/sound/firewire/fireface/ |
D | ff-protocol-ff400.c | 25 static int ff400_get_clock(struct snd_ff *ff, unsigned int *rate, in ff400_get_clock() argument 41 *rate = 32000; in ff400_get_clock() 44 *rate = 44100; in ff400_get_clock() 47 *rate = 48000; in ff400_get_clock() 55 *rate *= 2; in ff400_get_clock() 57 *rate *= 4; in ff400_get_clock() 84 static int ff400_begin_session(struct snd_ff *ff, unsigned int rate) in ff400_begin_session() argument 91 if (amdtp_rate_table[i] == rate) in ff400_begin_session() 98 reg = cpu_to_le32(rate); in ff400_begin_session() 292 unsigned int rate; in ff400_dump_clock_config() local [all …]
|
D | ff-pcm.c | 70 unsigned int rate, channels; in limit_channels_and_rates() local 87 rate = amdtp_rate_table[i]; in limit_channels_and_rates() 88 hw->rates |= snd_pcm_rate_to_rate_bit(rate); in limit_channels_and_rates() 89 hw->rate_min = min(hw->rate_min, rate); in limit_channels_and_rates() 90 hw->rate_max = max(hw->rate_max, rate); in limit_channels_and_rates() 132 unsigned int rate; in pcm_open() local 144 err = ff->spec->protocol->get_clock(ff, &rate, &src); in pcm_open() 150 if (amdtp_rate_table[i] == rate) in pcm_open() 162 substream->runtime->hw.rate_min = rate; in pcm_open() 163 substream->runtime->hw.rate_max = rate; in pcm_open() [all …]
|
D | ff-stream.c | 13 static int get_rate_mode(unsigned int rate, unsigned int *mode) in get_rate_mode() argument 18 if (amdtp_rate_table[i] == rate) in get_rate_mode() 34 static int keep_resources(struct snd_ff *ff, unsigned int rate) in keep_resources() argument 39 err = get_rate_mode(rate, &mode); in keep_resources() 44 err = amdtp_ff_set_parameters(&ff->tx_stream, rate, in keep_resources() 56 err = amdtp_ff_set_parameters(&ff->rx_stream, rate, in keep_resources() 143 int snd_ff_stream_start_duplex(struct snd_ff *ff, unsigned int rate) in snd_ff_stream_start_duplex() argument 155 if (curr_rate != rate || in snd_ff_stream_start_duplex() 171 err = keep_resources(ff, rate); in snd_ff_stream_start_duplex() 175 err = ff->spec->protocol->begin_session(ff, rate); in snd_ff_stream_start_duplex()
|
/sound/core/ |
D | pcm_timer.c | 36 unsigned long rate, mult, fsize, l, post; in snd_pcm_timer_resolution_change() local 40 rate = runtime->rate; in snd_pcm_timer_resolution_change() 41 if (snd_BUG_ON(!rate)) in snd_pcm_timer_resolution_change() 43 l = gcd(mult, rate); in snd_pcm_timer_resolution_change() 45 rate /= l; in snd_pcm_timer_resolution_change() 49 l = gcd(rate, fsize); in snd_pcm_timer_resolution_change() 50 rate /= l; in snd_pcm_timer_resolution_change() 57 if (rate == 0) { in snd_pcm_timer_resolution_change() 60 runtime->rate, runtime->period_size); in snd_pcm_timer_resolution_change() 64 runtime->timer_resolution = (mult * fsize / rate) * post; in snd_pcm_timer_resolution_change()
|
/sound/usb/ |
D | format.c | 185 unsigned int rate = combine_triple(&fmt[idx]); in parse_audio_format_rates_v1() local 186 if (!rate) in parse_audio_format_rates_v1() 190 if (rate == 48000 && nr_rates == 1 && in parse_audio_format_rates_v1() 195 rate = 96000; in parse_audio_format_rates_v1() 197 if (rate == 16000 && in parse_audio_format_rates_v1() 200 rate = 8000; in parse_audio_format_rates_v1() 202 fp->rate_table[fp->nr_rates] = rate; in parse_audio_format_rates_v1() 203 if (!fp->rate_min || rate < fp->rate_min) in parse_audio_format_rates_v1() 204 fp->rate_min = rate; in parse_audio_format_rates_v1() 205 if (!fp->rate_max || rate > fp->rate_max) in parse_audio_format_rates_v1() [all …]
|
D | clock.c | 284 struct audioformat *fmt, int rate) in set_sample_rate_v1() argument 299 data[0] = rate; in set_sample_rate_v1() 300 data[1] = rate >> 8; in set_sample_rate_v1() 301 data[2] = rate >> 16; in set_sample_rate_v1() 307 iface, fmt->altsetting, rate, ep); in set_sample_rate_v1() 330 if (crate != rate) { in set_sample_rate_v1() 331 dev_warn(&dev->dev, "current rate %d is different from the runtime rate %d\n", crate, rate); in set_sample_rate_v1() 361 struct audioformat *fmt, int rate) in set_sample_rate_v2() argument 375 if (prev_rate == rate) in set_sample_rate_v2() 381 data = cpu_to_le32(rate); in set_sample_rate_v2() [all …]
|
/sound/pci/echoaudio/ |
D | layla20_dsp.c | 159 static int set_sample_rate(struct echoaudio *chip, u32 rate) in set_sample_rate() argument 161 if (snd_BUG_ON(rate < 8000 || rate > 50000)) in set_sample_rate() 169 chip->comm_page->sample_rate = cpu_to_le32(rate); in set_sample_rate() 170 chip->sample_rate = rate; in set_sample_rate() 177 dev_dbg(chip->card->dev, "set_sample_rate(%d)\n", rate); in set_sample_rate() 178 chip->sample_rate = rate; in set_sample_rate() 179 chip->comm_page->sample_rate = cpu_to_le32(rate); in set_sample_rate() 189 u32 rate; in set_input_clock() local 191 rate = 0; in set_input_clock() 194 rate = chip->sample_rate; in set_input_clock() [all …]
|
D | echoaudio_3g.c | 143 static u32 set_spdif_bits(struct echoaudio *chip, u32 control_reg, u32 rate) in set_spdif_bits() argument 147 switch (rate) { in set_spdif_bits() 256 static int set_sample_rate(struct echoaudio *chip, u32 rate) in set_sample_rate() argument 265 chip->comm_page->sample_rate = cpu_to_le32(rate); in set_sample_rate() 266 chip->sample_rate = rate; in set_sample_rate() 271 if (snd_BUG_ON(rate >= 50000 && in set_sample_rate() 279 switch (rate) { in set_sample_rate() 297 if (rate > 50000) in set_sample_rate() 303 control_reg = set_spdif_bits(chip, control_reg, rate); in set_sample_rate() 305 base_rate = rate; in set_sample_rate() [all …]
|
D | layla24_dsp.c | 157 static int set_sample_rate(struct echoaudio *chip, u32 rate) in set_sample_rate() argument 161 if (snd_BUG_ON(rate >= 50000 && in set_sample_rate() 170 chip->comm_page->sample_rate = cpu_to_le32(rate); in set_sample_rate() 171 chip->sample_rate = rate; in set_sample_rate() 181 switch (rate) { in set_sample_rate() 217 if (rate > 50000) { in set_sample_rate() 218 base_rate = rate >> 1; in set_sample_rate() 221 base_rate = rate; in set_sample_rate() 239 chip->comm_page->sample_rate = cpu_to_le32(rate); /* ignored by the DSP ? */ in set_sample_rate() 240 chip->sample_rate = rate; in set_sample_rate() [all …]
|
D | darla24_dsp.c | 97 static int set_sample_rate(struct echoaudio *chip, u32 rate) in set_sample_rate() argument 101 switch (rate) { in set_sample_rate() 132 rate); in set_sample_rate() 140 "set_sample_rate: %d clock %d\n", rate, clock); in set_sample_rate() 141 chip->sample_rate = rate; in set_sample_rate() 147 chip->comm_page->sample_rate = cpu_to_le32(rate); /* ignored by the DSP ? */ in set_sample_rate()
|
/sound/soc/codecs/ |
D | rl6231.c | 72 int rl6231_calc_dmic_clk(int rate) in rl6231_calc_dmic_clk() argument 77 if (rate < 1000000 * div[0]) { in rl6231_calc_dmic_clk() 78 pr_warn("Base clock rate %d is too low\n", rate); in rl6231_calc_dmic_clk() 86 if (3072000 * div[i] >= rate) in rl6231_calc_dmic_clk() 90 pr_warn("Base clock rate %d is too high\n", rate); in rl6231_calc_dmic_clk() 190 int rl6231_get_clk_info(int sclk, int rate) in rl6231_get_clk_info() argument 194 if (sclk <= 0 || rate <= 0) in rl6231_get_clk_info() 197 rate = rate << 8; in rl6231_get_clk_info() 199 if (sclk == rate * pd[i]) in rl6231_get_clk_info()
|
D | max98925.c | 208 int rate; member 213 .rate = 8000, 218 .rate = 11025, 223 .rate = 12000, 228 .rate = 16000, 233 .rate = 22050, 238 .rate = 24000, 243 .rate = 32000, 248 .rate = 44100, 253 .rate = 48000, [all …]
|
D | max98926.c | 259 int rate; member 263 .rate = 8000, 267 .rate = 11025, 271 .rate = 12000, 275 .rate = 16000, 279 .rate = 22050, 283 .rate = 24000, 287 .rate = 32000, 291 .rate = 44100, 295 .rate = 48000, [all …]
|
D | max98088.c | 36 unsigned int rate; member 933 u32 rate; member 948 static inline int rate_value(int rate, u8 *value) in rate_value() argument 953 if (rate_table[i].rate >= rate) { in rate_value() 970 unsigned int rate; in max98088_dai1_hw_params() local 975 rate = params_rate(params); in max98088_dai1_hw_params() 992 if (rate_value(rate, ®val)) in max98088_dai1_hw_params() 997 cdata->rate = rate; in max98088_dai1_hw_params() 1006 ni = 65536ULL * (rate < 50000 ? 96ULL : 48ULL) in max98088_dai1_hw_params() 1007 * (unsigned long long int)rate; in max98088_dai1_hw_params() [all …]
|
D | ssm4567.c | 204 unsigned int rate = params_rate(params); in ssm4567_hw_params() local 207 if (rate >= 8000 && rate <= 12000) in ssm4567_hw_params() 209 else if (rate >= 16000 && rate <= 24000) in ssm4567_hw_params() 211 else if (rate >= 32000 && rate <= 48000) in ssm4567_hw_params() 213 else if (rate >= 64000 && rate <= 96000) in ssm4567_hw_params() 215 else if (rate >= 128000 && rate <= 192000) in ssm4567_hw_params()
|
/sound/firewire/tascam/ |
D | tascam-stream.c | 45 static int set_clock(struct snd_tscm *tscm, unsigned int rate, in set_clock() argument 57 if (rate > 0) { in set_clock() 60 if ((rate % 44100) == 0) { in set_clock() 63 if (rate / 44100 == 2) in set_clock() 65 } else if ((rate % 48000) == 0) { in set_clock() 68 if (rate / 48000 == 2) in set_clock() 98 int snd_tscm_stream_get_rate(struct snd_tscm *tscm, unsigned int *rate) in snd_tscm_stream_get_rate() argument 111 *rate = 44100; in snd_tscm_stream_get_rate() 113 *rate = 48000; in snd_tscm_stream_get_rate() 119 *rate *= 2; in snd_tscm_stream_get_rate() [all …]
|
/sound/firewire/digi00x/ |
D | digi00x-stream.c | 31 int snd_dg00x_stream_get_local_rate(struct snd_dg00x *dg00x, unsigned int *rate) in snd_dg00x_stream_get_local_rate() argument 45 *rate = snd_dg00x_stream_rates[data]; in snd_dg00x_stream_get_local_rate() 52 int snd_dg00x_stream_set_local_rate(struct snd_dg00x *dg00x, unsigned int rate) in snd_dg00x_stream_set_local_rate() argument 58 if (rate == snd_dg00x_stream_rates[i]) in snd_dg00x_stream_set_local_rate() 104 unsigned int *rate) in snd_dg00x_stream_get_external_rate() argument 118 *rate = snd_dg00x_stream_rates[data]; in snd_dg00x_stream_get_external_rate() 186 static int keep_resources(struct snd_dg00x *dg00x, unsigned int rate) in keep_resources() argument 194 if (snd_dg00x_stream_rates[i] == rate) in keep_resources() 201 err = amdtp_dot_set_parameters(&dg00x->rx_stream, rate, in keep_resources() 212 err = amdtp_dot_set_parameters(&dg00x->tx_stream, rate, in keep_resources() [all …]
|
/sound/pci/ac97/ |
D | ac97_pcm.c | 174 static int set_spdif_rate(struct snd_ac97 *ac97, unsigned short rate) in set_spdif_rate() argument 184 switch (rate) { in set_spdif_rate() 194 if (ac97->id == AC97_ID_CM9739 && rate != 48000) { in set_spdif_rate() 198 switch (rate) { in set_spdif_rate() 219 switch (rate) { in set_spdif_rate() 226 switch (rate) { in set_spdif_rate() 258 int snd_ac97_set_rate(struct snd_ac97 *ac97, int reg, unsigned int rate) in snd_ac97_set_rate() argument 263 dbl = rate > 48000; in snd_ac97_set_rate() 275 if (rate != 48000) in snd_ac97_set_rate() 281 if (rate != 48000 && rate != 96000) in snd_ac97_set_rate() [all …]
|
/sound/firewire/motu/ |
D | motu-pcm.c | 24 unsigned int i, pcm_channels, rate, mode; in motu_rate_constraint() local 27 rate = snd_motu_clock_rates[i]; in motu_rate_constraint() 35 rates.min = min(rates.min, rate); in motu_rate_constraint() 36 rates.max = max(rates.max, rate); in motu_rate_constraint() 54 unsigned int i, pcm_channels, rate, mode; in motu_channels_constraint() local 57 rate = snd_motu_clock_rates[i]; in motu_channels_constraint() 60 if (!snd_interval_test(r, rate)) in motu_channels_constraint() 77 unsigned int i, pcm_channels, rate, mode; in limit_channels_and_rates() local 83 rate = snd_motu_clock_rates[i]; in limit_channels_and_rates() 91 hw->rates |= snd_pcm_rate_to_rate_bit(rate); in limit_channels_and_rates() [all …]
|
/sound/firewire/oxfw/ |
D | oxfw-stream.c | 42 static int set_rate(struct snd_oxfw *oxfw, unsigned int rate) in set_rate() argument 46 err = avc_general_set_sig_fmt(oxfw->unit, rate, in set_rate() 52 err = avc_general_set_sig_fmt(oxfw->unit, rate, in set_rate() 59 unsigned int rate, unsigned int pcm_channels) in set_stream_format() argument 81 if ((formation.rate == rate) && (formation.pcm == pcm_channels)) in set_stream_format() 89 return set_rate(oxfw, rate); in set_stream_format() 116 unsigned int rate, unsigned int pcm_channels) in start_stream() argument 140 if (rate != formation.rate) in start_stream() 158 err = amdtp_am824_set_parameters(stream, rate, pcm_channels, midi_ports, in start_stream() 255 unsigned int rate, unsigned int pcm_channels) in snd_oxfw_stream_start_simplex() argument [all …]
|
/sound/pci/pcxhr/ |
D | pcxhr_mix22.c | 352 unsigned int rate, in hr222_sub_set_clock() argument 357 unsigned realfreq = rate; in hr222_sub_set_clock() 361 err = hr222_pll_freq_register(rate, &pllreg, &realfreq); in hr222_sub_set_clock() 393 speed = rate < 55000 ? 0 : 1; in hr222_sub_set_clock() 411 rate, realfreq, pllreg); in hr222_sub_set_clock() 419 int rate, calc_rate = 0; in hr222_get_external_clock() local 470 rate = 192000; in hr222_get_external_clock() 472 rate = 176400; in hr222_get_external_clock() 474 rate = 128000; in hr222_get_external_clock() 476 rate = 96000; in hr222_get_external_clock() [all …]
|
/sound/pci/ice1712/ |
D | juli.c | 154 static int get_gpio_val(int rate) in get_gpio_val() argument 158 if (juli_rates[i] == rate) in get_gpio_val() 185 int rate; in juli_spdif_in_open() local 190 rate = snd_ak4114_external_rate(spec->ak4114); in juli_spdif_in_open() 191 if (rate >= runtime->hw.rate_min && rate <= runtime->hw.rate_max) { in juli_spdif_in_open() 192 runtime->hw.rate_min = rate; in juli_spdif_in_open() 193 runtime->hw.rate_max = rate; in juli_spdif_in_open() 222 static void juli_akm_set_rate_val(struct snd_akm4xxx *ak, unsigned int rate) in juli_akm_set_rate_val() argument 229 if (rate == 0) /* no hint - S/PDIF input is master or the new spdif in juli_akm_set_rate_val() 234 if (rate > 96000) { in juli_akm_set_rate_val() [all …]
|
/sound/soc/sh/rcar/ |
D | adg.c | 183 if (runtime->rate != in_rate) { in rsnd_adg_get_timesel_ratio() 186 } else if (runtime->rate != out_rate) { in rsnd_adg_get_timesel_ratio() 312 int rsnd_adg_clk_query(struct rsnd_priv *priv, unsigned int rate) in rsnd_adg_clk_query() argument 325 dev_dbg(dev, "request clock = %d\n", rate); in rsnd_adg_clk_query() 332 if (rate == adg->clk_rate[i]) in rsnd_adg_clk_query() 339 if (rate == adg->rbga_rate_for_441khz) in rsnd_adg_clk_query() 342 if (rate == adg->rbgb_rate_for_48khz) in rsnd_adg_clk_query() 355 int rsnd_adg_ssi_clk_try_start(struct rsnd_mod *ssi_mod, unsigned int rate) in rsnd_adg_ssi_clk_try_start() argument 364 data = rsnd_adg_clk_query(priv, rate); in rsnd_adg_ssi_clk_try_start() 374 if (0 == (rate % 8000)) in rsnd_adg_ssi_clk_try_start() [all …]
|
/sound/core/oss/ |
D | rate.c | 193 if (plugin->src_format.rate < plugin->dst_format.rate) { in rate_src_frames() 226 if (plugin->src_format.rate < plugin->dst_format.rate) { in rate_dst_frames() 321 if (snd_BUG_ON(src_format->rate == dst_format->rate)) in snd_pcm_plugin_build_rate() 332 if (src_format->rate < dst_format->rate) { in snd_pcm_plugin_build_rate() 333 data->pitch = ((src_format->rate << SHIFT) + (dst_format->rate >> 1)) / dst_format->rate; in snd_pcm_plugin_build_rate() 336 data->pitch = ((dst_format->rate << SHIFT) + (src_format->rate >> 1)) / src_format->rate; in snd_pcm_plugin_build_rate()
|
/sound/soc/samsung/ |
D | h1940_uda1380.c | 80 unsigned int rate = params_rate(params); in h1940_hw_params() local 82 switch (rate) { in h1940_hw_params() 86 div = s3c24xx_i2s_get_clockrate() / (384 * rate); in h1940_hw_params() 87 if (s3c24xx_i2s_get_clockrate() % (384 * rate) > (192 * rate)) in h1940_hw_params() 92 __func__, rate); in h1940_hw_params() 97 ret = snd_soc_dai_set_sysclk(cpu_dai, S3C24XX_CLKSRC_PCLK, rate, in h1940_hw_params()
|