diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-08-24 08:10:30 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-08-24 08:10:30 -0400 |
commit | 9d0b71b1cf7b7ff856d200841de3f3d7c64eb170 (patch) | |
tree | 42d22d0f9b142e732f0d08909c568f029e3f2c43 /sound/pci | |
parent | fd72d008465d45db63d7f8931eea6a04e05916d6 (diff) |
ALSA: hda - Reuse ALC268 parser for ALC269
Reuse a part of the code of ALC268 parser for ALC269.
This will change the default output volume either to Front or Speaker
depending on the pin configuration.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 83 |
1 files changed, 2 insertions, 81 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 084e291e12de..dd25db936773 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -13086,87 +13086,8 @@ static struct hda_verb alc269_init_verbs[] = { | |||
13086 | { } | 13086 | { } |
13087 | }; | 13087 | }; |
13088 | 13088 | ||
13089 | /* add playback controls from the parsed DAC table */ | 13089 | #define alc269_auto_create_multi_out_ctls \ |
13090 | static int alc269_auto_create_multi_out_ctls(struct alc_spec *spec, | 13090 | alc268_auto_create_multi_out_ctls |
13091 | const struct auto_pin_cfg *cfg) | ||
13092 | { | ||
13093 | hda_nid_t nid; | ||
13094 | int err; | ||
13095 | |||
13096 | spec->multiout.num_dacs = 1; /* only use one dac */ | ||
13097 | spec->multiout.dac_nids = spec->private_dac_nids; | ||
13098 | spec->multiout.dac_nids[0] = 2; | ||
13099 | |||
13100 | nid = cfg->line_out_pins[0]; | ||
13101 | if (nid) { | ||
13102 | err = add_control(spec, ALC_CTL_WIDGET_VOL, | ||
13103 | "Front Playback Volume", | ||
13104 | HDA_COMPOSE_AMP_VAL(0x02, 3, 0, HDA_OUTPUT)); | ||
13105 | if (err < 0) | ||
13106 | return err; | ||
13107 | err = add_control(spec, ALC_CTL_WIDGET_MUTE, | ||
13108 | "Front Playback Switch", | ||
13109 | HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_OUTPUT)); | ||
13110 | if (err < 0) | ||
13111 | return err; | ||
13112 | } | ||
13113 | |||
13114 | nid = cfg->speaker_pins[0]; | ||
13115 | if (nid) { | ||
13116 | if (!cfg->line_out_pins[0]) { | ||
13117 | err = add_control(spec, ALC_CTL_WIDGET_VOL, | ||
13118 | "Speaker Playback Volume", | ||
13119 | HDA_COMPOSE_AMP_VAL(0x02, 3, 0, | ||
13120 | HDA_OUTPUT)); | ||
13121 | if (err < 0) | ||
13122 | return err; | ||
13123 | } | ||
13124 | if (nid == 0x16) { | ||
13125 | err = add_control(spec, ALC_CTL_WIDGET_MUTE, | ||
13126 | "Speaker Playback Switch", | ||
13127 | HDA_COMPOSE_AMP_VAL(nid, 2, 0, | ||
13128 | HDA_OUTPUT)); | ||
13129 | if (err < 0) | ||
13130 | return err; | ||
13131 | } else { | ||
13132 | err = add_control(spec, ALC_CTL_WIDGET_MUTE, | ||
13133 | "Speaker Playback Switch", | ||
13134 | HDA_COMPOSE_AMP_VAL(nid, 3, 0, | ||
13135 | HDA_OUTPUT)); | ||
13136 | if (err < 0) | ||
13137 | return err; | ||
13138 | } | ||
13139 | } | ||
13140 | nid = cfg->hp_pins[0]; | ||
13141 | if (nid) { | ||
13142 | /* spec->multiout.hp_nid = 2; */ | ||
13143 | if (!cfg->line_out_pins[0] && !cfg->speaker_pins[0]) { | ||
13144 | err = add_control(spec, ALC_CTL_WIDGET_VOL, | ||
13145 | "Headphone Playback Volume", | ||
13146 | HDA_COMPOSE_AMP_VAL(0x02, 3, 0, | ||
13147 | HDA_OUTPUT)); | ||
13148 | if (err < 0) | ||
13149 | return err; | ||
13150 | } | ||
13151 | if (nid == 0x16) { | ||
13152 | err = add_control(spec, ALC_CTL_WIDGET_MUTE, | ||
13153 | "Headphone Playback Switch", | ||
13154 | HDA_COMPOSE_AMP_VAL(nid, 2, 0, | ||
13155 | HDA_OUTPUT)); | ||
13156 | if (err < 0) | ||
13157 | return err; | ||
13158 | } else { | ||
13159 | err = add_control(spec, ALC_CTL_WIDGET_MUTE, | ||
13160 | "Headphone Playback Switch", | ||
13161 | HDA_COMPOSE_AMP_VAL(nid, 3, 0, | ||
13162 | HDA_OUTPUT)); | ||
13163 | if (err < 0) | ||
13164 | return err; | ||
13165 | } | ||
13166 | } | ||
13167 | return 0; | ||
13168 | } | ||
13169 | |||
13170 | #define alc269_auto_create_analog_input_ctls \ | 13091 | #define alc269_auto_create_analog_input_ctls \ |
13171 | alc262_auto_create_analog_input_ctls | 13092 | alc262_auto_create_analog_input_ctls |
13172 | 13093 | ||