diff options
author | Stephen Boyd <sboyd@kernel.org> | 2023-06-27 01:29:58 +0200 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2023-06-27 01:29:58 +0200 |
commit | ff1c6c904c8dd265e62abd8adf301bf755e203de (patch) | |
tree | fb8c18bedfe2493540572e863d504b143ca6f3a3 /drivers/clk/at91/clk-main.c | |
parent | Merge tag 'clk-microchip-6.5' of https://git.kernel.org/pub/scm/linux/kernel/... (diff) | |
parent | clk: at91: sama7g5: s/ep_chg_chg_id/ep_chg_id (diff) | |
download | linux-ff1c6c904c8dd265e62abd8adf301bf755e203de.tar.xz linux-ff1c6c904c8dd265e62abd8adf301bf755e203de.zip |
Merge tag 'clk-microchip-6.5-2' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into clk-microchip
Pull Microchip clk driver updates from Claudiu Beznea:
It contains support for parent_data, parent_hw in AT91 clock drivers
used by SAMA7G5 SoC (e.g. main, master, generic, peripheral, programmable,
system, utmi, slow clocks) and also the update of SAMA7G5 to use
this new support.
* tag 'clk-microchip-6.5-2' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux:
clk: at91: sama7g5: s/ep_chg_chg_id/ep_chg_id
clk: at91: sama7g5: switch to parent_hw and parent_data
clk: at91: sckc: switch to parent_data/parent_hw
clk: at91: clk-sam9x60-pll: add support for parent_hw
clk: at91: clk-utmi: add support for parent_hw
clk: at91: clk-system: add support for parent_hw
clk: at91: clk-programmable: add support for parent_hw
clk: at91: clk-peripheral: add support for parent_hw
clk: at91: clk-master: add support for parent_hw
clk: at91: clk-generated: add support for parent_hw
clk: at91: clk-main: add support for parent_data/parent_hw
Diffstat (limited to 'drivers/clk/at91/clk-main.c')
-rw-r--r-- | drivers/clk/at91/clk-main.c | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/drivers/clk/at91/clk-main.c b/drivers/clk/at91/clk-main.c index 8601b27c1ae0..4b5f0ff9e287 100644 --- a/drivers/clk/at91/clk-main.c +++ b/drivers/clk/at91/clk-main.c @@ -152,14 +152,15 @@ struct clk_hw * __init at91_clk_register_main_osc(struct regmap *regmap, const char *name, const char *parent_name, + struct clk_parent_data *parent_data, bool bypass) { struct clk_main_osc *osc; - struct clk_init_data init; + struct clk_init_data init = {}; struct clk_hw *hw; int ret; - if (!name || !parent_name) + if (!name || !(parent_name || parent_data)) return ERR_PTR(-EINVAL); osc = kzalloc(sizeof(*osc), GFP_KERNEL); @@ -168,7 +169,10 @@ at91_clk_register_main_osc(struct regmap *regmap, init.name = name; init.ops = &main_osc_ops; - init.parent_names = &parent_name; + if (parent_data) + init.parent_data = (const struct clk_parent_data *)parent_data; + else + init.parent_names = &parent_name; init.num_parents = 1; init.flags = CLK_IGNORE_UNUSED; @@ -397,17 +401,18 @@ static const struct clk_ops rm9200_main_ops = { struct clk_hw * __init at91_clk_register_rm9200_main(struct regmap *regmap, const char *name, - const char *parent_name) + const char *parent_name, + struct clk_hw *parent_hw) { struct clk_rm9200_main *clkmain; - struct clk_init_data init; + struct clk_init_data init = {}; struct clk_hw *hw; int ret; if (!name) return ERR_PTR(-EINVAL); - if (!parent_name) + if (!(parent_name || parent_hw)) return ERR_PTR(-EINVAL); clkmain = kzalloc(sizeof(*clkmain), GFP_KERNEL); @@ -416,7 +421,10 @@ at91_clk_register_rm9200_main(struct regmap *regmap, init.name = name; init.ops = &rm9200_main_ops; - init.parent_names = &parent_name; + if (parent_hw) + init.parent_hws = (const struct clk_hw **)&parent_hw; + else + init.parent_names = &parent_name; init.num_parents = 1; init.flags = 0; @@ -543,10 +551,11 @@ struct clk_hw * __init at91_clk_register_sam9x5_main(struct regmap *regmap, const char *name, const char **parent_names, + struct clk_hw **parent_hws, int num_parents) { struct clk_sam9x5_main *clkmain; - struct clk_init_data init; + struct clk_init_data init = {}; unsigned int status; struct clk_hw *hw; int ret; @@ -554,7 +563,7 @@ at91_clk_register_sam9x5_main(struct regmap *regmap, if (!name) return ERR_PTR(-EINVAL); - if (!parent_names || !num_parents) + if (!(parent_hws || parent_names) || !num_parents) return ERR_PTR(-EINVAL); clkmain = kzalloc(sizeof(*clkmain), GFP_KERNEL); @@ -563,7 +572,10 @@ at91_clk_register_sam9x5_main(struct regmap *regmap, init.name = name; init.ops = &sam9x5_main_ops; - init.parent_names = parent_names; + if (parent_hws) + init.parent_hws = (const struct clk_hw **)parent_hws; + else + init.parent_names = parent_names; init.num_parents = num_parents; init.flags = CLK_SET_PARENT_GATE; |