Skip to content

Commit

Permalink
ALSA: hda - Remove invalid init verbs for Nvidia 2ch codecs
Browse files Browse the repository at this point in the history
Nvidia 2ch codecs have no NIDs greather than 0x05.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Jun 15, 2012
1 parent d0b1252 commit ceaa86b
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions sound/pci/hda/patch_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,15 @@ static const hda_nid_t nvhdmi_con_nids_7x[4] = {
0x6, 0x8, 0xa, 0xc,
};

static const struct hda_verb nvhdmi_basic_init_7x[] = {
static const struct hda_verb nvhdmi_basic_init_7x_2ch[] = {
/* set audio protect on */
{ 0x1, Nv_VERB_SET_Audio_Protection_On, 0x1},
/* enable digital output on pin widget */
{ 0x5, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x5 },
{} /* terminator */
};

static const struct hda_verb nvhdmi_basic_init_7x_8ch[] = {
/* set audio protect on */
{ 0x1, Nv_VERB_SET_Audio_Protection_On, 0x1},
/* enable digital output on pin widget */
Expand Down Expand Up @@ -1481,9 +1489,15 @@ static const struct hda_verb nvhdmi_basic_init_7x[] = {
(SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE)
#endif

static int nvhdmi_7x_init(struct hda_codec *codec)
static int nvhdmi_7x_init_2ch(struct hda_codec *codec)
{
snd_hda_sequence_write(codec, nvhdmi_basic_init_7x_2ch);
return 0;
}

static int nvhdmi_7x_init_8ch(struct hda_codec *codec)
{
snd_hda_sequence_write(codec, nvhdmi_basic_init_7x);
snd_hda_sequence_write(codec, nvhdmi_basic_init_7x_8ch);
return 0;
}

Expand Down Expand Up @@ -1782,7 +1796,7 @@ static int patch_nvhdmi_2ch(struct hda_codec *codec)
if (err < 0)
return err;

codec->patch_ops.init = nvhdmi_7x_init;
codec->patch_ops.init = nvhdmi_7x_init_2ch;
/* override the PCM rates, etc, as the codec doesn't give full list */
spec = codec->spec;
spec->pcm_playback.rates = SUPPORTED_RATES;
Expand All @@ -1800,6 +1814,7 @@ static int patch_nvhdmi_8ch_7x(struct hda_codec *codec)
spec = codec->spec;
spec->multiout.max_channels = 8;
spec->pcm_playback = nvhdmi_pcm_playback_8ch_7x;
codec->patch_ops.init = nvhdmi_7x_init_8ch;

/* Initialize the audio infoframe channel mask and checksum to something
* valid */
Expand Down

0 comments on commit ceaa86b

Please sign in to comment.