From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967354AbdEWKQQ (ORCPT ); Tue, 23 May 2017 06:16:16 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:42056 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967338AbdEWKQL (ORCPT ); Tue, 23 May 2017 06:16:11 -0400 X-AuditID: b6c32a58-f79896d000000567-1b-59240be9a676 MIME-version: 1.0 Content-transfer-encoding: 8BIT Content-type: text/plain; charset="UTF-8" Message-id: <59240BE8.5020908@samsung.com> Date: Tue, 23 May 2017 19:16:08 +0900 From: Chanwoo Choi Organization: Samsung Electronics User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 To: Damien Riegel , linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Felipe Balbi , Greg Kroah-Hartman , MyungJoo Ham , kernel@savoirfairelinux.com Subject: Re: [RFC][PATCH 0/3] add EXTCON_CHG_USB_* cables to MSM USB phy In-reply-to: <20170517131242.xjj2f2o3tswoq4we@workotop.localdomain> X-Brightmail-Tracker: H4sIAAAAAAAAA01SeUgUcRTut+POjNbmr63stWBtkxUKbjt72CjZQQcbBVlGaRE26eCKe9jO agcULh2adolhtiWaHeRWWJsdW9GamUH9o3YTWZBlWUGkdGK2s5PUf9/73vc93vt4NKGuJDV0 nsMtuBy8jSGjIi7fjo9PfD88LlM/+DGaa9vVTXG+k7dIbvvxRpLrPhxQcA+uHSW5+lM7Ce65 5zQ5h7L4fbtJS7DmLGXZ1+RDlocXahSWPv+ENOVqYaZV4HMEl1ZwZDtz8hy5qczi9Kx5WeYk PZvIJnMzGK2DtwupzPwlaYkL82yhNRhtEW8rDFFpvCgy02fNdDkL3YLW6hTdqcwaljXoWP0M ncFg0JmMa1MM5pBknWAd/FxHFgyM3/StalkxCkaXoUgasAlK/W1KGcdAe1cjWYaia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noAFmcDiu9/cYMNxOYXUJS4+uMxI8hMUYEIie4TlSBhEYFgibvr/oHdwCywh1Fi 2tH/YPXCAh4STy/OYAKxhQSuMErs3lgPYnMKOEvsPnKRcQKj4Cwkp85COHUWklMXMDKvYuRK LSjOTc8tNiow2sQIjK1th7UCdjA2nYs+xCjAwajEwzvDVTlSiDWxrLgy9xCjBAezkgjvRFaV SCHelMTKqtSi/Pii0pzU4kOMpkDfTWSWEk3OB8Z9Xkm8oYmlkYmBmZmhkYGxmZI474TALxFC AumJJanZqakFqUUwfUwcnFINjGaFSjcFntjJTpRbv5/1sMeUl7xRDIm535hO7QjcOWVNyk2D e5opfYnSc3kvXnIWbl3qbc9S1ZLm+uGrYu3L1EsrSthKPgt/SLB5uNz/jXT2D+EjEmcSFn04 If10rmL2yk8MU+LmRXzLakzySLj6p+PKvrhXa37nJdrcCHE7vsP//3XLbimjdCWW4oxEQy3m ouJEADEpsMvDAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170523101608epcas5p2eb85309f2673751235bd714dd5edb57b X-Msg-Generator: CA X-Sender-IP: 182.195.42.80 X-Local-Sender: =?UTF-8?B?7LWc7LCs7JqwG1RpemVuIFBsYXRmb3JtIExhYihTL1fshLw=?= =?UTF-8?B?7YSwKRvsgrzshLHsoITsnpAbU2VuaW9yIEVuZ2luZWVy?= X-Global-Sender: =?UTF-8?B?Q2hhbndvbyBDaG9pG1RpemVuIFBsYXRmb3JtIExhYi4bU2Ft?= =?UTF-8?B?c3VuZyBFbGVjdHJvbmljcxtTZW5pb3IgRW5naW5lZXI=?= X-Sender-Code: =?UTF-8?B?QzEwG1RFTEUbQzEwVjgxMTE=?= CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20170517131339epcas5p2a40af0b1c895877cc95af03834e78e7c X-RootMTR: 20170517131339epcas5p2a40af0b1c895877cc95af03834e78e7c References: <20170414184330.22296-1-damien.riegel@savoirfairelinux.com> <20170517131242.xjj2f2o3tswoq4we@workotop.localdomain> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 2017년 05월 17일 22:12, Damien Riegel wrote: > Hi, > > On Fri, Apr 14, 2017 at 02:43:27PM -0400, Damien Riegel wrote: >> 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. > > I wanted to know if someone has any comment to make on this patchset? > I'm currently working on the PMIC driver and it uses the EXTCON > notifications, so I just want to make sure it makes sense to do that. It looks like some strange situation. In this case, it seems like that usb phy just uses the extcon as a notifier chain. IMHO, USB PHY might handle the regulator provided by PMIC instead of extcon notifier as following: But, I'm not sure. It is just my opinion. +----------+ +--------------+ | gpio | | PMIC | +----------+ +--------------+ | | `----------+ | | regulator EXTCON_USB | events | \|/ \|/ +--------------+ | USB PHY | +--------------+ | \|/ USB PHY may determine how much current it can use to charge a battery according to the charger cable. Because USB PHY know the kind of connected charger cable. -- Best Regards, Chanwoo Choi Samsung Electronics