aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-02-10 05:56:44 -0500
committerTakashi Iwai <tiwai@suse.de>2009-02-10 05:56:44 -0500
commit22971e3a77f193579be525a12f3ab91dbf241517 (patch)
tree6ef52817d5a1a604d49e4e35495744acea4bb723 /sound/pci/hda/patch_realtek.c
parentdea0a5095b5e21306a81c496567043798fac7815 (diff)
ALSA: hda - add digital beep support for ALC268
Added the digital beep support for ALC268. It was missing in the last patches. However, ALC268 has a strange pin use for widget 0x1d, which could be used as another purpose. So, the patch adds a check of the beep control before creating the hook for input layer. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 7ae8fad0189f..97eaf3b1d97f 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -11885,7 +11885,7 @@ static struct snd_pci_quirk alc268_cfg_tbl[] = {
11885 11885
11886static struct alc_config_preset alc268_presets[] = { 11886static struct alc_config_preset alc268_presets[] = {
11887 [ALC267_QUANTA_IL1] = { 11887 [ALC267_QUANTA_IL1] = {
11888 .mixers = { alc267_quanta_il1_mixer }, 11888 .mixers = { alc267_quanta_il1_mixer, alc268_beep_mixer },
11889 .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs, 11889 .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
11890 alc267_quanta_il1_verbs }, 11890 alc267_quanta_il1_verbs },
11891 .num_dacs = ARRAY_SIZE(alc268_dac_nids), 11891 .num_dacs = ARRAY_SIZE(alc268_dac_nids),
@@ -11967,7 +11967,8 @@ static struct alc_config_preset alc268_presets[] = {
11967 }, 11967 },
11968 [ALC268_ACER_ASPIRE_ONE] = { 11968 [ALC268_ACER_ASPIRE_ONE] = {
11969 .mixers = { alc268_acer_aspire_one_mixer, 11969 .mixers = { alc268_acer_aspire_one_mixer,
11970 alc268_capture_alt_mixer }, 11970 alc268_beep_mixer,
11971 alc268_capture_alt_mixer },
11971 .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs, 11972 .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
11972 alc268_acer_aspire_one_verbs }, 11973 alc268_acer_aspire_one_verbs },
11973 .num_dacs = ARRAY_SIZE(alc268_dac_nids), 11974 .num_dacs = ARRAY_SIZE(alc268_dac_nids),
@@ -12036,7 +12037,7 @@ static int patch_alc268(struct hda_codec *codec)
12036{ 12037{
12037 struct alc_spec *spec; 12038 struct alc_spec *spec;
12038 int board_config; 12039 int board_config;
12039 int err; 12040 int i, has_beep, err;
12040 12041
12041 spec = kcalloc(1, sizeof(*spec), GFP_KERNEL); 12042 spec = kcalloc(1, sizeof(*spec), GFP_KERNEL);
12042 if (spec == NULL) 12043 if (spec == NULL)
@@ -12091,13 +12092,28 @@ static int patch_alc268(struct hda_codec *codec)
12091 12092
12092 spec->stream_digital_playback = &alc268_pcm_digital_playback; 12093 spec->stream_digital_playback = &alc268_pcm_digital_playback;
12093 12094
12094 if (!query_amp_caps(codec, 0x1d, HDA_INPUT)) 12095 has_beep = 0;
12095 /* override the amp caps for beep generator */ 12096 for (i = 0; i < spec->num_mixers; i++) {
12096 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT, 12097 if (spec->mixers[i] == alc268_beep_mixer) {
12098 has_beep = 1;
12099 break;
12100 }
12101 }
12102
12103 if (has_beep) {
12104 err = snd_hda_attach_beep_device(codec, 0x1);
12105 if (err < 0) {
12106 alc_free(codec);
12107 return err;
12108 }
12109 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
12110 /* override the amp caps for beep generator */
12111 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
12097 (0x0c << AC_AMPCAP_OFFSET_SHIFT) | 12112 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
12098 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) | 12113 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
12099 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) | 12114 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
12100 (0 << AC_AMPCAP_MUTE_SHIFT)); 12115 (0 << AC_AMPCAP_MUTE_SHIFT));
12116 }
12101 12117
12102 if (!spec->adc_nids && spec->input_mux) { 12118 if (!spec->adc_nids && spec->input_mux) {
12103 /* check whether NID 0x07 is valid */ 12119 /* check whether NID 0x07 is valid */