diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2011-07-13 05:29:18 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2011-09-10 17:03:13 -0400 |
commit | 1fcaea7e4c932b2bcc2612fafec6e1917944d192 (patch) | |
tree | a0b1d124ee43fb9496914c779e8aeafcdb731df9 /arch/arm/mach-at91/at91sam9261_devices.c | |
parent | aa6e52a35d388e730f4df0ec2ec48294590cc459 (diff) |
at91: at91-ohci: configure overcurrent pins as input GPIOs
As a new overcurrent_pin[] array has been added to the at91_usbh_data
structure, those pins must be muxed to work properly. This commit
implements this muxing for all AT91 SoCs that support the AT91 OHCI.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[nicolas.ferre@atmel.com: added i variable declaration for the loop]
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Diffstat (limited to 'arch/arm/mach-at91/at91sam9261_devices.c')
-rw-r--r-- | arch/arm/mach-at91/at91sam9261_devices.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index 0f917928eeb7..3b8fb79d6b10 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c | |||
@@ -64,9 +64,17 @@ static struct platform_device at91sam9261_usbh_device = { | |||
64 | 64 | ||
65 | void __init at91_add_device_usbh(struct at91_usbh_data *data) | 65 | void __init at91_add_device_usbh(struct at91_usbh_data *data) |
66 | { | 66 | { |
67 | int i; | ||
68 | |||
67 | if (!data) | 69 | if (!data) |
68 | return; | 70 | return; |
69 | 71 | ||
72 | /* Enable overcurrent notification */ | ||
73 | for (i = 0; i < data->ports; i++) { | ||
74 | if (data->overcurrent_pin[i]) | ||
75 | at91_set_gpio_input(data->overcurrent_pin[i], 1); | ||
76 | } | ||
77 | |||
70 | usbh_data = *data; | 78 | usbh_data = *data; |
71 | platform_device_register(&at91sam9261_usbh_device); | 79 | platform_device_register(&at91sam9261_usbh_device); |
72 | } | 80 | } |