From: Hans de Goede Date: Fri, 22 Dec 2017 12:36:16 +0000 (+0100) Subject: extcon: axp288: Handle reserved charger-type values better X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=ca90a64dc671f4a18958078a4bf2e31e2ef57db9;p=openwrt%2Fstaging%2Fblogic.git extcon: axp288: Handle reserved charger-type values better 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 Signed-off-by: Chanwoo Choi --- diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c index 74d5be0b1f35..0a44d43802fe 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: