diff options
Diffstat (limited to 'arch/arm/mach-at91rm9200')
-rw-r--r-- | arch/arm/mach-at91rm9200/devices.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-at91rm9200/gpio.c | 17 |
2 files changed, 20 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 | } |
160 | EXPORT_SYMBOL(at91_set_deglitch); | 160 | EXPORT_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 | */ | ||
166 | int __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 | } | ||
177 | EXPORT_SYMBOL(at91_set_multi_drive); | ||
178 | |||
162 | /*--------------------------------------------------------------------------*/ | 179 | /*--------------------------------------------------------------------------*/ |
163 | 180 | ||
164 | 181 | ||