diff options
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/keyboard/jornada720_kbd.c | 1 | ||||
-rw-r--r-- | drivers/input/misc/88pm860x_onkey.c | 26 | ||||
-rw-r--r-- | drivers/input/serio/ambakmi.c | 13 | ||||
-rw-r--r-- | drivers/input/serio/ams_delta_serio.c | 54 | ||||
-rw-r--r-- | drivers/input/serio/rpckbd.c | 44 | ||||
-rw-r--r-- | drivers/input/serio/sa1111ps2.c | 59 | ||||
-rw-r--r-- | drivers/input/touchscreen/Kconfig | 2 | ||||
-rw-r--r-- | drivers/input/touchscreen/jornada720_ts.c | 1 | ||||
-rw-r--r-- | drivers/input/touchscreen/mc13783_ts.c | 11 |
9 files changed, 153 insertions, 58 deletions
diff --git a/drivers/input/keyboard/jornada720_kbd.c b/drivers/input/keyboard/jornada720_kbd.c index eeafc30b207b..9d639fa1afbd 100644 --- a/drivers/input/keyboard/jornada720_kbd.c +++ b/drivers/input/keyboard/jornada720_kbd.c | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | #include <mach/jornada720.h> | 28 | #include <mach/jornada720.h> |
29 | #include <mach/hardware.h> | 29 | #include <mach/hardware.h> |
30 | #include <mach/irqs.h> | ||
30 | 31 | ||
31 | MODULE_AUTHOR("Kristoffer Ericson <Kristoffer.Ericson@gmail.com>"); | 32 | MODULE_AUTHOR("Kristoffer Ericson <Kristoffer.Ericson@gmail.com>"); |
32 | MODULE_DESCRIPTION("HP Jornada 710/720/728 keyboard driver"); | 33 | MODULE_DESCRIPTION("HP Jornada 710/720/728 keyboard driver"); |
diff --git a/drivers/input/misc/88pm860x_onkey.c b/drivers/input/misc/88pm860x_onkey.c index f2e0cbc5ab64..f9ce1835e4d7 100644 --- a/drivers/input/misc/88pm860x_onkey.c +++ b/drivers/input/misc/88pm860x_onkey.c | |||
@@ -105,6 +105,8 @@ static int __devinit pm860x_onkey_probe(struct platform_device *pdev) | |||
105 | } | 105 | } |
106 | 106 | ||
107 | platform_set_drvdata(pdev, info); | 107 | platform_set_drvdata(pdev, info); |
108 | device_init_wakeup(&pdev->dev, 1); | ||
109 | |||
108 | return 0; | 110 | return 0; |
109 | 111 | ||
110 | out_irq: | 112 | out_irq: |
@@ -129,10 +131,34 @@ static int __devexit pm860x_onkey_remove(struct platform_device *pdev) | |||
129 | return 0; | 131 | return 0; |
130 | } | 132 | } |
131 | 133 | ||
134 | #ifdef CONFIG_PM_SLEEP | ||
135 | static int pm860x_onkey_suspend(struct device *dev) | ||
136 | { | ||
137 | struct platform_device *pdev = to_platform_device(dev); | ||
138 | struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); | ||
139 | |||
140 | if (device_may_wakeup(dev)) | ||
141 | chip->wakeup_flag |= 1 << PM8607_IRQ_ONKEY; | ||
142 | return 0; | ||
143 | } | ||
144 | static int pm860x_onkey_resume(struct device *dev) | ||
145 | { | ||
146 | struct platform_device *pdev = to_platform_device(dev); | ||
147 | struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); | ||
148 | |||
149 | if (device_may_wakeup(dev)) | ||
150 | chip->wakeup_flag &= ~(1 << PM8607_IRQ_ONKEY); | ||
151 | return 0; | ||
152 | } | ||
153 | #endif | ||
154 | |||
155 | static SIMPLE_DEV_PM_OPS(pm860x_onkey_pm_ops, pm860x_onkey_suspend, pm860x_onkey_resume); | ||
156 | |||
132 | static struct platform_driver pm860x_onkey_driver = { | 157 | static struct platform_driver pm860x_onkey_driver = { |
133 | .driver = { | 158 | .driver = { |
134 | .name = "88pm860x-onkey", | 159 | .name = "88pm860x-onkey", |
135 | .owner = THIS_MODULE, | 160 | .owner = THIS_MODULE, |
161 | .pm = &pm860x_onkey_pm_ops, | ||
136 | }, | 162 | }, |
137 | .probe = pm860x_onkey_probe, | 163 | .probe = pm860x_onkey_probe, |
138 | .remove = __devexit_p(pm860x_onkey_remove), | 164 | .remove = __devexit_p(pm860x_onkey_remove), |
diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c index 8407d5b0ced8..2ffd110bd5bc 100644 --- a/drivers/input/serio/ambakmi.c +++ b/drivers/input/serio/ambakmi.c | |||
@@ -208,18 +208,7 @@ static struct amba_driver ambakmi_driver = { | |||
208 | .resume = amba_kmi_resume, | 208 | .resume = amba_kmi_resume, |
209 | }; | 209 | }; |
210 | 210 | ||
211 | static int __init amba_kmi_init(void) | 211 | module_amba_driver(ambakmi_driver); |
212 | { | ||
213 | return amba_driver_register(&ambakmi_driver); | ||
214 | } | ||
215 | |||
216 | static void __exit amba_kmi_exit(void) | ||
217 | { | ||
218 | amba_driver_unregister(&ambakmi_driver); | ||
219 | } | ||
220 | |||
221 | module_init(amba_kmi_init); | ||
222 | module_exit(amba_kmi_exit); | ||
223 | 212 | ||
224 | MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>"); | 213 | MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>"); |
225 | MODULE_DESCRIPTION("AMBA KMI controller driver"); | 214 | MODULE_DESCRIPTION("AMBA KMI controller driver"); |
diff --git a/drivers/input/serio/ams_delta_serio.c b/drivers/input/serio/ams_delta_serio.c index d4d08bd9205b..bd5b10eeeb40 100644 --- a/drivers/input/serio/ams_delta_serio.c +++ b/drivers/input/serio/ams_delta_serio.c | |||
@@ -92,8 +92,7 @@ static irqreturn_t ams_delta_serio_interrupt(int irq, void *dev_id) | |||
92 | static int ams_delta_serio_open(struct serio *serio) | 92 | static int ams_delta_serio_open(struct serio *serio) |
93 | { | 93 | { |
94 | /* enable keyboard */ | 94 | /* enable keyboard */ |
95 | ams_delta_latch2_write(AMD_DELTA_LATCH2_KEYBRD_PWR, | 95 | gpio_set_value(AMS_DELTA_GPIO_PIN_KEYBRD_PWR, 1); |
96 | AMD_DELTA_LATCH2_KEYBRD_PWR); | ||
97 | 96 | ||
98 | return 0; | 97 | return 0; |
99 | } | 98 | } |
@@ -101,9 +100,32 @@ static int ams_delta_serio_open(struct serio *serio) | |||
101 | static void ams_delta_serio_close(struct serio *serio) | 100 | static void ams_delta_serio_close(struct serio *serio) |
102 | { | 101 | { |
103 | /* disable keyboard */ | 102 | /* disable keyboard */ |
104 | ams_delta_latch2_write(AMD_DELTA_LATCH2_KEYBRD_PWR, 0); | 103 | gpio_set_value(AMS_DELTA_GPIO_PIN_KEYBRD_PWR, 0); |
105 | } | 104 | } |
106 | 105 | ||
106 | static const struct gpio ams_delta_gpios[] __initconst_or_module = { | ||
107 | { | ||
108 | .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_DATA, | ||
109 | .flags = GPIOF_DIR_IN, | ||
110 | .label = "serio-data", | ||
111 | }, | ||
112 | { | ||
113 | .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_CLK, | ||
114 | .flags = GPIOF_DIR_IN, | ||
115 | .label = "serio-clock", | ||
116 | }, | ||
117 | { | ||
118 | .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_PWR, | ||
119 | .flags = GPIOF_OUT_INIT_LOW, | ||
120 | .label = "serio-power", | ||
121 | }, | ||
122 | { | ||
123 | .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_DATAOUT, | ||
124 | .flags = GPIOF_OUT_INIT_LOW, | ||
125 | .label = "serio-dataout", | ||
126 | }, | ||
127 | }; | ||
128 | |||
107 | static int __init ams_delta_serio_init(void) | 129 | static int __init ams_delta_serio_init(void) |
108 | { | 130 | { |
109 | int err; | 131 | int err; |
@@ -123,19 +145,12 @@ static int __init ams_delta_serio_init(void) | |||
123 | strlcpy(ams_delta_serio->phys, "GPIO/serio0", | 145 | strlcpy(ams_delta_serio->phys, "GPIO/serio0", |
124 | sizeof(ams_delta_serio->phys)); | 146 | sizeof(ams_delta_serio->phys)); |
125 | 147 | ||
126 | err = gpio_request(AMS_DELTA_GPIO_PIN_KEYBRD_DATA, "serio-data"); | 148 | err = gpio_request_array(ams_delta_gpios, |
149 | ARRAY_SIZE(ams_delta_gpios)); | ||
127 | if (err) { | 150 | if (err) { |
128 | pr_err("ams_delta_serio: Couldn't request gpio pin for data\n"); | 151 | pr_err("ams_delta_serio: Couldn't request gpio pins\n"); |
129 | goto serio; | 152 | goto serio; |
130 | } | 153 | } |
131 | gpio_direction_input(AMS_DELTA_GPIO_PIN_KEYBRD_DATA); | ||
132 | |||
133 | err = gpio_request(AMS_DELTA_GPIO_PIN_KEYBRD_CLK, "serio-clock"); | ||
134 | if (err) { | ||
135 | pr_err("ams_delta_serio: couldn't request gpio pin for clock\n"); | ||
136 | goto gpio_data; | ||
137 | } | ||
138 | gpio_direction_input(AMS_DELTA_GPIO_PIN_KEYBRD_CLK); | ||
139 | 154 | ||
140 | err = request_irq(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), | 155 | err = request_irq(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), |
141 | ams_delta_serio_interrupt, IRQ_TYPE_EDGE_RISING, | 156 | ams_delta_serio_interrupt, IRQ_TYPE_EDGE_RISING, |
@@ -143,7 +158,7 @@ static int __init ams_delta_serio_init(void) | |||
143 | if (err < 0) { | 158 | if (err < 0) { |
144 | pr_err("ams_delta_serio: couldn't request gpio interrupt %d\n", | 159 | pr_err("ams_delta_serio: couldn't request gpio interrupt %d\n", |
145 | gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK)); | 160 | gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK)); |
146 | goto gpio_clk; | 161 | goto gpio; |
147 | } | 162 | } |
148 | /* | 163 | /* |
149 | * Since GPIO register handling for keyboard clock pin is performed | 164 | * Since GPIO register handling for keyboard clock pin is performed |
@@ -157,10 +172,9 @@ static int __init ams_delta_serio_init(void) | |||
157 | dev_info(&ams_delta_serio->dev, "%s\n", ams_delta_serio->name); | 172 | dev_info(&ams_delta_serio->dev, "%s\n", ams_delta_serio->name); |
158 | 173 | ||
159 | return 0; | 174 | return 0; |
160 | gpio_clk: | 175 | gpio: |
161 | gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_CLK); | 176 | gpio_free_array(ams_delta_gpios, |
162 | gpio_data: | 177 | ARRAY_SIZE(ams_delta_gpios)); |
163 | gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_DATA); | ||
164 | serio: | 178 | serio: |
165 | kfree(ams_delta_serio); | 179 | kfree(ams_delta_serio); |
166 | return err; | 180 | return err; |
@@ -171,7 +185,7 @@ static void __exit ams_delta_serio_exit(void) | |||
171 | { | 185 | { |
172 | serio_unregister_port(ams_delta_serio); | 186 | serio_unregister_port(ams_delta_serio); |
173 | free_irq(OMAP_GPIO_IRQ(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), 0); | 187 | free_irq(OMAP_GPIO_IRQ(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), 0); |
174 | gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_CLK); | 188 | gpio_free_array(ams_delta_gpios, |
175 | gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_DATA); | 189 | ARRAY_SIZE(ams_delta_gpios)); |
176 | } | 190 | } |
177 | module_exit(ams_delta_serio_exit); | 191 | module_exit(ams_delta_serio_exit); |
diff --git a/drivers/input/serio/rpckbd.c b/drivers/input/serio/rpckbd.c index d8aac177307f..2af5df6a8fba 100644 --- a/drivers/input/serio/rpckbd.c +++ b/drivers/input/serio/rpckbd.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include <linux/io.h> | 36 | #include <linux/io.h> |
37 | #include <linux/slab.h> | 37 | #include <linux/slab.h> |
38 | 38 | ||
39 | #include <asm/irq.h> | ||
40 | #include <mach/hardware.h> | 39 | #include <mach/hardware.h> |
41 | #include <asm/hardware/iomd.h> | 40 | #include <asm/hardware/iomd.h> |
42 | 41 | ||
@@ -45,6 +44,11 @@ MODULE_DESCRIPTION("Acorn RiscPC PS/2 keyboard controller driver"); | |||
45 | MODULE_LICENSE("GPL"); | 44 | MODULE_LICENSE("GPL"); |
46 | MODULE_ALIAS("platform:kart"); | 45 | MODULE_ALIAS("platform:kart"); |
47 | 46 | ||
47 | struct rpckbd_data { | ||
48 | int tx_irq; | ||
49 | int rx_irq; | ||
50 | }; | ||
51 | |||
48 | static int rpckbd_write(struct serio *port, unsigned char val) | 52 | static int rpckbd_write(struct serio *port, unsigned char val) |
49 | { | 53 | { |
50 | while (!(iomd_readb(IOMD_KCTRL) & (1 << 7))) | 54 | while (!(iomd_readb(IOMD_KCTRL) & (1 << 7))) |
@@ -77,19 +81,21 @@ static irqreturn_t rpckbd_tx(int irq, void *dev_id) | |||
77 | 81 | ||
78 | static int rpckbd_open(struct serio *port) | 82 | static int rpckbd_open(struct serio *port) |
79 | { | 83 | { |
84 | struct rpckbd_data *rpckbd = port->port_data; | ||
85 | |||
80 | /* Reset the keyboard state machine. */ | 86 | /* Reset the keyboard state machine. */ |
81 | iomd_writeb(0, IOMD_KCTRL); | 87 | iomd_writeb(0, IOMD_KCTRL); |
82 | iomd_writeb(8, IOMD_KCTRL); | 88 | iomd_writeb(8, IOMD_KCTRL); |
83 | iomd_readb(IOMD_KARTRX); | 89 | iomd_readb(IOMD_KARTRX); |
84 | 90 | ||
85 | if (request_irq(IRQ_KEYBOARDRX, rpckbd_rx, 0, "rpckbd", port) != 0) { | 91 | if (request_irq(rpckbd->rx_irq, rpckbd_rx, 0, "rpckbd", port) != 0) { |
86 | printk(KERN_ERR "rpckbd.c: Could not allocate keyboard receive IRQ\n"); | 92 | printk(KERN_ERR "rpckbd.c: Could not allocate keyboard receive IRQ\n"); |
87 | return -EBUSY; | 93 | return -EBUSY; |
88 | } | 94 | } |
89 | 95 | ||
90 | if (request_irq(IRQ_KEYBOARDTX, rpckbd_tx, 0, "rpckbd", port) != 0) { | 96 | if (request_irq(rpckbd->tx_irq, rpckbd_tx, 0, "rpckbd", port) != 0) { |
91 | printk(KERN_ERR "rpckbd.c: Could not allocate keyboard transmit IRQ\n"); | 97 | printk(KERN_ERR "rpckbd.c: Could not allocate keyboard transmit IRQ\n"); |
92 | free_irq(IRQ_KEYBOARDRX, port); | 98 | free_irq(rpckbd->rx_irq, port); |
93 | return -EBUSY; | 99 | return -EBUSY; |
94 | } | 100 | } |
95 | 101 | ||
@@ -98,8 +104,10 @@ static int rpckbd_open(struct serio *port) | |||
98 | 104 | ||
99 | static void rpckbd_close(struct serio *port) | 105 | static void rpckbd_close(struct serio *port) |
100 | { | 106 | { |
101 | free_irq(IRQ_KEYBOARDRX, port); | 107 | struct rpckbd_data *rpckbd = port->port_data; |
102 | free_irq(IRQ_KEYBOARDTX, port); | 108 | |
109 | free_irq(rpckbd->rx_irq, port); | ||
110 | free_irq(rpckbd->tx_irq, port); | ||
103 | } | 111 | } |
104 | 112 | ||
105 | /* | 113 | /* |
@@ -108,17 +116,35 @@ static void rpckbd_close(struct serio *port) | |||
108 | */ | 116 | */ |
109 | static int __devinit rpckbd_probe(struct platform_device *dev) | 117 | static int __devinit rpckbd_probe(struct platform_device *dev) |
110 | { | 118 | { |
119 | struct rpckbd_data *rpckbd; | ||
111 | struct serio *serio; | 120 | struct serio *serio; |
121 | int tx_irq, rx_irq; | ||
122 | |||
123 | rx_irq = platform_get_irq(dev, 0); | ||
124 | if (rx_irq <= 0) | ||
125 | return rx_irq < 0 ? rx_irq : -ENXIO; | ||
126 | |||
127 | tx_irq = platform_get_irq(dev, 1); | ||
128 | if (tx_irq <= 0) | ||
129 | return tx_irq < 0 ? tx_irq : -ENXIO; | ||
112 | 130 | ||
113 | serio = kzalloc(sizeof(struct serio), GFP_KERNEL); | 131 | serio = kzalloc(sizeof(struct serio), GFP_KERNEL); |
114 | if (!serio) | 132 | rpckbd = kzalloc(sizeof(*rpckbd), GFP_KERNEL); |
133 | if (!serio || !rpckbd) { | ||
134 | kfree(rpckbd); | ||
135 | kfree(serio); | ||
115 | return -ENOMEM; | 136 | return -ENOMEM; |
137 | } | ||
138 | |||
139 | rpckbd->rx_irq = rx_irq; | ||
140 | rpckbd->tx_irq = tx_irq; | ||
116 | 141 | ||
117 | serio->id.type = SERIO_8042; | 142 | serio->id.type = SERIO_8042; |
118 | serio->write = rpckbd_write; | 143 | serio->write = rpckbd_write; |
119 | serio->open = rpckbd_open; | 144 | serio->open = rpckbd_open; |
120 | serio->close = rpckbd_close; | 145 | serio->close = rpckbd_close; |
121 | serio->dev.parent = &dev->dev; | 146 | serio->dev.parent = &dev->dev; |
147 | serio->port_data = rpckbd; | ||
122 | strlcpy(serio->name, "RiscPC PS/2 kbd port", sizeof(serio->name)); | 148 | strlcpy(serio->name, "RiscPC PS/2 kbd port", sizeof(serio->name)); |
123 | strlcpy(serio->phys, "rpckbd/serio0", sizeof(serio->phys)); | 149 | strlcpy(serio->phys, "rpckbd/serio0", sizeof(serio->phys)); |
124 | 150 | ||
@@ -130,7 +156,11 @@ static int __devinit rpckbd_probe(struct platform_device *dev) | |||
130 | static int __devexit rpckbd_remove(struct platform_device *dev) | 156 | static int __devexit rpckbd_remove(struct platform_device *dev) |
131 | { | 157 | { |
132 | struct serio *serio = platform_get_drvdata(dev); | 158 | struct serio *serio = platform_get_drvdata(dev); |
159 | struct rpckbd_data *rpckbd = serio->port_data; | ||
160 | |||
133 | serio_unregister_port(serio); | 161 | serio_unregister_port(serio); |
162 | kfree(rpckbd); | ||
163 | |||
134 | return 0; | 164 | return 0; |
135 | } | 165 | } |
136 | 166 | ||
diff --git a/drivers/input/serio/sa1111ps2.c b/drivers/input/serio/sa1111ps2.c index e3c85fafe937..389766707534 100644 --- a/drivers/input/serio/sa1111ps2.c +++ b/drivers/input/serio/sa1111ps2.c | |||
@@ -23,6 +23,26 @@ | |||
23 | 23 | ||
24 | #include <asm/hardware/sa1111.h> | 24 | #include <asm/hardware/sa1111.h> |
25 | 25 | ||
26 | #define PS2CR 0x0000 | ||
27 | #define PS2STAT 0x0004 | ||
28 | #define PS2DATA 0x0008 | ||
29 | #define PS2CLKDIV 0x000c | ||
30 | #define PS2PRECNT 0x0010 | ||
31 | |||
32 | #define PS2CR_ENA 0x08 | ||
33 | #define PS2CR_FKD 0x02 | ||
34 | #define PS2CR_FKC 0x01 | ||
35 | |||
36 | #define PS2STAT_STP 0x0100 | ||
37 | #define PS2STAT_TXE 0x0080 | ||
38 | #define PS2STAT_TXB 0x0040 | ||
39 | #define PS2STAT_RXF 0x0020 | ||
40 | #define PS2STAT_RXB 0x0010 | ||
41 | #define PS2STAT_ENA 0x0008 | ||
42 | #define PS2STAT_RXP 0x0004 | ||
43 | #define PS2STAT_KBD 0x0002 | ||
44 | #define PS2STAT_KBC 0x0001 | ||
45 | |||
26 | struct ps2if { | 46 | struct ps2if { |
27 | struct serio *io; | 47 | struct serio *io; |
28 | struct sa1111_dev *dev; | 48 | struct sa1111_dev *dev; |
@@ -44,22 +64,22 @@ static irqreturn_t ps2_rxint(int irq, void *dev_id) | |||
44 | struct ps2if *ps2if = dev_id; | 64 | struct ps2if *ps2if = dev_id; |
45 | unsigned int scancode, flag, status; | 65 | unsigned int scancode, flag, status; |
46 | 66 | ||
47 | status = sa1111_readl(ps2if->base + SA1111_PS2STAT); | 67 | status = sa1111_readl(ps2if->base + PS2STAT); |
48 | while (status & PS2STAT_RXF) { | 68 | while (status & PS2STAT_RXF) { |
49 | if (status & PS2STAT_STP) | 69 | if (status & PS2STAT_STP) |
50 | sa1111_writel(PS2STAT_STP, ps2if->base + SA1111_PS2STAT); | 70 | sa1111_writel(PS2STAT_STP, ps2if->base + PS2STAT); |
51 | 71 | ||
52 | flag = (status & PS2STAT_STP ? SERIO_FRAME : 0) | | 72 | flag = (status & PS2STAT_STP ? SERIO_FRAME : 0) | |
53 | (status & PS2STAT_RXP ? 0 : SERIO_PARITY); | 73 | (status & PS2STAT_RXP ? 0 : SERIO_PARITY); |
54 | 74 | ||
55 | scancode = sa1111_readl(ps2if->base + SA1111_PS2DATA) & 0xff; | 75 | scancode = sa1111_readl(ps2if->base + PS2DATA) & 0xff; |
56 | 76 | ||
57 | if (hweight8(scancode) & 1) | 77 | if (hweight8(scancode) & 1) |
58 | flag ^= SERIO_PARITY; | 78 | flag ^= SERIO_PARITY; |
59 | 79 | ||
60 | serio_interrupt(ps2if->io, scancode, flag); | 80 | serio_interrupt(ps2if->io, scancode, flag); |
61 | 81 | ||
62 | status = sa1111_readl(ps2if->base + SA1111_PS2STAT); | 82 | status = sa1111_readl(ps2if->base + PS2STAT); |
63 | } | 83 | } |
64 | 84 | ||
65 | return IRQ_HANDLED; | 85 | return IRQ_HANDLED; |
@@ -74,12 +94,12 @@ static irqreturn_t ps2_txint(int irq, void *dev_id) | |||
74 | unsigned int status; | 94 | unsigned int status; |
75 | 95 | ||
76 | spin_lock(&ps2if->lock); | 96 | spin_lock(&ps2if->lock); |
77 | status = sa1111_readl(ps2if->base + SA1111_PS2STAT); | 97 | status = sa1111_readl(ps2if->base + PS2STAT); |
78 | if (ps2if->head == ps2if->tail) { | 98 | if (ps2if->head == ps2if->tail) { |
79 | disable_irq_nosync(irq); | 99 | disable_irq_nosync(irq); |
80 | /* done */ | 100 | /* done */ |
81 | } else if (status & PS2STAT_TXE) { | 101 | } else if (status & PS2STAT_TXE) { |
82 | sa1111_writel(ps2if->buf[ps2if->tail], ps2if->base + SA1111_PS2DATA); | 102 | sa1111_writel(ps2if->buf[ps2if->tail], ps2if->base + PS2DATA); |
83 | ps2if->tail = (ps2if->tail + 1) & (sizeof(ps2if->buf) - 1); | 103 | ps2if->tail = (ps2if->tail + 1) & (sizeof(ps2if->buf) - 1); |
84 | } | 104 | } |
85 | spin_unlock(&ps2if->lock); | 105 | spin_unlock(&ps2if->lock); |
@@ -102,8 +122,8 @@ static int ps2_write(struct serio *io, unsigned char val) | |||
102 | /* | 122 | /* |
103 | * If the TX register is empty, we can go straight out. | 123 | * If the TX register is empty, we can go straight out. |
104 | */ | 124 | */ |
105 | if (sa1111_readl(ps2if->base + SA1111_PS2STAT) & PS2STAT_TXE) { | 125 | if (sa1111_readl(ps2if->base + PS2STAT) & PS2STAT_TXE) { |
106 | sa1111_writel(val, ps2if->base + SA1111_PS2DATA); | 126 | sa1111_writel(val, ps2if->base + PS2DATA); |
107 | } else { | 127 | } else { |
108 | if (ps2if->head == ps2if->tail) | 128 | if (ps2if->head == ps2if->tail) |
109 | enable_irq(ps2if->dev->irq[1]); | 129 | enable_irq(ps2if->dev->irq[1]); |
@@ -123,13 +143,16 @@ static int ps2_open(struct serio *io) | |||
123 | struct ps2if *ps2if = io->port_data; | 143 | struct ps2if *ps2if = io->port_data; |
124 | int ret; | 144 | int ret; |
125 | 145 | ||
126 | sa1111_enable_device(ps2if->dev); | 146 | ret = sa1111_enable_device(ps2if->dev); |
147 | if (ret) | ||
148 | return ret; | ||
127 | 149 | ||
128 | ret = request_irq(ps2if->dev->irq[0], ps2_rxint, 0, | 150 | ret = request_irq(ps2if->dev->irq[0], ps2_rxint, 0, |
129 | SA1111_DRIVER_NAME(ps2if->dev), ps2if); | 151 | SA1111_DRIVER_NAME(ps2if->dev), ps2if); |
130 | if (ret) { | 152 | if (ret) { |
131 | printk(KERN_ERR "sa1111ps2: could not allocate IRQ%d: %d\n", | 153 | printk(KERN_ERR "sa1111ps2: could not allocate IRQ%d: %d\n", |
132 | ps2if->dev->irq[0], ret); | 154 | ps2if->dev->irq[0], ret); |
155 | sa1111_disable_device(ps2if->dev); | ||
133 | return ret; | 156 | return ret; |
134 | } | 157 | } |
135 | 158 | ||
@@ -139,6 +162,7 @@ static int ps2_open(struct serio *io) | |||
139 | printk(KERN_ERR "sa1111ps2: could not allocate IRQ%d: %d\n", | 162 | printk(KERN_ERR "sa1111ps2: could not allocate IRQ%d: %d\n", |
140 | ps2if->dev->irq[1], ret); | 163 | ps2if->dev->irq[1], ret); |
141 | free_irq(ps2if->dev->irq[0], ps2if); | 164 | free_irq(ps2if->dev->irq[0], ps2if); |
165 | sa1111_disable_device(ps2if->dev); | ||
142 | return ret; | 166 | return ret; |
143 | } | 167 | } |
144 | 168 | ||
@@ -146,7 +170,7 @@ static int ps2_open(struct serio *io) | |||
146 | 170 | ||
147 | enable_irq_wake(ps2if->dev->irq[0]); | 171 | enable_irq_wake(ps2if->dev->irq[0]); |
148 | 172 | ||
149 | sa1111_writel(PS2CR_ENA, ps2if->base + SA1111_PS2CR); | 173 | sa1111_writel(PS2CR_ENA, ps2if->base + PS2CR); |
150 | return 0; | 174 | return 0; |
151 | } | 175 | } |
152 | 176 | ||
@@ -154,7 +178,7 @@ static void ps2_close(struct serio *io) | |||
154 | { | 178 | { |
155 | struct ps2if *ps2if = io->port_data; | 179 | struct ps2if *ps2if = io->port_data; |
156 | 180 | ||
157 | sa1111_writel(0, ps2if->base + SA1111_PS2CR); | 181 | sa1111_writel(0, ps2if->base + PS2CR); |
158 | 182 | ||
159 | disable_irq_wake(ps2if->dev->irq[0]); | 183 | disable_irq_wake(ps2if->dev->irq[0]); |
160 | 184 | ||
@@ -174,7 +198,7 @@ static void __devinit ps2_clear_input(struct ps2if *ps2if) | |||
174 | int maxread = 100; | 198 | int maxread = 100; |
175 | 199 | ||
176 | while (maxread--) { | 200 | while (maxread--) { |
177 | if ((sa1111_readl(ps2if->base + SA1111_PS2DATA) & 0xff) == 0xff) | 201 | if ((sa1111_readl(ps2if->base + PS2DATA) & 0xff) == 0xff) |
178 | break; | 202 | break; |
179 | } | 203 | } |
180 | } | 204 | } |
@@ -184,11 +208,11 @@ static unsigned int __devinit ps2_test_one(struct ps2if *ps2if, | |||
184 | { | 208 | { |
185 | unsigned int val; | 209 | unsigned int val; |
186 | 210 | ||
187 | sa1111_writel(PS2CR_ENA | mask, ps2if->base + SA1111_PS2CR); | 211 | sa1111_writel(PS2CR_ENA | mask, ps2if->base + PS2CR); |
188 | 212 | ||
189 | udelay(2); | 213 | udelay(2); |
190 | 214 | ||
191 | val = sa1111_readl(ps2if->base + SA1111_PS2STAT); | 215 | val = sa1111_readl(ps2if->base + PS2STAT); |
192 | return val & (PS2STAT_KBC | PS2STAT_KBD); | 216 | return val & (PS2STAT_KBC | PS2STAT_KBD); |
193 | } | 217 | } |
194 | 218 | ||
@@ -219,7 +243,7 @@ static int __devinit ps2_test(struct ps2if *ps2if) | |||
219 | ret = -ENODEV; | 243 | ret = -ENODEV; |
220 | } | 244 | } |
221 | 245 | ||
222 | sa1111_writel(0, ps2if->base + SA1111_PS2CR); | 246 | sa1111_writel(0, ps2if->base + PS2CR); |
223 | 247 | ||
224 | return ret; | 248 | return ret; |
225 | } | 249 | } |
@@ -273,8 +297,8 @@ static int __devinit ps2_probe(struct sa1111_dev *dev) | |||
273 | sa1111_enable_device(ps2if->dev); | 297 | sa1111_enable_device(ps2if->dev); |
274 | 298 | ||
275 | /* Incoming clock is 8MHz */ | 299 | /* Incoming clock is 8MHz */ |
276 | sa1111_writel(0, ps2if->base + SA1111_PS2CLKDIV); | 300 | sa1111_writel(0, ps2if->base + PS2CLKDIV); |
277 | sa1111_writel(127, ps2if->base + SA1111_PS2PRECNT); | 301 | sa1111_writel(127, ps2if->base + PS2PRECNT); |
278 | 302 | ||
279 | /* | 303 | /* |
280 | * Flush any pending input. | 304 | * Flush any pending input. |
@@ -329,6 +353,7 @@ static int __devexit ps2_remove(struct sa1111_dev *dev) | |||
329 | static struct sa1111_driver ps2_driver = { | 353 | static struct sa1111_driver ps2_driver = { |
330 | .drv = { | 354 | .drv = { |
331 | .name = "sa1111-ps2", | 355 | .name = "sa1111-ps2", |
356 | .owner = THIS_MODULE, | ||
332 | }, | 357 | }, |
333 | .devid = SA1111_DEVID_PS2, | 358 | .devid = SA1111_DEVID_PS2, |
334 | .probe = ps2_probe, | 359 | .probe = ps2_probe, |
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index 97b31a0e0525..2a2141915aa0 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig | |||
@@ -260,7 +260,7 @@ config TOUCHSCREEN_ILI210X | |||
260 | 260 | ||
261 | config TOUCHSCREEN_S3C2410 | 261 | config TOUCHSCREEN_S3C2410 |
262 | tristate "Samsung S3C2410/generic touchscreen input driver" | 262 | tristate "Samsung S3C2410/generic touchscreen input driver" |
263 | depends on ARCH_S3C2410 || SAMSUNG_DEV_TS | 263 | depends on ARCH_S3C24XX || SAMSUNG_DEV_TS |
264 | select S3C_ADC | 264 | select S3C_ADC |
265 | help | 265 | help |
266 | Say Y here if you have the s3c2410 touchscreen. | 266 | Say Y here if you have the s3c2410 touchscreen. |
diff --git a/drivers/input/touchscreen/jornada720_ts.c b/drivers/input/touchscreen/jornada720_ts.c index c3848ad2325b..d9be6eac99b1 100644 --- a/drivers/input/touchscreen/jornada720_ts.c +++ b/drivers/input/touchscreen/jornada720_ts.c | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
24 | #include <mach/jornada720.h> | 24 | #include <mach/jornada720.h> |
25 | #include <mach/irqs.h> | ||
25 | 26 | ||
26 | MODULE_AUTHOR("Kristoffer Ericson <kristoffer.ericson@gmail.com>"); | 27 | MODULE_AUTHOR("Kristoffer Ericson <kristoffer.ericson@gmail.com>"); |
27 | MODULE_DESCRIPTION("HP Jornada 710/720/728 touchscreen driver"); | 28 | MODULE_DESCRIPTION("HP Jornada 710/720/728 touchscreen driver"); |
diff --git a/drivers/input/touchscreen/mc13783_ts.c b/drivers/input/touchscreen/mc13783_ts.c index ede02743eac1..48dc5b0d26f1 100644 --- a/drivers/input/touchscreen/mc13783_ts.c +++ b/drivers/input/touchscreen/mc13783_ts.c | |||
@@ -39,6 +39,7 @@ struct mc13783_ts_priv { | |||
39 | struct delayed_work work; | 39 | struct delayed_work work; |
40 | struct workqueue_struct *workq; | 40 | struct workqueue_struct *workq; |
41 | unsigned int sample[4]; | 41 | unsigned int sample[4]; |
42 | struct mc13xxx_ts_platform_data *touch; | ||
42 | }; | 43 | }; |
43 | 44 | ||
44 | static irqreturn_t mc13783_ts_handler(int irq, void *data) | 45 | static irqreturn_t mc13783_ts_handler(int irq, void *data) |
@@ -125,7 +126,9 @@ static void mc13783_ts_work(struct work_struct *work) | |||
125 | unsigned int channel = 12; | 126 | unsigned int channel = 12; |
126 | 127 | ||
127 | if (mc13xxx_adc_do_conversion(priv->mc13xxx, | 128 | if (mc13xxx_adc_do_conversion(priv->mc13xxx, |
128 | mode, channel, priv->sample) == 0) | 129 | mode, channel, |
130 | priv->touch->ato, priv->touch->atox, | ||
131 | priv->sample) == 0) | ||
129 | mc13783_ts_report_sample(priv); | 132 | mc13783_ts_report_sample(priv); |
130 | } | 133 | } |
131 | 134 | ||
@@ -179,6 +182,12 @@ static int __init mc13783_ts_probe(struct platform_device *pdev) | |||
179 | INIT_DELAYED_WORK(&priv->work, mc13783_ts_work); | 182 | INIT_DELAYED_WORK(&priv->work, mc13783_ts_work); |
180 | priv->mc13xxx = dev_get_drvdata(pdev->dev.parent); | 183 | priv->mc13xxx = dev_get_drvdata(pdev->dev.parent); |
181 | priv->idev = idev; | 184 | priv->idev = idev; |
185 | priv->touch = dev_get_platdata(&pdev->dev); | ||
186 | if (!priv->touch) { | ||
187 | dev_err(&pdev->dev, "missing platform data\n"); | ||
188 | ret = -ENODEV; | ||
189 | goto err_free_mem; | ||
190 | } | ||
182 | 191 | ||
183 | /* | 192 | /* |
184 | * We need separate workqueue because mc13783_adc_do_conversion | 193 | * We need separate workqueue because mc13783_adc_do_conversion |