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


Groups > linux.kernel > #1544246 > unrolled thread

[PATCH 5/8] extcon: axp288: Make a couple of messages dev_info instead of dev_dbg

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 5/8] extcon: axp288: Make a couple of messages dev_info instead of dev_dbg Hans de Goede <hdegoede@redhat.com> - 2016-12-19 01:20 +0100
    Re: [PATCH 5/8] extcon: axp288: Make a couple of messages dev_info  instead of dev_dbg Chanwoo Choi <cw00.choi@samsung.com> - 2016-12-19 07:40 +0100

#1544246 — [PATCH 5/8] extcon: axp288: Make a couple of messages dev_info instead of dev_dbg

FromHans de Goede <hdegoede@redhat.com>
Date2016-12-19 01:20 +0100
Subject[PATCH 5/8] extcon: axp288: Make a couple of messages dev_info instead of dev_dbg
Message-ID<sPTQl-tj-3@gated-at.bofh.it>
These messages are helpful for the user to check if their charger is
correctly detected, so make them dev_dbg instead of dev_info.

Also add a new message to indicate when the vbus is disconnected /
no cable is detected.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/extcon/extcon-axp288.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c
index ded0bd9..fc636f6 100644
--- a/drivers/extcon/extcon-axp288.c
+++ b/drivers/extcon/extcon-axp288.c
@@ -167,8 +167,10 @@ static int axp288_handle_chrg_det_event(struct axp288_extcon_info *info)
 	}
 
 	vbus_attach = (pwr_stat & PS_STAT_VBUS_PRESENT);
-	if (!vbus_attach)
+	if (!vbus_attach) {
+		dev_info(info->dev, "vbus/cable disconnected\n");
 		goto no_vbus;
+	}
 
 	/* Check charger detection completion status */
 	ret = regmap_read(info->regmap, AXP288_BC_GLOBAL_REG, &cfg);
@@ -187,15 +189,15 @@ static int axp288_handle_chrg_det_event(struct axp288_extcon_info *info)
 
 	switch (chrg_type) {
 	case DET_STAT_SDP:
-		dev_dbg(info->dev, "sdp cable is connected\n");
+		dev_info(info->dev, "sdp cable is connected\n");
 		cable = EXTCON_CHG_USB_SDP;
 		break;
 	case DET_STAT_CDP:
-		dev_dbg(info->dev, "cdp cable is connected\n");
+		dev_info(info->dev, "cdp cable is connected\n");
 		cable = EXTCON_CHG_USB_CDP;
 		break;
 	case DET_STAT_DCP:
-		dev_dbg(info->dev, "dcp cable is connected\n");
+		dev_info(info->dev, "dcp cable is connected\n");
 		cable = EXTCON_CHG_USB_DCP;
 		break;
 	default:
-- 
2.9.3

[toc] | [next] | [standalone]


#1544332 — Re: [PATCH 5/8] extcon: axp288: Make a couple of messages dev_info instead of dev_dbg

FromChanwoo Choi <cw00.choi@samsung.com>
Date2016-12-19 07:40 +0100
SubjectRe: [PATCH 5/8] extcon: axp288: Make a couple of messages dev_info instead of dev_dbg
Message-ID<sPZM6-4cU-25@gated-at.bofh.it>
In reply to#1544246
Hi Hans,

I prefer to use the dev_dbg on the fly instead of dev_info.
If you want to check the change state, you can use the udev monitor tool
because extcon send the uevent when changing the state of connector.

Regards,
Chanwoo Choi

On 2016년 12월 19일 09:13, Hans de Goede wrote:
> These messages are helpful for the user to check if their charger is
> correctly detected, so make them dev_dbg instead of dev_info.
> 
> Also add a new message to indicate when the vbus is disconnected /
> no cable is detected.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/extcon/extcon-axp288.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c
> index ded0bd9..fc636f6 100644
> --- a/drivers/extcon/extcon-axp288.c
> +++ b/drivers/extcon/extcon-axp288.c
> @@ -167,8 +167,10 @@ static int axp288_handle_chrg_det_event(struct axp288_extcon_info *info)
>  	}
>  
>  	vbus_attach = (pwr_stat & PS_STAT_VBUS_PRESENT);
> -	if (!vbus_attach)
> +	if (!vbus_attach) {
> +		dev_info(info->dev, "vbus/cable disconnected\n");
>  		goto no_vbus;
> +	}
>  
>  	/* Check charger detection completion status */
>  	ret = regmap_read(info->regmap, AXP288_BC_GLOBAL_REG, &cfg);
> @@ -187,15 +189,15 @@ static int axp288_handle_chrg_det_event(struct axp288_extcon_info *info)
>  
>  	switch (chrg_type) {
>  	case DET_STAT_SDP:
> -		dev_dbg(info->dev, "sdp cable is connected\n");
> +		dev_info(info->dev, "sdp cable is connected\n");
>  		cable = EXTCON_CHG_USB_SDP;
>  		break;
>  	case DET_STAT_CDP:
> -		dev_dbg(info->dev, "cdp cable is connected\n");
> +		dev_info(info->dev, "cdp cable is connected\n");
>  		cable = EXTCON_CHG_USB_CDP;
>  		break;
>  	case DET_STAT_DCP:
> -		dev_dbg(info->dev, "dcp cable is connected\n");
> +		dev_info(info->dev, "dcp cable is connected\n");
>  		cable = EXTCON_CHG_USB_DCP;
>  		break;
>  	default:
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web