All of lore.kernel.org
 help / color / mirror / Atom feed
* Question about pinctrl_pm_select_xxx()
@ 2019-06-19  7:22 Kuninori Morimoto
  2019-06-19 11:43 ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Kuninori Morimoto @ 2019-06-19  7:22 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA


Hi ALSA ML

I noticed pinctrl_pm_select_xxx() unbalance.

I think these are paired function

	pinctrl_pm_select_default_state()
	pinctrl_pm_select_sleep_state()

I can find pinctrl_pm_select_sleep_state() for component at
snd_soc_suspend().

	int snd_soc_suspend(struct device *dev)
	{
		...
		if (!snd_soc_component_is_suspended(component)) {
			switch (snd_soc_dapm_get_bias_level(dapm)) {
			...
			case SND_SOC_BIAS_OFF:
				...
				/* deactivate pins to sleep state */
=>				pinctrl_pm_select_sleep_state(component->dev);
				break;
			}
			...
		}
		...
	}

But, I can't find its paired pinctrl_pm_select_default_state().
It looks strange for me. Is this really needed ??

And about pinctrl_pm_select_xxx() for CPU/Codec DAI,
Many places are calling pinctrl_pm_select_xxx() for both CPU/Codec.
snd_soc_suspend() cares only CPU only, but snd_soc_resume() cares both.
Is this bug ??

	int snd_soc_suspend(struct device *dev)
	{
		...
		for_each_card_rtds(card, rtd) {
			/* deactivate pins to sleep state */
=>			pinctrl_pm_select_sleep_state(cpu_dai->dev);
		}
		...
	}

	int snd_soc_resume(struct device *dev)
	{
		...
		for_each_card_rtds(card, rtd) {
			...
			if (cpu_dai->active)
=>				pinctrl_pm_select_default_state(cpu_dai->dev);

			for_each_rtd_codec_dai(rtd, i, codec_dai) {
				if (codec_dai->active)
=>					pinctrl_pm_select_default_state(codec_dai->dev);
			}
		}
		...
	}


Thank you for your help !!
Best regards
---
Kuninori Morimoto

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

end of thread, other threads:[~2019-06-21  1:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-19  7:22 Question about pinctrl_pm_select_xxx() Kuninori Morimoto
2019-06-19 11:43 ` Mark Brown
2019-06-20  0:35   ` Kuninori Morimoto
2019-06-20 11:54     ` Mark Brown
2019-06-20 23:55       ` Kuninori Morimoto
2019-06-21  1:15         ` Kuninori Morimoto
2019-06-21  1:38           ` Kuninori Morimoto

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.