aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-at91rm9200/devices.c4
-rw-r--r--arch/arm/mach-at91rm9200/gpio.c17
-rw-r--r--include/asm-arm/arch-at91rm9200/gpio.h1
3 files changed, 21 insertions, 1 deletions
diff --git a/arch/arm/mach-at91rm9200/devices.c b/arch/arm/mach-at91rm9200/devices.c
index 8df3e5245651..57eedd5beaf6 100644
--- a/arch/arm/mach-at91rm9200/devices.c
+++ b/arch/arm/mach-at91rm9200/devices.c
@@ -100,8 +100,10 @@ void __init at91_add_device_udc(struct at91_udc_data *data)
100 at91_set_gpio_input(data->vbus_pin, 0); 100 at91_set_gpio_input(data->vbus_pin, 0);
101 at91_set_deglitch(data->vbus_pin, 1); 101 at91_set_deglitch(data->vbus_pin, 1);
102 } 102 }
103 if (data->pullup_pin) 103 if (data->pullup_pin) {
104 at91_set_gpio_output(data->pullup_pin, 0); 104 at91_set_gpio_output(data->pullup_pin, 0);
105 at91_set_multi_drive(data->pullup_pin, 1);
106 }
105 107
106 udc_data = *data; 108 udc_data = *data;
107 platform_device_register(&at91rm9200_udc_device); 109 platform_device_register(&at91rm9200_udc_device);
diff --git a/arch/arm/mach-at91rm9200/gpio.c b/arch/arm/mach-at91rm9200/gpio.c
index 2fd2ef583e4d..a9f718bf8ba8 100644
--- a/arch/arm/mach-at91rm9200/gpio.c
+++ b/arch/arm/mach-at91rm9200/gpio.c
@@ -159,6 +159,23 @@ int __init_or_module at91_set_deglitch(unsigned pin, int is_on)
159} 159}
160EXPORT_SYMBOL(at91_set_deglitch); 160EXPORT_SYMBOL(at91_set_deglitch);
161 161
162/*
163 * enable/disable the multi-driver; This is only valid for output and
164 * allows the output pin to run as an open collector output.
165 */
166int __init_or_module at91_set_multi_drive(unsigned pin, int is_on)
167{
168 void __iomem *pio = pin_to_controller(pin);
169 unsigned mask = pin_to_mask(pin);
170
171 if (!pio)
172 return -EINVAL;
173
174 __raw_writel(mask, pio + (is_on ? PIO_MDER : PIO_MDDR));
175 return 0;
176}
177EXPORT_SYMBOL(at91_set_multi_drive);
178
162/*--------------------------------------------------------------------------*/ 179/*--------------------------------------------------------------------------*/
163 180
164 181
diff --git a/include/asm-arm/arch-at91rm9200/gpio.h b/include/asm-arm/arch-at91rm9200/gpio.h
index 0f0a61e2f129..6176ab2dc417 100644
--- a/include/asm-arm/arch-at91rm9200/gpio.h
+++ b/include/asm-arm/arch-at91rm9200/gpio.h
@@ -183,6 +183,7 @@ extern int at91_set_B_periph(unsigned pin, int use_pullup);
183extern int at91_set_gpio_input(unsigned pin, int use_pullup); 183extern int at91_set_gpio_input(unsigned pin, int use_pullup);
184extern int at91_set_gpio_output(unsigned pin, int value); 184extern int at91_set_gpio_output(unsigned pin, int value);
185extern int at91_set_deglitch(unsigned pin, int is_on); 185extern int at91_set_deglitch(unsigned pin, int is_on);
186extern int at91_set_multi_drive(unsigned pin, int is_on);
186 187
187/* callable at any time */ 188/* callable at any time */
188extern int at91_set_gpio_value(unsigned pin, int value); 189extern int at91_set_gpio_value(unsigned pin, int value);