public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
* ASoC: cs4271: init/timing problem
@ 2015-03-31  8:50 Pascal Huerst
  2015-03-31 21:01 ` Brian Austin
  0 siblings, 1 reply; 8+ messages in thread
From: Pascal Huerst @ 2015-03-31  8:50 UTC (permalink / raw)
  To: brian.austin; +Cc: alsa-devel, Mark Brown, Paul.Handrigan

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:

const int retries = 5;

while (retries) {
	ret = regmap_update_bits(cs4271->regmap, CS4271_MODE2,
                                 CS4271_MODE2_PDN | CS4271_MODE2_CPEN,
                                 CS4271_MODE2_PDN | CS4271_MODE2_CPEN);

        if (ret == -EREMOTEIO) {
                retries--;
                udelay(1);
                continue;

        } else if (ret)
                return ret;

        break;
}

But I might also just add a proper delay before the first call to
regmap_update_bits(..)

So what is the proper way to handle this?

Thanks
Pascal

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-04-02  7:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-31  8:50 ASoC: cs4271: init/timing problem Pascal Huerst
2015-03-31 21:01 ` Brian Austin
2015-04-01  9:57   ` Pascal Huerst
2015-04-01 10:52     ` Pascal Huerst
2015-04-01 14:47       ` Austin, Brian
2015-04-01 15:37         ` Pascal Huerst
2015-04-01 17:08           ` Brian Austin
2015-04-02  7:56             ` Pascal Huerst

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox