diff options
| author | Ian Molton <spyro@f2s.com> | 2008-08-24 14:21:26 -0400 |
|---|---|---|
| committer | Ian Molton <spyro@f2s.com> | 2008-11-29 18:26:36 -0500 |
| commit | 36033422639913dad1f3146d452116522c77f753 (patch) | |
| tree | f0865621035f9deedcab470e8267b7d19a3bf4ed | |
| parent | 5e1dbdb458ada37f7e97265cb2ea87c55fd5d034 (diff) | |
[ARM] IrDA support for e7xx
This patchset provides a fully functional SIR IrDA driver for the Toshiba
e7xx PDAs.
Signed-off-by: Ian Molton <spyro@f2s.com>
| -rw-r--r-- | arch/arm/mach-pxa/e740.c | 6 | ||||
| -rw-r--r-- | arch/arm/mach-pxa/e750.c | 3 | ||||
| -rw-r--r-- | arch/arm/mach-pxa/eseries.c | 43 | ||||
| -rw-r--r-- | arch/arm/mach-pxa/eseries.h | 3 | ||||
| -rw-r--r-- | arch/arm/mach-pxa/include/mach/eseries-gpio.h | 2 |
5 files changed, 56 insertions, 1 deletions
diff --git a/arch/arm/mach-pxa/e740.c b/arch/arm/mach-pxa/e740.c index c57a15b37f0d..8675fd1b349b 100644 --- a/arch/arm/mach-pxa/e740.c +++ b/arch/arm/mach-pxa/e740.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <mach/mfp-pxa25x.h> | 25 | #include <mach/mfp-pxa25x.h> |
| 26 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
| 27 | #include <mach/udc.h> | 27 | #include <mach/udc.h> |
| 28 | #include <mach/irda.h> | ||
| 28 | 29 | ||
| 29 | #include "generic.h" | 30 | #include "generic.h" |
| 30 | #include "eseries.h" | 31 | #include "eseries.h" |
| @@ -118,6 +119,9 @@ static unsigned long e740_pin_config[] __initdata = { | |||
| 118 | GPIO44_BTUART_CTS, | 119 | GPIO44_BTUART_CTS, |
| 119 | GPIO45_GPIO, /* Used by TMIO for #SUSPEND */ | 120 | GPIO45_GPIO, /* Used by TMIO for #SUSPEND */ |
| 120 | 121 | ||
| 122 | /* IrDA */ | ||
| 123 | GPIO38_GPIO | MFP_LPM_DRIVE_HIGH, | ||
| 124 | |||
| 121 | /* PC Card */ | 125 | /* PC Card */ |
| 122 | GPIO8_GPIO, /* CD0 */ | 126 | GPIO8_GPIO, /* CD0 */ |
| 123 | GPIO44_GPIO, /* CD1 */ | 127 | GPIO44_GPIO, /* CD1 */ |
| @@ -153,6 +157,8 @@ static void __init e740_init(void) | |||
| 153 | pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config)); | 157 | pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config)); |
| 154 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 158 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
| 155 | pxa_set_udc_info(&e7xx_udc_mach_info); | 159 | pxa_set_udc_info(&e7xx_udc_mach_info); |
| 160 | e7xx_irda_init(); | ||
| 161 | pxa_set_ficp_info(&e7xx_ficp_platform_data); | ||
| 156 | } | 162 | } |
| 157 | 163 | ||
| 158 | MACHINE_START(E740, "Toshiba e740") | 164 | MACHINE_START(E740, "Toshiba e740") |
diff --git a/arch/arm/mach-pxa/e750.c b/arch/arm/mach-pxa/e750.c index 640e738b85df..1410ad7e20b1 100644 --- a/arch/arm/mach-pxa/e750.c +++ b/arch/arm/mach-pxa/e750.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <mach/mfp-pxa25x.h> | 25 | #include <mach/mfp-pxa25x.h> |
| 26 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
| 27 | #include <mach/udc.h> | 27 | #include <mach/udc.h> |
| 28 | #include <mach/irda.h> | ||
| 28 | 29 | ||
| 29 | #include "generic.h" | 30 | #include "generic.h" |
| 30 | #include "eseries.h" | 31 | #include "eseries.h" |
| @@ -110,6 +111,8 @@ static void __init e750_init(void) | |||
| 110 | { | 111 | { |
| 111 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 112 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
| 112 | pxa_set_udc_info(&e7xx_udc_mach_info); | 113 | pxa_set_udc_info(&e7xx_udc_mach_info); |
| 114 | e7xx_irda_init(); | ||
| 115 | pxa_set_ficp_info(&e7xx_ficp_platform_data); | ||
| 113 | } | 116 | } |
| 114 | 117 | ||
| 115 | MACHINE_START(E750, "Toshiba e750") | 118 | MACHINE_START(E750, "Toshiba e750") |
diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c index d28849b50a14..ee79e33b1748 100644 --- a/arch/arm/mach-pxa/eseries.c +++ b/arch/arm/mach-pxa/eseries.c | |||
| @@ -12,6 +12,8 @@ | |||
| 12 | 12 | ||
| 13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
| 14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
| 15 | #include <linux/gpio.h> | ||
| 16 | #include <linux/platform_device.h> | ||
| 15 | 17 | ||
| 16 | #include <asm/setup.h> | 18 | #include <asm/setup.h> |
| 17 | #include <asm/mach/arch.h> | 19 | #include <asm/mach/arch.h> |
| @@ -21,6 +23,7 @@ | |||
| 21 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
| 22 | #include <mach/eseries-gpio.h> | 24 | #include <mach/eseries-gpio.h> |
| 23 | #include <mach/udc.h> | 25 | #include <mach/udc.h> |
| 26 | #include <mach/irda.h> | ||
| 24 | 27 | ||
| 25 | #include "generic.h" | 28 | #include "generic.h" |
| 26 | 29 | ||
| @@ -43,3 +46,43 @@ struct pxa2xx_udc_mach_info e7xx_udc_mach_info = { | |||
| 43 | .gpio_pullup_inverted = 1 | 46 | .gpio_pullup_inverted = 1 |
| 44 | }; | 47 | }; |
| 45 | 48 | ||
| 49 | static void e7xx_irda_transceiver_mode(struct device *dev, int mode) | ||
| 50 | { | ||
| 51 | if (mode & IR_OFF) { | ||
| 52 | gpio_set_value(GPIO_E7XX_IR_OFF, 1); | ||
| 53 | pxa2xx_transceiver_mode(dev, mode); | ||
| 54 | } else { | ||
| 55 | pxa2xx_transceiver_mode(dev, mode); | ||
| 56 | gpio_set_value(GPIO_E7XX_IR_OFF, 0); | ||
| 57 | } | ||
| 58 | } | ||
| 59 | |||
| 60 | int e7xx_irda_init(void) | ||
| 61 | { | ||
| 62 | int ret; | ||
| 63 | |||
| 64 | ret = gpio_request(GPIO_E7XX_IR_OFF, "IrDA power"); | ||
| 65 | if (ret) | ||
| 66 | goto out; | ||
| 67 | |||
| 68 | ret = gpio_direction_output(GPIO_E7XX_IR_OFF, 0); | ||
| 69 | if (ret) | ||
| 70 | goto out; | ||
| 71 | |||
| 72 | e7xx_irda_transceiver_mode(NULL, IR_SIRMODE | IR_OFF); | ||
| 73 | out: | ||
| 74 | return ret; | ||
| 75 | } | ||
| 76 | |||
| 77 | static void e7xx_irda_shutdown(struct device *dev) | ||
| 78 | { | ||
| 79 | e7xx_irda_transceiver_mode(dev, IR_SIRMODE | IR_OFF); | ||
| 80 | gpio_free(GPIO_E7XX_IR_OFF); | ||
| 81 | } | ||
| 82 | |||
| 83 | struct pxaficp_platform_data e7xx_ficp_platform_data = { | ||
| 84 | .transceiver_cap = IR_SIRMODE | IR_OFF, | ||
| 85 | .transceiver_mode = e7xx_irda_transceiver_mode, | ||
| 86 | .shutdown = e7xx_irda_shutdown, | ||
| 87 | }; | ||
| 88 | |||
diff --git a/arch/arm/mach-pxa/eseries.h b/arch/arm/mach-pxa/eseries.h index a83f88d4b6ad..bcfc589d6e22 100644 --- a/arch/arm/mach-pxa/eseries.h +++ b/arch/arm/mach-pxa/eseries.h | |||
| @@ -2,3 +2,6 @@ void __init eseries_fixup(struct machine_desc *desc, | |||
| 2 | struct tag *tags, char **cmdline, struct meminfo *mi); | 2 | struct tag *tags, char **cmdline, struct meminfo *mi); |
| 3 | 3 | ||
| 4 | extern struct pxa2xx_udc_mach_info e7xx_udc_mach_info; | 4 | extern struct pxa2xx_udc_mach_info e7xx_udc_mach_info; |
| 5 | extern struct pxaficp_platform_data e7xx_ficp_platform_data; | ||
| 6 | extern int e7xx_irda_init(void); | ||
| 7 | |||
diff --git a/arch/arm/mach-pxa/include/mach/eseries-gpio.h b/arch/arm/mach-pxa/include/mach/eseries-gpio.h index 4c90b1310270..794bc338b4df 100644 --- a/arch/arm/mach-pxa/include/mach/eseries-gpio.h +++ b/arch/arm/mach-pxa/include/mach/eseries-gpio.h | |||
| @@ -43,7 +43,7 @@ | |||
| 43 | #define GPIO_E800_PCMCIA_PWR1 73 | 43 | #define GPIO_E800_PCMCIA_PWR1 73 |
| 44 | 44 | ||
| 45 | /* e7xx IrDA power control */ | 45 | /* e7xx IrDA power control */ |
| 46 | #define GPIO_E7XX_IR_ON 38 | 46 | #define GPIO_E7XX_IR_OFF 38 |
| 47 | 47 | ||
| 48 | /* ASIC related GPIOs */ | 48 | /* ASIC related GPIOs */ |
| 49 | #define GPIO_ESERIES_TMIO_IRQ 5 | 49 | #define GPIO_ESERIES_TMIO_IRQ 5 |
