From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753178AbcLSGgN (ORCPT ); Mon, 19 Dec 2016 01:36:13 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:48557 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751997AbcLSGgM (ORCPT ); Mon, 19 Dec 2016 01:36:12 -0500 MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 X-AuditID: cbfee61b-f79d86d00000197e-f6-58577fda571b Content-transfer-encoding: 8BIT Message-id: <58577FD9.7030109@samsung.com> Date: Mon, 19 Dec 2016 15:36:09 +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: Hans de Goede , MyungJoo Ham Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/8] extcon: axp288: Use vbus-valid instead of -present to determine cable presence References: <20161219001313.13402-1-hdegoede@redhat.com> <20161219001313.13402-6-hdegoede@redhat.com> In-reply-to: <20161219001313.13402-6-hdegoede@redhat.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrIIsWRmVeSWpSXmKPExsVy+t9jAd1b9eERBle/cVi8OT6dyeLyrjls FrcbV7A5MHu833eVzaNvyypGj8+b5AKYo9xsMlITU1KLFFLzkvNTMvPSbZVCQ9x0LZQU8hJz U22VInR9Q4KUFMoSc0qBPCMDNODgHOAerKRvl+CWsfDJHpaCyTwVHxc9ZmpgfM7ZxcjJISFg IrGus5UVwhaTuHBvPVsXIxeHkMBSRoknc44ygyR4BQQlfky+x9LFyMHBLCAvceRSNkiYWUBd YtK8RcwQ9Q8YJZbvP8QGUa8l8bh9E5jNIqAqcbzrAwuIzQYU3//iBlicX0BR4uqPx4wgM0UF IiS6T1SChEUEAiR+nupnh5ivIPHr3iaw24QFMiV2Tn8PtWs3o8T/w3/AijgFLCXOvn3FMoFR cBaSU2chnDoLyakLGJlXMUqkFiQXFCel5xrlpZbrFSfmFpfmpesl5+duYgRHzzPpHYyHd7kf YhTgYFTi4Z3AHR4hxJpYVlyZe4hRgoNZSYRXpBwoxJuSWFmVWpQfX1Sak1p8iNEU6NeJzFKi yfnAyM4riTc0MTcxNzawMLe0NDFSEudtnP0sXEggPbEkNTs1tSC1CKaPiYNTqoGRO59/T/wj A++TWkoX9PuP9gSZTiy20mycEiuvvP/UzIK7/LLRxz6dLjnRO+PYoxxzPSb1GOe17QUvA9co Zqskvvu+wF1EYK7tqkq/RXydzVXznf8KhiibiMmKRpumPbFaqfpdwJ5No48lpywyn/1934df vFcmHI2XVlUx2f4u8lKK7YOSVUosxRmJhlrMRcWJAFYUh0O0AgAA X-MTR: 20000000000000000@CPGS Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Hans, On 2016년 12월 19일 09:13, Hans de Goede wrote: > The vbus-present bit in the power status register also gets set to 1 > when a usb-host cable (id-pin shorted to ground) is plugged in and a 5v > boost converter is supplying 5v to the otg usb bus. > > This causes a "disconnect or unknown or ID event" warning in dmesg as > well as the extcon device to report the last detected charger cable > type as being connected even though none is connected. > > This commit switches to checking the vbus-valid bit instead, which is > only 1 when both vbus is present and the vbus-path is enabled in the > vbus-path control register (the vbus-path gets disabled when a usb-host > cable is detected, to avoid the pmic drawing power from the 5v boost > converter). > > Signed-off-by: Hans de Goede > --- > drivers/extcon/extcon-axp288.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c > index fc636f6..7aec413 100644 > --- a/drivers/extcon/extcon-axp288.c > +++ b/drivers/extcon/extcon-axp288.c > @@ -166,7 +166,7 @@ static int axp288_handle_chrg_det_event(struct axp288_extcon_info *info) > return ret; > } > > - vbus_attach = (pwr_stat & PS_STAT_VBUS_PRESENT); > + vbus_attach = (pwr_stat & PS_STAT_VBUS_VALID); > if (!vbus_attach) { > dev_info(info->dev, "vbus/cable disconnected\n"); > goto no_vbus; > Acked-by: Chanwoo Choi -- Regards, Chanwoo Choi