From 98a6be105ad00b6e11822989909cd465669e9d74 Mon Sep 17 00:00:00 2001 From: Jack Pham Date: Thu, 21 May 2020 18:38:21 -0700 Subject: [PATCH] usb: phy: qmp: Call chain notifier for cable connect/disconnect USB PHY base already has an atomic notifier chain that clients can register for using usb_register_notifier(). Use the call chain to indicate cable connect and disconnect status for interested clients. Change-Id: I73f7df8fbd14cb2ee99739d6f7b6cc946fb1783c Signed-off-by: Jack Pham --- drivers/usb/phy/phy-msm-ssusb-qmp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/phy/phy-msm-ssusb-qmp.c b/drivers/usb/phy/phy-msm-ssusb-qmp.c index b220c72b711a..d8f27da371d5 100644 --- a/drivers/usb/phy/phy-msm-ssusb-qmp.c +++ b/drivers/usb/phy/phy-msm-ssusb-qmp.c @@ -742,7 +742,8 @@ static int msm_ssphy_qmp_notify_connect(struct usb_phy *uphy, dev_dbg(uphy->dev, "QMP phy connect notification\n"); phy->cable_connected = true; - dev_dbg(uphy->dev, "cable_connected=%d\n", phy->cable_connected); + atomic_notifier_call_chain(&uphy->notifier, 1, uphy); + return 0; } @@ -752,6 +753,7 @@ static int msm_ssphy_qmp_notify_disconnect(struct usb_phy *uphy, struct msm_ssphy_qmp *phy = container_of(uphy, struct msm_ssphy_qmp, phy); + atomic_notifier_call_chain(&uphy->notifier, 0, uphy); writel_relaxed(0x00, phy->base + phy->phy_reg[USB3_PHY_POWER_DOWN_CONTROL]); readl_relaxed(phy->base + phy->phy_reg[USB3_PHY_POWER_DOWN_CONTROL]); @@ -759,6 +761,7 @@ static int msm_ssphy_qmp_notify_disconnect(struct usb_phy *uphy, dev_dbg(uphy->dev, "QMP phy disconnect notification\n"); dev_dbg(uphy->dev, " cable_connected=%d\n", phy->cable_connected); phy->cable_connected = false; + return 0; }