[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170414184330.22296-2-damien.riegel@savoirfairelinux.com>
Date: Fri, 14 Apr 2017 14:43:28 -0400
From: Damien Riegel <damien.riegel@...oirfairelinux.com>
To: linux-usb@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, Felipe Balbi <balbi@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
MyungJoo Ham <myungjoo.ham@...sung.com>,
Chanwoo Choi <cw00.choi@...sung.com>,
kernel@...oirfairelinux.com,
Damien Riegel <damien.riegel@...oirfairelinux.com>
Subject: [RFC][PATCH 1/3] usb: phy: msm: notify charger after setting charger info
Move calls to msm_otg_notify_charger after attributes chg_state and
chg_type have been set. That way the function can use them and not rely
only on the "mA" parameter.
Signed-off-by: Damien Riegel <damien.riegel@...oirfairelinux.com>
---
drivers/usb/phy/phy-msm-usb.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index 93d9aaad2994..c1460182bc56 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -1392,9 +1392,9 @@ static void msm_otg_sm_work(struct work_struct *w)
pm_runtime_put_sync(otg->usb_phy->dev);
msm_otg_reset(otg->usb_phy);
}
- msm_otg_notify_charger(motg, 0);
motg->chg_state = USB_CHG_STATE_UNDEFINED;
motg->chg_type = USB_INVALID_CHARGER;
+ msm_otg_notify_charger(motg, 0);
}
if (otg->state == OTG_STATE_B_IDLE)
@@ -1404,10 +1404,10 @@ static void msm_otg_sm_work(struct work_struct *w)
dev_dbg(otg->usb_phy->dev, "OTG_STATE_B_PERIPHERAL state\n");
if (!test_bit(B_SESS_VLD, &motg->inputs) ||
!test_bit(ID, &motg->inputs)) {
- msm_otg_notify_charger(motg, 0);
- msm_otg_start_peripheral(otg->usb_phy, 0);
motg->chg_state = USB_CHG_STATE_UNDEFINED;
motg->chg_type = USB_INVALID_CHARGER;
+ msm_otg_notify_charger(motg, 0);
+ msm_otg_start_peripheral(otg->usb_phy, 0);
otg->state = OTG_STATE_B_IDLE;
msm_otg_reset(otg->usb_phy);
schedule_work(w);
--
2.12.2
Powered by blists - more mailing lists