Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: wm97xx - add possibility to control the GPIO_STATUS shift

This patch allows tweaking the behaviour of GPIO_STATUS register
shift quirk that's in wm97xx-core. The problem with GPIO_STATUS
register being shifted by one doesn't appear on all hardware it
seems and causes problems with accelerated touchscreen drivers on
Palm hardware. Therefore an accelerated touchscreen driver can select
if the shift is/isn't happening on the hardware.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

authored by

Marek Vasut and committed by
Dmitry Torokhov
99fde513 b833306f

+14 -2
+3
drivers/input/touchscreen/mainstone-wm97xx.c
··· 198 198 if (machine_is_palmt5() || machine_is_palmtx() || machine_is_palmld()) { 199 199 pen_int = 1; 200 200 irq = 27; 201 + /* There is some obscure mutant of WM9712 interbred with WM9713 202 + * used on Palm HW */ 203 + wm->variant = WM97xx_WM1613; 201 204 } else if (machine_is_mainstone() && pen_int) 202 205 irq = 4; 203 206
+4 -2
drivers/input/touchscreen/wm97xx-core.c
··· 204 204 else 205 205 reg &= ~gpio; 206 206 207 - if (wm->id == WM9712_ID2) 207 + if (wm->id == WM9712_ID2 && wm->variant != WM97xx_WM1613) 208 208 wm97xx_reg_write(wm, AC97_GPIO_STATUS, reg << 1); 209 209 else 210 210 wm97xx_reg_write(wm, AC97_GPIO_STATUS, reg); ··· 307 307 WM97XX_GPIO_13); 308 308 } 309 309 310 - if (wm->id == WM9712_ID2) 310 + if (wm->id == WM9712_ID2 && wm->variant != WM97xx_WM1613) 311 311 wm97xx_reg_write(wm, AC97_GPIO_STATUS, (status & 312 312 ~WM97XX_GPIO_13) << 1); 313 313 else ··· 581 581 } 582 582 583 583 wm->id = wm97xx_reg_read(wm, AC97_VENDOR_ID2); 584 + 585 + wm->variant = WM97xx_GENERIC; 584 586 585 587 dev_info(wm->dev, "detected a wm97%02x codec\n", wm->id & 0xff); 586 588
+7
include/linux/wm97xx.h
··· 16 16 #include <linux/platform_device.h> 17 17 18 18 /* 19 + * WM97xx variants 20 + */ 21 + #define WM97xx_GENERIC 0x0000 22 + #define WM97xx_WM1613 0x1613 23 + 24 + /* 19 25 * WM97xx AC97 Touchscreen registers 20 26 */ 21 27 #define AC97_WM97XX_DIGITISER1 0x76 ··· 289 283 unsigned pen_is_down:1; /* Pen is down */ 290 284 unsigned aux_waiting:1; /* aux measurement waiting */ 291 285 unsigned pen_probably_down:1; /* used in polling mode */ 286 + u16 variant; /* WM97xx chip variant */ 292 287 u16 suspend_mode; /* PRP in suspend mode */ 293 288 }; 294 289