From patchwork Mon Jan 8 02:23:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 10148847 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 F1EBE601BE for ; Mon, 8 Jan 2018 02:50:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E259A28602 for ; Mon, 8 Jan 2018 02:50:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D769328610; Mon, 8 Jan 2018 02:50: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=-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 5286728602 for ; Mon, 8 Jan 2018 02:50: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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=wqXo4PpHKsTJm+wPRchyR4/sZh0Z4rbp4vhVNHQ+DkU=; b=CT9 CHMRazBwuvo4cpq4yNV2D71NNcL1AInIwdjx7kGano9Mfa5aarKD3vyK/tA8fxscWdr0+DgUa4a5F AGuFNm7aGdk2QdJZggsJ5wbdIw+2H4jW0xxuoi0KHR77BTBsTk8J3egdU6MjgKcDrdHBKYf7Tp3Z5 sMJ3AS8bsjxQTAAEmCRyHlPzu4WgLs1zjb8dX2PKMQReBUnJHWMBOogPMM16111AtrN3QRXPxBYno Z1muW8LutTenuVMUtSF4VhtuK/kJasDfp3B1oN3aeh38CuFcFmCRLvLf49wHSOPJqZK0QXiWY5mZ/ U7rDihBgQDbPHEcy4qMM9sJkFmem8IQ==; 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 1eYNVk-000536-RC; Mon, 08 Jan 2018 02:50:04 +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 1eYNON-0007cX-Dz for linux-arm-kernel@bombadil.infradead.org; Mon, 08 Jan 2018 02:42:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=EjhBu6ZIDtFbmd1IMO4jeZu3rkhKg2+P/bCH39Ua08c=; b=KPBs4U+RRSee1019Z2nkI7nrG Kzm3u5+L9geL3zhz1o3iDvUVUFXMOAlcw3uVCmdzRNvFcgmbQWJklywxMQR5AjebcbY72dDxCVlDz ycx7pRpRTXNjAgHuomFnELd3eb3JN22/5CwQQkSo5g0+MpXVh/LAXXIvrbYbwvqmUdUAl+jMHFfNO sLbiOuhMXSRQoNoBnjuNPazJNPSGh7d6zChh45lQElnn44bzGpfSMEXLirNH8ZK6jwBOmXJ5Y1Ie+ XKeTq9XALaAsJD7nGd5VTgYcx33CSnAQAZilxeqhrDIxA114aExYQqlFNQHacIaSLLgAmipYb3r9d tBZg5gZJA==; Received: from vern.gendns.com ([206.190.152.46]) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eYN75-000737-T4 for linux-arm-kernel@lists.infradead.org; Mon, 08 Jan 2018 02:24:39 +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=EjhBu6ZIDtFbmd1IMO4jeZu3rkhKg2+P/bCH39Ua08c=; b=zwy8kE/kQavaz5VRjuKzjkC1pl 0s77NUbUm+09wun1uItA9WFMWjb+QmuPZ2uO2db/ZYyIt79tvy2ozfNmizZCgmoCFgDohjbeQVgfg +tol3Pmr9cIIuC8MB++9iXyTj+TRq1oTpylEa5K+QBP7CTTrFBJyQuJqBO4C+1J1L1w1v37doVean 4He/yIK2enbijtwTuLcvcViJLY9/khiBljEFNBt46tQZMuG3LcqumK4DifZC5oYD9jdZH/0C+Zh+o dJbMQzKI3fcku1bSkZmcp+s/GHw/80gizcteS3KaNev2Sx2OpK3CUq2ChM7h85NHR6jwsehRHXYA1 IQnd63Fg==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:54028 helo=freyr.lechnology.com) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-SHA256:128) (Exim 4.89) (envelope-from ) id 1eYN6j-000AHD-Ui; Sun, 07 Jan 2018 21:24:14 -0500 From: David Lechner To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 30/44] ARM: da8xx: add new sata_refclk init using common clock frmework Date: Sun, 7 Jan 2018 20:23:49 -0600 Message-Id: <1515378238-23105-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-20180108_022436_145300_BD030F0C X-CRM114-Status: GOOD ( 13.06 ) 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, 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 --- 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 fe5e15a..7ffacb9 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[] = { {