Lines Matching defs:rate

1220 static int hdspm_round_frequency(int rate)
1222 if (rate < 38050)
1224 if (rate < 46008)
1238 static int hdspm_rate_multiplier(struct hdspm *hdspm, int rate)
1240 if (rate <= 48000) {
1242 return rate * 4;
1245 return rate * 2;
1247 return rate;
1250 /* check for external sample rate, returns the sample rate in Hz*/
1254 int syncref, rate = 0, rate_bits;
1264 /* Check WC sync and get sample rate */
1277 /* Check AES sync and get sample rate */
1285 /* Check TCO sync and get sample rate */
1298 rate = 0; /* no lock */
1302 rate = 32000; break;
1304 rate = 44100; break;
1306 rate = 48000; break;
1308 rate = 64000; break;
1310 rate = 88200; break;
1312 rate = 96000; break;
1314 rate = 128000; break;
1316 rate = 176400; break;
1318 rate = 192000; break;
1320 rate = 0; break;
1331 rate = 0;
1342 rate = 32000;
1345 rate = 44100;
1348 rate = 48000;
1351 rate = 64000;
1354 rate = 88200;
1357 rate = 96000;
1360 rate = 128000;
1363 rate = 176400;
1366 rate = 192000;
1369 rate = 0;
1374 /* if rate detected and Syncref is Word than have it,
1377 if (rate != 0 &&
1379 return hdspm_rate_multiplier(hdspm, rate);
1387 rate = 32000;
1390 rate = 44100;
1393 rate = 48000;
1396 rate = 64000;
1399 rate = 88200;
1402 rate = 96000;
1405 rate = 128000;
1408 rate = 176400;
1411 rate = 192000;
1414 rate = 0;
1420 /* check sample rate from TCO or SYNC_IN */
1437 rate = hdspm_round_frequency(
1442 rate = hdspm_rate_multiplier(hdspm, rate);
1447 return rate;
1593 static void hdspm_set_dds_value(struct hdspm *hdspm, int rate)
1597 if (snd_BUG_ON(rate <= 0))
1600 if (rate >= 112000)
1601 rate /= 4;
1602 else if (rate >= 56000)
1603 rate /= 2;
1622 n = div_u64(n, rate);
1628 /* dummy set rate lets see what happens */
1629 static int hdspm_set_rate(struct hdspm * hdspm, int rate, int called_internally)
1665 } else if (rate != external_freq) {
1668 "Warning: No AutoSync source for requested rate\n");
1682 externally-driven rate changes. All we can do is to flag rate
1693 if (rate <= 48000)
1695 else if (rate <= 96000)
1700 switch (rate) {
1748 hdspm_set_dds_value(hdspm, rate);
1750 if (AES32 == hdspm->io_type && rate != current_rate)
1753 hdspm->system_sample_rate = rate;
1755 if (rate <= 48000) {
1762 } else if (rate <= 96000) {
2189 /* get the system sample rate which is set */
2194 unsigned int period, rate;
2197 rate = hdspm_calc_dds_value(hdspm, period);
2199 return rate;
2203 * Calculate the real sample rate from the
2208 unsigned int rate;
2210 rate = hdspm_get_pll_freq(hdspm);
2212 if (rate > 207000) {
2213 /* Unreasonable high sample rate as seen on PCI MADI cards. */
2215 /* master mode, return internal sample rate */
2216 rate = hdspm->system_sample_rate;
2218 /* slave mode, return external sample rate */
2219 rate = hdspm_external_sample_rate(hdspm);
2220 if (!rate)
2221 rate = hdspm->system_sample_rate;
2225 return rate;
2267 int rate = ucontrol->value.integer.value[0];
2269 if (rate < 27000 || rate > 207000)
2277 * Returns the WordClock sample rate class for the given card.
2301 * Returns the TCO sample rate class for the given card.
2326 * Returns the SYNC_IN sample rate class for the given card.
2347 * Returns the AES sample rate class for the given card.
2364 * Returns the sample rate class for input source <idx> for
2378 /* Helper function to query the external sample rate and return the
2383 int rate = hdspm_external_sample_rate(hdspm);
2386 if (HDSPM_bit2freq(i) == rate) {
2616 int rate;
2619 rate = 32000; break;
2621 rate = 44100; break;
2623 rate = 48000; break;
2625 rate = 64000; break;
2627 rate = 88200; break;
2629 rate = 96000; break;
2631 rate = 128000; break;
2633 rate = 176400; break;
2635 rate = 192000; break;
2637 rate = 48000;
2639 hdspm_set_rate(hdspm, rate, 1);
4751 u32 rate;
4817 /* rate = freq_const/period; */
4818 rate = div_u64(freq_const, period);
4821 rate *= 4;
4823 rate *= 2;
4827 (unsigned int) rate);
5367 /* set a default rate so that the channel map is set up. */
5535 /* how to make sure that the rate matches an externally-set one ? */