Commit 5d7e0b15 authored by Mark Brown's avatar Mark Brown

ASoC: dmic: Allow GPIO operations to sleep

If there is a power GPIO provided we control it from DAPM context so there
is no problem with a sleeping GPIO, use the _cansleep() version of the API
to allow this.
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Reviewed-by: default avatarTzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200422083550.50711-1-broonie@kernel.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 4aa86e05
...@@ -59,14 +59,14 @@ static int dmic_aif_event(struct snd_soc_dapm_widget *w, ...@@ -59,14 +59,14 @@ static int dmic_aif_event(struct snd_soc_dapm_widget *w,
switch (event) { switch (event) {
case SND_SOC_DAPM_POST_PMU: case SND_SOC_DAPM_POST_PMU:
if (dmic->gpio_en) if (dmic->gpio_en)
gpiod_set_value(dmic->gpio_en, 1); gpiod_set_value_cansleep(dmic->gpio_en, 1);
if (dmic->wakeup_delay) if (dmic->wakeup_delay)
msleep(dmic->wakeup_delay); msleep(dmic->wakeup_delay);
break; break;
case SND_SOC_DAPM_POST_PMD: case SND_SOC_DAPM_POST_PMD:
if (dmic->gpio_en) if (dmic->gpio_en)
gpiod_set_value(dmic->gpio_en, 0); gpiod_set_value_cansleep(dmic->gpio_en, 0);
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment