/linux/drivers/clk/ |
H A D | clk-loongson2.c | 59 #define CLK_DIV(_id, _name, _pname, _offset, _dshift, _dwidth) \ macro 121 CLK_DIV(LOONGSON2_NODE_CLK, "clk_node", "pll_node", 0, 24, 6), 122 CLK_DIV(LOONGSON2_DDR_CLK, "clk_ddr", "pll_ddr", 0x8, 24, 6), 123 CLK_DIV(LOONGSON2_HDA_CLK, "clk_hda", "pll_ddr", 0xc, 8, 6), 124 CLK_DIV(LOONGSON2_GPU_CLK, "clk_gpu", "pll_soc", 0x10, 24, 6), 125 CLK_DIV(LOONGSON2_DC_CLK, "clk_sb", "pll_soc", 0x14, 0, 6), 126 CLK_DIV(LOONGSON2_GMAC_CLK, "clk_gmac", "pll_soc", 0x14, 8, 6), 127 CLK_DIV(LOONGSON2_PIX0_CLK, "clk_pix0", "pll_pix0", 0x18, 24, 6), 128 CLK_DIV(LOONGSON2_PIX1_CLK, "clk_pix1", "pll_pix1", 0x20, 24, 6), 142 CLK_DIV(LOONGSON2_NODE_CLK, "clk_node", "pll_node", 0x8, 0, 6), [all …]
|
H A D | clk-versaclock3.c | 587 static struct vc3_hw_data clk_div[5]; variable 591 { .hw = &clk_div[VC3_DIV2].hw } 791 static struct vc3_hw_data clk_div[] = { variable 894 &clk_div[VC3_DIV5].hw, 895 &clk_div[VC3_DIV4].hw 910 &clk_div[VC3_DIV5].hw, 911 &clk_div[VC3_DIV4].hw 926 &clk_div[VC3_DIV2].hw, 927 &clk_div[VC3_DIV4].hw 942 &clk_div[VC3_DIV1].hw, [all …]
|
H A D | clk-bm1880.c | 183 #define CLK_DIV(_id, _name, _parent, _reg, _shift, _width, _initval, \ macro 372 CLK_DIV(BM1880_CLK_DIV_0_RV, "clk_div_0_rv", &bm1880_pll_clks[1].hw, 374 CLK_DIV(BM1880_CLK_DIV_1_RV, "clk_div_1_rv", &bm1880_pll_clks[2].hw, 376 CLK_DIV(BM1880_CLK_DIV_UART_500M, "clk_div_uart_500m", &bm1880_pll_clks[2].hw, 378 CLK_DIV(BM1880_CLK_DIV_0_AXI1, "clk_div_0_axi1", &bm1880_pll_clks[0].hw, 381 CLK_DIV(BM1880_CLK_DIV_1_AXI1, "clk_div_1_axi1", &bm1880_pll_clks[2].hw, 384 CLK_DIV(BM1880_CLK_DIV_0_AXI6, "clk_div_0_axi6", &bm1880_pll_clks[2].hw, 387 CLK_DIV(BM1880_CLK_DIV_1_AXI6, "clk_div_1_axi6", &bm1880_pll_clks[0].hw, 390 CLK_DIV(BM1880_CLK_DIV_12M_USB, "clk_div_12m_usb", &bm1880_pll_clks[2].hw,
|
/linux/drivers/pwm/ |
H A D | pwm-mtk-disp.c | 73 u32 clk_div, period, high_width, value; in mtk_disp_pwm_apply() local 108 * Find period, high_width and clk_div to suit duty_ns and period_ns. in mtk_disp_pwm_apply() 111 * period_ns = 10^9 * (clk_div + 1) * (period + 1) / PWM_CLK_RATE in mtk_disp_pwm_apply() 112 * duty_ns = 10^9 * (clk_div + 1) * high_width / PWM_CLK_RATE in mtk_disp_pwm_apply() 114 * period = (PWM_CLK_RATE * period_ns) / (10^9 * (clk_div + 1)) - 1 in mtk_disp_pwm_apply() 115 * high_width = (PWM_CLK_RATE * duty_ns) / (10^9 * (clk_div + 1)) in mtk_disp_pwm_apply() 118 clk_div = mul_u64_u64_div_u64(state->period, rate, NSEC_PER_SEC) >> in mtk_disp_pwm_apply() 120 if (clk_div > PWM_CLKDIV_MAX) { in mtk_disp_pwm_apply() 128 div = NSEC_PER_SEC * (clk_div + 1); in mtk_disp_pwm_apply() 151 clk_div << PWM_CLKDIV_SHIFT); in mtk_disp_pwm_apply() [all …]
|
H A D | pwm-crc.c | 42 int clk_div; in crc_pwm_calc_clk_div() local 44 clk_div = PWM_BASE_CLK_MHZ * period_ns / (256 * NSEC_PER_USEC); in crc_pwm_calc_clk_div() 45 /* clk_div 1 - 128, maps to register values 0-127 */ in crc_pwm_calc_clk_div() 46 if (clk_div > 0) in crc_pwm_calc_clk_div() 47 clk_div--; in crc_pwm_calc_clk_div() 49 return clk_div; in crc_pwm_calc_clk_div() 100 int clk_div = crc_pwm_calc_clk_div(state->period); in crc_pwm_apply() local 104 clk_div | pwm_output_enable); in crc_pwm_apply() 127 unsigned int clk_div, clk_div_reg, duty_cycle_reg; in crc_pwm_get_state() local 142 clk_div = (clk_div_reg & ~PWM_OUTPUT_ENABLE) + 1; in crc_pwm_get_state() [all …]
|
/linux/drivers/clk/mxs/ |
H A D | clk-div.c | 12 * struct clk_div - mxs integer divider clock 21 struct clk_div { struct 28 static inline struct clk_div *to_clk_div(struct clk_hw *hw) in to_clk_div() argument 32 return container_of(divider, struct clk_div, divider); in to_clk_div() 38 struct clk_div *div = to_clk_div(hw); in clk_div_recalc_rate() 46 struct clk_div *div = to_clk_div(hw); in clk_div_round_rate() 54 struct clk_div *div = to_clk_div(hw); in clk_div_set_rate() 73 struct clk_div *div; in mxs_clk_div()
|
/linux/drivers/net/ethernet/xilinx/ |
H A D | xilinx_axienet_mdio.c | 179 u32 clk_div; in axienet_mdio_enable() local 215 /* clk_div can be calculated by deriving it from the equation: in axienet_mdio_enable() 216 * fMDIO = fHOST / ((1 + clk_div) * 2) in axienet_mdio_enable() 219 * fHOST / ((1 + clk_div) * 2) <= 2500000 in axienet_mdio_enable() 222 * 1 / ((1 + clk_div) * 2) <= (2500000 / fHOST) in axienet_mdio_enable() 225 * 1 / (1 + clk_div) <= ((2500000 * 2) / fHOST) in axienet_mdio_enable() 228 * 1 / (1 + clk_div) <= (5000000 / fHOST) in axienet_mdio_enable() 231 * (1 + clk_div) >= (fHOST / 5000000) in axienet_mdio_enable() 234 * clk_div >= (fHOST / 5000000) - 1 in axienet_mdio_enable() 240 clk_div = (host_clock / (mdio_freq * 2)) - 1; in axienet_mdio_enable() [all …]
|
H A D | ll_temac_mdio.c | 70 int clk_div; in temac_mdio_setup() local 82 clk_div = 0x3f; /* worst-case default setting */ in temac_mdio_setup() 84 clk_div = bus_hz / (2500 * 1000 * 2) - 1; in temac_mdio_setup() 85 if (clk_div < 1) in temac_mdio_setup() 86 clk_div = 1; in temac_mdio_setup() 87 if (clk_div > 0x3f) in temac_mdio_setup() 88 clk_div = 0x3f; in temac_mdio_setup() 94 temac_indirect_out32(lp, XTE_MC_OFFSET, 1 << 6 | clk_div); in temac_mdio_setup()
|
/linux/drivers/mfd/ |
H A D | fsl-imx25-tsadc.c | 103 unsigned clk_div; in mx25_tsadc_setup_clk() local 115 clk_div = DIV_ROUND_UP(clk_get_rate(tsadc->clk), 1750000); in mx25_tsadc_setup_clk() 116 dev_dbg(&pdev->dev, "Setting up ADC clock divider to %u\n", clk_div); in mx25_tsadc_setup_clk() 119 clk_div -= 2; in mx25_tsadc_setup_clk() 120 clk_div /= 2; in mx25_tsadc_setup_clk() 126 clk_div = max_t(unsigned, 4, clk_div); in mx25_tsadc_setup_clk() 129 clk_get_rate(tsadc->clk) / (2 * clk_div + 2)); in mx25_tsadc_setup_clk() 133 MX25_TGCR_ADCCLKCFG(clk_div)); in mx25_tsadc_setup_clk()
|
/linux/arch/mips/ath25/ |
H A D | ar2315.c | 208 unsigned int clk_div; in ar2315_sys_clk() local 221 clk_div = ATH25_REG_MS(pllc_ctrl, AR2315_PLLC_CLKM_DIV); in ar2315_sys_clk() 222 clk_div = pllc_divide_table[clk_div]; in ar2315_sys_clk() 225 clk_div = ATH25_REG_MS(pllc_ctrl, AR2315_PLLC_CLKC_DIV); in ar2315_sys_clk() 226 clk_div = pllc_divide_table[clk_div]; in ar2315_sys_clk() 230 clk_div = 1; in ar2315_sys_clk() 237 return pllc_out / (clk_div * cpu_div); in ar2315_sys_clk()
|
/linux/sound/soc/ti/ |
H A D | davinci-i2s.c | 159 int clk_div; member 452 dev->clk_div = div; in davinci_i2s_dai_set_clkdiv() 463 unsigned int clk_div, freq, framesize; in davinci_i2s_hw_params() local 518 clk_div = 256; in davinci_i2s_hw_params() 520 framesize = (freq / (--clk_div)) / in davinci_i2s_hw_params() 524 (clk_div)); in davinci_i2s_hw_params() 525 clk_div--; in davinci_i2s_hw_params() 529 clk_div = freq / (mcbsp_word_length * 16) / in davinci_i2s_hw_params() 534 clk_div &= 0xFF; in davinci_i2s_hw_params() 535 srgr |= clk_div; in davinci_i2s_hw_params() [all …]
|
/linux/include/linux/dma/ |
H A D | qcom-gpi-dma.h | 26 * @clk_div: source clock divider 43 u32 clk_div; member 61 * @clk_div: source clock divider 77 u16 clk_div; member
|
/linux/drivers/spi/ |
H A D | spi-hisi-kunpeng.c | 117 u16 clk_div; /* baud rate divider */ member 119 /* clk_div = (1 + div_post) * div_pre */ 280 if (chip->clk_div % chip->div_pre == 0) in __hisi_calc_div_reg() 286 if (chip->div_pre > chip->clk_div) in __hisi_calc_div_reg() 287 chip->div_pre = chip->clk_div; in __hisi_calc_div_reg() 289 chip->div_post = (chip->clk_div / chip->div_pre) - 1; in __hisi_calc_div_reg() 298 chip->clk_div = DIV_ROUND_UP(host->max_speed_hz, speed_hz) + 1; in hisi_calc_effective_speed() 299 chip->clk_div &= 0xfffe; in hisi_calc_effective_speed() 300 if (chip->clk_div > CLK_DIV_MAX) in hisi_calc_effective_speed() 301 chip->clk_div = CLK_DIV_MAX; in hisi_calc_effective_speed() [all …]
|
H A D | spi-axi-spi-engine.c | 222 unsigned int clk_div, max_hz = msg->spi->controller->max_speed_hz; in spi_engine_precompile_message() local 226 clk_div = DIV_ROUND_UP(max_hz, xfer->speed_hz); in spi_engine_precompile_message() 227 xfer->effective_speed_hz = max_hz / min(clk_div, 256U); in spi_engine_precompile_message() 237 int clk_div, new_clk_div, inst_ns; in spi_engine_compile_message() local 247 clk_div = 1; in spi_engine_compile_message() 258 if (new_clk_div != clk_div) { in spi_engine_compile_message() 259 clk_div = new_clk_div; in spi_engine_compile_message() 263 clk_div - 1)); in spi_engine_compile_message() 304 if (clk_div != 1) in spi_engine_compile_message()
|
H A D | spi-s3c64xx.c | 148 * @clk_div: Internal clock divider 170 int clk_div; member 698 int div = sdd->port_conf->clk_div; in s3c64xx_spi_config() 1008 div = sdd->port_conf->clk_div; in s3c64xx_spi_setup() 1517 .clk_div = 2, 1527 .clk_div = 2, 1536 .clk_div = 2, 1546 .clk_div = 2, 1558 .clk_div = 2, 1570 .clk_div = 2, [all …]
|
/linux/drivers/i2c/busses/ |
H A D | i2c-sun6i-p2wi.c | 192 int clk_div; in p2wi_probe() local 286 clk_div = parent_clk_freq / clk_freq; in p2wi_probe() 287 if (!clk_div) { in p2wi_probe() 291 clk_div = 1; in p2wi_probe() 292 } else if (clk_div > P2WI_CCR_MAX_CLK_DIV) { in p2wi_probe() 296 clk_div = P2WI_CCR_MAX_CLK_DIV; in p2wi_probe() 299 writel(P2WI_CCR_SDA_OUT_DELAY(1) | P2WI_CCR_CLK_DIV(clk_div), in p2wi_probe()
|
H A D | i2c-mt7621.c | 65 u32 clk_div; member 96 iowrite32(((i2c->clk_div << 16) & SM0CTL0_CLK_DIV_MASK) | SM0CTL0_EN | in mtk_i2c_reset() 263 i2c->clk_div = clk_get_rate(i2c->clk) / i2c->bus_freq - 1; in mtk_i2c_init() 264 if (i2c->clk_div < 99) in mtk_i2c_init() 265 i2c->clk_div = 99; in mtk_i2c_init() 266 if (i2c->clk_div > SM0CTL0_CLK_DIV_MAX) in mtk_i2c_init() 267 i2c->clk_div = SM0CTL0_CLK_DIV_MAX; in mtk_i2c_init()
|
H A D | i2c-pasemi-platform.c | 32 data->smbus.clk_div = DIV_ROUND_UP(clk_rate, 16 * frequency); in pasemi_platform_i2c_calc_clk_div() 33 if (data->smbus.clk_div < 4) in pasemi_platform_i2c_calc_clk_div() 37 if (data->smbus.clk_div > 0xff) in pasemi_platform_i2c_calc_clk_div()
|
/linux/sound/soc/sti/ |
H A D | uniperif_player.c | 316 int clk_div; in uni_player_prepare_iec958() local 318 clk_div = player->mclk / runtime->rate; in uni_player_prepare_iec958() 321 if ((clk_div % 128) || (clk_div <= 0)) { in uni_player_prepare_iec958() 322 dev_err(player->dev, "%s: invalid clk_div %d\n", in uni_player_prepare_iec958() 323 __func__, clk_div); in uni_player_prepare_iec958() 398 SET_UNIPERIF_CTRL_DIVIDER(player, clk_div / 128); in uni_player_prepare_iec958() 419 int output_frame_size, slot_width, clk_div; in uni_player_prepare_pcm() local 430 clk_div = player->mclk / runtime->rate; in uni_player_prepare_pcm() 432 * For 32 bits subframe clk_div must be a multiple of 128, in uni_player_prepare_pcm() 435 if ((slot_width == 32) && (clk_div % 128)) { in uni_player_prepare_pcm() [all …]
|
/linux/drivers/bus/ |
H A D | sunxi-rsb.c | 655 int clk_div, ret; in sunxi_rsb_hw_init() local 682 clk_div = p_clk_freq / rsb->clk_freq / 2; in sunxi_rsb_hw_init() 683 if (!clk_div) in sunxi_rsb_hw_init() 684 clk_div = 1; in sunxi_rsb_hw_init() 685 else if (clk_div > RSB_CCR_MAX_CLK_DIV + 1) in sunxi_rsb_hw_init() 686 clk_div = RSB_CCR_MAX_CLK_DIV + 1; in sunxi_rsb_hw_init() 688 clk_delay = clk_div >> 1; in sunxi_rsb_hw_init() 692 dev_info(dev, "RSB running at %lu Hz\n", p_clk_freq / clk_div / 2); in sunxi_rsb_hw_init() 693 writel(RSB_CCR_SDA_OUT_DELAY(clk_delay) | RSB_CCR_CLK_DIV(clk_div - 1), in sunxi_rsb_hw_init()
|
/linux/sound/soc/codecs/ |
H A D | lpass-va-macro.c | 614 u8 clk_div; in va_dmic_clk_enable() local 652 clk_div = va->dmic_clk_div; in va_dmic_clk_enable() 661 clk_div << CDC_VA_DMIC_CLK_SEL_SHFT); in va_dmic_clk_enable() 666 if (*dmic_clk_div > clk_div) { in va_dmic_clk_enable() 673 clk_div << CDC_VA_DMIC_CLK_SEL_SHFT); in va_dmic_clk_enable() 679 clk_div = *dmic_clk_div; in va_dmic_clk_enable() 682 *dmic_clk_div = clk_div; in va_dmic_clk_enable() 688 clk_div = 0; in va_dmic_clk_enable() 691 clk_div << CDC_VA_DMIC_CLK_SEL_SHFT); in va_dmic_clk_enable() 693 clk_div = va->dmic_clk_div; in va_dmic_clk_enable() [all …]
|
/linux/drivers/leds/ |
H A D | leds-bcm6358.c | 153 u32 clk_div; in bcm6358_leds_probe() local 169 of_property_read_u32(np, "brcm,clk-div", &clk_div); in bcm6358_leds_probe() 170 switch (clk_div) { in bcm6358_leds_probe()
|
/linux/drivers/mmc/host/ |
H A D | tifm_sd.c | 98 unsigned int clk_div; member 595 ((1000000000UL / host->clk_freq) * host->clk_div); in tifm_sd_set_data_timeout() 827 host->clk_div = clk_div1; in tifm_sd_ios() 833 host->clk_div = clk_div2; in tifm_sd_ios() 839 host->clk_div = 0; in tifm_sd_ios() 841 host->clk_div &= TIFM_MMCSD_CLKMASK; in tifm_sd_ios() 842 writel(host->clk_div in tifm_sd_ios() 883 host->clk_div = 61; in tifm_sd_initialize_host() 886 writel(host->clk_div | TIFM_MMCSD_POWER, in tifm_sd_initialize_host() 905 writel(host->clk_div | TIFM_MMCSD_POWER, in tifm_sd_initialize_host()
|
/linux/drivers/video/fbdev/omap/ |
H A D | sossi.c | 60 int clk_div; member 124 int div = t->clk_div; in calc_rd_timings() 175 int div = t->clk_div; in calc_wr_timings() 258 _set_timing(sossi.clk_div, in set_timing() 317 int div = t->clk_div; in sossi_convert_timings() 348 sossi.clk_div = t->tim[4]; in sossi_set_timings()
|
/linux/drivers/media/dvb-frontends/ |
H A D | stv6110.c | 29 u8 clk_div; member 214 priv->regs[RSTV6110_CTRL2] |= (priv->clk_div << 6); in stv6110_init() 398 reg0[2] |= (config->clk_div << 6); in stv6110_attach() 418 priv->clk_div = config->clk_div; in stv6110_attach()
|