diff options
author | Mylène Josserand <mylene.josserand@bootlin.com> | 2019-03-18 11:39:38 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-03-18 11:18:47 +0000 |
commit | 2944d29d7c89573f9aa47083d105ff0243d5a125 (patch) | |
tree | a1b9b19278b042cd4d6174cfc8379853fbfe469f /sound/soc/codecs/simple-amplifier.c | |
parent | c4bce31c4982ddb866b6b6d0f7ca1cf039a3aded (diff) | |
download | linux-stable-2944d29d7c89573f9aa47083d105ff0243d5a125.tar.gz linux-stable-2944d29d7c89573f9aa47083d105ff0243d5a125.tar.bz2 linux-stable-2944d29d7c89573f9aa47083d105ff0243d5a125.zip |
ASoC: simple-amplifier: Make gpio property optional
Some amplifier may not have a GPIO to control the power, but instead simply
rely on the regulator to power up and down the amplifier.
In order to support those setups, let's make the GPIO optional.
Signed-off-by: Mylène Josserand <mylene.josserand@bootlin.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/simple-amplifier.c')
-rw-r--r-- | sound/soc/codecs/simple-amplifier.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/codecs/simple-amplifier.c b/sound/soc/codecs/simple-amplifier.c index c07e8a80b4b7..351aa55c384e 100644 --- a/sound/soc/codecs/simple-amplifier.c +++ b/sound/soc/codecs/simple-amplifier.c @@ -89,7 +89,8 @@ static int simple_amp_probe(struct platform_device *pdev) return -ENOMEM; platform_set_drvdata(pdev, priv); - priv->gpiod_enable = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW); + priv->gpiod_enable = devm_gpiod_get_optional(dev, "enable", + GPIOD_OUT_LOW); if (IS_ERR(priv->gpiod_enable)) { err = PTR_ERR(priv->gpiod_enable); if (err != -EPROBE_DEFER) |