[alsa-devel] [PATCH v2 1/3] ASoC: rt5645: Simplify rt5645_enable_push_button_irq

Mark Brown broonie at kernel.org
Wed Jul 15 10:50:12 CEST 2015


On Wed, Jul 15, 2015 at 09:05:30AM +0800, Nicolas Boichat wrote:
> On Tue, Jul 14, 2015 at 6:28 PM, Mark Brown <broonie at kernel.org> wrote:

> if (dapm)
> 	snd_soc_dapm_force_enable_pin(dapm, ...)
> else
> 	regmap_update_bits(...)

> If guess something like this might be preferable:
> if (rt5645->codec) {
> 	dapm = snd_soc_codec_get_dapm(rt5645->codec);
> }

> and then:

> if (dapm)
> 	snd_soc_dapm_force_enable_pin(dapm, ...)

> regmap_update_bits(...)

> Does that make sense?

No, that still has the problem that you don't handle the !dapm case
properly since as soon as DAPM kicks in it'll power everything off.

> Is there a better way to communicate my intent in this series? Maybe
> patch 1/3 should convert everyhing to this pattern:
> snd_soc_dapm_force_enable_pin(dapm, ...)
> regmap_update_bits(...)

Your intent is clear, the problem is that the code doesn't actually do
what it's supposed to do - see previous e-mail.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20150715/c04d382c/attachment.sig>


More information about the Alsa-devel mailing list