diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/patch_nvhdmi.c | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/sound/pci/hda/patch_nvhdmi.c b/sound/pci/hda/patch_nvhdmi.c index c8435c9a97f9..23ad93983118 100644 --- a/sound/pci/hda/patch_nvhdmi.c +++ b/sound/pci/hda/patch_nvhdmi.c | |||
@@ -29,6 +29,9 @@ | |||
29 | #include "hda_codec.h" | 29 | #include "hda_codec.h" |
30 | #include "hda_local.h" | 30 | #include "hda_local.h" |
31 | 31 | ||
32 | /* define below to restrict the supported rates and formats */ | ||
33 | #define LIMITED_RATE_FMT_SUPPORT | ||
34 | |||
32 | struct nvhdmi_spec { | 35 | struct nvhdmi_spec { |
33 | struct hda_multi_out multiout; | 36 | struct hda_multi_out multiout; |
34 | 37 | ||
@@ -60,6 +63,22 @@ static struct hda_verb nvhdmi_basic_init[] = { | |||
60 | {} /* terminator */ | 63 | {} /* terminator */ |
61 | }; | 64 | }; |
62 | 65 | ||
66 | #ifdef LIMITED_RATE_FMT_SUPPORT | ||
67 | /* support only the safe format and rate */ | ||
68 | #define SUPPORTED_RATES SNDRV_PCM_RATE_48000 | ||
69 | #define SUPPORTED_MAXBPS 16 | ||
70 | #define SUPPORTED_FORMATS SNDRV_PCM_FMTBIT_S16_LE | ||
71 | #else | ||
72 | /* support all rates and formats */ | ||
73 | #define SUPPORTED_RATES \ | ||
74 | (SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |\ | ||
75 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |\ | ||
76 | SNDRV_PCM_RATE_192000) | ||
77 | #define SUPPORTED_MAXBPS 24 | ||
78 | #define SUPPORTED_FORMATS \ | ||
79 | (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE) | ||
80 | #endif | ||
81 | |||
63 | /* | 82 | /* |
64 | * Controls | 83 | * Controls |
65 | */ | 84 | */ |
@@ -258,9 +277,9 @@ static struct hda_pcm_stream nvhdmi_pcm_digital_playback_8ch = { | |||
258 | .channels_min = 2, | 277 | .channels_min = 2, |
259 | .channels_max = 8, | 278 | .channels_max = 8, |
260 | .nid = Nv_Master_Convert_nid, | 279 | .nid = Nv_Master_Convert_nid, |
261 | .rates = SNDRV_PCM_RATE_48000, | 280 | .rates = SUPPORTED_RATES, |
262 | .maxbps = 16, | 281 | .maxbps = SUPPORTED_MAXBPS, |
263 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | 282 | .formats = SUPPORTED_FORMATS, |
264 | .ops = { | 283 | .ops = { |
265 | .open = nvhdmi_dig_playback_pcm_open, | 284 | .open = nvhdmi_dig_playback_pcm_open, |
266 | .close = nvhdmi_dig_playback_pcm_close_8ch, | 285 | .close = nvhdmi_dig_playback_pcm_close_8ch, |
@@ -273,9 +292,9 @@ static struct hda_pcm_stream nvhdmi_pcm_digital_playback_2ch = { | |||
273 | .channels_min = 2, | 292 | .channels_min = 2, |
274 | .channels_max = 2, | 293 | .channels_max = 2, |
275 | .nid = Nv_Master_Convert_nid, | 294 | .nid = Nv_Master_Convert_nid, |
276 | .rates = SNDRV_PCM_RATE_48000, | 295 | .rates = SUPPORTED_RATES, |
277 | .maxbps = 16, | 296 | .maxbps = SUPPORTED_MAXBPS, |
278 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | 297 | .formats = SUPPORTED_FORMATS, |
279 | .ops = { | 298 | .ops = { |
280 | .open = nvhdmi_dig_playback_pcm_open, | 299 | .open = nvhdmi_dig_playback_pcm_open, |
281 | .close = nvhdmi_dig_playback_pcm_close_2ch, | 300 | .close = nvhdmi_dig_playback_pcm_close_2ch, |