/kernel/linux/linux-5.10/sound/soc/codecs/ |
H A D | si476x.c | 153 int rate, width, err; in si476x_codec_hw_params() local 155 rate = params_rate(params); in si476x_codec_hw_params() 156 if (rate < 32000 || rate > 48000) { in si476x_codec_hw_params() 157 dev_err(dai->component->dev, "Rate: %d is not supported\n", rate); in si476x_codec_hw_params() 181 rate); in si476x_codec_hw_params() 183 dev_err(dai->component->dev, "Failed to set sample rate\n"); in si476x_codec_hw_params()
|
/kernel/linux/linux-5.10/sound/soc/sof/intel/ |
H A D | hda-pcm.c | 30 u32 hda_dsp_get_mult_div(struct snd_sof_dev *sdev, int rate) in hda_dsp_get_mult_div() argument 32 switch (rate) { in hda_dsp_get_mult_div() 58 dev_warn(sdev->dev, "can't find div rate %d using 48kHz\n", in hda_dsp_get_mult_div() 59 rate); in hda_dsp_get_mult_div() 95 u32 size, rate, bits; in hda_dsp_pcm_hw_params() local 98 rate = hda_dsp_get_mult_div(sdev, params_rate(params)); in hda_dsp_pcm_hw_params() 105 hstream->format_val = rate | bits | (params_channels(params) - 1); in hda_dsp_pcm_hw_params()
|
/kernel/linux/linux-5.10/drivers/gpu/drm/sun4i/ |
H A D | sun4i_dotclock.c | 70 static long sun4i_dclk_round_rate(struct clk_hw *hw, unsigned long rate, in sun4i_dclk_round_rate() argument 80 u64 ideal = (u64)rate * i; in sun4i_dclk_round_rate() 102 if (abs(rate - rounded / i) < in sun4i_dclk_round_rate() 103 abs(rate - best_parent / best_div)) { in sun4i_dclk_round_rate() 115 static int sun4i_dclk_set_rate(struct clk_hw *hw, unsigned long rate, in sun4i_dclk_set_rate() argument 119 u8 div = parent_rate / rate; in sun4i_dclk_set_rate()
|
/kernel/linux/linux-6.6/drivers/watchdog/ |
H A D | ixp4xx_wdt.c | 26 unsigned long rate; member 57 __raw_writel(wdd->timeout * iwdt->rate, in ixp4xx_wdt_start() 155 * Retrieve rate from a fixed clock from the device tree if in ixp4xx_wdt_probe() 156 * the parent has that, else use the default clock rate. in ixp4xx_wdt_probe() 160 iwdt->rate = clk_get_rate(clk); in ixp4xx_wdt_probe() 162 if (!iwdt->rate) in ixp4xx_wdt_probe() 163 iwdt->rate = IXP4XX_TIMER_FREQ; in ixp4xx_wdt_probe() 168 iwdt->wdd.max_timeout = U32_MAX / iwdt->rate; in ixp4xx_wdt_probe()
|
/kernel/linux/linux-6.6/drivers/clk/imx/ |
H A D | clk.c | 84 const char *name, unsigned long rate) in imx_obtain_fixed_clock() 90 clk = imx_clk_fixed(name, rate); in imx_obtain_fixed_clock() 95 const char *name, unsigned long rate) in imx_obtain_fixed_clock_hw() 101 clk = imx_clk_fixed(name, rate); in imx_obtain_fixed_clock_hw() 106 const char *name, unsigned long rate) in imx_obtain_fixed_of_clock() 112 hw = imx_obtain_fixed_clock_hw(name, rate); in imx_obtain_fixed_of_clock() 83 imx_obtain_fixed_clock( const char *name, unsigned long rate) imx_obtain_fixed_clock() argument 94 imx_obtain_fixed_clock_hw( const char *name, unsigned long rate) imx_obtain_fixed_clock_hw() argument 105 imx_obtain_fixed_of_clock(struct device_node *np, const char *name, unsigned long rate) imx_obtain_fixed_of_clock() argument
|
/kernel/linux/linux-6.6/drivers/clk/rockchip/ |
H A D | clk-mmc-phase.c | 49 unsigned long rate = clk_hw_get_rate(hw); in rockchip_mmc_get_phase() local 55 if (!rate) in rockchip_mmc_get_phase() 65 36 * (rate / 10000); in rockchip_mmc_get_phase() 78 unsigned long rate = clk_hw_get_rate(hw); in rockchip_mmc_set_phase() local 87 * the clock rate from its parent, namely the output clock in rockchip_mmc_set_phase() 96 if (!rate) { in rockchip_mmc_set_phase() 97 pr_err("%s: invalid clk rate\n", __func__); in rockchip_mmc_set_phase() 130 (rate / 1000) * 36 * in rockchip_mmc_set_phase() 167 * process. However if the clock rate is changed, the phase is stale in rockchip_mmc_clk_rate_notify() 174 * (2) the new coming rate i in rockchip_mmc_clk_rate_notify() [all...] |
/kernel/linux/linux-6.6/drivers/clocksource/ |
H A D | timer-digicolor.c | 151 unsigned long rate; in digicolor_timer_init() local 177 rate = clk_get_rate(clk); in digicolor_timer_init() 178 dc_timer_dev.ticks_per_jiffy = DIV_ROUND_UP(rate, HZ); in digicolor_timer_init() 184 sched_clock_register(digicolor_timer_sched_read, 32, rate); in digicolor_timer_init() 186 rate, 340, 32, clocksource_mmio_readl_down); in digicolor_timer_init() 199 clockevents_config_and_register(&dc_timer_dev.ce, rate, 0, 0xffffffff); in digicolor_timer_init()
|
/kernel/linux/linux-6.6/drivers/net/wireless/broadcom/brcm80211/brcmsmac/ |
H A D | rate.h | 34 /* phy rate in kbps [20Mhz] */ 36 /* phy rate in kbps [40Mhz] */ 38 /* phy rate in kbps [20Mhz] with SGI */ 40 /* phy rate in kbps [40Mhz] with SGI */ 42 /* phy ctl byte 3, code rate, modulation type, # of streams */ 44 /* matching legacy ofdm rate in 500bkps */ 75 #define BRCMS_RATE_MASK_FULL 0xff /* Rate value mask with basic rate flag */ 78 * rate spec : holds rate and mode specific information required to generate a 84 /* rate spe 183 u32 rate = (ratespec & BRCMS_RATE_MASK); is_cck_rate() local [all...] |
/kernel/linux/linux-6.6/drivers/phy/ |
H A D | phy-pistachio-usb.c | 55 unsigned long timeout, rate; in pistachio_usb_phy_power_on() local 70 rate = clk_get_rate(p_phy->phy_clk); in pistachio_usb_phy_power_on() 71 if (p_phy->refclk == REFCLK_XO_CRYSTAL && rate != 12000000) { in pistachio_usb_phy_power_on() 72 dev_err(p_phy->dev, "Unsupported rate for XO crystal: %ld\n", in pistachio_usb_phy_power_on() 73 rate); in pistachio_usb_phy_power_on() 79 if (rate == fsel_rate_map[i]) in pistachio_usb_phy_power_on() 83 dev_err(p_phy->dev, "Unsupported clock rate: %lu\n", rate); in pistachio_usb_phy_power_on()
|
/kernel/linux/linux-6.6/drivers/gpu/drm/sun4i/ |
H A D | sun4i_tcon_dclk.c | 70 static long sun4i_dclk_round_rate(struct clk_hw *hw, unsigned long rate, in sun4i_dclk_round_rate() argument 80 u64 ideal = (u64)rate * i; in sun4i_dclk_round_rate() 102 if (abs(rate - rounded / i) < in sun4i_dclk_round_rate() 103 abs(rate - best_parent / best_div)) { in sun4i_dclk_round_rate() 115 static int sun4i_dclk_set_rate(struct clk_hw *hw, unsigned long rate, in sun4i_dclk_set_rate() argument 119 u8 div = parent_rate / rate; in sun4i_dclk_set_rate()
|
/kernel/linux/linux-6.6/sound/firewire/fireface/ |
H A D | ff.h | 123 int (*get_clock)(struct snd_ff *ff, unsigned int *rate, 126 int (*allocate_resources)(struct snd_ff *ff, unsigned int rate); 127 int (*begin_session)(struct snd_ff *ff, unsigned int rate); 140 int amdtp_ff_set_parameters(struct amdtp_stream *s, unsigned int rate, 151 int snd_ff_stream_reserve_duplex(struct snd_ff *ff, unsigned int rate, 154 int snd_ff_stream_start_duplex(struct snd_ff *ff, unsigned int rate);
|
/kernel/linux/linux-6.6/sound/soc/codecs/ |
H A D | si476x.c | 153 int rate, width, err; in si476x_codec_hw_params() local 155 rate = params_rate(params); in si476x_codec_hw_params() 156 if (rate < 32000 || rate > 48000) { in si476x_codec_hw_params() 157 dev_err(dai->component->dev, "Rate: %d is not supported\n", rate); in si476x_codec_hw_params() 181 rate); in si476x_codec_hw_params() 183 dev_err(dai->component->dev, "Failed to set sample rate\n"); in si476x_codec_hw_params()
|
/kernel/linux/linux-5.10/sound/firewire/motu/ |
H A D | motu-stream.c | 28 static int keep_resources(struct snd_motu *motu, unsigned int rate, in keep_resources() argument 52 err = amdtp_motu_set_parameters(stream, rate, midi_ports, in keep_resources() 136 int snd_motu_stream_reserve_duplex(struct snd_motu *motu, unsigned int rate, in snd_motu_stream_reserve_duplex() argument 146 if (rate == 0) in snd_motu_stream_reserve_duplex() 147 rate = curr_rate; in snd_motu_stream_reserve_duplex() 149 if (motu->substreams_counter == 0 || curr_rate != rate) { in snd_motu_stream_reserve_duplex() 156 err = snd_motu_protocol_set_clock_rate(motu, rate); in snd_motu_stream_reserve_duplex() 159 "fail to set sampling rate: %d\n", err); in snd_motu_stream_reserve_duplex() 167 err = keep_resources(motu, rate, &motu->tx_stream); in snd_motu_stream_reserve_duplex() 171 err = keep_resources(motu, rate, in snd_motu_stream_reserve_duplex() [all...] |
H A D | motu-protocol-v2.c | 27 static int get_clock_rate(u32 data, unsigned int *rate) in get_clock_rate() argument 33 *rate = snd_motu_clock_rates[index]; in get_clock_rate() 39 unsigned int *rate) in snd_motu_protocol_v2_get_clock_rate() 49 return get_clock_rate(be32_to_cpu(reg), rate); in snd_motu_protocol_v2_get_clock_rate() 53 unsigned int rate) in snd_motu_protocol_v2_set_clock_rate() 61 if (snd_motu_clock_rates[i] == rate) in snd_motu_protocol_v2_set_clock_rate() 185 unsigned int rate; in switch_fetching_mode_spartan() local 193 err = get_clock_rate(*data, &rate); in switch_fetching_mode_spartan() 197 if (src == SND_MOTU_CLOCK_SOURCE_SPH && rate > 48000) in switch_fetching_mode_spartan() 38 snd_motu_protocol_v2_get_clock_rate(struct snd_motu *motu, unsigned int *rate) snd_motu_protocol_v2_get_clock_rate() argument 52 snd_motu_protocol_v2_set_clock_rate(struct snd_motu *motu, unsigned int rate) snd_motu_protocol_v2_set_clock_rate() argument
|
/kernel/linux/linux-5.10/sound/pci/echoaudio/ |
H A D | mona_dsp.c | 196 static int set_sample_rate(struct echoaudio *chip, u32 rate) in set_sample_rate() argument 205 "Cannot set sample rate - clock not set to CLK_CLOCKININTERNAL\n"); in set_sample_rate() 206 /* Save the rate anyhow */ in set_sample_rate() 207 chip->comm_page->sample_rate = cpu_to_le32(rate); in set_sample_rate() 208 chip->sample_rate = rate; in set_sample_rate() 213 if (rate >= 88200) { in set_sample_rate() 248 switch (rate) { in set_sample_rate() 282 "set_sample_rate: %d invalid!\n", rate); in set_sample_rate() 288 chip->comm_page->sample_rate = cpu_to_le32(rate); /* ignored by the DSP */ in set_sample_rate() 289 chip->sample_rate = rate; in set_sample_rate() [all...] |
/kernel/linux/linux-5.10/sound/soc/qcom/qdsp6/ |
H A D | q6afe-clocks.c | 19 .rate = 19200000, \ 42 int rate; member 60 Q6AFE_LPASS_CLK_ROOT_DEFAULT, clk->rate); in clk_q6afe_prepare() 71 static int clk_q6afe_set_rate(struct clk_hw *hw, unsigned long rate, in clk_q6afe_set_rate() argument 76 clk->rate = rate; in clk_q6afe_set_rate() 86 return clk->rate; in clk_q6afe_recalc_rate() 89 static long clk_q6afe_round_rate(struct clk_hw *hw, unsigned long rate, in clk_q6afe_round_rate() argument 92 return rate; in clk_q6afe_round_rate()
|
/kernel/linux/linux-5.10/drivers/pwm/ |
H A D | pwm-bcm-iproc.c | 85 u64 tmp, multi, rate; in iproc_pwmc_get_state() local 100 rate = clk_get_rate(ip->clk); in iproc_pwmc_get_state() 101 if (rate == 0) { in iproc_pwmc_get_state() 115 state->period = div64_u64(tmp, rate); in iproc_pwmc_get_state() 119 state->duty_cycle = div64_u64(tmp, rate); in iproc_pwmc_get_state() 128 u64 rate; in iproc_pwmc_apply() local 130 rate = clk_get_rate(ip->clk); in iproc_pwmc_apply() 146 value = rate * state->period; in iproc_pwmc_apply() 148 value = rate * state->duty_cycle; in iproc_pwmc_apply()
|
/kernel/linux/linux-6.6/drivers/pwm/ |
H A D | pwm-bcm-iproc.c | 75 u64 tmp, multi, rate; in iproc_pwmc_get_state() local 90 rate = clk_get_rate(ip->clk); in iproc_pwmc_get_state() 91 if (rate == 0) { in iproc_pwmc_get_state() 105 state->period = div64_u64(tmp, rate); in iproc_pwmc_get_state() 109 state->duty_cycle = div64_u64(tmp, rate); in iproc_pwmc_get_state() 120 u64 rate; in iproc_pwmc_apply() local 122 rate = clk_get_rate(ip->clk); in iproc_pwmc_apply() 138 value = rate * state->period; in iproc_pwmc_apply() 140 value = rate * state->duty_cycle; in iproc_pwmc_apply()
|
H A D | pwm-mtk-disp.c | 75 u64 div, rate; in mtk_disp_pwm_apply() local 118 rate = clk_get_rate(mdp->clk_main); in mtk_disp_pwm_apply() 119 clk_div = mul_u64_u64_div_u64(state->period, rate, NSEC_PER_SEC) >> in mtk_disp_pwm_apply() 130 period = mul_u64_u64_div_u64(state->period, rate, div); in mtk_disp_pwm_apply() 134 high_width = mul_u64_u64_div_u64(state->duty_cycle, rate, div); in mtk_disp_pwm_apply() 178 u64 rate, period, high_width; in mtk_disp_pwm_get_state() local 205 rate = clk_get_rate(mdp->clk_main); in mtk_disp_pwm_get_state() 216 state->period = DIV64_U64_ROUND_UP(period * (clk_div + 1) * NSEC_PER_SEC, rate); in mtk_disp_pwm_get_state() 219 rate); in mtk_disp_pwm_get_state()
|
/kernel/linux/linux-6.6/drivers/clk/tegra/ |
H A D | clk-super.c | 150 unsigned long rate; in clk_super_determine_rate() local 154 rate = super->div_ops->round_rate(div_hw, req->rate, in clk_super_determine_rate() 156 if (rate < 0) in clk_super_determine_rate() 157 return rate; in clk_super_determine_rate() 159 req->rate = rate; in clk_super_determine_rate() 174 static int clk_super_set_rate(struct clk_hw *hw, unsigned long rate, in clk_super_set_rate() argument 182 return super->div_ops->set_rate(div_hw, rate, parent_rate); in clk_super_set_rate()
|
H A D | clk-periph.c | 54 unsigned long rate; in clk_periph_determine_rate() local 58 rate = div_ops->round_rate(div_hw, req->rate, &req->best_parent_rate); in clk_periph_determine_rate() 59 if (rate < 0) in clk_periph_determine_rate() 60 return rate; in clk_periph_determine_rate() 62 req->rate = rate; in clk_periph_determine_rate() 66 static int clk_periph_set_rate(struct clk_hw *hw, unsigned long rate, in clk_periph_set_rate() argument 75 return div_ops->set_rate(div_hw, rate, parent_rate); in clk_periph_set_rate()
|
/kernel/linux/linux-6.6/sound/pci/echoaudio/ |
H A D | mona_dsp.c | 198 static int set_sample_rate(struct echoaudio *chip, u32 rate) in set_sample_rate() argument 207 "Cannot set sample rate - clock not set to CLK_CLOCKININTERNAL\n"); in set_sample_rate() 208 /* Save the rate anyhow */ in set_sample_rate() 209 chip->comm_page->sample_rate = cpu_to_le32(rate); in set_sample_rate() 210 chip->sample_rate = rate; in set_sample_rate() 215 if (rate >= 88200) { in set_sample_rate() 250 switch (rate) { in set_sample_rate() 284 "set_sample_rate: %d invalid!\n", rate); in set_sample_rate() 290 chip->comm_page->sample_rate = cpu_to_le32(rate); /* ignored by the DSP */ in set_sample_rate() 291 chip->sample_rate = rate; in set_sample_rate() [all...] |
/kernel/linux/linux-5.10/drivers/clk/sirf/ |
H A D | clk-common.c | 95 static long pll_clk_round_rate(struct clk_hw *hw, unsigned long rate, in pll_clk_round_rate() argument 105 rate = rate - rate % MHZ; in pll_clk_round_rate() 107 nf = rate / MHZ; in pll_clk_round_rate() 126 static int pll_clk_set_rate(struct clk_hw *hw, unsigned long rate, in pll_clk_set_rate() argument 137 nf = rate / MHZ; in pll_clk_set_rate() 138 if (unlikely((rate % MHZ) || nf > BIT(13) || nf < 1)) in pll_clk_set_rate() 162 static long cpu_clk_round_rate(struct clk_hw *hw, unsigned long rate, in cpu_clk_round_rate() argument 172 return pll_clk_round_rate(parent_clk, rate, in cpu_clk_round_rate() 353 dmn_clk_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *parent_rate) dmn_clk_round_rate() argument 375 dmn_clk_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) dmn_clk_set_rate() argument 407 cpu_clk_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) cpu_clk_set_rate() argument [all...] |
/kernel/linux/linux-5.10/drivers/clk/mvebu/ |
H A D | armada-37xx-periph.c | 457 static long clk_pm_cpu_round_rate(struct clk_hw *hw, unsigned long rate, in clk_pm_cpu_round_rate() argument 462 unsigned int div = *parent_rate / rate; in clk_pm_cpu_round_rate() 509 unsigned int new_level, unsigned long rate, in clk_pm_cpu_set_rate_wa() 537 if (rate < 1000*1000*1000) in clk_pm_cpu_set_rate_wa() 541 * We are going to L0 with rate >= 1GHz. Check whether we have been at in clk_pm_cpu_set_rate_wa() 556 static int clk_pm_cpu_set_rate(struct clk_hw *hw, unsigned long rate, in clk_pm_cpu_set_rate() argument 561 unsigned int div = parent_rate / rate; in clk_pm_cpu_set_rate() 589 clk_pm_cpu_set_rate_wa(pm_cpu, load_level, rate, base); in clk_pm_cpu_set_rate() 593 return rate; in clk_pm_cpu_set_rate() 649 struct clk_double_div *rate; in armada_3700_add_composite_clk() local 508 clk_pm_cpu_set_rate_wa(struct clk_pm_cpu *pm_cpu, unsigned int new_level, unsigned long rate, struct regmap *base) clk_pm_cpu_set_rate_wa() argument 655 struct clk_divider *rate = to_clk_divider(rate_hw); armada_3700_add_composite_clk() local [all...] |
/kernel/linux/linux-6.6/drivers/clk/ingenic/ |
H A D | cgu.c | 131 unsigned long rate, unsigned long parent_rate, in ingenic_pll_calc_m_n_od() 144 m = (rate / MHZ) * od * n / (parent_rate / MHZ); in ingenic_pll_calc_m_n_od() 155 unsigned long rate, unsigned long parent_rate, in ingenic_pll_calc() 162 (*pll_info->calc_m_n_od)(pll_info, rate, parent_rate, &m, &n, &od); in ingenic_pll_calc() 164 ingenic_pll_calc_m_n_od(pll_info, rate, parent_rate, &m, &n, &od); in ingenic_pll_calc() 208 unsigned long rate, flags; in ingenic_pll_set_rate() local 213 rate = ingenic_pll_calc(clk_info, req_rate, parent_rate, in ingenic_pll_set_rate() 215 if (rate != req_rate) in ingenic_pll_set_rate() 216 pr_info("ingenic-cgu: request '%s' rate %luHz, actual %luHz\n", in ingenic_pll_set_rate() 217 clk_info->name, req_rate, rate); in ingenic_pll_set_rate() 130 ingenic_pll_calc_m_n_od(const struct ingenic_cgu_pll_info *pll_info, unsigned long rate, unsigned long parent_rate, unsigned int *pm, unsigned int *pn, unsigned int *pod) ingenic_pll_calc_m_n_od() argument 154 ingenic_pll_calc(const struct ingenic_cgu_clk_info *clk_info, unsigned long rate, unsigned long parent_rate, unsigned int *pm, unsigned int *pn, unsigned int *pod) ingenic_pll_calc() argument 411 unsigned long rate = parent_rate; ingenic_clk_recalc_rate() local 530 unsigned long rate, flags; ingenic_clk_set_rate() local [all...] |