]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - sound/pci/hda/patch_sigmatel.c
Merge tag 'v2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / sound / pci / hda / patch_sigmatel.c
index f03b2ff90496f86151b01cec6131e9cc94996a42..bd7b123f64407e5398f0ddfe8a48ec10acfb1308 100644 (file)
@@ -266,7 +266,7 @@ struct sigmatel_spec {
        struct sigmatel_mic_route int_mic;
        struct sigmatel_mic_route dock_mic;
 
-       const char **spdif_labels;
+       const char * const *spdif_labels;
 
        hda_nid_t dig_in_nid;
        hda_nid_t mono_nid;
@@ -389,6 +389,9 @@ static hda_nid_t stac92hd83xxx_dmic_nids[STAC92HD83XXX_NUM_DMICS + 1] = {
        0x11, 0x20, 0
 };
 
+#define STAC92HD88XXX_NUM_DMICS        STAC92HD83XXX_NUM_DMICS
+#define stac92hd88xxx_dmic_nids        stac92hd83xxx_dmic_nids
+
 #define STAC92HD87B_NUM_DMICS   1
 static hda_nid_t stac92hd87b_dmic_nids[STAC92HD87B_NUM_DMICS + 1] = {
        0x11, 0
@@ -521,7 +524,7 @@ static unsigned long stac927x_capsws[] = {
        HDA_COMPOSE_AMP_VAL(0x1d, 3, 0, HDA_OUTPUT),
 };
 
-static const char *stac927x_spdif_labels[5] = {
+static const char * const stac927x_spdif_labels[5] = {
        "Digital Playback", "ADAT", "Analog Mux 1",
        "Analog Mux 2", "Analog Mux 3"
 };
@@ -583,7 +586,12 @@ static hda_nid_t stac92hd83xxx_pin_nids[10] = {
        0x0f, 0x10, 0x11, 0x1f, 0x20,
 };
 
-static hda_nid_t stac92hd88xxx_pin_nids[10] = {
+static hda_nid_t stac92hd87xxx_pin_nids[6] = {
+       0x0a, 0x0b, 0x0c, 0x0d,
+       0x0f, 0x11,
+};
+
+static hda_nid_t stac92hd88xxx_pin_nids[8] = {
        0x0a, 0x0b, 0x0c, 0x0d,
        0x0f, 0x11, 0x1f, 0x20,
 };
@@ -1059,7 +1067,7 @@ static struct snd_kcontrol_new stac_smux_mixer = {
        .put = stac92xx_smux_enum_put,
 };
 
-static const char *slave_vols[] = {
+static const char * const slave_vols[] = {
        "Front Playback Volume",
        "Surround Playback Volume",
        "Center Playback Volume",
@@ -1070,7 +1078,7 @@ static const char *slave_vols[] = {
        NULL
 };
 
-static const char *slave_sws[] = {
+static const char * const slave_sws[] = {
        "Front Playback Switch",
        "Surround Playback Switch",
        "Center Playback Switch",
@@ -1351,7 +1359,7 @@ static unsigned int *stac9200_brd_tbl[STAC_9200_MODELS] = {
        [STAC_9200_PANASONIC] = ref9200_pin_configs,
 };
 
-static const char *stac9200_models[STAC_9200_MODELS] = {
+static const char * const stac9200_models[STAC_9200_MODELS] = {
        [STAC_AUTO] = "auto",
        [STAC_REF] = "ref",
        [STAC_9200_OQO] = "oqo",
@@ -1497,7 +1505,7 @@ static unsigned int *stac925x_brd_tbl[STAC_925x_MODELS] = {
        [STAC_M6] = stac925xM6_pin_configs,
 };
 
-static const char *stac925x_models[STAC_925x_MODELS] = {
+static const char * const stac925x_models[STAC_925x_MODELS] = {
        [STAC_925x_AUTO] = "auto",
        [STAC_REF] = "ref",
        [STAC_M1] = "m1",
@@ -1571,7 +1579,7 @@ static unsigned int *stac92hd73xx_brd_tbl[STAC_92HD73XX_MODELS] = {
        [STAC_92HD73XX_INTEL]   = intel_dg45id_pin_configs,
 };
 
-static const char *stac92hd73xx_models[STAC_92HD73XX_MODELS] = {
+static const char * const stac92hd73xx_models[STAC_92HD73XX_MODELS] = {
        [STAC_92HD73XX_AUTO] = "auto",
        [STAC_92HD73XX_NO_JD] = "no-jd",
        [STAC_92HD73XX_REF] = "ref",
@@ -1657,7 +1665,7 @@ static unsigned int *stac92hd83xxx_brd_tbl[STAC_92HD83XXX_MODELS] = {
        [STAC_HP_DV7_4000] = hp_dv7_4000_pin_configs,
 };
 
-static const char *stac92hd83xxx_models[STAC_92HD83XXX_MODELS] = {
+static const char * const stac92hd83xxx_models[STAC_92HD83XXX_MODELS] = {
        [STAC_92HD83XXX_AUTO] = "auto",
        [STAC_92HD83XXX_REF] = "ref",
        [STAC_92HD83XXX_PWR_REF] = "mic-ref",
@@ -1719,7 +1727,7 @@ static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = {
        [STAC_HP_DV4_1222NR]    = NULL,
 };
 
-static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = {
+static const char * const stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = {
        [STAC_92HD71BXX_AUTO] = "auto",
        [STAC_92HD71BXX_REF] = "ref",
        [STAC_DELL_M4_1] = "dell-m4-1",
@@ -1912,7 +1920,7 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = {
        [STAC_922X_DELL_M82] = dell_922x_m82_pin_configs,       
 };
 
-static const char *stac922x_models[STAC_922X_MODELS] = {
+static const char * const stac922x_models[STAC_922X_MODELS] = {
        [STAC_922X_AUTO] = "auto",
        [STAC_D945_REF] = "ref",
        [STAC_D945GTP5] = "5stack",
@@ -2074,7 +2082,7 @@ static unsigned int *stac927x_brd_tbl[STAC_927X_MODELS] = {
        [STAC_927X_VOLKNOB] = NULL,
 };
 
-static const char *stac927x_models[STAC_927X_MODELS] = {
+static const char * const stac927x_models[STAC_927X_MODELS] = {
        [STAC_927X_AUTO]        = "auto",
        [STAC_D965_REF_NO_JD]   = "ref-no-jd",
        [STAC_D965_REF]         = "ref",
@@ -2177,7 +2185,7 @@ static unsigned int *stac9205_brd_tbl[STAC_9205_MODELS] = {
        [STAC_9205_EAPD] = NULL,
 };
 
-static const char *stac9205_models[STAC_9205_MODELS] = {
+static const char * const stac9205_models[STAC_9205_MODELS] = {
        [STAC_9205_AUTO] = "auto",
        [STAC_9205_REF] = "ref",
        [STAC_9205_DELL_M42] = "dell-m42",
@@ -3120,7 +3128,7 @@ static int create_multi_out_ctls(struct hda_codec *codec, int num_outs,
                                 int type)
 {
        struct sigmatel_spec *spec = codec->spec;
-       static const char *chname[4] = {
+       static const char * const chname[4] = {
                "Front", "Surround", NULL /*CLFE*/, "Side"
        };
        hda_nid_t nid;
@@ -3253,7 +3261,7 @@ static int stac92xx_auto_create_hp_ctls(struct hda_codec *codec,
 }
 
 /* labels for mono mux outputs */
-static const char *stac92xx_mono_labels[4] = {
+static const char * const stac92xx_mono_labels[4] = {
        "DAC0", "DAC1", "Mixer", "DAC2"
 };
 
@@ -3377,7 +3385,7 @@ static int stac92xx_auto_create_mux_input_ctls(struct hda_codec *codec)
        return 0;
 };
 
-static const char *stac92xx_spdif_labels[3] = {
+static const char * const stac92xx_spdif_labels[3] = {
        "Digital Playback", "Analog Mux 1", "Analog Mux 2",
 };
 
@@ -3385,7 +3393,7 @@ static int stac92xx_auto_create_spdif_mux_ctls(struct hda_codec *codec)
 {
        struct sigmatel_spec *spec = codec->spec;
        struct hda_input_mux *spdif_mux = &spec->private_smux;
-       const char **labels = spec->spdif_labels;
+       const char * const *labels = spec->spdif_labels;
        int i, num_cons;
        hda_nid_t con_lst[HDA_MAX_NUM_INPUTS];
 
@@ -3406,7 +3414,7 @@ static int stac92xx_auto_create_spdif_mux_ctls(struct hda_codec *codec)
 }
 
 /* labels for dmic mux inputs */
-static const char *stac92xx_dmic_labels[5] = {
+static const char * const stac92xx_dmic_labels[5] = {
        "Analog Inputs", "Digital Mic 1", "Digital Mic 2",
        "Digital Mic 3", "Digital Mic 4"
 };
@@ -3591,7 +3599,7 @@ static int stac_check_auto_mic(struct hda_codec *codec)
                if (check_mic_pin(codec, spec->dmic_nids[i],
                    &fixed, &ext, &dock))
                        return 0;
-       if (!fixed && !ext && !dock)
+       if (!fixed || (!ext && !dock))
                return 0; /* no input to switch */
        if (!(get_wcaps(codec, ext) & AC_WCAP_UNSOL_CAP))
                return 0; /* no unsol support */
@@ -5330,7 +5338,7 @@ again:
        return 0;
 }
 
-static int stac92hd83xxx_set_system_btl_amp(struct hda_codec *codec)
+static int hp_bnb2011_with_dock(struct hda_codec *codec)
 {
        if (codec->vendor_id != 0x111d7605 &&
            codec->vendor_id != 0x111d76d1)
@@ -5345,10 +5353,6 @@ static int stac92hd83xxx_set_system_btl_amp(struct hda_codec *codec)
        case 0x103c161d:
        case 0x103c161e:
        case 0x103c161f:
-       case 0x103c1620:
-       case 0x103c1621:
-       case 0x103c1622:
-       case 0x103c1623:
 
        case 0x103c162a:
        case 0x103c162b:
@@ -5357,41 +5361,9 @@ static int stac92hd83xxx_set_system_btl_amp(struct hda_codec *codec)
        case 0x103c1631:
 
        case 0x103c1633:
-
+       case 0x103c1634:
        case 0x103c1635:
 
-       case 0x103c164f:
-
-       case 0x103c1676:
-       case 0x103c1677:
-       case 0x103c1678:
-       case 0x103c1679:
-       case 0x103c167a:
-       case 0x103c167b:
-       case 0x103c167c:
-       case 0x103c167d:
-       case 0x103c167e:
-       case 0x103c167f:
-       case 0x103c1680:
-       case 0x103c1681:
-       case 0x103c1682:
-       case 0x103c1683:
-       case 0x103c1684:
-       case 0x103c1685:
-       case 0x103c1686:
-       case 0x103c1687:
-       case 0x103c1688:
-       case 0x103c1689:
-       case 0x103c168a:
-       case 0x103c168b:
-       case 0x103c168c:
-       case 0x103c168d:
-       case 0x103c168e:
-       case 0x103c168f:
-       case 0x103c1690:
-       case 0x103c1691:
-       case 0x103c1692:
-
        case 0x103c3587:
        case 0x103c3588:
        case 0x103c3589:
@@ -5399,9 +5371,9 @@ static int stac92hd83xxx_set_system_btl_amp(struct hda_codec *codec)
 
        case 0x103c3667:
        case 0x103c3668:
-               /* set BTL amp level to 13.43dB for louder speaker output */
-               return snd_hda_codec_write_cache(codec, codec->afg, 0,
-                                                0x7F4, 0x14);
+       case 0x103c3669:
+
+               return 1;
        }
        return 0;
 }
@@ -5417,12 +5389,17 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
        if (spec == NULL)
                return -ENOMEM;
 
+       if (hp_bnb2011_with_dock(codec)) {
+               snd_hda_codec_set_pincfg(codec, 0xa, 0x2101201f);
+               snd_hda_codec_set_pincfg(codec, 0xf, 0x2181205e);
+       }
+
        /* reset pin power-down; Windows may leave these bits after reboot */
        snd_hda_codec_write_cache(codec, codec->afg, 0, 0x7EC, 0);
        snd_hda_codec_write_cache(codec, codec->afg, 0, 0x7ED, 0);
        codec->no_trigger_sense = 1;
        codec->spec = spec;
-       spec->linear_tone_beep = 1;
+       spec->linear_tone_beep = 0;
        codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs;
        spec->digbeep_nid = 0x21;
        spec->dmic_nids = stac92hd83xxx_dmic_nids;
@@ -5458,19 +5435,27 @@ again:
        switch (codec->vendor_id) {
        case 0x111d76d1:
        case 0x111d76d9:
+       case 0x111d76e5:
                spec->dmic_nids = stac92hd87b_dmic_nids;
                spec->num_dmics = stac92xx_connected_ports(codec,
                                stac92hd87b_dmic_nids,
                                STAC92HD87B_NUM_DMICS);
-               /* Fall through */
+               spec->num_pins = ARRAY_SIZE(stac92hd87xxx_pin_nids);
+               spec->pin_nids = stac92hd87xxx_pin_nids;
+               spec->mono_nid = 0;
+               spec->num_pwrs = 0;
+               break;
        case 0x111d7666:
        case 0x111d7667:
        case 0x111d7668:
        case 0x111d7669:
+       case 0x111d76e3:
+               spec->num_dmics = stac92xx_connected_ports(codec,
+                               stac92hd88xxx_dmic_nids,
+                               STAC92HD88XXX_NUM_DMICS);
                spec->num_pins = ARRAY_SIZE(stac92hd88xxx_pin_nids);
                spec->pin_nids = stac92hd88xxx_pin_nids;
                spec->mono_nid = 0;
-               spec->digbeep_nid = 0;
                spec->num_pwrs = 0;
                break;
        case 0x111d7604:
@@ -5537,8 +5522,6 @@ again:
                        AC_VERB_SET_CONNECT_SEL, num_dacs);
        }
 
-       stac92hd83xxx_set_system_btl_amp(codec);
-
        codec->proc_widget_hook = stac92hd_proc_hook;
 
        return 0;
@@ -6261,7 +6244,7 @@ static unsigned int stac9872_vaio_pin_configs[9] = {
        0x90a7013e
 };
 
-static const char *stac9872_models[STAC_9872_MODELS] = {
+static const char * const stac9872_models[STAC_9872_MODELS] = {
        [STAC_9872_AUTO] = "auto",
        [STAC_9872_VAIO] = "vaio",
 };
@@ -6411,6 +6394,8 @@ static struct hda_codec_preset snd_hda_preset_sigmatel[] = {
        { .id = 0x111d76cd, .name = "92HD89F2", .patch = patch_stac92hd73xx },
        { .id = 0x111d76ce, .name = "92HD89F1", .patch = patch_stac92hd73xx },
        { .id = 0x111d76e0, .name = "92HD91BXX", .patch = patch_stac92hd83xxx},
+       { .id = 0x111d76e3, .name = "92HD98BXX", .patch = patch_stac92hd83xxx},
+       { .id = 0x111d76e5, .name = "92HD99BXX", .patch = patch_stac92hd83xxx},
        { .id = 0x111d76e7, .name = "92HD90BXX", .patch = patch_stac92hd83xxx},
        {} /* terminator */
 };