aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/mk712.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/touchscreen/mk712.c')
-rw-r--r--drivers/input/touchscreen/mk712.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/drivers/input/touchscreen/mk712.c b/drivers/input/touchscreen/mk712.c
index 2d14a57a05e5..afaaebe5225b 100644
--- a/drivers/input/touchscreen/mk712.c
+++ b/drivers/input/touchscreen/mk712.c
@@ -17,7 +17,7 @@
17 * found in Gateway AOL Connected Touchpad computers. 17 * found in Gateway AOL Connected Touchpad computers.
18 * 18 *
19 * Documentation for ICS MK712 can be found at: 19 * Documentation for ICS MK712 can be found at:
20 * http://www.icst.com/pdf/mk712.pdf 20 * http://www.icst.com/pdf/mk712.pdf
21 */ 21 */
22 22
23/* 23/*
@@ -77,7 +77,6 @@ MODULE_PARM_DESC(irq, "IRQ of MK712 touchscreen controller");
77#define MK712_READ_ONE_POINT 0x20 77#define MK712_READ_ONE_POINT 0x20
78#define MK712_POWERUP 0x40 78#define MK712_POWERUP 0x40
79 79
80static int mk712_used = 0;
81static struct input_dev mk712_dev; 80static struct input_dev mk712_dev;
82static DEFINE_SPINLOCK(mk712_lock); 81static DEFINE_SPINLOCK(mk712_lock);
83 82
@@ -130,17 +129,14 @@ static int mk712_open(struct input_dev *dev)
130 129
131 spin_lock_irqsave(&mk712_lock, flags); 130 spin_lock_irqsave(&mk712_lock, flags);
132 131
133 if (!mk712_used++) { 132 outb(0, mk712_io + MK712_CONTROL); /* Reset */
134 133
135 outb(0, mk712_io + MK712_CONTROL); /* Reset */ 134 outb(MK712_ENABLE_INT | MK712_INT_ON_CONVERSION_COMPLETE |
135 MK712_INT_ON_CHANGE_IN_TOUCH_STATUS |
136 MK712_ENABLE_PERIODIC_CONVERSIONS |
137 MK712_POWERUP, mk712_io + MK712_CONTROL);
136 138
137 outb(MK712_ENABLE_INT | MK712_INT_ON_CONVERSION_COMPLETE | 139 outb(10, mk712_io + MK712_RATE); /* 187 points per second */
138 MK712_INT_ON_CHANGE_IN_TOUCH_STATUS |
139 MK712_ENABLE_PERIODIC_CONVERSIONS |
140 MK712_POWERUP, mk712_io + MK712_CONTROL);
141
142 outb(10, mk712_io + MK712_RATE); /* 187 points per second */
143 }
144 140
145 spin_unlock_irqrestore(&mk712_lock, flags); 141 spin_unlock_irqrestore(&mk712_lock, flags);
146 142
@@ -153,8 +149,7 @@ static void mk712_close(struct input_dev *dev)
153 149
154 spin_lock_irqsave(&mk712_lock, flags); 150 spin_lock_irqsave(&mk712_lock, flags);
155 151
156 if (!--mk712_used) 152 outb(0, mk712_io + MK712_CONTROL);
157 outb(0, mk712_io + MK712_CONTROL);
158 153
159 spin_unlock_irqrestore(&mk712_lock, flags); 154 spin_unlock_irqrestore(&mk712_lock, flags);
160} 155}