diff options
-rw-r--r-- | arch/arm/mach-omap1/board-h3.c | 101 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-h4.c | 95 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/mach/gpioexpander.h | 35 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/mach/irda.h | 4 |
4 files changed, 0 insertions, 235 deletions
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c index 4695965114c4..f597968733b4 100644 --- a/arch/arm/mach-omap1/board-h3.c +++ b/arch/arm/mach-omap1/board-h3.c | |||
@@ -39,12 +39,10 @@ | |||
39 | #include <asm/mach/flash.h> | 39 | #include <asm/mach/flash.h> |
40 | #include <asm/mach/map.h> | 40 | #include <asm/mach/map.h> |
41 | 41 | ||
42 | #include <mach/gpioexpander.h> | ||
43 | #include <mach/irqs.h> | 42 | #include <mach/irqs.h> |
44 | #include <mach/mux.h> | 43 | #include <mach/mux.h> |
45 | #include <mach/tc.h> | 44 | #include <mach/tc.h> |
46 | #include <mach/nand.h> | 45 | #include <mach/nand.h> |
47 | #include <mach/irda.h> | ||
48 | #include <mach/usb.h> | 46 | #include <mach/usb.h> |
49 | #include <mach/keypad.h> | 47 | #include <mach/keypad.h> |
50 | #include <mach/dma.h> | 48 | #include <mach/dma.h> |
@@ -276,104 +274,6 @@ static struct platform_device h3_kp_device = { | |||
276 | .resource = h3_kp_resources, | 274 | .resource = h3_kp_resources, |
277 | }; | 275 | }; |
278 | 276 | ||
279 | |||
280 | /* Select between the IrDA and aGPS module | ||
281 | */ | ||
282 | static int h3_select_irda(struct device *dev, int state) | ||
283 | { | ||
284 | unsigned char expa; | ||
285 | int err = 0; | ||
286 | |||
287 | if ((err = read_gpio_expa(&expa, 0x26))) { | ||
288 | printk(KERN_ERR "Error reading from I/O EXPANDER \n"); | ||
289 | return err; | ||
290 | } | ||
291 | |||
292 | /* 'P6' enable/disable IRDA_TX and IRDA_RX */ | ||
293 | if (state & IR_SEL) { /* IrDA */ | ||
294 | if ((err = write_gpio_expa(expa | 0x40, 0x26))) { | ||
295 | printk(KERN_ERR "Error writing to I/O EXPANDER \n"); | ||
296 | return err; | ||
297 | } | ||
298 | } else { | ||
299 | if ((err = write_gpio_expa(expa & ~0x40, 0x26))) { | ||
300 | printk(KERN_ERR "Error writing to I/O EXPANDER \n"); | ||
301 | return err; | ||
302 | } | ||
303 | } | ||
304 | return err; | ||
305 | } | ||
306 | |||
307 | static void set_trans_mode(struct work_struct *work) | ||
308 | { | ||
309 | struct omap_irda_config *irda_config = | ||
310 | container_of(work, struct omap_irda_config, gpio_expa.work); | ||
311 | int mode = irda_config->mode; | ||
312 | unsigned char expa; | ||
313 | int err = 0; | ||
314 | |||
315 | if ((err = read_gpio_expa(&expa, 0x27)) != 0) { | ||
316 | printk(KERN_ERR "Error reading from I/O expander\n"); | ||
317 | } | ||
318 | |||
319 | expa &= ~0x03; | ||
320 | |||
321 | if (mode & IR_SIRMODE) { | ||
322 | expa |= 0x01; | ||
323 | } else { /* MIR/FIR */ | ||
324 | expa |= 0x03; | ||
325 | } | ||
326 | |||
327 | if ((err = write_gpio_expa(expa, 0x27)) != 0) { | ||
328 | printk(KERN_ERR "Error writing to I/O expander\n"); | ||
329 | } | ||
330 | } | ||
331 | |||
332 | static int h3_transceiver_mode(struct device *dev, int mode) | ||
333 | { | ||
334 | struct omap_irda_config *irda_config = dev->platform_data; | ||
335 | |||
336 | irda_config->mode = mode; | ||
337 | cancel_delayed_work(&irda_config->gpio_expa); | ||
338 | PREPARE_DELAYED_WORK(&irda_config->gpio_expa, set_trans_mode); | ||
339 | schedule_delayed_work(&irda_config->gpio_expa, 0); | ||
340 | |||
341 | return 0; | ||
342 | } | ||
343 | |||
344 | static struct omap_irda_config h3_irda_data = { | ||
345 | .transceiver_cap = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE, | ||
346 | .transceiver_mode = h3_transceiver_mode, | ||
347 | .select_irda = h3_select_irda, | ||
348 | .rx_channel = OMAP_DMA_UART3_RX, | ||
349 | .tx_channel = OMAP_DMA_UART3_TX, | ||
350 | .dest_start = UART3_THR, | ||
351 | .src_start = UART3_RHR, | ||
352 | .tx_trigger = 0, | ||
353 | .rx_trigger = 0, | ||
354 | }; | ||
355 | |||
356 | static struct resource h3_irda_resources[] = { | ||
357 | [0] = { | ||
358 | .start = INT_UART3, | ||
359 | .end = INT_UART3, | ||
360 | .flags = IORESOURCE_IRQ, | ||
361 | }, | ||
362 | }; | ||
363 | |||
364 | static u64 irda_dmamask = 0xffffffff; | ||
365 | |||
366 | static struct platform_device h3_irda_device = { | ||
367 | .name = "omapirda", | ||
368 | .id = 0, | ||
369 | .dev = { | ||
370 | .platform_data = &h3_irda_data, | ||
371 | .dma_mask = &irda_dmamask, | ||
372 | }, | ||
373 | .num_resources = ARRAY_SIZE(h3_irda_resources), | ||
374 | .resource = h3_irda_resources, | ||
375 | }; | ||
376 | |||
377 | static struct platform_device h3_lcd_device = { | 277 | static struct platform_device h3_lcd_device = { |
378 | .name = "lcd_h3", | 278 | .name = "lcd_h3", |
379 | .id = -1, | 279 | .id = -1, |
@@ -395,7 +295,6 @@ static struct platform_device *devices[] __initdata = { | |||
395 | &nand_device, | 295 | &nand_device, |
396 | &smc91x_device, | 296 | &smc91x_device, |
397 | &intlat_device, | 297 | &intlat_device, |
398 | &h3_irda_device, | ||
399 | &h3_kp_device, | 298 | &h3_kp_device, |
400 | &h3_lcd_device, | 299 | &h3_lcd_device, |
401 | }; | 300 | }; |
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index a0267a9ab466..e7d017cdc438 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c | |||
@@ -33,10 +33,8 @@ | |||
33 | 33 | ||
34 | #include <mach/control.h> | 34 | #include <mach/control.h> |
35 | #include <mach/gpio.h> | 35 | #include <mach/gpio.h> |
36 | #include <mach/gpioexpander.h> | ||
37 | #include <mach/mux.h> | 36 | #include <mach/mux.h> |
38 | #include <mach/usb.h> | 37 | #include <mach/usb.h> |
39 | #include <mach/irda.h> | ||
40 | #include <mach/board.h> | 38 | #include <mach/board.h> |
41 | #include <mach/common.h> | 39 | #include <mach/common.h> |
42 | #include <mach/keypad.h> | 40 | #include <mach/keypad.h> |
@@ -138,98 +136,6 @@ static struct platform_device h4_flash_device = { | |||
138 | .resource = &h4_flash_resource, | 136 | .resource = &h4_flash_resource, |
139 | }; | 137 | }; |
140 | 138 | ||
141 | /* Select between the IrDA and aGPS module | ||
142 | */ | ||
143 | static int h4_select_irda(struct device *dev, int state) | ||
144 | { | ||
145 | unsigned char expa; | ||
146 | int err = 0; | ||
147 | |||
148 | if ((err = read_gpio_expa(&expa, 0x21))) { | ||
149 | printk(KERN_ERR "Error reading from I/O expander\n"); | ||
150 | return err; | ||
151 | } | ||
152 | |||
153 | /* 'P6' enable/disable IRDA_TX and IRDA_RX */ | ||
154 | if (state & IR_SEL) { /* IrDa */ | ||
155 | if ((err = write_gpio_expa(expa | 0x01, 0x21))) { | ||
156 | printk(KERN_ERR "Error writing to I/O expander\n"); | ||
157 | return err; | ||
158 | } | ||
159 | } else { | ||
160 | if ((err = write_gpio_expa(expa & ~0x01, 0x21))) { | ||
161 | printk(KERN_ERR "Error writing to I/O expander\n"); | ||
162 | return err; | ||
163 | } | ||
164 | } | ||
165 | return err; | ||
166 | } | ||
167 | |||
168 | static void set_trans_mode(struct work_struct *work) | ||
169 | { | ||
170 | struct omap_irda_config *irda_config = | ||
171 | container_of(work, struct omap_irda_config, gpio_expa.work); | ||
172 | int mode = irda_config->mode; | ||
173 | unsigned char expa; | ||
174 | int err = 0; | ||
175 | |||
176 | if ((err = read_gpio_expa(&expa, 0x20)) != 0) { | ||
177 | printk(KERN_ERR "Error reading from I/O expander\n"); | ||
178 | } | ||
179 | |||
180 | expa &= ~0x01; | ||
181 | |||
182 | if (!(mode & IR_SIRMODE)) { /* MIR/FIR */ | ||
183 | expa |= 0x01; | ||
184 | } | ||
185 | |||
186 | if ((err = write_gpio_expa(expa, 0x20)) != 0) { | ||
187 | printk(KERN_ERR "Error writing to I/O expander\n"); | ||
188 | } | ||
189 | } | ||
190 | |||
191 | static int h4_transceiver_mode(struct device *dev, int mode) | ||
192 | { | ||
193 | struct omap_irda_config *irda_config = dev->platform_data; | ||
194 | |||
195 | irda_config->mode = mode; | ||
196 | cancel_delayed_work(&irda_config->gpio_expa); | ||
197 | PREPARE_DELAYED_WORK(&irda_config->gpio_expa, set_trans_mode); | ||
198 | schedule_delayed_work(&irda_config->gpio_expa, 0); | ||
199 | |||
200 | return 0; | ||
201 | } | ||
202 | |||
203 | static struct omap_irda_config h4_irda_data = { | ||
204 | .transceiver_cap = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE, | ||
205 | .transceiver_mode = h4_transceiver_mode, | ||
206 | .select_irda = h4_select_irda, | ||
207 | .rx_channel = OMAP24XX_DMA_UART3_RX, | ||
208 | .tx_channel = OMAP24XX_DMA_UART3_TX, | ||
209 | .dest_start = OMAP_UART3_BASE, | ||
210 | .src_start = OMAP_UART3_BASE, | ||
211 | .tx_trigger = OMAP24XX_DMA_UART3_TX, | ||
212 | .rx_trigger = OMAP24XX_DMA_UART3_RX, | ||
213 | }; | ||
214 | |||
215 | static struct resource h4_irda_resources[] = { | ||
216 | [0] = { | ||
217 | .start = INT_24XX_UART3_IRQ, | ||
218 | .end = INT_24XX_UART3_IRQ, | ||
219 | .flags = IORESOURCE_IRQ, | ||
220 | }, | ||
221 | }; | ||
222 | |||
223 | static struct platform_device h4_irda_device = { | ||
224 | .name = "omapirda", | ||
225 | .id = -1, | ||
226 | .dev = { | ||
227 | .platform_data = &h4_irda_data, | ||
228 | }, | ||
229 | .num_resources = 1, | ||
230 | .resource = h4_irda_resources, | ||
231 | }; | ||
232 | |||
233 | static struct omap_kp_platform_data h4_kp_data = { | 139 | static struct omap_kp_platform_data h4_kp_data = { |
234 | .rows = 6, | 140 | .rows = 6, |
235 | .cols = 7, | 141 | .cols = 7, |
@@ -255,7 +161,6 @@ static struct platform_device h4_lcd_device = { | |||
255 | 161 | ||
256 | static struct platform_device *h4_devices[] __initdata = { | 162 | static struct platform_device *h4_devices[] __initdata = { |
257 | &h4_flash_device, | 163 | &h4_flash_device, |
258 | &h4_irda_device, | ||
259 | &h4_kp_device, | 164 | &h4_kp_device, |
260 | &h4_lcd_device, | 165 | &h4_lcd_device, |
261 | }; | 166 | }; |
diff --git a/arch/arm/plat-omap/include/mach/gpioexpander.h b/arch/arm/plat-omap/include/mach/gpioexpander.h deleted file mode 100644 index 90444a0d6b1a..000000000000 --- a/arch/arm/plat-omap/include/mach/gpioexpander.h +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-omap/include/mach/gpioexpander.h | ||
3 | * | ||
4 | * | ||
5 | * Copyright (C) 2004 Texas Instruments, Inc. | ||
6 | * | ||
7 | * This package is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | ||
12 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | ||
13 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
14 | */ | ||
15 | |||
16 | #ifndef __ASM_ARCH_OMAP_GPIOEXPANDER_H | ||
17 | #define __ASM_ARCH_OMAP_GPIOEXPANDER_H | ||
18 | |||
19 | /* Function Prototypes for GPIO Expander functions */ | ||
20 | |||
21 | #ifdef CONFIG_GPIOEXPANDER_OMAP | ||
22 | int read_gpio_expa(u8 *, int); | ||
23 | int write_gpio_expa(u8 , int); | ||
24 | #else | ||
25 | static inline int read_gpio_expa(u8 *val, int addr) | ||
26 | { | ||
27 | return 0; | ||
28 | } | ||
29 | static inline int write_gpio_expa(u8 val, int addr) | ||
30 | { | ||
31 | return 0; | ||
32 | } | ||
33 | #endif | ||
34 | |||
35 | #endif /* __ASM_ARCH_OMAP_GPIOEXPANDER_H */ | ||
diff --git a/arch/arm/plat-omap/include/mach/irda.h b/arch/arm/plat-omap/include/mach/irda.h index 8372a00d8e0b..40f60339d1c6 100644 --- a/arch/arm/plat-omap/include/mach/irda.h +++ b/arch/arm/plat-omap/include/mach/irda.h | |||
@@ -21,10 +21,6 @@ struct omap_irda_config { | |||
21 | int transceiver_cap; | 21 | int transceiver_cap; |
22 | int (*transceiver_mode)(struct device *dev, int mode); | 22 | int (*transceiver_mode)(struct device *dev, int mode); |
23 | int (*select_irda)(struct device *dev, int state); | 23 | int (*select_irda)(struct device *dev, int state); |
24 | /* Very specific to the needs of some platforms (h3,h4) | ||
25 | * having calls which can sleep in irda_set_speed. | ||
26 | */ | ||
27 | struct delayed_work gpio_expa; | ||
28 | int rx_channel; | 24 | int rx_channel; |
29 | int tx_channel; | 25 | int tx_channel; |
30 | unsigned long dest_start; | 26 | unsigned long dest_start; |