public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 0/3] add EXTCON_CHG_USB_* cables to MSM USB phy
@ 2017-04-14 18:43 Damien Riegel
  2017-04-14 18:43 ` [RFC][PATCH 1/3] usb: phy: msm: notify charger after setting charger info Damien Riegel
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Damien Riegel @ 2017-04-14 18:43 UTC (permalink / raw)
  To: linux-usb
  Cc: linux-kernel, Felipe Balbi, Greg Kroah-Hartman, MyungJoo Ham,
	Chanwoo Choi, kernel, Damien Riegel

This patchset adds a way for the MSM USB phy to notify a power supply
when the charging state changes. It achieves that using the extcon
subsystem.

The first patch makes sure msm_otg_notify_charger is called after the
charger attributes have been set.
The second one makes sure that function is called when unplugging a
"in-the-wall" charger.
The last one adds EXTCON_CHG_USB_* cables to the phy.


I send this patchset as RFC because it seems a bit peculiar to have
different drivers that generate the EXTCON_USB_* and EXTCON_CHG_USB_*
events, so I want to make sure to get things right.

As far as I can tell, all the drivers in the kernel that have USB
charger events also have the EXTCON_USB one. In this case, this patchset
would make things a bit different for the MSM phy:

       +----------+      +--------------+
       |   gpio   |      |     PMIC     |<-+
       +----------+      +--------------+  |
           |                    |          |
           `--------------------+          |  EXTCON_CHG_USB_*
                                |          |       events
                    EXTCON_USB  |          |
                      events    |          |
                               \|/         |
                         +--------------+  |
                         |   USB PHY    |--+
                         +--------------+
       
Text version: EXTCON_USB comes from a GPIO or a PMIC, that triggers a
notifier in the USB phy. That notifier will determine the new
EXTCON_CHG_USB_XXX state and the PMIC will be notified about it and
determine how much current it can use to charge a battery.

Please let me know if this is the correct way to go.
 

Damien Riegel (3):
  usb: phy: msm: notify charger after setting charger info
  usb: phy: msm: notify charger when power supply is unplugged
  usb: phy: msm: use extcon to notify charger

 drivers/usb/phy/phy-msm-usb.c | 47 ++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 44 insertions(+), 3 deletions(-)

-- 
2.12.2

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-05-23 10:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-14 18:43 [RFC][PATCH 0/3] add EXTCON_CHG_USB_* cables to MSM USB phy Damien Riegel
2017-04-14 18:43 ` [RFC][PATCH 1/3] usb: phy: msm: notify charger after setting charger info Damien Riegel
2017-04-14 18:43 ` [RFC][PATCH 2/3] usb: phy: msm: notify charger when power supply is unplugged Damien Riegel
2017-04-14 18:43 ` [RFC][PATCH 3/3] usb: phy: msm: use extcon to notify charger Damien Riegel
2017-05-17 13:12 ` [RFC][PATCH 0/3] add EXTCON_CHG_USB_* cables to MSM USB phy Damien Riegel
2017-05-23 10:16   ` Chanwoo Choi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox