Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934037AbbHKJ1h (ORCPT ); Tue, 11 Aug 2015 05:27:37 -0400 Received: from mail-bn1on0119.outbound.protection.outlook.com ([157.56.110.119]:16704 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933915AbbHKJ06 (ORCPT ); Tue, 11 Aug 2015 05:26:58 -0400 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; vger.kernel.org; dkim=none (message not signed) header.d=none; From: Shengjiu Wang To: , , , , , , , , , CC: , , , Subject: [PATCH V1 2/3] ARM: imx6sl: Add SPDIF_GCLK clock in clock tree Date: Tue, 11 Aug 2015 17:26:53 +0800 Message-ID: <22e9a375a152703a52895af8d2596f6f58b93249.1439284957.git.shengjiu.wang@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD005;1:WSz5XTBdoetS7lVRghQan1rjTneb/F0/hlrd/5MD8mZOlIF0WdB1MX7XYPTMpSTbLHCywejjVH+IjC0y2xQCVOrMU24Y8H5ZBer+kvsY8tyurzf6kGNuBKAq8XVO6RRFP4QBYyX7fuS3Sdlh3q+FR2E6DmWCyRXVGlQrd5GTy8FGj4IZJlNUmIODrHviJjL5fcgq3X1+KKITMl3EGFMV0CrPTyrjZBFZvnxIOvVuG/N0qHgUeSJwBW32OcPKYSCbkY9Ar2QivUMlhiE7NbMl2Xo7zLnotFLsKMOm2dFIhMPJWMV1+oeGZdyXfiBtXabAXhVviKvcLrOQ72MG9+xXJmRP7B236P4djXnMN/c+SXDk1I0L4THZ/8rhVFY3hQYw X-Forefront-Antispam-Report: CIP:192.88.158.2;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(339900001)(3050300001)(199003)(189002)(50226001)(50466002)(64706001)(2201001)(68736005)(77096005)(105606002)(46102003)(106466001)(229853001)(33646002)(48376002)(189998001)(2950100001)(118296001)(5003940100001)(104016003)(92566002)(5001920100001)(50986999)(47776003)(87936001)(81156007)(5001960100002)(76176999)(77156002)(85426001)(36756003)(69596002)(6806004)(19580405001)(62966003)(5001830100001)(97736004)(5001770100001)(86362001)(575784001)(5001860100001)(4001540100001)(19580395003)(921003)(32563001)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:DM2PR0301MB1277;H:az84smr01.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB1277;2:GSsCy8IrOy7xoQV119w+hq/1RzH1J0ST95PnUF+yMukIq9Qe58P7Zc3Vb9uW+EXpS45O5MmPzrXvn53shioi58OmWkYxz8sTI71q4S0k5DBwReszzwSLYz8KKypmwiPYfEpcm28vi1Rg7jR+WvLYIteT3/1hxPnRA3BISuXq13s=;3:odqnFsh1ZAIQED02FIbV6i7XuLlOD0SWlKbvBLaHlvQtq+VX3C3NvMLlI8eiBK0FCcBMb9hwH3bkOXBPW3WZEnogkkfsqxgtlPQDV/WMjJctz6QSXsQ88NbkSnvk7AmZ/ZjDd9IO4uK/9pEmjoLWeBdrtq9U9H5plxG7vhVzGr2Vpdvc0jFF3EZRbO8cVpkfmUJCcR9Q1EqX74vQR0TvCKDR7VHq0wgh0VoIMGxwUdo=;25:sWq0QuylrMmajBV9BpbMiJols1dTXAU8qcuBpOXSD9hCMubp08rLJ+ZA/lbrMyTKfbmjBYrNWMBSEh/+lDiSPsfC2wr1D5O6QtWw2R6tiDEf1lgQl2TlsTAk4U14OhFY82FlVshhacHS0v4d6G/OqdrxO/8TQyTnai3guCnYsB27rIaMAGrWSXNzth1agTGLQnETtI9kqkoTtzDzwBG5zCSgtrkZxgLJluuxWD1uLtUyU0gh7lw01yO8kazUFmEJgsLWTA4j/BhlOTymBjnXlA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB1277; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB1277;20:/Cv6qF2tYpn8PbJHGPjHn5ZtyxDAdXfzO3Aj1nP7lrqtwsxxxU8NbcZmLLS3nhlEsUAHH1bNsiS1hSW7Hc1nLJWP03eT1H1j+zBjJr/2tedGxqnucX33voN1q5n3xUaod6Kh8XfWZq10QWWIRBkpXwKKtaBKdWGUIbO2i+JyiTl5IJYc+q0wPw23Z6EpJr/odm0dRtXpAt7IluynblS4+VaCEHdZgsFS+M8wswe9qEjbIhhJQe+J3nSGMOo9QmPFDpDqt4YwZZe19UodsQ7PoG4UBVzL1x9IkiTcD9xkbjlD/rpXp/dp5ZlG9qCvQSh269agsPbuONy3mz7bY5lNoi2lQ+FHJ3HjCKvfc1PBSVY=;4:Vs6SURDmoc4jVJnbSCfcsbexyUfGiySUFpksI13AwSJTMfXFVP/234MheBKzf7bm1kjydh5yRrJaTuHad/+mIsdEmMDYA8o/J/oL8P9WjZnO4tFGb9XTdF2O8bBvhvAr+fquLJVfARO83uWwWGPQOIYltXWAK1yhn5SEV7SSN5gTfKfumn9xxIpDVUOlFPwpn9HJfYLrtKqRd57HBTbUhAnWc3ccxq7MU4xB/1VHpcAzeNsFAAu9Z/KpVEiKwlF7ObrT5MIC/RD1bkSS8wkDJBBYwsm8V6OqK6Mi1Ej2Qgk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:DM2PR0301MB1277;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB1277; X-Forefront-PRVS: 066517B35B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM2PR0301MB1277;23:Hk7QiDVWGT+nscHIvHvXTlQmc8BXmwVkNrWqsO9?= =?us-ascii?Q?6yENtzODqVp8d9yVEMDeX+6c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ascii?Q?18OrdqpbngAX/0batGnWdkV0ld/VNQgsLumKl3tblIciHtTIE1IUsj02PpZN?= =?us-ascii?Q?a25g8522j3yASdBtCLQZHzdWar5SpiaBU3b1jjrpKCO7sOtK+71jggi/1IkR?= =?us-ascii?Q?RhKl/yZJquaGQEE6Pmzvh3SVLAD8uFn9bvgTkN9vf0GhlcD/Xwp2LZE0N6UL?= =?us-ascii?Q?a0R8jp42v7j4XbZC4sGBtBFzwiQz6Myr1ojIh2z/BDRriW5u1eYuicGKv/EN?= =?us-ascii?Q?0WRUlJR6fq2OeL942Rqpkmipefd7aIeoUd+UssGbyLIPa/hyCvND7BwI2XVe?= =?us-ascii?Q?te0P2XcUvgR/BcXZf9hD/avGhC0h09hfUycSH4jc8BkBE8omuQjqL5N6xNOI?= =?us-ascii?Q?9vA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB1277;5:D4o6ktak0no4FZ/o4odUwIGnabGLf6K/h7aFjdjUXDcmKFdfafwzYBYqwEdFmVw+tPZJSOK/VRfD8Enj5tpKm2+rAHHyfNM/K/aNEi7K3XzJIaV48dOrDw+or0p6UZHnxNysTZFGaV6qsOjthBJMSA==;24:+qNPX/Hd181PPJvnH/MA09Rx9lkGlDgcG8utm8V8quVbdFR+Ro18KVUOeXmKgNdUokFg+yE1Tbsb56YmRA//QD2yMakz2HcjYImDfmQbUxo=;20:JLGbTkCntty8E7Vk3t9WaBkpQs9t/sdHgN2bMMOvQoYT+JPSm+xfaMNdlln8OBQq0sWD5R6XmJFfgPvId0o26A== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2015 09:26:54.9533 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.158.2];Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB1277 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3990 Lines: 87 As spdif driver will register SPDIF clock to regmap, regmap will do clk_prepare in init function, so SPDIF clock is prepared in probe, then its root clock (pll clock) is prepared also, which cause the arm can't enter low power mode. Add SPDIF_GCLK in clock tree which share same gate bits with SPDIF clock. Its root clock is ipg clock, and register it to regmap, then the issue can be fixed. Signed-off-by: Shengjiu Wang --- arch/arm/boot/dts/imx6sl.dtsi | 16 ++++++++++++++++ drivers/clk/imx/clk-imx6sl.c | 4 +++- include/dt-bindings/clock/imx6sl-clock.h | 3 ++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi index 320a27f..c247756 100644 --- a/arch/arm/boot/dts/imx6sl.dtsi +++ b/arch/arm/boot/dts/imx6sl.dtsi @@ -135,8 +135,24 @@ ranges; spdif: spdif@02004000 { + compatible = "fsl,imx6sl-spdif", + "fsl,imx35-spdif"; reg = <0x02004000 0x4000>; interrupts = <0 52 IRQ_TYPE_LEVEL_HIGH>; + dmas = <&sdma 14 18 0>, + <&sdma 15 18 0>; + dma-names = "rx", "tx"; + clocks = <&clks IMX6SL_CLK_SPDIF_GCLK>, <&clks IMX6SL_CLK_OSC>, + <&clks IMX6SL_CLK_SPDIF>, <&clks IMX6SL_CLK_DUMMY>, + <&clks IMX6SL_CLK_DUMMY>, <&clks IMX6SL_CLK_DUMMY>, + <&clks IMX6SL_CLK_IPG>, <&clks IMX6SL_CLK_DUMMY>, + <&clks IMX6SL_CLK_DUMMY>, <&clks IMX6SL_CLK_SPBA>; + clock-names = "core", "rxtx0", + "rxtx1", "rxtx2", + "rxtx3", "rxtx4", + "rxtx5", "rxtx6", + "rxtx7", "dma"; + status = "disabled"; }; ecspi1: ecspi@02008000 { diff --git a/drivers/clk/imx/clk-imx6sl.c b/drivers/clk/imx/clk-imx6sl.c index a0d4cf2..a73cedd 100644 --- a/drivers/clk/imx/clk-imx6sl.c +++ b/drivers/clk/imx/clk-imx6sl.c @@ -97,6 +97,7 @@ static struct clk_div_table video_div_table[] = { static unsigned int share_count_ssi1; static unsigned int share_count_ssi2; static unsigned int share_count_ssi3; +static unsigned int share_count_spdif; static struct clk *clks[IMX6SL_CLK_END]; static struct clk_onecell_data clk_data; @@ -391,7 +392,8 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node) clks[IMX6SL_CLK_PWM4] = imx_clk_gate2("pwm4", "perclk", base + 0x78, 22); clks[IMX6SL_CLK_SDMA] = imx_clk_gate2("sdma", "ipg", base + 0x7c, 6); clks[IMX6SL_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12); - clks[IMX6SL_CLK_SPDIF] = imx_clk_gate2("spdif", "spdif0_podf", base + 0x7c, 14); + clks[IMX6SL_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif0_podf", base + 0x7c, 14, &share_count_spdif); + clks[IMX6SL_CLK_SPDIF_GCLK] = imx_clk_gate2_shared("spdif_gclk", "ipg", base + 0x7c, 14, &share_count_spdif); clks[IMX6SL_CLK_SSI1_IPG] = imx_clk_gate2_shared("ssi1_ipg", "ipg", base + 0x7c, 18, &share_count_ssi1); clks[IMX6SL_CLK_SSI2_IPG] = imx_clk_gate2_shared("ssi2_ipg", "ipg", base + 0x7c, 20, &share_count_ssi2); clks[IMX6SL_CLK_SSI3_IPG] = imx_clk_gate2_shared("ssi3_ipg", "ipg", base + 0x7c, 22, &share_count_ssi3); diff --git a/include/dt-bindings/clock/imx6sl-clock.h b/include/dt-bindings/clock/imx6sl-clock.h index 9ce4e42..e14573e 100644 --- a/include/dt-bindings/clock/imx6sl-clock.h +++ b/include/dt-bindings/clock/imx6sl-clock.h @@ -174,6 +174,7 @@ #define IMX6SL_CLK_SSI1_IPG 161 #define IMX6SL_CLK_SSI2_IPG 162 #define IMX6SL_CLK_SSI3_IPG 163 -#define IMX6SL_CLK_END 164 +#define IMX6SL_CLK_SPDIF_GCLK 164 +#define IMX6SL_CLK_END 165 #endif /* __DT_BINDINGS_CLOCK_IMX6SL_H */ -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/