Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fff00cbc authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: wm0010: Allow slow GPIO for reset



We never set the GPIO from atomic context so there's no reason why we
can't support a GPIO that needs to sleep when configuring.

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 76dbd2af
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -168,7 +168,8 @@ static void wm0010_halt(struct snd_soc_codec *codec)
	case WM0010_STAGE2:
	case WM0010_STAGE2:
	case WM0010_FIRMWARE:
	case WM0010_FIRMWARE:
		/* Remember to put chip back into reset */
		/* Remember to put chip back into reset */
		gpio_set_value(wm0010->gpio_reset, wm0010->gpio_reset_value);
		gpio_set_value_cansleep(wm0010->gpio_reset,
					wm0010->gpio_reset_value);
		/* Disable the regulators */
		/* Disable the regulators */
		regulator_disable(wm0010->dbvdd);
		regulator_disable(wm0010->dbvdd);
		regulator_bulk_disable(ARRAY_SIZE(wm0010->core_supplies),
		regulator_bulk_disable(ARRAY_SIZE(wm0010->core_supplies),
@@ -387,7 +388,7 @@ static int wm0010_boot(struct snd_soc_codec *codec)
	}
	}


	/* Release reset */
	/* Release reset */
	gpio_set_value(wm0010->gpio_reset, !wm0010->gpio_reset_value);
	gpio_set_value_cansleep(wm0010->gpio_reset, !wm0010->gpio_reset_value);
	spin_lock_irqsave(&wm0010->irq_lock, flags);
	spin_lock_irqsave(&wm0010->irq_lock, flags);
	wm0010->state = WM0010_OUT_OF_RESET;
	wm0010->state = WM0010_OUT_OF_RESET;
	spin_unlock_irqrestore(&wm0010->irq_lock, flags);
	spin_unlock_irqrestore(&wm0010->irq_lock, flags);
@@ -918,7 +919,8 @@ static int __devexit wm0010_spi_remove(struct spi_device *spi)


	if (wm0010->gpio_reset) {
	if (wm0010->gpio_reset) {
		/* Remember to put chip back into reset */
		/* Remember to put chip back into reset */
		gpio_set_value(wm0010->gpio_reset, wm0010->gpio_reset_value);
		gpio_set_value_cansleep(wm0010->gpio_reset,
					wm0010->gpio_reset_value);
	}
	}


	if (wm0010->irq)
	if (wm0010->irq)