lkml.org 
[lkml]   [2020]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 2/2] ASoC: tas2562: Update shutdown GPIO property
Date
Update the shutdown GPIO property to be shutdown from shut-down.

Fixes: c173dba44c2d2 ("ASoC: tas2562: Introduce the TAS2562 amplifier")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---

v2 - Set sdz_gpio to NULL if gpio property not present.

sound/soc/codecs/tas2562.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/tas2562.c b/sound/soc/codecs/tas2562.c
index e74628061040..8a53633a3853 100644
--- a/sound/soc/codecs/tas2562.c
+++ b/sound/soc/codecs/tas2562.c
@@ -680,12 +680,25 @@ static int tas2562_parse_dt(struct tas2562_data *tas2562)
struct device *dev = tas2562->dev;
int ret = 0;

- tas2562->sdz_gpio = devm_gpiod_get_optional(dev, "shut-down",
- GPIOD_OUT_HIGH);
+ tas2562->sdz_gpio = devm_gpiod_get_optional(dev, "shutdown",
+ GPIOD_OUT_HIGH);
if (IS_ERR(tas2562->sdz_gpio)) {
- if (PTR_ERR(tas2562->sdz_gpio) == -EPROBE_DEFER) {
- tas2562->sdz_gpio = NULL;
+ tas2562->sdz_gpio = NULL;
+ if (PTR_ERR(tas2562->sdz_gpio) == -EPROBE_DEFER)
return -EPROBE_DEFER;
+ }
+
+ /*
+ * The shut-down property is deprecated but needs to be checked for
+ * backwards compatibility.
+ */
+ if (tas2562->sdz_gpio == NULL) {
+ tas2562->sdz_gpio = devm_gpiod_get_optional(dev, "shut-down",
+ GPIOD_OUT_HIGH);
+ if (IS_ERR(tas2562->sdz_gpio)) {
+ tas2562->sdz_gpio = NULL;
+ if (PTR_ERR(tas2562->sdz_gpio) == -EPROBE_DEFER)
+ return -EPROBE_DEFER;
}
}

--
2.27.0
\
 
 \ /
  Last update: 2020-07-22 17:49    [W:0.076 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site