diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-08-01 06:17:41 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-09-06 12:08:30 -0400 |
commit | 53775b0d0cb91ab217c9853efddc51597b58bbff (patch) | |
tree | 310b5894512f70a74fd7ce0226932221b4d2b803 /sound/pci/hda | |
parent | d45e6889ee69456a4d5b1bbb32252f460cd48fa9 (diff) |
ALSA: hda - Fix channel maps for Nvidia 7x 8ch HDMI codecs
Some old Nvidia HDMI codecs with 8ch support only 2/8 or
2/6/8 channels and with the fixed CLFE-first map.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r-- | sound/pci/hda/patch_hdmi.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 4a5d24fe8adf..2c53ea889da9 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -2155,6 +2155,43 @@ static int patch_nvhdmi_2ch(struct hda_codec *codec) | |||
2155 | return 0; | 2155 | return 0; |
2156 | } | 2156 | } |
2157 | 2157 | ||
2158 | static int nvhdmi_7x_8ch_build_pcms(struct hda_codec *codec) | ||
2159 | { | ||
2160 | struct hdmi_spec *spec = codec->spec; | ||
2161 | int err = simple_playback_build_pcms(codec); | ||
2162 | spec->pcm_rec[0].own_chmap = true; | ||
2163 | return err; | ||
2164 | } | ||
2165 | |||
2166 | static int nvhdmi_7x_8ch_build_controls(struct hda_codec *codec) | ||
2167 | { | ||
2168 | struct hdmi_spec *spec = codec->spec; | ||
2169 | struct snd_pcm_chmap *chmap; | ||
2170 | int err; | ||
2171 | |||
2172 | err = simple_playback_build_controls(codec); | ||
2173 | if (err < 0) | ||
2174 | return err; | ||
2175 | |||
2176 | /* add channel maps */ | ||
2177 | err = snd_pcm_add_chmap_ctls(spec->pcm_rec[0].pcm, | ||
2178 | SNDRV_PCM_STREAM_PLAYBACK, | ||
2179 | snd_pcm_alt_chmaps, 8, 0, &chmap); | ||
2180 | if (err < 0) | ||
2181 | return err; | ||
2182 | switch (codec->preset->id) { | ||
2183 | case 0x10de0002: | ||
2184 | case 0x10de0003: | ||
2185 | case 0x10de0005: | ||
2186 | case 0x10de0006: | ||
2187 | chmap->channel_mask = (1U << 2) | (1U << 8); | ||
2188 | break; | ||
2189 | case 0x10de0007: | ||
2190 | chmap->channel_mask = (1U << 2) | (1U << 6) | (1U << 8); | ||
2191 | } | ||
2192 | return 0; | ||
2193 | } | ||
2194 | |||
2158 | static int patch_nvhdmi_8ch_7x(struct hda_codec *codec) | 2195 | static int patch_nvhdmi_8ch_7x(struct hda_codec *codec) |
2159 | { | 2196 | { |
2160 | struct hdmi_spec *spec; | 2197 | struct hdmi_spec *spec; |
@@ -2165,6 +2202,8 @@ static int patch_nvhdmi_8ch_7x(struct hda_codec *codec) | |||
2165 | spec->multiout.max_channels = 8; | 2202 | spec->multiout.max_channels = 8; |
2166 | spec->pcm_playback = nvhdmi_pcm_playback_8ch_7x; | 2203 | spec->pcm_playback = nvhdmi_pcm_playback_8ch_7x; |
2167 | codec->patch_ops.init = nvhdmi_7x_init_8ch; | 2204 | codec->patch_ops.init = nvhdmi_7x_init_8ch; |
2205 | codec->patch_ops.build_pcms = nvhdmi_7x_8ch_build_pcms; | ||
2206 | codec->patch_ops.build_controls = nvhdmi_7x_8ch_build_controls; | ||
2168 | 2207 | ||
2169 | /* Initialize the audio infoframe channel mask and checksum to something | 2208 | /* Initialize the audio infoframe channel mask and checksum to something |
2170 | * valid */ | 2209 | * valid */ |