Home
last modified time | relevance | path

Searched refs:div (Results 1 – 25 of 149) sorted by relevance

123456

/drivers/clk/
Dclk-divider.c38 unsigned int div; in clk_divider_recalc_rate() local
40 div = readl(divider->reg) >> divider->shift; in clk_divider_recalc_rate()
41 div &= div_mask(divider); in clk_divider_recalc_rate()
44 div++; in clk_divider_recalc_rate()
46 return parent_rate / div; in clk_divider_recalc_rate()
109 int div; in clk_divider_round_rate() local
110 div = clk_divider_bestdiv(hw, rate, prate); in clk_divider_round_rate()
113 return *prate / div; in clk_divider_round_rate()
117 return r / div; in clk_divider_round_rate()
125 unsigned int div; in clk_divider_set_rate() local
[all …]
/drivers/media/video/
Daptina-pll.c38 unsigned int div; in aptina_pll_calculate() local
55 div = gcd(pll->pix_clock, pll->ext_clock); in aptina_pll_calculate()
56 pll->m = pll->pix_clock / div; in aptina_pll_calculate()
57 div = pll->ext_clock / div; in aptina_pll_calculate()
72 mf_min = max(mf_min, limits->n_min * limits->p1_min / div); in aptina_pll_calculate()
76 mf_max = min(mf_max, DIV_ROUND_UP(limits->n_max * limits->p1_max, div)); in aptina_pll_calculate()
141 p1_min = max(limits->p1_min, DIV_ROUND_UP(limits->out_clock_min * div, in aptina_pll_calculate()
143 p1_max = min(limits->p1_max, limits->out_clock_max * div / in aptina_pll_calculate()
147 unsigned int mf_inc = p1 / gcd(div, p1); in aptina_pll_calculate()
153 limits->int_clock_max * div)); in aptina_pll_calculate()
[all …]
/drivers/media/common/tuners/
Dtea5767.c136 unsigned int div, frq; in tea5767_status_dump() local
148 div = ((buffer[0] & 0x3f) << 8) | buffer[1]; in tea5767_status_dump()
152 frq = (div * 50000 - 700000 - 225000) / 4; /* Freq in KHz */ in tea5767_status_dump()
155 frq = (div * 50000 + 700000 + 225000) / 4; /* Freq in KHz */ in tea5767_status_dump()
158 frq = (div * 32768 + 700000 + 225000) / 4; /* Freq in KHz */ in tea5767_status_dump()
162 frq = (div * 32768 - 700000 - 225000) / 4; /* Freq in KHz */ in tea5767_status_dump()
165 buffer[0] = (div >> 8) & 0x3f; in tea5767_status_dump()
166 buffer[1] = div & 0xff; in tea5767_status_dump()
169 frq / 1000, frq % 1000, div); in tea5767_status_dump()
194 unsigned div; in set_radio_freq() local
[all …]
Dtuner-simple.c440 u16 div, u8 config, u8 cb) in simple_post_tune() argument
476 buffer[0] = (div>>8) & 0x7f; in simple_post_tune()
477 buffer[1] = div & 0xff; in simple_post_tune()
548 u16 div; in simple_set_tv_freq() local
586 div = params->frequency + IFPCoff + offset; in simple_set_tv_freq()
592 offset / 16, offset % 16 * 100 / 16, div); in simple_set_tv_freq()
597 if (t_params->cb_first_if_lower_freq && div < priv->last_div) { in simple_set_tv_freq()
600 buffer[2] = (div>>8) & 0x7f; in simple_set_tv_freq()
601 buffer[3] = div & 0xff; in simple_set_tv_freq()
603 buffer[0] = (div>>8) & 0x7f; in simple_set_tv_freq()
[all …]
Dtea5761.c128 unsigned int div, frq; in tea5761_status_dump() local
130 div = ((buffer[2] & 0x3f) << 8) | buffer[3]; in tea5761_status_dump()
132 frq = 1000 * (div * 32768 / 1000 + FREQ_OFFSET + 225) / 4; /* Freq in KHz */ in tea5761_status_dump()
135 frq / 1000, frq % 1000, div); in tea5761_status_dump()
146 unsigned div; in __set_radio_freq() local
166 div = (1000 * (frq * 4 / 16 + 700 + 225) ) >> 15; in __set_radio_freq()
167 buffer[1] = (div >> 8) & 0x3f; in __set_radio_freq()
168 buffer[2] = div & 0xff; in __set_radio_freq()
/drivers/mmc/host/
Dsdhci-cns3xxx.c30 int div = 1; in sdhci_cns3xxx_set_clock() local
42 while (host->max_clk / div > clock) { in sdhci_cns3xxx_set_clock()
47 if (div < 4) in sdhci_cns3xxx_set_clock()
48 div += 1; in sdhci_cns3xxx_set_clock()
49 else if (div < 256) in sdhci_cns3xxx_set_clock()
50 div *= 2; in sdhci_cns3xxx_set_clock()
56 clock, host->max_clk / div); in sdhci_cns3xxx_set_clock()
59 if (div != 3) in sdhci_cns3xxx_set_clock()
60 div >>= 1; in sdhci_cns3xxx_set_clock()
62 clk = div << SDHCI_DIVIDER_SHIFT; in sdhci_cns3xxx_set_clock()
Dsdhci-esdhc.h48 int div = 1; in esdhc_set_clock() local
62 while (host->max_clk / pre_div / div > clock && div < 16) in esdhc_set_clock()
63 div++; in esdhc_set_clock()
66 clock, host->max_clk / pre_div / div); in esdhc_set_clock()
69 div--; in esdhc_set_clock()
73 | (div << ESDHC_DIVIDER_SHIFT) in esdhc_set_clock()
/drivers/gpu/drm/nouveau/
Dnouveau_backlight.c103 u32 div = 1025; in nv50_get_intensity() local
108 return ((val * 100) + (div / 2)) / div; in nv50_get_intensity()
117 u32 div = 1025; in nv50_set_intensity() local
118 u32 val = (bd->props.brightness * div) / 100; in nv50_set_intensity()
137 u32 div, val; in nva3_get_intensity() local
139 div = nv_rd32(dev, NV50_PDISP_SOR_PWM_DIV(or)); in nva3_get_intensity()
142 if (div && div >= val) in nva3_get_intensity()
143 return ((val * 100) + (div / 2)) / div; in nva3_get_intensity()
154 u32 div, val; in nva3_set_intensity() local
156 div = nv_rd32(dev, NV50_PDISP_SOR_PWM_DIV(or)); in nva3_set_intensity()
[all …]
/drivers/video/omap2/dss/
Drfbi.c378 static inline unsigned long round_to_extif_ticks(unsigned long ps, int div) in round_to_extif_ticks() argument
380 int bus_tick = extif_clk_period * div; in round_to_extif_ticks()
384 static int calc_reg_timing(struct rfbi_timings *t, int div) in calc_reg_timing() argument
386 t->clk_div = div; in calc_reg_timing()
388 t->cs_on_time = round_to_extif_ticks(t->cs_on_time, div); in calc_reg_timing()
390 t->we_on_time = round_to_extif_ticks(t->we_on_time, div); in calc_reg_timing()
391 t->we_off_time = round_to_extif_ticks(t->we_off_time, div); in calc_reg_timing()
392 t->we_cycle_time = round_to_extif_ticks(t->we_cycle_time, div); in calc_reg_timing()
394 t->re_on_time = round_to_extif_ticks(t->re_on_time, div); in calc_reg_timing()
395 t->re_off_time = round_to_extif_ticks(t->re_off_time, div); in calc_reg_timing()
[all …]
/drivers/video/omap/
Dsossi.c125 static u32 ps_to_sossi_ticks(u32 ps, int div) in ps_to_sossi_ticks() argument
127 u32 clk_period = HZ_TO_PS(sossi.fck_hz) * div; in ps_to_sossi_ticks()
135 int div = t->clk_div; in calc_rd_timings() local
141 reon = ps_to_sossi_ticks(t->re_on_time, div); in calc_rd_timings()
146 reoff = ps_to_sossi_ticks(t->re_off_time, div); in calc_rd_timings()
155 recyc = ps_to_sossi_ticks(t->re_cycle_time, div); in calc_rd_timings()
166 actim = ps_to_sossi_ticks(t->access_time, div); in calc_rd_timings()
186 int div = t->clk_div; in calc_wr_timings() local
192 weon = ps_to_sossi_ticks(t->we_on_time, div); in calc_wr_timings()
197 weoff = ps_to_sossi_ticks(t->we_off_time, div); in calc_wr_timings()
[all …]
Dhwa742.c630 static unsigned long round_to_extif_ticks(unsigned long ps, int div) in round_to_extif_ticks() argument
632 int bus_tick = hwa742.extif_clk_period * div; in round_to_extif_ticks()
636 static int calc_reg_timing(unsigned long sysclk, int div) in calc_reg_timing() argument
651 "extif_clk_div %d\n", systim, hwa742.extif_clk_period, div); in calc_reg_timing()
655 t->clk_div = div; in calc_reg_timing()
657 t->we_on_time = round_to_extif_ticks(t->cs_on_time + 2000, div); in calc_reg_timing()
658 t->re_on_time = round_to_extif_ticks(t->cs_on_time + 2000, div); in calc_reg_timing()
659 t->access_time = round_to_extif_ticks(t->re_on_time + 12200, div); in calc_reg_timing()
660 t->we_off_time = round_to_extif_ticks(t->we_on_time + 1000, div); in calc_reg_timing()
661 t->re_off_time = round_to_extif_ticks(t->re_on_time + 16000, div); in calc_reg_timing()
[all …]
/drivers/usb/host/
Docteon2-common.c22 u64 div; in octeon2_usb_clocks_start() local
75 div = octeon_get_io_clock_rate() / 130000000ull; in octeon2_usb_clocks_start()
77 switch (div) { in octeon2_usb_clocks_start()
79 div = 1; in octeon2_usb_clocks_start()
87 div = 4; in octeon2_usb_clocks_start()
91 div = 6; in octeon2_usb_clocks_start()
97 div = 8; in octeon2_usb_clocks_start()
100 div = 12; in octeon2_usb_clocks_start()
103 clk_rst_ctl.s.h_div = div; in octeon2_usb_clocks_start()
/drivers/media/dvb/ttpci/
Dbudget.c210 u32 div = (c->frequency + 479500) / 125; in alps_bsrv2_tuner_set_params() local
224 buf[0] = (div >> 8) & 0x7f; in alps_bsrv2_tuner_set_params()
225 buf[1] = div & 0xff; in alps_bsrv2_tuner_set_params()
226 buf[2] = ((div & 0x18000) >> 10) | 0x95; in alps_bsrv2_tuner_set_params()
249 u32 div; in alps_tdbe2_tuner_set_params() local
253 div = (c->frequency + 35937500 + 31250) / 62500; in alps_tdbe2_tuner_set_params()
255 data[0] = (div >> 8) & 0x7f; in alps_tdbe2_tuner_set_params()
256 data[1] = div & 0xff; in alps_tdbe2_tuner_set_params()
257 data[2] = 0x85 | ((div >> 10) & 0x60); in alps_tdbe2_tuner_set_params()
278 u32 div; in grundig_29504_401_tuner_set_params() local
[all …]
/drivers/mfd/
Ddb8500-prcmu.c708 int prcmu_config_clkout(u8 clkout, u8 source, u8 div) in prcmu_config_clkout() argument
719 BUG_ON(div > 63); in prcmu_config_clkout()
722 if (!div && !requests[clkout]) in prcmu_config_clkout()
730 (div << PRCM_CLKOCR_CLKODIV0_SHIFT)); in prcmu_config_clkout()
737 (div << PRCM_CLKOCR_CLKODIV1_SHIFT)); in prcmu_config_clkout()
746 if (div) { in prcmu_config_clkout()
759 requests[clkout] += (div ? 1 : -1); in prcmu_config_clkout()
1076 u32 div; in request_even_slower_clocks() local
1079 div = (val & PRCM_CLK_MGT_CLKPLLDIV_MASK); in request_even_slower_clocks()
1081 if ((div <= 1) || (div > 15)) { in request_even_slower_clocks()
[all …]
/drivers/cpufreq/
Dcpufreq-nforce2.c23 #define NFORCE2_PLL(mul, div) (0x100000 | (mul << 8) | div) argument
69 unsigned char mul, div; in nforce2_calc_fsb() local
72 div = pll & 0xff; in nforce2_calc_fsb()
74 if (div > 0) in nforce2_calc_fsb()
75 return NFORCE2_XTAL * mul / div; in nforce2_calc_fsb()
89 unsigned char mul = 0, div = 0; in nforce2_calc_pll() local
93 while (((mul == 0) || (div == 0)) && (tried <= 3)) { in nforce2_calc_pll()
99 div = xdiv; in nforce2_calc_pll()
104 if ((mul == 0) || (div == 0)) in nforce2_calc_pll()
107 return NFORCE2_PLL(mul, div); in nforce2_calc_pll()
/drivers/media/dvb/bt8xx/
Ddvb-bt8xx.c156 u32 div; in thomson_dtt7579_tuner_calc_regs() local
163 div = (((c->frequency + 83333) * 3) / 500000) + IF_FREQUENCYx6; in thomson_dtt7579_tuner_calc_regs()
180 pllbuf[1] = div >> 8; in thomson_dtt7579_tuner_calc_regs()
181 pllbuf[2] = div & 0xff; in thomson_dtt7579_tuner_calc_regs()
278 u32 div; in microtune_mt7202dtf_tuner_set_params() local
281 div = (36000000 + c->frequency + 83333) / 166666; in microtune_mt7202dtf_tuner_set_params()
302 data[0] = (div >> 8) & 0x7f; in microtune_mt7202dtf_tuner_set_params()
303 data[1] = div & 0xff; in microtune_mt7202dtf_tuner_set_params()
304 data[2] = ((div >> 10) & 0x60) | cfg; in microtune_mt7202dtf_tuner_set_params()
310 return (div * 166666 - 36000000); in microtune_mt7202dtf_tuner_set_params()
[all …]
/drivers/media/dvb/frontends/
Dbsbe1.h77 u32 div; in alps_bsbe1_tuner_set_params() local
84 div = p->frequency / 1000; in alps_bsbe1_tuner_set_params()
85 data[0] = (div >> 8) & 0x7f; in alps_bsbe1_tuner_set_params()
86 data[1] = div & 0xff; in alps_bsbe1_tuner_set_params()
87 data[2] = 0x80 | ((div & 0x18000) >> 10) | 0x1; in alps_bsbe1_tuner_set_params()
Dbsru6.h108 u32 div; in alps_bsru6_tuner_set_params() local
115 div = (p->frequency + (125 - 1)) / 125; /* round correctly */ in alps_bsru6_tuner_set_params()
116 buf[0] = (div >> 8) & 0x7f; in alps_bsru6_tuner_set_params()
117 buf[1] = div & 0xff; in alps_bsru6_tuner_set_params()
118 buf[2] = 0x80 | ((div & 0x18000) >> 10) | 4; in alps_bsru6_tuner_set_params()
Dtua6100.c74 u32 div; in tua6100_set_params() local
119 div = prediv / _P; in tua6100_set_params()
120 reg1[1] |= (div >> 9) & 0x03; in tua6100_set_params()
121 reg1[2] = div >> 1; in tua6100_set_params()
122 reg1[3] = (div << 7); in tua6100_set_params()
123 priv->frequency = ((div * _P) * (_ri / 1000)) / _R; in tua6100_set_params()
126 reg1[3] |= (prediv - (div*_P)) & 0x7f; in tua6100_set_params()
Dtdhd1.h49 u32 div; in alps_tdhd1_204a_tuner_set_params() local
51 div = (p->frequency + 36166666) / 166666; in alps_tdhd1_204a_tuner_set_params()
53 data[0] = (div >> 8) & 0x7f; in alps_tdhd1_204a_tuner_set_params()
54 data[1] = div & 0xff; in alps_tdhd1_204a_tuner_set_params()
Dtda826x.c79 u32 div; in tda826x_set_params() local
87 div = (p->frequency + (1000-1)) / 1000; in tda826x_set_params()
103 buf[3] = div >> 7; in tda826x_set_params()
104 buf[4] = div << 1; in tda826x_set_params()
120 priv->frequency = div * 1000; in tda826x_set_params()
/drivers/staging/rts5139/
Drts51x_card.c394 u8 mcu_cnt, div, max_div, ssc_depth; in switch_ssc_clock() local
414 div = CLK_DIV_1; in switch_ssc_clock()
415 while ((N < min_N) && (div < max_div)) { in switch_ssc_clock()
417 div++; in switch_ssc_clock()
419 RTS51X_DEBUGP("N = %d, div = %d\n", N, div); in switch_ssc_clock()
472 if (div == CLK_DIV_2) { in switch_ssc_clock()
479 } else if (div == CLK_DIV_4) { in switch_ssc_clock()
498 (div << 4) | mcu_cnt); in switch_ssc_clock()
528 u8 sel, div, mcu_cnt; in switch_normal_clock() local
544 div = CLK_DIV_4; in switch_normal_clock()
[all …]
/drivers/i2c/busses/
Di2c-mpc.c199 const struct mpc_i2c_divider *div = NULL; in mpc_i2c_get_fdr_52xx() local
218 div = &mpc_i2c_dividers_52xx[i]; in mpc_i2c_get_fdr_52xx()
220 if (div->fdr & 0xc0 && pvr == 0x80822011) in mpc_i2c_get_fdr_52xx()
222 if (div->divider >= divider) in mpc_i2c_get_fdr_52xx()
226 *real_clk = mpc5xxx_get_bus_frequency(node) / div->divider; in mpc_i2c_get_fdr_52xx()
227 return (int)div->fdr; in mpc_i2c_get_fdr_52xx()
348 const struct mpc_i2c_divider *div = NULL; in mpc_i2c_get_fdr_8xxx() local
374 div = &mpc_i2c_dividers_8xxx[i]; in mpc_i2c_get_fdr_8xxx()
375 if (div->divider >= divider) in mpc_i2c_get_fdr_8xxx()
379 *real_clk = fsl_get_sys_freq() / prescaler / div->divider; in mpc_i2c_get_fdr_8xxx()
[all …]
/drivers/staging/rts_pstor/
Drtsx_card.c656 u8 mcu_cnt, div, max_div, ssc_depth, ssc_depth_mask; in switch_ssc_clock() local
693 div = CLK_DIV_1; in switch_ssc_clock()
694 while ((N < min_N) && (div < max_div)) { in switch_ssc_clock()
696 div++; in switch_ssc_clock()
698 RTSX_DEBUGP("N = %d, div = %d\n", N, div); in switch_ssc_clock()
735 if (div == CLK_DIV_2) { in switch_ssc_clock()
741 } else if (div == CLK_DIV_4) { in switch_ssc_clock()
747 } else if (div == CLK_DIV_8) { in switch_ssc_clock()
773 rtsx_add_cmd(chip, WRITE_REG_CMD, CLK_DIV, 0xFF, (div << 4) | mcu_cnt); in switch_ssc_clock()
798 u8 sel, div, mcu_cnt; in switch_normal_clock() local
[all …]
/drivers/sh/clk/
Dcore.c45 unsigned long mult, div; in clk_rate_table_build() local
52 div = 1; in clk_rate_table_build()
56 div = src_table->divisors[i]; in clk_rate_table_build()
61 if (!div || !mult || (bitmap && !test_bit(i, bitmap))) in clk_rate_table_build()
64 freq = clk->parent->rate * mult / div; in clk_rate_table_build()
569 unsigned long error = ULONG_MAX, freq_high, freq_low, div; in clk_round_parent() local
623 div = freq->frequency / target; in clk_round_parent()
624 freq_high = freq->frequency / div; in clk_round_parent()
625 freq_low = freq->frequency / (div + 1); in clk_round_parent()
642 freq->frequency, div, freq_high, div + 1, freq_low, in clk_round_parent()

123456