Changeset 87


Ignore:
Timestamp:
Jan 23, 2007, 10:49:43 PM (19 years ago)
Author:
vladest
Message:

Latest HDA patches from ALSA

Location:
GPL/trunk/alsa-kernel/pci/hda
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk/alsa-kernel/pci/hda/patch_analog.c

    r86 r87  
    787787};
    788788
     789/* Ultra initialization */
     790static struct hda_verb ad1986a_ultra_init[] = {
     791        /* eapd initialization */
     792        { 0x1b, AC_VERB_SET_EAPD_BTLENABLE, 0x00 },
     793        /* CLFE -> Mic in */
     794        { 0x0f, AC_VERB_SET_CONNECT_SEL, 0x2 },
     795        { 0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
     796        { 0x1d, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080 },
     797        { } /* end */
     798};
     799
    789800/* models */
    790801enum {
     
    792803        AD1986A_3STACK,
    793804        AD1986A_LAPTOP,
    794         AD1986A_LAPTOP_EAPD,
     805        AD1986A_LAPTOP_EAPD,
     806        AD1986A_ULTRA,
    795807        AD1986A_MODELS
    796808};
     
    800812        [AD1986A_3STACK]        = "3stack",
    801813        [AD1986A_LAPTOP]        = "laptop",
    802         [AD1986A_LAPTOP_EAPD]   = "laptop-eapd",
     814        [AD1986A_LAPTOP_EAPD]   = "laptop-eapd",
     815        [AD1986A_ULTRA]         = "ultra",
    803816};
    804817
     
    822835        SND_PCI_QUIRK(0x144d, 0xc024, "Samsung R65", AD1986A_LAPTOP_EAPD),
    823836        SND_PCI_QUIRK(0x144d, 0xc026, "Samsung X11", AD1986A_LAPTOP_EAPD),
     837        SND_PCI_QUIRK(0x144d, 0xc504, "Samsung Q35", AD1986A_3STACK),
     838        SND_PCI_QUIRK(0x144d, 0xc027, "Samsung Q1", AD1986A_ULTRA),
    824839        SND_PCI_QUIRK(0x17aa, 0x1017, "Lenovo A60", AD1986A_3STACK),
    825840        SND_PCI_QUIRK(0x17aa, 0x2066, "Lenovo N100", AD1986A_LAPTOP_EAPD),
     
    888903                spec->input_mux = &ad1986a_laptop_eapd_capture_source;
    889904                break;
     905        case AD1986A_ULTRA:
     906                spec->mixers[0] = ad1986a_laptop_eapd_mixers;
     907                spec->num_init_verbs = 2;
     908                spec->init_verbs[1] = ad1986a_ultra_init;
     909                spec->multiout.max_channels = 2;
     910                spec->multiout.num_dacs = 1;
     911                spec->multiout.dac_nids = ad1986a_laptop_dac_nids;
     912                spec->multiout.dig_out_nid = 0;
     913                break;
    890914        }
    891915
    892         return 0;
     916        return 0;
    893917}
    894918
  • GPL/trunk/alsa-kernel/pci/hda/patch_sigmatel.c

    r86 r87  
    5151
    5252enum {
     53        STAC_925x_REF,
     54        STAC_M2_2,
     55        STAC_MA6,
     56        STAC_925x_MODELS
     57};
     58
     59enum {
    5360        STAC_D945_REF,
    5461        STAC_D945GTP3,
     
    132139};
    133140
     141static hda_nid_t stac925x_adc_nids[1] = {
     142        0x03,
     143};
     144
     145static hda_nid_t stac925x_mux_nids[1] = {
     146        0x0f,
     147};
     148
     149static hda_nid_t stac925x_dac_nids[1] = {
     150        0x02,
     151};
     152
    134153static hda_nid_t stac922x_adc_nids[2] = {
    135154        0x06, 0x07,
     
    163182        0x08, 0x09, 0x0d, 0x0e,
    164183        0x0f, 0x10, 0x11, 0x12,
     184};
     185
     186static hda_nid_t stac925x_pin_nids[8] = {
     187        0x07, 0x08, 0x0a, 0x0b,
     188        0x0c, 0x0d, 0x10, 0x11,
    165189};
    166190
     
    241265        /* set dac0mux for dac converter */
    242266        { 0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
     267        {0}
     268};
     269
     270static struct hda_verb stac925x_core_init[] = {
     271        /* set dac0mux for dac converter */
     272        { 0x06, AC_VERB_SET_CONNECT_SEL, 0x00},
    243273        {0}
    244274};
     
    286316        HDA_CODEC_MUTE("Capture Switch", 0x0a, 0, HDA_OUTPUT),
    287317        HDA_CODEC_VOLUME("Capture Mux Volume", 0x0c, 0, HDA_OUTPUT),
     318        {0} /* end */
     319};
     320
     321static struct snd_kcontrol_new stac925x_mixer[] = {
     322        HDA_CODEC_VOLUME("Master Playback Volume", 0xe, 0, HDA_OUTPUT),
     323        HDA_CODEC_MUTE("Master Playback Switch", 0xe, 0, HDA_OUTPUT),
     324        {
     325                .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
     326                .name = "Input Source",
     327                .count = 1,
     328                .info = stac92xx_mux_enum_info,
     329                .get = stac92xx_mux_enum_get,
     330                .put = stac92xx_mux_enum_put,
     331        },
     332        HDA_CODEC_VOLUME("Capture Volume", 0x09, 0, HDA_OUTPUT),
     333        HDA_CODEC_MUTE("Capture Switch", 0x09, 0, HDA_OUTPUT),
     334        HDA_CODEC_VOLUME("Capture Mux Volume", 0x0f, 0, HDA_OUTPUT),
    288335        {0} /* end */
    289336};
     
    411458        SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01cb,
    412459                      "Dell Latitude 120L", STAC_REF),
     460        {0} /* terminator */
     461};
     462
     463static unsigned int ref925x_pin_configs[8] = {
     464        0x40c003f0, 0x424503f2, 0x01813022, 0x02a19021,
     465        0x90a70320, 0x02214210, 0x400003f1, 0x9033032e,
     466};
     467
     468static unsigned int stac925x_MA6_pin_configs[8] = {
     469        0x40c003f0, 0x424503f2, 0x01813022, 0x02a19021,
     470        0x90a70320, 0x90100211, 0x400003f1, 0x9033032e,
     471};
     472
     473static unsigned int stac925xM2_2_pin_configs[8] = {
     474        0x40c003f3, 0x424503f2, 0x041800f4, 0x02a19020,
     475        0x50a103F0, 0x90100210, 0x400003f1, 0x9033032e,
     476};
     477
     478static unsigned int *stac925x_brd_tbl[STAC_925x_MODELS] = {
     479        [STAC_REF] = ref925x_pin_configs,
     480        [STAC_M2_2] = stac925xM2_2_pin_configs,
     481        [STAC_MA6] = stac925x_MA6_pin_configs,
     482};
     483
     484static const char *stac925x_models[STAC_925x_MODELS] = {
     485        [STAC_REF] = "ref",
     486        [STAC_M2_2] = "m2-2",
     487        [STAC_MA6] = "m6",
     488};
     489
     490static struct snd_pci_quirk stac925x_cfg_tbl[] = {
     491        /* SigmaTel reference board */
     492        SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, "DFI LanParty", STAC_REF),
     493        SND_PCI_QUIRK(0x107b, 0x0316, "Gateway M255", STAC_REF),
     494        SND_PCI_QUIRK(0x107b, 0x0366, "Gateway MP6954", STAC_REF),
     495        SND_PCI_QUIRK(0x107b, 0x0461, "Gateway NX560XL", STAC_MA6),
     496        SND_PCI_QUIRK(0x1002, 0x437b, "Gateway MX6453", STAC_M2_2),
    413497        {0} /* terminator */
    414498};
     
    17021786}
    17031787
     1788static int patch_stac925x(struct hda_codec *codec)
     1789{
     1790        struct sigmatel_spec *spec;
     1791        int err;
     1792
     1793        spec  = kzalloc(sizeof(*spec), GFP_KERNEL);
     1794        if (spec == NULL)
     1795                return -ENOMEM;
     1796
     1797        codec->spec = spec;
     1798        spec->num_pins = 8;
     1799        spec->pin_nids = stac925x_pin_nids;
     1800        spec->board_config = snd_hda_check_board_config(codec, STAC_925x_MODELS,
     1801                                                        stac925x_models,
     1802                                                        stac925x_cfg_tbl);
     1803        if (spec->board_config < 0) {
     1804                snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC925x, using BIOS defaults\n");
     1805                err = stac92xx_save_bios_config_regs(codec);
     1806                if (err < 0) {
     1807                        stac92xx_free(codec);
     1808                        return err;
     1809                }
     1810                spec->pin_configs = spec->bios_pin_configs;
     1811        } else if (stac925x_brd_tbl[spec->board_config] != NULL){
     1812                spec->pin_configs = stac925x_brd_tbl[spec->board_config];
     1813                stac92xx_set_config_regs(codec);
     1814        }
     1815
     1816        spec->multiout.max_channels = 2;
     1817        spec->multiout.num_dacs = 1;
     1818        spec->multiout.dac_nids = stac925x_dac_nids;
     1819        spec->adc_nids = stac925x_adc_nids;
     1820        spec->mux_nids = stac925x_mux_nids;
     1821        spec->num_muxes = 1;
     1822        spec->num_dmics = 0;
     1823
     1824        spec->init = stac925x_core_init;
     1825        spec->mixer = stac925x_mixer;
     1826
     1827        err = stac92xx_parse_auto_config(codec, 0x8, 0x7);
     1828        if (err < 0) {
     1829                stac92xx_free(codec);
     1830                return err;
     1831        }
     1832
     1833        codec->patch_ops = stac92xx_patch_ops;
     1834
     1835        return 0;
     1836}
     1837
    17041838static int patch_stac922x(struct hda_codec *codec)
    17051839{
     
    18611995
    18621996        spec->multiout.dac_nids = spec->dac_nids;
     1997
     1998        /* Configure GPIO0 as EAPD output */
     1999        snd_hda_codec_write(codec, codec->afg, 0,
     2000                            AC_VERB_SET_GPIO_DIRECTION, 0x00000001);
     2001        /* Configure GPIO0 as CMOS */
     2002        snd_hda_codec_write(codec, codec->afg, 0, 0x7e7, 0x00000000);
     2003        /* Assert GPIO0 high */
     2004        snd_hda_codec_write(codec, codec->afg, 0,
     2005                            AC_VERB_SET_GPIO_DATA, 0x00000001);
     2006        /* Enable GPIO0 */
     2007        snd_hda_codec_write(codec, codec->afg, 0,
     2008                            AC_VERB_SET_GPIO_MASK, 0x00000001);
    18632009
    18642010        err = stac92xx_parse_auto_config(codec, 0x1f, 0x20);
     
    21392285        { .id = 0x83847627, .name = "STAC9271D", .patch = patch_stac927x },
    21402286        { .id = 0x83847628, .name = "STAC9274X5NH", .patch = patch_stac927x },
    2141         { .id = 0x83847629, .name = "STAC9274D5NH", .patch = patch_stac927x },
     2287        { .id = 0x83847629, .name = "STAC9274D5NH", .patch = patch_stac927x },
     2288        { .id = 0x83847632, .name = "STAC9202",  .patch = patch_stac925x },
     2289        { .id = 0x83847633, .name = "STAC9202D", .patch = patch_stac925x },
     2290        { .id = 0x83847634, .name = "STAC9250", .patch = patch_stac925x },
     2291        { .id = 0x83847635, .name = "STAC9250D", .patch = patch_stac925x },
     2292        { .id = 0x83847636, .name = "STAC9251", .patch = patch_stac925x },
     2293        { .id = 0x83847637, .name = "STAC9250D", .patch = patch_stac925x },
    21422294        /* The following does not take into account .id=0x83847661 when subsys =
    21432295         * 104D0C00 which is STAC9225s. Because of this, some SZ Notebooks are
Note: See TracChangeset for help on using the changeset viewer.