Received: by 10.223.185.116 with SMTP id b49csp4168445wrg; Mon, 19 Feb 2018 12:26:00 -0800 (PST) X-Google-Smtp-Source: AH8x224aPVEEsOrbyFKelX20TwbkmvbyW/B9UiFHw8h0PY5VObgmGoUAqzdRgkeSPad9sXjknOpK X-Received: by 10.99.97.7 with SMTP id v7mr13492599pgb.239.1519071960290; Mon, 19 Feb 2018 12:26:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519071960; cv=none; d=google.com; s=arc-20160816; b=Zd68ReHUAUR5bqg3pY8id0SVzTJswbbIEncvuTCNk2BtuzrijzahrJyuprc3xzgUnJ 3cjRYwlmGxuvf9QTkZPVIdeRGTeoo4TernLqgVcv9hm84bkQbsbMDfGw3aj2O0noqEUS yxMhWV8vqHiopw6TMo6gOvx9JIGRpJnoSM3QNYiprQFP0PK9AYvdbHRYwKaI7DfWSLzv 2x7+FSU6olhUgV/6YaBDJ/PZi9SlwqpxkF82GeqlzZtIEKsIQgo7mAMu1EItUOhL+6/p TELtTvnN9brBlk9sH6Yhv8a0gKDMUyr0ooir9QEwCAvclCZNF+/kOyyAHpcmaolcJX84 xRTg== 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=eZeDpmCei/nYSFF/BNjyxpWoSogMj/a5C5G3q80rB3Y=; b=VBgd4KAWvyx2U6PuND2KCW4TRk9OkzuHGgwBRjsrB/YXtnY5oTaz2pW3/VILy1tdtt ofuzzcg3UVnCg8h3hBk2cHrZrUTfx59MozNrMNHreCYOc9D4wPevScLBp20WdYXQl+tz DTT2JNqu5/xTxNPxhjtdQ0mG9tBsVvz4g2hkV77oEnhW+GZjgT4YhXNVwuvbYWwpIr9o ufnBpKFE/6sKj8s81PdCF5/ciJn32jyn+Wzasu4AY+SA9UJVSN+x32uEEQmCNkajS6qS 4m3yY6mFu/AgEzbewAijZXWGa8o2iRV5yKqxIA3k0NdgaAXxRICF66DZd1VTrYi/q0hx qYIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=Mk1976Kj; 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 m123si2465468pgm.698.2018.02.19.12.25.46; Mon, 19 Feb 2018 12:26:00 -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=Mk1976Kj; 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 S932306AbeBSUYO (ORCPT + 99 others); Mon, 19 Feb 2018 15:24:14 -0500 Received: from vern.gendns.com ([206.190.152.46]:58646 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932229AbeBSUXU (ORCPT ); Mon, 19 Feb 2018 15:23:20 -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=eZeDpmCei/nYSFF/BNjyxpWoSogMj/a5C5G3q80rB3Y=; b=Mk1976KjGBH29hfIVETfmSIRN w2KH+JZb+6Zenjfv9CGLryUMUqqq0QvV9kcF7ObU8nbXr9guYbjn3ZRbJQqBnUF5flBD8gkY1OSVx PvP/cv5MJcj+jeNCRL1XMithn5/4BJmBfYXkPTvTM1ZyoR0Xds8hXUuOlgPtHQoA2HF836SSAa4eW bSbE07RLfxFK6quv1tRDwZ9cl6oAhgeXAzIqh83Tt2qDhGOMMstVuAt/OfdT+DmyPhKnrxdP+74XK T9OnXgXjW9kd5tM+o3BdO6EhzvFwhtbxZN/6/d2R7ws+6NWFCV2x9bdGWGWEvcLXInBqoK86t9DsI G3w81xWhw==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:48842 helo=freyr.lechnology.com) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1enrwl-003xBV-Qj; Mon, 19 Feb 2018 15:22:00 -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 v7 28/42] ARM: davinci: da8xx: add new sata_refclk init using common clock framework Date: Mon, 19 Feb 2018 14:21:49 -0600 Message-Id: <1519071723-31790-29-git-send-email-david@lechnology.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519071723-31790-1-git-send-email-david@lechnology.com> References: <1519071723-31790-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 Reviewed-by: Sekhar Nori --- v7 changes: - sorting of include files seems to have been messed up by rebasing - will fix in later revision v6 changes: - none 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 24422ba..c7ec60b 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c @@ -10,25 +10,30 @@ * 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 "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 @@ -1040,6 +1045,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, @@ -1061,6 +1067,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