Input: wm9713 - support five wire panels

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

authored by Mark Brown and committed by Dmitry Torokhov 43f83a8f 5de4cd43

+23
+22
drivers/input/touchscreen/wm9713.c
··· 85 85 MODULE_PARM_DESC(delay, "Set adc sample delay."); 86 86 87 87 /* 88 + * Set five_wire = 1 to use a 5 wire touchscreen. 89 + * 90 + * NOTE: Five wire mode does not allow for readback of pressure. 91 + */ 92 + static int five_wire; 93 + module_param(five_wire, int, 0); 94 + MODULE_PARM_DESC(five_wire, "Set to '1' to use 5-wire touchscreen."); 95 + 96 + /* 88 97 * Set adc mask function. 89 98 * 90 99 * Sources of glitch noise, such as signals driving an LCD display, may feed ··· 169 160 dig3 |= WM9712_RPU(rpu); 170 161 dev_info(wm->dev, "setting pen detect pull-up to %d Ohms\n", 171 162 64000 / rpu); 163 + } 164 + 165 + /* Five wire panel? */ 166 + if (five_wire) { 167 + dig3 |= WM9713_45W; 168 + dev_info(wm->dev, "setting 5-wire touchscreen mode."); 169 + 170 + if (pil) { 171 + dev_warn(wm->dev, 172 + "Pressure measurement not supported in 5 " 173 + "wire mode, disabling\n"); 174 + pil = 0; 175 + } 172 176 } 173 177 174 178 /* touchpanel pressure */
+1
include/linux/wm97xx.h
··· 100 100 #define WM9713_ADCSEL_Y 0x0004 /* Y measurement */ 101 101 #define WM9713_ADCSEL_PRES 0x0008 /* Pressure measurement */ 102 102 #define WM9713_COO 0x0001 /* enable coordinate mode */ 103 + #define WM9713_45W 0x1000 /* set for 5 wire panel */ 103 104 #define WM9713_PDEN 0x0800 /* measure only when pen down */ 104 105 #define WM9713_ADCSEL_MASK 0x00fe /* ADC selection mask */ 105 106 #define WM9713_WAIT 0x0200 /* coordinate wait */