From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756079AbdLVMgd (ORCPT ); Fri, 22 Dec 2017 07:36:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34978 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755982AbdLVMgX (ORCPT ); Fri, 22 Dec 2017 07:36:23 -0500 From: Hans de Goede To: MyungJoo Ham , Chanwoo Choi Cc: Hans de Goede , 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 Message-Id: <20171222123616.9562-4-hdegoede@redhat.com> In-Reply-To: <20171222123616.9562-1-hdegoede@redhat.com> References: <20171222123616.9562-1-hdegoede@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 22 Dec 2017 12:36:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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