diff options
| author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-13 00:19:20 +0800 |
|---|---|---|
| committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-13 00:19:20 +0800 |
| commit | 68556ca1e03d6a35be3b315eba58df2f8176e3a0 (patch) | |
| tree | 36a390d29a0d03a59a90c0f223b0d98a80f0f6c3 /drivers/usb/host/ohci-at91.c | |
| parent | 0604ca48f1689ad06144b81f5c08f297b6edd831 (diff) | |
| parent | 8ab30691826fc05efa47c4ffba19b80496bb3a2c (diff) | |
Merge branch 'mfd/wm8994' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc into for-3.3
Diffstat (limited to 'drivers/usb/host/ohci-at91.c')
| -rw-r--r-- | drivers/usb/host/ohci-at91.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index ba3a46b78b75..95a9fec38e89 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -223,6 +223,9 @@ static void ohci_at91_usb_set_power(struct at91_usbh_data *pdata, int port, int if (port < 0 || port >= 2) return; + if (pdata->vbus_pin[port] <= 0) + return; + gpio_set_value(pdata->vbus_pin[port], !pdata->vbus_pin_inverted ^ enable); } @@ -231,6 +234,9 @@ static int ohci_at91_usb_get_power(struct at91_usbh_data *pdata, int port) if (port < 0 || port >= 2) return -EINVAL; + if (pdata->vbus_pin[port] <= 0) + return -EINVAL; + return gpio_get_value(pdata->vbus_pin[port]) ^ !pdata->vbus_pin_inverted; } |
