From patchwork Wed Jun 12 05:55:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 10988495 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 78D2413AD for ; Wed, 12 Jun 2019 05:55:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6172B28961 for ; Wed, 12 Jun 2019 05:55:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 50B8228969; Wed, 12 Jun 2019 05:55:56 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 062A028961 for ; Wed, 12 Jun 2019 05:55:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=QPyDXmaEt2rz3Hr5ihgUBtUxqoaltqrwmZpbU3XLgos=; b=p27sHOwc8DGEdd zzyvjzLX5L+QclodGbrxw5PiM/NVL/PNQ/yi2Xum082dejDsYgqD8+57GuYsRXO3l761ffcLXiuF8 /g6tk20HFDjrxTp05iF6C09R/t/VSnxNMQVOiSZfvqoRZehYBhkluFNoaIyFcA+lQYEKmKgBwvPdv M8JhtEGf4SOrxDfy3dlbDoj1Jf4ldPg75ooiVQbK1W1EGawEUaW3gw2okpoey1KqGkDBn0ZC7hEil fniRYziAKbAe1P4XTs7yTCjVD5cBvbLZx4yFx40W5Az07b8xL1UbR2XTHUpEEoVVrueKovE96jWO5 zLNepJTZkMYS6TP4GvVg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hawEg-0003Mz-RE; Wed, 12 Jun 2019 05:55:50 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hawEb-0003LH-TK; Wed, 12 Jun 2019 05:55:47 +0000 X-UUID: f0b85d32d35e49ea8e1c0018403b8152-20190611 X-UUID: f0b85d32d35e49ea8e1c0018403b8152-20190611 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 1368809534; Tue, 11 Jun 2019 21:55:43 -0800 Received: from MTKMBS31N1.mediatek.inc (172.27.4.69) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 11 Jun 2019 22:55:42 -0700 Received: from mtkcas07.mediatek.inc (172.21.101.84) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 12 Jun 2019 13:55:37 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 12 Jun 2019 13:55:31 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Rob Herring Subject: [PATCH 1/5] dt-bindings: usb: mtu3: fix typo of DMA clock name Date: Wed, 12 Jun 2019 13:55:17 +0800 Message-ID: <5e06482a0be15476c7b5825f155accf98275afa8.1560246390.git.chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190611_225545_952132_F3618BDA X-CRM114-Status: GOOD ( 11.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Jumin Li , Mathias Nyman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Chunfeng Yun , linux-mediatek@lists.infradead.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org 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 Fix typo of dma_ck Signed-off-by: Chunfeng Yun Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/usb/mediatek,mtu3.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtu3.txt b/Documentation/devicetree/bindings/usb/mediatek,mtu3.txt index 3382b5cb471d..5d740e9d4525 100644 --- a/Documentation/devicetree/bindings/usb/mediatek,mtu3.txt +++ b/Documentation/devicetree/bindings/usb/mediatek,mtu3.txt @@ -16,7 +16,7 @@ Required properties: entry in clock-names - clock-names : must contain "sys_ck" for clock of controller, the following clocks are optional: - "ref_ck", "mcu_ck" and "dam_ck"; + "ref_ck", "mcu_ck" and "dma_ck"; - phys : see usb-hcd.txt in the current directory - dr_mode : should be one of "host", "peripheral" or "otg", refer to usb/generic.txt From patchwork Wed Jun 12 05:55:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 10988505 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 24B0B6C5 for ; Wed, 12 Jun 2019 05:56:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1065228961 for ; Wed, 12 Jun 2019 05:56:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 042712896A; Wed, 12 Jun 2019 05:56:20 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 908FB28961 for ; Wed, 12 Jun 2019 05:56:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=K2srTFj7d8apnmQeFhP+ZKxqOa5vZPpSgB0JOss6ybU=; b=pcguAg7RtqFkc0 BqQc0n4zV95VdynZflVTa6pUBMfDLFq1sSPZpQePm0ISQq5gZOxwmDCwCIm1k+nxE1IJzFB8cKwdx +/mbcBG23ZTTUPtOXzlgiGvhXQBd+osyUTl5DNOXFxunhnmpue1swEMox+NEgqLxbJ6gm9A/qomC0 i1ku1n5YvAO+VQwCi3cke95N64O6HSZSrOAjHl8dP7Q/HFcvN9LPGoDPFRoH0rQtRSldvhYPAaqjm 9QKLC6hCgwTpXfo7QzbtJCahX47x9jCl+dpgr3qypC7kjwE3/vJ4uXynB8z1tO+kSysoBOBJimq8r lQwYIsDhWlfOtzfuYR7Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hawF3-0003hv-2V; Wed, 12 Jun 2019 05:56:13 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hawEy-0003ez-B7; Wed, 12 Jun 2019 05:56:09 +0000 X-UUID: a0b9efa17c544b5eba7bd9f1c0b07acb-20190611 X-UUID: a0b9efa17c544b5eba7bd9f1c0b07acb-20190611 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 1331865235; Tue, 11 Jun 2019 21:55:47 -0800 Received: from MTKMBS31DR.mediatek.inc (172.27.6.102) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 11 Jun 2019 22:55:46 -0700 Received: from mtkcas07.mediatek.inc (172.21.101.84) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 12 Jun 2019 13:55:41 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 12 Jun 2019 13:55:39 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Rob Herring Subject: [PATCH 2/5] dt-bindings: usb: mtu3: support force_vbus mode Date: Wed, 12 Jun 2019 13:55:18 +0800 Message-ID: <65f025186332b2b44f7b27f58af893217df1adb5.1560246390.git.chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <5e06482a0be15476c7b5825f155accf98275afa8.1560246390.git.chunfeng.yun@mediatek.com> References: <5e06482a0be15476c7b5825f155accf98275afa8.1560246390.git.chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190611_225608_383442_9536CC98 X-CRM114-Status: GOOD ( 11.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Jumin Li , Mathias Nyman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Chunfeng Yun , linux-mediatek@lists.infradead.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org 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 Add a new property to indicate that the controller doesn't support Vbus detection due to non-exist Vbus PIN, and the driver should set force_vbus state for device mode Signed-off-by: Chunfeng Yun Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/usb/mediatek,mtu3.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtu3.txt b/Documentation/devicetree/bindings/usb/mediatek,mtu3.txt index 5d740e9d4525..c13cc8642154 100644 --- a/Documentation/devicetree/bindings/usb/mediatek,mtu3.txt +++ b/Documentation/devicetree/bindings/usb/mediatek,mtu3.txt @@ -52,6 +52,8 @@ Optional properties: - 2 : used by mt2712 etc - mediatek,u3p-dis-msk : mask to disable u3ports, bit0 for u3port0, bit1 for u3port1, ... etc; + - mediatek,force-vbus : boolean, indicates that the controller doesn't support + Vbus detection due to non-exist Vbus PIN. additionally the properties from usb-hcd.txt (in the current directory) are supported. From patchwork Wed Jun 12 05:55:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 10988515 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 658A913AD for ; Wed, 12 Jun 2019 05:56:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4ED3428961 for ; Wed, 12 Jun 2019 05:56:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3FBF52896A; Wed, 12 Jun 2019 05:56:56 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EB4D028961 for ; Wed, 12 Jun 2019 05:56:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YL1ozXaymeJCpdEvr3gDVi/d5OybDy/i1X5MYdRA9xU=; b=dzHa6h2/Lq5sgv Gbjip9JOm1Iy0oMfMHhEvFrfmNlM4wjJkP5mB8je45R0gCVHcde1XPMcUyVxRIWV2jul+GFEQ9i80 RYk9kvvpv1IB0Vw8pvK4JVby4IUlzScVKTb1RbgnU1RNcJIQ0CgrD8VNjL0YQ5cL8oZGex+yaJ/VL nVewWhqTqXMmVq06O3P1f7CofBmQKfQlcR8DddN9Q5CJZI7bzTdt24Q/gAlW9mhh3hd5H+3zFIaFX 2Wl5ujrduwCgZbbGiM6z8MChu40hHbtPaZpiugQVCGZWaqmB8Q2hUAgMgX+bpDD4hynQfAxe3SGpa Iy3VuH2Eic0nK0dQfPGg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hawFb-0004Fm-Gc; Wed, 12 Jun 2019 05:56:47 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hawEz-0003ey-DH; Wed, 12 Jun 2019 05:56:10 +0000 X-UUID: f8b02f0459c242b28088d53047f051b9-20190611 X-UUID: f8b02f0459c242b28088d53047f051b9-20190611 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 82874855; Tue, 11 Jun 2019 21:55:49 -0800 Received: from MTKMBS31N2.mediatek.inc (172.27.4.87) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 11 Jun 2019 22:55:48 -0700 Received: from mtkcas07.mediatek.inc (172.21.101.84) by MTKMBS31N2.mediatek.inc (172.27.4.87) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 12 Jun 2019 13:55:45 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 12 Jun 2019 13:55:44 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Rob Herring Subject: [PATCH 3/5] dt-bindings: usb: mtk-xhci: add an optional xhci_ck clock Date: Wed, 12 Jun 2019 13:55:19 +0800 Message-ID: <9b6ad8dee142d73b56d653ecb7475c4ed28e5eb8.1560246390.git.chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <5e06482a0be15476c7b5825f155accf98275afa8.1560246390.git.chunfeng.yun@mediatek.com> References: <5e06482a0be15476c7b5825f155accf98275afa8.1560246390.git.chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190611_225609_456129_65FF022F X-CRM114-Status: GOOD ( 11.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Jumin Li , Mathias Nyman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Chunfeng Yun , linux-mediatek@lists.infradead.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org 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 Add a new optional clock xhci_ck Signed-off-by: Chunfeng Yun --- Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.txt b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.txt index 266c2d917a28..91c0704b586b 100644 --- a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.txt +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.txt @@ -29,6 +29,7 @@ Required properties: "sys_ck": controller clock used by normal mode, the following ones are optional: "ref_ck": reference clock used by low power mode etc, + "xhci_ck": controller clock, "mcu_ck": mcu_bus clock for register access, "dma_ck": dma_bus clock for data transfer by DMA @@ -100,7 +101,7 @@ Required properties: - clocks : a list of phandle + clock-specifier pairs, one for each entry in clock-names - clock-names : must contain "sys_ck", and the following ones are optional: - "ref_ck", "mcu_ck" and "dma_ck" + "ref_ck", "xhci_ck", "mcu_ck" and "dma_ck" Optional properties: - vbus-supply : reference to the VBUS regulator; From patchwork Wed Jun 12 05:55:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 10988519 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4953F6C5 for ; Wed, 12 Jun 2019 05:57:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3517328969 for ; Wed, 12 Jun 2019 05:57:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 276AE2896D; Wed, 12 Jun 2019 05:57:17 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B4A5728969 for ; Wed, 12 Jun 2019 05:57:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SZY699RoPXE9JG4JnQrqsnlHA+UyFXUjYrMs0zbBG9Q=; b=tNz6L3Uq+LrOED vKeRJ1e+QykyiBKtJyDPsrda/z+LVe43JB4Glgyu1ZQE0mxOJbJvzR7C433usk3yLl1qCx5bjHjqJ 26okwSpgS8zv0DPPBrPN0maYMQ7IkVrZiNDs2UFcThUAGFcAHZPx0Lb+zqwRvtdMpDsYBmMfRNg8b 0oUyMvAxZ4/s+pH0WiVANmH8w71SKBQ7mVMHZT44PJHSO+j4i+xju3gs/DwtAnbTQCx7jPkENLyKU MsZdQCJzIRqGNdc/GD38XFQBQ5d4LrMtgPjNi+OfA+d4o+NW+R6kkDqfHCfIpJwJqOKsf6MPLrfOl icMUp2G3j2Q/NlV7PKOQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hawFz-0004XP-O1; Wed, 12 Jun 2019 05:57:11 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hawF0-0003ey-SK; Wed, 12 Jun 2019 05:56:12 +0000 X-UUID: 5b544a3cc1614c96a1b4aa034781c92b-20190611 X-UUID: 5b544a3cc1614c96a1b4aa034781c92b-20190611 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 203891946; Tue, 11 Jun 2019 21:55:51 -0800 Received: from MTKMBS31N1.mediatek.inc (172.27.4.69) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 11 Jun 2019 22:55:50 -0700 Received: from mtkcas07.mediatek.inc (172.21.101.84) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 12 Jun 2019 13:55:47 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 12 Jun 2019 13:55:45 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Rob Herring Subject: [PATCH 4/5] usb: mtu3: support force_vbus mode Date: Wed, 12 Jun 2019 13:55:20 +0800 Message-ID: <80b3e7ed4d7719b854816dfdd974772999a2e672.1560246390.git.chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <5e06482a0be15476c7b5825f155accf98275afa8.1560246390.git.chunfeng.yun@mediatek.com> References: <5e06482a0be15476c7b5825f155accf98275afa8.1560246390.git.chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190611_225610_951999_5A31EDD1 X-CRM114-Status: GOOD ( 14.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Jumin Li , Mathias Nyman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Chunfeng Yun , linux-mediatek@lists.infradead.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org 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 Some SoCs don't support Vbus detection due to non-exist Vbus PIN, so software need set force_vbus state when the controller works as device mode. Signed-off-by: Chunfeng Yun --- drivers/usb/mtu3/mtu3.h | 3 +++ drivers/usb/mtu3/mtu3_core.c | 1 + drivers/usb/mtu3/mtu3_dr.c | 2 ++ drivers/usb/mtu3/mtu3_host.c | 1 + drivers/usb/mtu3/mtu3_plat.c | 23 +++++++++++++++++++++++ 5 files changed, 30 insertions(+) diff --git a/drivers/usb/mtu3/mtu3.h b/drivers/usb/mtu3/mtu3.h index 76ecf12fdf62..01b0dc9caa3e 100644 --- a/drivers/usb/mtu3/mtu3.h +++ b/drivers/usb/mtu3/mtu3.h @@ -231,6 +231,7 @@ struct otg_switch_mtk { * @u3p_dis_msk: mask of disabling usb3 ports, for example, bit0==1 to * disable u3port0, bit1==1 to disable u3port1,... etc * @dbgfs_root: only used when supports manual dual-role switch via debugfs + * @force_vbus: without Vbus PIN, SW need set force_vbus state for device * @uwk_en: it's true when supports remote wakeup in host mode * @uwk: syscon including usb wakeup glue layer between SSUSB IP and SPM * @uwk_reg_base: the base address of the wakeup glue layer in @uwk @@ -257,6 +258,7 @@ struct ssusb_mtk { int u3_ports; int u3p_dis_msk; struct dentry *dbgfs_root; + bool force_vbus; /* usb wakeup for host mode */ bool uwk_en; struct regmap *uwk; @@ -415,6 +417,7 @@ static inline void mtu3_clrbits(void __iomem *base, u32 offset, u32 bits) } int ssusb_check_clocks(struct ssusb_mtk *ssusb, u32 ex_clks); +void ssusb_set_force_vbus(struct ssusb_mtk *ssusb, bool vbus_on); struct usb_request *mtu3_alloc_request(struct usb_ep *ep, gfp_t gfp_flags); void mtu3_free_request(struct usb_ep *ep, struct usb_request *req); void mtu3_req_complete(struct mtu3_ep *mep, diff --git a/drivers/usb/mtu3/mtu3_core.c b/drivers/usb/mtu3/mtu3_core.c index f8bd1d57e795..65aa382ffb85 100644 --- a/drivers/usb/mtu3/mtu3_core.c +++ b/drivers/usb/mtu3/mtu3_core.c @@ -604,6 +604,7 @@ static void mtu3_regs_init(struct mtu3 *mtu) /* enable automatical HWRW from L1 */ mtu3_setbits(mbase, U3D_POWER_MANAGEMENT, LPM_HRWE); + ssusb_set_force_vbus(mtu->ssusb, true); /* use new QMU format when HW version >= 0x1003 */ if (mtu->gen2cp) mtu3_writel(mbase, U3D_QFCR, ~0x0); diff --git a/drivers/usb/mtu3/mtu3_dr.c b/drivers/usb/mtu3/mtu3_dr.c index 5fcb71af875a..006c5864ff45 100644 --- a/drivers/usb/mtu3/mtu3_dr.c +++ b/drivers/usb/mtu3/mtu3_dr.c @@ -173,8 +173,10 @@ static void ssusb_set_mailbox(struct otg_switch_mtk *otg_sx, case MTU3_VBUS_OFF: mtu3_stop(mtu); pm_relax(ssusb->dev); + ssusb_set_force_vbus(ssusb, false); break; case MTU3_VBUS_VALID: + ssusb_set_force_vbus(ssusb, true); /* avoid suspend when works as device */ pm_stay_awake(ssusb->dev); mtu3_start(mtu); diff --git a/drivers/usb/mtu3/mtu3_host.c b/drivers/usb/mtu3/mtu3_host.c index c871b94f3e6f..7618a0c384f9 100644 --- a/drivers/usb/mtu3/mtu3_host.c +++ b/drivers/usb/mtu3/mtu3_host.c @@ -205,6 +205,7 @@ static void ssusb_host_setup(struct ssusb_mtk *ssusb) ssusb_set_force_mode(ssusb, MTU3_DR_FORCE_HOST); /* if port0 supports dual-role, works as host mode by default */ + ssusb_set_force_vbus(ssusb, false); ssusb_set_vbus(&ssusb->otg_switch, 1); } diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c index fd0f6c5dfbc1..e9d313e92fc3 100644 --- a/drivers/usb/mtu3/mtu3_plat.c +++ b/drivers/usb/mtu3/mtu3_plat.c @@ -45,6 +45,27 @@ int ssusb_check_clocks(struct ssusb_mtk *ssusb, u32 ex_clks) return 0; } +void ssusb_set_force_vbus(struct ssusb_mtk *ssusb, bool vbus_on) +{ + u32 u2ctl; + u32 misc; + + if (!ssusb->force_vbus) + return; + + u2ctl = mtu3_readl(ssusb->ippc_base, SSUSB_U2_CTRL(0)); + misc = mtu3_readl(ssusb->mac_base, U3D_MISC_CTRL); + if (vbus_on) { + u2ctl &= ~SSUSB_U2_PORT_OTG_SEL; + misc |= VBUS_FRC_EN | VBUS_ON; + } else { + u2ctl |= SSUSB_U2_PORT_OTG_SEL; + misc &= ~(VBUS_FRC_EN | VBUS_ON); + } + mtu3_writel(ssusb->ippc_base, SSUSB_U2_CTRL(0), u2ctl); + mtu3_writel(ssusb->mac_base, U3D_MISC_CTRL, misc); +} + static int ssusb_phy_init(struct ssusb_mtk *ssusb) { int i; @@ -268,6 +289,8 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb) if (IS_ERR(ssusb->ippc_base)) return PTR_ERR(ssusb->ippc_base); + ssusb->force_vbus = of_property_read_bool(node, "mediatek,force-vbus"); + ssusb->dr_mode = usb_get_dr_mode(dev); if (ssusb->dr_mode == USB_DR_MODE_UNKNOWN) ssusb->dr_mode = USB_DR_MODE_OTG; From patchwork Wed Jun 12 05:55:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 10988513 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3F25613AD for ; Wed, 12 Jun 2019 05:56:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A98028961 for ; Wed, 12 Jun 2019 05:56:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B9EB2896A; Wed, 12 Jun 2019 05:56:40 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9F41828961 for ; Wed, 12 Jun 2019 05:56:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rVvHh4Ya0F5tXVO9pxTwQCs8eq5YV+WWsSdxTMp1DFY=; b=AOBruYDF05FMLb Q7I2Y0gsEIT29AlgVois66Ht24aR3EOsUHGtCWBnl7US77pnQdTwBWCk+Xllm4NB5YNIjgtpaD8+Y mM4MHvtaH7Oy8fJI2MHdeRcPAYRrDYABKBrWre+h7FQs+3/QF4jB7k2UsqcjE4pozyZY3414aj1oZ Nen5SoTLG+VpsIJEjpPhvt4gjmqkF173RFe26Qg/myZYh1e0JU9MffSment4++ANlBKHAOWUBx2u0 vJnbKs0oal1KQkPJf0poogofGpwd//gzVxvREavmk5ppvaGTZfAFzQkOCBylV92qkSkJx3BkdkBmB bOQfUcsV2Ke27labzKoQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hawFL-0003z9-PY; Wed, 12 Jun 2019 05:56:31 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hawEz-0003fH-DL; Wed, 12 Jun 2019 05:56:11 +0000 X-UUID: 34a071fa91bd49a2a18e47b4b18c3f82-20190611 X-UUID: 34a071fa91bd49a2a18e47b4b18c3f82-20190611 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 625688226; Tue, 11 Jun 2019 21:55:54 -0800 Received: from MTKMBS31DR.mediatek.inc (172.27.6.102) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 11 Jun 2019 22:55:52 -0700 Received: from mtkcas07.mediatek.inc (172.21.101.84) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 12 Jun 2019 13:55:49 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 12 Jun 2019 13:55:48 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Rob Herring Subject: [PATCH 5/5] usb: xhci-mtk: add an optional xhci_ck clock Date: Wed, 12 Jun 2019 13:55:21 +0800 Message-ID: <41bb0198ef2a4059685a8736b54c88487864a517.1560246390.git.chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <5e06482a0be15476c7b5825f155accf98275afa8.1560246390.git.chunfeng.yun@mediatek.com> References: <5e06482a0be15476c7b5825f155accf98275afa8.1560246390.git.chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190611_225609_458254_F7ACFC53 X-CRM114-Status: GOOD ( 12.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Jumin Li , Mathias Nyman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Chunfeng Yun , linux-mediatek@lists.infradead.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org 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 Some SoCs may have an optional clock xhci_ck (125M or 200M), it usually uses the same PLL as sys_ck, so support it. Signed-off-by: Chunfeng Yun --- drivers/usb/host/xhci-mtk.c | 13 +++++++++++++ drivers/usb/host/xhci-mtk.h | 1 + 2 files changed, 14 insertions(+) diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c index 026fe18972d3..b18a6baef204 100644 --- a/drivers/usb/host/xhci-mtk.c +++ b/drivers/usb/host/xhci-mtk.c @@ -216,6 +216,10 @@ static int xhci_mtk_clks_get(struct xhci_hcd_mtk *mtk) return PTR_ERR(mtk->sys_clk); } + mtk->xhci_clk = devm_clk_get_optional(dev, "xhci_ck"); + if (IS_ERR(mtk->xhci_clk)) + return PTR_ERR(mtk->xhci_clk); + mtk->ref_clk = devm_clk_get_optional(dev, "ref_ck"); if (IS_ERR(mtk->ref_clk)) return PTR_ERR(mtk->ref_clk); @@ -244,6 +248,12 @@ static int xhci_mtk_clks_enable(struct xhci_hcd_mtk *mtk) goto sys_clk_err; } + ret = clk_prepare_enable(mtk->xhci_clk); + if (ret) { + dev_err(mtk->dev, "failed to enable xhci_clk\n"); + goto xhci_clk_err; + } + ret = clk_prepare_enable(mtk->mcu_clk); if (ret) { dev_err(mtk->dev, "failed to enable mcu_clk\n"); @@ -261,6 +271,8 @@ static int xhci_mtk_clks_enable(struct xhci_hcd_mtk *mtk) dma_clk_err: clk_disable_unprepare(mtk->mcu_clk); mcu_clk_err: + clk_disable_unprepare(mtk->xhci_clk); +xhci_clk_err: clk_disable_unprepare(mtk->sys_clk); sys_clk_err: clk_disable_unprepare(mtk->ref_clk); @@ -272,6 +284,7 @@ static void xhci_mtk_clks_disable(struct xhci_hcd_mtk *mtk) { clk_disable_unprepare(mtk->dma_clk); clk_disable_unprepare(mtk->mcu_clk); + clk_disable_unprepare(mtk->xhci_clk); clk_disable_unprepare(mtk->sys_clk); clk_disable_unprepare(mtk->ref_clk); } diff --git a/drivers/usb/host/xhci-mtk.h b/drivers/usb/host/xhci-mtk.h index 8be8c5f7ff62..5ac458b7d2e0 100644 --- a/drivers/usb/host/xhci-mtk.h +++ b/drivers/usb/host/xhci-mtk.h @@ -139,6 +139,7 @@ struct xhci_hcd_mtk { struct regulator *vusb33; struct regulator *vbus; struct clk *sys_clk; /* sys and mac clock */ + struct clk *xhci_clk; struct clk *ref_clk; struct clk *mcu_clk; struct clk *dma_clk;