summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Murphy <dmurphy@ti.com>2020-07-23 11:08:38 -0500
committerMark Brown <broonie@kernel.org>2020-07-28 16:43:34 +0100
commitf78a97003b8babb1c49e2e4a6b46f15ac31ecf49 (patch)
treefa0760ea637d574b5f1dc2a58d5f86987d3a11f1
parent92e67a9c4f206dc9c859c405e67448a8be59ac5d (diff)
ASoC: tas2562: Update shutdown GPIO property
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> Link: https://lore.kernel.org/r/20200723160838.9738-2-dmurphy@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/tas2562.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/sound/soc/codecs/tas2562.c b/sound/soc/codecs/tas2562.c
index e74628061040..99920c691d28 100644
--- a/sound/soc/codecs/tas2562.c
+++ b/sound/soc/codecs/tas2562.c
@@ -680,13 +680,26 @@ 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;
+ if (PTR_ERR(tas2562->sdz_gpio) == -EPROBE_DEFER)
return -EPROBE_DEFER;
- }
+
+ tas2562->sdz_gpio = NULL;
+ }
+
+ /*
+ * 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))
+ if (PTR_ERR(tas2562->sdz_gpio) == -EPROBE_DEFER)
+ return -EPROBE_DEFER;
+
+ tas2562->sdz_gpio = NULL;
}
ret = fwnode_property_read_u32(dev->fwnode, "ti,imon-slot-no",