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: 9482515 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 1087360821 for ; Wed, 21 Dec 2016 06:12:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2C0D27FBE for ; Wed, 21 Dec 2016 06:12:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4D9E28118; Wed, 21 Dec 2016 06:12:11 +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 6D18827FBE for ; Wed, 21 Dec 2016 06:12:11 +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 1cJa8I-0002ol-Vp; Wed, 21 Dec 2016 06:12:11 +0000 Received: from mail-pg0-x22c.google.com ([2607:f8b0:400e:c05::22c]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cJa7i-0002FO-8W for linux-rockchip@lists.infradead.org; Wed, 21 Dec 2016 06:11:35 +0000 Received: by mail-pg0-x22c.google.com with SMTP id f188so81673975pgc.3 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=RPKfXahCfkBfXaYlRK3lnYJZSRNJqfntkc4KxQDjvI3gCLnRTZr+o7lnJxC1fFxwkl pn/YR+OCc3dK0vcdzOpNIX/nTKWFqcnTwG2jfJCl9o3KnCJjeeddETk+DDJ0fGtwiLt9 sowwIMQR7TiZmur1S0JfZgRk3UhTzDv/hWVaUoI56Zxx34z9FSQDoC+V6NJoWAO4BWBl BMlSaVH5q6iZMlUQp4KdB+XfmwLjB9T2XKGhMi3J5RsYS9bkZKuNWqy7l6dms3arGifF W+63kIcPd9RSqiUnGBvR5UMzvo90FvGWspQpbqmHC/zo5yrzBabqT1d2mepG9F4gCP69 0vGA== X-Gm-Message-State: AIkVDXKfC1q236izlyzBNFcDyiK1HS9QUiYQQWByX/m7AZ4wtVsMwwolB314KJAQ61NmzyBv 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_404890_6406BE8F X-CRM114-Status: UNSURE ( 9.97 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms 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-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=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)