Skip to content

Commit 2ce7e49

Browse files
Tejas Patelbebarino
authored andcommitted
clk: zynqmp: Update fraction clock check from custom type flags
Older firmware version sets BIT(13) in clkflag to mark a divider as fractional divider. Updated firmware version sets BIT(4) in type flags to mark a divider as fractional divider since BIT(13) is defined as CLK_DUTY_CYCLE_PARENT in the common clk framework flags. To support both old and new firmware version, consider BIT(13) from clkflag and BIT(4) from type_flag to check if divider is fractional or not. To maintain compatibility BIT(13) of clkflag in firmware will not be used in future for any purpose and will be marked as unused. Signed-off-by: Tejas Patel <[email protected]> Signed-off-by: Rajan Vaja <[email protected]> Signed-off-by: Jolly Shah <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent e605fa9 commit 2ce7e49

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/clk/zynqmp/divider.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
#define to_zynqmp_clk_divider(_hw) \
2626
container_of(_hw, struct zynqmp_clk_divider, hw)
2727

28-
#define CLK_FRAC BIT(13) /* has a fractional parent */
28+
#define CLK_FRAC BIT(13) /* has a fractional parent */
29+
#define CUSTOM_FLAG_CLK_FRAC BIT(0) /* has a fractional parent in custom type flag */
2930

3031
/**
3132
* struct zynqmp_clk_divider - adjustable divider clock
@@ -320,7 +321,8 @@ struct clk_hw *zynqmp_clk_register_divider(const char *name,
320321
init.num_parents = 1;
321322

322323
/* struct clk_divider assignments */
323-
div->is_frac = !!(nodes->flag & CLK_FRAC);
324+
div->is_frac = !!((nodes->flag & CLK_FRAC) |
325+
(nodes->custom_type_flag & CUSTOM_FLAG_CLK_FRAC));
324326
div->flags = nodes->type_flag;
325327
div->hw.init = &init;
326328
div->clk_id = clk_id;

0 commit comments

Comments
 (0)