From: Peter Chen <hzpeterchen@gmail.com>
To: NeilBrown <neilb@suse.com>
Cc: Baolin Wang <baolin.wang@linaro.org>,
Felipe Balbi <balbi@kernel.org>,
Greg KH <gregkh@linuxfoundation.org>,
Sebastian Reichel <sre@kernel.org>,
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
robh@kernel.org, Jun Li <jun.li@nxp.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Ruslan Bilovol <ruslan.bilovol@gmail.com>,
Peter Chen <peter.chen@freescale.com>,
Alan Stern <stern@rowland.harvard.edu>,
grygorii.strashko@ti.com,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
Lee Jones <lee.jones@linaro.org>, Mark Brown <broonie@kernel.org>,
John Stultz <john.stultz@linaro.org>,
Charles Keepax <ckeepax@opensource.wolfsonmicro.com>,
patches@opensource.wolfsonmicro.com,
Linux PM list <linux-pm@vger.kernel>
Subject: Re: [PATCH v18 0/4] Introduce usb charger framework to deal with the usb gadget power negotation
Date: Wed, 9 Nov 2016 09:33:16 +0800 [thread overview]
Message-ID: <20161109013316.GA27425@b29397-desktop> (raw)
In-Reply-To: <87vavxn1v7.fsf@notabene.neil.brown.name>
On Wed, Nov 09, 2016 at 07:38:36AM +1100, NeilBrown wrote:
> On Tue, Nov 08 2016, Peter Chen wrote:
>
> > On Thu, Nov 03, 2016 at 12:25:42PM +1100, NeilBrown wrote:
> >>
> >>
> >>
> >> 2/ Change all usb phys to register an extcon and to send appropriate
> >> notifications. Many already do, but I don't think it is universal.
> >> It is probable that the extcon should be registered using common code
> >> instead of each phy driver having its own
> >> extcon_get_edev_by_phandle()
> >> or whatever.
> >> If the usb phy driver needs to look at battery charger registers to
> >> know what sort of cable was connected (which I believe is the case
> >> for the chips you are interested in), then it should do that.
> >
> > Not only USB PHY to register an extcon, but also for the drivers which
> > can detect USB charger type, it may be USB controller driver, USB type-c
> > driver, pmic driver, and these drivers may not have an extcon device
> > since the internal part can finish the vbus detect.
>
> Can you point to an example of the sort of hardware/driver you are
> referring to, preferably in the mainline kernel. Concrete examples make
> this sort of thing much easier to understand.
>
Eg, the nxp/fsl USB charger detector part, the register used to begin
the detection is in USB controller register region, and we also need to
use controller register to pull up dp to begin the secondary detect.
Since there is no USB charger framework, the code is not in mainline.
It finished an upstream version based on patch set in this thread [1]
Some SoCs uses chipidea IP doesn't need to use extcon to detect plugging
in/out, since the vbus pin connects to SoC's vbus pin.
The pmic has abilities to charger detection, eg, drivers/mfd/axp20x.c
and drivers/extcon/extcon-axp288.c.
> I think I would argue that if some piece of hardware can detect the USB
> charger type, then that piece of hardware is part of the "USB PHY", even
> if the hardware manufacturer has chosen to partition the register set in
> a way which doesn't make that obvious.
I agree with that the charger detect hardware is in the USB PHY part,
but some USB PHY's control is integrated in USB controller (eg, some
controller uses drivers/usb/phy/phy-generic.c as its PHY driver), so
we have to use controller register to finish some PHY function, eg
charger detection.
[1] https://www.spinics.net/lists/linux-usb/msg139425.html
--
Best Regards,
Peter Chen
next prev parent reply other threads:[~2016-11-09 1:33 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-19 2:37 [PATCH v18 0/4] Introduce usb charger framework to deal with the usb gadget power negotation Baolin Wang
[not found] ` <cover.1476780088.git.baolin.wang-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-10-19 2:37 ` [PATCH v18 1/4] usb: gadget: Introduce the usb charger framework Baolin Wang
2016-10-19 2:37 ` [PATCH v18 2/4] usb: gadget: Support for " Baolin Wang
2016-10-19 2:37 ` [PATCH v18 3/4] usb: gadget: Integrate with the usb gadget supporting for usb charger Baolin Wang
2016-10-19 2:37 ` [PATCH v18 4/4] power: wm831x_power: Support USB charger current limit management Baolin Wang
2016-10-27 7:33 ` [PATCH v18 0/4] Introduce usb charger framework to deal with the usb gadget power negotation Baolin Wang
2016-10-27 22:00 ` NeilBrown
2016-10-28 12:51 ` Baolin Wang
[not found] ` <CAMz4kuJPenbqf935EGW67UeqOiP48_Ti1Jf5YfJ_K=DEcrz++Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-28 17:03 ` Mark Brown
2016-10-31 11:25 ` Baolin Wang
2016-10-31 0:00 ` NeilBrown
2016-11-01 12:54 ` Baolin Wang
2016-11-03 1:25 ` NeilBrown
2016-11-07 8:14 ` Baolin Wang
2016-11-07 20:36 ` NeilBrown
2016-11-10 9:42 ` Baolin Wang
2016-11-14 4:21 ` NeilBrown
[not found] ` <87eg2ek7ye.fsf-wvvUuzkyo1HefUI2i7LXDhCRmIWqnp/j@public.gmane.org>
2016-11-14 12:04 ` Mark Brown
2016-11-14 21:35 ` NeilBrown
2016-11-15 5:03 ` Peter Chen
[not found] ` <87mvh1iw32.fsf-wvvUuzkyo1HefUI2i7LXDhCRmIWqnp/j@public.gmane.org>
2016-11-16 16:16 ` Mark Brown
2016-11-17 6:46 ` NeilBrown
2016-11-21 17:17 ` Mark Brown
2016-11-21 22:40 ` NeilBrown
2016-11-25 13:00 ` Mark Brown
2016-11-26 0:44 ` NeilBrown
2016-11-28 7:15 ` Baolin Wang
2016-11-14 12:36 ` Baolin Wang
2016-11-08 8:41 ` Peter Chen
2016-11-08 20:38 ` NeilBrown
2016-11-09 1:33 ` Peter Chen [this message]
2016-12-20 7:05 ` Baolin Wang
2016-12-20 22:07 ` NeilBrown
2016-12-21 2:54 ` Baolin Wang
2016-12-21 3:48 ` NeilBrown
2016-12-21 9:07 ` Baolin Wang
2016-12-21 23:47 ` NeilBrown
2016-12-22 7:06 ` Baolin Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161109013316.GA27425@b29397-desktop \
--to=hzpeterchen@gmail.com \
--cc=balbi@kernel.org \
--cc=baolin.wang@linaro.org \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.wolfsonmicro.com \
--cc=dbaryshkov@gmail.com \
--cc=dwmw2@infradead.org \
--cc=gregkh@linuxfoundation.org \
--cc=grygorii.strashko@ti.com \
--cc=john.stultz@linaro.org \
--cc=jun.li@nxp.com \
--cc=lee.jones@linaro.org \
--cc=linux-pm@vger.kernel \
--cc=m.szyprowski@samsung.com \
--cc=neilb@suse.com \
--cc=patches@opensource.wolfsonmicro.com \
--cc=peter.chen@freescale.com \
--cc=robh@kernel.org \
--cc=ruslan.bilovol@gmail.com \
--cc=sre@kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=yoshihiro.shimoda.uh@renesas.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).