ar71xx: fix WNDR3x00 model detection
[openwrt.git] / target / linux / at91 / patches / 600-usb_vbus_active_high.patch
1 --- a/arch/arm/mach-at91/at91cap9_devices.c
2 +++ b/arch/arm/mach-at91/at91cap9_devices.c
3 @@ -77,7 +77,7 @@ void __init at91_add_device_usbh(struct
4 /* Enable VBus control for UHP ports */
5 for (i = 0; i < data->ports; i++) {
6 if (data->vbus_pin[i])
7 - at91_set_gpio_output(data->vbus_pin[i], 0);
8 + at91_set_gpio_output(data->vbus_pin[i], data->vbus_active_high);
9 }
10
11 usbh_data = *data;
12 --- a/arch/arm/mach-at91/at91sam9263_devices.c
13 +++ b/arch/arm/mach-at91/at91sam9263_devices.c
14 @@ -71,7 +71,7 @@ void __init at91_add_device_usbh(struct
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);
20 }
21
22 usbh_data = *data;
23 --- a/arch/arm/mach-at91/at91sam9g45_devices.c
24 +++ b/arch/arm/mach-at91/at91sam9g45_devices.c
25 @@ -121,7 +121,7 @@ void __init at91_add_device_usbh_ohci(st
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);
31 }
32
33 usbh_ohci_data = *data;
34 @@ -176,7 +176,7 @@ void __init at91_add_device_usbh_ehci(st
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);
40 }
41
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
45 @@ -96,8 +96,9 @@ extern void __init at91_add_device_eth(s
46
47 /* USB Host */
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 */
54 };
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
59 @@ -277,14 +277,13 @@ static int ohci_hcd_at91_drv_probe(struc
60 if (pdata) {
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.
66 */
67 for (i = 0; i < ARRAY_SIZE(pdata->vbus_pin); i++) {
68 if (pdata->vbus_pin[i] <= 0)
69 continue;
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);
73 }
74 }
75
76 @@ -301,7 +300,7 @@ static int ohci_hcd_at91_drv_remove(stru
77 for (i = 0; i < ARRAY_SIZE(pdata->vbus_pin); i++) {
78 if (pdata->vbus_pin[i] <= 0)
79 continue;
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]);
83 }
84 }
This page took 0.053692 seconds and 5 git commands to generate.