mux state of 1 indicates host mode.
- mux-control-names: Shall be "usb_switch" if mux-controls is specified.
- ci-disable-lpm: Some chipidea hardware need to disable low power mode
+- phy-charger-detection: enable USB PHY charger detection function
i.mx specific properties
- fsl,usbmisc: phandler of non-core register device, with one
if (of_find_property(dev->of_node, "non-zero-ttctrl-ttha", NULL))
platdata->flags |= CI_HDRC_SET_NON_ZERO_TTHA;
+ /* "imx-usb-charger-detection is legacy compatible */
+ if (of_find_property(dev->of_node, "phy-charger-detection", NULL) ||
+ of_find_property(dev->of_node, "imx-usb-charger-detection",
+ NULL))
+ platdata->flags |= CI_HDRC_PHY_CHARGER_DETECTION;
+
ext_id = ERR_PTR(-ENODEV);
ext_vbus = ERR_PTR(-ENODEV);
if (of_property_read_bool(dev->of_node, "extcon")) {
if (is_active)
pm_runtime_get_sync(ci->dev);
+ if (!(ci->platdata->flags & CI_HDRC_PHY_CHARGER_DETECTION))
+ goto out;
+
if (ci->usb_phy->charger_detect) {
usb_phy_set_charger_state(ci->usb_phy, is_active ?
USB_CHARGER_PRESENT : USB_CHARGER_ABSENT);
}
schedule_work(&ci->usb_phy->chg_work);
}
+out:
if (!is_active)
pm_runtime_put_sync(ci->dev);
#define CI_HDRC_IMX_IS_HSIC BIT(15)
/* need request pmqos during low power */
#define CI_HDRC_PMQOS BIT(16)
+/* Using PHY's charger detection */
+#define CI_HDRC_PHY_CHARGER_DETECTION BIT(17)
enum usb_dr_mode dr_mode;
#define CI_HDRC_CONTROLLER_RESET_EVENT 0
#define CI_HDRC_CONTROLLER_STOPPED_EVENT 1