summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@nxp.com>2018-10-22 16:20:02 +0800
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:34:48 +0800
commit7356c99576ddff45070ab57850e60c3bd7b16e77 (patch)
tree4cfb37801e5993e59ac76a7ff1634ad08074c767
parente0a8e75896ed7991c5240c75b514f92e59833c1d (diff)
MLK-20011-2 usb: chipidea: delete DP pullup for secondary charger detection
Since the DP pullup can be finished at glue layer, we can delete it at common code, but we still need to keep DP pulldown operation since the DP may have already pulled up before. Reviewed-by: Jun Li <jun.li@nxp.com> Signed-off-by: Peter Chen <peter.chen@nxp.com>
-rw-r--r--drivers/usb/chipidea/core.c5
-rw-r--r--drivers/usb/chipidea/udc.c12
-rw-r--r--include/linux/usb/chipidea.h2
3 files changed, 4 insertions, 15 deletions
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 7d8002d92249..67f6e3b44669 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -1095,8 +1095,11 @@ static int ci_hdrc_probe(struct platform_device *pdev)
ci->role = ci_get_role(ci);
/* only update vbus status for peripheral */
- if (ci->role == CI_ROLE_GADGET)
+ if (ci->role == CI_ROLE_GADGET) {
+ /* Let DP pull down if it isn't currently */
+ hw_write(ci, OP_USBCMD, USBCMD_RS, 0);
ci_handle_vbus_connected(ci);
+ }
if (!ci_otg_is_fsm_mode(ci)) {
ret = ci_role_start(ci, ci->role);
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 0a54bed64ee3..dd44f594dca1 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -2023,20 +2023,8 @@ int ci_usb_charger_connect(struct ci_hdrc *ci, int is_active)
usb_phy_set_charger_state(ci->usb_phy, is_active ?
USB_CHARGER_PRESENT : USB_CHARGER_ABSENT);
} else if (ci->platdata->notify_event) {
- if (is_active)
- hw_write(ci, OP_USBCMD, USBCMD_RS, 0);
-
ret = ci->platdata->notify_event(ci,
CI_HDRC_CONTROLLER_VBUS_EVENT);
- if (ret == CI_HDRC_NOTIFY_RET_DEFER_EVENT) {
- hw_device_reset(ci);
- /* Pull up dp */
- hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS);
- ci->platdata->notify_event(ci,
- CI_HDRC_CONTROLLER_CHARGER_POST_EVENT);
- /* Pull down dp */
- hw_write(ci, OP_USBCMD, USBCMD_RS, 0);
- }
schedule_work(&ci->usb_phy->chg_work);
}
out:
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
index ba2c49047434..f572e1e01c63 100644
--- a/include/linux/usb/chipidea.h
+++ b/include/linux/usb/chipidea.h
@@ -70,8 +70,6 @@ struct ci_hdrc_platform_data {
#define CI_HDRC_CONTROLLER_RESET_EVENT 0
#define CI_HDRC_CONTROLLER_STOPPED_EVENT 1
#define CI_HDRC_CONTROLLER_VBUS_EVENT 2
-#define CI_HDRC_NOTIFY_RET_DEFER_EVENT 3
-#define CI_HDRC_CONTROLLER_CHARGER_POST_EVENT 4
#define CI_HDRC_IMX_HSIC_ACTIVE_EVENT 5
#define CI_HDRC_IMX_HSIC_SUSPEND_EVENT 6
#define CI_HDRC_IMX_TERM_SELECT_OVERRIDE_FS 7