Skip to content

Commit 0e40198

Browse files
MrVanShawn Guo
authored andcommitted
clk: imx: add imx8m_clk_hw_composite_bus
Introduce imx8m_clk_hw_composite_bus api for bus clk root slice usage. Because the mux switch sequence issue, we could not reuse Peripheral Clock Slice code, need use composite specific mux operation. Signed-off-by: Peng Fan <[email protected]> Reviewed-by: Dong Aisheng <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
1 parent f90b68d commit 0e40198

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

drivers/clk/imx/clk-composite-8m.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,11 @@ struct clk_hw *imx8m_clk_hw_composite_flags(const char *name,
205205
div->width = PCG_CORE_DIV_WIDTH;
206206
divider_ops = &clk_divider_ops;
207207
mux_ops = &imx8m_clk_composite_mux_ops;
208+
} else if (composite_flags & IMX_COMPOSITE_BUS) {
209+
div->shift = PCG_PREDIV_SHIFT;
210+
div->width = PCG_PREDIV_WIDTH;
211+
divider_ops = &imx8m_clk_composite_divider_ops;
212+
mux_ops = &imx8m_clk_composite_mux_ops;
208213
} else {
209214
div->shift = PCG_PREDIV_SHIFT;
210215
div->width = PCG_PREDIV_WIDTH;

drivers/clk/imx/clk.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ struct clk_hw *imx_clk_hw_cpu(const char *name, const char *parent_name,
527527
struct clk *step);
528528

529529
#define IMX_COMPOSITE_CORE BIT(0)
530+
#define IMX_COMPOSITE_BUS BIT(1)
530531

531532
struct clk_hw *imx8m_clk_hw_composite_flags(const char *name,
532533
const char * const *parent_names,
@@ -535,6 +536,12 @@ struct clk_hw *imx8m_clk_hw_composite_flags(const char *name,
535536
u32 composite_flags,
536537
unsigned long flags);
537538

539+
#define imx8m_clk_hw_composite_bus(name, parent_names, reg) \
540+
imx8m_clk_hw_composite_flags(name, parent_names, \
541+
ARRAY_SIZE(parent_names), reg, \
542+
IMX_COMPOSITE_BUS, \
543+
CLK_SET_RATE_NO_REPARENT | CLK_OPS_PARENT_ENABLE)
544+
538545
#define imx8m_clk_hw_composite_core(name, parent_names, reg) \
539546
imx8m_clk_hw_composite_flags(name, parent_names, \
540547
ARRAY_SIZE(parent_names), reg, \

0 commit comments

Comments
 (0)