* Mute LED on HP Pavilion DV7-1160eg
@ 2010-05-01 20:19 Thoralf Freitag
2010-05-06 8:16 ` Takashi Iwai
0 siblings, 1 reply; 5+ messages in thread
From: Thoralf Freitag @ 2010-05-01 20:19 UTC (permalink / raw)
To: alsa-devel
I tried to find a way for switching/control Mute LED on an HP DV 7
notebook. I found a solution which is very ugly. According the solution
described here
(http://mailman.alsa-project.org/pipermail/alsa-devel/2009-April/016126.html)
I changed the value for LED control in this manner:
diff -u alsa-driver-1.0.23/sound/pci/hda/patch_sigmatel.c
alsa-driver-1.0.23_b/sound/pci/hda/patch_sigmatel.c
--- alsa-driver-1.0.23/sound/pci/hda/patch_sigmatel.c 2010-04-16
13:10:10.000000000 +0200
+++ alsa-driver-1.0.23_b/sound/pci/hda/patch_sigmatel.c 2010-05-01
21:37:36.719063655 +0200
@@ -4952,9 +4952,9 @@
}
}
if (muted)
- spec->gpio_data &= ~spec->gpio_led; /* orange */
+ spec->gpio_data &= ~0x01; /* orange */
else
- spec->gpio_data |= spec->gpio_led; /* white */
+ spec->gpio_data |= 0x01; /* white */
if (!spec->gpio_led_polarity) {
/* LED state is inverted on these systems */
I hate this solution. Maybe someone of the programming experts could
give me a way to make it better. On which position should I make which
changes ?
Thanx for your guidance.
Thoralf
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Mute LED on HP Pavilion DV7-1160eg
2010-05-01 20:19 Mute LED on HP Pavilion DV7-1160eg Thoralf Freitag
@ 2010-05-06 8:16 ` Takashi Iwai
2010-05-10 20:10 ` Thoralf Freitag
0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2010-05-06 8:16 UTC (permalink / raw)
To: Thoralf Freitag; +Cc: alsa-devel
At Sat, 01 May 2010 22:19:14 +0200,
Thoralf Freitag wrote:
>
> I tried to find a way for switching/control Mute LED on an HP DV 7
> notebook. I found a solution which is very ugly. According the solution
> described here
> (http://mailman.alsa-project.org/pipermail/alsa-devel/2009-April/016126.html)
> I changed the value for LED control in this manner:
>
> diff -u alsa-driver-1.0.23/sound/pci/hda/patch_sigmatel.c
> alsa-driver-1.0.23_b/sound/pci/hda/patch_sigmatel.c
> --- alsa-driver-1.0.23/sound/pci/hda/patch_sigmatel.c 2010-04-16
> 13:10:10.000000000 +0200
> +++ alsa-driver-1.0.23_b/sound/pci/hda/patch_sigmatel.c 2010-05-01
> 21:37:36.719063655 +0200
> @@ -4952,9 +4952,9 @@
> }
> }
> if (muted)
> - spec->gpio_data &= ~spec->gpio_led; /* orange */
> + spec->gpio_data &= ~0x01; /* orange */
> else
> - spec->gpio_data |= spec->gpio_led; /* white */
> + spec->gpio_data |= 0x01; /* white */
>
> if (!spec->gpio_led_polarity) {
> /* LED state is inverted on these systems */
>
> I hate this solution. Maybe someone of the programming experts could
> give me a way to make it better. On which position should I make which
> changes ?
The mute LED is set up in find_mute_led_gpio().
If your BIOS doesn't give the proper information, you can add the device
statically in hp_blike_system().
Takashi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Mute LED on HP Pavilion DV7-1160eg
2010-05-06 8:16 ` Takashi Iwai
@ 2010-05-10 20:10 ` Thoralf Freitag
2010-05-10 21:09 ` Takashi Iwai
0 siblings, 1 reply; 5+ messages in thread
From: Thoralf Freitag @ 2010-05-10 20:10 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel
Takashi Iwai schrieb:
> At Sat, 01 May 2010 22:19:14 +0200,
> Thoralf Freitag wrote:
>
>> I tried to find a way for switching/control Mute LED on an HP DV 7
>> notebook. I found a solution which is very ugly. According the solution
>> described here
>> (http://mailman.alsa-project.org/pipermail/alsa-devel/2009-April/016126.html)
>> I changed the value for LED control in this manner:
>>
>> diff -u alsa-driver-1.0.23/sound/pci/hda/patch_sigmatel.c
>> alsa-driver-1.0.23_b/sound/pci/hda/patch_sigmatel.c
>> --- alsa-driver-1.0.23/sound/pci/hda/patch_sigmatel.c 2010-04-16
>> 13:10:10.000000000 +0200
>> +++ alsa-driver-1.0.23_b/sound/pci/hda/patch_sigmatel.c 2010-05-01
>> 21:37:36.719063655 +0200
>> @@ -4952,9 +4952,9 @@
>> }
>> }
>> if (muted)
>> - spec->gpio_data &= ~spec->gpio_led; /* orange */
>> + spec->gpio_data &= ~0x01; /* orange */
>> else
>> - spec->gpio_data |= spec->gpio_led; /* white */
>> + spec->gpio_data |= 0x01; /* white */
>>
>> if (!spec->gpio_led_polarity) {
>> /* LED state is inverted on these systems */
>>
>> I hate this solution. Maybe someone of the programming experts could
>> give me a way to make it better. On which position should I make which
>> changes ?
>>
>
> The mute LED is set up in find_mute_led_gpio().
> If your BIOS doesn't give the proper information, you can add the device
> statically in hp_blike_system().
>
>
> Takashi
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
Takashi, thanks for your advice. Maybe I found the problem. Adding my
card to hp_blike_system() doesn't change anything. The driver identifies
the card (laptop) successfully as a HP DV7 (because the bass speaker is
usable and can switched on or off with tools like Alsamixergui), with or
without an entry in hp_blike_system() like this: case 0x103c30fc: .
As I identified, the problem is located in set_hp_led_gpio. This
function assumes, if it counts more than 3 io's, the GPIO 3 is
responsible for controlling of mute LED. Maybe it is right in some
cases, but not in all. For the HP7-1160eg (and probably not only on
this notebook) GPIO 0 controlls the mute LED, but the counter is
I could fix it by changing the value from 3 to 8 in static void
set_hp_led_gpio(struct hda_codec *codec). I don't know, there the value
of 3 comes from. But I afraid, it could causing a lot of side effects.
Who knows, why the threshold value is set greater then 3 ?
kaktus@elefant-lin:~$ diff
alsa-driver-1.0.23_a/alsa-kernel/pci/hda/patch_sigmatel.c
alsa-driver-1.0.23_b/alsa-kernel/pci/hda/patch_sigmatel.c
4769c4769
< if (gpio > 3)
---
> if (gpio > 8)
This is the function:
static void set_hp_led_gpio(struct hda_codec *codec)
{
struct sigmatel_spec *spec = codec->spec;
unsigned int gpio;
gpio = snd_hda_param_read(codec, codec->afg, AC_PAR_GPIO_CAP);
gpio &= AC_GPIO_IO_COUNT;
if (gpio > 8)
spec->gpio_led = 0x08; /* GPIO 3 */
else
spec->gpio_led = 0x01; /* GPIO 0 */
}
Here are some information about my sound-card. hda_analyzer shows:
Codec: 0x111d76b2
Address: 0
Function Id: 0x101
Vendor Id: 0x111d76b2
Subsystem Id: 0x103c30fd
Revision Id: 0x100302
No Modem Function Group found
Default PCM:
rates [0x7e0]: 44100 48000 88200 96000 176400 192000
bits [0xe]: 16 20 24
formats [0x1]: PCM
Default Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
Default Amp-Out caps: ofs=0x7f, nsteps=0x7f, stepsize=0x02, mute=1
GPIO: io=8, o=0, i=0, unsolicited=1, wake=1
IO[0]: enable=1, dir=1, wake=0, sticky=0, data=1, unsol=0
IO[1]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
IO[2]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
IO[3]: enable=1, dir=1, wake=0, sticky=0, data=0, unsol=0
IO[4]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
IO[5]: enable=1, dir=1, wake=0, sticky=0, data=1, unsol=0
IO[6]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
IO[7]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
What should I do for for making a reliable patch. Any ideas ?
Thanks.
TF
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Mute LED on HP Pavilion DV7-1160eg
2010-05-10 20:10 ` Thoralf Freitag
@ 2010-05-10 21:09 ` Takashi Iwai
0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2010-05-10 21:09 UTC (permalink / raw)
To: Thoralf Freitag; +Cc: alsa-devel
At Mon, 10 May 2010 22:10:23 +0200,
Thoralf Freitag wrote:
>
> Takashi Iwai schrieb:
> > At Sat, 01 May 2010 22:19:14 +0200,
> > Thoralf Freitag wrote:
> >
> >> I tried to find a way for switching/control Mute LED on an HP DV 7
> >> notebook. I found a solution which is very ugly. According the solution
> >> described here
> >> (http://mailman.alsa-project.org/pipermail/alsa-devel/2009-April/016126.html)
> >> I changed the value for LED control in this manner:
> >>
> >> diff -u alsa-driver-1.0.23/sound/pci/hda/patch_sigmatel.c
> >> alsa-driver-1.0.23_b/sound/pci/hda/patch_sigmatel.c
> >> --- alsa-driver-1.0.23/sound/pci/hda/patch_sigmatel.c 2010-04-16
> >> 13:10:10.000000000 +0200
> >> +++ alsa-driver-1.0.23_b/sound/pci/hda/patch_sigmatel.c 2010-05-01
> >> 21:37:36.719063655 +0200
> >> @@ -4952,9 +4952,9 @@
> >> }
> >> }
> >> if (muted)
> >> - spec->gpio_data &= ~spec->gpio_led; /* orange */
> >> + spec->gpio_data &= ~0x01; /* orange */
> >> else
> >> - spec->gpio_data |= spec->gpio_led; /* white */
> >> + spec->gpio_data |= 0x01; /* white */
> >>
> >> if (!spec->gpio_led_polarity) {
> >> /* LED state is inverted on these systems */
> >>
> >> I hate this solution. Maybe someone of the programming experts could
> >> give me a way to make it better. On which position should I make which
> >> changes ?
> >>
> >
> > The mute LED is set up in find_mute_led_gpio().
> > If your BIOS doesn't give the proper information, you can add the device
> > statically in hp_blike_system().
> >
> >
> > Takashi
> > _______________________________________________
> > Alsa-devel mailing list
> > Alsa-devel@alsa-project.org
> > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> >
> Takashi, thanks for your advice. Maybe I found the problem. Adding my
> card to hp_blike_system() doesn't change anything. The driver identifies
> the card (laptop) successfully as a HP DV7 (because the bass speaker is
> usable and can switched on or off with tools like Alsamixergui), with or
> without an entry in hp_blike_system() like this: case 0x103c30fc: .
>
> As I identified, the problem is located in set_hp_led_gpio. This
> function assumes, if it counts more than 3 io's, the GPIO 3 is
> responsible for controlling of mute LED. Maybe it is right in some
> cases, but not in all. For the HP7-1160eg (and probably not only on
> this notebook) GPIO 0 controlls the mute LED, but the counter is
>
> I could fix it by changing the value from 3 to 8 in static void
> set_hp_led_gpio(struct hda_codec *codec). I don't know, there the value
> of 3 comes from. But I afraid, it could causing a lot of side effects.
> Who knows, why the threshold value is set greater then 3 ?
>
> kaktus@elefant-lin:~$ diff
> alsa-driver-1.0.23_a/alsa-kernel/pci/hda/patch_sigmatel.c
> alsa-driver-1.0.23_b/alsa-kernel/pci/hda/patch_sigmatel.c
>
> 4769c4769
> < if (gpio > 3)
> ---
> > if (gpio > 8)
>
>
> This is the function:
>
> static void set_hp_led_gpio(struct hda_codec *codec)
> {
> struct sigmatel_spec *spec = codec->spec;
> unsigned int gpio;
>
> gpio = snd_hda_param_read(codec, codec->afg, AC_PAR_GPIO_CAP);
> gpio &= AC_GPIO_IO_COUNT;
> if (gpio > 8)
> spec->gpio_led = 0x08; /* GPIO 3 */
> else
> spec->gpio_led = 0x01; /* GPIO 0 */
> }
This isn't correct -- gpio here returned gives the number of GPIO
pins, and your codec chip has indeed 8 pins, thus its bitmask is
up to 0x80. GPIO bit 0x08 means 3 pins. That's how the number 3
was deduced in the original code.
> Here are some information about my sound-card. hda_analyzer shows:
>
> Codec: 0x111d76b2
> Address: 0
> Function Id: 0x101
> Vendor Id: 0x111d76b2
> Subsystem Id: 0x103c30fd
> Revision Id: 0x100302
> No Modem Function Group found
> Default PCM:
> rates [0x7e0]: 44100 48000 88200 96000 176400 192000
> bits [0xe]: 16 20 24
> formats [0x1]: PCM
> Default Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
> Default Amp-Out caps: ofs=0x7f, nsteps=0x7f, stepsize=0x02, mute=1
> GPIO: io=8, o=0, i=0, unsolicited=1, wake=1
> IO[0]: enable=1, dir=1, wake=0, sticky=0, data=1, unsol=0
> IO[1]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
> IO[2]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
> IO[3]: enable=1, dir=1, wake=0, sticky=0, data=0, unsol=0
> IO[4]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
> IO[5]: enable=1, dir=1, wake=0, sticky=0, data=1, unsol=0
> IO[6]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
> IO[7]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
>
>
> What should I do for for making a reliable patch. Any ideas ?
Based on the information from HP, I assumed that the large package
always contains 8 GPIO pins and GPIO 3 is used for mute LED. But,
it seems some don't follow that rule, apparently.
The right fix is simply to add an exception check.
Could you try the patch below?
Takashi
---
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 12825aa..fa8c25b 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -4766,6 +4766,12 @@ static void set_hp_led_gpio(struct hda_codec *codec)
struct sigmatel_spec *spec = codec->spec;
unsigned int gpio;
+ if (codec->vendor_id == 0x111d76b2) {
+ /* use GPIO 3 exceptionally */
+ spec->gpio_led = 0x08; /* GPIO 3 */
+ return;
+ }
+
gpio = snd_hda_param_read(codec, codec->afg, AC_PAR_GPIO_CAP);
gpio &= AC_GPIO_IO_COUNT;
if (gpio > 3)
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: Mute LED on HP Pavilion DV7-1160eg
2010-05-19 16:29 ` Takashi Iwai
@ 2010-05-30 22:12 ` Thoralf Freitag
0 siblings, 0 replies; 5+ messages in thread
From: Thoralf Freitag @ 2010-05-30 22:12 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel
Hi Takashi,
since you have patched the source code for the control of the Mute LED
on HP Pavilion DV7, I could test it for a longer time.
Everything works fine - except shutdown of the computer. I found out,
during the shutdown process a short loud hum occurs. This hum is
independ of volume and it come also, if sound muted.
I don't know whether this nomal (expected) or anything else is not 100 %
OK. What's your opinion ?
Thoralf
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-05-30 22:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-01 20:19 Mute LED on HP Pavilion DV7-1160eg Thoralf Freitag
2010-05-06 8:16 ` Takashi Iwai
2010-05-10 20:10 ` Thoralf Freitag
2010-05-10 21:09 ` Takashi Iwai
-- strict thread matches above, loose matches on Subject: below --
2010-05-19 15:34 [PATCH] ALSA: usb/mixer.c: remove unused variable Daniel Mack
2010-05-19 16:29 ` Takashi Iwai
2010-05-30 22:12 ` Mute LED on HP Pavilion DV7-1160eg Thoralf Freitag
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.