aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/input/touchscreen/wm9713.c22
-rw-r--r--include/linux/wm97xx.h1
2 files changed, 23 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/wm9713.c b/drivers/input/touchscreen/wm9713.c
index 01278bd7e65c..838458792ea0 100644
--- a/drivers/input/touchscreen/wm9713.c
+++ b/drivers/input/touchscreen/wm9713.c
@@ -85,6 +85,15 @@ module_param(delay, int, 0);
85MODULE_PARM_DESC(delay, "Set adc sample delay."); 85MODULE_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 */
92static int five_wire;
93module_param(five_wire, int, 0);
94MODULE_PARM_DESC(five_wire, "Set to '1' to use 5-wire touchscreen.");
95
96/*
88 * Set adc mask function. 97 * Set adc mask function.
89 * 98 *
90 * Sources of glitch noise, such as signals driving an LCD display, may feed 99 * Sources of glitch noise, such as signals driving an LCD display, may feed
@@ -162,6 +171,19 @@ static void wm9713_phy_init(struct wm97xx *wm)
162 64000 / rpu); 171 64000 / rpu);
163 } 172 }
164 173
174 /* Five wire panel? */
175 if (five_wire) {
176 dig3 |= WM9713_45W;
177 dev_info(wm->dev, "setting 5-wire touchscreen mode.");
178
179 if (pil) {
180 dev_warn(wm->dev,
181 "Pressure measurement not supported in 5 "
182 "wire mode, disabling\n");
183 pil = 0;
184 }
185 }
186
165 /* touchpanel pressure */ 187 /* touchpanel pressure */
166 if (pil == 2) { 188 if (pil == 2) {
167 dig3 |= WM9712_PIL; 189 dig3 |= WM9712_PIL;
diff --git a/include/linux/wm97xx.h b/include/linux/wm97xx.h
index 4d13732e9cf0..6f69968eab24 100644
--- a/include/linux/wm97xx.h
+++ b/include/linux/wm97xx.h
@@ -100,6 +100,7 @@
100#define WM9713_ADCSEL_Y 0x0004 /* Y measurement */ 100#define WM9713_ADCSEL_Y 0x0004 /* Y measurement */
101#define WM9713_ADCSEL_PRES 0x0008 /* Pressure measurement */ 101#define WM9713_ADCSEL_PRES 0x0008 /* Pressure measurement */
102#define WM9713_COO 0x0001 /* enable coordinate mode */ 102#define WM9713_COO 0x0001 /* enable coordinate mode */
103#define WM9713_45W 0x1000 /* set for 5 wire panel */
103#define WM9713_PDEN 0x0800 /* measure only when pen down */ 104#define WM9713_PDEN 0x0800 /* measure only when pen down */
104#define WM9713_ADCSEL_MASK 0x00fe /* ADC selection mask */ 105#define WM9713_ADCSEL_MASK 0x00fe /* ADC selection mask */
105#define WM9713_WAIT 0x0200 /* coordinate wait */ 106#define WM9713_WAIT 0x0200 /* coordinate wait */