clk: sunxi-ng: mux: Increase fixed pre-divider div size
authorChen-Yu Tsai <wens@csie.org>
Tue, 26 Jul 2016 07:04:25 +0000 (15:04 +0800)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Mon, 8 Aug 2016 18:03:20 +0000 (20:03 +0200)
Some clocks have a predivider value that is larger than what u8 can
store. One such example is the OUT clk found on A20/A31, which has
a /750 pre-divider on one of the osc24M parents.

Increase the size of the div field to u16.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
drivers/clk/sunxi-ng/ccu_mux.c
drivers/clk/sunxi-ng/ccu_mux.h

index 58fc36e..1329b9a 100644 (file)
@@ -18,7 +18,7 @@ void ccu_mux_helper_adjust_parent_for_prediv(struct ccu_common *common,
                                             int parent_index,
                                             unsigned long *parent_rate)
 {
-       u8 prediv = 1;
+       u16 prediv = 1;
        u32 reg;
 
        if (!((common->features & CCU_FEATURE_FIXED_PREDIV) ||
index 9450826..d35ce5e 100644 (file)
@@ -11,7 +11,7 @@ struct ccu_mux_internal {
 
        struct {
                u8      index;
-               u     div;
+               u16     div;
        } fixed_prediv;
 
        struct {