[alsa-devel] ASoC: cs4271: init/timing problem

Pascal Huerst pascal.huerst at gmail.com
Wed Apr 1 12:52:49 CEST 2015


Hey Brian,

On 01.04.2015 11:57, Pascal Huerst wrote:
> Hey Brian,
> 
> On 31.03.2015 23:01, Brian Austin wrote:
>> On Tue, 31 Mar 2015, Pascal Huerst wrote:
>>
>>> Hey all,
>>>
>>> We have a custom built hw, based on am335x and from time to time we need
>>> to rmmod/modprobe the ASoC machine driver. Depending on the hw, the
>>> first call to regmap_update_bits(..) in cs4271_codec_probe(..) fails
>>> with -EREMOTEIO.
>>>
>>> The error is originated in:
>>>
>>> drivers/i2c/busses/i2c-omap.c
>>>
>>> and happens if no i2c package acknowledge is received by the host.
>>>
>>> I think this is a timing issue and on some devices, the codec is just
>>> not ready yet, for communication.
>>>
>>> What is the right way to fix that? My attempt would be something like this:
>>
>> The error you are referring to is a NACK from a device (CODEC). That is 
>> usually seen when you dont have it hooked up correctly. Could also be that 
>> the I2C bus is too fast. How fast are you running the bus?
> 
> clock-frequency is set to 100000, hence 100 kHz, which should be ok,
> according to the datasheet.

I just lowered the clock-frequency to 50 kHz and I face the same
problem, but it very much depends on the hardware. On some devices I
don't face the problem at all and on others I can reproduce it very
reliable. If I add a mdelay(20), or use the loop I postet earlier, the
issue is gone on all devices.


More information about the Alsa-devel mailing list