mfd: Remove default selection of AB4500
[safe/jmp/linux-2.6] / drivers / mfd / ucb1x00-ts.c
index cb8c264..000cb41 100644 (file)
 #include <linux/freezer.h>
 #include <linux/slab.h>
 #include <linux/kthread.h>
+#include <linux/mfd/ucb1x00.h>
 
-#include <asm/dma.h>
-#include <asm/semaphore.h>
-#include <asm/arch/collie.h>
+#include <mach/dma.h>
+#include <mach/collie.h>
 #include <asm/mach-types.h>
 
-#include "ucb1x00.h"
 
 
 struct ucb1x00_ts {
@@ -205,19 +204,10 @@ static inline int ucb1x00_ts_pen_down(struct ucb1x00_ts *ts)
 static int ucb1x00_thread(void *_ts)
 {
        struct ucb1x00_ts *ts = _ts;
-       struct task_struct *tsk = current;
-       DECLARE_WAITQUEUE(wait, tsk);
-       int valid;
-
-       /*
-        * We could run as a real-time thread.  However, thus far
-        * this doesn't seem to be necessary.
-        */
-//     tsk->policy = SCHED_FIFO;
-//     tsk->rt_priority = 1;
-
-       valid = 0;
+       DECLARE_WAITQUEUE(wait, current);
+       int valid = 0;
 
+       set_freezable();
        add_wait_queue(&ts->irq_wait, &wait);
        while (!kthread_should_stop()) {
                unsigned int x, y, p;
@@ -243,7 +233,7 @@ static int ucb1x00_thread(void *_ts)
 
 
                if (ucb1x00_ts_pen_down(ts)) {
-                       set_task_state(tsk, TASK_INTERRUPTIBLE);
+                       set_current_state(TASK_INTERRUPTIBLE);
 
                        ucb1x00_enable_irq(ts->ucb, UCB_IRQ_TSPX, machine_is_collie() ? UCB_RISING : UCB_FALLING);
                        ucb1x00_disable(ts->ucb);
@@ -271,7 +261,7 @@ static int ucb1x00_thread(void *_ts)
                                valid = 1;
                        }
 
-                       set_task_state(tsk, TASK_INTERRUPTIBLE);
+                       set_current_state(TASK_INTERRUPTIBLE);
                        timeout = HZ / 100;
                }
 
@@ -300,7 +290,7 @@ static void ucb1x00_ts_irq(int idx, void *id)
 
 static int ucb1x00_ts_open(struct input_dev *idev)
 {
-       struct ucb1x00_ts *ts = idev->private;
+       struct ucb1x00_ts *ts = input_get_drvdata(idev);
        int ret = 0;
 
        BUG_ON(ts->rtask);
@@ -337,7 +327,7 @@ static int ucb1x00_ts_open(struct input_dev *idev)
  */
 static void ucb1x00_ts_close(struct input_dev *idev)
 {
-       struct ucb1x00_ts *ts = idev->private;
+       struct ucb1x00_ts *ts = input_get_drvdata(idev);
 
        if (ts->rtask)
                kthread_stop(ts->rtask);
@@ -389,7 +379,6 @@ static int ucb1x00_ts_add(struct ucb1x00_dev *dev)
        ts->idev = idev;
        ts->adcsync = adcsync ? UCB_SYNC : UCB_NOSYNC;
 
-       idev->private    = ts;
        idev->name       = "Touchscreen panel";
        idev->id.product = ts->ucb->id;
        idev->open       = ucb1x00_ts_open;
@@ -400,6 +389,8 @@ static int ucb1x00_ts_add(struct ucb1x00_dev *dev)
        __set_bit(ABS_Y, idev->absbit);
        __set_bit(ABS_PRESSURE, idev->absbit);
 
+       input_set_drvdata(idev, ts);
+
        err = input_register_device(idev);
        if (err)
                goto fail;