aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/eseries.c
diff options
context:
space:
mode:
authorIan Molton <spyro@f2s.com>2008-08-24 14:21:26 -0400
committerIan Molton <spyro@f2s.com>2008-11-29 18:26:36 -0500
commit36033422639913dad1f3146d452116522c77f753 (patch)
treef0865621035f9deedcab470e8267b7d19a3bf4ed /arch/arm/mach-pxa/eseries.c
parent5e1dbdb458ada37f7e97265cb2ea87c55fd5d034 (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>
Diffstat (limited to 'arch/arm/mach-pxa/eseries.c')
-rw-r--r--arch/arm/mach-pxa/eseries.c43
1 files changed, 43 insertions, 0 deletions
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
49static 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
60int 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);
73out:
74 return ret;
75}
76
77static 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
83struct 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