Home
last modified time | relevance | path

Searched refs:prescale (Results 1 – 25 of 50) sorted by relevance

12

/drivers/iio/adc/
Dqcom-vadc-common.c282 const struct vadc_prescale_ratio *prescale,
286 const struct vadc_prescale_ratio *prescale,
290 const struct vadc_prescale_ratio *prescale,
294 const struct vadc_prescale_ratio *prescale,
298 const struct vadc_prescale_ratio *prescale,
302 const struct vadc_prescale_ratio *prescale,
306 const struct vadc_prescale_ratio *prescale,
384 const struct vadc_prescale_ratio *prescale, in qcom_vadc_scale_volt() argument
392 voltage = voltage * prescale->den; in qcom_vadc_scale_volt()
393 result = div64_s64(voltage, prescale->num); in qcom_vadc_scale_volt()
[all …]
Dqcom-vadc-common.h161 const struct vadc_prescale_ratio *prescale,
166 int (*scale_fn)(const struct vadc_prescale_ratio *prescale,
171 const struct vadc_prescale_ratio *prescale,
/drivers/clocksource/
Dingenic-sysost.c97 unsigned int prescale; in ingenic_ost_percpu_timer_recalc_rate() local
99 prescale = readl(ost_clk->ost->base + info->ostccr_reg); in ingenic_ost_percpu_timer_recalc_rate()
101 prescale = (prescale & OSTCCR_PRESCALE1_MASK) >> OSTCCR_PRESCALE1_LSB; in ingenic_ost_percpu_timer_recalc_rate()
103 return parent_rate >> (prescale * 2); in ingenic_ost_percpu_timer_recalc_rate()
111 unsigned int prescale; in ingenic_ost_global_timer_recalc_rate() local
113 prescale = readl(ost_clk->ost->base + info->ostccr_reg); in ingenic_ost_global_timer_recalc_rate()
115 prescale = (prescale & OSTCCR_PRESCALE2_MASK) >> OSTCCR_PRESCALE2_LSB; in ingenic_ost_global_timer_recalc_rate()
117 return parent_rate >> (prescale * 2); in ingenic_ost_global_timer_recalc_rate()
122 u8 prescale; in ingenic_ost_get_prescale() local
124 for (prescale = 0; prescale < 2; prescale++) in ingenic_ost_get_prescale()
[all …]
/drivers/pwm/
Dpwm-imx-tpm.c70 u8 prescale; member
93 u32 rate, prescale, period_count, clock_unit; in pwm_imx_tpm_round_state() local
100 prescale = 0; in pwm_imx_tpm_round_state()
102 prescale = ilog2(clock_unit) + 1 - PWM_IMX_TPM_MOD_WIDTH; in pwm_imx_tpm_round_state()
104 if ((!FIELD_FIT(PWM_IMX_TPM_SC_PS, prescale))) in pwm_imx_tpm_round_state()
106 p->prescale = prescale; in pwm_imx_tpm_round_state()
108 period_count = (clock_unit + ((1 << prescale) >> 1)) >> prescale; in pwm_imx_tpm_round_state()
112 tmp = (u64)period_count << prescale; in pwm_imx_tpm_round_state()
140 u32 rate, val, prescale; in pwm_imx_tpm_get_state() local
149 prescale = FIELD_GET(PWM_IMX_TPM_SC_PS, val); in pwm_imx_tpm_get_state()
[all …]
Dpwm-sprd.c74 u32 val, duty, prescale; in sprd_pwm_get_state() local
104 prescale = val & SPRD_PWM_PRESCALE_MSK; in sprd_pwm_get_state()
105 tmp = (prescale + 1) * NSEC_PER_SEC * SPRD_PWM_MOD_MAX; in sprd_pwm_get_state()
110 tmp = (prescale + 1) * NSEC_PER_SEC * duty; in sprd_pwm_get_state()
123 u32 prescale, duty; in sprd_pwm_config() local
140 prescale = DIV_ROUND_CLOSEST_ULL(tmp, SPRD_PWM_MOD_MAX) - 1; in sprd_pwm_config()
141 if (prescale > SPRD_PWM_PRESCALE_MSK) in sprd_pwm_config()
142 prescale = SPRD_PWM_PRESCALE_MSK; in sprd_pwm_config()
152 sprd_pwm_write(spc, pwm->hwpwm, SPRD_PWM_PRESCALE, prescale); in sprd_pwm_config()
Dpwm-bcm-iproc.c86 u32 value, prescale; in iproc_pwmc_get_state() local
108 prescale = value >> IPROC_PWM_PRESCALE_SHIFT(pwm->hwpwm); in iproc_pwmc_get_state()
109 prescale &= IPROC_PWM_PRESCALE_MAX; in iproc_pwmc_get_state()
111 multi = NSEC_PER_SEC * (prescale + 1); in iproc_pwmc_get_state()
125 unsigned long prescale = IPROC_PWM_PRESCALE_MIN; in iproc_pwmc_apply() local
145 div = NSEC_PER_SEC * (prescale + 1); in iproc_pwmc_apply()
159 if (++prescale > IPROC_PWM_PRESCALE_MAX) in iproc_pwmc_apply()
168 value |= prescale << IPROC_PWM_PRESCALE_SHIFT(pwm->hwpwm); in iproc_pwmc_apply()
Dpwm-pxa.c65 unsigned long period_cycles, prescale, pv, dc; in pxa_pwm_config() local
78 prescale = (period_cycles - 1) / 1024; in pxa_pwm_config()
79 pv = period_cycles / (prescale + 1) - 1; in pxa_pwm_config()
81 if (prescale > 63) in pxa_pwm_config()
96 writel(prescale, pc->mmio_base + offset + PWMCR); in pxa_pwm_config()
Dpwm-vt8500.c77 unsigned long period_cycles, prescale, pv, dc; in vt8500_pwm_config() local
94 prescale = (period_cycles - 1) / 4096; in vt8500_pwm_config()
95 pv = period_cycles / (prescale + 1) - 1; in vt8500_pwm_config()
99 if (prescale > 1023) { in vt8500_pwm_config()
108 writel(prescale, vt8500->base + REG_SCALAR(pwm->hwpwm)); in vt8500_pwm_config()
Dpwm-spear.c82 unsigned long prescale = PWMCR_MIN_PRESCALE, pv, dc; in spear_pwm_config() local
98 div *= 1 + prescale; in spear_pwm_config()
113 if (++prescale > PWMCR_MAX_PRESCALE) in spear_pwm_config()
129 prescale << PWMCR_PRESCALE_SHIFT); in spear_pwm_config()
Dpwm-imx27.c218 unsigned long period_cycles, duty_cycles, prescale; in pwm_imx27_apply() local
234 prescale = period_cycles / 0x10000 + 1; in pwm_imx27_apply()
236 period_cycles /= prescale; in pwm_imx27_apply()
240 duty_cycles /= prescale; in pwm_imx27_apply()
274 cr = MX3_PWMCR_PRESCALER_SET(prescale) | in pwm_imx27_apply()
Dpwm-sti.c124 unsigned int *prescale) in sti_pwm_get_prescale() argument
150 *prescale = ps; in sti_pwm_get_prescale()
169 unsigned int ncfg, value, prescale = 0; in sti_pwm_config() local
205 ret = sti_pwm_get_prescale(pc, period_ns, &prescale); in sti_pwm_config()
209 value = prescale & PWM_PRESCALE_LOW_MASK; in sti_pwm_config()
215 value = (prescale & PWM_PRESCALE_HIGH_MASK) >> 4; in sti_pwm_config()
240 prescale, period_ns, duty_ns, value); in sti_pwm_config()
Dpwm-bcm-kona.c116 unsigned long prescale = PRESCALE_MIN, pc, dc; in kona_pwmc_config() local
134 div *= 1 + prescale; in kona_pwmc_config()
149 if (++prescale > PRESCALE_MAX) in kona_pwmc_config()
163 value |= prescale << PRESCALE_SHIFT(chan); in kona_pwmc_config()
Dpwm-pca9685.c255 int prescale; in pca9685_pwm_config() local
258 prescale = DIV_ROUND_CLOSEST(PCA9685_OSC_CLOCK_MHZ * period_ns, in pca9685_pwm_config()
261 if (prescale >= PCA9685_PRESCALE_MIN && in pca9685_pwm_config()
262 prescale <= PCA9685_PRESCALE_MAX) { in pca9685_pwm_config()
273 regmap_write(pca->regmap, PCA9685_PRESCALE, prescale); in pca9685_pwm_config()
/drivers/clk/ingenic/
Dtcu.c158 unsigned int prescale; in ingenic_tcu_recalc_rate() local
161 ret = regmap_read(tcu_clk->tcu->map, info->tcsr_reg, &prescale); in ingenic_tcu_recalc_rate()
164 prescale = (prescale & TCU_TCSR_PRESCALE_MASK) >> TCU_TCSR_PRESCALE_LSB; in ingenic_tcu_recalc_rate()
166 return parent_rate >> (prescale * 2); in ingenic_tcu_recalc_rate()
171 u8 prescale; in ingenic_tcu_get_prescale() local
173 for (prescale = 0; prescale < 5; prescale++) in ingenic_tcu_get_prescale()
174 if ((rate >> (prescale * 2)) <= req_rate) in ingenic_tcu_get_prescale()
175 return prescale; in ingenic_tcu_get_prescale()
184 u8 prescale; in ingenic_tcu_round_rate() local
189 prescale = ingenic_tcu_get_prescale(rate, req_rate); in ingenic_tcu_round_rate()
[all …]
/drivers/i2c/busses/
Di2c-kempld.c226 long prescale; in kempld_i2c_device_init() local
240 prescale = pld->pld_clock / (bus_frequency * 5) - 1000; in kempld_i2c_device_init()
242 prescale = pld->pld_clock / (bus_frequency * 4) - 3000; in kempld_i2c_device_init()
244 if (prescale < 0) in kempld_i2c_device_init()
245 prescale = 0; in kempld_i2c_device_init()
248 prescale_corr = prescale / 1000; in kempld_i2c_device_init()
249 if (prescale % 1000 >= 500) in kempld_i2c_device_init()
Di2c-imx-lpi2c.c203 u8 prescale, filt, sethold, datavd; in lpi2c_imx_config() local
216 for (prescale = 0; prescale <= 7; prescale++) { in lpi2c_imx_config()
217 clk_cycle = clk_rate / ((1 << prescale) * lpi2c_imx->bitrate) in lpi2c_imx_config()
225 if (prescale > 7) in lpi2c_imx_config()
233 temp = prescale | pincfg << 24; in lpi2c_imx_config()
Di2c-ocores.c423 int prescale; in ocores_init() local
431 prescale = (i2c->ip_clock_khz / (5 * i2c->bus_clock_khz)) - 1; in ocores_init()
432 prescale = clamp(prescale, 0, 0xffff); in ocores_init()
434 diff = i2c->ip_clock_khz / (5 * (prescale + 1)) - i2c->bus_clock_khz; in ocores_init()
442 oc_setreg(i2c, OCI2C_PRELOW, prescale & 0xff); in ocores_init()
443 oc_setreg(i2c, OCI2C_PREHIGH, prescale >> 8); in ocores_init()
/drivers/gpu/drm/radeon/
Dradeon_i2c.c242 u32 prescale = 0; in radeon_get_i2c_prescale() local
268 prescale = m | (n << 8); in radeon_get_i2c_prescale()
276 prescale = (((sclk * 10)/(4 * 128 * 100) + 1) << 8) + 128; in radeon_get_i2c_prescale()
291 prescale = (127 << 8) + ((sclk * 10) / (4 * 127 * i2c_clock)); in radeon_get_i2c_prescale()
293 prescale = (((sclk * 10)/(4 * 128 * 100) + 1) << 8) + 128; in radeon_get_i2c_prescale()
322 return prescale; in radeon_get_i2c_prescale()
337 u32 prescale; in r100_hw_i2c_xfer() local
345 prescale = radeon_get_i2c_prescale(rdev); in r100_hw_i2c_xfer()
347 reg = ((prescale << RADEON_I2C_PRESCALE_SHIFT) | in r100_hw_i2c_xfer()
590 u32 prescale; in r500_hw_i2c_xfer() local
[all …]
/drivers/media/i2c/
Dsaa717x.c807 int task, int prescale) in set_h_prescale() argument
833 if (vals[i].xpsc == prescale) in set_h_prescale()
987 int prescale, h_scale, v_scale; in saa717x_set_fmt() local
1008 prescale = SAA717X_NTSC_WIDTH / fmt->width; in saa717x_set_fmt()
1009 if (prescale == 0) in saa717x_set_fmt()
1010 prescale = 1; in saa717x_set_fmt()
1011 h_scale = 1024 * SAA717X_NTSC_WIDTH / prescale / fmt->width; in saa717x_set_fmt()
1016 set_h_prescale(sd, 0, prescale); in saa717x_set_fmt()
1017 set_h_prescale(sd, 1, prescale); in saa717x_set_fmt()
/drivers/staging/comedi/drivers/
Ddt3000.c345 unsigned int divider, base, prescale; in dt3k_ns_to_timer() local
350 for (prescale = 0; prescale < 16; prescale++) { in dt3k_ns_to_timer()
351 base = timer_base * (prescale + 1); in dt3k_ns_to_timer()
366 return (prescale << 16) | (divider); in dt3k_ns_to_timer()
370 prescale = 15; in dt3k_ns_to_timer()
371 base = timer_base * (prescale + 1); in dt3k_ns_to_timer()
374 return (prescale << 16) | (divider); in dt3k_ns_to_timer()
/drivers/spi/
Dspi-fsl-lpspi.c89 u8 prescale; member
263 temp |= fsl_lpspi->config.prescale << 27; in fsl_lpspi_set_cmd()
301 u8 prescale; in fsl_lpspi_set_bitrate() local
311 for (prescale = 0; prescale < 8; prescale++) { in fsl_lpspi_set_bitrate()
312 scldiv = perclk_rate / config.speed_hz / (1 << prescale) - 2; in fsl_lpspi_set_bitrate()
314 fsl_lpspi->config.prescale = prescale; in fsl_lpspi_set_bitrate()
326 perclk_rate, config.speed_hz, prescale, scldiv); in fsl_lpspi_set_bitrate()
Dspi-armada-3700.c222 u32 prescale; in a3700_spi_clock_set() local
224 prescale = DIV_ROUND_UP(clk_get_rate(a3700_spi->clk), speed_hz); in a3700_spi_clock_set()
230 if (prescale > 15) in a3700_spi_clock_set()
231 prescale = A3700_SPI_CLK_EVEN_OFFS + DIV_ROUND_UP(prescale, 2); in a3700_spi_clock_set()
236 val = val | (prescale & A3700_SPI_CLK_PRESCALE_MASK); in a3700_spi_clock_set()
239 if (prescale <= 2) { in a3700_spi_clock_set()
/drivers/media/pci/cobalt/
Dcobalt-i2c.c309 int prescale; in cobalt_i2c_init() local
315 prescale = ((ALT_CPU_FREQ) / (5 * I2C_FREQUENCY)) - 1; in cobalt_i2c_init()
344 iowrite8(prescale & 0xff, &regs->prerlo); in cobalt_i2c_init()
345 iowrite8((prescale >> 8) & 0xff, &regs->prerhi); in cobalt_i2c_init()
/drivers/video/fbdev/
Datafb.c907 int prescale; in falcon_decode_var() local
1217 prescale = hxx_prescale(&par->hw.falcon); in falcon_decode_var()
1227 hdb_off = (base_off + 16 * plen) + prescale; in falcon_decode_var()
1232 hdb_off = (64 + base_off + (128 / bpp + 2) * plen) + prescale; in falcon_decode_var()
1234 hdb_off = (base_off + (128 / bpp + 18) * plen) + prescale; in falcon_decode_var()
1237 gstart = (prescale / 2 + plen * left_margin) / prescale; in falcon_decode_var()
1239 gend1 = gstart + roundup(xres, align) * plen / prescale; in falcon_decode_var()
1241 gend2 = gstart + xres * plen / prescale; in falcon_decode_var()
1243 (2 * prescale) - 2; in falcon_decode_var()
1246 par->HDB = gstart - hdb_off / prescale; in falcon_decode_var()
[all …]
/drivers/media/pci/cx88/
Dcx88-core.c740 static int set_pll(struct cx88_core *core, int prescale, u32 ofreq) in set_pll() argument
747 if (prescale < 2) in set_pll()
748 prescale = 2; in set_pll()
749 if (prescale > 5) in set_pll()
750 prescale = 5; in set_pll()
752 pll = ofreq * 8 * prescale * (u64)(1 << 20); in set_pll()
754 reg = (pll & 0x3ffffff) | (pre[prescale] << 26); in set_pll()
767 prescale, ofreq); in set_pll()
773 dprintk(1, "pll NOT locked [pre=%d,ofreq=%d]\n", prescale, ofreq); in set_pll()

12