Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933593AbcKHUi5 (ORCPT ); Tue, 8 Nov 2016 15:38:57 -0500 Received: from mx2.suse.de ([195.135.220.15]:59593 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932329AbcKHUi4 (ORCPT ); Tue, 8 Nov 2016 15:38:56 -0500 From: NeilBrown To: Peter Chen Date: Wed, 09 Nov 2016 07:38:36 +1100 Cc: Baolin Wang , Felipe Balbi , Greg KH , Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , robh@kernel.org, Jun Li , Marek Szyprowski , Ruslan Bilovol , Peter Chen , Alan Stern , grygorii.strashko@ti.com, Yoshihiro Shimoda , Lee Jones , Mark Brown , John Stultz , Charles Keepax , patches@opensource.wolfsonmicro.com, Linux PM list , USB , device-mainlining@lists.linuxfoundation.org, LKML Subject: Re: [PATCH v18 0/4] Introduce usb charger framework to deal with the usb gadget power negotation In-Reply-To: <20161108084133.GA12276@b29397-desktop> References: <87k2cttptn.fsf@notabene.neil.brown.name> <87a8dls7yn.fsf@notabene.neil.brown.name> <871sytqrqh.fsf@notabene.neil.brown.name> <20161108084133.GA12276@b29397-desktop> User-Agent: Notmuch/0.22.1 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-suse-linux-gnu) Message-ID: <87vavxn1v7.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2350 Lines: 56 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, Nov 08 2016, Peter Chen wrote: > On Thu, Nov 03, 2016 at 12:25:42PM +1100, NeilBrown wrote: >>=20 >>=20 >>=20 >> 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. 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. NeilBrown --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJYIjfMAAoJEDnsnt1WYoG5HP8P/3IBkoGhYReqGAJBR9SCJDAA i9pI57WGiObpJFi2LE/QXmT+fYCNsO3pdo63ZdaM2txEfyGMzkt5yIoHdxBs1arA oZtCIIA+XgqAdjs7TThGgvcNpIl7dOOEklElCocH/k4UcoLldQ4SJFY389sIZbhR vboJuEibRB0cD/ydKvZkjDSL5VZyHzOHUij+nz1gtznqlko2yfppVDVzVsE/cVRx VUX+gAn/sLME+kKp/SNvJEUM6SDocYZXefIwVvZK+13VTmb3px8GrEgs8P0rrYy7 a36osZswY1Rl5EJATvJNfi5EQFb/iugzaHR4+KNLLALx8G/ZnCRk5lGFPthcvgRc 7SG+JvohxPUKiDL9M7DXbh+mw0zH9bq3mtRwCXpmWFA/CHtvwYNNuMWLhovsCgoA zRzVetvMbTKhXTFk/bvJX3BWhfkqclHfSxP2GXRp9rradLqvmSl66RoixJ9uRvLl AKT/a0LTV38U8zkFQ1A2dKrNFfmD1Aqpc3rpMeTjy+dPXj9qSyDMQkfdL5vOajvw 6RZLswTsVLkKpsCB02eywo5XqzeTJOgD/rHAVRRrCoNgfhP3+Ka4nMOVsB7AghjX KdmWHKxsHORoblGpSD7v6ZA/Ft2TC923dlszKjYeTusU1Fja+YIpEUI8MEo6h6t5 8C+7zSCfww1Hkv82gOPV =lT8y -----END PGP SIGNATURE----- --=-=-=--