From: "joey.jiaojg" <joey.jiaojg@gmail.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: Raymond Yau <superquad.vortex2@gmail.com>,
pshou@realtek.com.tw,
ALSA Development Mailing List <alsa-devel@alsa-project.org>,
kailang@realtek.com.tw
Subject: Re: Bug report - patch_realtek.c - Laptop HP COMPAQ B1900 Series
Date: Wed, 15 Feb 2012 17:31:44 +0800 [thread overview]
Message-ID: <4F3B7B80.5030102@gmail.com> (raw)
In-Reply-To: <s5h8vk4wivv.wl%tiwai@suse.de>
[-- Attachment #1: Type: text/plain, Size: 720 bytes --]
Here is the diff file.
On 2012年02月15日 17:22, Takashi Iwai wrote:
> At Wed, 15 Feb 2012 17:08:45 +0800,
> joey.jiaojg wrote:
>> Well, now I have fully fixed the speaker/headphone issue for HP COMPAQ
>> B1900 by adding a new model=b1900 into patch_realtek.c which also can
>> automute by detect HP state.
> That's great.
>
>> As I cannot compile alsa-driver-1.0.25 on my ubuntu 11.10, so I modified
>> based on kernel-3.0.13 (alsa version 1.0.24) from ubuntu src.
>> Attached with stocked source and my updated one, please consider adding
>> into next alsa-driver.
> Could you simply give a patch file (with "diff -up")?
> Then I can check your changes more easily.
>
>
> thanks,
>
> Takashi
[-- Attachment #2: patch_realtek_diff.c --]
[-- Type: text/x-csrc, Size: 3752 bytes --]
--- patch_realtek.c.bk 2012-02-15 17:29:44.851620661 +0800
+++ patch_realtek.c 2012-02-15 17:29:40.887601285 +0800
@@ -80,6 +80,7 @@ enum {
ALC260_WILL,
ALC260_REPLACER_672V,
ALC260_FAVORIT100,
+ ALC260_B1900,
#ifdef CONFIG_SND_DEBUG
ALC260_TEST,
#endif
@@ -1323,6 +1324,34 @@ static void alc_inithook(struct hda_code
alc_mic_automute(codec);
}
+/* toggle speaker-output according to the hp-jack state */
+static void alc260_b1900_automute(struct hda_codec *codec)
+{
+ unsigned int present;
+
+ present = snd_hda_jack_detect(codec, 0x0f);
+ if (present) {
+ snd_hda_codec_write_cache(codec, 0x01, 0,
+ AC_VERB_SET_GPIO_MASK, 0);
+ snd_hda_codec_write_cache(codec, 0x01, 0,
+ AC_VERB_SET_GPIO_DIRECTION,
+ 0);
+ snd_hda_codec_write_cache(codec, 0x0f, 0,
+ AC_VERB_SET_PIN_WIDGET_CONTROL,
+ PIN_HP);
+ } else {
+ snd_hda_codec_write_cache(codec, 0x01, 0,
+ AC_VERB_SET_GPIO_MASK, 1);
+ snd_hda_codec_write_cache(codec, 0x01, 0,
+ AC_VERB_SET_GPIO_DIRECTION,
+ 1);
+ snd_hda_codec_write_cache(codec, 0x0f, 0,
+ AC_VERB_SET_PIN_WIDGET_CONTROL,
+ PIN_OUT);
+ }
+}
+
+
/* additional initialization for ALC888 variants */
static void alc888_coef_init(struct hda_codec *codec)
{
@@ -6899,6 +6928,18 @@ static const struct hda_verb alc260_will
{}
};
+static const struct hda_verb alc260_b1900_verbs[] = {
+ {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
+ {0x0b, AC_VERB_SET_CONNECT_SEL, 0x00},
+ {0x0d, AC_VERB_SET_CONNECT_SEL, 0x00},
+ {0x0f, AC_VERB_SET_EAPD_BTLENABLE, 0x02},
+ {0x1a, AC_VERB_SET_COEF_INDEX, 0x07},
+ {0x1a, AC_VERB_SET_PROC_COEF, 0x3040},
+ {0x0f, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
+ {}
+};
+
+
static const struct hda_verb alc260_replacer_672v_verbs[] = {
{0x0f, AC_VERB_SET_EAPD_BTLENABLE, 0x02},
{0x1a, AC_VERB_SET_COEF_INDEX, 0x07},
@@ -6941,6 +6982,12 @@ static void alc260_replacer_672v_unsol_e
alc260_replacer_672v_automute(codec);
}
+static void alc260_b1900_unsol_event(struct hda_codec *codec,
+ unsigned int res)
+{
+ if ((res >> 26) == ALC880_HP_EVENT)
+ alc260_b1900_automute(codec);
+}
static const struct hda_verb alc260_hp_dc7600_verbs[] = {
{0x05, AC_VERB_SET_CONNECT_SEL, 0x01},
{0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
@@ -7431,6 +7478,7 @@ static const char * const alc260_models[
[ALC260_WILL] = "will",
[ALC260_REPLACER_672V] = "replacer",
[ALC260_FAVORIT100] = "favorit100",
+ [ALC260_B1900] = "b1900",
#ifdef CONFIG_SND_DEBUG
[ALC260_TEST] = "test",
#endif
@@ -7458,6 +7506,7 @@ static const struct snd_pci_quirk alc260
SND_PCI_QUIRK(0x152d, 0x0729, "CTL U553W", ALC260_BASIC),
SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_REPLACER_672V),
SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_WILL),
+ SND_PCI_QUIRK(0x103c, 0x007f, "HP COMPAQ", ALC260_B1900),
{}
};
@@ -7570,6 +7619,20 @@ static const struct alc_config_preset al
.channel_mode = alc260_modes,
.input_mux = &alc260_capture_source,
},
+ [ALC260_B1900] = {
+ .mixers = { alc260_will_mixer },
+ .init_verbs = { alc260_init_verbs, alc260_b1900_verbs },
+ .num_dacs = ARRAY_SIZE(alc260_dac_nids),
+ .dac_nids = alc260_dac_nids,
+ .num_adc_nids = ARRAY_SIZE(alc260_adc_nids),
+ .adc_nids = alc260_adc_nids,
+ .dig_out_nid = ALC260_DIGOUT_NID,
+ .num_channel_mode = ARRAY_SIZE(alc260_modes),
+ .channel_mode = alc260_modes,
+ .input_mux = &alc260_capture_source,
+ .unsol_event = alc260_b1900_unsol_event,
+ .init_hook = alc260_b1900_automute,
+ },
[ALC260_REPLACER_672V] = {
.mixers = { alc260_replacer_672v_mixer },
.init_verbs = { alc260_init_verbs, alc260_replacer_672v_verbs },
[-- Attachment #3: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2012-02-15 9:31 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4F35C191.9080401@gmail.com>
2012-02-11 2:05 ` Bug report - patch_realtek.c - Laptop HP COMPAQ B1900 Series Jonathan Woithe
2012-02-15 0:50 ` Raymond Yau
[not found] ` <CAKOmCvoS+tgvyPZJey4gfFFq=Uz01pnZY7YvGbxgQPpAzQ7KCA@mail.gmail.com>
2012-02-15 1:29 ` Joey Jiao
2012-02-15 2:49 ` Raymond Yau
[not found] ` <4F3B761D.4060306@gmail.com>
2012-02-15 9:22 ` Takashi Iwai
2012-02-15 9:31 ` joey.jiaojg [this message]
2012-02-15 9:40 ` Takashi Iwai
2012-02-15 9:45 ` joey.jiaojg
2012-02-15 9:58 ` Takashi Iwai
2012-02-15 10:06 ` joey.jiaojg
2012-02-15 10:11 ` Takashi Iwai
2012-02-15 13:14 ` joey.jiaojg
2012-02-15 13:21 ` Takashi Iwai
2012-02-15 14:45 ` joey.jiaojg
2012-02-15 15:04 ` Takashi Iwai
2012-02-16 2:04 ` Joey Jiao
2012-02-16 3:41 ` joey.jiaojg
2012-02-16 9:36 ` Takashi Iwai
2012-02-16 9:35 ` Takashi Iwai
2012-02-16 9:38 ` joey.jiaojg
2012-02-16 9:41 ` Takashi Iwai
2012-02-16 9:42 ` Takashi Iwai
2012-02-16 9:52 ` joey.jiaojg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F3B7B80.5030102@gmail.com \
--to=joey.jiaojg@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=kailang@realtek.com.tw \
--cc=pshou@realtek.com.tw \
--cc=superquad.vortex2@gmail.com \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).