From patchwork Tue May 15 08:23:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 159251 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B1FC5B6FB9 for ; Tue, 15 May 2012 18:26:30 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SUD3N-0005u7-9P; Tue, 15 May 2012 08:24:21 +0000 Received: from mail-out.m-online.net ([212.18.0.10]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SUD2w-0005qV-53 for linux-arm-kernel@lists.infradead.org; Tue, 15 May 2012 08:23:56 +0000 Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3VsBd33fhtz3hhj3; Tue, 15 May 2012 10:23:51 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.8.164]) by mail.m-online.net (Postfix) with ESMTP id 3VsBd33F98z4KK9P; Tue, 15 May 2012 10:23:51 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from smtp-auth.mnet-online.de ([192.168.8.180]) by localhost (dynscan1.mail.m-online.net [192.168.8.164]) (amavisd-new, port 10024) with ESMTP id 8AClJsbJZnei; Tue, 15 May 2012 10:23:50 +0200 (CEST) Received: from mashiro.lan (host-82-135-33-74.customer.m-online.net [82.135.33.74]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA; Tue, 15 May 2012 10:23:49 +0200 (CEST) From: Marek Vasut To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/8] MXS: Make clk_disable return integer Date: Tue, 15 May 2012 10:23:32 +0200 Message-Id: <1337070219-3630-2-git-send-email-marex@denx.de> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1337070219-3630-1-git-send-email-marex@denx.de> References: <1337070219-3630-1-git-send-email-marex@denx.de> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.18.0.10 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Marek Vasut , Li Frank-B20596 , Shi Make-B15407 , Subodh Nijsure , Detlev Zundel , Chen Peter-B29397 , Sascha Hauer , Linux USB , Liu JunJie-B08287 , Shawn Guo , Fabio Estevam , Stefano Babic , Wolfgang Denk X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org This allows subsequent USB clock patch to interchange enable() and disable() calls without adding unnecessary switching cruft. Signed-off-by: Marek Vasut Cc: Chen Peter-B29397 Cc: Detlev Zundel Cc: Fabio Estevam Cc: Li Frank-B20596 Cc: Linux USB Cc: Liu JunJie-B08287 Cc: Sascha Hauer Cc: Shawn Guo Cc: Shi Make-B15407 Cc: Stefano Babic Cc: Subodh Nijsure Cc: Wolfgang Denk --- arch/arm/mach-mxs/clock-mx28.c | 7 +++++-- arch/arm/mach-mxs/include/mach/clock.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c index cea29c9..43116ba 100644 --- a/arch/arm/mach-mxs/clock-mx28.c +++ b/arch/arm/mach-mxs/clock-mx28.c @@ -86,7 +86,7 @@ static int _raw_clk_enable(struct clk *clk) return 0; } -static void _raw_clk_disable(struct clk *clk) +static int _raw_clk_disable(struct clk *clk) { u32 reg; @@ -95,6 +95,8 @@ static void _raw_clk_disable(struct clk *clk) reg |= 1 << clk->enable_shift; __raw_writel(reg, clk->enable_reg); } + + return 0; } /* @@ -149,7 +151,7 @@ _CLK_ENABLE_PLL(pll1_clk, PLL1, EN_USB_CLKS) _CLK_ENABLE_PLL(pll2_clk, PLL2, CLKGATE) #define _CLK_DISABLE_PLL(name, r, g) \ -static void name##_disable(struct clk *clk) \ +static int name##_disable(struct clk *clk) \ { \ __raw_writel(BM_CLKCTRL_##r##CTRL0_POWER, \ CLKCTRL_BASE_ADDR + HW_CLKCTRL_##r##CTRL0_CLR); \ @@ -161,6 +163,7 @@ static void name##_disable(struct clk *clk) \ __raw_writel(BM_CLKCTRL_##r##CTRL0_##g, \ CLKCTRL_BASE_ADDR + HW_CLKCTRL_##r##CTRL0_CLR); \ \ + return 0; \ } _CLK_DISABLE_PLL(pll0_clk, PLL0, EN_USB_CLKS) diff --git a/arch/arm/mach-mxs/include/mach/clock.h b/arch/arm/mach-mxs/include/mach/clock.h index 592c9ab..21d1fad 100644 --- a/arch/arm/mach-mxs/include/mach/clock.h +++ b/arch/arm/mach-mxs/include/mach/clock.h @@ -50,7 +50,7 @@ struct clk { int (*enable) (struct clk *); /* Function ptr to disable the clock. Leave blank if clock can not be gated. */ - void (*disable) (struct clk *); + int (*disable) (struct clk *); /* Function ptr to set the parent clock of the clock. */ int (*set_parent) (struct clk *, struct clk *); };