From: Brian Masney <bmasney@redhat.com>
To: Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Maxime Ripard <mripard@kernel.org>
Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
Brian Masney <bmasney@redhat.com>
Subject: [PATCH 2/2] clk: microchip: core: allow driver to be compiled with COMPILE_TEST
Date: Tue, 25 Nov 2025 14:39:55 -0500 [thread overview]
Message-ID: <20251125-clk-microchip-fixes-v1-2-6c1f5573d1b9@redhat.com> (raw)
In-Reply-To: <20251125-clk-microchip-fixes-v1-0-6c1f5573d1b9@redhat.com>
This driver currently only supports builds against a PIC32 target. To
avoid future breakage in the future, let's update the Kconfig and the
driver so that it can be built with CONFIG_COMPILE_TEST enabled.
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
drivers/clk/microchip/Kconfig | 2 +-
drivers/clk/microchip/clk-core.c | 10 +++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/microchip/Kconfig b/drivers/clk/microchip/Kconfig
index 1b9e43eb54976b219a0277cc971f353fd6af226a..1e56a057319d97e20440fe4e107d26fa85c95ab1 100644
--- a/drivers/clk/microchip/Kconfig
+++ b/drivers/clk/microchip/Kconfig
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
config COMMON_CLK_PIC32
- def_bool COMMON_CLK && MACH_PIC32
+ def_bool (COMMON_CLK && MACH_PIC32) || COMPILE_TEST
config MCHP_CLK_MPFS
bool "Clk driver for PolarFire SoC"
diff --git a/drivers/clk/microchip/clk-core.c b/drivers/clk/microchip/clk-core.c
index a0163441dfe5c1dfc27dae48e64cf3cb3d6b764f..c58f4289525d5d2c8449b96119fc70a3829d9f7e 100644
--- a/drivers/clk/microchip/clk-core.c
+++ b/drivers/clk/microchip/clk-core.c
@@ -9,9 +9,17 @@
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/iopoll.h>
-#include <asm/mach-pic32/pic32.h>
#include <asm/traps.h>
+#if !defined(CONFIG_MACH_PIC32) && defined(CONFIG_COMPILE_TEST)
+#define PIC32_CLR(_reg) ((_reg) + 0x04)
+#define PIC32_SET(_reg) ((_reg) + 0x08)
+#define PIC32_INV(_reg) ((_reg) + 0x0C)
+#define pic32_syskey_unlock()
+#else
+#include <asm/mach-pic32/pic32.h>
+#endif
+
#include "clk-core.h"
/* OSCCON Reg fields */
--
2.51.1
next prev parent reply other threads:[~2025-11-25 19:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-25 19:39 [PATCH 0/2] clk: microchip: core: fix issue with round_rate conversion and allow compile test Brian Masney
2025-11-25 19:39 ` [PATCH 1/2] clk: microchip: core: remove duplicate determine_rate on pic32_sclk_ops Brian Masney
2025-11-25 19:39 ` Brian Masney [this message]
2025-11-27 2:11 ` [PATCH 2/2] clk: microchip: core: allow driver to be compiled with COMPILE_TEST kernel test robot
2025-12-01 18:01 ` Brian Masney
2025-12-01 18:09 ` Conor Dooley
2025-12-01 21:09 ` Brian Masney
2025-12-01 21:37 ` Conor Dooley
2025-11-27 5:28 ` kernel test robot
2025-11-27 10:49 ` kernel test robot
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=20251125-clk-microchip-fixes-v1-2-6c1f5573d1b9@redhat.com \
--to=bmasney@redhat.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mripard@kernel.org \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.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
all inboxes | Powered by JetHome®