clk: st: Use round to closest divider flag
[cascardo/linux.git] / drivers / clk / st / clkgen-mux.c
index a329906..79dc40b 100644 (file)
@@ -580,6 +580,11 @@ static struct clkgen_mux_data stih416_a9_mux_data = {
        .shift = 0,
        .width = 2,
 };
+static struct clkgen_mux_data stih407_a9_mux_data = {
+       .offset = 0x1a4,
+       .shift = 1,
+       .width = 2,
+};
 
 static struct of_device_id mux_of_match[] = {
        {
@@ -610,6 +615,10 @@ static struct of_device_id mux_of_match[] = {
                .compatible = "st,stih416-clkgen-a9-mux",
                .data = &stih416_a9_mux_data,
        },
+       {
+               .compatible = "st,stih407-clkgen-a9-mux",
+               .data = &stih407_a9_mux_data,
+       },
        {}
 };
 
@@ -765,7 +774,8 @@ void __init st_of_clkgen_vcc_setup(struct device_node *np)
                div->reg = reg + VCC_DIV_OFFSET;
                div->shift = 2 * i;
                div->width = 2;
-               div->flags = CLK_DIVIDER_POWER_OF_TWO;
+               div->flags = CLK_DIVIDER_POWER_OF_TWO |
+                       CLK_DIVIDER_ROUND_CLOSEST;
 
                mux->reg = reg + VCC_MUX_OFFSET;
                mux->shift = 2 * i;