提交 4055e5e5 编写于 作者: D David Mosberger-Tang 提交者: Greg Kroah-Hartman

usb: host: max3421-hcd: Allow platform-data to specify Vbus polarity

Signed-off-by: NDavidm Mosberger <davidm@egauge.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 05dfa5c9
......@@ -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);
......
......@@ -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 */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册