diff options
-rw-r--r-- | drivers/input/touchscreen/mainstone-wm97xx.c | 3 | ||||
-rw-r--r-- | drivers/input/touchscreen/wm97xx-core.c | 6 | ||||
-rw-r--r-- | include/linux/wm97xx.h | 7 |
3 files changed, 14 insertions, 2 deletions
diff --git a/drivers/input/touchscreen/mainstone-wm97xx.c b/drivers/input/touchscreen/mainstone-wm97xx.c index c797bc04ee83..8fc3b08deb3b 100644 --- a/drivers/input/touchscreen/mainstone-wm97xx.c +++ b/drivers/input/touchscreen/mainstone-wm97xx.c | |||
@@ -198,6 +198,9 @@ static int wm97xx_acc_startup(struct wm97xx *wm) | |||
198 | if (machine_is_palmt5() || machine_is_palmtx() || machine_is_palmld()) { | 198 | if (machine_is_palmt5() || machine_is_palmtx() || machine_is_palmld()) { |
199 | pen_int = 1; | 199 | pen_int = 1; |
200 | irq = 27; | 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 | } else if (machine_is_mainstone() && pen_int) | 204 | } else if (machine_is_mainstone() && pen_int) |
202 | irq = 4; | 205 | irq = 4; |
203 | 206 | ||
diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c index 2957d48e0045..252eb11fe9db 100644 --- a/drivers/input/touchscreen/wm97xx-core.c +++ b/drivers/input/touchscreen/wm97xx-core.c | |||
@@ -204,7 +204,7 @@ void wm97xx_set_gpio(struct wm97xx *wm, u32 gpio, | |||
204 | else | 204 | else |
205 | reg &= ~gpio; | 205 | reg &= ~gpio; |
206 | 206 | ||
207 | if (wm->id == WM9712_ID2) | 207 | if (wm->id == WM9712_ID2 && wm->variant != WM97xx_WM1613) |
208 | wm97xx_reg_write(wm, AC97_GPIO_STATUS, reg << 1); | 208 | wm97xx_reg_write(wm, AC97_GPIO_STATUS, reg << 1); |
209 | else | 209 | else |
210 | wm97xx_reg_write(wm, AC97_GPIO_STATUS, reg); | 210 | wm97xx_reg_write(wm, AC97_GPIO_STATUS, reg); |
@@ -307,7 +307,7 @@ static void wm97xx_pen_irq_worker(struct work_struct *work) | |||
307 | WM97XX_GPIO_13); | 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 | wm97xx_reg_write(wm, AC97_GPIO_STATUS, (status & | 311 | wm97xx_reg_write(wm, AC97_GPIO_STATUS, (status & |
312 | ~WM97XX_GPIO_13) << 1); | 312 | ~WM97XX_GPIO_13) << 1); |
313 | else | 313 | else |
@@ -582,6 +582,8 @@ static int wm97xx_probe(struct device *dev) | |||
582 | 582 | ||
583 | wm->id = wm97xx_reg_read(wm, AC97_VENDOR_ID2); | 583 | wm->id = wm97xx_reg_read(wm, AC97_VENDOR_ID2); |
584 | 584 | ||
585 | wm->variant = WM97xx_GENERIC; | ||
586 | |||
585 | dev_info(wm->dev, "detected a wm97%02x codec\n", wm->id & 0xff); | 587 | dev_info(wm->dev, "detected a wm97%02x codec\n", wm->id & 0xff); |
586 | 588 | ||
587 | switch (wm->id & 0xff) { | 589 | switch (wm->id & 0xff) { |
diff --git a/include/linux/wm97xx.h b/include/linux/wm97xx.h index 6f69968eab24..0c9878123d5f 100644 --- a/include/linux/wm97xx.h +++ b/include/linux/wm97xx.h | |||
@@ -16,6 +16,12 @@ | |||
16 | #include <linux/platform_device.h> | 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 | * WM97xx AC97 Touchscreen registers | 25 | * WM97xx AC97 Touchscreen registers |
20 | */ | 26 | */ |
21 | #define AC97_WM97XX_DIGITISER1 0x76 | 27 | #define AC97_WM97XX_DIGITISER1 0x76 |
@@ -283,6 +289,7 @@ struct wm97xx { | |||
283 | unsigned pen_is_down:1; /* Pen is down */ | 289 | unsigned pen_is_down:1; /* Pen is down */ |
284 | unsigned aux_waiting:1; /* aux measurement waiting */ | 290 | unsigned aux_waiting:1; /* aux measurement waiting */ |
285 | unsigned pen_probably_down:1; /* used in polling mode */ | 291 | unsigned pen_probably_down:1; /* used in polling mode */ |
292 | u16 variant; /* WM97xx chip variant */ | ||
286 | u16 suspend_mode; /* PRP in suspend mode */ | 293 | u16 suspend_mode; /* PRP in suspend mode */ |
287 | }; | 294 | }; |
288 | 295 | ||