diff options
Diffstat (limited to 'drivers/input/touchscreen/hp680_ts_input.c')
-rw-r--r-- | drivers/input/touchscreen/hp680_ts_input.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/drivers/input/touchscreen/hp680_ts_input.c b/drivers/input/touchscreen/hp680_ts_input.c index 7e1404441eca..957dd5a1b15e 100644 --- a/drivers/input/touchscreen/hp680_ts_input.c +++ b/drivers/input/touchscreen/hp680_ts_input.c | |||
@@ -21,10 +21,8 @@ | |||
21 | 21 | ||
22 | static void do_softint(void *data); | 22 | static void do_softint(void *data); |
23 | 23 | ||
24 | static struct input_dev hp680_ts_dev; | 24 | static struct input_dev *hp680_ts_dev; |
25 | static DECLARE_WORK(work, do_softint, 0); | 25 | static DECLARE_WORK(work, do_softint, 0); |
26 | static char *hp680_ts_name = "HP Jornada touchscreen"; | ||
27 | static char *hp680_ts_phys = "input0"; | ||
28 | 26 | ||
29 | static void do_softint(void *data) | 27 | static void do_softint(void *data) |
30 | { | 28 | { |
@@ -58,14 +56,14 @@ static void do_softint(void *data) | |||
58 | } | 56 | } |
59 | 57 | ||
60 | if (touched) { | 58 | if (touched) { |
61 | input_report_key(&hp680_ts_dev, BTN_TOUCH, 1); | 59 | input_report_key(hp680_ts_dev, BTN_TOUCH, 1); |
62 | input_report_abs(&hp680_ts_dev, ABS_X, absx); | 60 | input_report_abs(hp680_ts_dev, ABS_X, absx); |
63 | input_report_abs(&hp680_ts_dev, ABS_Y, absy); | 61 | input_report_abs(hp680_ts_dev, ABS_Y, absy); |
64 | } else { | 62 | } else { |
65 | input_report_key(&hp680_ts_dev, BTN_TOUCH, 0); | 63 | input_report_key(hp680_ts_dev, BTN_TOUCH, 0); |
66 | } | 64 | } |
67 | 65 | ||
68 | input_sync(&hp680_ts_dev); | 66 | input_sync(hp680_ts_dev); |
69 | enable_irq(HP680_TS_IRQ); | 67 | enable_irq(HP680_TS_IRQ); |
70 | } | 68 | } |
71 | 69 | ||
@@ -92,27 +90,29 @@ static int __init hp680_ts_init(void) | |||
92 | scpcr |= SCPCR_TS_ENABLE; | 90 | scpcr |= SCPCR_TS_ENABLE; |
93 | ctrl_outw(scpcr, SCPCR); | 91 | ctrl_outw(scpcr, SCPCR); |
94 | 92 | ||
95 | memset(&hp680_ts_dev, 0, sizeof(hp680_ts_dev)); | 93 | hp680_ts_dev = input_allocate_device(); |
96 | init_input_dev(&hp680_ts_dev); | 94 | if (!hp680_ts_dev) |
95 | return -ENOMEM; | ||
97 | 96 | ||
98 | hp680_ts_dev.evbit[0] = BIT(EV_ABS) | BIT(EV_KEY); | 97 | hp680_ts_dev->evbit[0] = BIT(EV_ABS) | BIT(EV_KEY); |
99 | hp680_ts_dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y); | 98 | hp680_ts_dev->absbit[0] = BIT(ABS_X) | BIT(ABS_Y); |
100 | hp680_ts_dev.keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); | 99 | hp680_ts_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); |
101 | 100 | ||
102 | hp680_ts_dev.absmin[ABS_X] = HP680_TS_ABS_X_MIN; | 101 | hp680_ts_dev->absmin[ABS_X] = HP680_TS_ABS_X_MIN; |
103 | hp680_ts_dev.absmin[ABS_Y] = HP680_TS_ABS_Y_MIN; | 102 | hp680_ts_dev->absmin[ABS_Y] = HP680_TS_ABS_Y_MIN; |
104 | hp680_ts_dev.absmax[ABS_X] = HP680_TS_ABS_X_MAX; | 103 | hp680_ts_dev->absmax[ABS_X] = HP680_TS_ABS_X_MAX; |
105 | hp680_ts_dev.absmax[ABS_Y] = HP680_TS_ABS_Y_MAX; | 104 | hp680_ts_dev->absmax[ABS_Y] = HP680_TS_ABS_Y_MAX; |
106 | 105 | ||
107 | hp680_ts_dev.name = hp680_ts_name; | 106 | hp680_ts_dev->name = "HP Jornada touchscreen"; |
108 | hp680_ts_dev.phys = hp680_ts_phys; | 107 | hp680_ts_dev->phys = "hp680_ts/input0"; |
109 | input_register_device(&hp680_ts_dev); | ||
110 | 108 | ||
111 | if (request_irq | 109 | input_register_device(hp680_ts_dev); |
112 | (HP680_TS_IRQ, hp680_ts_interrupt, SA_INTERRUPT, MODNAME, 0) < 0) { | 110 | |
113 | printk(KERN_ERR "hp680_touchscreen.c : Can't allocate irq %d\n", | 111 | if (request_irq(HP680_TS_IRQ, hp680_ts_interrupt, |
112 | SA_INTERRUPT, MODNAME, 0) < 0) { | ||
113 | printk(KERN_ERR "hp680_touchscreen.c: Can't allocate irq %d\n", | ||
114 | HP680_TS_IRQ); | 114 | HP680_TS_IRQ); |
115 | input_unregister_device(&hp680_ts_dev); | 115 | input_unregister_device(hp680_ts_dev); |
116 | return -EBUSY; | 116 | return -EBUSY; |
117 | } | 117 | } |
118 | 118 | ||
@@ -124,7 +124,7 @@ static void __exit hp680_ts_exit(void) | |||
124 | free_irq(HP680_TS_IRQ, 0); | 124 | free_irq(HP680_TS_IRQ, 0); |
125 | cancel_delayed_work(&work); | 125 | cancel_delayed_work(&work); |
126 | flush_scheduled_work(); | 126 | flush_scheduled_work(); |
127 | input_unregister_device(&hp680_ts_dev); | 127 | input_unregister_device(hp680_ts_dev); |
128 | } | 128 | } |
129 | 129 | ||
130 | module_init(hp680_ts_init); | 130 | module_init(hp680_ts_init); |