@@ -40,6 +40,7 @@ static struct clk *rockchip_clk_register_branch(const char *name,
40
40
const char * const * parent_names , u8 num_parents ,
41
41
void __iomem * base ,
42
42
int muxdiv_offset , u8 mux_shift , u8 mux_width , u8 mux_flags ,
43
+ u32 * mux_table ,
43
44
int div_offset , u8 div_shift , u8 div_width , u8 div_flags ,
44
45
struct clk_div_table * div_table , int gate_offset ,
45
46
u8 gate_shift , u8 gate_flags , unsigned long flags ,
@@ -62,6 +63,7 @@ static struct clk *rockchip_clk_register_branch(const char *name,
62
63
mux -> shift = mux_shift ;
63
64
mux -> mask = BIT (mux_width ) - 1 ;
64
65
mux -> flags = mux_flags ;
66
+ mux -> table = mux_table ;
65
67
mux -> lock = lock ;
66
68
mux_ops = (mux_flags & CLK_MUX_READ_ONLY ) ? & clk_mux_ro_ops
67
69
: & clk_mux_ops ;
@@ -270,6 +272,8 @@ static struct clk *rockchip_clk_register_frac_branch(
270
272
frac_mux -> shift = child -> mux_shift ;
271
273
frac_mux -> mask = BIT (child -> mux_width ) - 1 ;
272
274
frac_mux -> flags = child -> mux_flags ;
275
+ if (child -> mux_table )
276
+ frac_mux -> table = child -> mux_table ;
273
277
frac_mux -> lock = lock ;
274
278
frac_mux -> hw .init = & init ;
275
279
@@ -444,11 +448,21 @@ void rockchip_clk_register_branches(struct rockchip_clk_provider *ctx,
444
448
/* catch simple muxes */
445
449
switch (list -> branch_type ) {
446
450
case branch_mux :
447
- clk = clk_register_mux (NULL , list -> name ,
448
- list -> parent_names , list -> num_parents ,
449
- flags , ctx -> reg_base + list -> muxdiv_offset ,
450
- list -> mux_shift , list -> mux_width ,
451
- list -> mux_flags , & ctx -> lock );
451
+ if (list -> mux_table )
452
+ clk = clk_register_mux_table (NULL , list -> name ,
453
+ list -> parent_names , list -> num_parents ,
454
+ flags ,
455
+ ctx -> reg_base + list -> muxdiv_offset ,
456
+ list -> mux_shift , list -> mux_width ,
457
+ list -> mux_flags , list -> mux_table ,
458
+ & ctx -> lock );
459
+ else
460
+ clk = clk_register_mux (NULL , list -> name ,
461
+ list -> parent_names , list -> num_parents ,
462
+ flags ,
463
+ ctx -> reg_base + list -> muxdiv_offset ,
464
+ list -> mux_shift , list -> mux_width ,
465
+ list -> mux_flags , & ctx -> lock );
452
466
break ;
453
467
case branch_muxgrf :
454
468
clk = rockchip_clk_register_muxgrf (list -> name ,
@@ -506,7 +520,8 @@ void rockchip_clk_register_branches(struct rockchip_clk_provider *ctx,
506
520
ctx -> reg_base , list -> muxdiv_offset ,
507
521
list -> mux_shift ,
508
522
list -> mux_width , list -> mux_flags ,
509
- list -> div_offset , list -> div_shift , list -> div_width ,
523
+ list -> mux_table , list -> div_offset ,
524
+ list -> div_shift , list -> div_width ,
510
525
list -> div_flags , list -> div_table ,
511
526
list -> gate_offset , list -> gate_shift ,
512
527
list -> gate_flags , flags , & ctx -> lock );
0 commit comments