Lines Matching +full:semi +full:- +full:static

1 // SPDX-License-Identifier: GPL-2.0+
5 // Copyright (c) 2014 Actions Semi Inc.
6 // Author: David Liu <liuwei@actions-semi.com>
11 #include <linux/clk-provider.h>
14 #include "owl-divider.h"
21 return divider_round_rate(&common->hw, rate, parent_rate, in owl_divider_helper_round_rate()
22 div_hw->table, div_hw->width, in owl_divider_helper_round_rate()
23 div_hw->div_flags); in owl_divider_helper_round_rate()
26 static long owl_divider_round_rate(struct clk_hw *hw, unsigned long rate, in owl_divider_round_rate()
31 return owl_divider_helper_round_rate(&div->common, &div->div_hw, in owl_divider_round_rate()
42 regmap_read(common->regmap, div_hw->reg, &reg); in owl_divider_helper_recalc_rate()
43 val = reg >> div_hw->shift; in owl_divider_helper_recalc_rate()
44 val &= (1 << div_hw->width) - 1; in owl_divider_helper_recalc_rate()
46 return divider_recalc_rate(&common->hw, parent_rate, in owl_divider_helper_recalc_rate()
47 val, div_hw->table, in owl_divider_helper_recalc_rate()
48 div_hw->div_flags, in owl_divider_helper_recalc_rate()
49 div_hw->width); in owl_divider_helper_recalc_rate()
52 static unsigned long owl_divider_recalc_rate(struct clk_hw *hw, in owl_divider_recalc_rate()
57 return owl_divider_helper_recalc_rate(&div->common, in owl_divider_recalc_rate()
58 &div->div_hw, parent_rate); in owl_divider_recalc_rate()
69 val = divider_get_val(rate, parent_rate, div_hw->table, in owl_divider_helper_set_rate()
70 div_hw->width, 0); in owl_divider_helper_set_rate()
72 regmap_read(common->regmap, div_hw->reg, &reg); in owl_divider_helper_set_rate()
73 reg &= ~GENMASK(div_hw->width + div_hw->shift - 1, div_hw->shift); in owl_divider_helper_set_rate()
75 regmap_write(common->regmap, div_hw->reg, in owl_divider_helper_set_rate()
76 reg | (val << div_hw->shift)); in owl_divider_helper_set_rate()
81 static int owl_divider_set_rate(struct clk_hw *hw, unsigned long rate, in owl_divider_set_rate()
86 return owl_divider_helper_set_rate(&div->common, &div->div_hw, in owl_divider_set_rate()