diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-10-11 11:53:33 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-10-11 11:53:33 -0400 |
commit | 26917499fd4d9e699e17f9f3b23f856ce5c5283a (patch) | |
tree | d9d1905ec0d286b8abf1b67dadb99ea7b30194a1 /sound/pci/hda | |
parent | 0afe5f891501609f31146798fb41784f4adad27c (diff) | |
parent | f0613d5752d8f7d1d02e6d40947f38877fdf9c90 (diff) |
Merge branch 'fix/hda' into topic/hda
Diffstat (limited to 'sound/pci/hda')
-rw-r--r-- | sound/pci/hda/patch_nvhdmi.c | 31 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 89 |
2 files changed, 92 insertions, 28 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, |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index a751858811e1..4c8e5216506b 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -1332,15 +1332,20 @@ do_sku: | |||
1332 | * when the external headphone out jack is plugged" | 1332 | * when the external headphone out jack is plugged" |
1333 | */ | 1333 | */ |
1334 | if (!spec->autocfg.hp_pins[0]) { | 1334 | if (!spec->autocfg.hp_pins[0]) { |
1335 | hda_nid_t nid; | ||
1335 | tmp = (ass >> 11) & 0x3; /* HP to chassis */ | 1336 | tmp = (ass >> 11) & 0x3; /* HP to chassis */ |
1336 | if (tmp == 0) | 1337 | if (tmp == 0) |
1337 | spec->autocfg.hp_pins[0] = porta; | 1338 | nid = porta; |
1338 | else if (tmp == 1) | 1339 | else if (tmp == 1) |
1339 | spec->autocfg.hp_pins[0] = porte; | 1340 | nid = porte; |
1340 | else if (tmp == 2) | 1341 | else if (tmp == 2) |
1341 | spec->autocfg.hp_pins[0] = portd; | 1342 | nid = portd; |
1342 | else | 1343 | else |
1343 | return 1; | 1344 | return 1; |
1345 | for (i = 0; i < spec->autocfg.line_outs; i++) | ||
1346 | if (spec->autocfg.line_out_pins[i] == nid) | ||
1347 | return 1; | ||
1348 | spec->autocfg.hp_pins[0] = nid; | ||
1344 | } | 1349 | } |
1345 | 1350 | ||
1346 | alc_init_auto_hp(codec); | 1351 | alc_init_auto_hp(codec); |
@@ -1362,7 +1367,7 @@ static void alc_ssid_check(struct hda_codec *codec, | |||
1362 | } | 1367 | } |
1363 | 1368 | ||
1364 | /* | 1369 | /* |
1365 | * Fix-up pin default configurations | 1370 | * Fix-up pin default configurations and add default verbs |
1366 | */ | 1371 | */ |
1367 | 1372 | ||
1368 | struct alc_pincfg { | 1373 | struct alc_pincfg { |
@@ -1370,9 +1375,14 @@ struct alc_pincfg { | |||
1370 | u32 val; | 1375 | u32 val; |
1371 | }; | 1376 | }; |
1372 | 1377 | ||
1373 | static void alc_fix_pincfg(struct hda_codec *codec, | 1378 | struct alc_fixup { |
1379 | const struct alc_pincfg *pins; | ||
1380 | const struct hda_verb *verbs; | ||
1381 | }; | ||
1382 | |||
1383 | static void alc_pick_fixup(struct hda_codec *codec, | ||
1374 | const struct snd_pci_quirk *quirk, | 1384 | const struct snd_pci_quirk *quirk, |
1375 | const struct alc_pincfg **pinfix) | 1385 | const struct alc_fixup *fix) |
1376 | { | 1386 | { |
1377 | const struct alc_pincfg *cfg; | 1387 | const struct alc_pincfg *cfg; |
1378 | 1388 | ||
@@ -1380,9 +1390,14 @@ static void alc_fix_pincfg(struct hda_codec *codec, | |||
1380 | if (!quirk) | 1390 | if (!quirk) |
1381 | return; | 1391 | return; |
1382 | 1392 | ||
1383 | cfg = pinfix[quirk->value]; | 1393 | fix += quirk->value; |
1384 | for (; cfg->nid; cfg++) | 1394 | cfg = fix->pins; |
1385 | snd_hda_codec_set_pincfg(codec, cfg->nid, cfg->val); | 1395 | if (cfg) { |
1396 | for (; cfg->nid; cfg++) | ||
1397 | snd_hda_codec_set_pincfg(codec, cfg->nid, cfg->val); | ||
1398 | } | ||
1399 | if (fix->verbs) | ||
1400 | add_verb(codec->spec, fix->verbs); | ||
1386 | } | 1401 | } |
1387 | 1402 | ||
1388 | /* | 1403 | /* |
@@ -9594,11 +9609,13 @@ static struct alc_pincfg alc882_abit_aw9d_pinfix[] = { | |||
9594 | { } | 9609 | { } |
9595 | }; | 9610 | }; |
9596 | 9611 | ||
9597 | static const struct alc_pincfg *alc882_pin_fixes[] = { | 9612 | static const struct alc_fixup alc882_fixups[] = { |
9598 | [PINFIX_ABIT_AW9D_MAX] = alc882_abit_aw9d_pinfix, | 9613 | [PINFIX_ABIT_AW9D_MAX] = { |
9614 | .pins = alc882_abit_aw9d_pinfix | ||
9615 | }, | ||
9599 | }; | 9616 | }; |
9600 | 9617 | ||
9601 | static struct snd_pci_quirk alc882_pinfix_tbl[] = { | 9618 | static struct snd_pci_quirk alc882_fixup_tbl[] = { |
9602 | SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", PINFIX_ABIT_AW9D_MAX), | 9619 | SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", PINFIX_ABIT_AW9D_MAX), |
9603 | {} | 9620 | {} |
9604 | }; | 9621 | }; |
@@ -9870,7 +9887,7 @@ static int patch_alc882(struct hda_codec *codec) | |||
9870 | board_config = ALC882_AUTO; | 9887 | board_config = ALC882_AUTO; |
9871 | } | 9888 | } |
9872 | 9889 | ||
9873 | alc_fix_pincfg(codec, alc882_pinfix_tbl, alc882_pin_fixes); | 9890 | alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups); |
9874 | 9891 | ||
9875 | if (board_config == ALC882_AUTO) { | 9892 | if (board_config == ALC882_AUTO) { |
9876 | /* automatic parse from the BIOS config */ | 9893 | /* automatic parse from the BIOS config */ |
@@ -12834,12 +12851,15 @@ static int patch_alc268(struct hda_codec *codec) | |||
12834 | unsigned int wcap = get_wcaps(codec, 0x07); | 12851 | unsigned int wcap = get_wcaps(codec, 0x07); |
12835 | int i; | 12852 | int i; |
12836 | 12853 | ||
12854 | spec->capsrc_nids = alc268_capsrc_nids; | ||
12837 | /* get type */ | 12855 | /* get type */ |
12838 | wcap = get_wcaps_type(wcap); | 12856 | wcap = get_wcaps_type(wcap); |
12839 | if (spec->auto_mic || | 12857 | if (spec->auto_mic || |
12840 | wcap != AC_WID_AUD_IN || spec->input_mux->num_items == 1) { | 12858 | wcap != AC_WID_AUD_IN || spec->input_mux->num_items == 1) { |
12841 | spec->adc_nids = alc268_adc_nids_alt; | 12859 | spec->adc_nids = alc268_adc_nids_alt; |
12842 | spec->num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt); | 12860 | spec->num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt); |
12861 | if (spec->auto_mic) | ||
12862 | fixup_automic_adc(codec); | ||
12843 | if (spec->auto_mic || spec->input_mux->num_items == 1) | 12863 | if (spec->auto_mic || spec->input_mux->num_items == 1) |
12844 | add_mixer(spec, alc268_capture_nosrc_mixer); | 12864 | add_mixer(spec, alc268_capture_nosrc_mixer); |
12845 | else | 12865 | else |
@@ -12849,7 +12869,6 @@ static int patch_alc268(struct hda_codec *codec) | |||
12849 | spec->num_adc_nids = ARRAY_SIZE(alc268_adc_nids); | 12869 | spec->num_adc_nids = ARRAY_SIZE(alc268_adc_nids); |
12850 | add_mixer(spec, alc268_capture_mixer); | 12870 | add_mixer(spec, alc268_capture_mixer); |
12851 | } | 12871 | } |
12852 | spec->capsrc_nids = alc268_capsrc_nids; | ||
12853 | /* set default input source */ | 12872 | /* set default input source */ |
12854 | for (i = 0; i < spec->num_adc_nids; i++) | 12873 | for (i = 0; i < spec->num_adc_nids; i++) |
12855 | snd_hda_codec_write_cache(codec, alc268_capsrc_nids[i], | 12874 | snd_hda_codec_write_cache(codec, alc268_capsrc_nids[i], |
@@ -14347,15 +14366,16 @@ static void alc861_auto_init_multi_out(struct hda_codec *codec) | |||
14347 | static void alc861_auto_init_hp_out(struct hda_codec *codec) | 14366 | static void alc861_auto_init_hp_out(struct hda_codec *codec) |
14348 | { | 14367 | { |
14349 | struct alc_spec *spec = codec->spec; | 14368 | struct alc_spec *spec = codec->spec; |
14350 | hda_nid_t pin; | ||
14351 | 14369 | ||
14352 | pin = spec->autocfg.hp_pins[0]; | 14370 | if (spec->autocfg.hp_outs) |
14353 | if (pin) | 14371 | alc861_auto_set_output_and_unmute(codec, |
14354 | alc861_auto_set_output_and_unmute(codec, pin, PIN_HP, | 14372 | spec->autocfg.hp_pins[0], |
14373 | PIN_HP, | ||
14355 | spec->multiout.hp_nid); | 14374 | spec->multiout.hp_nid); |
14356 | pin = spec->autocfg.speaker_pins[0]; | 14375 | if (spec->autocfg.speaker_outs) |
14357 | if (pin) | 14376 | alc861_auto_set_output_and_unmute(codec, |
14358 | alc861_auto_set_output_and_unmute(codec, pin, PIN_OUT, | 14377 | spec->autocfg.speaker_pins[0], |
14378 | PIN_OUT, | ||
14359 | spec->multiout.dac_nids[0]); | 14379 | spec->multiout.dac_nids[0]); |
14360 | } | 14380 | } |
14361 | 14381 | ||
@@ -15148,7 +15168,7 @@ static struct snd_pci_quirk alc861vd_cfg_tbl[] = { | |||
15148 | SND_PCI_QUIRK(0x1019, 0xa88d, "Realtek ALC660 demo", ALC660VD_3ST), | 15168 | SND_PCI_QUIRK(0x1019, 0xa88d, "Realtek ALC660 demo", ALC660VD_3ST), |
15149 | SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_HP), | 15169 | SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_HP), |
15150 | SND_PCI_QUIRK(0x1043, 0x12e2, "Asus z35m", ALC660VD_3ST), | 15170 | SND_PCI_QUIRK(0x1043, 0x12e2, "Asus z35m", ALC660VD_3ST), |
15151 | SND_PCI_QUIRK(0x1043, 0x1339, "Asus G1", ALC660VD_3ST), | 15171 | /*SND_PCI_QUIRK(0x1043, 0x1339, "Asus G1", ALC660VD_3ST),*/ /* auto */ |
15152 | SND_PCI_QUIRK(0x1043, 0x1633, "Asus V1Sn", ALC660VD_ASUS_V1S), | 15172 | SND_PCI_QUIRK(0x1043, 0x1633, "Asus V1Sn", ALC660VD_ASUS_V1S), |
15153 | SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS", ALC660VD_3ST_DIG), | 15173 | SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS", ALC660VD_3ST_DIG), |
15154 | SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), | 15174 | SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), |
@@ -15534,6 +15554,29 @@ static void alc861vd_auto_init(struct hda_codec *codec) | |||
15534 | alc_inithook(codec); | 15554 | alc_inithook(codec); |
15535 | } | 15555 | } |
15536 | 15556 | ||
15557 | enum { | ||
15558 | ALC660VD_FIX_ASUS_GPIO1 | ||
15559 | }; | ||
15560 | |||
15561 | /* reset GPIO1 */ | ||
15562 | static const struct hda_verb alc660vd_fix_asus_gpio1_verbs[] = { | ||
15563 | {0x01, AC_VERB_SET_GPIO_MASK, 0x03}, | ||
15564 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01}, | ||
15565 | {0x01, AC_VERB_SET_GPIO_DATA, 0x01}, | ||
15566 | { } | ||
15567 | }; | ||
15568 | |||
15569 | static const struct alc_fixup alc861vd_fixups[] = { | ||
15570 | [ALC660VD_FIX_ASUS_GPIO1] = { | ||
15571 | .verbs = alc660vd_fix_asus_gpio1_verbs, | ||
15572 | }, | ||
15573 | }; | ||
15574 | |||
15575 | static struct snd_pci_quirk alc861vd_fixup_tbl[] = { | ||
15576 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1), | ||
15577 | {} | ||
15578 | }; | ||
15579 | |||
15537 | static int patch_alc861vd(struct hda_codec *codec) | 15580 | static int patch_alc861vd(struct hda_codec *codec) |
15538 | { | 15581 | { |
15539 | struct alc_spec *spec; | 15582 | struct alc_spec *spec; |
@@ -15555,6 +15598,8 @@ static int patch_alc861vd(struct hda_codec *codec) | |||
15555 | board_config = ALC861VD_AUTO; | 15598 | board_config = ALC861VD_AUTO; |
15556 | } | 15599 | } |
15557 | 15600 | ||
15601 | alc_pick_fixup(codec, alc861vd_fixup_tbl, alc861vd_fixups); | ||
15602 | |||
15558 | if (board_config == ALC861VD_AUTO) { | 15603 | if (board_config == ALC861VD_AUTO) { |
15559 | /* automatic parse from the BIOS config */ | 15604 | /* automatic parse from the BIOS config */ |
15560 | err = alc861vd_parse_auto_config(codec); | 15605 | err = alc861vd_parse_auto_config(codec); |