[PATCH RFC 2/3] input: wm97xx: set GPIOs with AC97 GPIO busops if implemented

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

 



If the AC97 controller implements the ->setgpio callback, use it.
Some codecs (i.e. WM9712) only accept GPIO data through AC97 slot 12.

Signed-off-by: Manuel Lauss <manuel.lauss@xxxxxxxxxxxxxx>
---
 drivers/input/touchscreen/wm97xx-core.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c
index cbfef1e..4f7b38c 100644
--- a/drivers/input/touchscreen/wm97xx-core.c
+++ b/drivers/input/touchscreen/wm97xx-core.c
@@ -206,7 +206,10 @@ void wm97xx_set_gpio(struct wm97xx *wm, u32 gpio,
 		reg &= ~gpio;
 
 	if (wm->id == WM9712_ID2 && wm->variant != WM97xx_WM1613)
-		wm97xx_reg_write(wm, AC97_GPIO_STATUS, reg << 1);
+		reg <<= 1;
+
+	if (wm->ac97->bus->ops->setgpio)
+		wm->ac97->bus->ops->setgpio(wm->ac97, reg);
 	else
 		wm97xx_reg_write(wm, AC97_GPIO_STATUS, reg);
 	mutex_unlock(&wm->codec_mutex);
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux