diff options
author | Linux Build Service Account <lnxbuild@quicinc.com> | 2017-06-19 07:54:17 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-06-19 07:54:17 -0700 |
commit | c9ada11e43d71f256c6ba6981e050ab84afb6c8e (patch) | |
tree | 9e9de0541d42927ea9330a0d295f3b177f004a09 | |
parent | 3b61e3236868b9fd9bb6a3ad21dcf76fd56826a8 (diff) | |
parent | c848d4ca45ff58fcc406afc9f95be02b054c520d (diff) |
Merge "ASoC: wsa881x: Fix GPIO leak issue"
-rw-r--r-- | sound/soc/codecs/wsa881x.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c index 0af656ce48f0..fe975a7dbe4e 100644 --- a/sound/soc/codecs/wsa881x.c +++ b/sound/soc/codecs/wsa881x.c @@ -1185,6 +1185,7 @@ static int wsa881x_swr_probe(struct swr_device *pdev) int ret = 0; struct wsa881x_priv *wsa881x; u8 devnum = 0; + bool pin_state_current = false; wsa881x = devm_kzalloc(&pdev->dev, sizeof(struct wsa881x_priv), GFP_KERNEL); @@ -1218,6 +1219,9 @@ static int wsa881x_swr_probe(struct swr_device *pdev) if (ret) goto err; } + if (wsa881x->wsa_rst_np) + pin_state_current = msm_cdc_pinctrl_get_state( + wsa881x->wsa_rst_np); wsa881x_gpio_ctrl(wsa881x, true); wsa881x->state = WSA881X_DEV_UP; @@ -1280,6 +1284,8 @@ static int wsa881x_swr_probe(struct swr_device *pdev) return 0; dev_err: + if (pin_state_current == false) + wsa881x_gpio_ctrl(wsa881x, false); swr_remove_device(pdev); err: return ret; |