clk: rockchip: add flag CLK_FRAC_DIVIDER_NO_LIMIT for fractional divider

There are some clks(uart) that do not have to comply with the 20 times
fractional divider limit.

Change-Id: I420d8ba3b5de65d9e0ea74920d5ea8450ae94465
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
This commit is contained in:
Elaine Zhang
2021-02-22 10:20:34 +08:00
committed by Tao Huang
parent a5bc56f4b7
commit e5cbf33404
2 changed files with 13 additions and 5 deletions

View File

@@ -222,12 +222,14 @@ static void rockchip_fractional_approximation(struct clk_hw *hw,
*m = 1;
*n = *parent_rate / rate;
return;
} else if (!(fd->flags & CLK_FRAC_DIVIDER_NO_LIMIT)) {
pr_warn("%s p_rate(%ld) is low than rate(%ld)*20, use integer or half-div\n",
clk_hw_get_name(hw),
*parent_rate, rate);
*m = 0;
*n = 1;
return;
}
pr_warn("%s p_rate(%ld) is low than rate(%ld)*20, use integer or half-div\n",
clk_hw_get_name(hw), *parent_rate, rate);
*m = 0;
*n = 1;
return;
}
}

View File

@@ -695,6 +695,10 @@ void clk_hw_unregister_fixed_factor(struct clk_hw *hw);
* @lock: register lock
*
* Clock with adjustable fractional divider affecting its output frequency.
*
* Flags:
* CLK_FRAC_DIVIDER_NO_LIMIT - not need to follow the 20 times limit on
* fractional divider
*/
struct clk_fractional_divider {
struct clk_hw hw;
@@ -715,6 +719,8 @@ struct clk_fractional_divider {
#define to_clk_fd(_hw) container_of(_hw, struct clk_fractional_divider, hw)
#define CLK_FRAC_DIVIDER_NO_LIMIT BIT(2)
extern const struct clk_ops clk_fractional_divider_ops;
struct clk *clk_register_fractional_divider(struct device *dev,
const char *name, const char *parent_name, unsigned long flags,