From patchwork Wed Dec 21 07:22:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 9482655 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3B32160487 for ; Wed, 21 Dec 2016 07:34:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C3FE2811D for ; Wed, 21 Dec 2016 07:34:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 205BA28156; Wed, 21 Dec 2016 07:34:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C1DF52811D for ; Wed, 21 Dec 2016 07:34:26 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cJbOY-0007Ag-2W; Wed, 21 Dec 2016 07:33:02 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cJbOU-00075Y-D4; Wed, 21 Dec 2016 07:32:59 +0000 MIME-version: 1.0 Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OII00DVNXT6L770@mailout1.samsung.com>; Wed, 21 Dec 2016 16:22:36 +0900 (KST) X-AuditID: cbfee61a-f79bd6d000000fc6-15-585a2dbcb5b8 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id AD.53.04038.CBD2A585; Wed, 21 Dec 2016 16:22:36 +0900 (KST) Received: from [10.113.62.212] by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OII00IJUXTN4X30@mmp1.samsung.com>; Wed, 21 Dec 2016 16:22:36 +0900 (KST) Message-id: <585A2DBB.8070504@samsung.com> Date: Wed, 21 Dec 2016 16:22:35 +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: Baolin Wang , myungjoo.ham@samsung.com, wens@csie.org, kishon@ti.com, heiko@sntech.de Subject: Re: [PATCH 2/3] extcon: axp288: Set EXTCON_USB when EXTCON_CHG_USB_SDP was set References: <7b9836ce2ca34118a2acd1ea113605a5f13b4439.1482300213.git.baolin.wang@linaro.org> <11fb7adc2982a9134faee9abb1de4dcfb253f2d2.1482300213.git.baolin.wang@linaro.org> In-reply-to: <11fb7adc2982a9134faee9abb1de4dcfb253f2d2.1482300213.git.baolin.wang@linaro.org> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrFIsWRmVeSWpSXmKPExsVy+t9jAd09ulERBk9m8Fp8arjCbDH14RM2 i/+PXrNaXHjaw2bx/tAzZotNj6+xWlzeNYfN4tOD/8wWtxtXAFkbYy1+HjrP5MDtseHRalaP Tas62TzuXNvD5rF5Sb3H7X+PmT36tqxi9Nh+bR6zx/otV1k8jt/YzuTxeZNcAFeUm01GamJK apFCal5yfkpmXrqtUmiIm66FkkJeYm6qrVKErm9IkJJCWWJOKZBnZIAGHJwD3IOV9O0S3DL2 Xb/JUvBEsuLXoYvMDYw/hbsYOTgkBEwk9s3l6mLkBDLFJC7cW8/WxcjFISSwlFGid9osNpAE r4CgxI/J91hA6pkF5CWOXMoGCTMLqEtMmreIGaL+AaPEgx9TWSHqtSROtGwBs1kEVCWWXutn AbHZgOL7X9wAm8kvoChx9cdjRpCZogIREt0nKkHCIgLFEhMOLWYFmckssIlR4tmuSYwgCWGB SInLnw4xQixrZZL4cb4fLMEpEC+x6tNmlgmMgrOQ3DoL4dZZSG5dwMi8ilEitSC5oDgpPdcw L7Vcrzgxt7g0L10vOT93EyM4np9J7WA8uMv9EKMAB6MSD+8O68gIIdbEsuLK3EOMEhzMSiK8 G7WjIoR4UxIrq1KL8uOLSnNSiw8xmgI9O5FZSjQ5H5hq8kriDU3MTcyNDSzMLS1NjJTEeRtn PwsXEkhPLEnNTk0tSC2C6WPi4JRqYHRQj7D8Kc7eY3Vi5Rmzi9xT3R+fs14897VMiFTxRd8i 7lQz4UNKmU8/KCeG/E7/HRpY2nVna1FaVOnNmhP9ofMW/rYQamePtt3ieZ4p2X7WUU/rqbqT WDVPWLxrXV15iyNvLxerYnaZfdikcqtl2/nWnzllyr0xPl/e+H549dUzG7f3diUqKrEUZyQa ajEXFScCAIYbBRL9AgAA X-MTR: 20000000000000000@CPGS X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161220_233258_661944_5EBBEEF2 X-CRM114-Status: GOOD ( 17.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, neilb@suse.com, linux-rockchip@lists.infradead.org, broonie@kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, On 2016년 12월 21일 15:10, Baolin Wang wrote: > According to the documentation, we should set the EXTCON_USB when > one SDP charger connector was reported. > > Signed-off-by: Baolin Wang > --- > drivers/extcon/extcon-axp288.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c > index 42f41e8..4490726 100644 > --- a/drivers/extcon/extcon-axp288.c > +++ b/drivers/extcon/extcon-axp288.c > @@ -102,6 +102,7 @@ enum axp288_extcon_irq { > }; > > static const unsigned int axp288_extcon_cables[] = { > + EXTCON_USB, > EXTCON_CHG_USB_SDP, > EXTCON_CHG_USB_CDP, > EXTCON_CHG_USB_DCP, > @@ -225,8 +226,12 @@ static int axp288_handle_chrg_det_event(struct axp288_extcon_info *info) > vbus_attach ? USB_EVENT_VBUS : USB_EVENT_NONE, NULL); > } > > - if (notify_charger) > + if (notify_charger) { > extcon_set_state_sync(info->edev, cable, vbus_attach); > + if (cable == EXTCON_CHG_USB_SDP) > + extcon_set_state_sync(info->edev, EXTCON_USB, > + vbus_attach); > + } > > /* Clear the flags on disconnect event */ > if (!vbus_attach) > The extcon-axp288.c driver has some patches on extcon-next[1] branch. [1] https://git.kernel.org/cgit/linux/kernel/git/chanwoo/extcon.git/log/?h=extcon-next I rework your patch on extcon-next branch as following: If you ok, I'll merge it for v4.11. commit 1a96f92bdfab86d0b634e56092f543cad348fd0b Refs: extcon-next, extcon-next-for-4.10-15-g1a96f92bdfab Author: Baolin Wang AuthorDate: Wed Dec 21 15:51:26 2016 +0900 Commit: Chanwoo Choi CommitDate: Wed Dec 21 15:52:00 2016 +0900 extcon: axp288: Set EXTCON_USB when EXTCON_CHG_USB_SDP was set According to the documentation, we should set the EXTCON_USB when one SDP charger connector was reported. Signed-off-by: Baolin Wang Signed-off-by: Chanwoo Choi --- drivers/extcon/extcon-axp288.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c index 3e145e2a4860..f4fd03e58e37 100644 --- a/drivers/extcon/extcon-axp288.c +++ b/drivers/extcon/extcon-axp288.c @@ -96,6 +96,7 @@ enum axp288_extcon_irq { EXTCON_CHG_USB_SDP, EXTCON_CHG_USB_CDP, EXTCON_CHG_USB_DCP, + EXTCON_USB, EXTCON_NONE, }; @@ -206,8 +207,15 @@ static int axp288_handle_chrg_det_event(struct axp288_extcon_info *info) : EXTCON_GPIO_MUX_SEL_PMIC); extcon_set_state_sync(info->edev, info->previous_cable, false); + if (info->previous_cable == EXTCON_CHG_USB_SDP) + extcon_set_state_sync(info->edev, EXTCON_USB, false); + if (vbus_attach) { extcon_set_state_sync(info->edev, cable, vbus_attach); + if (cable == EXTCON_CHG_USB_SDP) + extcon_set_state_sync(info->edev, EXTCON_USB, + vbus_attach); + info->previous_cable = cable; }