/drivers/iio/adc/ |
D | qcom-vadc-common.c | 282 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 …]
|
D | qcom-vadc-common.h | 161 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/ |
D | ingenic-sysost.c | 97 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/ |
D | pwm-imx-tpm.c | 70 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 …]
|
D | pwm-sprd.c | 74 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()
|
D | pwm-bcm-iproc.c | 86 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()
|
D | pwm-pxa.c | 65 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()
|
D | pwm-vt8500.c | 77 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()
|
D | pwm-spear.c | 82 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()
|
D | pwm-imx27.c | 218 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()
|
D | pwm-sti.c | 124 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()
|
D | pwm-bcm-kona.c | 116 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()
|
D | pwm-pca9685.c | 255 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/ |
D | tcu.c | 158 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/ |
D | i2c-kempld.c | 226 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()
|
D | i2c-imx-lpi2c.c | 203 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()
|
D | i2c-ocores.c | 423 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/ |
D | radeon_i2c.c | 242 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/ |
D | saa717x.c | 807 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/ |
D | dt3000.c | 345 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/ |
D | spi-fsl-lpspi.c | 89 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()
|
D | spi-armada-3700.c | 222 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/ |
D | cobalt-i2c.c | 309 int prescale; in cobalt_i2c_init() local 315 prescale = ((ALT_CPU_FREQ) / (5 * I2C_FREQUENCY)) - 1; in cobalt_i2c_init() 344 iowrite8(prescale & 0xff, ®s->prerlo); in cobalt_i2c_init() 345 iowrite8((prescale >> 8) & 0xff, ®s->prerhi); in cobalt_i2c_init()
|
/drivers/video/fbdev/ |
D | atafb.c | 907 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/ |
D | cx88-core.c | 740 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()
|