Home
last modified time | relevance | path

Searched refs:prescaler (Results 1 – 25 of 32) sorted by relevance

12

/drivers/pwm/
Dpwm-sl28cpld.c55 #define SL28CPLD_PWM_MAX_DUTY_CYCLE(prescaler) (1 << (7 - (prescaler))) argument
56 #define SL28CPLD_PWM_PERIOD(prescaler) \ argument
57 (NSEC_PER_SEC / SL28CPLD_PWM_CLK * SL28CPLD_PWM_MAX_DUTY_CYCLE(prescaler))
100 int prescaler; in sl28cpld_pwm_get_state() local
106 prescaler = FIELD_GET(SL28CPLD_PWM_CTRL_PRESCALER_MASK, reg); in sl28cpld_pwm_get_state()
107 state->period = SL28CPLD_PWM_PERIOD(prescaler); in sl28cpld_pwm_get_state()
130 unsigned int cycle, prescaler; in sl28cpld_pwm_apply() local
143 prescaler = DIV_ROUND_UP_ULL(SL28CPLD_PWM_PERIOD(0), state->period); in sl28cpld_pwm_apply()
144 prescaler = order_base_2(prescaler); in sl28cpld_pwm_apply()
146 if (prescaler > field_max(SL28CPLD_PWM_CTRL_PRESCALER_MASK)) in sl28cpld_pwm_apply()
[all …]
Dpwm-sun4i.c117 unsigned int prescaler; in sun4i_pwm_get_state() local
141 prescaler = 1; in sun4i_pwm_get_state()
143 prescaler = prescaler_table[PWM_REG_PRESCAL(val, pwm->hwpwm)]; in sun4i_pwm_get_state()
145 if (prescaler == 0) in sun4i_pwm_get_state()
161 tmp = (u64)prescaler * NSEC_PER_SEC * PWM_REG_DTY(val); in sun4i_pwm_get_state()
164 tmp = (u64)prescaler * NSEC_PER_SEC * PWM_REG_PRD(val); in sun4i_pwm_get_state()
176 unsigned int prescaler = 0; in sun4i_pwm_calculate() local
192 prescaler = PWM_PRESCAL_MASK; in sun4i_pwm_calculate()
201 prescaler = 0; in sun4i_pwm_calculate()
204 if (prescaler == 0) { in sun4i_pwm_calculate()
[all …]
Dpwm-renesas-tpu.c76 unsigned int prescaler; member
176 tpd->prescaler); in tpu_pwm_timer_start()
225 tpd->prescaler = 0; in tpu_pwm_request()
249 unsigned int prescaler; in tpu_pwm_config() local
283 prescaler = 0; in tpu_pwm_config()
287 prescaler = 1; in tpu_pwm_config()
291 prescaler = 2; in tpu_pwm_config()
295 prescaler = 3; in tpu_pwm_config()
302 period >>= 2 * prescaler; in tpu_pwm_config()
306 (u64)NSEC_PER_SEC << (2 * prescaler)); in tpu_pwm_config()
[all …]
Dpwm-rockchip.c49 unsigned int prescaler; member
82 tmp *= pc->data->prescaler * NSEC_PER_SEC; in rockchip_pwm_get_state()
86 tmp *= pc->data->prescaler * NSEC_PER_SEC; in rockchip_pwm_get_state()
120 pc->data->prescaler * NSEC_PER_SEC); in rockchip_pwm_config()
123 duty = DIV_ROUND_CLOSEST_ULL(div, pc->data->prescaler * NSEC_PER_SEC); in rockchip_pwm_config()
241 .prescaler = 2,
254 .prescaler = 1,
268 .prescaler = 1,
282 .prescaler = 1,
Dpwm-imx27.c125 u32 period, prescaler, pwm_clk, val; in pwm_imx27_get_state() local
151 prescaler = MX3_PWMCR_PRESCALER_GET(val); in pwm_imx27_get_state()
157 tmp = NSEC_PER_SEC * (u64)(period + 2) * prescaler; in pwm_imx27_get_state()
169 tmp = NSEC_PER_SEC * (u64)(val) * prescaler; in pwm_imx27_get_state()
Dpwm-stm32.c330 unsigned int prescaler = 0; in stm32_pwm_config() local
340 prescaler++; in stm32_pwm_config()
342 do_div(div, prescaler + 1); in stm32_pwm_config()
350 if (prescaler > MAX_TIM_PSC) in stm32_pwm_config()
363 if ((psc != prescaler) || (arr != prd - 1)) in stm32_pwm_config()
367 regmap_write(priv->regmap, TIM_PSC, prescaler); in stm32_pwm_config()
/drivers/clocksource/
Dtimer-stm32.c209 int prescaler = 1; in stm32_timer_set_prescaler() local
212 prescaler = DIV_ROUND_CLOSEST(timer_of_rate(to), in stm32_timer_set_prescaler()
219 prescaler = prescaler < TIM_PSC_MAX ? prescaler : TIM_PSC_MAX; in stm32_timer_set_prescaler()
222 writel_relaxed(prescaler - 1, timer_of_base(to) + TIM_PSC); in stm32_timer_set_prescaler()
227 to->of_clk.rate = DIV_ROUND_CLOSEST(to->of_clk.rate, prescaler); in stm32_timer_set_prescaler()
Dtimer-ti-dm.c898 int prescaler) in omap_dm_timer_set_prescaler() argument
906 if (unlikely(!timer) || prescaler < -1 || prescaler > 7) in omap_dm_timer_set_prescaler()
916 if (prescaler >= 0) { in omap_dm_timer_set_prescaler()
918 l |= prescaler << 2; in omap_dm_timer_set_prescaler()
/drivers/watchdog/
Dmpc8xxx_wdt.c44 int prescaler; member
186 ddata->swtc = min(ddata->wdd.timeout * freq / wdt_type->prescaler, in mpc8xxx_wdt_probe()
197 ddata->wdd.max_hw_heartbeat_ms = (ddata->swtc * wdt_type->prescaler) / in mpc8xxx_wdt_probe()
219 .prescaler = 0x10000,
226 .prescaler = 0x10000,
234 .prescaler = 0x800,
Dcadence_wdt.c78 u32 prescaler; member
186 count = (wdd->timeout * (clock_f / wdt->prescaler)) / in cdns_wdt_start()
338 wdt->prescaler = CDNS_WDT_PRESCALE_512; in cdns_wdt_probe()
341 wdt->prescaler = CDNS_WDT_PRESCALE_4096; in cdns_wdt_probe()
Dkempld_wdt.c133 u32 prescaler; in kempld_wdt_set_stage_timeout() local
139 prescaler = kempld_prescaler[PRESCALER_21]; in kempld_wdt_set_stage_timeout()
145 remainder = do_div(stage_timeout64, prescaler); in kempld_wdt_set_stage_timeout()
175 u32 prescaler; in kempld_wdt_get_timeout() local
184 prescaler = kempld_prescaler[STAGE_CFG_GET_PRESCALER(stage_cfg)]; in kempld_wdt_get_timeout()
186 stage_timeout = (stage_timeout & stage->mask) * prescaler; in kempld_wdt_get_timeout()
/drivers/rtc/
Drtc-mpfs.c219 unsigned long prescaler; in mpfs_rtc_probe() local
260 prescaler = clk_get_rate(devm_clk_get(&pdev->dev, "rtcref")) - 1; in mpfs_rtc_probe()
261 if (prescaler > MAX_PRESCALER_COUNT) { in mpfs_rtc_probe()
262 dev_dbg(&pdev->dev, "invalid prescaler %lu\n", prescaler); in mpfs_rtc_probe()
266 writel(prescaler, rtcdev->base + PRESCALER_REG); in mpfs_rtc_probe()
267 dev_info(&pdev->dev, "prescaler set to: %lu\n", prescaler); in mpfs_rtc_probe()
/drivers/i2c/busses/
Di2c-mpc.c400 u32 prescaler = 1; in mpc_i2c_get_prescaler_8xxx() local
415 prescaler = 1; in mpc_i2c_get_prescaler_8xxx()
419 prescaler = mpc_i2c_get_sec_cfg_8xxx() ? 3 : 2; in mpc_i2c_get_prescaler_8xxx()
422 prescaler = 2; in mpc_i2c_get_prescaler_8xxx()
425 return prescaler; in mpc_i2c_get_prescaler_8xxx()
432 u32 prescaler = mpc_i2c_get_prescaler_8xxx(); in mpc_i2c_get_fdr_8xxx() local
438 *real_clk = fsl_get_sys_freq() / prescaler / (16 * 3072); in mpc_i2c_get_fdr_8xxx()
442 divider = fsl_get_sys_freq() / clock / prescaler; in mpc_i2c_get_fdr_8xxx()
457 *real_clk = fsl_get_sys_freq() / prescaler / div->divider; in mpc_i2c_get_fdr_8xxx()
/drivers/thermal/st/
Dstm_thermal.c200 u32 prescaler; in stm_thermal_calibration() local
207 prescaler = 0; in stm_thermal_calibration()
210 while (prescaler <= clk_freq) in stm_thermal_calibration()
211 prescaler++; in stm_thermal_calibration()
220 value |= (prescaler << HSREF_CLK_DIV_POS); in stm_thermal_calibration()
/drivers/iio/frequency/
Dadf4350.c139 u32 div_gcd, prescaler, chspc; in adf4350_set_freq() local
147 prescaler = ADF4350_REG1_PRESCALER; in adf4350_set_freq()
150 prescaler = 0; in adf4350_set_freq()
204 1 << st->r4_rf_div_sel, prescaler ? "8/9" : "4/5", in adf4350_set_freq()
212 prescaler; in adf4350_set_freq()
/drivers/usb/serial/
Dkeyspan.c49 u8 *prescaler, int portnum);
53 u8 *prescaler, int portnum);
57 u8 *prescaler, int portnum);
61 u8 *prescaler, int portnum);
176 u8 *rate_hi, u8 *rate_low, u8 *prescaler,
1845 u8 *rate_low, u8 *prescaler, int portnum) in keyspan_usa19_calc_baud() argument
1886 u8 *rate_low, u8 *prescaler, int portnum) in keyspan_usa19hs_calc_baud() argument
1922 u8 *rate_low, u8 *prescaler, int portnum) in keyspan_usa19w_calc_baud() argument
1976 if (prescaler) { in keyspan_usa19w_calc_baud()
1977 *prescaler = best_prescaler; in keyspan_usa19w_calc_baud()
[all …]
Dkeyspan_usa26msg.h155 prescaler; // BOTH: specified as N/8; values 8-ff are valid member
Dkeyspan_usa67msg.h153 prescaler; // specified as N/8; values 8-ff are valid member
Dkeyspan_usa49msg.h143 prescaler, // specified as N/8; values 8-ff are valid member
/drivers/mmc/host/
Dmxcmmc.c776 int prescaler = 0; in mxcmci_set_clk_rate() local
779 while (prescaler <= 0x800) { in mxcmci_set_clk_rate()
785 if (prescaler) in mxcmci_set_clk_rate()
786 x /= (prescaler * 2); in mxcmci_set_clk_rate()
794 if (prescaler == 0) in mxcmci_set_clk_rate()
795 prescaler = 1; in mxcmci_set_clk_rate()
797 prescaler <<= 1; in mxcmci_set_clk_rate()
800 mxcmci_writew(host, (prescaler << 4) | divider, MMC_REG_CLK_RATE); in mxcmci_set_clk_rate()
803 prescaler, divider, clk_in, clk_ios); in mxcmci_set_clk_rate()
/drivers/counter/
D104-quad-8.c1003 u8 *prescaler) in quad8_signal_fck_prescaler_read() argument
1007 *prescaler = priv->fck_prescaler[signal->id / 2]; in quad8_signal_fck_prescaler_read()
1013 const u8 prescaler) in quad8_filter_clock_prescaler_set() argument
1020 ret = regmap_write(priv->map, QUAD8_DATA(id), prescaler); in quad8_filter_clock_prescaler_set()
1028 u8 prescaler) in quad8_signal_fck_prescaler_write() argument
1037 priv->fck_prescaler[channel_id] = prescaler; in quad8_signal_fck_prescaler_write()
1038 ret = quad8_filter_clock_prescaler_set(priv, channel_id, prescaler); in quad8_signal_fck_prescaler_write()
/drivers/iio/trigger/
Dstm32-timer-trigger.c122 int prescaler = 0; in stm32_timer_start() local
137 prescaler++; in stm32_timer_start()
139 do_div(div, (prescaler + 1)); in stm32_timer_start()
143 if (prescaler > MAX_TIM_PSC) { in stm32_timer_start()
159 regmap_write(priv->regmap, TIM_PSC, prescaler); in stm32_timer_start()
/drivers/tty/serial/
Dmpc52xx_uart.c125 u16 prescaler, unsigned int divisor) in mpc52xx_set_divisor() argument
128 out_be16(&psc->mpc52xx_psc_clock_select, prescaler); in mpc52xx_set_divisor()
312 u16 prescaler; in mpc5200b_psc_set_baudrate() local
325 prescaler = 0xdd00; /* /32 */ in mpc5200b_psc_set_baudrate()
327 prescaler = 0xff00; /* /4 */ in mpc5200b_psc_set_baudrate()
328 mpc52xx_set_divisor(PSC(port), prescaler, divisor); in mpc5200b_psc_set_baudrate()
873 u8 prescaler, unsigned int divisor) in mpc5125_set_divisor() argument
876 out_8(&psc->mpc52xx_psc_clock_select, prescaler); in mpc5125_set_divisor()
/drivers/hwmon/
Dmax6650.c39 static int prescaler; variable
44 module_param(prescaler, int, 0444);
375 prescale = prescaler; in max6650_init_client()
/drivers/media/rc/
Dmceusb.c1036 int prescaler = 0, divisor = 0; in mceusb_set_tx_carrier() local
1052 for (prescaler = 0; prescaler < 4; ++prescaler) { in mceusb_set_tx_carrier()
1053 divisor = (clk >> (2 * prescaler)) / carrier; in mceusb_set_tx_carrier()
1056 cmdbuf[2] = prescaler; in mceusb_set_tx_carrier()

12