Lines Matching refs:div

35 	u8 div;  in sun4i_get_pll1_factors()  local
38 div = req->rate / 6000000; in sun4i_get_pll1_factors()
39 req->rate = 6000000 * div; in sun4i_get_pll1_factors()
52 if (div < 10) in sun4i_get_pll1_factors()
56 else if (div < 20 || (div < 32 && (div & 1))) in sun4i_get_pll1_factors()
61 else if (div < 40 || (div < 64 && (div & 2))) in sun4i_get_pll1_factors()
69 div <<= req->p; in sun4i_get_pll1_factors()
70 div /= (req->k + 1); in sun4i_get_pll1_factors()
71 req->n = div / 4; in sun4i_get_pll1_factors()
159 u8 div; in sun8i_a23_get_pll1_factors() local
162 div = req->rate / 6000000; in sun8i_a23_get_pll1_factors()
163 req->rate = 6000000 * div; in sun8i_a23_get_pll1_factors()
176 if (div < 20 || (div < 32 && (div & 1))) in sun8i_a23_get_pll1_factors()
181 else if (div < 40 || (div < 64 && (div & 2))) in sun8i_a23_get_pll1_factors()
189 div <<= req->p; in sun8i_a23_get_pll1_factors()
190 div /= (req->k + 1); in sun8i_a23_get_pll1_factors()
191 req->n = div / 4 - 1; in sun8i_a23_get_pll1_factors()
203 u8 div; in sun4i_get_pll5_factors() local
206 div = req->rate / req->parent_rate; in sun4i_get_pll5_factors()
207 req->rate = req->parent_rate * div; in sun4i_get_pll5_factors()
209 if (div < 31) in sun4i_get_pll5_factors()
211 else if (div / 2 < 31) in sun4i_get_pll5_factors()
213 else if (div / 3 < 31) in sun4i_get_pll5_factors()
218 req->n = DIV_ROUND_UP(div, (req->k + 1)); in sun4i_get_pll5_factors()
230 u8 div; in sun6i_a31_get_pll6_factors() local
233 div = req->rate / req->parent_rate; in sun6i_a31_get_pll6_factors()
234 req->rate = req->parent_rate * div; in sun6i_a31_get_pll6_factors()
236 req->k = div / 32; in sun6i_a31_get_pll6_factors()
240 req->n = DIV_ROUND_UP(div, (req->k + 1)) - 1; in sun6i_a31_get_pll6_factors()
251 u32 div; in sun5i_a13_get_ahb_factors() local
266 div = order_base_2(DIV_ROUND_UP(req->parent_rate, req->rate)); in sun5i_a13_get_ahb_factors()
269 if (div > 3) in sun5i_a13_get_ahb_factors()
270 div = 3; in sun5i_a13_get_ahb_factors()
272 req->rate = req->parent_rate >> div; in sun5i_a13_get_ahb_factors()
274 req->p = div; in sun5i_a13_get_ahb_factors()
290 u8 div, calcp, calcm = 1; in sun6i_get_ahb1_factors() local
299 div = DIV_ROUND_UP(req->parent_rate, req->rate); in sun6i_get_ahb1_factors()
303 if (div < 4) in sun6i_get_ahb1_factors()
305 else if (div / 2 < 4) in sun6i_get_ahb1_factors()
307 else if (div / 4 < 4) in sun6i_get_ahb1_factors()
312 calcm = DIV_ROUND_UP(div, 1 << calcp); in sun6i_get_ahb1_factors()
314 calcp = __roundup_pow_of_two(div); in sun6i_get_ahb1_factors()
348 int div; in sun4i_get_apb1_factors() local
353 div = DIV_ROUND_UP(req->parent_rate, req->rate); in sun4i_get_apb1_factors()
356 if (div > 32) in sun4i_get_apb1_factors()
359 if (div <= 4) in sun4i_get_apb1_factors()
361 else if (div <= 8) in sun4i_get_apb1_factors()
363 else if (div <= 16) in sun4i_get_apb1_factors()
368 calcm = (div >> calcp) - 1; in sun4i_get_apb1_factors()
386 u8 div, calcm, calcp; in sun7i_a20_get_out_factors() local
393 div = DIV_ROUND_UP(req->parent_rate, req->rate); in sun7i_a20_get_out_factors()
395 if (div < 32) in sun7i_a20_get_out_factors()
397 else if (div / 2 < 32) in sun7i_a20_get_out_factors()
399 else if (div / 4 < 32) in sun7i_a20_get_out_factors()
404 calcm = DIV_ROUND_UP(div, 1 << calcp); in sun7i_a20_get_out_factors()
738 { .val = 0, .div = 1 },
739 { .val = 1, .div = 2 },
740 { .val = 2, .div = 3 },
741 { .val = 3, .div = 4 },
742 { .val = 4, .div = 4 },
743 { .val = 5, .div = 4 },
744 { .val = 6, .div = 4 },
745 { .val = 7, .div = 4 },
761 { .val = 0, .div = 2 },
762 { .val = 1, .div = 2 },
763 { .val = 2, .div = 4 },
764 { .val = 3, .div = 8 },
890 } div[SUNXI_DIVS_MAX_QTY]; member
894 { .val = 0, .div = 6, },
895 { .val = 1, .div = 12, },
896 { .val = 2, .div = 18, },
897 { .val = 3, .div = 24, },
904 .div = {
915 .div = {
926 .div = {
967 if (data->div[i].self) { in sunxi_divs_clk_setup()
1025 if (data->div[i].self) { in sunxi_divs_clk_setup()
1035 if (data->div[i].gate) { in sunxi_divs_clk_setup()
1041 gate->bit_idx = data->div[i].gate; in sunxi_divs_clk_setup()
1048 if (data->div[i].fixed) { in sunxi_divs_clk_setup()
1054 fix_factor->div = data->div[i].fixed; in sunxi_divs_clk_setup()
1063 flags = data->div[i].pow ? CLK_DIVIDER_POWER_OF_TWO : 0; in sunxi_divs_clk_setup()
1066 divider->shift = data->div[i].shift; in sunxi_divs_clk_setup()
1070 divider->table = data->div[i].table; in sunxi_divs_clk_setup()
1083 (data->div[i].critical ? in sunxi_divs_clk_setup()