/sound/core/ |
D | pcm_timer.c | 34 unsigned long rate, mult, fsize, l, post; in snd_pcm_timer_resolution_change() local 38 rate = runtime->rate; in snd_pcm_timer_resolution_change() 39 if (snd_BUG_ON(!rate)) in snd_pcm_timer_resolution_change() 41 l = gcd(mult, rate); in snd_pcm_timer_resolution_change() 43 rate /= l; in snd_pcm_timer_resolution_change() 47 l = gcd(rate, fsize); in snd_pcm_timer_resolution_change() 48 rate /= l; in snd_pcm_timer_resolution_change() 55 if (rate == 0) { in snd_pcm_timer_resolution_change() 58 runtime->rate, runtime->period_size); in snd_pcm_timer_resolution_change() 62 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() 189 int rl6231_get_clk_info(int sclk, int rate) in rl6231_get_clk_info() argument 193 if (sclk <= 0 || rate <= 0) in rl6231_get_clk_info() 196 rate = rate << 8; in rl6231_get_clk_info() 198 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 | 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()
|
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 | max98095.c | 37 unsigned int rate; member 912 u32 rate; member 927 static int rate_value(int rate, u8 *value) in rate_value() argument 932 if (rate_table[i].rate >= rate) { in rate_value() 949 unsigned int rate; in max98095_dai1_hw_params() local 954 rate = params_rate(params); in max98095_dai1_hw_params() 969 if (rate_value(rate, ®val)) in max98095_dai1_hw_params() 974 cdata->rate = rate; in max98095_dai1_hw_params() 982 ni = 65536ULL * (rate < 50000 ? 96ULL : 48ULL) in max98095_dai1_hw_params() 983 * (unsigned long long int)rate; in max98095_dai1_hw_params() [all …]
|
/sound/firewire/tascam/ |
D | tascam-stream.c | 28 static int set_clock(struct snd_tscm *tscm, unsigned int rate, in set_clock() argument 40 if (rate > 0) { in set_clock() 43 if ((rate % 44100) == 0) { in set_clock() 46 if (rate / 44100 == 2) in set_clock() 48 } else if ((rate % 48000) == 0) { in set_clock() 51 if (rate / 48000 == 2) in set_clock() 81 int snd_tscm_stream_get_rate(struct snd_tscm *tscm, unsigned int *rate) in snd_tscm_stream_get_rate() argument 97 *rate = 44100; in snd_tscm_stream_get_rate() 99 *rate = 48000; in snd_tscm_stream_get_rate() 105 *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 …]
|
D | digi00x-proc.c | 41 unsigned int rate; in proc_read_clock() local 47 if (snd_dg00x_stream_get_local_rate(dg00x, &rate) < 0) in proc_read_clock() 53 snd_iprintf(buf, "Sampling Rate: %d\n", rate); in proc_read_clock() 65 if (snd_dg00x_stream_get_external_rate(dg00x, &rate) >= 0) in proc_read_clock() 66 snd_iprintf(buf, "External sampling rate: %d\n", rate); in proc_read_clock()
|
/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/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 | 178 if (runtime->rate != in_rate) { in rsnd_adg_get_timesel_ratio() 181 } else if (runtime->rate != out_rate) { in rsnd_adg_get_timesel_ratio() 314 int rsnd_adg_ssi_clk_try_start(struct rsnd_mod *ssi_mod, unsigned int rate) in rsnd_adg_ssi_clk_try_start() argument 329 dev_dbg(dev, "request clock = %d\n", rate); in rsnd_adg_ssi_clk_try_start() 337 if (rate == clk_get_rate(clk)) { in rsnd_adg_ssi_clk_try_start() 346 if (rate == adg->rbga_rate_for_441khz) { in rsnd_adg_ssi_clk_try_start() 351 if (rate == adg->rbgb_rate_for_48khz) { in rsnd_adg_ssi_clk_try_start() 366 if (0 == (rate % 8000)) in rsnd_adg_ssi_clk_try_start() 374 data, rate); in rsnd_adg_ssi_clk_try_start() 414 u32 rate, req_rate = 0, div; in rsnd_adg_get_clkout() local [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()
|
/sound/oss/ |
D | vidc.c | 190 static int vidc_audio_set_speed(int dev, int rate) in vidc_audio_set_speed() argument 192 if (rate) { in vidc_audio_set_speed() 200 hwrate = (((VIDC_SOUND_CLOCK * 2) / rate) + 1) >> 1; in vidc_audio_set_speed() 207 hwrate_ext = (((VIDC_SOUND_CLOCK_EXT * 2) / rate) + 1) >> 1; in vidc_audio_set_speed() 217 diff_int = my_abs(rate_ext-rate); in vidc_audio_set_speed() 218 diff_ext = my_abs(rate_int-rate); in vidc_audio_set_speed() 224 if (diff_ext > (rate/256)) in vidc_audio_set_speed() 225 rate=rate_ext; in vidc_audio_set_speed() 230 if (diff_int > (rate/256)) in vidc_audio_set_speed() 231 rate=rate_int; in vidc_audio_set_speed() [all …]
|
/sound/firewire/bebob/ |
D | bebob_stream.c | 51 get_formation_index(unsigned int rate, unsigned int *index) in get_formation_index() argument 56 if (snd_bebob_rate_table[i] == rate) { in get_formation_index() 98 snd_bebob_stream_set_rate(struct snd_bebob *bebob, unsigned int rate) in snd_bebob_stream_set_rate() argument 102 err = avc_general_set_sig_fmt(bebob->unit, rate, in snd_bebob_stream_set_rate() 107 err = avc_general_set_sig_fmt(bebob->unit, rate, in snd_bebob_stream_set_rate() 422 make_both_connections(struct snd_bebob *bebob, unsigned int rate) in make_both_connections() argument 430 err = get_formation_index(rate, &index); in make_both_connections() 435 err = amdtp_am824_set_parameters(&bebob->tx_stream, rate, in make_both_connections() 443 err = amdtp_am824_set_parameters(&bebob->rx_stream, rate, in make_both_connections() 488 unsigned int rate) in start_stream() argument [all …]
|