Loading drivers/clk/ti/clk-dra7-atl.c +5 −1 Original line number Diff line number Diff line Loading @@ -139,9 +139,13 @@ static long atl_clk_round_rate(struct clk_hw *hw, unsigned long rate, static int atl_clk_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { struct dra7_atl_desc *cdesc = to_atl_desc(hw); struct dra7_atl_desc *cdesc; u32 divider; if (!hw || !rate) return -EINVAL; cdesc = to_atl_desc(hw); divider = ((parent_rate + rate / 2) / rate) - 1; if (divider > DRA7_ATL_DIVIDER_MASK) divider = DRA7_ATL_DIVIDER_MASK; Loading drivers/clk/ti/divider.c +6 −1 Original line number Diff line number Diff line Loading @@ -211,11 +211,16 @@ static long ti_clk_divider_round_rate(struct clk_hw *hw, unsigned long rate, static int ti_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { struct clk_divider *divider = to_clk_divider(hw); struct clk_divider *divider; unsigned int div, value; unsigned long flags = 0; u32 val; if (!hw || !rate) return -EINVAL; divider = to_clk_divider(hw); div = DIV_ROUND_UP(parent_rate, rate); value = _get_val(divider, div); Loading Loading
drivers/clk/ti/clk-dra7-atl.c +5 −1 Original line number Diff line number Diff line Loading @@ -139,9 +139,13 @@ static long atl_clk_round_rate(struct clk_hw *hw, unsigned long rate, static int atl_clk_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { struct dra7_atl_desc *cdesc = to_atl_desc(hw); struct dra7_atl_desc *cdesc; u32 divider; if (!hw || !rate) return -EINVAL; cdesc = to_atl_desc(hw); divider = ((parent_rate + rate / 2) / rate) - 1; if (divider > DRA7_ATL_DIVIDER_MASK) divider = DRA7_ATL_DIVIDER_MASK; Loading
drivers/clk/ti/divider.c +6 −1 Original line number Diff line number Diff line Loading @@ -211,11 +211,16 @@ static long ti_clk_divider_round_rate(struct clk_hw *hw, unsigned long rate, static int ti_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { struct clk_divider *divider = to_clk_divider(hw); struct clk_divider *divider; unsigned int div, value; unsigned long flags = 0; u32 val; if (!hw || !rate) return -EINVAL; divider = to_clk_divider(hw); div = DIV_ROUND_UP(parent_rate, rate); value = _get_val(divider, div); Loading