From: Pascal Huerst <pascal.huerst@gmail.com>
To: Brian Austin <brian.austin@cirrus.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
"Handrigan, Paul" <Paul.Handrigan@cirrus.com>
Subject: Re: ASoC: cs4271: init/timing problem
Date: Thu, 02 Apr 2015 09:56:48 +0200 [thread overview]
Message-ID: <551CF640.5010203@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1504011206320.13828@heelrod-desktop>
On 01.04.2015 19:08, Brian Austin wrote:
>>>> 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.
>>> Are there any other devices on the I2C bus? Lets take this off the ALSA list until there
>>> is a determination that it is an ASoC issue which it does not appear to be right now.
>>
>> Well I think it is. There is a delay needed in sound/soc/codec/cs4271.c
>> at line 569, in certain cases, because the call to regmap_update_bits on
>> line 570 fails sometimes. If I add a delay of a few us on line 569, the
>> call never fails.
>>
>> But let me just send in a patch so we really know what we are talking
>> about, then.
>>
> can you try something like this?
>
> gpio_direction_output(cs4271->gpio_nreset, 0);
> -udelay(1);
> gpio_set_value(cs4271->gpio_nreset, 1);
> /* Give the codec time to wake up */
> -udelay(1);
>
> gpio_direction_output(cs4271->gpio_nreset, 0);
> +mdelay(1);
> gpio_set_value(cs4271->gpio_nreset, 1);
> /* Give the codec time to wake up */
> +mdelay(1);
>
> See if that helps instead of adding another delay.
Works perfect for me. Tested on different devices without any problems.
If you agree on that, I'll send in a patch.
prev parent reply other threads:[~2015-04-02 7:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=551CF640.5010203@gmail.com \
--to=pascal.huerst@gmail.com \
--cc=Paul.Handrigan@cirrus.com \
--cc=alsa-devel@alsa-project.org \
--cc=brian.austin@cirrus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox