Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1544253 > unrolled thread

[PATCH 6/8] extcon: axp288: Use vbus-valid instead of -present to determine cable presence

Started byHans de Goede <hdegoede@redhat.com>
First post2016-12-19 01:20 +0100
Last post2016-12-19 07:40 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 6/8] extcon: axp288: Use vbus-valid instead of -present to determine cable presence Hans de Goede <hdegoede@redhat.com> - 2016-12-19 01:20 +0100
    Re: [PATCH 6/8] extcon: axp288: Use vbus-valid instead of -present to  determine cable presence Chanwoo Choi <cw00.choi@samsung.com> - 2016-12-19 07:40 +0100

#1544253 — [PATCH 6/8] extcon: axp288: Use vbus-valid instead of -present to determine cable presence

FromHans de Goede <hdegoede@redhat.com>
Date2016-12-19 01:20 +0100
Subject[PATCH 6/8] extcon: axp288: Use vbus-valid instead of -present to determine cable presence
Message-ID<sPTQl-tj-23@gated-at.bofh.it>
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 <hdegoede@redhat.com>
---
 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;
-- 
2.9.3

[toc] | [next] | [standalone]


#1544333 — Re: [PATCH 6/8] extcon: axp288: Use vbus-valid instead of -present to determine cable presence

FromChanwoo Choi <cw00.choi@samsung.com>
Date2016-12-19 07:40 +0100
SubjectRe: [PATCH 6/8] extcon: axp288: Use vbus-valid instead of -present to determine cable presence
Message-ID<sPZM5-4cU-11@gated-at.bofh.it>
In reply to#1544253
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 <hdegoede@redhat.com>
> ---
>  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 <cw00.choi@samsung.com>

-- 
Regards,
Chanwoo Choi

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web