| /OK3568_Linux_fs/kernel/drivers/pwm/ |
| H A D | pwm-sl28cpld.c | 10 * With the prescaler setting you can select which bit of the counter is used 16 * | prescaler | reset | counter bits | frequency | period length | 25 * - The hardware cannot generate a 100% duty cycle if the prescaler is 0. 26 * - The hardware cannot atomically set the prescaler and the counter value, 28 * - The counter is not reset if you switch the prescaler which leads 54 #define SL28CPLD_PWM_MAX_DUTY_CYCLE(prescaler) (1 << (7 - (prescaler))) argument 55 #define SL28CPLD_PWM_PERIOD(prescaler) \ argument 56 (NSEC_PER_SEC / SL28CPLD_PWM_CLK * SL28CPLD_PWM_MAX_DUTY_CYCLE(prescaler)) 63 * max_period_ns = 1 << (7 - prescaler) / SL28CPLD_PWM_CLK * NSEC_PER_SEC 64 * max_duty_cycle = 1 << (7 - prescaler) [all …]
|
| H A D | pwm-sun4i.c | 119 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() 174 unsigned int prescaler = 0; in sun4i_pwm_calculate() local 189 /* First, test without any prescaler when available */ in sun4i_pwm_calculate() 190 prescaler = PWM_PRESCAL_MASK; in sun4i_pwm_calculate() 192 * When not using any prescaler, the clock period in nanoseconds in sun4i_pwm_calculate() [all …]
|
| H A D | pwm-renesas-tpu.c | 76 unsigned int prescaler; member 170 * - Set prescaler in tpu_pwm_timer_start() 176 pwm->prescaler); in tpu_pwm_timer_start() 225 pwm->prescaler = 0; in tpu_pwm_request() 250 unsigned int prescaler; in tpu_pwm_config() local 258 * Pick a prescaler to avoid overflowing the counter. in tpu_pwm_config() 259 * TODO: Pick the highest acceptable prescaler. in tpu_pwm_config() 263 for (prescaler = 0; prescaler < ARRAY_SIZE(prescalers); ++prescaler) { in tpu_pwm_config() 264 period = clk_rate / prescalers[prescaler] in tpu_pwm_config() 270 if (prescaler == ARRAY_SIZE(prescalers) || period == 0) { in tpu_pwm_config() [all …]
|
| H A D | pwm-stm32.c | 198 /* prescaler: fit timeout window provided by upper layer */ in stm32_pwm_capture() 228 * - decrease counter clock prescaler, scale up to max rate. in stm32_pwm_capture() 229 * - use input prescaler, capture once every /2 /4 or /8 edges. in stm32_pwm_capture() 254 /* input prescaler: also keep arbitrary margin */ in stm32_pwm_capture() 264 /* Last chance to improve period accuracy, using input prescaler */ in stm32_pwm_capture() 277 * We may fall here using input prescaler, when input in stm32_pwm_capture() 326 unsigned int prescaler = 0; in stm32_pwm_config() local 329 /* Period and prescaler values depends on clock rate */ in stm32_pwm_config() 336 prescaler++; in stm32_pwm_config() 338 do_div(div, prescaler + 1); in stm32_pwm_config() [all …]
|
| H A D | pwm-rockchip.c | 86 unsigned int prescaler; member 119 tmp *= dclk_div * pc->data->prescaler * NSEC_PER_SEC; in rockchip_pwm_get_state() 123 tmp *= dclk_div * pc->data->prescaler * NSEC_PER_SEC; in rockchip_pwm_get_state() 186 * default prescaler value for all practical clock rate values. in rockchip_pwm_config() 189 period = DIV_ROUND_CLOSEST_ULL(div, dclk_div * pc->data->prescaler * NSEC_PER_SEC); in rockchip_pwm_config() 192 duty = DIV_ROUND_CLOSEST_ULL(div, dclk_div * pc->data->prescaler * NSEC_PER_SEC); in rockchip_pwm_config() 379 .prescaler = 2, 394 .prescaler = 1, 410 .prescaler = 1, 426 .prescaler = 1,
|
| /OK3568_Linux_fs/kernel/drivers/clocksource/ |
| H A D | timer-stm32.c | 200 * stm32_timer_set_prescaler - Compute and set the prescaler register 203 * Depending on the timer width, compute the prescaler to always 205 * considered precise and long enough to not use the prescaler. 209 int prescaler = 1; in stm32_timer_set_prescaler() local 212 prescaler = DIV_ROUND_CLOSEST(timer_of_rate(to), in stm32_timer_set_prescaler() 215 * The prescaler register is an u16, the variable 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() 226 /* Adjust rate and period given the prescaler value */ in stm32_timer_set_prescaler() 227 to->of_clk.rate = DIV_ROUND_CLOSEST(to->of_clk.rate, prescaler); in stm32_timer_set_prescaler()
|
| /OK3568_Linux_fs/kernel/drivers/watchdog/ |
| H A D | cadence_wdt.c | 34 /* Clock prescaler value and selection */ 67 * @prescaler: for saving prescaler value 68 * @ctrl_clksel: counter clock prescaler selection 78 u32 prescaler; member 163 * calculated count = (timeout * clock) / prescaler + 1. 166 * Clears the contents of prescaler and counter reset value. Sets the 167 * prescaler to 4096 and the calculated count and access key 186 count = (wdd->timeout * (clock_f / wdt->prescaler)) / in cdns_wdt_start() 353 wdt->prescaler = CDNS_WDT_PRESCALE_512; in cdns_wdt_probe() 356 wdt->prescaler = CDNS_WDT_PRESCALE_4096; in cdns_wdt_probe()
|
| H A D | mpc8xxx_wdt.c | 44 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,
|
| H A D | mt7621_wdt.c | 73 /* set the prescaler to 1ms == 1000us */ in mt7621_wdt_start() 150 * the prescaler of this driver here into account (the in mt7621_wdt_probe() 151 * boot loader might be using a different prescaler). in mt7621_wdt_probe() 154 * we first disable the watchdog, set the new prescaler in mt7621_wdt_probe()
|
| H A D | stm32_iwdg.c | 26 #define IWDG_PR 0x04 /* Prescaler Register */ 46 #define SR_PVU BIT(0) /* Watchdog prescaler value update */ 100 /* The prescaler is align on power of 2 and start at 2 ^ PR_SHIFT. */ in stm32_iwdg_start() 108 /* set prescaler & reload registers */ in stm32_iwdg_start() 118 dev_err(wdd->parent, "Fail to set prescaler, reload regs\n"); in stm32_iwdg_start()
|
| /OK3568_Linux_fs/u-boot/arch/arm/cpu/armv7/s5p-common/ |
| H A D | pwm.c | 121 unsigned int offset, prescaler; in pwm_init() local 130 prescaler = PRESCALER_0; in pwm_init() 132 val |= (prescaler & 0xff); in pwm_init() 134 prescaler = PRESCALER_1; in pwm_init() 136 val |= (prescaler & 0xff) << 8; in pwm_init() 153 ((prescaler + 1) * (1 << div)); in pwm_init()
|
| /OK3568_Linux_fs/u-boot/drivers/pwm/ |
| H A D | rk_pwm.c | 24 unsigned int prescaler; member 86 priv->data->prescaler * 1000000); in rk_pwm_set_config() 88 priv->data->prescaler * 1000000); in rk_pwm_set_config() 186 .prescaler = 2, 201 .prescaler = 1, 217 .prescaler = 1, 233 .prescaler = 1,
|
| /OK3568_Linux_fs/u-boot/drivers/spi/ |
| H A D | cf_spi.c | 183 * 27 - 26: PCS to SCK delay prescaler in cfspi_setup_slave() 184 * 25 - 24: After SCK delay prescaler in cfspi_setup_slave() 185 * 23 - 22: Delay after transfer prescaler in cfspi_setup_slave() 194 int prescaler[] = { 2, 3, 5, 7 }; in cfspi_setup_slave() local 205 tmp = (prescaler[3] * scaler[15]); in cfspi_setup_slave() 216 (cfslave->baudrate > (gd->bus_clk / (prescaler[0] * scaler[0])))) { in cfspi_setup_slave() 254 pbrcnt = sizeof(prescaler) / sizeof(int); in cfspi_setup_slave() 259 baud_speed = gd->bus_clk / prescaler[i]; in cfspi_setup_slave()
|
| H A D | stm32_qspi.c | 550 u32 prescaler = 255; in stm32_qspi_set_speed() local 552 prescaler = DIV_ROUND_UP(qspi_clk, speed) - 1; in stm32_qspi_set_speed() 553 if (prescaler > 255) in stm32_qspi_set_speed() 554 prescaler = 255; in stm32_qspi_set_speed() 555 else if (prescaler < 0) in stm32_qspi_set_speed() 556 prescaler = 0; in stm32_qspi_set_speed() 559 u32 csht = DIV_ROUND_UP((5 * qspi_clk) / (prescaler + 1), 100000000); in stm32_qspi_set_speed() 567 prescaler << STM32_QSPI_CR_PRESCALER_SHIFT); in stm32_qspi_set_speed() 575 (qspi_clk / (prescaler + 1))); in stm32_qspi_set_speed()
|
| /OK3568_Linux_fs/kernel/arch/powerpc/sysdev/ |
| H A D | fsl_gtm.c | 170 unsigned int prescaler; in gtm_set_ref_timer16() local 177 /* CPM2 doesn't have primary prescaler */ in gtm_set_ref_timer16() 181 prescaler = gtm->clock / frequency; in gtm_set_ref_timer16() 187 if (prescaler > max_prescaler) in gtm_set_ref_timer16() 190 if (prescaler > max_prescaler / 16) { in gtm_set_ref_timer16() 192 prescaler /= 16; in gtm_set_ref_timer16() 195 if (prescaler <= 256) { in gtm_set_ref_timer16() 197 sps = prescaler - 1; in gtm_set_ref_timer16() 200 sps = prescaler / 256 - 1; in gtm_set_ref_timer16() 366 /* CPM2 doesn't have primary prescaler */ in gtm_set_shortcuts()
|
| /OK3568_Linux_fs/kernel/Documentation/ABI/testing/ |
| H A D | sysfs-bus-counter-ftm-quaddec | 9 What: /sys/bus/counter/devices/counterX/countY/prescaler 13 Configure the prescaler value associated with Count Y. 15 prescaler (i.e. a counter). This acts like a clock
|
| /OK3568_Linux_fs/kernel/drivers/thermal/st/ |
| H A D | stm_thermal.c | 203 u32 prescaler; in stm_thermal_calibration() local 205 /* Figure out prescaler value for PCLK during calibration */ in stm_thermal_calibration() 210 prescaler = 0; in stm_thermal_calibration() 213 while (prescaler <= clk_freq) in stm_thermal_calibration() 214 prescaler++; in stm_thermal_calibration() 219 /* Clear prescaler */ in stm_thermal_calibration() 222 /* Set prescaler. pclk_freq/prescaler < 1MHz */ in stm_thermal_calibration() 223 value |= (prescaler << HSREF_CLK_DIV_POS); in stm_thermal_calibration()
|
| /OK3568_Linux_fs/u-boot/arch/arm/mach-imx/ |
| H A D | timer.c | 20 unsigned int prescaler; member 88 * Enable bit and prescaler in timer_init() 96 &cur_gpt->prescaler); in timer_init() 102 __raw_writel(0, &cur_gpt->prescaler); /* 32Khz */ in timer_init()
|
| /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/power/supply/ |
| H A D | ltc2941.txt | 16 - lltc,prescaler-exponent: The prescaler exponent as explained in the datasheet. 27 lltc,prescaler-exponent = <5>; /* 2^(2*5) = 1024 */
|
| /OK3568_Linux_fs/kernel/drivers/tty/serial/ |
| H A D | mpc52xx_uart.c | 121 /* setting the prescaler and divisor reg is common for all chips */ 123 u16 prescaler, unsigned int divisor) in mpc52xx_set_divisor() argument 125 /* select prescaler */ in mpc52xx_set_divisor() 126 out_be16(&psc->mpc52xx_psc_clock_select, prescaler); in mpc52xx_set_divisor() 293 /* The 5200 has a fixed /32 prescaler, uartclk contains the ipb freq */ in mpc5200_psc_set_baudrate() 299 /* enable the /32 prescaler and set the divisor */ in mpc5200_psc_set_baudrate() 310 u16 prescaler; in mpc5200b_psc_set_baudrate() local 312 /* The 5200B has a selectable /4 or /32 prescaler, uartclk contains the in mpc5200b_psc_set_baudrate() 319 /* select the proper prescaler and set the divisor in mpc5200b_psc_set_baudrate() 320 * prefer high prescaler for more tolerance on low baudrates */ in mpc5200b_psc_set_baudrate() [all …]
|
| /OK3568_Linux_fs/u-boot/drivers/mmc/ |
| H A D | mxcmmc.c | 424 int prescaler = 0; in mxcmci_set_clk_rate() local 427 while (prescaler <= 0x800) { in mxcmci_set_clk_rate() 433 if (prescaler) in mxcmci_set_clk_rate() 434 x /= (prescaler * 2); in mxcmci_set_clk_rate() 442 if (prescaler == 0) in mxcmci_set_clk_rate() 443 prescaler = 1; in mxcmci_set_clk_rate() 445 prescaler <<= 1; in mxcmci_set_clk_rate() 448 writel((prescaler << 4) | divider, &host->base->clk_rate); in mxcmci_set_clk_rate()
|
| /OK3568_Linux_fs/kernel/drivers/i2c/busses/ |
| H A D | i2c-mpc.c | 435 * According to the AN2919 all MPC824x have prescaler 1, while MPC83xx in mpc_i2c_get_prescaler_8xxx() 436 * may have prescaler 1, 2, or 3, depending on the power-on in mpc_i2c_get_prescaler_8xxx() 439 u32 prescaler = 1; in mpc_i2c_get_prescaler_8xxx() local 453 /* the above 85xx SoCs have prescaler 1 */ in mpc_i2c_get_prescaler_8xxx() 454 prescaler = 1; in mpc_i2c_get_prescaler_8xxx() 457 /* the above 85xx SoCs have prescaler 3 or 2 */ in mpc_i2c_get_prescaler_8xxx() 458 prescaler = mpc_i2c_get_sec_cfg_8xxx() ? 3 : 2; in mpc_i2c_get_prescaler_8xxx() 460 /* all the other 85xx have prescaler 2 */ in mpc_i2c_get_prescaler_8xxx() 461 prescaler = 2; in mpc_i2c_get_prescaler_8xxx() 464 return prescaler; in mpc_i2c_get_prescaler_8xxx() [all …]
|
| /OK3568_Linux_fs/kernel/drivers/iio/adc/ |
| H A D | aspeed_adc.c | 192 /* Register ADC clock prescaler with source specified by device tree. */ in aspeed_adc_probe() 197 &pdev->dev, "prescaler", clk_parent_name, 0, in aspeed_adc_probe() 204 * Register ADC clock scaler downstream from the prescaler. Allow rate in aspeed_adc_probe() 205 * setting to adjust the prescaler as well. in aspeed_adc_probe() 208 &pdev->dev, "scaler", "prescaler", in aspeed_adc_probe()
|
| /OK3568_Linux_fs/kernel/drivers/hwmon/ |
| H A D | max6650.c | 38 /* prescaler: Possible values are 1, 2, 4, 8, 16 or 0 for don't change */ 39 static int prescaler; variable 44 module_param(prescaler, int, 0444); 233 * 2) The prescaler (low three bits of the config register) has already 234 * been set to an appropriate value. Use the prescaler module parameter 252 * KSCALE is the prescaler value (1, 2, 4, 8, or 16) 375 prescale = prescaler; in max6650_init_client() 419 dev_err(dev, "illegal value for prescaler (%d)\n", prescale); in max6650_init_client() 422 dev_info(dev, "Fan voltage: %dV, prescaler: %d.\n", in max6650_init_client()
|
| /OK3568_Linux_fs/u-boot/arch/arm/mach-zynq/ |
| H A D | timer.c | 50 #define SCUTIMER_CONTROL_PRESCALER_MASK 0x0000FF00 /* Prescaler */ 89 * Enable Auto reload mode, Clear prescaler control bits in timer_init() 90 * Set prescaler value, Enable the decrementer in timer_init()
|