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: 9857159 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 47233600F5 for ; Fri, 21 Jul 2017 15:24:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B742286C2 for ; Fri, 21 Jul 2017 15:24:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 30620286DE; Fri, 21 Jul 2017 15:24:32 +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=-1.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=no 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 C6D91286C2 for ; Fri, 21 Jul 2017 15:24:31 +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=4QS1cK0+InSMTqZbilUPwF2O03N7UZB3g7KdoI21Wrs=; b=AFZL4X64HEuX6Om7sG4Vq6pTGN RZRND7qPEyuFLsKeO76rgy+6Erg5WaM3vNTtOvtzFx1uVkoT1IHn/yoWnahFRjSt2FvCpk5CrtD/A YpInBLdQGH5axYXzlSRpndf3LB/0P5oCmEIwrZzyMib3F24D38DeKjmgWDy0Gq1SKUdq0njjfRkZi I3IiWER4hk/a5IQ8W5Nv+sxBL5SPp6ilcoAiSyKlGXSsmucPPS9+c0hZs+e/xBvY2n3+ZKbpOJo8d r6fUSRpmVzaJhIg15itQQbbjNRvfSOOMnXr12cUafu6SZG/EyqKPvkbjywXy0EEFWjEKBhtaMvolW +zu/RLXg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dYZn2-0001C2-6e; Fri, 21 Jul 2017 15:24:28 +0000 Received: from mout.kundenserver.de ([212.227.126.134]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dYZmo-0000r2-S4 for linux-arm-kernel@lists.infradead.org; Fri, 21 Jul 2017 15:24:26 +0000 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 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== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170721_082415_332557_1F48B4D8 X-CRM114-Status: GOOD ( 12.09 ) 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: Eric Miao , Arnd Bergmann , Kevin Hilman , Masahiro Yamada , Stephen Boyd , Michael Turquette , Sekhar Nori , Russell King , Haojian Zhuang , linux-kernel@vger.kernel.org, Hartley Sweeten , Alexandre Bailon , Alexander Sverdlin , linux-clk@vger.kernel.org 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 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) { /*