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: Mark Brown <broonie@kernel.org>
Reviewed-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200422083550.50711-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Mark Brown 2020-04-22 09:35:50 +01:00
parent 4aa86e05be
commit 5d7e0b1516
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -59,14 +59,14 @@ static int dmic_aif_event(struct snd_soc_dapm_widget *w,
switch (event) {
case SND_SOC_DAPM_POST_PMU:
if (dmic->gpio_en)
gpiod_set_value(dmic->gpio_en, 1);
gpiod_set_value_cansleep(dmic->gpio_en, 1);
if (dmic->wakeup_delay)
msleep(dmic->wakeup_delay);
break;
case SND_SOC_DAPM_POST_PMD:
if (dmic->gpio_en)
gpiod_set_value(dmic->gpio_en, 0);
gpiod_set_value_cansleep(dmic->gpio_en, 0);
break;
}