summaryrefslogtreecommitdiffstats
path: root/drivers/clk/at91/pmc.h
diff options
context:
space:
mode:
authorVarshini Rajendran <varshini.rajendran@microchip.com>2024-07-29 09:07:53 +0200
committerClaudiu Beznea <claudiu.beznea@tuxon.dev>2024-08-07 18:16:47 +0200
commit5bf194adedb921f87fb7c9c59c590b802458bccc (patch)
tree2e0bf6083807c21462fef76141ddc7e439d990b8 /drivers/clk/at91/pmc.h
parentclk: at91: sam9x7: add support for HW PLL freq dividers (diff)
downloadlinux-5bf194adedb921f87fb7c9c59c590b802458bccc.tar.xz
linux-5bf194adedb921f87fb7c9c59c590b802458bccc.zip
clk: at91: sama7g5: move mux table macros to header file
Move the mux table init and fill macro function definitions from the sama7g5 pmc driver to the pmc.h header file since they will be used by other SoC's pmc drivers as well like sam9x7. Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev> Link: https://lore.kernel.org/r/20240729070753.1990866-1-varshini.rajendran@microchip.com Signed-off-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Diffstat (limited to 'drivers/clk/at91/pmc.h')
-rw-r--r--drivers/clk/at91/pmc.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h
index 91d1c6305d95..4fb29ca111f7 100644
--- a/drivers/clk/at91/pmc.h
+++ b/drivers/clk/at91/pmc.h
@@ -121,6 +121,22 @@ struct at91_clk_pms {
#define ndck(a, s) (a[s - 1].id + 1)
#define nck(a) (a[ARRAY_SIZE(a) - 1].id + 1)
+
+#define PMC_INIT_TABLE(_table, _count) \
+ do { \
+ u8 _i; \
+ for (_i = 0; _i < (_count); _i++) \
+ (_table)[_i] = _i; \
+ } while (0)
+
+#define PMC_FILL_TABLE(_to, _from, _count) \
+ do { \
+ u8 _i; \
+ for (_i = 0; _i < (_count); _i++) { \
+ (_to)[_i] = (_from)[_i]; \
+ } \
+ } while (0)
+
struct pmc_data *pmc_data_allocate(unsigned int ncore, unsigned int nsystem,
unsigned int nperiph, unsigned int ngck,
unsigned int npck);