Lines Matching refs:div

22 	struct iproc_asiu_div div;  member
82 val = readl(asiu->div_base + clk->div.offset); in iproc_asiu_clk_recalc_rate()
83 if ((val & (1 << clk->div.en_shift)) == 0) { in iproc_asiu_clk_recalc_rate()
89 div_h = (val >> clk->div.high_shift) & bit_mask(clk->div.high_width); in iproc_asiu_clk_recalc_rate()
91 div_l = (val >> clk->div.low_shift) & bit_mask(clk->div.low_width); in iproc_asiu_clk_recalc_rate()
104 unsigned int div; in iproc_asiu_clk_round_rate() local
112 div = DIV_ROUND_CLOSEST(*parent_rate, rate); in iproc_asiu_clk_round_rate()
113 if (div < 2) in iproc_asiu_clk_round_rate()
116 return *parent_rate / div; in iproc_asiu_clk_round_rate()
124 unsigned int div, div_h, div_l; in iproc_asiu_clk_set_rate() local
132 val = readl(asiu->div_base + clk->div.offset); in iproc_asiu_clk_set_rate()
133 val &= ~(1 << clk->div.en_shift); in iproc_asiu_clk_set_rate()
134 writel(val, asiu->div_base + clk->div.offset); in iproc_asiu_clk_set_rate()
138 div = DIV_ROUND_CLOSEST(parent_rate, rate); in iproc_asiu_clk_set_rate()
139 if (div < 2) in iproc_asiu_clk_set_rate()
142 div_h = div_l = div >> 1; in iproc_asiu_clk_set_rate()
146 val = readl(asiu->div_base + clk->div.offset); in iproc_asiu_clk_set_rate()
147 val |= 1 << clk->div.en_shift; in iproc_asiu_clk_set_rate()
149 val &= ~(bit_mask(clk->div.high_width) in iproc_asiu_clk_set_rate()
150 << clk->div.high_shift); in iproc_asiu_clk_set_rate()
151 val |= div_h << clk->div.high_shift; in iproc_asiu_clk_set_rate()
153 val &= ~(bit_mask(clk->div.high_width) in iproc_asiu_clk_set_rate()
154 << clk->div.high_shift); in iproc_asiu_clk_set_rate()
157 val &= ~(bit_mask(clk->div.low_width) << clk->div.low_shift); in iproc_asiu_clk_set_rate()
158 val |= div_l << clk->div.low_shift; in iproc_asiu_clk_set_rate()
160 val &= ~(bit_mask(clk->div.low_width) << clk->div.low_shift); in iproc_asiu_clk_set_rate()
162 writel(val, asiu->div_base + clk->div.offset); in iproc_asiu_clk_set_rate()
176 const struct iproc_asiu_div *div, in iproc_asiu_setup() argument
183 if (WARN_ON(!gate || !div)) in iproc_asiu_setup()
222 asiu_clk->div = div[i]; in iproc_asiu_setup()