Received: by 10.223.176.46 with SMTP id f43csp1030416wra; Sat, 20 Jan 2018 09:19:53 -0800 (PST) X-Google-Smtp-Source: AH8x225nqtg+EGrZpFj5j6Km9iWaHQk6IB8u4LnyDpV5lVe2kDKkOVLU+uQehqqzTlrG/7/cE7/v X-Received: by 10.98.212.26 with SMTP id a26mr3037769pfh.38.1516468793760; Sat, 20 Jan 2018 09:19:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516468793; cv=none; d=google.com; s=arc-20160816; b=kpenhkK9GzcD/9MaUH60rcXPKWQdqoOYsD1NgIJKibqdo6S5B2QbCwJMdtaSxPdj6g 9wzZ6p/pMTziyEOEpaerkvaJS4YhjretMX2q/2bH9khyMJ3cgHe+ObqgXTOFcpKJSIrR qx4qdvg253PdhlJNNTJjGa6+65na4l2egQ/jA7U2FOmlRs8byw0wTFasO/u+i5fZBbZz wkI9xWW8sp7EUhI90tOk7MlMpgfE3l3jmGNf8LVJhEpdbT52rnOfFXDexvaLyWG1CNDO BikZXLh4ysXDdnWDUzXWEIMIbSQp25lGwGGfVktxBQ3qfLotUcpdU+OhipP8l+aH4QBU FlHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=5k8iZ6VkKzQ2PwMpxAybnizOGJfH/ITVc4Ff8Yfd4PI=; b=U5F627Tj7i1x4EhJ1rqEnjhAL3nbVbZteGOwNhLbBxUIln8Mzsn8PUH/+Z0II0XXq/ sqcGQMXi0TV3f2K3jXAZRTUQQfeYSwXjrU9Gg4V2NLkka91J66d/s/Uo+l0x7SIq71Jg zD/KcNBQPvXHYF7zU0rj2FTOhNZLKUqwPLPyOqE5nqFE0bawZ4+0FJSKyPvoiFLLXPVq 3uHX/KcxlFCogZn2aGNA/8/tCnB9ZQzYCHKIC/k/TVXvn/MGwmQz5v+8huQ+m1/xrJMs FH2w/NYrNIHD4Br0IO3WALzsZ0PulgqRSWnYZOJ4nhJ4XcN6nAyosZ+z8PUb6AfAG6b5 OZkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=hBsciSoU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j134si722122pgc.494.2018.01.20.09.19.40; Sat, 20 Jan 2018 09:19:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=hBsciSoU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756809AbeATRSL (ORCPT + 99 others); Sat, 20 Jan 2018 12:18:11 -0500 Received: from vern.gendns.com ([206.190.152.46]:42841 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756657AbeATRPt (ORCPT ); Sat, 20 Jan 2018 12:15:49 -0500 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 Cc: Michael Turquette , Stephen Boyd , Rob Herring , Mark Rutland , Sekhar Nori , Kevin Hilman , Bartosz Golaszewski , Adam Ford , linux-kernel@vger.kernel.org, David Lechner 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 - vger.kernel.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: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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[] = { { -- 2.7.4