From 1fcaea7e4c932b2bcc2612fafec6e1917944d192 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 13 Jul 2011 11:29:18 +0200 Subject: 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 [nicolas.ferre@atmel.com: added i variable declaration for the loop] Signed-off-by: Nicolas Ferre --- arch/arm/mach-at91/at91sam9g45_devices.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arch/arm/mach-at91/at91sam9g45_devices.c') diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c index 600bffb01ed..e4a98574893 100644 --- a/arch/arm/mach-at91/at91sam9g45_devices.c +++ b/arch/arm/mach-at91/at91sam9g45_devices.c @@ -124,6 +124,12 @@ void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data) at91_set_gpio_output(data->vbus_pin[i], 0); } + /* Enable overcurrent notification */ + for (i = 0; i < data->ports; i++) { + if (data->overcurrent_pin[i]) + at91_set_gpio_input(data->overcurrent_pin[i], 1); + } + usbh_ohci_data = *data; platform_device_register(&at91_usbh_ohci_device); } -- cgit v1.2.3-70-g09d2