| /linux/drivers/clk/qcom/ |
| H A D | clk-spmi-pmic-div.c | 25 struct clkdiv { struct 34 static inline struct clkdiv *to_clkdiv(struct clk_hw *hw) in to_clkdiv() argument 36 return container_of(hw, struct clkdiv, hw); in to_clkdiv() 52 static bool is_spmi_pmic_clkdiv_enabled(struct clkdiv *clkdiv) in is_spmi_pmic_clkdiv_enabled() argument 56 regmap_read(clkdiv->regmap, clkdiv->base + REG_EN_CTL, &val); in is_spmi_pmic_clkdiv_enabled() 62 __spmi_pmic_clkdiv_set_enable_state(struct clkdiv *clkdiv, bool enable, in __spmi_pmic_clkdiv_set_enable_state() argument 66 unsigned int ns = clkdiv->cxo_period_ns; in __spmi_pmic_clkdiv_set_enable_state() 69 ret = regmap_update_bits(clkdiv->regmap, clkdiv->base + REG_EN_CTL, in __spmi_pmic_clkdiv_set_enable_state() 82 static int spmi_pmic_clkdiv_set_enable_state(struct clkdiv *clkdiv, bool enable) in spmi_pmic_clkdiv_set_enable_state() argument 86 regmap_read(clkdiv->regmap, clkdiv->base + REG_DIV_CTL1, &div_factor); in spmi_pmic_clkdiv_set_enable_state() [all …]
|
| /linux/drivers/pwm/ |
| H A D | pwm-mediatek.c | 150 u32 clkdiv, enable; in pwm_mediatek_round_waveform_tohw() local 187 clkdiv = FIELD_MAX(PWMCON_CLKDIV); in pwm_mediatek_round_waveform_tohw() 190 clkdiv = ilog2(cnt_period) - ilog2(FIELD_MAX(PWMDWIDTH_PERIOD)); in pwm_mediatek_round_waveform_tohw() 191 cnt_period >>= clkdiv; in pwm_mediatek_round_waveform_tohw() 194 clkdiv = 0; in pwm_mediatek_round_waveform_tohw() 197 cnt_duty = mul_u64_u64_div_u64(wf->duty_length_ns, clk_rate, NSEC_PER_SEC) >> clkdiv; in pwm_mediatek_round_waveform_tohw() 212 enable, clkdiv, cnt_period, cnt_duty); in pwm_mediatek_round_waveform_tohw() 216 .con = clkdiv, in pwm_mediatek_round_waveform_tohw() 229 u32 clkdiv, cnt_period, cnt_duty; in pwm_mediatek_round_waveform_fromhw() local 239 clkdiv = FIELD_GET(PWMCON_CLKDIV, wfhw->con); in pwm_mediatek_round_waveform_fromhw() [all …]
|
| /linux/drivers/spi/ |
| H A D | spi-cavium.h | 46 uint64_t clkdiv:13; member 78 uint64_t clkdiv:13; 85 uint64_t clkdiv:13; member 111 uint64_t clkdiv:13; 118 uint64_t clkdiv:13; member 142 uint64_t clkdiv:13; 150 uint64_t clkdiv:13; member 180 uint64_t clkdiv:13; 187 uint64_t clkdiv:13; member 217 uint64_t clkdiv:13;
|
| H A D | spi-cavium.c | 36 unsigned int clkdiv; in octeon_spi_do_transfer() local 48 clkdiv = p->sys_freq / (2 * xfer->speed_hz); in octeon_spi_do_transfer() 52 mpi_cfg.s.clkdiv = clkdiv; in octeon_spi_do_transfer()
|
| H A D | spi-pci1xxxx.c | 139 u8 clkdiv; member 451 u8 clkdiv, u32 len) in pci1xxxx_spi_setup() argument 463 regval |= FIELD_PREP(SPI_MST_CTL_SPEED_MASK, clkdiv); in pci1xxxx_spi_setup() 489 u8 clkdiv; in pci1xxxx_spi_transfer_with_io() local 493 clkdiv = pci1xxxx_get_clock_div(par, xfer->speed_hz); in pci1xxxx_spi_transfer_with_io() 517 pci1xxxx_spi_setup(par, p->hw_inst, spi->mode, clkdiv, len); in pci1xxxx_spi_transfer_with_io() 562 p->clkdiv = pci1xxxx_get_clock_div(par, xfer->speed_hz); in pci1xxxx_spi_transfer_with_dma() 570 pci1xxxx_spi_setup(par, p->hw_inst, p->mode, p->clkdiv, p->tx_sgl_len); in pci1xxxx_spi_transfer_with_dma() 675 p->hw_inst, p->mode, p->clkdiv, p->tx_sgl_len); in pci1xxxx_spi_setup_next_dma_to_io_transfer()
|
| /linux/drivers/hwtracing/intel_th/ |
| H A D | pti.c | 27 unsigned int clkdiv; member 113 return scnprintf(buf, PAGE_SIZE, "%d\n", 1u << pti->clkdiv); in clock_divider_show() 131 pti->clkdiv = val; in clock_divider_store() 159 ctl |= pti->clkdiv << __ffs(PTI_CLKDIV); in intel_th_pti_activate() 183 pti->clkdiv = (ctl & PTI_CLKDIV) >> __ffs(PTI_CLKDIV); in read_hw_config() 188 if (!pti->clkdiv) in read_hw_config() 189 pti->clkdiv = 1; in read_hw_config()
|
| /linux/drivers/w1/masters/ |
| H A D | mxc_w1.c | 95 unsigned int clkdiv; in mxc_w1_probe() local 116 clkdiv = DIV_ROUND_CLOSEST(clkrate, 1000000); in mxc_w1_probe() 117 clkrate /= clkdiv; in mxc_w1_probe() 132 writeb(clkdiv - 1, mdev->regs + MXC_W1_TIME_DIVIDER); in mxc_w1_probe()
|
| /linux/arch/arm/boot/dts/renesas/ |
| H A D | emev2.dtsi | 72 compatible = "renesas,emev2-smu-clkdiv"; 84 compatible = "renesas,emev2-smu-clkdiv"; 103 compatible = "renesas,emev2-smu-clkdiv"; 109 compatible = "renesas,emev2-smu-clkdiv"; 115 compatible = "renesas,emev2-smu-clkdiv"; 121 compatible = "renesas,emev2-smu-clkdiv";
|
| /linux/sound/soc/adi/ |
| H A D | axi-spdif.c | 80 unsigned int clkdiv, stat; in axi_spdif_hw_params() local 97 clkdiv = DIV_ROUND_CLOSEST(clk_get_rate(spdif->clk_ref), in axi_spdif_hw_params() 99 clkdiv <<= AXI_SPDIF_CTRL_CLKDIV_OFFSET; in axi_spdif_hw_params() 103 AXI_SPDIF_CTRL_CLKDIV_MASK, clkdiv); in axi_spdif_hw_params()
|
| /linux/sound/soc/codecs/ |
| H A D | adau1701.c | 299 static int adau1701_reset(struct snd_soc_component *component, unsigned int clkdiv, in adau1701_reset() argument 308 if (clkdiv != ADAU1707_CLKDIV_UNSET && adau1701->gpio_pll_mode) { in adau1701_reset() 309 switch (clkdiv) { in adau1701_reset() 331 adau1701->pll_clkdiv = clkdiv; in adau1701_reset() 346 if (clkdiv != ADAU1707_CLKDIV_UNSET) { in adau1701_reset() 438 unsigned int clkdiv = adau1701->sysclk / params_rate(params); in adau1701_hw_params() local 447 if (clkdiv != adau1701->pll_clkdiv) { in adau1701_hw_params() 448 ret = adau1701_reset(component, clkdiv, params_rate(params)); in adau1701_hw_params()
|
| /linux/drivers/iio/adc/ |
| H A D | lpc18xx_adc.c | 133 unsigned int clkdiv; in lpc18xx_adc_probe() local 176 clkdiv = DIV_ROUND_UP(rate, LPC18XX_ADC_CLK_TARGET); in lpc18xx_adc_probe() 178 adc->cr_reg = (clkdiv << LPC18XX_ADC_CR_CLKDIV_SHIFT) | in lpc18xx_adc_probe()
|
| /linux/drivers/gpu/drm/exynos/ |
| H A D | exynos7_drm_decon.c | 196 u32 clkdiv; in decon_calc_clkdiv() local 199 clkdiv = DIV_ROUND_UP(clk_get_rate(ctx->vclk), ideal_clk); in decon_calc_clkdiv() 201 return (clkdiv < 0x100) ? clkdiv : 0xff; in decon_calc_clkdiv() 208 u32 val, clkdiv; in decon_commit() local 254 clkdiv = decon_calc_clkdiv(ctx, mode); in decon_commit() 255 if (clkdiv > 1) { in decon_commit() 256 val = VCLKCON1_CLKVAL_NUM_VCLK(clkdiv - 1); in decon_commit()
|
| H A D | exynos_drm_fimd.c | 196 u32 clkdiv; member 422 u32 clkdiv; in fimd_atomic_check() local 448 clkdiv = DIV_ROUND_CLOSEST(lcd_rate, ideal_clk); in fimd_atomic_check() 449 if (clkdiv >= 0x200) { in fimd_atomic_check() 455 ctx->clkdiv = (clkdiv < 0x100) ? clkdiv : 0xff; in fimd_atomic_check() 590 if (ctx->clkdiv > 1) in fimd_commit() 591 val |= VIDCON0_CLKVAL_F(ctx->clkdiv - 1) | VIDCON0_CLKDIR; in fimd_commit()
|
| /linux/drivers/gpu/drm/tilcdc/ |
| H A D | tilcdc_crtc.c | 208 unsigned int clkdiv; in tilcdc_crtc_set_clk() local 211 clkdiv = 2; /* first try using a standard divider of 2 */ in tilcdc_crtc_set_clk() 216 ret = clk_set_rate(priv->clk, pclk_rate * clkdiv); in tilcdc_crtc_set_clk() 218 real_pclk_rate = clk_rate / clkdiv; in tilcdc_crtc_set_clk() 234 clkdiv = DIV_ROUND_CLOSEST(clk_rate, pclk_rate); in tilcdc_crtc_set_clk() 243 real_pclk_rate = clk_rate / clkdiv; in tilcdc_crtc_set_clk() 255 tilcdc_crtc->lcd_fck_rate, crtc->mode.clock, clkdiv); in tilcdc_crtc_set_clk() 258 tilcdc_write(dev, LCDC_CTRL_REG, LCDC_CLK_DIVISOR(clkdiv) | in tilcdc_crtc_set_clk()
|
| /linux/drivers/mmc/host/ |
| H A D | sunplus-mmc.c | 233 unsigned int clkdiv; in spmmc_set_bus_clk() local 243 clkdiv = (clk_get_rate(host->clk) + clk) / clk - 1; in spmmc_set_bus_clk() 244 if (clkdiv > 0xfff) in spmmc_set_bus_clk() 245 clkdiv = 0xfff; in spmmc_set_bus_clk() 247 value |= FIELD_PREP(SPMMC_CLOCK_DIVISION, clkdiv); in spmmc_set_bus_clk() 254 int clkdiv = FIELD_GET(SPMMC_CLOCK_DIVISION, readl(host->base + SPMMC_SD_CONFIG0_REG)); in spmmc_set_bus_timing() local 255 int delay = clkdiv / 2 < 7 ? clkdiv / 2 : 7; in spmmc_set_bus_timing()
|
| H A D | sh_mmcif.c | 485 unsigned int clkdiv; in sh_mmcif_clock_control() local 497 clkdiv = 0; in sh_mmcif_clock_control() 516 clkdiv = i; in sh_mmcif_clock_control() 522 (best_freq >> (clkdiv + 1)), clk, best_freq, clkdiv); in sh_mmcif_clock_control() 525 clkdiv = clkdiv << 16; in sh_mmcif_clock_control() 527 clkdiv = CLK_SUP_PCLK; in sh_mmcif_clock_control() 529 clkdiv = (fls(DIV_ROUND_UP(current_clk, clk) - 1) - 1) << 16; in sh_mmcif_clock_control() 532 sh_mmcif_bitset(host, MMCIF_CE_CLK_CTRL, CLK_CLEAR & clkdiv); in sh_mmcif_clock_control()
|
| H A D | atmel-mci.c | 1428 int clkdiv; in atmci_set_ios() local 1451 clkdiv = DIV_ROUND_UP(host->bus_hz, clock_min) - 2; in atmci_set_ios() 1452 if (clkdiv < 0) { in atmci_set_ios() 1456 clkdiv = 0; in atmci_set_ios() 1457 } else if (clkdiv > 511) { in atmci_set_ios() 1461 clkdiv = 511; in atmci_set_ios() 1463 host->mode_reg = ATMCI_MR_CLKDIV(clkdiv >> 1) in atmci_set_ios() 1464 | ATMCI_MR_CLKODD(clkdiv & 1); in atmci_set_ios() 1466 clkdiv = DIV_ROUND_UP(host->bus_hz, 2 * clock_min) - 1; in atmci_set_ios() 1467 if (clkdiv > 255) { in atmci_set_ios() [all …]
|
| H A D | sdhci-omap.c | 701 unsigned long clkdiv; in sdhci_omap_set_clock() local 708 clkdiv = sdhci_omap_calc_divisor(pltfm_host, clock); in sdhci_omap_set_clock() 709 clkdiv = (clkdiv & SYSCTL_CLKD_MASK) << SYSCTL_CLKD_SHIFT; in sdhci_omap_set_clock() 710 sdhci_enable_clk(host, clkdiv); in sdhci_omap_set_clock()
|
| /linux/arch/powerpc/platforms/52xx/ |
| H A D | mpc52xx_common.c | 172 int mpc52xx_set_psc_clkdiv(int psc_id, int clkdiv) in mpc52xx_set_psc_clkdiv() argument 183 mclken_div = 0x8000 | (clkdiv & 0x1FF); in mpc52xx_set_psc_clkdiv()
|
| /linux/drivers/media/dvb-frontends/ |
| H A D | stv6111.c | 366 u32 clkdiv = 0; in init_state() local 386 if (clkdiv <= 3) in init_state() 387 state->reg[0x00] |= (clkdiv & 0x03); in init_state()
|
| H A D | cx24120.c | 123 u8 clkdiv; member 1116 state->dnxt.clkdiv = (-(rate < 31000001) & 3) + 2; in cx24120_set_symbolrate() 1119 state->dnxt.clkdiv = 3; in cx24120_set_symbolrate() 1191 state->dcur.clkdiv, state->dcur.ratediv); in cx24120_set_frontend() 1218 cmd.arg[13] = state->dcur.clkdiv; in cx24120_set_frontend() 1227 ret = cx24120_writereg(state, CX24120_REG_CLKDIV, state->dcur.clkdiv); in cx24120_set_frontend()
|
| /linux/drivers/gpu/drm/bridge/ |
| H A D | tc358775.c | 380 u16 dsiclk, clkdiv, byteclk, t1, t2, t3, vsdelay; in tc_bridge_atomic_enable() local 440 clkdiv = dsiclk / (tc->lvds_link == DUAL_LINK ? DIVIDE_BY_6 : DIVIDE_BY_3); in tc_bridge_atomic_enable() 443 t2 = ((100000 / clkdiv)) * (hactive + hback_porch + hsync_len + hfront_porch) / 1000; in tc_bridge_atomic_enable() 447 vsdelay = (clkdiv * (t1 + t3) / byteclk) - hback_porch - hsync_len - hactive; in tc_bridge_atomic_enable()
|
| /linux/drivers/i2c/busses/ |
| H A D | i2c-ibm_iic.h | 33 u8 clkdiv; member
|
| /linux/drivers/hwmon/ |
| H A D | ltc4282.c | 192 u32 clkdiv; in ltc4282_recalc_rate() local 195 ret = regmap_read(st->map, LTC4282_CLK_DIV, &clkdiv); in ltc4282_recalc_rate() 199 clkdiv = FIELD_GET(LTC4282_CLKOUT_MASK, clkdiv); in ltc4282_recalc_rate() 200 if (!clkdiv) in ltc4282_recalc_rate() 202 if (clkdiv == LTC4282_CLKOUT_INT) in ltc4282_recalc_rate()
|
| /linux/drivers/net/ethernet/ |
| H A D | ethoc.c | 1184 u32 clkdiv = MIIMODER_CLKDIV(eth_clkfreq / 2500000 + 1); in ethoc_probe() local 1186 if (!clkdiv) in ethoc_probe() 1187 clkdiv = 2; in ethoc_probe() 1188 dev_dbg(&pdev->dev, "setting MII clkdiv to %u\n", clkdiv); in ethoc_probe() 1191 clkdiv); in ethoc_probe()
|