aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-sa1100/h3600.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c
index 559c2a0a40d9..a663e7230141 100644
--- a/arch/arm/mach-sa1100/h3600.c
+++ b/arch/arm/mach-sa1100/h3600.c
@@ -97,6 +97,11 @@ static void __init h3600_map_io(void)
97/* 97/*
98 * This turns the IRDA power on or off on the Compaq H3600 98 * This turns the IRDA power on or off on the Compaq H3600
99 */ 99 */
100static struct gpio h3600_irda_gpio[] = {
101 { H3600_EGPIO_IR_ON, GPIOF_OUT_INIT_LOW, "IrDA power" },
102 { H3600_EGPIO_IR_FSEL, GPIOF_OUT_INIT_LOW, "IrDA fsel" },
103};
104
100static int h3600_irda_set_power(struct device *dev, unsigned int state) 105static int h3600_irda_set_power(struct device *dev, unsigned int state)
101{ 106{
102 gpio_set_value(H3600_EGPIO_IR_ON, state); 107 gpio_set_value(H3600_EGPIO_IR_ON, state);
@@ -110,29 +115,12 @@ static void h3600_irda_set_speed(struct device *dev, unsigned int speed)
110 115
111static int h3600_irda_startup(struct device *dev) 116static int h3600_irda_startup(struct device *dev)
112{ 117{
113 int err = gpio_request(H3600_EGPIO_IR_ON, "IrDA power"); 118 return gpio_request_array(h3600_irda_gpio, sizeof(h3600_irda_gpio));
114 if (err)
115 goto err1;
116 err = gpio_direction_output(H3600_EGPIO_IR_ON, 0);
117 if (err)
118 goto err2;
119 err = gpio_request(H3600_EGPIO_IR_FSEL, "IrDA fsel");
120 if (err)
121 goto err2;
122 err = gpio_direction_output(H3600_EGPIO_IR_FSEL, 0);
123 if (err)
124 goto err3;
125 return 0;
126
127err3: gpio_free(H3600_EGPIO_IR_FSEL);
128err2: gpio_free(H3600_EGPIO_IR_ON);
129err1: return err;
130} 119}
131 120
132static void h3600_irda_shutdown(struct device *dev) 121static void h3600_irda_shutdown(struct device *dev)
133{ 122{
134 gpio_free(H3600_EGPIO_IR_ON); 123 return gpio_free_array(h3600_irda_gpio, sizeof(h3600_irda_gpio));
135 gpio_free(H3600_EGPIO_IR_FSEL);
136} 124}
137 125
138static struct irda_platform_data h3600_irda_data = { 126static struct irda_platform_data h3600_irda_data = {