Patchwork [Jaunty,1/3] SRU: Enable speakers for Toshiba NB200 (Realtek ALC272)

login
register
mail settings
Submitter Leann Ogasawara
Date Nov. 3, 2009, 5:47 p.m.
Message ID <1257270452.25494.50.camel@emiko>
Download mbox | patch
Permalink /patch/37522/
State Accepted
Headers show

Comments

Leann Ogasawara - Nov. 3, 2009, 5:47 p.m.
>From abc722e76ba082a82b5e5edefdb43327e88af37d Mon Sep 17 00:00:00 2001
From: Leann Ogasawara <leann.ogasawara@canonical.com>
Date: Tue, 18 Aug 2009 11:56:47 -0700
Subject: [PATCH] UBUNTU: SAUCE: Enable speakers for Toshiba NB200 (Realtek ALC272)

OriginalLocation: Hardy LUM netbook-lpia branch
BugLink: BugLink: http://bugs.launchpad.net/bugs/438318

The following adds a new verb table to enable the speakers for the
Toshiba NB200, Realtek ALC272 (Vendor ID: 0x10ec:0272, Subsystem ID:
0x1179:0xff6e, Revision ID: 0x100001).  Code was forward ported from
Hardy LUM (netbook-lpia branch).

Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
---
 sound/pci/hda/patch_realtek.c |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)
Stefan Bader - Nov. 4, 2009, 3:41 p.m.
As far as I can see we are adding only, we got the same setup in Hardy and the
affected model should be well tested.

Leann Ogasawara wrote:
>>From abc722e76ba082a82b5e5edefdb43327e88af37d Mon Sep 17 00:00:00 2001
> From: Leann Ogasawara <leann.ogasawara@canonical.com>
> Date: Tue, 18 Aug 2009 11:56:47 -0700
> Subject: [PATCH] UBUNTU: SAUCE: Enable speakers for Toshiba NB200 (Realtek ALC272)
> 
> OriginalLocation: Hardy LUM netbook-lpia branch
> BugLink: BugLink: http://bugs.launchpad.net/bugs/438318
> 
> The following adds a new verb table to enable the speakers for the
> Toshiba NB200, Realtek ALC272 (Vendor ID: 0x10ec:0272, Subsystem ID:
> 0x1179:0xff6e, Revision ID: 0x100001).  Code was forward ported from
> Hardy LUM (netbook-lpia branch).
> 
> Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>

Acked-by: Stefan Bader <stefan.bader@canonical.com>

