From patchwork Sun Dec 31 23:39:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 10138353 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 1D4D86037D for ; Sun, 31 Dec 2017 23:42:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DAE320072 for ; Sun, 31 Dec 2017 23:42:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0242127F54; Sun, 31 Dec 2017 23:42:58 +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.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 613F420072 for ; Sun, 31 Dec 2017 23:42:58 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=+4SCU6Mp2DLTtLBsY0yWL15F9pTVG0Et+tMaUOxZXI0=; b=TgWLhC3XFpkJVYl57WsFqhB54k BUWc2UAevRd8rsaMRZPZ+ibdrA+HUOocBDLUSlfMUf8tSqz48R66cH0fmRnlkWaA680aNRFNj9fCB 0tSfnUWwWHM7qSDlFhOM2J8tM5RrP36O/MPo0AAyFbK91ABn2tWHxFklVw3SMuFjJwaGmjqqc0x0y +edWLhXMOwsNivepreWfy2iOHsFxDH9gecZC9wgc8RQuk1oWMJBPHyDYhmil5BVdsVYRPN2CiEfdx MOadd1ytkj5LlcRzaF8EKDEwWiyIHHntUSKabvsR8brFtPkOpMTEHc7Rf4G1TxZCYzjEWi0ySWOYg maxmN0gg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eVnFn-0003uM-8I; Sun, 31 Dec 2017 23:42:55 +0000 Received: from vern.gendns.com ([206.190.152.46]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eVnEa-00037a-0F for linux-arm-kernel@lists.infradead.org; Sun, 31 Dec 2017 23:41:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject :Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Dmq3O7ibd2jULIdRgyTrMUkxfjShZlmm35RSzePW5xA=; b=vBL2DZ6FsEmIQHE2ATecY6gQ2 45cTg/cX+gRR7c+pvq8BmPyEbhLfO7yq3Mu1lAd1Xzui5HlALiCL1wmEjPA2W/SObOJbQmRlpSSWh 2Q3TLLLklYGSpvT3Kh24kl32zdfjqyQniSUJUtr9HAa+ACQAeLSA3BHcUhHnPqw7le+drDq0HdiWI 891nXBSEBzN4Nv/whLN5ITDHq5xYTYLHex01Q/Xnr/XpGsfigl0z0SNuIZBe28bl77ZGOPkj2tOyU 9Lk6pyoEXlgpuxq/GBTB9rh37PUDUnV2I4Or6zvRe/VJDLj+8hWN7No2kBM17ZdxhWUK1J/fHxcW3 B14Ii5klg==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:35310 helo=freyr.lechnology.com) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-SHA256:128) (Exim 4.89) (envelope-from ) id 1eVnBC-002uGW-B3; Sun, 31 Dec 2017 18:38:10 -0500 From: David Lechner To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 3/7] ARM: davinci: fix duplicate clocks Date: Sun, 31 Dec 2017 17:39:44 -0600 Message-Id: <1514763588-31560-4-git-send-email-david@lechnology.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514763588-31560-1-git-send-email-david@lechnology.com> References: <1514763588-31560-1-git-send-email-david@lechnology.com> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171231_154140_207310_9E678FB4 X-CRM114-Status: UNSURE ( 9.46 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Adam Ford , Sekhar Nori , David Lechner , linux-kernel@vger.kernel.org, Kevin Hilman 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 There are a number of clocks that were duplicated because they are used by more than one device. It is no longer necessary to do this since we are explicitly calling clk_register_clkdev() for each clock. In da830.c, some clocks were using the same LPSC, which would cause problems with reference counting, so these are combinded into one clock each. In da850.c the duplicate clocks had already been fixed by creating dummy child clocks, so these clocks are removed. Signed-off-by: David Lechner --- arch/arm/mach-davinci/da830.c | 65 ++++++-------------------------------- arch/arm/mach-davinci/da850.c | 72 ------------------------------------------ arch/arm/mach-davinci/dm365.c | 1 - arch/arm/mach-davinci/dm644x.c | 3 -- arch/arm/mach-davinci/dm646x.c | 1 - 5 files changed, 9 insertions(+), 133 deletions(-) diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c index 73c48f5..b0e54a1 100644 --- a/arch/arm/mach-davinci/da830.c +++ b/arch/arm/mach-davinci/da830.c @@ -213,57 +213,22 @@ static struct clk spi1_clk = { .gpsc = 1, }; -static struct clk ecap0_clk = { - .name = "ecap0", +static struct clk ecap_clk = { + .name = "ecap", .parent = &pll0_sysclk2, .lpsc = DA8XX_LPSC1_ECAP, .gpsc = 1, }; -static struct clk ecap1_clk = { - .name = "ecap1", - .parent = &pll0_sysclk2, - .lpsc = DA8XX_LPSC1_ECAP, - .gpsc = 1, -}; - -static struct clk ecap2_clk = { - .name = "ecap2", - .parent = &pll0_sysclk2, - .lpsc = DA8XX_LPSC1_ECAP, - .gpsc = 1, -}; - -static struct clk pwm0_clk = { - .name = "pwm0", - .parent = &pll0_sysclk2, - .lpsc = DA8XX_LPSC1_PWM, - .gpsc = 1, -}; - -static struct clk pwm1_clk = { - .name = "pwm1", +static struct clk pwm_clk = { + .name = "pwm", .parent = &pll0_sysclk2, .lpsc = DA8XX_LPSC1_PWM, .gpsc = 1, }; -static struct clk pwm2_clk = { - .name = "pwm2", - .parent = &pll0_sysclk2, - .lpsc = DA8XX_LPSC1_PWM, - .gpsc = 1, -}; - -static struct clk eqep0_clk = { - .name = "eqep0", - .parent = &pll0_sysclk2, - .lpsc = DA830_LPSC1_EQEP, - .gpsc = 1, -}; - -static struct clk eqep1_clk = { - .name = "eqep1", +static struct clk eqep_clk = { + .name = "eqep", .parent = &pll0_sysclk2, .lpsc = DA830_LPSC1_EQEP, .gpsc = 1, @@ -304,11 +269,6 @@ static struct clk usb20_clk = { .gpsc = 1, }; -static struct clk cppi41_clk = { - .name = "cppi41", - .parent = &usb20_clk, -}; - static struct clk aemif_clk = { .name = "aemif", .parent = &pll0_sysclk3, @@ -434,21 +394,16 @@ static __init void da830_clk_init(void) clk_register_clkdev(clk, NULL, "spi_davinci.0"); clk = davinci_clk_init(&spi1_clk); clk_register_clkdev(clk, NULL, "spi_davinci.1"); - clk = davinci_clk_init(&ecap0_clk); + clk = davinci_clk_init(&ecap_clk); clk_register_clkdev(clk, "ecap0", NULL); - clk = davinci_clk_init(&ecap1_clk); clk_register_clkdev(clk, "ecap1", NULL); - clk = davinci_clk_init(&ecap2_clk); clk_register_clkdev(clk, "ecap2", NULL); - clk = davinci_clk_init(&pwm0_clk); + clk = davinci_clk_init(&pwm_clk); clk_register_clkdev(clk, "pwm0", NULL); - clk = davinci_clk_init(&pwm1_clk); clk_register_clkdev(clk, "pwm1", NULL); - clk = davinci_clk_init(&pwm2_clk); clk_register_clkdev(clk, "pwm2", NULL); - clk = davinci_clk_init(&eqep0_clk); + clk = davinci_clk_init(&eqep_clk); clk_register_clkdev(clk, NULL, "eqep.0"); - clk = davinci_clk_init(&eqep1_clk); clk_register_clkdev(clk, NULL, "eqep.1"); clk = davinci_clk_init(&lcdc_clk); clk_register_clkdev(clk, "fck", "da8xx_lcdc.0"); @@ -460,7 +415,6 @@ static __init void da830_clk_init(void) clk_register_clkdev(clk, NULL, "davinci-mcasp.2"); clk = davinci_clk_init(&usb20_clk); clk_register_clkdev(clk, "usb20", "musb-da8xx"); - clk = davinci_clk_init(&cppi41_clk); clk_register_clkdev(clk, NULL, "cppi41-dmaengine"); clk = davinci_clk_init(&aemif_clk); clk_register_clkdev(clk, "aemif", NULL); @@ -470,7 +424,6 @@ static __init void da830_clk_init(void) clk_register_clkdev(clk, "secu_mgr", NULL); clk = davinci_clk_init(&emac_clk); clk_register_clkdev(clk, NULL, "davinci_emac.1"); - clk = davinci_clk_init(&emac_clk); clk_register_clkdev(clk, "fck", "davinci_mdio.0"); clk = davinci_clk_init(&gpio_clk); clk_register_clkdev(clk, "gpio", NULL); diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index eaa05ac..0975edb 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -319,16 +319,6 @@ static struct clk emac_clk = { .gpsc = 1, }; -/* - * In order to avoid adding the emac_clk to the clock lookup table twice (and - * screwing up the linked list in the process) create a separate clock for - * mdio inheriting the rate from emac_clk. - */ -static struct clk mdio_clk = { - .name = "mdio", - .parent = &emac_clk, -}; - static struct clk mcasp_clk = { .name = "mcasp", .parent = &async3_clk, @@ -377,16 +367,6 @@ static struct clk aemif_clk = { .flags = ALWAYS_ENABLED, }; -/* - * In order to avoid adding the aemif_clk to the clock lookup table twice (and - * screwing up the linked list in the process) create a separate clock for - * nand inheriting the rate from aemif_clk. - */ -static struct clk aemif_nand_clk = { - .name = "nand", - .parent = &aemif_clk, -}; - static struct clk usb11_clk = { .name = "usb11", .parent = &pll0_sysclk4, @@ -401,11 +381,6 @@ static struct clk usb20_clk = { .gpsc = 1, }; -static struct clk cppi41_clk = { - .name = "cppi41", - .parent = &usb20_clk, -}; - static struct clk spi0_clk = { .name = "spi0", .parent = &pll0_sysclk2, @@ -449,16 +424,6 @@ static struct clk ehrpwm_clk = { .gpsc = 1, }; -static struct clk ehrpwm0_clk = { - .name = "ehrpwm0", - .parent = &ehrpwm_clk, -}; - -static struct clk ehrpwm1_clk = { - .name = "ehrpwm1", - .parent = &ehrpwm_clk, -}; - #define DA8XX_EHRPWM_TBCLKSYNC BIT(12) static void ehrpwm_tblck_enable(struct clk *clk) @@ -486,15 +451,6 @@ static struct clk ehrpwm_tbclk = { .clk_disable = ehrpwm_tblck_disable, }; -static struct clk ehrpwm0_tbclk = { - .name = "ehrpwm0_tbclk", - .parent = &ehrpwm_tbclk, -}; - -static struct clk ehrpwm1_tbclk = { - .name = "ehrpwm1_tbclk", - .parent = &ehrpwm_tbclk, -}; static struct clk ecap_clk = { .name = "ecap", @@ -503,21 +459,6 @@ static struct clk ecap_clk = { .gpsc = 1, }; -static struct clk ecap0_clk = { - .name = "ecap0_clk", - .parent = &ecap_clk, -}; - -static struct clk ecap1_clk = { - .name = "ecap1_clk", - .parent = &ecap_clk, -}; - -static struct clk ecap2_clk = { - .name = "ecap2_clk", - .parent = &ecap_clk, -}; - static __init void da850_clk_init(void) { struct clk *clk; @@ -592,7 +533,6 @@ static __init void da850_clk_init(void) clk_register_clkdev(clk, "rmii", NULL); clk = davinci_clk_init(&emac_clk); clk_register_clkdev(clk, NULL, "davinci_emac.1"); - clk = davinci_clk_init(&mdio_clk); clk_register_clkdev(clk, "fck", "davinci_mdio.0"); clk = davinci_clk_init(&mcasp_clk); clk_register_clkdev(clk, NULL, "davinci-mcasp.0"); @@ -608,13 +548,11 @@ static __init void da850_clk_init(void) clk_register_clkdev(clk, NULL, "da830-mmc.1"); clk = davinci_clk_init(&aemif_clk); clk_register_clkdev(clk, NULL, "ti-aemif"); - clk = davinci_clk_init(&aemif_nand_clk); clk_register_clkdev(clk, "aemif", "davinci-nand.0"); clk = davinci_clk_init(&usb11_clk); clk_register_clkdev(clk, "usb11", "ohci-da8xx"); clk = davinci_clk_init(&usb20_clk); clk_register_clkdev(clk, "usb20", "musb-da8xx"); - clk = davinci_clk_init(&cppi41_clk); clk_register_clkdev(clk, NULL, "cppi41-dmaengine"); clk = davinci_clk_init(&spi0_clk); clk_register_clkdev(clk, NULL, "spi_davinci.0"); @@ -627,24 +565,14 @@ static __init void da850_clk_init(void) clk = davinci_clk_init(&dsp_clk); clk_register_clkdev(clk, NULL, "davinci-rproc.0"); clk = davinci_clk_init(&ehrpwm_clk); - clk_register_clkdev(clk, NULL, NULL); - clk = davinci_clk_init(&ehrpwm0_clk); clk_register_clkdev(clk, "fck", "ehrpwm.0"); - clk = davinci_clk_init(&ehrpwm1_clk); clk_register_clkdev(clk, "fck", "ehrpwm.1"); clk = davinci_clk_init(&ehrpwm_tbclk); - clk_register_clkdev(clk, NULL, NULL); - clk = davinci_clk_init(&ehrpwm0_tbclk); clk_register_clkdev(clk, "tbclk", "ehrpwm.0"); - clk = davinci_clk_init(&ehrpwm1_tbclk); clk_register_clkdev(clk, "tbclk", "ehrpwm.1"); clk = davinci_clk_init(&ecap_clk); - clk_register_clkdev(clk, NULL, NULL); - clk = davinci_clk_init(&ecap0_clk); clk_register_clkdev(clk, "fck", "ecap.0"); - clk = davinci_clk_init(&ecap1_clk); clk_register_clkdev(clk, "fck", "ecap.1"); - clk = davinci_clk_init(&ecap2_clk); clk_register_clkdev(clk, "fck", "ecap.2"); } diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index 0cf4ab4..430fb1e 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c @@ -533,7 +533,6 @@ static __init void dm365_clk_init(void) clk_register_clkdev(clk, "usb", NULL); clk = davinci_clk_init(&emac_clk); clk_register_clkdev(clk, NULL, "davinci_emac.1"); - clk = davinci_clk_init(&emac_clk); clk_register_clkdev(clk, "fck", "davinci_mdio.0"); clk = davinci_clk_init(&voicecodec_clk); clk_register_clkdev(clk, NULL, "davinci_voicecodec"); diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index 769ce29..58120f4 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c @@ -323,8 +323,6 @@ static __init void dm644x_clk_init(void) clk_register_clkdev(clk, "master", "vpss"); clk = davinci_clk_init(&vpss_slave_clk); clk_register_clkdev(clk, "slave", "vpss"); - clk = davinci_clk_init(&arm_clk); - clk_register_clkdev(clk, "arm", NULL); clk = davinci_clk_init(&uart0_clk); clk_register_clkdev(clk, NULL, "serial8250.0"); clk = davinci_clk_init(&uart1_clk); @@ -333,7 +331,6 @@ static __init void dm644x_clk_init(void) clk_register_clkdev(clk, NULL, "serial8250.2"); clk = davinci_clk_init(&emac_clk); clk_register_clkdev(clk, NULL, "davinci_emac.1"); - clk = davinci_clk_init(&emac_clk); clk_register_clkdev(clk, "fck", "davinci_mdio.0"); clk = davinci_clk_init(&i2c_clk); clk_register_clkdev(clk, NULL, "i2c_davinci.1"); diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c index d75b4bc09..0cd5d51 100644 --- a/arch/arm/mach-davinci/dm646x.c +++ b/arch/arm/mach-davinci/dm646x.c @@ -386,7 +386,6 @@ static __init void dm646x_clk_init(void) clk_register_clkdev(clk, "aemif", NULL); clk = davinci_clk_init(&emac_clk); clk_register_clkdev(clk, NULL, "davinci_emac.1"); - clk = davinci_clk_init(&emac_clk); clk_register_clkdev(clk, "fck", "davinci_mdio.0"); clk = davinci_clk_init(&pwm0_clk); clk_register_clkdev(clk, "pwm0", NULL);