-do the parameter check of setting operating mode.
-add device haeder file.

Signed-off-by: Matt Hsu <[email protected]>
---
 drivers/input/touchscreen/pcap7200_ts.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/input/touchscreen/pcap7200_ts.c 
b/drivers/input/touchscreen/pcap7200_ts.c
index 70f7d89..73e29b8 100644
--- a/drivers/input/touchscreen/pcap7200_ts.c
+++ b/drivers/input/touchscreen/pcap7200_ts.c
@@ -24,6 +24,7 @@
 #include <linux/interrupt.h>
 #include <linux/workqueue.h>
 #include <linux/input.h>
+#include <linux/device.h>
 
 #include <linux/pcap7200.h>
 #include <../drivers/input/touchscreen/ts_filter.h>
@@ -114,6 +115,8 @@ static int __set_op_mode(struct pcap7200_data *pcap, 
u_int8_t val)
 
        mutex_lock(&pcap->lock);
 
+       val = val & 0x03;
+
        /* this chip has an issue.
         * you need to give wakeup call for 3 times if it's
         * in sleep mode.
-- 
1.5.6.5


Reply via email to