aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2011-07-13 05:29:16 -0400
committerArnd Bergmann <arnd@arndb.de>2011-09-10 17:03:13 -0400
commite7da859e424ccc30d2ef87dbabf655ad3d59f291 (patch)
treee59f994cbaa45322bef762014190160b28f23e77
parent0af4316babb64c6703c113a89462ff7843767f24 (diff)
at91: ohci-at91: add vbus_pin_inverted platform attribute
The existing OHCI AT91 driver made the assumption that the enable input of the USB power switch was active low. However, some USB power switches such as the Micrel MIC2026-1 [1] have an active high input to enable the power. A new vbus_pin_inverted attribute is added to the at91_usbh_data structure so that board files can tell the OHCI driver if the vbus pin logic is active low or active high. [1] http://www.micrel.com/page.do?page=product-info/products/mic2026.shtml Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
-rw-r--r--arch/arm/mach-at91/include/mach/board.h1
-rw-r--r--drivers/usb/host/ohci-at91.c4
2 files changed, 3 insertions, 2 deletions
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
index ed544a0d5a1d..61d52dc05051 100644
--- a/arch/arm/mach-at91/include/mach/board.h
+++ b/arch/arm/mach-at91/include/mach/board.h
@@ -98,6 +98,7 @@ extern void __init at91_add_device_eth(struct at91_eth_data *data);
98struct at91_usbh_data { 98struct at91_usbh_data {
99 u8 ports; /* number of ports on root hub */ 99 u8 ports; /* number of ports on root hub */
100 u8 vbus_pin[2]; /* port power-control pin */ 100 u8 vbus_pin[2]; /* port power-control pin */
101 u8 vbus_pin_inverted;
101}; 102};
102extern void __init at91_add_device_usbh(struct at91_usbh_data *data); 103extern void __init at91_add_device_usbh(struct at91_usbh_data *data);
103extern void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data); 104extern void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data);
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index e08cb10d1aca..5dd381fc2ddb 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -279,7 +279,7 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)
279 if (pdata->vbus_pin[i] <= 0) 279 if (pdata->vbus_pin[i] <= 0)
280 continue; 280 continue;
281 gpio_request(pdata->vbus_pin[i], "ohci_vbus"); 281 gpio_request(pdata->vbus_pin[i], "ohci_vbus");
282 gpio_direction_output(pdata->vbus_pin[i], 0); 282 gpio_direction_output(pdata->vbus_pin[i], pdata->vbus_pin_inverted);
283 } 283 }
284 } 284 }
285 285
@@ -296,7 +296,7 @@ static int ohci_hcd_at91_drv_remove(struct platform_device *pdev)
296 for (i = 0; i < ARRAY_SIZE(pdata->vbus_pin); i++) { 296 for (i = 0; i < ARRAY_SIZE(pdata->vbus_pin); i++) {
297 if (pdata->vbus_pin[i] <= 0) 297 if (pdata->vbus_pin[i] <= 0)
298 continue; 298 continue;
299 gpio_direction_output(pdata->vbus_pin[i], 1); 299 gpio_direction_output(pdata->vbus_pin[i], !pdata->vbus_pin_inverted);
300 gpio_free(pdata->vbus_pin[i]); 300 gpio_free(pdata->vbus_pin[i]);
301 } 301 }
302 } 302 }