diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-01-23 16:31:36 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-01-24 05:09:10 -0500 |
commit | faddaa5d1c0cd29629c9c7e7a9d41ecb3149a064 (patch) | |
tree | 52348c4897a692c4a8cf3bb8663488cb73bfe02d | |
parent | 4e4ac60030293cb3d1e4bacf7c8be9aebdb8df61 (diff) |
ALSA: hda - Add support for Toshiba Satellite M300
Added the support for Toshiba Satellite M300 with Conexant 5051 codec.
Since the laptop has no port C connection and the pin reports always
the jack sense true, we need to ignore port-C unsol event.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | Documentation/sound/alsa/HD-Audio-Models.txt | 1 | ||||
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 38 |
2 files changed, 34 insertions, 5 deletions
diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt index cb46eb259d68..8f06f20096f4 100644 --- a/Documentation/sound/alsa/HD-Audio-Models.txt +++ b/Documentation/sound/alsa/HD-Audio-Models.txt | |||
@@ -281,6 +281,7 @@ Conexant 5051 | |||
281 | hp-dv6736 HP dv6736 | 281 | hp-dv6736 HP dv6736 |
282 | hp-f700 HP Compaq Presario F700 | 282 | hp-f700 HP Compaq Presario F700 |
283 | lenovo-x200 Lenovo X200 laptop | 283 | lenovo-x200 Lenovo X200 laptop |
284 | toshiba Toshiba Satellite M300 | ||
284 | 285 | ||
285 | Conexant 5066 | 286 | Conexant 5066 |
286 | ============= | 287 | ============= |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 08c5b32dcd63..56dda9c7f899 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -46,6 +46,8 @@ | |||
46 | #define CXT5051_PORTB_EVENT 0x38 | 46 | #define CXT5051_PORTB_EVENT 0x38 |
47 | #define CXT5051_PORTC_EVENT 0x39 | 47 | #define CXT5051_PORTC_EVENT 0x39 |
48 | 48 | ||
49 | #define AUTO_MIC_PORTB (1 << 1) | ||
50 | #define AUTO_MIC_PORTC (1 << 2) | ||
49 | 51 | ||
50 | struct conexant_jack { | 52 | struct conexant_jack { |
51 | 53 | ||
@@ -74,7 +76,7 @@ struct conexant_spec { | |||
74 | */ | 76 | */ |
75 | unsigned int cur_eapd; | 77 | unsigned int cur_eapd; |
76 | unsigned int hp_present; | 78 | unsigned int hp_present; |
77 | unsigned int no_auto_mic; | 79 | unsigned int auto_mic; |
78 | unsigned int need_dac_fix; | 80 | unsigned int need_dac_fix; |
79 | 81 | ||
80 | /* capture */ | 82 | /* capture */ |
@@ -1626,7 +1628,7 @@ static void cxt5051_portb_automic(struct hda_codec *codec) | |||
1626 | struct conexant_spec *spec = codec->spec; | 1628 | struct conexant_spec *spec = codec->spec; |
1627 | unsigned int present; | 1629 | unsigned int present; |
1628 | 1630 | ||
1629 | if (spec->no_auto_mic) | 1631 | if (!(spec->auto_mic & AUTO_MIC_PORTB)) |
1630 | return; | 1632 | return; |
1631 | present = snd_hda_jack_detect(codec, 0x17); | 1633 | present = snd_hda_jack_detect(codec, 0x17); |
1632 | snd_hda_codec_write(codec, 0x14, 0, | 1634 | snd_hda_codec_write(codec, 0x14, 0, |
@@ -1641,7 +1643,7 @@ static void cxt5051_portc_automic(struct hda_codec *codec) | |||
1641 | unsigned int present; | 1643 | unsigned int present; |
1642 | hda_nid_t new_adc; | 1644 | hda_nid_t new_adc; |
1643 | 1645 | ||
1644 | if (spec->no_auto_mic) | 1646 | if (!(spec->auto_mic & AUTO_MIC_PORTC)) |
1645 | return; | 1647 | return; |
1646 | present = snd_hda_jack_detect(codec, 0x18); | 1648 | present = snd_hda_jack_detect(codec, 0x18); |
1647 | if (present) | 1649 | if (present) |
@@ -1757,6 +1759,24 @@ static struct snd_kcontrol_new cxt5051_f700_mixers[] = { | |||
1757 | {} | 1759 | {} |
1758 | }; | 1760 | }; |
1759 | 1761 | ||
1762 | static struct snd_kcontrol_new cxt5051_toshiba_mixers[] = { | ||
1763 | HDA_CODEC_VOLUME("Internal Mic Volume", 0x14, 0x00, HDA_INPUT), | ||
1764 | HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT), | ||
1765 | HDA_CODEC_VOLUME("External Mic Volume", 0x14, 0x01, HDA_INPUT), | ||
1766 | HDA_CODEC_MUTE("External Mic Switch", 0x14, 0x01, HDA_INPUT), | ||
1767 | HDA_CODEC_VOLUME("Master Playback Volume", 0x10, 0x00, HDA_OUTPUT), | ||
1768 | { | ||
1769 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
1770 | .name = "Master Playback Switch", | ||
1771 | .info = cxt_eapd_info, | ||
1772 | .get = cxt_eapd_get, | ||
1773 | .put = cxt5051_hp_master_sw_put, | ||
1774 | .private_value = 0x1a, | ||
1775 | }, | ||
1776 | |||
1777 | {} | ||
1778 | }; | ||
1779 | |||
1760 | static struct hda_verb cxt5051_init_verbs[] = { | 1780 | static struct hda_verb cxt5051_init_verbs[] = { |
1761 | /* Line in, Mic */ | 1781 | /* Line in, Mic */ |
1762 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x03}, | 1782 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x03}, |
@@ -1893,6 +1913,7 @@ enum { | |||
1893 | CXT5051_HP_DV6736, /* HP without mic switch */ | 1913 | CXT5051_HP_DV6736, /* HP without mic switch */ |
1894 | CXT5051_LENOVO_X200, /* Lenovo X200 laptop */ | 1914 | CXT5051_LENOVO_X200, /* Lenovo X200 laptop */ |
1895 | CXT5051_F700, /* HP Compaq Presario F700 */ | 1915 | CXT5051_F700, /* HP Compaq Presario F700 */ |
1916 | CXT5051_TOSHIBA, /* Toshiba M300 & co */ | ||
1896 | CXT5051_MODELS | 1917 | CXT5051_MODELS |
1897 | }; | 1918 | }; |
1898 | 1919 | ||
@@ -1902,12 +1923,14 @@ static const char *cxt5051_models[CXT5051_MODELS] = { | |||
1902 | [CXT5051_HP_DV6736] = "hp-dv6736", | 1923 | [CXT5051_HP_DV6736] = "hp-dv6736", |
1903 | [CXT5051_LENOVO_X200] = "lenovo-x200", | 1924 | [CXT5051_LENOVO_X200] = "lenovo-x200", |
1904 | [CXT5051_F700] = "hp-700", | 1925 | [CXT5051_F700] = "hp-700", |
1926 | [CXT5051_TOSHIBA] = "toshiba", | ||
1905 | }; | 1927 | }; |
1906 | 1928 | ||
1907 | static struct snd_pci_quirk cxt5051_cfg_tbl[] = { | 1929 | static struct snd_pci_quirk cxt5051_cfg_tbl[] = { |
1908 | SND_PCI_QUIRK(0x103c, 0x30cf, "HP DV6736", CXT5051_HP_DV6736), | 1930 | SND_PCI_QUIRK(0x103c, 0x30cf, "HP DV6736", CXT5051_HP_DV6736), |
1909 | SND_PCI_QUIRK(0x103c, 0x360b, "Compaq Presario CQ60", CXT5051_HP), | 1931 | SND_PCI_QUIRK(0x103c, 0x360b, "Compaq Presario CQ60", CXT5051_HP), |
1910 | SND_PCI_QUIRK(0x103c, 0x30ea, "Compaq Presario F700", CXT5051_F700), | 1932 | SND_PCI_QUIRK(0x103c, 0x30ea, "Compaq Presario F700", CXT5051_F700), |
1933 | SND_PCI_QUIRK(0x1179, 0xff50, "Toshiba M30x", CXT5051_TOSHIBA), | ||
1911 | SND_PCI_QUIRK(0x14f1, 0x0101, "Conexant Reference board", | 1934 | SND_PCI_QUIRK(0x14f1, 0x0101, "Conexant Reference board", |
1912 | CXT5051_LAPTOP), | 1935 | CXT5051_LAPTOP), |
1913 | SND_PCI_QUIRK(0x14f1, 0x5051, "HP Spartan 1.1", CXT5051_HP), | 1936 | SND_PCI_QUIRK(0x14f1, 0x5051, "HP Spartan 1.1", CXT5051_HP), |
@@ -1950,6 +1973,7 @@ static int patch_cxt5051(struct hda_codec *codec) | |||
1950 | board_config = snd_hda_check_board_config(codec, CXT5051_MODELS, | 1973 | board_config = snd_hda_check_board_config(codec, CXT5051_MODELS, |
1951 | cxt5051_models, | 1974 | cxt5051_models, |
1952 | cxt5051_cfg_tbl); | 1975 | cxt5051_cfg_tbl); |
1976 | spec->auto_mic = AUTO_MIC_PORTB | AUTO_MIC_PORTC; | ||
1953 | switch (board_config) { | 1977 | switch (board_config) { |
1954 | case CXT5051_HP: | 1978 | case CXT5051_HP: |
1955 | spec->mixers[0] = cxt5051_hp_mixers; | 1979 | spec->mixers[0] = cxt5051_hp_mixers; |
@@ -1957,7 +1981,7 @@ static int patch_cxt5051(struct hda_codec *codec) | |||
1957 | case CXT5051_HP_DV6736: | 1981 | case CXT5051_HP_DV6736: |
1958 | spec->init_verbs[0] = cxt5051_hp_dv6736_init_verbs; | 1982 | spec->init_verbs[0] = cxt5051_hp_dv6736_init_verbs; |
1959 | spec->mixers[0] = cxt5051_hp_dv6736_mixers; | 1983 | spec->mixers[0] = cxt5051_hp_dv6736_mixers; |
1960 | spec->no_auto_mic = 1; | 1984 | spec->auto_mic = 0; |
1961 | break; | 1985 | break; |
1962 | case CXT5051_LENOVO_X200: | 1986 | case CXT5051_LENOVO_X200: |
1963 | spec->init_verbs[0] = cxt5051_lenovo_x200_init_verbs; | 1987 | spec->init_verbs[0] = cxt5051_lenovo_x200_init_verbs; |
@@ -1965,7 +1989,11 @@ static int patch_cxt5051(struct hda_codec *codec) | |||
1965 | case CXT5051_F700: | 1989 | case CXT5051_F700: |
1966 | spec->init_verbs[0] = cxt5051_f700_init_verbs; | 1990 | spec->init_verbs[0] = cxt5051_f700_init_verbs; |
1967 | spec->mixers[0] = cxt5051_f700_mixers; | 1991 | spec->mixers[0] = cxt5051_f700_mixers; |
1968 | spec->no_auto_mic = 1; | 1992 | spec->auto_mic = 0; |
1993 | break; | ||
1994 | case CXT5051_TOSHIBA: | ||
1995 | spec->mixers[0] = cxt5051_toshiba_mixers; | ||
1996 | spec->auto_mic = AUTO_MIC_PORTB; | ||
1969 | break; | 1997 | break; |
1970 | } | 1998 | } |
1971 | 1999 | ||