From patchwork Mon Oct 31 20:04:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 9406405 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 C7F6460585 for ; Mon, 31 Oct 2016 20:07:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B28AC285B2 for ; Mon, 31 Oct 2016 20:07:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A496528D41; Mon, 31 Oct 2016 20:07:22 +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=unavailable 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 2DD52285B2 for ; Mon, 31 Oct 2016 20:07:22 +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 1c1IqG-0006k9-Pn; Mon, 31 Oct 2016 20:06:00 +0000 Received: from vern.gendns.com ([206.190.152.46]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c1IpD-0004fi-Nc for linux-arm-kernel@lists.infradead.org; Mon, 31 Oct 2016 20:05:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=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:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Di306D3od70vVt1EM+tvGsK6fcCOAiy8pneSLwV9wAo=; b=fTJJIERLdSQ7byIurY5l6IL2bm eu97S47NWq+oslX0Co8Ek4Ma0fHtK3LTXJKVlLIoz+JGEs1YWbWNYuH8Z0ttSEQ2j3ahRV//TS3yu XR/3j0uW+nZRqPuIQrXx9hLMJsn5NcEkt6LVSuidH1aLoDuQa/97pVIfAvjL5sHR6QSzCqiPyTib7 jBEkiHF9+UMoQRyaRxSFFSsP/NRR90JrhSfcZAtW7r6E+9f1x9emNiQ1/idWZgfhl6uQnOa0LW9CC e5C8eI1aXWWTcSsdD7EVcVbmg25ecFiRoyUf7DkGZXASO/bivJr0/jwVQUJAnAsAkj0JRGOQv3GIa MS438SbQ==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:38126 helo=freyr.lechnology.com) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-SHA256:128) (Exim 4.87) (envelope-from ) id 1c1Ioq-001nEK-4m; Mon, 31 Oct 2016 16:04:32 -0400 From: David Lechner To: Sekhar Nori , Kevin Hilman Subject: [PATCH v2] ARM: davinci: da850: Fix pwm name matching Date: Mon, 31 Oct 2016 15:04:24 -0500 Message-Id: <1477944264-18637-1-git-send-email-david@lechnology.com> X-Mailer: git-send-email 2.7.4 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-20161031_130456_075222_A7C63B23 X-CRM114-Status: UNSURE ( 7.02 ) X-CRM114-Notice: Please train this message. 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: David Lechner , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.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 This fixes pwm name matching for DA850 familiy devices. When using device tree, the da850_auxdata_lookup[] table caused pwm devices to have the exact same name, which caused errors when trying to register the devices. We cannot have multiple entries for the same clock in in da850_clks[], so we have added child clocks to the EHRPWM and ECAP LPSC clocks so that each PWM device will have its own clock for proper name matching. Signed-off-by: David Lechner --- v2 changes: * Added child clocks so that each PWM has its own clock. arch/arm/mach-davinci/da850.c | 48 +++++++++++++++++++++++++++++++++++++--- arch/arm/mach-davinci/da8xx-dt.c | 10 ++++----- 2 files changed, 50 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index 196e262..a9db413 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -424,6 +424,16 @@ 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) @@ -451,6 +461,16 @@ 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", .parent = &async3_clk, @@ -458,6 +478,21 @@ 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 struct clk_lookup da850_clks[] = { CLK(NULL, "ref", &ref_clk), CLK(NULL, "pll0", &pll0_clk), @@ -510,9 +545,16 @@ static struct clk_lookup da850_clks[] = { CLK("vpif", NULL, &vpif_clk), CLK("ahci_da850", NULL, &sata_clk), CLK("davinci-rproc.0", NULL, &dsp_clk), - CLK("ehrpwm", "fck", &ehrpwm_clk), - CLK("ehrpwm", "tbclk", &ehrpwm_tbclk), - CLK("ecap", "fck", &ecap_clk), + CLK(NULL, NULL, &ehrpwm_clk), + CLK("ehrpwm.0", "fck", &ehrpwm0_clk), + CLK("ehrpwm.1", "fck", &ehrpwm1_clk), + CLK(NULL, NULL, &ehrpwm_tbclk), + CLK("ehrpwm.0", "tbclk", &ehrpwm0_tbclk), + CLK("ehrpwm.1", "tbclk", &ehrpwm1_tbclk), + CLK(NULL, NULL, &ecap_clk), + CLK("ecap.0", "fck", &ecap0_clk), + CLK("ecap.1", "fck", &ecap1_clk), + CLK("ecap.2", "fck", &ecap2_clk), CLK(NULL, NULL, NULL), }; diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c index 0e45cbd..aec569f9 100644 --- a/arch/arm/mach-davinci/da8xx-dt.c +++ b/arch/arm/mach-davinci/da8xx-dt.c @@ -23,11 +23,11 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = { OF_DEV_AUXDATA("ti,davinci-i2c", 0x01e28000, "i2c_davinci.2", NULL), OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "davinci-wdt", NULL), OF_DEV_AUXDATA("ti,da830-mmc", 0x01c40000, "da830-mmc.0", NULL), - OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f00000, "ehrpwm", NULL), - OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f02000, "ehrpwm", NULL), - OF_DEV_AUXDATA("ti,da850-ecap", 0x01f06000, "ecap", NULL), - OF_DEV_AUXDATA("ti,da850-ecap", 0x01f07000, "ecap", NULL), - OF_DEV_AUXDATA("ti,da850-ecap", 0x01f08000, "ecap", NULL), + OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f00000, "ehrpwm.0", NULL), + OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f02000, "ehrpwm.1", NULL), + OF_DEV_AUXDATA("ti,da850-ecap", 0x01f06000, "ecap.0", NULL), + OF_DEV_AUXDATA("ti,da850-ecap", 0x01f07000, "ecap.1", NULL), + OF_DEV_AUXDATA("ti,da850-ecap", 0x01f08000, "ecap.2", NULL), OF_DEV_AUXDATA("ti,da830-spi", 0x01c41000, "spi_davinci.0", NULL), OF_DEV_AUXDATA("ti,da830-spi", 0x01f0e000, "spi_davinci.1", NULL), OF_DEV_AUXDATA("ns16550a", 0x01c42000, "serial8250.0", NULL),