aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/rme9652
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 22:52:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 22:52:22 -0400
commit1286da8bc009cb2aee7f285e94623fc974c0c983 (patch)
tree51ec0a79c3de63fa809b831ae0cbb5b85e44482f /sound/pci/rme9652
parent9e220385c4eb8b7e66174a60ea0e15b6b296f228 (diff)
parent1ba65ae4bdbd43265c51ee4c30ff21a48124b6d8 (diff)
Merge tag 'sound-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound updates from Takashi Iwai: "A relative calm release at this time with a flat diffstat. The only significant change in the ALSA core side is the support for more than 32 card instances, configurable via kconfig. Other than that, in both ASoC and other parts, mostly some improvements and fixes on the driver side. - hda: More quirks for ALC269-variants on Dell & co, VIA codec fixes - hda: Haswell HDMI audio fixes, runtime PM improvements - hda: Intel BayTrail support, ALC5505 DSP support - es1968: MediaForte M56VAP support - usb-audio: Improved support for Yamaha/Roland devices - usb-audio: M2Tech hiFace, Audio Advantage Micro II support - hdspm: wordclock fixes - ASoC: Pending fixes for WM8962 - ASoC: Cleanups and fixes for Blackfin, SGTL5000 and UX500 - ASoC: Generalisation of the Bluetooth and HDMI stub drivers - ASoC: SSM2518 and RT5640 codec drivers. - ASoC: Tegra CPUs with RT5640 machine driver - ASoC: AC'97 refactoring bug fixes - ASoC: ADAU1701 driver fixes - Clean up of *_set_drvdata() in a wide range of drivers" * tag 'sound-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (284 commits) ALSA: vmaster: Fix the regression of missing vmaster hook call ALSA: hda - Add Dell SSID to support Headset Mic recording ASoC: adau1701: remove control_data assignment ASoC: adau1701: more direct regmap usage ASoC: ac97: fixup multi-platform AC'97 module build failure ASoC: pxa2xx: fixup multi-platform AC'97 build failures ASoC: tegra20-ac97: Remove unused variable ASoC: tegra20-ac97: Remove duplicate error message ALSA: usb-audio: Add Audio Advantage Micro II ASoC: tas5086: fix Mid-Z implementation ASoC: tas5086: fix TAS5086_CLOCK_CONTROL register size ALSA: Replace the magic number 44 with const ALSA: hda - Fix the max length of control name in generic parser ALSA: hda - Guess what, it's two more Dell headset mic quirks ALSA: hda - Yet another Dell headset mic quirk ALSA: hda - Add support for ALC5505 DSP power-save mode ASoC: mfld: Remove unused variable ALSA: usb-audio: add quirks for Roland QUAD/OCTO-CAPTURE ALSA: usb-audio: claim autodetected PCM interfaces all at once ALSA: usb-audio: remove superfluous Roland quirks ...
Diffstat (limited to 'sound/pci/rme9652')
-rw-r--r--sound/pci/rme9652/hdsp.c1
-rw-r--r--sound/pci/rme9652/hdspm.c59
-rw-r--r--sound/pci/rme9652/rme9652.c1
3 files changed, 39 insertions, 22 deletions
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index 94084cdb130c..4f255dfee450 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -5412,7 +5412,6 @@ static int snd_hdsp_probe(struct pci_dev *pci,
5412static void snd_hdsp_remove(struct pci_dev *pci) 5412static void snd_hdsp_remove(struct pci_dev *pci)
5413{ 5413{
5414 snd_card_free(pci_get_drvdata(pci)); 5414 snd_card_free(pci_get_drvdata(pci));
5415 pci_set_drvdata(pci, NULL);
5416} 5415}
5417 5416
5418static struct pci_driver hdsp_driver = { 5417static struct pci_driver hdsp_driver = {
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 9ea05e956474..bd501931ee23 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -400,8 +400,8 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
400 400
401#define HDSPM_wc_freq0 (1<<5) /* input freq detected via autosync */ 401#define HDSPM_wc_freq0 (1<<5) /* input freq detected via autosync */
402#define HDSPM_wc_freq1 (1<<6) /* 001=32, 010==44.1, 011=48, */ 402#define HDSPM_wc_freq1 (1<<6) /* 001=32, 010==44.1, 011=48, */
403#define HDSPM_wc_freq2 (1<<7) /* 100=64, 101=88.2, 110=96, */ 403#define HDSPM_wc_freq2 (1<<7) /* 100=64, 101=88.2, 110=96, 111=128 */
404/* missing Bit for 111=128, 1000=176.4, 1001=192 */ 404#define HDSPM_wc_freq3 0x800 /* 1000=176.4, 1001=192 */
405 405
406#define HDSPM_SyncRef0 0x10000 /* Sync Reference */ 406#define HDSPM_SyncRef0 0x10000 /* Sync Reference */
407#define HDSPM_SyncRef1 0x20000 407#define HDSPM_SyncRef1 0x20000
@@ -412,13 +412,17 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
412 412
413#define HDSPM_wc_valid (HDSPM_wcLock|HDSPM_wcSync) 413#define HDSPM_wc_valid (HDSPM_wcLock|HDSPM_wcSync)
414 414
415#define HDSPM_wcFreqMask (HDSPM_wc_freq0|HDSPM_wc_freq1|HDSPM_wc_freq2) 415#define HDSPM_wcFreqMask (HDSPM_wc_freq0|HDSPM_wc_freq1|HDSPM_wc_freq2|\
416 HDSPM_wc_freq3)
416#define HDSPM_wcFreq32 (HDSPM_wc_freq0) 417#define HDSPM_wcFreq32 (HDSPM_wc_freq0)
417#define HDSPM_wcFreq44_1 (HDSPM_wc_freq1) 418#define HDSPM_wcFreq44_1 (HDSPM_wc_freq1)
418#define HDSPM_wcFreq48 (HDSPM_wc_freq0|HDSPM_wc_freq1) 419#define HDSPM_wcFreq48 (HDSPM_wc_freq0|HDSPM_wc_freq1)
419#define HDSPM_wcFreq64 (HDSPM_wc_freq2) 420#define HDSPM_wcFreq64 (HDSPM_wc_freq2)
420#define HDSPM_wcFreq88_2 (HDSPM_wc_freq0|HDSPM_wc_freq2) 421#define HDSPM_wcFreq88_2 (HDSPM_wc_freq0|HDSPM_wc_freq2)
421#define HDSPM_wcFreq96 (HDSPM_wc_freq1|HDSPM_wc_freq2) 422#define HDSPM_wcFreq96 (HDSPM_wc_freq1|HDSPM_wc_freq2)
423#define HDSPM_wcFreq128 (HDSPM_wc_freq0|HDSPM_wc_freq1|HDSPM_wc_freq2)
424#define HDSPM_wcFreq176_4 (HDSPM_wc_freq3)
425#define HDSPM_wcFreq192 (HDSPM_wc_freq0|HDSPM_wc_freq3)
422 426
423#define HDSPM_status1_F_0 0x0400000 427#define HDSPM_status1_F_0 0x0400000
424#define HDSPM_status1_F_1 0x0800000 428#define HDSPM_status1_F_1 0x0800000
@@ -1087,6 +1091,26 @@ static int hdspm_round_frequency(int rate)
1087 return 48000; 1091 return 48000;
1088} 1092}
1089 1093
1094/* QS and DS rates normally can not be detected
1095 * automatically by the card. Only exception is MADI
1096 * in 96k frame mode.
1097 *
1098 * So if we read SS values (32 .. 48k), check for
1099 * user-provided DS/QS bits in the control register
1100 * and multiply the base frequency accordingly.
1101 */
1102static int hdspm_rate_multiplier(struct hdspm *hdspm, int rate)
1103{
1104 if (rate <= 48000) {
1105 if (hdspm->control_register & HDSPM_QuadSpeed)
1106 return rate * 4;
1107 else if (hdspm->control_register &
1108 HDSPM_DoubleSpeed)
1109 return rate * 2;
1110 };
1111 return rate;
1112}
1113
1090static int hdspm_tco_sync_check(struct hdspm *hdspm); 1114static int hdspm_tco_sync_check(struct hdspm *hdspm);
1091static int hdspm_sync_in_sync_check(struct hdspm *hdspm); 1115static int hdspm_sync_in_sync_check(struct hdspm *hdspm);
1092 1116
@@ -1181,6 +1205,15 @@ static int hdspm_external_sample_rate(struct hdspm *hdspm)
1181 case HDSPM_wcFreq96: 1205 case HDSPM_wcFreq96:
1182 rate = 96000; 1206 rate = 96000;
1183 break; 1207 break;
1208 case HDSPM_wcFreq128:
1209 rate = 128000;
1210 break;
1211 case HDSPM_wcFreq176_4:
1212 rate = 176400;
1213 break;
1214 case HDSPM_wcFreq192:
1215 rate = 192000;
1216 break;
1184 default: 1217 default:
1185 rate = 0; 1218 rate = 0;
1186 break; 1219 break;
@@ -1192,7 +1225,7 @@ static int hdspm_external_sample_rate(struct hdspm *hdspm)
1192 */ 1225 */
1193 if (rate != 0 && 1226 if (rate != 0 &&
1194 (status2 & HDSPM_SelSyncRefMask) == HDSPM_SelSyncRef_WORD) 1227 (status2 & HDSPM_SelSyncRefMask) == HDSPM_SelSyncRef_WORD)
1195 return rate; 1228 return hdspm_rate_multiplier(hdspm, rate);
1196 1229
1197 /* maybe a madi input (which is taken if sel sync is madi) */ 1230 /* maybe a madi input (which is taken if sel sync is madi) */
1198 if (status & HDSPM_madiLock) { 1231 if (status & HDSPM_madiLock) {
@@ -1255,21 +1288,8 @@ static int hdspm_external_sample_rate(struct hdspm *hdspm)
1255 } 1288 }
1256 } 1289 }
1257 1290
1258 /* QS and DS rates normally can not be detected 1291 rate = hdspm_rate_multiplier(hdspm, rate);
1259 * automatically by the card. Only exception is MADI 1292
1260 * in 96k frame mode.
1261 *
1262 * So if we read SS values (32 .. 48k), check for
1263 * user-provided DS/QS bits in the control register
1264 * and multiply the base frequency accordingly.
1265 */
1266 if (rate <= 48000) {
1267 if (hdspm->control_register & HDSPM_QuadSpeed)
1268 rate *= 4;
1269 else if (hdspm->control_register &
1270 HDSPM_DoubleSpeed)
1271 rate *= 2;
1272 }
1273 break; 1293 break;
1274 } 1294 }
1275 1295
@@ -6737,7 +6757,6 @@ static int snd_hdspm_probe(struct pci_dev *pci,
6737static void snd_hdspm_remove(struct pci_dev *pci) 6757static void snd_hdspm_remove(struct pci_dev *pci)
6738{ 6758{
6739 snd_card_free(pci_get_drvdata(pci)); 6759 snd_card_free(pci_get_drvdata(pci));
6740 pci_set_drvdata(pci, NULL);
6741} 6760}
6742 6761
6743static struct pci_driver hdspm_driver = { 6762static struct pci_driver hdspm_driver = {
diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c
index 773a67fff4cd..b96d9e1adf6d 100644
--- a/sound/pci/rme9652/rme9652.c
+++ b/sound/pci/rme9652/rme9652.c
@@ -2628,7 +2628,6 @@ static int snd_rme9652_probe(struct pci_dev *pci,
2628static void snd_rme9652_remove(struct pci_dev *pci) 2628static void snd_rme9652_remove(struct pci_dev *pci)
2629{ 2629{
2630 snd_card_free(pci_get_drvdata(pci)); 2630 snd_card_free(pci_get_drvdata(pci));
2631 pci_set_drvdata(pci, NULL);
2632} 2631}
2633 2632
2634static struct pci_driver rme9652_driver = { 2633static struct pci_driver rme9652_driver = {