Commit ec5dba73 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Mark Brown

ASoC: codecs: wsa883x: Use proper shutdown GPIO polarity

The shutdown GPIO is active low (SD_N), but this depends on actual board
layout.  Linux drivers should only care about logical state, where high
(1) means shutdown and low (0) means do not shutdown.

Invert the GPIO to match logical value.

Fixes: 43b8c7dc ("ASoC: codecs: add wsa883x amplifier support")
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221110133512.478831-2-krzysztof.kozlowski@linaro.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 817e9817
...@@ -1392,7 +1392,7 @@ static int wsa883x_probe(struct sdw_slave *pdev, ...@@ -1392,7 +1392,7 @@ static int wsa883x_probe(struct sdw_slave *pdev,
} }
wsa883x->sd_n = devm_gpiod_get_optional(&pdev->dev, "powerdown", wsa883x->sd_n = devm_gpiod_get_optional(&pdev->dev, "powerdown",
GPIOD_FLAGS_BIT_NONEXCLUSIVE); GPIOD_FLAGS_BIT_NONEXCLUSIVE | GPIOD_OUT_HIGH);
if (IS_ERR(wsa883x->sd_n)) { if (IS_ERR(wsa883x->sd_n)) {
dev_err(&pdev->dev, "Shutdown Control GPIO not found\n"); dev_err(&pdev->dev, "Shutdown Control GPIO not found\n");
ret = PTR_ERR(wsa883x->sd_n); ret = PTR_ERR(wsa883x->sd_n);
...@@ -1411,7 +1411,7 @@ static int wsa883x_probe(struct sdw_slave *pdev, ...@@ -1411,7 +1411,7 @@ static int wsa883x_probe(struct sdw_slave *pdev,
pdev->prop.simple_clk_stop_capable = true; pdev->prop.simple_clk_stop_capable = true;
pdev->prop.sink_dpn_prop = wsa_sink_dpn_prop; pdev->prop.sink_dpn_prop = wsa_sink_dpn_prop;
pdev->prop.scp_int1_mask = SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY; pdev->prop.scp_int1_mask = SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY;
gpiod_direction_output(wsa883x->sd_n, 1); gpiod_direction_output(wsa883x->sd_n, 0);
wsa883x->regmap = devm_regmap_init_sdw(pdev, &wsa883x_regmap_config); wsa883x->regmap = devm_regmap_init_sdw(pdev, &wsa883x_regmap_config);
if (IS_ERR(wsa883x->regmap)) { if (IS_ERR(wsa883x->regmap)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment