From patchwork Wed Dec 21 08:12:12 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: 9482677 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 1B30960487 for ; Wed, 21 Dec 2016 08:14:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A96728138 for ; Wed, 21 Dec 2016 08:14:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F12FF28285; Wed, 21 Dec 2016 08:14:10 +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 95C8128138 for ; Wed, 21 Dec 2016 08:14:10 +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 1cJc14-0006Lo-SA; Wed, 21 Dec 2016 08:12:50 +0000 Received: from mail-pg0-x235.google.com ([2607:f8b0:400e:c05::235]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cJc10-00066R-BC for linux-arm-kernel@lists.infradead.org; Wed, 21 Dec 2016 08:12:47 +0000 Received: by mail-pg0-x235.google.com with SMTP id g1so43632706pgn.0 for ; Wed, 21 Dec 2016 00:12:25 -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; bh=52JVCN1fUCbOdEWRgJN69vujRZfEdNacMaEzTqbwLAk=; b=OMYWZkehaTAVK6UW/MwsAL7Y2JMnsz1ekLmNhNLeJ+oTyECulvgQhk8JlqDVAkmhyK oO1/5DKcBy3DVhr+XLewOFW/dWO2htBm3ZzB8h6OHd7HdkJ3TB/Dvykae4Fb9cIrzyRL 2seWwVkak1SGCOiryFsUGhaxEImGpaM21vFeU= 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; bh=52JVCN1fUCbOdEWRgJN69vujRZfEdNacMaEzTqbwLAk=; b=AFlv4fuuICDApg5YBaFOG7BdiDhRWN7+dJKC9uP10wqmxvZVeeZ35pwnBUsLmNbSba YmJTrCN1mDu5VHzlQ/5YD9gbq8l3j0nHgKgHgx+jdX8QeG6dmx0j34pMa9JA2QVwQBzd ocz9ptgc7xv39mVya+HKq1yfwEc/UXU22qPB1NMhJuS4gI9v3i7n+i+mjYf/yz5JlAr5 pYwW89uLYR9TtQ2pyqF774HukhbsXcIQgdNduQocTVDmSpmrSHK/3Tc3myxYODGv0k6d 1c6S4R1PsRDtHuG6uwxRspw8JIkSBfUHTt/IG4Jf3wi1WSo92Zc7QAMgck8tc3PV2x5p F7Jg== X-Gm-Message-State: AIkVDXIvx2GQRsqdX4f83W39kkwuorRoVtJYJVIGDT4FjsbHO6CwHfySoUlc/2nyhMiBahET X-Received: by 10.98.149.81 with SMTP id p78mr2952623pfd.95.1482307945315; Wed, 21 Dec 2016 00:12:25 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([175.111.195.49]) by smtp.gmail.com with ESMTPSA id a24sm44494421pfh.57.2016.12.21.00.12.21 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Dec 2016 00:12:24 -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 v2 3/3] phy: rockchip-inno-usb2: Set EXTCON_USB when EXTCON_CHG_USB_SDP was set Date: Wed, 21 Dec 2016 16:12:12 +0800 Message-Id: <23666cc1a5ff123ece5bdbb9821d1eab280d0927.1482307697.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <7b9836ce2ca34118a2acd1ea113605a5f13b4439.1482307697.git.baolin.wang@linaro.org> References: <7b9836ce2ca34118a2acd1ea113605a5f13b4439.1482307697.git.baolin.wang@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161221_001246_496289_D814334A X-CRM114-Status: GOOD ( 11.49 ) 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 Reviewed-by: Chanwoo Choi --- Changes since v1: - Change extcon_set_cable_state_() to extcon_set_state_sync(). - Add reviewed tag by Chanwoo Choi. --- drivers/phy/phy-rockchip-inno-usb2.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/phy/phy-rockchip-inno-usb2.c b/drivers/phy/phy-rockchip-inno-usb2.c index 2f99ec9..4ea95c2 100644 --- a/drivers/phy/phy-rockchip-inno-usb2.c +++ b/drivers/phy/phy-rockchip-inno-usb2.c @@ -595,9 +595,14 @@ static void rockchip_usb2phy_otg_sm_work(struct work_struct *work) if (rport->vbus_attached != vbus_attach) { rport->vbus_attached = vbus_attach; - if (notify_charger && rphy->edev) + if (notify_charger && rphy->edev) { extcon_set_cable_state_(rphy->edev, cable, vbus_attach); + if (cable == EXTCON_CHG_USB_SDP) + extcon_set_state_sync(rphy->edev, + EXTCON_USB, + vbus_attach); + } } break; case OTG_STATE_B_PERIPHERAL: