/linux/drivers/clk/meson/ |
A D | sclk-div.c | 33 return (1 << sclk->div.width) - 1; in sclk_div_maxval() 38 return sclk_div_maxval(sclk) + 1; in sclk_div_maxdiv() 61 maxdiv = sclk_div_maxdiv(sclk); in sclk_div_bestdiv() 115 sclk->cached_duty.num, in sclk_apply_ratio() 116 sclk->cached_duty.den); in sclk_apply_ratio() 132 sclk_apply_ratio(clk, sclk); in sclk_div_set_duty_cycle() 153 duty->den = sclk->cached_div; in sclk_div_get_duty_cycle() 161 sclk_apply_ratio(clk, sclk); in sclk_apply_divider() 163 meson_parm_write(clk->map, &sclk->div, sclk->cached_div - 1); in sclk_apply_divider() 229 sclk->cached_div = sclk_div_maxdiv(sclk); in sclk_div_init() [all …]
|
/linux/drivers/clk/hisilicon/ |
A D | clkgate-separated.c | 39 if (sclk->lock) in clkgate_separated_enable() 41 reg = BIT(sclk->bit_idx); in clkgate_separated_enable() 44 if (sclk->lock) in clkgate_separated_enable() 56 if (sclk->lock) in clkgate_separated_disable() 58 reg = BIT(sclk->bit_idx); in clkgate_separated_disable() 61 if (sclk->lock) in clkgate_separated_disable() 93 sclk = kzalloc(sizeof(*sclk), GFP_KERNEL); in hisi_register_clkgate_sep() 94 if (!sclk) in hisi_register_clkgate_sep() 106 sclk->hw.init = &init; in hisi_register_clkgate_sep() 107 sclk->lock = lock; in hisi_register_clkgate_sep() [all …]
|
/linux/drivers/clk/ralink/ |
A D | clk-mt7621.c | 138 .name = sclk->name, in mt7621_gate_ops_init() 141 sclk->hw.init = &init; in mt7621_gate_ops_init() 150 struct mt7621_gate *sclk; in mt7621_register_gates() local 155 sclk->priv = priv; in mt7621_register_gates() 162 hws[sclk->idx] = &sclk->hw; in mt7621_register_gates() 200 sclk->hw = clk_hw_register_fixed_rate(dev, sclk->name, in mt7621_register_fixed_clocks() 202 sclk->rate); in mt7621_register_fixed_clocks() 203 if (IS_ERR(sclk->hw)) { in mt7621_register_fixed_clocks() 209 hws[sclk->idx] = sclk->hw; in mt7621_register_fixed_clocks() 318 sclk->priv = priv; in mt7621_register_early_clocks() [all …]
|
/linux/drivers/clk/ |
A D | clk-scmi.c | 114 .name = sclk->info->name, in scmi_clk_ops_init() 117 sclk->hw.init = &init; in scmi_clk_ops_init() 122 if (sclk->info->rate_discrete) { in scmi_clk_ops_init() 172 struct scmi_clk *sclk; in scmi_clocks_probe() local 174 sclk = devm_kzalloc(dev, sizeof(*sclk), GFP_KERNEL); in scmi_clocks_probe() 175 if (!sclk) in scmi_clocks_probe() 179 if (!sclk->info) { in scmi_clocks_probe() 184 sclk->id = idx; in scmi_clocks_probe() 185 sclk->ph = ph; in scmi_clocks_probe() 190 devm_kfree(dev, sclk); in scmi_clocks_probe() [all …]
|
A D | clk-scpi.c | 150 sclk->hw.init = &init; in scpi_clk_ops_init() 154 sclk->info = sclk->scpi_ops->dvfs_get_info(sclk->id); in scpi_clk_ops_init() 155 if (IS_ERR(sclk->info)) in scpi_clk_ops_init() 158 if (sclk->scpi_ops->clk_get_range(sclk->id, &min, &max) || !max) in scpi_clk_ops_init() 178 struct scpi_clk *sclk; in scpi_of_clk_src_get() local 184 if (idx == sclk->id) in scpi_of_clk_src_get() 185 return &sclk->hw; in scpi_of_clk_src_get() 214 struct scpi_clk *sclk; in scpi_clk_add() local 218 sclk = devm_kzalloc(dev, sizeof(*sclk), GFP_KERNEL); in scpi_clk_add() 219 if (!sclk) in scpi_clk_add() [all …]
|
A D | clk-nomadik.c | 331 return !!(val & sclk->clkbit); in src_clk_is_enabled() 353 struct clk_src *sclk; in src_clk_register() local 356 sclk = kzalloc(sizeof(*sclk), GFP_KERNEL); in src_clk_register() 357 if (!sclk) in src_clk_register() 369 sclk->hw.init = &init; in src_clk_register() 370 sclk->id = id; in src_clk_register() 371 sclk->group1 = (id > 31); in src_clk_register() 372 sclk->clkbit = BIT(id & 0x1f); in src_clk_register() 375 name, id, sclk->group1, sclk->clkbit); in src_clk_register() 379 kfree(sclk); in src_clk_register() [all …]
|
/linux/drivers/clk/microchip/ |
A D | clk-core.c | 802 v = readl(sclk->slew_reg); in sclk_set_rate() 808 writel(v, sclk->slew_reg); in sclk_set_rate() 826 if (!sclk->parent_map) in sclk_get_parent() 845 nosc = sclk->parent_map ? sclk->parent_map[index] : index; in sclk_set_parent() 848 v = readl(sclk->mux_reg); in sclk_set_parent() 854 writel(v, sclk->mux_reg); in sclk_set_parent() 895 if (sclk->slew_div) { in sclk_init() 897 v = readl(sclk->slew_reg); in sclk_init() 933 sclk = devm_kzalloc(core->dev, sizeof(*sclk), GFP_KERNEL); in pic32_sys_clk_register() 934 if (!sclk) in pic32_sys_clk_register() [all …]
|
/linux/drivers/gpu/drm/nouveau/nvkm/subdev/clk/ |
A D | gk104.c | 68 u32 sclk; in read_pll() local 77 sclk = device->crystal; in read_pll() 101 sclk = (sclk * N) + (((u16)(fN + 4096) * sclk) >> 13); in read_pll() 102 return sclk / (M * P); in read_pll() 123 return (sclk * 2) / sdiv; in read_div() 149 u32 sclk, sdiv; in read_clk() local 182 return (sclk * 2) / sdiv; in read_clk() 185 return sclk; in read_clk() 236 u32 sclk; in calc_src() local 258 sclk = calc_div(clk, idx, sclk, freq, ddiv); in calc_src() [all …]
|
A D | gf100.c | 67 u32 sclk; in read_pll() local 75 sclk = device->crystal; in read_pll() 94 return sclk * N / M / P; in read_pll() 102 u32 sclk, sctl, sdiv = 2; in read_div() local 126 return (sclk * 2) / sdiv; in read_div() 138 u32 sclk, sdiv; in read_clk() local 152 return (sclk * 2) / sdiv; in read_clk() 154 return sclk; in read_clk() 223 u32 sclk; in calc_src() local 245 sclk = calc_div(clk, idx, sclk, freq, ddiv); in calc_src() [all …]
|
A D | gt215.c | 64 u32 sctl, sdiv, sclk; in read_clk() local 99 sclk = read_vco(clk, idx); in read_clk() 101 return (sclk * 2) / sdiv; in read_clk() 112 u32 sclk = 0, P = 1, N = 1, M = 1; in read_pll() local 131 sclk = read_clk(clk, 0x10 + idx, false); in read_pll() 139 return sclk * N / MP; in read_pll() 191 u32 oclk, sclk, sdiv; in gt215_clk_info() local 207 sclk = read_vco(clk, idx); in gt215_clk_info() 208 sdiv = min((sclk * 2) / khz, (u32)65); in gt215_clk_info() 209 oclk = (sclk * 2) / sdiv; in gt215_clk_info() [all …]
|
/linux/drivers/gpu/drm/radeon/ |
A D | rv730_dpm.c | 39 RV770_SMC_SCLK_VALUE *sclk) in rv730_populate_sclk_value() argument 106 sclk->sclk_value = cpu_to_be32(engine_clock); in rv730_populate_sclk_value() 107 sclk->vCG_SPLL_FUNC_CNTL = cpu_to_be32(spll_func_cntl); in rv730_populate_sclk_value() 108 sclk->vCG_SPLL_FUNC_CNTL_2 = cpu_to_be32(spll_func_cntl_2); in rv730_populate_sclk_value() 306 table->ACPIState.levels[0].sclk.sclk_value = 0; in rv730_populate_smc_acpi_state() 342 table->initialState.levels[0].sclk.vCG_SPLL_FUNC_CNTL = in rv730_populate_smc_initial_state() 353 table->initialState.levels[0].sclk.sclk_value = in rv730_populate_smc_initial_state() 354 cpu_to_be32(initial_state->low.sclk); in rv730_populate_smc_initial_state() 413 state->high.sclk, in rv730_program_memory_timing_parameters() 423 state->medium.sclk, in rv730_program_memory_timing_parameters() [all …]
|
A D | btc_dpm.c | 2117 ps->high.sclk = max_limits->sclk; in btc_apply_state_adjust_rules() 2126 ps->medium.sclk = max_limits->sclk; in btc_apply_state_adjust_rules() 2134 if (ps->low.sclk > max_limits->sclk) in btc_apply_state_adjust_rules() 2135 ps->low.sclk = max_limits->sclk; in btc_apply_state_adjust_rules() 2145 sclk = ps->low.sclk; in btc_apply_state_adjust_rules() 2150 sclk = ps->low.sclk; in btc_apply_state_adjust_rules() 2157 ps->low.sclk = sclk; in btc_apply_state_adjust_rules() 2166 if (ps->medium.sclk < ps->low.sclk) in btc_apply_state_adjust_rules() 2167 ps->medium.sclk = ps->low.sclk; in btc_apply_state_adjust_rules() 2170 if (ps->high.sclk < ps->medium.sclk) in btc_apply_state_adjust_rules() [all …]
|
A D | rv770_dpm.c | 281 a_n = (int)state->high.sclk * pi->lhp + (int)state->medium.sclk * in rv770_populate_smc_t() 631 &level->sclk); in rv770_convert_power_level_to_smc() 634 &level->sclk); in rv770_convert_power_level_to_smc() 637 &level->sclk); in rv770_convert_power_level_to_smc() 749 if (state->high.sclk < (state->low.sclk * 0xFF / 0x40)) in rv770_program_memory_timing_parameters() 1444 if (new_state->high.sclk >= current_state->high.sclk) in rv770_set_uvd_clock_before_set_eng_clock() 1461 if (new_state->high.sclk < current_state->high.sclk) in rv770_set_uvd_clock_after_set_eng_clock() 2182 u32 sclk, mclk; in rv7xx_parse_pplib_clock_info() local 2218 pl->sclk = sclk; in rv7xx_parse_pplib_clock_info() 2261 rdev->pm.dpm.dyn_state.max_clock_voltage_on_ac.sclk = pl->sclk; in rv7xx_parse_pplib_clock_info() [all …]
|
A D | trinity_dpm.c | 1292 if (sclk < 20000) in trinity_calculate_vce_wm() 1322 if (sclk < min) in trinity_get_sleep_divider_id_from_clock() 1523 ps->levels[i].sclk = in trinity_apply_state_adjust_rules() 1529 if (ps->levels[i].sclk < rdev->pm.dpm.vce_states[rdev->pm.dpm.vce_level].sclk) in trinity_apply_state_adjust_rules() 1530 ps->levels[i].sclk = rdev->pm.dpm.vce_states[rdev->pm.dpm.vce_level].sclk; in trinity_apply_state_adjust_rules() 1670 u32 sclk; in trinity_parse_pplib_clock_info() local 1674 pl->sclk = sclk; in trinity_parse_pplib_clock_info() 1762 u32 sclk; in trinity_parse_power_table() local 1768 rdev->pm.dpm.vce_states[i].sclk = sclk; in trinity_parse_power_table() 1979 i, pl->sclk, in trinity_dpm_print_power_state() [all …]
|
A D | kv_dpm.c | 1771 table->sclk = in kv_construct_max_power_limits_table() 1886 if (sclk < min) in kv_get_sleep_divider_id_from_clock() 1986 if (ps->levels[i].sclk < sclk) in kv_apply_state_adjust_rules() 1987 ps->levels[i].sclk = sclk; in kv_apply_state_adjust_rules() 2414 u32 sclk; in kv_parse_pplib_clock_info() local 2418 pl->sclk = sclk; in kv_parse_pplib_clock_info() 2506 u32 sclk; in kv_parse_power_table() local 2512 rdev->pm.dpm.vce_states[i].sclk = sclk; in kv_parse_power_table() 2605 u32 sclk, tmp; in kv_dpm_debugfs_print_current_performance_level() local 2628 u32 sclk; in kv_dpm_get_current_sclk() local [all …]
|
A D | rv740_dpm.c | 120 RV770_SMC_SCLK_VALUE *sclk) in rv740_populate_sclk_value() argument 175 sclk->sclk_value = cpu_to_be32(engine_clock); in rv740_populate_sclk_value() 176 sclk->vCG_SPLL_FUNC_CNTL = cpu_to_be32(spll_func_cntl); in rv740_populate_sclk_value() 177 sclk->vCG_SPLL_FUNC_CNTL_2 = cpu_to_be32(spll_func_cntl_2); in rv740_populate_sclk_value() 178 sclk->vCG_SPLL_FUNC_CNTL_3 = cpu_to_be32(spll_func_cntl_3); in rv740_populate_sclk_value() 179 sclk->vCG_SPLL_SPREAD_SPECTRUM = cpu_to_be32(cg_spll_spread_spectrum); in rv740_populate_sclk_value() 180 sclk->vCG_SPLL_SPREAD_SPECTRUM_2 = cpu_to_be32(cg_spll_spread_spectrum_2); in rv740_populate_sclk_value() 381 table->ACPIState.levels[0].sclk.vCG_SPLL_FUNC_CNTL = cpu_to_be32(spll_func_cntl); in rv740_populate_smc_acpi_state() 382 table->ACPIState.levels[0].sclk.vCG_SPLL_FUNC_CNTL_2 = cpu_to_be32(spll_func_cntl_2); in rv740_populate_smc_acpi_state() 383 table->ACPIState.levels[0].sclk.vCG_SPLL_FUNC_CNTL_3 = cpu_to_be32(spll_func_cntl_3); in rv740_populate_smc_acpi_state() [all …]
|
A D | ni_dpm.c | 810 if (ps->performance_levels[i].sclk > max_limits->sclk) in ni_apply_state_adjust_rules() 811 ps->performance_levels[i].sclk = max_limits->sclk; in ni_apply_state_adjust_rules() 834 if (ps->performance_levels[i].sclk < ps->performance_levels[i - 1].sclk) in ni_apply_state_adjust_rules() 835 ps->performance_levels[i].sclk = ps->performance_levels[i - 1].sclk; in ni_apply_state_adjust_rules() 2058 sclk->sclk_value = engine_clock; in ni_calculate_sclk_params() 2071 NISLANDS_SMC_SCLK_VALUE *sclk) in ni_populate_sclk_value() argument 2100 u32 sclk = 0; in ni_init_smc_spll_table() local 2148 sclk += 512; in ni_init_smc_spll_table() 2324 ret = ni_populate_sclk_value(rdev, pl->sclk, &level->sclk); in ni_convert_power_level_to_smc() 3979 rdev->pm.dpm.dyn_state.max_clock_voltage_on_ac.sclk = pl->sclk; in ni_parse_pplib_clock_info() [all …]
|
A D | sumo_dpm.c | 790 pi->acpi_pl.sclk, in sumo_program_acpi_power_level() 1004 u32 sclk, in sumo_get_sleep_divider_id_from_clock() argument 1013 if (sclk < min) in sumo_get_sleep_divider_id_from_clock() 1116 ps->levels[i].sclk = in sumo_apply_state_adjust_rules() 1436 u32 sclk; in sumo_parse_pplib_clock_info() local 1440 pl->sclk = sclk; in sumo_parse_pplib_clock_info() 1806 i, pl->sclk, in sumo_dpm_print_power_state() 1827 current_index, pl->sclk, in sumo_dpm_debugfs_print_current_performance_level() 1835 current_index, pl->sclk, in sumo_dpm_debugfs_print_current_performance_level() 1852 return pl->sclk; in sumo_dpm_get_current_sclk() [all …]
|
/linux/drivers/tty/serial/8250/ |
A D | 8250_em.c | 24 struct clk *sclk; member 100 priv->sclk = devm_clk_get(&pdev->dev, "sclk"); in serial8250_em_probe() 101 if (IS_ERR(priv->sclk)) { in serial8250_em_probe() 103 return PTR_ERR(priv->sclk); in serial8250_em_probe() 114 clk_prepare_enable(priv->sclk); in serial8250_em_probe() 115 up.port.uartclk = clk_get_rate(priv->sclk); in serial8250_em_probe() 126 clk_disable_unprepare(priv->sclk); in serial8250_em_probe() 140 clk_disable_unprepare(priv->sclk); in serial8250_em_remove()
|
/linux/drivers/power/reset/ |
A D | at91-poweroff.c | 55 struct clk *sclk; member 164 at91_shdwc.sclk = devm_clk_get(&pdev->dev, NULL); in at91_poweroff_probe() 165 if (IS_ERR(at91_shdwc.sclk)) in at91_poweroff_probe() 166 return PTR_ERR(at91_shdwc.sclk); in at91_poweroff_probe() 168 ret = clk_prepare_enable(at91_shdwc.sclk); in at91_poweroff_probe() 203 clk_disable_unprepare(at91_shdwc.sclk); in at91_poweroff_probe() 215 clk_disable_unprepare(at91_shdwc.sclk); in at91_poweroff_remove()
|
A D | at91-reset.c | 56 struct clk *sclk; member 220 reset->sclk = devm_clk_get(&pdev->dev, NULL); in at91_reset_probe() 221 if (IS_ERR(reset->sclk)) in at91_reset_probe() 222 return PTR_ERR(reset->sclk); in at91_reset_probe() 224 ret = clk_prepare_enable(reset->sclk); in at91_reset_probe() 241 clk_disable_unprepare(reset->sclk); in at91_reset_probe() 255 clk_disable_unprepare(reset->sclk); in at91_reset_remove()
|
/linux/drivers/media/dvb-frontends/ |
A D | cx24110.c | 544 s32 afc; unsigned sclk; in cx24110_get_frontend() local 548 sclk = cx24110_readreg (state, 0x07) & 0x03; in cx24110_get_frontend() 551 if (sclk==0) sclk=90999000L/2L; in cx24110_get_frontend() 552 else if (sclk==1) sclk=60666000L; in cx24110_get_frontend() 553 else if (sclk==2) sclk=80888000L; in cx24110_get_frontend() 554 else sclk=90999000L; in cx24110_get_frontend() 555 sclk>>=8; in cx24110_get_frontend() 556 afc = sclk*(cx24110_readreg (state, 0x44)&0x1f)+ in cx24110_get_frontend() 557 ((sclk*cx24110_readreg (state, 0x45))>>8)+ in cx24110_get_frontend() 558 ((sclk*cx24110_readreg (state, 0x46))>>16); in cx24110_get_frontend()
|
/linux/sound/soc/cirrus/ |
A D | ep93xx-i2s.c | 75 struct clk *sclk; member 115 clk_prepare_enable(info->sclk); in ep93xx_i2s_enable() 160 clk_disable_unprepare(info->sclk); in ep93xx_i2s_disable() 343 err = clk_set_rate(info->sclk, clk_get_rate(info->mclk) / sdiv); in ep93xx_i2s_hw_params() 347 err = clk_set_rate(info->lrclk, clk_get_rate(info->sclk) / lrdiv); in ep93xx_i2s_hw_params() 460 info->sclk = clk_get(&pdev->dev, "sclk"); in ep93xx_i2s_probe() 461 if (IS_ERR(info->sclk)) { in ep93xx_i2s_probe() 462 err = PTR_ERR(info->sclk); in ep93xx_i2s_probe() 488 clk_put(info->sclk); in ep93xx_i2s_probe() 500 clk_put(info->sclk); in ep93xx_i2s_remove()
|
/linux/drivers/clocksource/ |
A D | timer-atmel-st.c | 185 struct clk *sclk; in atmel_st_timer_init() local 216 sclk = of_clk_get(node, 0); in atmel_st_timer_init() 217 if (IS_ERR(sclk)) { in atmel_st_timer_init() 219 return PTR_ERR(sclk); in atmel_st_timer_init() 222 ret = clk_prepare_enable(sclk); in atmel_st_timer_init() 228 sclk_rate = clk_get_rate(sclk); in atmel_st_timer_init()
|
/linux/sound/soc/meson/ |
A D | axg-tdm-formatter.c | 20 struct clk *sclk; member 104 ret = clk_set_phase(formatter->sclk, invert ? 0 : 180); in axg_tdm_formatter_enable() 116 ret = clk_prepare_enable(formatter->sclk); in axg_tdm_formatter_enable() 122 clk_disable_unprepare(formatter->sclk); in axg_tdm_formatter_enable() 141 clk_disable_unprepare(formatter->sclk); in axg_tdm_formatter_disable() 198 ret = clk_set_parent(formatter->sclk_sel, ts->iface->sclk); in axg_tdm_formatter_power_up() 293 formatter->sclk = devm_clk_get(dev, "sclk"); in axg_tdm_formatter_probe() 294 if (IS_ERR(formatter->sclk)) { in axg_tdm_formatter_probe() 295 ret = PTR_ERR(formatter->sclk); in axg_tdm_formatter_probe()
|