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: 10988491 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 68DDF6C5 for ; Wed, 12 Jun 2019 05:55:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5511A28961 for ; Wed, 12 Jun 2019 05:55:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48F0B28969; Wed, 12 Jun 2019 05:55:51 +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 AD3AB28961 for ; Wed, 12 Jun 2019 05:55:49 +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=dz9EieGlE2V8cf0auYCaof9w2YgpPM57G5pbx64lS+E=; b=SrFGDqEYYR6HtE CYBKR+F1zebii10KT3D7RtLNODZF/ZsYlZ2jbVt7+iNUCH3LULOosIBCYUkkVeOtnYXhzQ6Ym8Rfa DWyBGXzgMd7spa9U9xBbNYeQH8eTOxnbTCbj6o080uWy9QEQt6hv5RZee+XwvxO9VUkx1IIkvOev9 H33FEAAwvpIKOS5RulY6CLSEfH+F/Y8Eemeh2d4ojP6OBn9fCHL1U85tIvpaE5RNrIkOZedzSy5FQ kSgBW/HB6+vKCSaEYmVcv7zIkqVPqAzY1olfElPkZRbtBsFeyj++q9n3jxDSfIRhtarOVDPIHOfh6 tKULVKuEBoZijfF4TaxA==; 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 1hawEf-0003M1-11; Wed, 12 Jun 2019 05:55:49 +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-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=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: 10988501 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 01A4913AD for ; Wed, 12 Jun 2019 05:56:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2D4228969 for ; Wed, 12 Jun 2019 05:56:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D452428961; Wed, 12 Jun 2019 05:56: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=-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 8686928961 for ; Wed, 12 Jun 2019 05:56:10 +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=EGJAxKl9IWAwLokdOheYsKQ3ceZql02q+lFxZG+Rk3c=; b=MBEakCEhY66pNB VG324j2Eoj9K0Y5Z+1FdMj3zaxF29JFgqKy7AD+bQxswCDyg4LOxmEafdkDeb0XiOuVeetZUsgjt/ rbkSS2V/MirBMi0GceZLLDaW7JSQrnFyFf7hG5zZ8KQl2crbli5WweTOOynqimDfe07QMs/NON8tu daP/el1AR5kWW0O35IrnlR9AihFPINikxTTCoBngnkqFaf2SHqW3AG2UxxL8rRWXTh1YsFrDLfdB6 23TZlmU6dyqnaOxzal9xs0q3cUNmeYg14BotDTEBRlbshFy3CQT+jF07RYXJ3IYQU1IkUOWJ9UIhJ DnegEPh3twdbHaoMwcCA==; 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 1hawF0-0003gc-98; Wed, 12 Jun 2019 05:56:10 +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-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=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: 10988509 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 D602313AD for ; Wed, 12 Jun 2019 05:56:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C12A628961 for ; Wed, 12 Jun 2019 05:56:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B443F2896A; Wed, 12 Jun 2019 05:56:28 +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 6B37128961 for ; Wed, 12 Jun 2019 05:56:28 +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=uCVQ9TmQx7sBgxiuPduQFqUl0ynpdJY9JdMh/LHT/24=; b=SxSH1fnHuLSIh7 +90u8l2EbVRmpgCVnAXZ+mfhdEifY6mUbZvTw7O0ZSYYUt2KKFB/J3fD8rlie7C20B5Pk9WcC9wLj xRVQGym6ik9gESYJr8JApUhm9o239xVhLxJoCFTXmjP7AwaeMWvq+XbOt2K9sj+k+TZGWxYIQCXz1 giOP9HpJtE/iuA5rs6xV/aGoUrOikYHhpr3KNjUmJhuF1FWl6GwVMuljyGakFdC1yxiKqD/Am7p1o 9L9HT96bRHX9vSqdHHYZUe2imwGgTRveHmmcyz6qY7GM7O0Fz9r54rBq+GehrQrtoIB0YuPP4HaSn /ekWaf9IzZc8mpdovNCA==; 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 1hawFI-0003vs-3x; Wed, 12 Jun 2019 05:56:28 +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-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=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: 10988517 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 CF60F6C5 for ; Wed, 12 Jun 2019 05:57:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBC6828961 for ; Wed, 12 Jun 2019 05:57:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF5CC2896A; Wed, 12 Jun 2019 05:57:06 +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 47AE128961 for ; Wed, 12 Jun 2019 05:57:06 +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=VgEsrQZDT6Qq9K6XM/SCszCnMT2n9Ozn0rXzLmrL51A=; b=OpTLfwz2Q1l/Gh OZp1RWitep3OcLIuPhid2CCBBlbyrNhrdqNfoOISCuYoTzrGw/qF34/N+hSwOqaOSEdvu4PyCccpt ZpiBtQ1rHk2CJj6SvVORI5HgeRC9fq/ZphUyZdknIMpY490e3gWz2YXi8lx8RqOSBggh4XIJw6Qcm pB9a8PoTAJAwsYQlppLPVjFjth5eGOEvWLUcEpNIiaxfph6GW4BOU1dnH7FXlNaNxtwienVan20wO x49dqkzANzFCmgNnm34vXGYhLFc5b5fiPV/xpQZaIsa0703l0eykX0gLjiAkZtelJ4or+bsGBoEnM HJVm2HQ44UQOWhzQp2PA==; 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 1hawFt-0004Uw-O2; Wed, 12 Jun 2019 05:57:05 +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-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=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: 10988511 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 402BC6C5 for ; Wed, 12 Jun 2019 05:56:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BF7328961 for ; Wed, 12 Jun 2019 05:56:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1F86C2896A; Wed, 12 Jun 2019 05:56:30 +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 BBD6628961 for ; Wed, 12 Jun 2019 05:56:29 +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=iA/4H5fVory3iWRadFZPbqYsufmEhBn4bVFWxlTQqLs=; b=t7AwDYpbAejCIK mlZcJb9UbG7CyWt7Vzb0h+8UTos/uIZJFwZLIHJn1/91Pqin8LI9I/y5lgOfeyAh7bsvR7gEbphuo DEhP196mssRv1o12SEFcoAUbsr3yKDpaLkmJOAc6Lmk94ZrODb9vhv/ADa5IHBxhgyb9Zp3sjv5fk xon7aw7RHFUNQvQMYFznv7sndsNBErqzohcOYLjFjPgv8pOU/ONZSG8fWS3vHraIGrUNzE0hrLOJB +SJ2tsvLmhoLn9wVW/NBIl6PzkS7xP8ULm0Fu3mTZ8r1PLFm60EzKNg0918ZPmYfb9VTkSmxT1ys5 P1gbH7jO85UmYQqWXHHg==; 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 1hawFJ-0003xR-9p; Wed, 12 Jun 2019 05:56:29 +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-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=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;