]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
usb: host: max3421-hcd: Allow platform-data to specify Vbus polarity
authorDavid Mosberger-Tang <davidm@egauge.net>
Thu, 29 May 2014 16:23:55 +0000 (10:23 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 May 2014 18:19:30 +0000 (11:19 -0700)
Signed-off-by: Davidm Mosberger <davidm@egauge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/max3421-hcd.c
include/linux/platform_data/max3421-hcd.h

index ccb1bc42b4d24f09c5de3a2c804520e89e77eeca..fd3ed994fa4db05a7d880f6ecaa2a577f1809489 100644 (file)
@@ -1717,7 +1717,8 @@ max3421_hub_control(struct usb_hcd *hcd, u16 type_req, u16 value, u16 index,
                        break;
                case USB_PORT_FEAT_POWER:
                        dev_dbg(hcd->self.controller, "power-off\n");
-                       max3421_gpout_set_value(hcd, pdata->vbus_gpout, 0);
+                       max3421_gpout_set_value(hcd, pdata->vbus_gpout,
+                                               !pdata->vbus_active_level);
                        /* FALLS THROUGH */
                default:
                        max3421_hcd->port_status &= ~(1 << value);
@@ -1766,7 +1767,8 @@ max3421_hub_control(struct usb_hcd *hcd, u16 type_req, u16 value, u16 index,
                case USB_PORT_FEAT_POWER:
                        dev_dbg(hcd->self.controller, "power-on\n");
                        max3421_hcd->port_status |= USB_PORT_STAT_POWER;
-                       max3421_gpout_set_value(hcd, pdata->vbus_gpout, 1);
+                       max3421_gpout_set_value(hcd, pdata->vbus_gpout,
+                                               pdata->vbus_active_level);
                        break;
                case USB_PORT_FEAT_RESET:
                        max3421_reset_port(hcd);
index 4ad459605d87a5a572edffcca260f33d9b4e6875..0303d1970084d8324075ba239adafd998de4edf8 100644 (file)
@@ -18,6 +18,7 @@
  */
 struct max3421_hcd_platform_data {
        u8 vbus_gpout;                  /* pin controlling Vbus */
+       u8 vbus_active_level;           /* level that turns on power */
 };
 
 #endif /* MAX3421_HCD_PLAT_H_INCLUDED */