From patchwork Fri Jul 21 15:22:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9857165 X-Patchwork-Delegate: sboyd@codeaurora.org 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 DF31F601C0 for ; Fri, 21 Jul 2017 15:28:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D42751FFF9 for ; Fri, 21 Jul 2017 15:28:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C875D286DE; Fri, 21 Jul 2017 15:28:26 +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=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 567D51FFF9 for ; Fri, 21 Jul 2017 15:28:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754105AbdGUPZ7 (ORCPT ); Fri, 21 Jul 2017 11:25:59 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:54095 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754620AbdGUPYa (ORCPT ); Fri, 21 Jul 2017 11:24:30 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.129]) with ESMTPA (Nemesis) id 0MMJjd-1dXipE3W73-008230; Fri, 21 Jul 2017 17:23:41 +0200 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org, Dmitry Eremin-Solenikov Cc: Arnd Bergmann , linux-clk@vger.kernel.org, Stephen Boyd , Michael Turquette , Sekhar Nori , Kevin Hilman , Hartley Sweeten , Alexander Sverdlin , Eric Miao , Haojian Zhuang , Russell King , Alexandre Bailon , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] ARM: sa1100: normalize clk API Date: Fri, 21 Jul 2017 17:22:47 +0200 Message-Id: <20170721152250.3310552-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170721152250.3310552-1-arnd@arndb.de> References: <20170721152250.3310552-1-arnd@arndb.de> X-Provags-ID: V03:K0:ufcoOrO34awk4t1kZwuZ8OZ585e9gieDzq2LNQL6QwEFy3Evft1 U17Nhpp6SWovZudaoly3/htzWApDMsf0YWiL4qbJqz2eHGG0aB6rWa40T8jjcVnESx3wd5Y +jfOPg8aOlaM/iVzLHi1fHH+ihWRpO0agdjE9CAHUNG9V43ELEWUB9YM3EA2uyT/U53fpmf A8hW5MZVNtuB9qg2zzEMA== X-UI-Out-Filterresults: notjunk:1; V01:K0:dl19JW89UqM=:cKXeHiCbxZmEOQrBhFOOoO Ujg8/0BZMIKIRbu1hTjCd491RBK3a9mi9HnHDVXi8k3ozKqh8QqzyUZD75DtPljYvYD9N3PJs kXAIPYZLEY1IrgyXvRBKNEaUmpnP490xv0LxhpsgKL/EMLdM+4PbgPJe4th9TsxXIRSdl08++ EwidDPryNd38TqY/1PT9VRCRM03jkE0i0xPZ9gB+hP4iKS1Pn2x3Wiumce4X4AImHBFeQP2/j jqnGlo8gdT2wCnlpyGazQsVL1GQNfxMXRFoYnPFPbH8sVRvC0MhaWadnQZpBIrWDnLvU30UdO awGjoSuqLCd0SgeAsamIUVWCSTlBgpUjk+EOcGLBIXtzkwM89MLtPMNywhuK75XLX29mnVBng GrTX0p1Rp3r6FH5455j+yCDkjm14xXmG3q2igotoTTtiVXkhzxLvBD7/LCLIgfswJb3P94928 hPYidpLnRS0LIqNRYY6SHq0FG/JXYbNwef8FgZKdOBlvj9mkcHboTqtNQ1h2X8Ee1SiTz1rwE j7LmkertcuDTknEgj66pwMdaycpFwAQuMgCXILbQZSmt7KmMprfNEzfm9m6nX9hrDtqZvM9jr DsLRf99gdI6VbJ6IkUN7ss0GBboJU1B1RhxlxH55QrK2Ht2cd9+b4MHiCx9raCWnJkx/T0Rvh e7vTsguP7tmQL5WAdQK9k0EChXdgWKVdPEOyo3uwQ1N/sa/4j/jlo8wuFDJ6oTsjscOAZEqOD FAdLprixkzQ5SHue94ra9XuVeWj5Lrtb73F7Jw== Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP sa1100 provides its own variant of the clk API rather than using the generic COMMON_CLK API. This generally works, but it causes some link errors with drivers using the clk_set_rate, clk_get_parent, clk_set_parent or clk_round_rate functions when a platform lacks those interfaces. This adds trivial stub implementations for each of them, based on the behavior of the COMMON_CLK implementation: - set_rate() and set_parent() report success without doing anything - round_rate() returns the clk rate - get_parent() returns NULL. This adds the minimal bloat and should do the right thing for the simple clock hardware in this SoC. Signed-off-by: Arnd Bergmann --- arch/arm/mach-sa1100/clock.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/arch/arm/mach-sa1100/clock.c b/arch/arm/mach-sa1100/clock.c index 0db46895c82a..7d52cd97d96e 100644 --- a/arch/arm/mach-sa1100/clock.c +++ b/arch/arm/mach-sa1100/clock.c @@ -35,6 +35,31 @@ struct clk clk_##_name = { \ static DEFINE_SPINLOCK(clocks_lock); +/* Dummy clk routine to build generic kernel parts that may be using them */ +long clk_round_rate(struct clk *clk, unsigned long rate) +{ + return clk_get_rate(clk); +} +EXPORT_SYMBOL(clk_round_rate); + +int clk_set_rate(struct clk *clk, unsigned long rate) +{ + return 0; +} +EXPORT_SYMBOL(clk_set_rate); + +int clk_set_parent(struct clk *clk, struct clk *parent) +{ + return 0; +} +EXPORT_SYMBOL(clk_set_parent); + +struct clk *clk_get_parent(struct clk *clk) +{ + return NULL; +} +EXPORT_SYMBOL(clk_get_parent); + static void clk_gpio27_enable(struct clk *clk) { /*