[PATCH 1/2] ASoC: codecs: wsa883x: Shutdown on error path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If probe fails, toggle shutdown via GPIO to save power and reverse
probe actions.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
---
 sound/soc/codecs/wsa883x.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/wsa883x.c b/sound/soc/codecs/wsa883x.c
index 77a7dd3cf495..4ad8b875eb8f 100644
--- a/sound/soc/codecs/wsa883x.c
+++ b/sound/soc/codecs/wsa883x.c
@@ -1415,6 +1415,7 @@ static int wsa883x_probe(struct sdw_slave *pdev,
 
 	wsa883x->regmap = devm_regmap_init_sdw(pdev, &wsa883x_regmap_config);
 	if (IS_ERR(wsa883x->regmap)) {
+		gpiod_direction_output(wsa883x->sd_n, 1);
 		dev_err(&pdev->dev, "regmap_init failed\n");
 		ret = PTR_ERR(wsa883x->regmap);
 		goto err;
-- 
2.34.1




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux