Skip to content

Commit f78a970

Browse files
Dan Murphybroonie
authored andcommitted
ASoC: tas2562: Update shutdown GPIO property
Update the shutdown GPIO property to be shutdown from shut-down. Fixes: c173dba ("ASoC: tas2562: Introduce the TAS2562 amplifier") Signed-off-by: Dan Murphy <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 92e67a9 commit f78a970

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

sound/soc/codecs/tas2562.c

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -680,13 +680,26 @@ static int tas2562_parse_dt(struct tas2562_data *tas2562)
680680
struct device *dev = tas2562->dev;
681681
int ret = 0;
682682

683-
tas2562->sdz_gpio = devm_gpiod_get_optional(dev, "shut-down",
684-
GPIOD_OUT_HIGH);
683+
tas2562->sdz_gpio = devm_gpiod_get_optional(dev, "shutdown", GPIOD_OUT_HIGH);
685684
if (IS_ERR(tas2562->sdz_gpio)) {
686-
if (PTR_ERR(tas2562->sdz_gpio) == -EPROBE_DEFER) {
687-
tas2562->sdz_gpio = NULL;
685+
if (PTR_ERR(tas2562->sdz_gpio) == -EPROBE_DEFER)
688686
return -EPROBE_DEFER;
689-
}
687+
688+
tas2562->sdz_gpio = NULL;
689+
}
690+
691+
/*
692+
* The shut-down property is deprecated but needs to be checked for
693+
* backwards compatibility.
694+
*/
695+
if (tas2562->sdz_gpio == NULL) {
696+
tas2562->sdz_gpio = devm_gpiod_get_optional(dev, "shut-down",
697+
GPIOD_OUT_HIGH);
698+
if (IS_ERR(tas2562->sdz_gpio))
699+
if (PTR_ERR(tas2562->sdz_gpio) == -EPROBE_DEFER)
700+
return -EPROBE_DEFER;
701+
702+
tas2562->sdz_gpio = NULL;
690703
}
691704

692705
ret = fwnode_property_read_u32(dev->fwnode, "ti,imon-slot-no",

0 commit comments

Comments
 (0)