diff options
| author | Adrian Knoth <adi@drcomp.erfurt.thur.de> | 2012-10-19 11:42:23 -0400 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2012-10-20 04:40:07 -0400 |
| commit | 21a164df0c1c2e72d4bb78b2f67dc75a1c9d14fb (patch) | |
| tree | 99a3f9b057232463ddc261780d1301d50f800e0f | |
| parent | 41285a98f8f052b59f01bbbcb0064e5e41b0ca2d (diff) | |
ALSA: hdspm - Report external rate in slave mode on PCI MADI
As a follow-up to a97bda7d29d02a2e9c6609d0947b15e55f5200e5, report the
external sample rate as system_sample_rate when in slave mode.
For PCIe MADI cards, the DDS value automatically contains the external
sample rate, but the PCI version needs this manual workaround.
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
| -rw-r--r-- | sound/pci/rme9652/hdspm.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 742bd5e430ab..1131a8ab3f73 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c | |||
| @@ -971,6 +971,7 @@ static inline void snd_hdspm_initialize_midi_flush(struct hdspm *hdspm); | |||
| 971 | static int hdspm_update_simple_mixer_controls(struct hdspm *hdspm); | 971 | static int hdspm_update_simple_mixer_controls(struct hdspm *hdspm); |
| 972 | static int hdspm_autosync_ref(struct hdspm *hdspm); | 972 | static int hdspm_autosync_ref(struct hdspm *hdspm); |
| 973 | static int snd_hdspm_set_defaults(struct hdspm *hdspm); | 973 | static int snd_hdspm_set_defaults(struct hdspm *hdspm); |
| 974 | static int hdspm_system_clock_mode(struct hdspm *hdspm); | ||
| 974 | static void hdspm_set_sgbuf(struct hdspm *hdspm, | 975 | static void hdspm_set_sgbuf(struct hdspm *hdspm, |
| 975 | struct snd_pcm_substream *substream, | 976 | struct snd_pcm_substream *substream, |
| 976 | unsigned int reg, int channels); | 977 | unsigned int reg, int channels); |
| @@ -1989,10 +1990,14 @@ static int hdspm_get_system_sample_rate(struct hdspm *hdspm) | |||
| 1989 | rate = hdspm_calc_dds_value(hdspm, period); | 1990 | rate = hdspm_calc_dds_value(hdspm, period); |
| 1990 | 1991 | ||
| 1991 | if (rate > 207000) { | 1992 | if (rate > 207000) { |
| 1992 | /* Unreasonable high sample rate as seen on PCI MADI cards. | 1993 | /* Unreasonable high sample rate as seen on PCI MADI cards. */ |
| 1993 | * Use the cached value instead. | 1994 | if (0 == hdspm_system_clock_mode(hdspm)) { |
| 1994 | */ | 1995 | /* master mode, return internal sample rate */ |
| 1995 | rate = hdspm->system_sample_rate; | 1996 | rate = hdspm->system_sample_rate; |
| 1997 | } else { | ||
| 1998 | /* slave mode, return external sample rate */ | ||
| 1999 | rate = hdspm_external_sample_rate(hdspm); | ||
| 2000 | } | ||
| 1996 | } | 2001 | } |
| 1997 | 2002 | ||
| 1998 | return rate; | 2003 | return rate; |
