mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 05/14] ARM: AT91: Always provide clk_set_rate stub
Date: Fri, 28 Nov 2014 15:28:57 +0100	[thread overview]
Message-ID: <1417184946-16128-5-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1417184946-16128-1-git-send-email-s.hauer@pengutronix.de>

Some drivers need clk_set_rate. To be able to link with these
drivers enabled provide a clk_set_rate stub.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-at91/clock.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c
index a7051c3..125d169 100644
--- a/arch/arm/mach-at91/clock.c
+++ b/arch/arm/mach-at91/clock.c
@@ -336,8 +336,6 @@ EXPORT_SYMBOL(clk_get_rate);
 
 /*------------------------------------------------------------------------*/
 
-#ifdef CONFIG_AT91_PROGRAMMABLE_CLOCKS
-
 /*
  * For now, only the programmable clocks support reparenting (MCK could
  * do this too, with care) or rate changing (the PLLs could do this too,
@@ -379,6 +377,9 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
 	unsigned long	prescale_offset, css_mask;
 	unsigned long	actual;
 
+	if (!IS_ENABLED(CONFIG_PROGRAMMABLE_CLOCKS))
+		return 0;
+
 	if (!clk_is_programmable(clk))
 		return -EINVAL;
 	if (clk->users)
@@ -419,6 +420,9 @@ EXPORT_SYMBOL(clk_get_parent);
 
 int clk_set_parent(struct clk *clk, struct clk *parent)
 {
+	if (!IS_ENABLED(CONFIG_PROGRAMMABLE_CLOCKS))
+		return -ENOSYS;
+
 	if (clk->users)
 		return -EBUSY;
 	if (!clk_is_primary(parent) || !clk_is_programmable(clk))
@@ -453,8 +457,6 @@ static void init_programmable_clock(struct clk *clk)
 	clk->rate_hz = parent->rate_hz / pmc_prescaler_divider(pckr);
 }
 
-#endif	/* CONFIG_AT91_PROGRAMMABLE_CLOCKS */
-
 /*------------------------------------------------------------------------*/
 
 /* Register a new clock */
@@ -483,13 +485,10 @@ int clk_register(struct clk *clk)
 	else if (clk_is_sys(clk)) {
 		clk->parent = &mck;
 		clk->mode = pmc_sys_mode;
-	}
-#ifdef CONFIG_AT91_PROGRAMMABLE_CLOCKS
-	else if (clk_is_programmable(clk)) {
+	} else if (IS_ENABLED(CONFIG_PROGRAMMABLE_CLOCKS) && clk_is_programmable(clk)) {
 		clk->mode = pmc_sys_mode;
 		init_programmable_clock(clk);
 	}
-#endif
 
 	at91_clk_add(clk);
 
-- 
2.1.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2014-11-28 14:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-28 14:28 [PATCH 01/14] ARM: friendlyarm-mini2440: fix compilation for some displays Sascha Hauer
2014-11-28 14:28 ` [PATCH 02/14] ARM: ep93xx: Fix typo Sascha Hauer
2014-11-28 14:28 ` [PATCH 03/14] ARM: ep93xx: let broken SoCs depend on BROKEN Sascha Hauer
2014-11-28 14:28 ` [PATCH 04/14] ARM: Let MMU depend on !CPU_ARM946E Sascha Hauer
2014-11-28 14:28 ` Sascha Hauer [this message]
2014-11-28 15:23   ` [PATCH 05/14] ARM: AT91: Always provide clk_set_rate stub Lucas Stach
2014-11-30 11:01     ` Sascha Hauer
2014-11-28 14:28 ` [PATCH 06/14] mci: mxs-mci: add f_min/f_max fields unconditionally Sascha Hauer
2014-11-28 14:28 ` [PATCH 07/14] param: make string arguments to dev_add_param_fixed const Sascha Hauer
2014-11-28 14:29 ` [PATCH 08/14] fs: bpkfs: select CRC32 Sascha Hauer
2014-11-28 14:29 ` [PATCH 09/14] firmware: altera serial: depend on GENERIC_GPIO Sascha Hauer
2014-11-28 14:29 ` [PATCH 10/14] spi: mxs-spi: Allow compilation on i.MX28 only Sascha Hauer
2014-11-28 14:29 ` [PATCH 11/14] gpio: move gpio_is_valid to include/gpio.h Sascha Hauer
2014-11-28 14:29 ` [PATCH 12/14] ARM: rockchip: select PINCTRL Sascha Hauer
2014-11-28 14:29 ` [PATCH 13/14] ARM: AM335x: Select OFTREE Sascha Hauer
2014-11-28 14:29 ` [PATCH 14/14] Kconfig: make BROKEN invisible Sascha Hauer
2014-12-01  9:00   ` Michael Olbrich
2014-12-01 11:12     ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1417184946-16128-5-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox