Skip to content

Commit 026d70d

Browse files
masneybtsbogend
authored andcommitted
clk: microchip: core: allow driver to be compiled with COMPILE_TEST
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. Note that with the existing asm calls is not how I'd want to do this today if this was a new driver, however I don't have access to this hardware. To avoid any breakage, let's keep the existing behavior. Signed-off-by: Brian Masney <bmasney@redhat.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
1 parent 89ace07 commit 026d70d

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

drivers/clk/microchip/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22

33
config COMMON_CLK_PIC32
4-
def_bool COMMON_CLK && MACH_PIC32
4+
def_bool (COMMON_CLK && MACH_PIC32) || COMPILE_TEST
55

66
config MCHP_CLK_MPFS
77
bool "Clk driver for PolarFire SoC"

drivers/clk/microchip/clk-core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
/* SoC specific clock needed during SPLL clock rate switch */
7676
static struct clk_hw *pic32_sclk_hw;
7777

78+
#ifdef CONFIG_MATCH_PIC32
7879
/* add instruction pipeline delay while CPU clock is in-transition. */
7980
#define cpu_nop5() \
8081
do { \
@@ -84,6 +85,9 @@ do { \
8485
__asm__ __volatile__("nop"); \
8586
__asm__ __volatile__("nop"); \
8687
} while (0)
88+
#else
89+
#define cpu_nop5()
90+
#endif
8791

8892
/* Perpheral bus clocks */
8993
struct pic32_periph_clk {

0 commit comments

Comments
 (0)