Bug#581876: Please apply upstream patch to fix the beep for some Thinkpad machines

2010-06-05 Thread Ben Hutchings
On Fri, 2010-06-04 at 09:10 +0200, Bjørn Mork wrote:
> Note: the commits I refer below to are taken from
> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
> 
> 
> Andrei Popescu  writes:
> 
> > 2.6.30 introduced a regression where some Thinkpads would not beep 
> > anymore on plugging/unplugging the power chord. See this thread
> > http://sourceforge.net/mailarchive/message.php?msg_id=m31vgd2v3h.fsf%40fox.lamasti.net
> > for more info.
> >
> > The alsa developers came up with a patch[1], but I haven't been able to 
> > test it myself as it won't apply against 2.6.32 from sid or even 2.6.33 
> > from experimental.
> 
> That's because it depends on ee6e365e30f7ee89bd214ff1215aaf90e93d4c40
> which isn't merged.  You may apply that first and then
> 0bf0e5a6f304ac1bc93a80cdd68b4d91f3519eb5 (which is the patch you refer
> to taken from Linus' tree).  Together they apply cleanly to 2.6.32.
[...]

But the result won't compile because HDA_CODEC_MUTE_BEEP is not defined.

Ben.

-- 
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.


signature.asc
Description: This is a digitally signed message part


Bug#581876: Please apply upstream patch to fix the beep for some Thinkpad machines

2010-06-04 Thread Bjørn Mork
Note: the commits I refer below to are taken from
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git


Andrei Popescu  writes:

> 2.6.30 introduced a regression where some Thinkpads would not beep 
> anymore on plugging/unplugging the power chord. See this thread
> http://sourceforge.net/mailarchive/message.php?msg_id=m31vgd2v3h.fsf%40fox.lamasti.net
> for more info.
>
> The alsa developers came up with a patch[1], but I haven't been able to 
> test it myself as it won't apply against 2.6.32 from sid or even 2.6.33 
> from experimental.

That's because it depends on ee6e365e30f7ee89bd214ff1215aaf90e93d4c40
which isn't merged.  You may apply that first and then
0bf0e5a6f304ac1bc93a80cdd68b4d91f3519eb5 (which is the patch you refer
to taken from Linus' tree).  Together they apply cleanly to 2.6.32.

Or you could try the patch I've attached, which is a backported variant
of 0bf0e5a6f304ac1bc93a80cdd68b4d91f3519eb5, avoiding the change in
ee6e365e30f7ee89bd214ff1215aaf90e93d4c40.

If this does fix a regression in 2.6.32, then I guess it's really more
material for 2.6.32 stable than for Debian kernels directly?



Bjørn

>From 2ac9a8175fe49bb994f87eedbc30572978325d05 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela 
Date: Fri, 26 Mar 2010 10:33:18 +0100
Subject: [PATCH] ALSA: hda-intel - AD1984 thinkpad - add analog beep input control
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

commit 0bf0e5a6f304ac1bc93a80cdd68b4d91f3519eb5 upstream
[bjorn: backported to 2.6.32 to avoid applying
ee6e365e30f7ee89bd214ff1215aaf90e93d4c40 as well]

For Lenovo Thinkpad T61/X61, the analog beep input is connected
to node 0x20, index 3. Move the digital beep mute/volume controls
as "Digital Beep" and create analog beep controls for mentioned node.

Signed-off-by: Jaroslav Kysela 
Signed-off-by: Bjørn Mork 
---
 sound/pci/hda/patch_analog.c |   19 ---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index bd0794e..8ff539e 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -71,8 +71,9 @@ struct ad198x_spec {
 	struct hda_input_mux private_imux;
 	hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS];
 
-	unsigned int jack_present :1;
-	unsigned int inv_jack_detect:1;
+	unsigned int jack_present: 1;
+	unsigned int inv_jack_detect: 1;/* inverted jack-detection */
+	unsigned int analog_beep: 1;	/* analog beep input present */
 
 #ifdef CONFIG_SND_HDA_POWER_SAVE
 	struct hda_loopback_check loopback;
@@ -163,6 +164,12 @@ static struct snd_kcontrol_new ad_beep_mixer[] = {
 	{ } /* end */
 };
 
+static struct snd_kcontrol_new ad_beep2_mixer[] = {
+	HDA_CODEC_VOLUME("Digital Beep Playback Volume", 0, 0, HDA_OUTPUT),
+	HDA_CODEC_MUTE_BEEP("Digital Beep Playback Switch", 0, 0, HDA_OUTPUT),
+	{ } /* end */
+};
+
 #define set_beep_amp(spec, nid, idx, dir) \
 	((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 1, idx, dir)) /* mono */
 
@@ -196,7 +203,8 @@ static int ad198x_build_controls(struct hda_codec *codec)
 	/* create beep controls if needed */
 	if (spec->beep_amp) {
 		struct snd_kcontrol_new *knew;
-		for (knew = ad_beep_mixer; knew->name; knew++) {
+		knew = spec->analog_beep ? ad_beep2_mixer : ad_beep_mixer;
+		for ( ; knew->name; knew++) {
 			struct snd_kcontrol *kctl;
 			kctl = snd_ctl_new1(knew, codec);
 			if (!kctl)
@@ -3362,6 +3370,8 @@ static struct snd_kcontrol_new ad1984_thinkpad_mixers[] = {
 	HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x00, HDA_INPUT),
 	HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x20, 0x01, HDA_INPUT),
 	HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x20, 0x01, HDA_INPUT),
+	HDA_CODEC_VOLUME("Beep Playback Volume", 0x20, 0x03, HDA_INPUT),
+	HDA_CODEC_MUTE("Beep Playback Switch", 0x20, 0x03, HDA_INPUT),
 	HDA_CODEC_VOLUME("Docking Mic Playback Volume", 0x20, 0x04, HDA_INPUT),
 	HDA_CODEC_MUTE("Docking Mic Playback Switch", 0x20, 0x04, HDA_INPUT),
 	HDA_CODEC_VOLUME("Mic Boost", 0x14, 0x0, HDA_INPUT),
@@ -3403,6 +3413,8 @@ static struct hda_verb ad1984_thinkpad_init_verbs[] = {
 	{0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
 	/* docking mic boost */
 	{0x25, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
+	/* Analog PC Beeper - allow firmware/ACPI beeps */
+	{0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3) | 0x1a},
 	/* Analog mixer - docking mic; mute as default */
 	{0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
 	/* enable EAPD bit */
@@ -3535,6 +3547,7 @@ static int patch_ad1984(struct hda_codec *codec)
 		spec->input_mux = &ad1984_thinkpad_capture_source;
 		spec->mixers[0] = ad1984_thinkpad_mixers;
 		spec->init_verbs[spec->num_init_verbs++] = ad1984_thinkpad_init_verbs;
+		spec->analog_beep = 1;
 		break;
 	case AD1984_DELL_DESKTOP:
 		spec->multiout.dig_out_nid = 0;
-- 
1.7.1



Bug#581876: Please apply upstream patch to fix the beep for some Thinkpad machines

2010-06-03 Thread Andrei Popescu
On Vi, 04 iun 10, 00:46:16, Moritz Muehlenhoff wrote:
> Version: 2.6.34-1
> 
> Andrei Popescu wrote:
> > On Mon,17.May.10, 02:48:28, Ben Hutchings wrote:
> >  
> > > Sorry, this patch cannot be applied on its own.  It depends on other
> > > changes to registration of 'beep' devices, and I'm not yet convinced
> > > that it's worth the risk to backport those changes.
> > 
> > Thanks for considering. If there's anything I can do to help please let 
> > me know.
> 
> The patch was merged in 2.6.34, marking that version as fixed.

Do you mean the version in experimental? I'll test as soon as I have 
time.

Regards,
Andrei
-- 
http://nuvreauspam.ro/2010/05/4-neticheta-pe-mail/


signature.asc
Description: Digital signature


Bug#581876: Please apply upstream patch to fix the beep for some Thinkpad machines

2010-05-17 Thread Andrei Popescu
On Mon,17.May.10, 02:48:28, Ben Hutchings wrote:
 
> Sorry, this patch cannot be applied on its own.  It depends on other
> changes to registration of 'beep' devices, and I'm not yet convinced
> that it's worth the risk to backport those changes.

Thanks for considering. If there's anything I can do to help please let 
me know.

Regards,
Andrei
-- 
http://nuvreauspam.ro/2010/05/4-neticheta-pe-mail/


signature.asc
Description: Digital signature


Bug#581876: Please apply upstream patch to fix the beep for some Thinkpad machines

2010-05-16 Thread Ben Hutchings
On Sun, 2010-05-16 at 23:26 +0300, Andrei Popescu wrote:
> Package: linux-2.6
> Severity: wishlist
> 
> Hello,
> 
> 2.6.30 introduced a regression where some Thinkpads would not beep 
> anymore on plugging/unplugging the power chord. See this thread
> http://sourceforge.net/mailarchive/message.php?msg_id=m31vgd2v3h.fsf%40fox.lamasti.net
> for more info.
> 
> The alsa developers came up with a patch[1], but I haven't been able to 
> test it myself as it won't apply against 2.6.32 from sid or even 2.6.33 
> from experimental.
> 
> If it isn't too much work to backport the patch it would be nice to have 
> it in squeeze. I could test if needed (assuming I get the rebuild[2] 
> right), but I lack the skills to do it myself.
[...]

Sorry, this patch cannot be applied on its own.  It depends on other
changes to registration of 'beep' devices, and I'm not yet convinced
that it's worth the risk to backport those changes.

Ben.

-- 
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.


signature.asc
Description: This is a digitally signed message part


Bug#581876: Please apply upstream patch to fix the beep for some Thinkpad machines

2010-05-16 Thread Andrei Popescu
Package: linux-2.6
Severity: wishlist

Hello,

2.6.30 introduced a regression where some Thinkpads would not beep 
anymore on plugging/unplugging the power chord. See this thread
http://sourceforge.net/mailarchive/message.php?msg_id=m31vgd2v3h.fsf%40fox.lamasti.net
for more info.

The alsa developers came up with a patch[1], but I haven't been able to 
test it myself as it won't apply against 2.6.32 from sid or even 2.6.33 
from experimental.

If it isn't too much work to backport the patch it would be nice to have 
it in squeeze. I could test if needed (assuming I get the rebuild[2] 
right), but I lack the skills to do it myself.

[1] 
http://sourceforge.net/mailarchive/message.php?msg_name=alpine.LNX.2.00.1003261047210.3925%40eeebox2.perex-int.cz

[2] http://wiki.debian.org/HowToRebuildAnOfficialDebianKernelPackage
BTW, there's a minor addition I wanted to do for this page, but it's set 
immutable...

Regards,
Andrei

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=ro_RO.UTF-8, LC_CTYPE=ro_RO.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash



-- 
To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/20100516202621.10814.56037.report...@think.homelan