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. 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