From patchwork Wed Dec 21 06:10:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 9482519 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8A53360821 for ; Wed, 21 Dec 2016 06:13:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A56C27FBE for ; Wed, 21 Dec 2016 06:13:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6ED7A28118; Wed, 21 Dec 2016 06:13:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D266427FBE for ; Wed, 21 Dec 2016 06:13:08 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cJa81-0002ed-3j; Wed, 21 Dec 2016 06:11:53 +0000 Received: from mail-pg0-x232.google.com ([2607:f8b0:400e:c05::232]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cJa7i-0002FN-6u for linux-arm-kernel@lists.infradead.org; Wed, 21 Dec 2016 06:11:35 +0000 Received: by mail-pg0-x232.google.com with SMTP id y62so29523838pgy.1 for ; Tue, 20 Dec 2016 22:11:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=C/ZacjFw8jm+x1dTJImhmfeTVyDfOn/Cu7Xg8qkbm4Y=; b=idsqh69wICGKIDunhKqT1bMhcq2S64x93zc3Wznp2PH4fe5GQO5vrYwfD/PlbIpvtG 0SdrmSJ7rrBIgR6g077nLG5behn1fYjMrOYFuig4LpNd8EqKBGStF4ilqryTMXxuWLWZ KRMeubAjw+NeYUnscV9utLAlVGJRPhOii4wzs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=C/ZacjFw8jm+x1dTJImhmfeTVyDfOn/Cu7Xg8qkbm4Y=; b=DVZ9o+XXbwMcgjhRgyquyBjGrkRP8CR9E99626CjQQ5+GZNVI9h0yBcG7wpcE1I6tA WKqGgD1XwuoxFadIIq6zWUO+AlsoKHjI4j7KHEPpsZmBP0pVUGfgv+X5CYtiVii1Oo+X E0MopeiAlIHk27GfeCjVYgJxiVMo+oiVrTSE1KT4SczJQJo3g3Rv7CC2/S9T1o5tG63j JenGAO/tupFoRGzolkunWqsQfTWy+iMiC20UVEDsa2ykV+npiMbKOBG0SaWy69lpD/bR k9Qrjo56kY5Agkfoxw16TsAxAX4pyFSfDiYTcx3M96mx5/HKcw+xlGJRqiCEt5c2eNuR z7dw== X-Gm-Message-State: AIkVDXLfZF/4JVlNDopHmHPvH2slYgscPvuxtnxaqMf+e167ENyVc6BrMoJt6HJi77FlMvyX X-Received: by 10.84.217.148 with SMTP id p20mr5838329pli.164.1482300673302; Tue, 20 Dec 2016 22:11:13 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([175.111.195.49]) by smtp.gmail.com with ESMTPSA id y89sm43302095pfk.83.2016.12.20.22.11.08 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Dec 2016 22:11:12 -0800 (PST) From: Baolin Wang To: myungjoo.ham@samsung.com, cw00.choi@samsung.com, wens@csie.org, kishon@ti.com, heiko@sntech.de Subject: [PATCH 2/3] extcon: axp288: Set EXTCON_USB when EXTCON_CHG_USB_SDP was set Date: Wed, 21 Dec 2016 14:10:48 +0800 Message-Id: <11fb7adc2982a9134faee9abb1de4dcfb253f2d2.1482300213.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <7b9836ce2ca34118a2acd1ea113605a5f13b4439.1482300213.git.baolin.wang@linaro.org> References: <7b9836ce2ca34118a2acd1ea113605a5f13b4439.1482300213.git.baolin.wang@linaro.org> In-Reply-To: <7b9836ce2ca34118a2acd1ea113605a5f13b4439.1482300213.git.baolin.wang@linaro.org> References: <7b9836ce2ca34118a2acd1ea113605a5f13b4439.1482300213.git.baolin.wang@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161220_221134_362957_8DD3E092 X-CRM114-Status: GOOD ( 11.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linaro-kernel@lists.linaro.org, baolin.wang@linaro.org, linux-kernel@vger.kernel.org, neilb@suse.com, linux-rockchip@lists.infradead.org, broonie@kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP According to the documentation, we should set the EXTCON_USB when one SDP charger connector was reported. Signed-off-by: Baolin Wang --- drivers/extcon/extcon-axp288.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c index 42f41e8..4490726 100644 --- a/drivers/extcon/extcon-axp288.c +++ b/drivers/extcon/extcon-axp288.c @@ -102,6 +102,7 @@ enum axp288_extcon_irq { }; static const unsigned int axp288_extcon_cables[] = { + EXTCON_USB, EXTCON_CHG_USB_SDP, EXTCON_CHG_USB_CDP, EXTCON_CHG_USB_DCP, @@ -225,8 +226,12 @@ static int axp288_handle_chrg_det_event(struct axp288_extcon_info *info) vbus_attach ? USB_EVENT_VBUS : USB_EVENT_NONE, NULL); } - if (notify_charger) + if (notify_charger) { extcon_set_state_sync(info->edev, cable, vbus_attach); + if (cable == EXTCON_CHG_USB_SDP) + extcon_set_state_sync(info->edev, EXTCON_USB, + vbus_attach); + } /* Clear the flags on disconnect event */ if (!vbus_attach)