diff options
-rw-r--r-- | arch/arm/mach-omap1/board-ams-delta.c | 10 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/board-ams-delta.h | 2 | ||||
-rw-r--r-- | drivers/input/serio/ams_delta_serio.c | 56 |
3 files changed, 35 insertions, 33 deletions
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index 3aba8f99cc7e..673cf21a90f8 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c | |||
@@ -227,16 +227,6 @@ static struct gpio latch_gpios[] __initconst = { | |||
227 | .label = "dockit2", | 227 | .label = "dockit2", |
228 | }, | 228 | }, |
229 | { | 229 | { |
230 | .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_PWR, | ||
231 | .flags = GPIOF_OUT_INIT_LOW, | ||
232 | .label = "keybrd_pwr", | ||
233 | }, | ||
234 | { | ||
235 | .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_DATAOUT, | ||
236 | .flags = GPIOF_OUT_INIT_LOW, | ||
237 | .label = "keybrd_dataout", | ||
238 | }, | ||
239 | { | ||
240 | .gpio = AMS_DELTA_GPIO_PIN_SCARD_RSTIN, | 230 | .gpio = AMS_DELTA_GPIO_PIN_SCARD_RSTIN, |
241 | .flags = GPIOF_OUT_INIT_LOW, | 231 | .flags = GPIOF_OUT_INIT_LOW, |
242 | .label = "scard_rstin", | 232 | .label = "scard_rstin", |
diff --git a/arch/arm/plat-omap/include/plat/board-ams-delta.h b/arch/arm/plat-omap/include/plat/board-ams-delta.h index e9ad673be32f..027e79eead5e 100644 --- a/arch/arm/plat-omap/include/plat/board-ams-delta.h +++ b/arch/arm/plat-omap/include/plat/board-ams-delta.h | |||
@@ -28,8 +28,6 @@ | |||
28 | 28 | ||
29 | #if defined (CONFIG_MACH_AMS_DELTA) | 29 | #if defined (CONFIG_MACH_AMS_DELTA) |
30 | 30 | ||
31 | #define AMD_DELTA_LATCH2_KEYBRD_PWR 0x0100 | ||
32 | #define AMD_DELTA_LATCH2_KEYBRD_DATA 0x0200 | ||
33 | #define AMD_DELTA_LATCH2_SCARD_RSTIN 0x0400 | 31 | #define AMD_DELTA_LATCH2_SCARD_RSTIN 0x0400 |
34 | #define AMD_DELTA_LATCH2_SCARD_CMDVCC 0x0800 | 32 | #define AMD_DELTA_LATCH2_SCARD_CMDVCC 0x0800 |
35 | #define AMS_DELTA_LATCH2_MODEM_NRESET 0x1000 | 33 | #define AMS_DELTA_LATCH2_MODEM_NRESET 0x1000 |
diff --git a/drivers/input/serio/ams_delta_serio.c b/drivers/input/serio/ams_delta_serio.c index 835d37abe62a..0571e2ec358b 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 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,21 +172,20 @@ 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; |
167 | } | 181 | } |
168 | late_initcall(ams_delta_serio_init); | 182 | module_init(ams_delta_serio_init); |
169 | 183 | ||
170 | static void __exit ams_delta_serio_exit(void) | 184 | 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); |