> ---
>  sound/pci/hda/patch_realtek.c |   39 +++++++++++++++++++++++++++++++++++++++
>  1 files changed, 39 insertions(+), 0 deletions(-)
> 
> diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
> index db91cf8..79710c5 100644
> --- a/sound/pci/hda/patch_realtek.c
> +++ b/sound/pci/hda/patch_realtek.c
> @@ -184,6 +184,7 @@ enum {
>  	ALC663_ASUS_MODE5,
>  	ALC663_ASUS_MODE6,
>  	ALC272_DELL_ZM1,
> +	ALC272_TOSHIBA_NB200,
>  	ALC662_AUTO,
>  	ALC662_MODEL_LAST,
>  };
> @@ -15348,6 +15349,28 @@ static struct hda_verb alc272_dell_zm1_init_verbs[] = {
>          {}
>  };
>  
> +static struct hda_verb alc272_toshiba_init_verbs[] = {
> +	/* Front Pin: output 0 (0x0c) */
> +	{0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, /* 0x14 */
> +	{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* 0x14 */
> +	/* Front Mic pin: input vref at 80% */
> +	{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, /* 0x19 */
> +	{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},    /* 0x19 */
> +	{0x17, AC_VERB_SET_EAPD_BTLENABLE, 2}, /* 0x14 */
> +	{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* originally 0x12 */
> +	{0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
> +	{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
> +	{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
> +	{0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
> +	{0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
> +	{0x21, AC_VERB_SET_CONNECT_SEL, 0x01},  /* Headphone */
> +	{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
> +	{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(9)},
> +	{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
> +	{0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
> +	{}
> +};
> +
>  
>  /* capture mixer elements */
>  static struct snd_kcontrol_new alc662_capture_mixer[] = {
> @@ -15872,6 +15895,7 @@ static const char *alc662_models[ALC662_MODEL_LAST] = {
>  	[ALC662_ASUS_EEEPC_EP20] = "eeepc-ep20",
>  	[ALC662_ECS] = "ecs",
>  	[ALC272_DELL_ZM1] = "dell-zm1",
> +	[ALC272_TOSHIBA_NB200] = "toshiba-nb200",
>  	[ALC663_ASUS_M51VA] = "m51va",
>  	[ALC663_ASUS_G71V] = "g71v",
>  	[ALC663_ASUS_H13] = "h13",
> @@ -15929,6 +15953,7 @@ static struct snd_pci_quirk alc662_cfg_tbl[] = {
>  	SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_ECS),
>  	SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_ECS),
>  	SND_PCI_QUIRK(0x1028, 0x02f4, "DELL ZM1", ALC272_DELL_ZM1),
> +	SND_PCI_QUIRK(0x1179, 0xff6e, "Toshiba NB200", ALC272_TOSHIBA_NB200),
>  	SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte 945GCM-S2L",
>  		      ALC662_3ST_6ch_DIG),
>  	SND_PCI_QUIRK(0x1565, 0x820f, "Biostar TA780G M2+", ALC662_3ST_6ch_DIG),
> @@ -16050,6 +16075,20 @@ static struct alc_config_preset alc662_presets[] = {
>                  .unsol_event = alc663_m51va_unsol_event,
>                  .init_hook = alc663_m51va_inithook,
>          },
> +	[ALC272_TOSHIBA_NB200] = {
> +		.mixers = { alc663_m51va_mixer },
> +		.init_verbs = { alc662_init_verbs, alc272_toshiba_init_verbs },
> +		.num_dacs = ARRAY_SIZE(alc662_dac_nids),
> +		.dac_nids = alc662_dac_nids,
> +		.num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
> +		.adc_nids = alc662_adc_nids,
> +		.num_adc_nids = ARRAY_SIZE(alc662_adc_nids),
> +		.capsrc_nids = alc662_capsrc_nids,
> +		.channel_mode = alc662_3ST_2ch_modes,
> +		.input_mux = &alc663_m51va_capture_source,
> +		.unsol_event = alc663_m51va_unsol_event,
> +		.init_hook = alc663_m51va_inithook,
> +	},
>  	[ALC663_ASUS_M51VA] = {
>  		.mixers = { alc663_m51va_mixer, alc662_capture_mixer},
>  		.init_verbs = { alc662_init_verbs, alc663_m51va_init_verbs },

Patch

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index db91cf8..79710c5 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -184,6 +184,7 @@  enum {
 	ALC663_ASUS_MODE5,
 	ALC663_ASUS_MODE6,
 	ALC272_DELL_ZM1,
+	ALC272_TOSHIBA_NB200,
 	ALC662_AUTO,
 	ALC662_MODEL_LAST,
 };
@@ -15348,6 +15349,28 @@  static struct hda_verb alc272_dell_zm1_init_verbs[] = {
         {}
 };
 
+static struct hda_verb alc272_toshiba_init_verbs[] = {
+	/* Front Pin: output 0 (0x0c) */
+	{0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, /* 0x14 */
+	{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* 0x14 */
+	/* Front Mic pin: input vref at 80% */
+	{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, /* 0x19 */
+	{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},    /* 0x19 */
+	{0x17, AC_VERB_SET_EAPD_BTLENABLE, 2}, /* 0x14 */
+	{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* originally 0x12 */
+	{0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
+	{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
+	{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
+	{0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
+	{0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+	{0x21, AC_VERB_SET_CONNECT_SEL, 0x01},  /* Headphone */
+	{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
+	{0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(9)},
+	{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
+	{0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
+	{}
+};
+
 
 /* capture mixer elements */
 static struct snd_kcontrol_new alc662_capture_mixer[] = {
@@ -15872,6 +15895,7 @@  static const char *alc662_models[ALC662_MODEL_LAST] = {
 	[ALC662_ASUS_EEEPC_EP20] = "eeepc-ep20",
 	[ALC662_ECS] = "ecs",
 	[ALC272_DELL_ZM1] = "dell-zm1",
+	[ALC272_TOSHIBA_NB200] = "toshiba-nb200",
 	[ALC663_ASUS_M51VA] = "m51va",
 	[ALC663_ASUS_G71V] = "g71v",
 	[ALC663_ASUS_H13] = "h13",
@@ -15929,6 +15953,7 @@  static struct snd_pci_quirk alc662_cfg_tbl[] = {
 	SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_ECS),
 	SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_ECS),
 	SND_PCI_QUIRK(0x1028, 0x02f4, "DELL ZM1", ALC272_DELL_ZM1),
+	SND_PCI_QUIRK(0x1179, 0xff6e, "Toshiba NB200", ALC272_TOSHIBA_NB200),
 	SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte 945GCM-S2L",
 		      ALC662_3ST_6ch_DIG),
 	SND_PCI_QUIRK(0x1565, 0x820f, "Biostar TA780G M2+", ALC662_3ST_6ch_DIG),
@@ -16050,6 +16075,20 @@  static struct alc_config_preset alc662_presets[] = {
                 .unsol_event = alc663_m51va_unsol_event,
                 .init_hook = alc663_m51va_inithook,
         },
+	[ALC272_TOSHIBA_NB200] = {
+		.mixers = { alc663_m51va_mixer },
+		.init_verbs = { alc662_init_verbs, alc272_toshiba_init_verbs },
+		.num_dacs = ARRAY_SIZE(alc662_dac_nids),
+		.dac_nids = alc662_dac_nids,
+		.num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
+		.adc_nids = alc662_adc_nids,
+		.num_adc_nids = ARRAY_SIZE(alc662_adc_nids),
+		.capsrc_nids = alc662_capsrc_nids,
+		.channel_mode = alc662_3ST_2ch_modes,
+		.input_mux = &alc663_m51va_capture_source,
+		.unsol_event = alc663_m51va_unsol_event,
+		.init_hook = alc663_m51va_inithook,
+	},
 	[ALC663_ASUS_M51VA] = {
 		.mixers = { alc663_m51va_mixer, alc662_capture_mixer},
 		.init_verbs = { alc662_init_verbs, alc663_m51va_init_verbs },