Commit 8134ff55 authored by Jean-Christophe PLAGNIOL-VILLARD's avatar Jean-Christophe PLAGNIOL-VILLARD Committed by Nicolas Ferre

ARM/USB: at91/ohci-at91: rename vbus_pin_inverted to vbus_pin_active_low

Allows to configure independently the vbus_pin associated with each port.
Matches usual naming scheme.
Signed-off-by: default avatarJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
Cc: linux-usb@vger.kernel.org
parent 6813463c
...@@ -88,7 +88,7 @@ extern void __init at91_add_device_eth(struct macb_platform_data *data); ...@@ -88,7 +88,7 @@ extern void __init at91_add_device_eth(struct macb_platform_data *data);
struct at91_usbh_data { struct at91_usbh_data {
u8 ports; /* number of ports on root hub */ u8 ports; /* number of ports on root hub */
int vbus_pin[2]; /* port power-control pin */ int vbus_pin[2]; /* port power-control pin */
u8 vbus_pin_inverted; u8 vbus_pin_active_low[2];
u8 overcurrent_supported; u8 overcurrent_supported;
int overcurrent_pin[2]; int overcurrent_pin[2];
u8 overcurrent_status[2]; u8 overcurrent_status[2];
......
...@@ -244,7 +244,8 @@ static void ohci_at91_usb_set_power(struct at91_usbh_data *pdata, int port, int ...@@ -244,7 +244,8 @@ static void ohci_at91_usb_set_power(struct at91_usbh_data *pdata, int port, int
if (!gpio_is_valid(pdata->vbus_pin[port])) if (!gpio_is_valid(pdata->vbus_pin[port]))
return; return;
gpio_set_value(pdata->vbus_pin[port], !pdata->vbus_pin_inverted ^ enable); gpio_set_value(pdata->vbus_pin[port],
!pdata->vbus_pin_active_low[port] ^ enable);
} }
static int ohci_at91_usb_get_power(struct at91_usbh_data *pdata, int port) static int ohci_at91_usb_get_power(struct at91_usbh_data *pdata, int port)
...@@ -255,7 +256,8 @@ static int ohci_at91_usb_get_power(struct at91_usbh_data *pdata, int port) ...@@ -255,7 +256,8 @@ static int ohci_at91_usb_get_power(struct at91_usbh_data *pdata, int port)
if (!gpio_is_valid(pdata->vbus_pin[port])) if (!gpio_is_valid(pdata->vbus_pin[port]))
return -EINVAL; return -EINVAL;
return gpio_get_value(pdata->vbus_pin[port]) ^ !pdata->vbus_pin_inverted; return gpio_get_value(pdata->vbus_pin[port]) ^
!pdata->vbus_pin_active_low[port];
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment