diff options
Diffstat (limited to 'sound/pci/hda/patch_analog.c')
-rw-r--r-- | sound/pci/hda/patch_analog.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 33b7d5806469..6823f2bc10b3 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -1545,6 +1545,9 @@ enum { | |||
1545 | /* reivision id to check workarounds */ | 1545 | /* reivision id to check workarounds */ |
1546 | #define AD1988A_REV2 0x100200 | 1546 | #define AD1988A_REV2 0x100200 |
1547 | 1547 | ||
1548 | #define is_rev2(codec) \ | ||
1549 | ((codec)->vendor_id == 0x11d41988 && \ | ||
1550 | (codec)->revision_id == AD1988A_REV2) | ||
1548 | 1551 | ||
1549 | /* | 1552 | /* |
1550 | * mixers | 1553 | * mixers |
@@ -1636,6 +1639,7 @@ static struct snd_kcontrol_new ad1988_6stack_mixers1[] = { | |||
1636 | HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT), | 1639 | HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT), |
1637 | HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x05, 2, 0x0, HDA_OUTPUT), | 1640 | HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x05, 2, 0x0, HDA_OUTPUT), |
1638 | HDA_CODEC_VOLUME("Side Playback Volume", 0x0a, 0x0, HDA_OUTPUT), | 1641 | HDA_CODEC_VOLUME("Side Playback Volume", 0x0a, 0x0, HDA_OUTPUT), |
1642 | { } /* end */ | ||
1639 | }; | 1643 | }; |
1640 | 1644 | ||
1641 | static struct snd_kcontrol_new ad1988_6stack_mixers1_rev2[] = { | 1645 | static struct snd_kcontrol_new ad1988_6stack_mixers1_rev2[] = { |
@@ -1644,6 +1648,7 @@ static struct snd_kcontrol_new ad1988_6stack_mixers1_rev2[] = { | |||
1644 | HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT), | 1648 | HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT), |
1645 | HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0a, 2, 0x0, HDA_OUTPUT), | 1649 | HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0a, 2, 0x0, HDA_OUTPUT), |
1646 | HDA_CODEC_VOLUME("Side Playback Volume", 0x06, 0x0, HDA_OUTPUT), | 1650 | HDA_CODEC_VOLUME("Side Playback Volume", 0x06, 0x0, HDA_OUTPUT), |
1651 | { } /* end */ | ||
1647 | }; | 1652 | }; |
1648 | 1653 | ||
1649 | static struct snd_kcontrol_new ad1988_6stack_mixers2[] = { | 1654 | static struct snd_kcontrol_new ad1988_6stack_mixers2[] = { |
@@ -1682,6 +1687,7 @@ static struct snd_kcontrol_new ad1988_3stack_mixers1[] = { | |||
1682 | HDA_CODEC_VOLUME("Surround Playback Volume", 0x0a, 0x0, HDA_OUTPUT), | 1687 | HDA_CODEC_VOLUME("Surround Playback Volume", 0x0a, 0x0, HDA_OUTPUT), |
1683 | HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT), | 1688 | HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT), |
1684 | HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x05, 2, 0x0, HDA_OUTPUT), | 1689 | HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x05, 2, 0x0, HDA_OUTPUT), |
1690 | { } /* end */ | ||
1685 | }; | 1691 | }; |
1686 | 1692 | ||
1687 | static struct snd_kcontrol_new ad1988_3stack_mixers1_rev2[] = { | 1693 | static struct snd_kcontrol_new ad1988_3stack_mixers1_rev2[] = { |
@@ -1689,6 +1695,7 @@ static struct snd_kcontrol_new ad1988_3stack_mixers1_rev2[] = { | |||
1689 | HDA_CODEC_VOLUME("Surround Playback Volume", 0x0a, 0x0, HDA_OUTPUT), | 1695 | HDA_CODEC_VOLUME("Surround Playback Volume", 0x0a, 0x0, HDA_OUTPUT), |
1690 | HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x06, 1, 0x0, HDA_OUTPUT), | 1696 | HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x06, 1, 0x0, HDA_OUTPUT), |
1691 | HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x06, 2, 0x0, HDA_OUTPUT), | 1697 | HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x06, 2, 0x0, HDA_OUTPUT), |
1698 | { } /* end */ | ||
1692 | }; | 1699 | }; |
1693 | 1700 | ||
1694 | static struct snd_kcontrol_new ad1988_3stack_mixers2[] = { | 1701 | static struct snd_kcontrol_new ad1988_3stack_mixers2[] = { |
@@ -2195,7 +2202,7 @@ static inline hda_nid_t ad1988_idx_to_dac(struct hda_codec *codec, int idx) | |||
2195 | /* A B C D E F G H */ | 2202 | /* A B C D E F G H */ |
2196 | 0x04, 0x05, 0x0a, 0x04, 0x06, 0x05, 0x0a, 0x06 | 2203 | 0x04, 0x05, 0x0a, 0x04, 0x06, 0x05, 0x0a, 0x06 |
2197 | }; | 2204 | }; |
2198 | if (codec->revision_id == AD1988A_REV2) | 2205 | if (is_rev2(codec)) |
2199 | return idx_to_dac_rev2[idx]; | 2206 | return idx_to_dac_rev2[idx]; |
2200 | else | 2207 | else |
2201 | return idx_to_dac[idx]; | 2208 | return idx_to_dac[idx]; |
@@ -2564,7 +2571,7 @@ static int patch_ad1988(struct hda_codec *codec) | |||
2564 | mutex_init(&spec->amp_mutex); | 2571 | mutex_init(&spec->amp_mutex); |
2565 | codec->spec = spec; | 2572 | codec->spec = spec; |
2566 | 2573 | ||
2567 | if (codec->revision_id == AD1988A_REV2) | 2574 | if (is_rev2(codec)) |
2568 | snd_printk(KERN_INFO "patch_analog: AD1988A rev.2 is detected, enable workarounds\n"); | 2575 | snd_printk(KERN_INFO "patch_analog: AD1988A rev.2 is detected, enable workarounds\n"); |
2569 | 2576 | ||
2570 | board_config = snd_hda_check_board_config(codec, ad1988_cfg_tbl); | 2577 | board_config = snd_hda_check_board_config(codec, ad1988_cfg_tbl); |
@@ -2590,13 +2597,13 @@ static int patch_ad1988(struct hda_codec *codec) | |||
2590 | case AD1988_6STACK_DIG: | 2597 | case AD1988_6STACK_DIG: |
2591 | spec->multiout.max_channels = 8; | 2598 | spec->multiout.max_channels = 8; |
2592 | spec->multiout.num_dacs = 4; | 2599 | spec->multiout.num_dacs = 4; |
2593 | if (codec->revision_id == AD1988A_REV2) | 2600 | if (is_rev2(codec)) |
2594 | spec->multiout.dac_nids = ad1988_6stack_dac_nids_rev2; | 2601 | spec->multiout.dac_nids = ad1988_6stack_dac_nids_rev2; |
2595 | else | 2602 | else |
2596 | spec->multiout.dac_nids = ad1988_6stack_dac_nids; | 2603 | spec->multiout.dac_nids = ad1988_6stack_dac_nids; |
2597 | spec->input_mux = &ad1988_6stack_capture_source; | 2604 | spec->input_mux = &ad1988_6stack_capture_source; |
2598 | spec->num_mixers = 2; | 2605 | spec->num_mixers = 2; |
2599 | if (codec->revision_id == AD1988A_REV2) | 2606 | if (is_rev2(codec)) |
2600 | spec->mixers[0] = ad1988_6stack_mixers1_rev2; | 2607 | spec->mixers[0] = ad1988_6stack_mixers1_rev2; |
2601 | else | 2608 | else |
2602 | spec->mixers[0] = ad1988_6stack_mixers1; | 2609 | spec->mixers[0] = ad1988_6stack_mixers1; |
@@ -2612,7 +2619,7 @@ static int patch_ad1988(struct hda_codec *codec) | |||
2612 | case AD1988_3STACK_DIG: | 2619 | case AD1988_3STACK_DIG: |
2613 | spec->multiout.max_channels = 6; | 2620 | spec->multiout.max_channels = 6; |
2614 | spec->multiout.num_dacs = 3; | 2621 | spec->multiout.num_dacs = 3; |
2615 | if (codec->revision_id == AD1988A_REV2) | 2622 | if (is_rev2(codec)) |
2616 | spec->multiout.dac_nids = ad1988_3stack_dac_nids_rev2; | 2623 | spec->multiout.dac_nids = ad1988_3stack_dac_nids_rev2; |
2617 | else | 2624 | else |
2618 | spec->multiout.dac_nids = ad1988_3stack_dac_nids; | 2625 | spec->multiout.dac_nids = ad1988_3stack_dac_nids; |
@@ -2620,7 +2627,7 @@ static int patch_ad1988(struct hda_codec *codec) | |||
2620 | spec->channel_mode = ad1988_3stack_modes; | 2627 | spec->channel_mode = ad1988_3stack_modes; |
2621 | spec->num_channel_mode = ARRAY_SIZE(ad1988_3stack_modes); | 2628 | spec->num_channel_mode = ARRAY_SIZE(ad1988_3stack_modes); |
2622 | spec->num_mixers = 2; | 2629 | spec->num_mixers = 2; |
2623 | if (codec->revision_id == AD1988A_REV2) | 2630 | if (is_rev2(codec)) |
2624 | spec->mixers[0] = ad1988_3stack_mixers1_rev2; | 2631 | spec->mixers[0] = ad1988_3stack_mixers1_rev2; |
2625 | else | 2632 | else |
2626 | spec->mixers[0] = ad1988_3stack_mixers1; | 2633 | spec->mixers[0] = ad1988_3stack_mixers1; |