linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: MyungJoo Ham <myungjoo.ham@samsung.com>,
	Chanwoo Choi <cw00.choi@samsung.com>
Cc: Hans de Goede <hdegoede@redhat.com>, linux-kernel@vger.kernel.org
Subject: [PATCH 4/4] extcon: axp288: Handle reserved charger-type values better
Date: Fri, 22 Dec 2017 13:36:16 +0100	[thread overview]
Message-ID: <20171222123616.9562-4-hdegoede@redhat.com> (raw)
In-Reply-To: <20171222123616.9562-1-hdegoede@redhat.com>

According to the data sheets all the values not handled in the
switch-case are "reserved". Update the dev_warn message to reflect
this and set the cable-type to EXTCON_CHG_USB_SDP (so max 500mA
current draw) as safe default.

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

diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c
index cc7c35c7ff02..d60c615f709f 100644
--- a/drivers/extcon/extcon-axp288.c
+++ b/drivers/extcon/extcon-axp288.c
@@ -205,8 +205,8 @@ static int axp288_handle_chrg_det_event(struct axp288_extcon_info *info)
 		cable = EXTCON_CHG_USB_DCP;
 		break;
 	default:
-		dev_warn(info->dev,
-			"disconnect or unknown or ID event\n");
+		dev_warn(info->dev, "unknown (reserved) bc detect result\n");
+		cable = EXTCON_CHG_USB_SDP;
 	}
 
 no_vbus:
-- 
2.14.3

  parent reply	other threads:[~2017-12-22 12:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20171222123627epcas1p25953168cb2b1432d2065c0068a71397f@epcas1p2.samsung.com>
2017-12-22 12:36 ` [PATCH 1/4] extcon: axp288: Remove unused extcon_nb struct member Hans de Goede
2017-12-22 12:36   ` [PATCH 2/4] extcon: axp288: Remove unused platform data Hans de Goede
2018-01-02  0:35     ` Chanwoo Choi
2018-01-02  9:16       ` Lee Jones
2018-01-03  1:34         ` Chanwoo Choi
2018-01-03  9:37           ` Lee Jones
2018-01-03  9:53             ` Chanwoo Choi
2018-01-05 10:44               ` Lee Jones
2017-12-22 12:36   ` [PATCH 3/4] extcon: axp288: Redo charger type dection a couple of seconds after probe() Hans de Goede
2018-01-02  0:54     ` Chanwoo Choi
2018-01-02 22:44       ` Hans de Goede
2018-01-03  0:58         ` Chanwoo Choi
2018-01-03  1:04           ` Chanwoo Choi
2017-12-22 12:36   ` Hans de Goede [this message]
2018-01-02  0:55     ` [PATCH 4/4] extcon: axp288: Handle reserved charger-type values better Chanwoo Choi
2018-01-02  0:36   ` [PATCH 1/4] extcon: axp288: Remove unused extcon_nb struct member Chanwoo Choi
2018-01-03  1:17   ` Chanwoo Choi
2018-01-03  8:08     ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171222123616.9562-4-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=cw00.choi@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).