1 --- a/arch/arm/mach-at91/at91cap9_devices.c
2 +++ b/arch/arm/mach-at91/at91cap9_devices.c
4 /* Enable VBus control for UHP ports */
5 for (i = 0; i < data->ports; i++) {
7 - at91_set_gpio_output(data->vbus_pin[i], 0);
8 + at91_set_gpio_output(data->vbus_pin[i], data->vbus_active_high);
12 --- a/arch/arm/mach-at91/at91sam9263_devices.c
13 +++ b/arch/arm/mach-at91/at91sam9263_devices.c
15 /* Enable VBus control for UHP ports */
16 for (i = 0; i < data->ports; i++) {
17 if (data->vbus_pin[i])
18 - at91_set_gpio_output(data->vbus_pin[i], 0);
19 + at91_set_gpio_output(data->vbus_pin[i], data->vbus_active_high);
23 --- a/arch/arm/mach-at91/at91sam9g45_devices.c
24 +++ b/arch/arm/mach-at91/at91sam9g45_devices.c
26 /* Enable VBus control for UHP ports */
27 for (i = 0; i < data->ports; i++) {
28 if (data->vbus_pin[i])
29 - at91_set_gpio_output(data->vbus_pin[i], 0);
30 + at91_set_gpio_output(data->vbus_pin[i], data->vbus_active_high);
33 usbh_ohci_data = *data;
35 /* Enable VBus control for UHP ports */
36 for (i = 0; i < data->ports; i++) {
37 if (data->vbus_pin[i])
38 - at91_set_gpio_output(data->vbus_pin[i], 0);
39 + at91_set_gpio_output(data->vbus_pin[i], data->vbus_active_high);
42 usbh_ehci_data = *data;
43 --- a/arch/arm/mach-at91/include/mach/board.h
44 +++ b/arch/arm/mach-at91/include/mach/board.h
48 struct at91_usbh_data {
49 - u8 ports; /* number of ports on root hub */
50 - u8 vbus_pin[2]; /* port power-control pin */
51 + u8 ports; /* number of ports on root hub */
52 + u8 vbus_pin[2]; /* port power-control pin */
53 + u8 vbus_active_high; /* true == vbus_pins are active high */
55 extern void __init at91_add_device_usbh(struct at91_usbh_data *data);
56 extern void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data);
57 --- a/drivers/usb/host/ohci-at91.c
58 +++ b/drivers/usb/host/ohci-at91.c
61 /* REVISIT make the driver support per-port power switching,
62 * and also overcurrent detection. Here we assume the ports
63 - * are always powered while this driver is active, and use
64 - * active-low power switches.
65 + * are always powered while this driver is active.
67 for (i = 0; i < ARRAY_SIZE(pdata->vbus_pin); i++) {
68 if (pdata->vbus_pin[i] <= 0)
70 gpio_request(pdata->vbus_pin[i], "ohci_vbus");
71 - gpio_direction_output(pdata->vbus_pin[i], 0);
72 + gpio_direction_output(pdata->vbus_pin[i], pdata->vbus_active_high);
77 for (i = 0; i < ARRAY_SIZE(pdata->vbus_pin); i++) {
78 if (pdata->vbus_pin[i] <= 0)
80 - gpio_direction_output(pdata->vbus_pin[i], 1);
81 + gpio_direction_output(pdata->vbus_pin[i], !pdata->vbus_active_high);
82 gpio_free(pdata->vbus_pin[i]);