diff options
author | Anatol Pomozov <anatol.pomozov@gmail.com> | 2015-07-12 11:14:19 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-07-13 14:13:03 -0400 |
commit | 5119222f2e3de2e51a3b3270036d53c55ce68236 (patch) | |
tree | c193578d24baab9e475e6dd7d8058868731b2d42 /sound/soc/codecs/max98357a.c | |
parent | d770e558e21961ad6cfdf0ff7df0eb5d7d4f0754 (diff) |
ASoC: max98357a: Make 'sdmode-gpios' dts property optional
The option is not needed if chip is always on or managed by some other part
of system like platform card driver.
Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/max98357a.c')
-rw-r--r-- | sound/soc/codecs/max98357a.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/soc/codecs/max98357a.c b/sound/soc/codecs/max98357a.c index 3a2fda08a893..fa1b79302bb3 100644 --- a/sound/soc/codecs/max98357a.c +++ b/sound/soc/codecs/max98357a.c | |||
@@ -31,6 +31,9 @@ static int max98357a_daiops_trigger(struct snd_pcm_substream *substream, | |||
31 | { | 31 | { |
32 | struct gpio_desc *sdmode = snd_soc_dai_get_drvdata(dai); | 32 | struct gpio_desc *sdmode = snd_soc_dai_get_drvdata(dai); |
33 | 33 | ||
34 | if (!sdmode) | ||
35 | return 0; | ||
36 | |||
34 | switch (cmd) { | 37 | switch (cmd) { |
35 | case SNDRV_PCM_TRIGGER_START: | 38 | case SNDRV_PCM_TRIGGER_START: |
36 | case SNDRV_PCM_TRIGGER_RESUME: | 39 | case SNDRV_PCM_TRIGGER_RESUME: |
@@ -60,7 +63,7 @@ static int max98357a_codec_probe(struct snd_soc_codec *codec) | |||
60 | { | 63 | { |
61 | struct gpio_desc *sdmode; | 64 | struct gpio_desc *sdmode; |
62 | 65 | ||
63 | sdmode = devm_gpiod_get(codec->dev, "sdmode", GPIOD_OUT_LOW); | 66 | sdmode = devm_gpiod_get_optional(codec->dev, "sdmode", GPIOD_OUT_LOW); |
64 | if (IS_ERR(sdmode)) { | 67 | if (IS_ERR(sdmode)) { |
65 | dev_err(codec->dev, "%s() unable to get sdmode GPIO: %ld\n", | 68 | dev_err(codec->dev, "%s() unable to get sdmode GPIO: %ld\n", |
66 | __func__, PTR_ERR(sdmode)); | 69 | __func__, PTR_ERR(sdmode)); |