mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@barebox.org>
Subject: [PATCH 2/8] clk: at91: sam9x60-pll: allow building under COMPILE_TEST and fix the build
Date: Mon, 31 Aug 2026 21:35:49 +0200	[thread overview]
Message-ID: <20260831193605.1474749-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20260831193605.1474749-1-a.fatoum@pengutronix.de>

From: Ahmad Fatoum <a.fatoum@barebox.org>

HAVE_AT91_SAM9X60_PLL is only selected by SOC_SAM9X60 and SOC_SAMA7G5,
which no board selects, so the driver has never been compiled and
doesn't build:

  clk-sam9x60-pll.c:78:17: error: implicit declaration of function 'DIV_ROUND_CLOSEST_ULL'
  clk-sam9x60-pll.c:201:16: error: implicit declaration of function 'mult_frac'
  clk-sam9x60-pll.c:442:28: error: implicit declaration of function 'abs'
  clk-sam9x60-pll.c:483:20: error: implicit declaration of function 'DIV_ROUND_CLOSEST'

Include the missing headers and give the symbol a COMPILE_TEST prompt.

Fixes: 18afc26f9caa ("clk: at91: port Linux v5.6 SAM9X60 (new ARM926EJ-S) clock support")
Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 arch/arm/mach-at91/Kconfig         | 2 +-
 drivers/clk/at91/clk-sam9x60-pll.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index db79ad2d267a..df20943254a9 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -44,7 +44,7 @@ config HAVE_AT91_I2S_MUX_CLK
 	bool
 
 config HAVE_AT91_SAM9X60_PLL
-	bool
+	bool "SAM9X60 PLL support" if COMPILE_TEST
 
 config HAVE_AT91_SDRAMC
 	bool
diff --git a/drivers/clk/at91/clk-sam9x60-pll.c b/drivers/clk/at91/clk-sam9x60-pll.c
index c4f16061288f..4a1843e06c00 100644
--- a/drivers/clk/at91/clk-sam9x60-pll.c
+++ b/drivers/clk/at91/clk-sam9x60-pll.c
@@ -9,6 +9,8 @@
 #include <linux/clk-provider.h>
 #include <linux/clkdev.h>
 #include <linux/clk/at91_pmc.h>
+#include <linux/math.h>
+#include <linux/math64.h>
 #include <of.h>
 #include <mfd/syscon.h>
 #include <linux/regmap.h>
-- 
2.47.3




  reply	other threads:[~2026-08-31 19:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 19:35 [PATCH 1/8] clk: stm32f4: " Ahmad Fatoum
2026-08-31 19:35 ` Ahmad Fatoum [this message]
2026-08-31 19:35 ` [PATCH 3/8] clk: composite: return ERR_PTR on registration failure Ahmad Fatoum
2026-08-31 19:35 ` [PATCH 4/8] clk: fixed-factor: use 64-bit arithmetic in recalc_rate Ahmad Fatoum
2026-08-31 19:35 ` [PATCH 5/8] clk: imx: pllv3: use 64-bit arithmetic in fractional PLL recalc_rate Ahmad Fatoum
2026-08-31 19:35 ` [PATCH 6/8] clk: divider: use 64-bit division in _div_round_up and divider_get_val Ahmad Fatoum
2026-08-31 19:35 ` [PATCH 7/8] clk: divider: round up when searching for the best divider Ahmad Fatoum
2026-08-31 19:35 ` [PATCH 8/8] clk: divider: fix calculation of maximal parent rate for a given divider Ahmad Fatoum

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=20260831193605.1474749-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=a.fatoum@barebox.org \
    --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