From patchwork Sat Jan 20 17:14:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 10176571 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 47F326055D for ; Sat, 20 Jan 2018 17:35:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 327E328515 for ; Sat, 20 Jan 2018 17:35:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 252212859A; Sat, 20 Jan 2018 17:35:50 +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 EE3B528515 for ; Sat, 20 Jan 2018 17:35:48 +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=JCojbv8sNkRT2/avhUja04Cuq3UwFZom5lgVozEplo4=; b=shlDPpLczGfEWlxXBjmNe7C78F HVUGelrWd2DERGE4axUe5kj7bQJ9wFRPNIDpJPnKe1Zu+fKOKxoo7YCeldCGIVsIN/bklH18yy7L6 5dMxXQse7hn03T45Jd9goPpCW3ADwG8SCyPv3bLb3QWYNOhXmJFqymPQJ6LEOzJSs3YuUh9knlt/C /gfY15sckqFVlxYZQDDd1VRD0cw45vLdmx3SA+/1rc/x1Hywe23xGAOLHX8YhozZevIpLwp8QJ9B6 JOGrlCavcQCp9JiEIF3hI24B6hhlPsgUZZxeHOELkMpzGhIFjeCFKYmE9aeKsVslgYIV+jCliYzzZ 0tVoUrEg==; 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 1ecx3Q-0004ur-CO; Sat, 20 Jan 2018 17:35:44 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ecx2d-0002Sb-2U for linux-arm-kernel@bombadil.infradead.org; Sat, 20 Jan 2018 17:34:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=5k8iZ6VkKzQ2PwMpxAybnizOGJfH/ITVc4Ff8Yfd4PI=; b=is0+204HQiS2JNhXfU6GOEwZB mCUBXiAQJBW1H7mtp0DeECou+KfTJrZOTpoL9EEVfTjRzLDz2q243VyrPetAMHv5E/UkMCZ/CLD6c cz9DIvjQJap8NdJgq47KosQ2WnlPhyRPPKyF0BpRFKIrCzj2WAJDTMh/Gf4XcZqRglA0HCvDzUCdR UuuXJYsr3z8IrSdLSBlsrte2TmJFNd7zpi1DJZlJ3P2rVHRhynMW86Ph3UU/u/0LxW20o3mwgmcXd RXCycI28Fce7J6CEaz0WIOlEhBrc5CLoGpFTrS9uVEFBE0torKVQ43Iiktmw2cqUSy9yK0jYogEX4 +UYAbNVuA==; Received: from vern.gendns.com ([206.190.152.46]) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ecwlC-0005OF-5B for linux-arm-kernel@lists.infradead.org; Sat, 20 Jan 2018 17:16:58 +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=5k8iZ6VkKzQ2PwMpxAybnizOGJfH/ITVc4Ff8Yfd4PI=; b=hBsciSoUnHFRhTenlr07tox4J 65vgkRgbt2ELt0sZnN9H8sjllupeRkEK8+pC/+6a1MdIB5YhkppmfnAf9hC4nlCTcLD0nyKhlJZi0 vt+l1c3f/DStTIh4cRw5SdDGHynEXb7P/ZpK7I1ET/g0ZZ65YvH647hrLGx6WbRRt+50+W8so3CR3 CJYS7NmfFnBuYZFD0kXC0esYMo+curLJcBhBR9wuiMdI6fU4oR7XsPntRXHyO+UQ30mB63coE/ckb nbrh3Y1VXC273h8aeVbB7V63B2xk3gBX3+mCn1JN6dtQFFy80IXVR4ukUpGtAOi6b/9qnlDFmdBIH VT1xuT0iw==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:53590 helo=freyr.lechnology.com) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1ecwjd-00059q-0S; Sat, 20 Jan 2018 12:15:17 -0500 From: David Lechner To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v6 27/41] ARM: da8xx: add new sata_refclk init using common clock framework Date: Sat, 20 Jan 2018 11:14:06 -0600 Message-Id: <1516468460-4908-28-git-send-email-david@lechnology.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516468460-4908-1-git-send-email-david@lechnology.com> References: <1516468460-4908-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-20180120_171654_381081_E581CCF4 X-CRM114-Status: GOOD ( 12.86 ) 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: Mark Rutland , David Lechner , Kevin Hilman , Stephen Boyd , Michael Turquette , Sekhar Nori , linux-kernel@vger.kernel.org, Bartosz Golaszewski , Rob Herring , Adam Ford 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 adds the new SATA REFCLK clock init in mach-davinci/devices-da8xx.c using the new common clock framework drivers. The #ifdefs are needed to prevent compile errors until the entire ARCH_DAVINCI is converted. Also, the #includes are sorted since we are adding some here. Signed-off-by: David Lechner Reviewed-by: Sekhar Nori --- v6 changes: - none (can you believe it?) arch/arm/mach-davinci/devices-da8xx.c | 36 ++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index 44cda0a..1a06b09 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c @@ -10,26 +10,31 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ +#include +#include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include #include -#include +#include -#include #include -#include +#include #include -#include +#include + +#include "asp.h" #include "cpuidle.h" #include "sram.h" +#ifndef CONFIG_COMMON_CLK +#include #include "clock.h" -#include "asp.h" +#endif #define DA8XX_TPCC_BASE 0x01c00000 #define DA8XX_TPTC0_BASE 0x01c08000 @@ -1041,6 +1046,7 @@ int __init da8xx_register_spi_bus(int instance, unsigned num_chipselect) } #ifdef CONFIG_ARCH_DAVINCI_DA850 +#ifndef CONFIG_COMMON_CLK static struct clk sata_refclk = { .name = "sata_refclk", .set_rate = davinci_simple_set_rate, @@ -1062,6 +1068,18 @@ int __init da850_register_sata_refclk(int rate) return 0; } +#else +int __init da850_register_sata_refclk(int rate) +{ + struct clk *clk; + + clk = clk_register_fixed_rate(NULL, "sata_refclk", NULL, 0, rate); + if (IS_ERR(clk)) + return PTR_ERR(clk); + + return clk_register_clkdev(clk, "refclk", "ahci_da850"); +} +#endif static struct resource da850_sata_resources[] = { {