summaryrefslogtreecommitdiff
path: root/drivers/usb/chipidea/core.c
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@nxp.com>2018-10-08 17:43:45 +0800
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:34:39 +0800
commitfa166b2d940660da6165ad2d169f87b02ad98198 (patch)
treed763208982e7ab93736b9dd950977d4b43ed8c85 /drivers/usb/chipidea/core.c
parent5ddd52920713c374960633b053577743d78648be (diff)
MLK-19850-6 usb: chipidea: introduce flag for enable USB PHY charger detection
Some platforms may want to use USB PHY charger detection function when VBUS is there, add one flag for it. The user can enable it at firmware. Reviewed-by: Jun Li <jun.li@nxp.com> Signed-off-by: Peter Chen <peter.chen@nxp.com>
Diffstat (limited to 'drivers/usb/chipidea/core.c')
-rw-r--r--drivers/usb/chipidea/core.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index b850178694b6..7d8002d92249 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -690,6 +690,12 @@ static int ci_get_platdata(struct device *dev,
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")) {