Lines Matching defs:rate
1221 static int hdspm_round_frequency(int rate)
1223 if (rate < 38050)
1225 if (rate < 46008)
1239 static int hdspm_rate_multiplier(struct hdspm *hdspm, int rate)
1241 if (rate <= 48000) {
1243 return rate * 4;
1246 return rate * 2;
1248 return rate;
1251 /* check for external sample rate, returns the sample rate in Hz*/
1255 int syncref, rate = 0, rate_bits;
1265 /* Check WC sync and get sample rate */
1278 /* Check AES sync and get sample rate */
1286 /* Check TCO sync and get sample rate */
1299 rate = 0; /* no lock */
1303 rate = 32000; break;
1305 rate = 44100; break;
1307 rate = 48000; break;
1309 rate = 64000; break;
1311 rate = 88200; break;
1313 rate = 96000; break;
1315 rate = 128000; break;
1317 rate = 176400; break;
1319 rate = 192000; break;
1321 rate = 0; break;
1332 rate = 0;
1343 rate = 32000;
1346 rate = 44100;
1349 rate = 48000;
1352 rate = 64000;
1355 rate = 88200;
1358 rate = 96000;
1361 rate = 128000;
1364 rate = 176400;
1367 rate = 192000;
1370 rate = 0;
1375 /* if rate detected and Syncref is Word than have it,
1378 if (rate != 0 &&
1380 return hdspm_rate_multiplier(hdspm, rate);
1388 rate = 32000;
1391 rate = 44100;
1394 rate = 48000;
1397 rate = 64000;
1400 rate = 88200;
1403 rate = 96000;
1406 rate = 128000;
1409 rate = 176400;
1412 rate = 192000;
1415 rate = 0;
1421 /* check sample rate from TCO or SYNC_IN */
1438 rate = hdspm_round_frequency(
1443 rate = hdspm_rate_multiplier(hdspm, rate);
1448 return rate;
1594 static void hdspm_set_dds_value(struct hdspm *hdspm, int rate)
1598 if (snd_BUG_ON(rate <= 0))
1601 if (rate >= 112000)
1602 rate /= 4;
1603 else if (rate >= 56000)
1604 rate /= 2;
1623 n = div_u64(n, rate);
1629 /* dummy set rate lets see what happens */
1630 static int hdspm_set_rate(struct hdspm * hdspm, int rate, int called_internally)
1666 } else if (rate != external_freq) {
1669 "Warning: No AutoSync source for requested rate\n");
1683 externally-driven rate changes. All we can do is to flag rate
1694 if (rate <= 48000)
1696 else if (rate <= 96000)
1701 switch (rate) {
1749 hdspm_set_dds_value(hdspm, rate);
1751 if (AES32 == hdspm->io_type && rate != current_rate)
1754 hdspm->system_sample_rate = rate;
1756 if (rate <= 48000) {
1763 } else if (rate <= 96000) {
2190 /* get the system sample rate which is set */
2195 unsigned int period, rate;
2198 rate = hdspm_calc_dds_value(hdspm, period);
2200 return rate;
2204 * Calculate the real sample rate from the
2209 unsigned int rate;
2211 rate = hdspm_get_pll_freq(hdspm);
2213 if (rate > 207000) {
2214 /* Unreasonable high sample rate as seen on PCI MADI cards. */
2216 /* master mode, return internal sample rate */
2217 rate = hdspm->system_sample_rate;
2219 /* slave mode, return external sample rate */
2220 rate = hdspm_external_sample_rate(hdspm);
2221 if (!rate)
2222 rate = hdspm->system_sample_rate;
2226 return rate;
2268 int rate = ucontrol->value.integer.value[0];
2270 if (rate < 27000 || rate > 207000)
2278 * Returns the WordClock sample rate class for the given card.
2303 * Returns the TCO sample rate class for the given card.
2329 * Returns the SYNC_IN sample rate class for the given card.
2351 * Returns the AES sample rate class for the given card.
2369 * Returns the sample rate class for input source <idx> for
2383 /* Helper function to query the external sample rate and return the
2388 int rate = hdspm_external_sample_rate(hdspm);
2391 if (HDSPM_bit2freq(i) == rate) {
2621 int rate;
2624 rate = 32000; break;
2626 rate = 44100; break;
2628 rate = 48000; break;
2630 rate = 64000; break;
2632 rate = 88200; break;
2634 rate = 96000; break;
2636 rate = 128000; break;
2638 rate = 176400; break;
2640 rate = 192000; break;
2642 rate = 48000;
2644 hdspm_set_rate(hdspm, rate, 1);
4760 u32 rate;
4826 /* rate = freq_const/period; */
4827 rate = div_u64(freq_const, period);
4830 rate *= 4;
4832 rate *= 2;
4836 (unsigned int) rate);
5376 /* set a default rate so that the channel map is set up. */
5544 /* how to make sure that the rate matches an externally-set one ? */