Title: [7705] trunk/sound/soc/codecs/ssm2602.c: add workaround for I2C spec mis-match problem
- Revision
- 7705
- Author
- cliff
- Date
- 2009-10-26 03:18:10 -0400 (Mon, 26 Oct 2009)
Log Message
add workaround for I2C spec mis-match problem
Modified Paths
Diff
Modified: trunk/sound/soc/codecs/ssm2602.c (7704 => 7705)
--- trunk/sound/soc/codecs/ssm2602.c 2009-10-22 11:26:05 UTC (rev 7704)
+++ trunk/sound/soc/codecs/ssm2602.c 2009-10-26 07:18:10 UTC (rev 7705)
@@ -98,6 +98,7 @@
unsigned int value)
{
u8 data[2];
+ u8 count = 0;
/* data is
* D15..D9 ssm2602 register offset
@@ -107,10 +108,14 @@
data[1] = value & 0x00ff;
ssm2602_write_reg_cache(codec, reg, value);
- if (codec->hw_write(codec->control_data, data, 2) == 2)
+ /* If failed, retry it up to 100 times */
+ for (count = 0; count < 100; count++)
+ if (codec->hw_write(codec->control_data, data, 2) == 2)
+ break;
+ if (count == 100)
+ return -EIO;
+ else
return 0;
- else
- return -EIO;
}
#define ssm2602_reset(c) ssm2602_write(c, SSM2602_RESET, 0)
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits