All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Bard Liao <bardliao@realtek.com>
To: Mark Brown <broonie@kernel.org>, Nicolas Boichat <drinkcat@chromium.org>
Cc: Oder Chiou <oder_chiou@realtek.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	Takashi Iwai <tiwai@suse.de>,
	"koro.chen@mediatek.com" <koro.chen@mediatek.com>,
	Liam Girdwood <lgirdwood@gmail.com>
Subject: Re: [PATCH v2 1/3] ASoC: rt5645: Simplify rt5645_enable_push_button_irq
Date: Wed, 15 Jul 2015 13:03:14 +0000	[thread overview]
Message-ID: <ABFD875FF5FB574BA706497D987D48D70108ADD8@RTITMBSV03.realtek.com.tw> (raw)
In-Reply-To: <20150715115644.GQ11162@sirena.org.uk>

> -----Original Message-----
> From: Mark Brown [mailto:broonie@kernel.org]
> Sent: Wednesday, July 15, 2015 7:57 PM
> To: Nicolas Boichat
> Cc: Bard Liao; Oder Chiou; Liam Girdwood; Jaroslav Kysela; Takashi Iwai;
> alsa-devel@alsa-project.org; koro.chen@mediatek.com
> Subject: Re: [PATCH v2 1/3] ASoC: rt5645: Simplify
> rt5645_enable_push_button_irq
> 
> On Wed, Jul 15, 2015 at 07:50:50PM +0800, Nicolas Boichat wrote:
> 
> > > Thanks for the review. I think what we need is something like
> > > +               snd_soc_dapm_force_enable_pin(dapm, "ADC L
> power");
> > > +               snd_soc_dapm_force_enable_pin(dapm, "ADC R
> power");
> > > +               snd_soc_dapm_sync(dapm);
> > > +               if (!codec->component.card->instantiated) {
> > > +                       regmap_update_bits(rt5645->regmap,
> RT5645_PWR_DIG1,
> > > +                               RT5645_PWR_ADC_L_BIT |
> RT5645_PWR_ADC_R_BIT,
> > > +                               RT5645_PWR_ADC_L_BIT |
> RT5645_PWR_ADC_R_BIT);
> > > +               }
> 
> > Just to make sure I understand... With the code above, the dapm state
> > is consistent. However, DAPM will only set the regmap bits when the
> > card is instantiated. So why do we still need to update the regmap? To
> > make sure we do not miss an early jack/button event? Or would we still
> > get jack irq if the pins are enabled a little later? (I guess we can
> > live with missing a button event at that stage, but we need the jack
> > state to be correct)
> 
> I'm assuming it's something to do with early detection, I don't really know
> though.
> 

I think the problem is dapm won't update the bits if card is not
instantiated. And those bits are necessary for the jack or button
detect functions. Without these bits, we may not get irq properly.
That's why we need to update those bits manually.

> 
> ------Please consider the environment before printing this e-mail.

  reply	other threads:[~2015-07-15 13:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-14  6:51 [PATCH v2 0/3] ASoC: rt5645: Remove codec dependency in workqueue handler Nicolas Boichat
2015-07-14  6:51 ` [PATCH v2 1/3] ASoC: rt5645: Simplify rt5645_enable_push_button_irq Nicolas Boichat
2015-07-14  9:48   ` Bard Liao
2015-07-14  9:52   ` Mark Brown
2015-07-14 10:09     ` Bard Liao
2015-07-14 10:28       ` Mark Brown
2015-07-15  1:05         ` Nicolas Boichat
2015-07-15  8:50           ` Mark Brown
2015-07-15 11:50       ` Nicolas Boichat
2015-07-15 11:56         ` Mark Brown
2015-07-15 13:03           ` Bard Liao [this message]
2015-07-16  3:05             ` Nicolas Boichat
2015-07-14  6:51 ` [PATCH v2 2/3] ASoC: rt5645: Remove irq_jack_detection function Nicolas Boichat
2015-07-15 11:55   ` Applied "ASoC: rt5645: Remove irq_jack_detection function" to the asoc tree Mark Brown
2015-07-14  6:51 ` [PATCH v2 3/3] ASoC: rt5645: Remove codec dependency in workqueue handler Nicolas Boichat

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=ABFD875FF5FB574BA706497D987D48D70108ADD8@RTITMBSV03.realtek.com.tw \
    --to=bardliao@realtek.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=drinkcat@chromium.org \
    --cc=koro.chen@mediatek.com \
    --cc=lgirdwood@gmail.com \
    --cc=oder_chiou@realtek.com \
    --cc=tiwai@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.