Question about pinctrl_pm_select_xxx()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux