]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mfd/ucb1x00-ts.c
Merge branch 'master' of /home/git/linux-omap-2.6
[linux-2.6-omap-h63xx.git] / drivers / mfd / ucb1x00-ts.c
index a984c0efabf0e39837ef40816b1c79c26eb20c57..02776814443e24df9218fed9b703542e6d66c614 100644 (file)
@@ -17,7 +17,6 @@
  * pin should provide pulses even when the LCD is blanked, otherwise
  * a pen touch needed to unblank the LCD will never be read.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
@@ -32,7 +31,6 @@
 #include <linux/suspend.h>
 #include <linux/slab.h>
 #include <linux/kthread.h>
-#include <linux/delay.h>
 
 #include <asm/dma.h>
 #include <asm/semaphore.h>
@@ -59,16 +57,18 @@ static int adcsync;
 
 static inline void ucb1x00_ts_evt_add(struct ucb1x00_ts *ts, u16 pressure, u16 x, u16 y)
 {
-       input_report_abs(ts->idev, ABS_X, x);
-       input_report_abs(ts->idev, ABS_Y, y);
-       input_report_abs(ts->idev, ABS_PRESSURE, pressure);
-       input_sync(ts->idev);
+       struct input_dev *idev = ts->idev;
+       input_report_abs(idev, ABS_X, x);
+       input_report_abs(idev, ABS_Y, y);
+       input_report_abs(idev, ABS_PRESSURE, pressure);
+       input_sync(idev);
 }
 
 static inline void ucb1x00_ts_event_release(struct ucb1x00_ts *ts)
 {
-       input_report_abs(ts->idev, ABS_PRESSURE, 0);
-       input_sync(ts->idev);
+       struct input_dev *idev = ts->idev;
+       input_report_abs(idev, ABS_PRESSURE, 0);
+       input_sync(idev);
 }
 
 /*
@@ -297,7 +297,7 @@ static void ucb1x00_ts_irq(int idx, void *id)
 
 static int ucb1x00_ts_open(struct input_dev *idev)
 {
-       struct ucb1x00_ts *ts = (struct ucb1x00_ts *)idev;
+       struct ucb1x00_ts *ts = idev->private;
        int ret = 0;
 
        BUG_ON(ts->rtask);
@@ -334,7 +334,7 @@ static int ucb1x00_ts_open(struct input_dev *idev)
  */
 static void ucb1x00_ts_close(struct input_dev *idev)
 {
-       struct ucb1x00_ts *ts = (struct ucb1x00_ts *)idev;
+       struct ucb1x00_ts *ts = idev->private;
 
        if (ts->rtask)
                kthread_stop(ts->rtask);
@@ -386,6 +386,7 @@ static int ucb1x00_ts_add(struct ucb1x00_dev *dev)
        ts->ucb = dev->ucb;
        ts->adcsync = adcsync ? UCB_SYNC : UCB_NOSYNC;
 
+       ts->idev->private = ts;
        ts->idev->name       = "Touchscreen panel";
        ts->idev->id.product = ts->ucb->id;
        ts->idev->open       = ucb1x00_ts_open;