[alsa-devel] [PATCH] ALSA: Fix mute led GPIO on HP dv-series notebooks.
On my laptop (HP dv6-1110ax), there are no OEM strings in SMBIOS of type "HP_Mute_LED*". Hence, the GPIO for the mute button LED doesn't get set properly. I didn't find the strings in my cousin's laptop (HP dv9500t CTO) either.
As per the documentation of find_mute_led_gpio(), these strings occur in HP B-series systems - so, before scanning the SMBIOS strings, we need to check if we're dealing with a B-series system. Need to get confirmation from HP if this logic takes care of all the systems. I'm trying to poke a friend there.
Please let me know if this looks OK or needs changes.
Signed-off-by: Kunal Gangakhedkar kunal.gangakhedkar@gmail.com --- sound/pci/hda/patch_sigmatel.c | 82 ++++++++++++++++++++++++++++++---------- 1 files changed, 62 insertions(+), 20 deletions(-)
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 117919a..d421b3b 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -4737,6 +4737,8 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res) } }
+static int hp_blike_system(u32 subsystem_id); + /* * This method searches for the mute LED GPIO configuration * provided as OEM string in SMBIOS. The format of that string @@ -4748,6 +4750,19 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res) * * So, HP B-series like systems may have HP_Mute_LED_0 (current models) * or HP_Mute_LED_0_3 (future models) OEM SMBIOS strings + * + * + * The dv-series laptops don't seem to have the HP_Mute_LED* strings in + * SMBIOS - at least the ones I have seen do not have them - which include + * my own system (HP Pavilion dv6-1110ax) and my cousin's + * HP Pavilion dv9500t CTO. + * Need more information on whether it is true across the entire series. + * + * The "else" could be converted into a conditional check for dv-series - + * say, hp_dv_series_system() - just like hp_blike_system(); however, + * I don't have all the PCI ids to identify the dv-series machines - maybe, + * we can add that later. + * -- kunal */ static int find_mute_led_gpio(struct hda_codec *codec) { @@ -4755,29 +4770,54 @@ static int find_mute_led_gpio(struct hda_codec *codec) const struct dmi_device *dev = NULL;
if ((codec->subsystem_id >> 16) == PCI_VENDOR_ID_HP) { - while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, + if (hp_blike_system(codec->subsystem_id)) { + while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) { - if (sscanf(dev->name, "HP_Mute_LED_%d_%d", - &spec->gpio_led_polarity, - &spec->gpio_led) == 2) { - spec->gpio_led = 1 << spec->gpio_led; - return 1; - } - if (sscanf(dev->name, "HP_Mute_LED_%d", - &spec->gpio_led_polarity) == 1) { - switch (codec->vendor_id) { - case 0x111d7608: - /* GPIO 0 */ - spec->gpio_led = 0x01; - return 1; - case 0x111d7600: - case 0x111d7601: - case 0x111d7602: - case 0x111d7603: - /* GPIO 3 */ - spec->gpio_led = 0x08; + if (sscanf(dev->name, "HP_Mute_LED_%d_%d", + &spec->gpio_led_polarity, + &spec->gpio_led) == 2) { + spec->gpio_led = 1 << spec->gpio_led; return 1; } + if (sscanf(dev->name, "HP_Mute_LED_%d", + &spec->gpio_led_polarity) == 1) { + switch (codec->vendor_id) { + case 0x111d7608: + /* GPIO 0 */ + spec->gpio_led = 0x01; + return 1; + case 0x111d7600: + case 0x111d7601: + case 0x111d7602: + case 0x111d7603: + /* GPIO 3 */ + spec->gpio_led = 0x08; + return 1; + } + } + } + } else { + /* + * Pavilion dv series notebooks do not seem to have + * HP_Mute_LED* in SMBIOS. + * If HP decides to add it in dv series, + * we'll need to fix this part + * - or merge it with the B-like check above. + */ + switch (codec->vendor_id) { + case 0x111d7608: + /* GPIO 0 */ + spec->gpio_led = 0x01; + spec->gpio_led_polarity |= spec->gpio_led; + return 1; + case 0x111d7600: + case 0x111d7601: + case 0x111d7602: + case 0x111d7603: + /* GPIO 3 */ + spec->gpio_led = 0x08; + spec->gpio_led_polarity |= spec->gpio_led; + return 1; } } } @@ -5603,6 +5643,8 @@ again: spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids); spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e);
+ snd_printd("Found board config: %d\n", spec->board_config); + switch (spec->board_config) { case STAC_HP_M4: /* enable internal microphone */
At Fri, 15 Jan 2010 12:04:11 +0530, Kunal Gangakhedkar wrote:
On my laptop (HP dv6-1110ax), there are no OEM strings in SMBIOS of type "HP_Mute_LED*". Hence, the GPIO for the mute button LED doesn't get set properly. I didn't find the strings in my cousin's laptop (HP dv9500t CTO) either.
As per the documentation of find_mute_led_gpio(), these strings occur in HP B-series systems - so, before scanning the SMBIOS strings, we need to check if we're dealing with a B-series system. Need to get confirmation from HP if this logic takes care of all the systems. I'm trying to poke a friend there.
Please let me know if this looks OK or needs changes.
The lengthy case for checking gpio_led can be a single function, e.g. set_hp_gpio_led(), so that we don't need to add to multiple places if new codec chip appears. Then the else section (dv) can be simply set_hp_gpio_led(codec); spec->gpio_led_polarity = 1; return 1;
Could you change in that way, test and repost?
thanks,
Takashi
Signed-off-by: Kunal Gangakhedkar kunal.gangakhedkar@gmail.com
sound/pci/hda/patch_sigmatel.c | 82 ++++++++++++++++++++++++++++++---------- 1 files changed, 62 insertions(+), 20 deletions(-)
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 117919a..d421b3b 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -4737,6 +4737,8 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res) } }
+static int hp_blike_system(u32 subsystem_id);
/*
- This method searches for the mute LED GPIO configuration
- provided as OEM string in SMBIOS. The format of that string
@@ -4748,6 +4750,19 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res)
- So, HP B-series like systems may have HP_Mute_LED_0 (current models)
- or HP_Mute_LED_0_3 (future models) OEM SMBIOS strings
- The dv-series laptops don't seem to have the HP_Mute_LED* strings in
- SMBIOS - at least the ones I have seen do not have them - which include
- my own system (HP Pavilion dv6-1110ax) and my cousin's
- HP Pavilion dv9500t CTO.
- Need more information on whether it is true across the entire series.
- The "else" could be converted into a conditional check for dv-series -
- say, hp_dv_series_system() - just like hp_blike_system(); however,
- I don't have all the PCI ids to identify the dv-series machines - maybe,
- we can add that later.
*/
- -- kunal
static int find_mute_led_gpio(struct hda_codec *codec) { @@ -4755,29 +4770,54 @@ static int find_mute_led_gpio(struct hda_codec *codec) const struct dmi_device *dev = NULL;
if ((codec->subsystem_id >> 16) == PCI_VENDOR_ID_HP) {
while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING,
if (hp_blike_system(codec->subsystem_id)) {
while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
if (sscanf(dev->name, "HP_Mute_LED_%d_%d",
&spec->gpio_led_polarity,
&spec->gpio_led) == 2) {
spec->gpio_led = 1 << spec->gpio_led;
return 1;
}
if (sscanf(dev->name, "HP_Mute_LED_%d",
&spec->gpio_led_polarity) == 1) {
switch (codec->vendor_id) {
case 0x111d7608:
/* GPIO 0 */
spec->gpio_led = 0x01;
return 1;
case 0x111d7600:
case 0x111d7601:
case 0x111d7602:
case 0x111d7603:
/* GPIO 3 */
spec->gpio_led = 0x08;
if (sscanf(dev->name, "HP_Mute_LED_%d_%d",
&spec->gpio_led_polarity,
&spec->gpio_led) == 2) {
spec->gpio_led = 1 << spec->gpio_led; return 1; }
if (sscanf(dev->name, "HP_Mute_LED_%d",
&spec->gpio_led_polarity) == 1) {
switch (codec->vendor_id) {
case 0x111d7608:
/* GPIO 0 */
spec->gpio_led = 0x01;
return 1;
case 0x111d7600:
case 0x111d7601:
case 0x111d7602:
case 0x111d7603:
/* GPIO 3 */
spec->gpio_led = 0x08;
return 1;
}
}
}
} else {
/*
* Pavilion dv series notebooks do not seem to have
* HP_Mute_LED* in SMBIOS.
* If HP decides to add it in dv series,
* we'll need to fix this part
* - or merge it with the B-like check above.
*/
switch (codec->vendor_id) {
case 0x111d7608:
/* GPIO 0 */
spec->gpio_led = 0x01;
spec->gpio_led_polarity |= spec->gpio_led;
return 1;
case 0x111d7600:
case 0x111d7601:
case 0x111d7602:
case 0x111d7603:
/* GPIO 3 */
spec->gpio_led = 0x08;
spec->gpio_led_polarity |= spec->gpio_led;
} }return 1; }
@@ -5603,6 +5643,8 @@ again: spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids); spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e);
- snd_printd("Found board config: %d\n", spec->board_config);
- switch (spec->board_config) { case STAC_HP_M4: /* enable internal microphone */
-- 1.6.6.60.gc2ff1
Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
On my laptop (HP dv6-1110ax), there are no OEM strings in SMBIOS of type "HP_Mute_LED*". Hence, the GPIO for the mute button LED doesn't get set properly. I didn't find the strings in my cousin's laptop (HP dv9500t CTO) either.
As per the documentation of find_mute_led_gpio(), these strings occur in HP B-series systems - so, before scanning the SMBIOS strings, we need to check if we're dealing with a B-series system. Need to get confirmation from HP if this logic takes care of all the systems. I'm trying to poke a friend there.
Please let me know if this looks OK or needs changes.
Signed-off-by: Kunal Gangakhedkar kunal.gangakhedkar@gmail.com --- sound/pci/hda/patch_sigmatel.c | 88 +++++++++++++++++++++++++++++++--------- 1 files changed, 68 insertions(+), 20 deletions(-)
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 117919a..85abf14 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -4737,6 +4737,26 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res) } }
+static int hp_blike_system(u32 subsystem_id); + +static void set_hp_led_gpio(struct hda_codec *codec) +{ + struct sigmatel_spec *spec = codec->spec; + switch (codec->vendor_id) { + case 0x111d7608: + /* GPIO 0 */ + spec->gpio_led = 0x01; + break; + case 0x111d7600: + case 0x111d7601: + case 0x111d7602: + case 0x111d7603: + /* GPIO 3 */ + spec->gpio_led = 0x08; + break; + } +} + /* * This method searches for the mute LED GPIO configuration * provided as OEM string in SMBIOS. The format of that string @@ -4748,6 +4768,19 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res) * * So, HP B-series like systems may have HP_Mute_LED_0 (current models) * or HP_Mute_LED_0_3 (future models) OEM SMBIOS strings + * + * + * The dv-series laptops don't seem to have the HP_Mute_LED* strings in + * SMBIOS - at least the ones I have seen do not have them - which include + * my own system (HP Pavilion dv6-1110ax) and my cousin's + * HP Pavilion dv9500t CTO. + * Need more information on whether it is true across the entire series. + * + * The "else" could be converted into a conditional check for dv-series - + * say, hp_dv_series_system() - just like hp_blike_system(); however, + * I don't have all the PCI ids to identify the dv-series machines - maybe, + * we can add that later. + * -- kunal */ static int find_mute_led_gpio(struct hda_codec *codec) { @@ -4755,30 +4788,43 @@ static int find_mute_led_gpio(struct hda_codec *codec) const struct dmi_device *dev = NULL;
if ((codec->subsystem_id >> 16) == PCI_VENDOR_ID_HP) { - while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, + if (hp_blike_system(codec->subsystem_id)) { + while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) { - if (sscanf(dev->name, "HP_Mute_LED_%d_%d", - &spec->gpio_led_polarity, - &spec->gpio_led) == 2) { - spec->gpio_led = 1 << spec->gpio_led; - return 1; - } - if (sscanf(dev->name, "HP_Mute_LED_%d", - &spec->gpio_led_polarity) == 1) { - switch (codec->vendor_id) { - case 0x111d7608: - /* GPIO 0 */ - spec->gpio_led = 0x01; - return 1; - case 0x111d7600: - case 0x111d7601: - case 0x111d7602: - case 0x111d7603: - /* GPIO 3 */ - spec->gpio_led = 0x08; + if (sscanf(dev->name, "HP_Mute_LED_%d_%d", + &spec->gpio_led_polarity, + &spec->gpio_led) == 2) { + spec->gpio_led = 1 << spec->gpio_led; return 1; } + if (sscanf(dev->name, "HP_Mute_LED_%d", + &spec->gpio_led_polarity) == 1) { + switch (codec->vendor_id) { + case 0x111d7608: + /* GPIO 0 */ + spec->gpio_led = 0x01; + return 1; + case 0x111d7600: + case 0x111d7601: + case 0x111d7602: + case 0x111d7603: + /* GPIO 3 */ + spec->gpio_led = 0x08; + return 1; + } + } } + } else { + /* + * Pavilion dv series notebooks do not seem to have + * HP_Mute_LED* in SMBIOS. + * If HP decides to add it in dv series, + * we'll need to fix this part + * - or merge it with the B-like check above. + */ + set_hp_led_gpio(codec); + spec->gpio_led_polarity = 1; + return 1; } } return 0; @@ -5603,6 +5649,8 @@ again: spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids); spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e);
+ snd_printd("Found board config: %d\n", spec->board_config); + switch (spec->board_config) { case STAC_HP_M4: /* enable internal microphone */
At Fri, 15 Jan 2010 18:35:19 +0530, Kunal Gangakhedkar wrote:
On my laptop (HP dv6-1110ax), there are no OEM strings in SMBIOS of type "HP_Mute_LED*". Hence, the GPIO for the mute button LED doesn't get set properly. I didn't find the strings in my cousin's laptop (HP dv9500t CTO) either.
As per the documentation of find_mute_led_gpio(), these strings occur in HP B-series systems - so, before scanning the SMBIOS strings, we need to check if we're dealing with a B-series system. Need to get confirmation from HP if this logic takes care of all the systems. I'm trying to poke a friend there.
Please let me know if this looks OK or needs changes.
Well, the open switch() for blike-system should be replaced with set_hp_led_gpio(). That's the very purpose I proposed to create a function.
Thinking the logic again, however, it might be safer to check DMI entries no matter which model is. Then set statically if it's DV series (i.e. !hp_blike_system()) as fallback. I suppose HP will implement the DMI entry for their new BIOS on other models in future, too, so the chance is high that the right setup is detected through DMI check instead of blindly fixed setup.
thanks,
Takashi
Signed-off-by: Kunal Gangakhedkar kunal.gangakhedkar@gmail.com
sound/pci/hda/patch_sigmatel.c | 88 +++++++++++++++++++++++++++++++--------- 1 files changed, 68 insertions(+), 20 deletions(-)
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 117919a..85abf14 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -4737,6 +4737,26 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res) } }
+static int hp_blike_system(u32 subsystem_id);
+static void set_hp_led_gpio(struct hda_codec *codec) +{
- struct sigmatel_spec *spec = codec->spec;
- switch (codec->vendor_id) {
- case 0x111d7608:
/* GPIO 0 */
spec->gpio_led = 0x01;
break;
- case 0x111d7600:
- case 0x111d7601:
- case 0x111d7602:
- case 0x111d7603:
/* GPIO 3 */
spec->gpio_led = 0x08;
break;
- }
+}
/*
- This method searches for the mute LED GPIO configuration
- provided as OEM string in SMBIOS. The format of that string
@@ -4748,6 +4768,19 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res)
- So, HP B-series like systems may have HP_Mute_LED_0 (current models)
- or HP_Mute_LED_0_3 (future models) OEM SMBIOS strings
- The dv-series laptops don't seem to have the HP_Mute_LED* strings in
- SMBIOS - at least the ones I have seen do not have them - which include
- my own system (HP Pavilion dv6-1110ax) and my cousin's
- HP Pavilion dv9500t CTO.
- Need more information on whether it is true across the entire series.
- The "else" could be converted into a conditional check for dv-series -
- say, hp_dv_series_system() - just like hp_blike_system(); however,
- I don't have all the PCI ids to identify the dv-series machines - maybe,
- we can add that later.
*/
- -- kunal
static int find_mute_led_gpio(struct hda_codec *codec) { @@ -4755,30 +4788,43 @@ static int find_mute_led_gpio(struct hda_codec *codec) const struct dmi_device *dev = NULL;
if ((codec->subsystem_id >> 16) == PCI_VENDOR_ID_HP) {
while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING,
if (hp_blike_system(codec->subsystem_id)) {
while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
if (sscanf(dev->name, "HP_Mute_LED_%d_%d",
&spec->gpio_led_polarity,
&spec->gpio_led) == 2) {
spec->gpio_led = 1 << spec->gpio_led;
return 1;
}
if (sscanf(dev->name, "HP_Mute_LED_%d",
&spec->gpio_led_polarity) == 1) {
switch (codec->vendor_id) {
case 0x111d7608:
/* GPIO 0 */
spec->gpio_led = 0x01;
return 1;
case 0x111d7600:
case 0x111d7601:
case 0x111d7602:
case 0x111d7603:
/* GPIO 3 */
spec->gpio_led = 0x08;
if (sscanf(dev->name, "HP_Mute_LED_%d_%d",
&spec->gpio_led_polarity,
&spec->gpio_led) == 2) {
spec->gpio_led = 1 << spec->gpio_led; return 1; }
if (sscanf(dev->name, "HP_Mute_LED_%d",
&spec->gpio_led_polarity) == 1) {
switch (codec->vendor_id) {
case 0x111d7608:
/* GPIO 0 */
spec->gpio_led = 0x01;
return 1;
case 0x111d7600:
case 0x111d7601:
case 0x111d7602:
case 0x111d7603:
/* GPIO 3 */
spec->gpio_led = 0x08;
return 1;
}
} }
} else {
/*
* Pavilion dv series notebooks do not seem to have
* HP_Mute_LED* in SMBIOS.
* If HP decides to add it in dv series,
* we'll need to fix this part
* - or merge it with the B-like check above.
*/
set_hp_led_gpio(codec);
spec->gpio_led_polarity = 1;
} } return 0;return 1;
@@ -5603,6 +5649,8 @@ again: spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids); spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e);
- snd_printd("Found board config: %d\n", spec->board_config);
- switch (spec->board_config) { case STAC_HP_M4: /* enable internal microphone */
-- 1.6.6.60.gc2ff1
On Friday 15 Jan 2010 6:51:30 pm Takashi Iwai wrote:
At Fri, 15 Jan 2010 18:35:19 +0530, Kunal Gangakhedkar wrote:
On my laptop (HP dv6-1110ax), there are no OEM strings in SMBIOS of type "HP_Mute_LED*". Hence, the GPIO for the mute button LED doesn't get set properly. I didn't find the strings in my cousin's laptop (HP dv9500t CTO) either.
As per the documentation of find_mute_led_gpio(), these strings occur in HP B-series systems - so, before scanning the SMBIOS strings, we need to check if we're dealing with a B-series system. Need to get confirmation from HP if this logic takes care of all the systems. I'm trying to poke a friend there.
Please let me know if this looks OK or needs changes.
Well, the open switch() for blike-system should be replaced with set_hp_led_gpio(). That's the very purpose I proposed to create a function.
I don't think you can do that since both cases (b-like and non-b-like) have different ways of setting the gpio.
Thinking the logic again, however, it might be safer to check DMI entries no matter which model is. Then set statically if it's DV series (i.e. !hp_blike_system()) as fallback. I suppose HP will implement the DMI entry for their new BIOS on other models in future, too, so the chance is high that the right setup is detected through DMI check instead of blindly fixed setup.
They're notorious to discontinue models really fast. For example, my laptop model is already discontinued in less than 6 months. So, I don't think I'll be getting updates for my BIOS at all. What do you propose for such cases?
I agree with your approach that we should be checking for DMI string unconditionally and use the fixed setup as fallback - I can send the patch with those fixes too. Let me know if that's what you'd prefer.
Thanks, Kunal
thanks,
Takashi
On Friday 15 Jan 2010 7:02:17 pm Kunal Gangakhedkar wrote:
On Friday 15 Jan 2010 6:51:30 pm Takashi Iwai wrote:
At Fri, 15 Jan 2010 18:35:19 +0530, Kunal Gangakhedkar wrote:
On my laptop (HP dv6-1110ax), there are no OEM strings in SMBIOS of type "HP_Mute_LED*". Hence, the GPIO for the mute button LED doesn't get set properly. I didn't find the strings in my cousin's laptop (HP dv9500t CTO) either.
As per the documentation of find_mute_led_gpio(), these strings occur in HP B-series systems - so, before scanning the SMBIOS strings, we need to check if we're dealing with a B-series system. Need to get confirmation from HP if this logic takes care of all the systems. I'm trying to poke a friend there.
Please let me know if this looks OK or needs changes.
Well, the open switch() for blike-system should be replaced with set_hp_led_gpio(). That's the very purpose I proposed to create a function.
I don't think you can do that since both cases (b-like and non-b-like) have different ways of setting the gpio.
Argh, sorry, my mistake - understood what you mean here after taking another look at the code. My bad that I replied even before verifying it :(
Making the changes right away.
Thanks, Kunal
At Fri, 15 Jan 2010 19:02:17 +0530, Kunal Gangakhedkar wrote:
Thinking the logic again, however, it might be safer to check DMI entries no matter which model is. Then set statically if it's DV series (i.e. !hp_blike_system()) as fallback. I suppose HP will implement the DMI entry for their new BIOS on other models in future, too, so the chance is high that the right setup is detected through DMI check instead of blindly fixed setup.
They're notorious to discontinue models really fast. For example, my laptop model is already discontinued in less than 6 months. So, I don't think I'll be getting updates for my BIOS at all. What do you propose for such cases?
Sure, we'd need to do some static fixes. But checking DMI first is more or less "safer".
I agree with your approach that we should be checking for DMI string unconditionally and use the fixed setup as fallback - I can send the patch with those fixes too.
That'll be great.
thanks,
Takashi
On my laptop (HP dv6-1110ax), there are no OEM strings in SMBIOS of type "HP_Mute_LED*". Hence, the GPIO for the mute button LED doesn't get set properly. I didn't find the strings in my cousin's laptop (HP dv9500t CTO) either.
As per the documentation of find_mute_led_gpio(), these strings occur in HP B-series systems - so, before scanning the SMBIOS strings, we need to check if we're dealing with a B-series system. Need to get confirmation from HP if this logic takes care of all the systems. I'm trying to poke a friend there.
Please let me know if this looks OK or needs change.
Signed-off-by: Kunal Gangakhedkar kunal.gangakhedkar@gmail.com --- sound/pci/hda/patch_sigmatel.c | 61 +++++++++++++++++++++++++++++---------- 1 files changed, 45 insertions(+), 16 deletions(-)
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 117919a..7d3e66a 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -4737,6 +4737,26 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res) } }
+static int hp_blike_system(u32 subsystem_id); + +static void set_hp_led_gpio(struct hda_codec *codec) +{ + struct sigmatel_spec *spec = codec->spec; + switch (codec->vendor_id) { + case 0x111d7608: + /* GPIO 0 */ + spec->gpio_led = 0x01; + break; + case 0x111d7600: + case 0x111d7601: + case 0x111d7602: + case 0x111d7603: + /* GPIO 3 */ + spec->gpio_led = 0x08; + break; + } +} + /* * This method searches for the mute LED GPIO configuration * provided as OEM string in SMBIOS. The format of that string @@ -4748,6 +4768,14 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res) * * So, HP B-series like systems may have HP_Mute_LED_0 (current models) * or HP_Mute_LED_0_3 (future models) OEM SMBIOS strings + * + * + * The dv-series laptops don't seem to have the HP_Mute_LED* strings in + * SMBIOS - at least the ones I have seen do not have them - which include + * my own system (HP Pavilion dv6-1110ax) and my cousin's + * HP Pavilion dv9500t CTO. + * Need more information on whether it is true across the entire series. + * -- kunal */ static int find_mute_led_gpio(struct hda_codec *codec) { @@ -4758,28 +4786,27 @@ static int find_mute_led_gpio(struct hda_codec *codec) while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) { if (sscanf(dev->name, "HP_Mute_LED_%d_%d", - &spec->gpio_led_polarity, - &spec->gpio_led) == 2) { + &spec->gpio_led_polarity, + &spec->gpio_led) == 2) { spec->gpio_led = 1 << spec->gpio_led; return 1; } if (sscanf(dev->name, "HP_Mute_LED_%d", - &spec->gpio_led_polarity) == 1) { - switch (codec->vendor_id) { - case 0x111d7608: - /* GPIO 0 */ - spec->gpio_led = 0x01; - return 1; - case 0x111d7600: - case 0x111d7601: - case 0x111d7602: - case 0x111d7603: - /* GPIO 3 */ - spec->gpio_led = 0x08; - return 1; - } + &spec->gpio_led_polarity) == 1) { + set_hp_led_gpio(codec); + return 1; } } + + /* + * Fallback case - if we don't find the DMI strings, + * we statically set the GPIO - if not a B-series system. + */ + if (!hp_blike_system(codec->subsystem_id)) { + set_hp_led_gpio(codec); + spec->gpio_led_polarity = 1; + return 1; + } } return 0; } @@ -5603,6 +5630,8 @@ again: spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids); spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e);
+ snd_printd("Found board config: %d\n", spec->board_config); + switch (spec->board_config) { case STAC_HP_M4: /* enable internal microphone */
At Fri, 15 Jan 2010 21:01:47 +0530, Kunal Gangakhedkar wrote:
On my laptop (HP dv6-1110ax), there are no OEM strings in SMBIOS of type "HP_Mute_LED*". Hence, the GPIO for the mute button LED doesn't get set properly. I didn't find the strings in my cousin's laptop (HP dv9500t CTO) either.
As per the documentation of find_mute_led_gpio(), these strings occur in HP B-series systems - so, before scanning the SMBIOS strings, we need to check if we're dealing with a B-series system. Need to get confirmation from HP if this logic takes care of all the systems. I'm trying to poke a friend there.
Please let me know if this looks OK or needs change.
Signed-off-by: Kunal Gangakhedkar kunal.gangakhedkar@gmail.com
Thanks, applied now (with a minor change from snd_printd() to snd_printdd() -- since snd_printd() is enabled in many cases).
Takashi
sound/pci/hda/patch_sigmatel.c | 61 +++++++++++++++++++++++++++++---------- 1 files changed, 45 insertions(+), 16 deletions(-)
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 117919a..7d3e66a 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -4737,6 +4737,26 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res) } }
+static int hp_blike_system(u32 subsystem_id);
+static void set_hp_led_gpio(struct hda_codec *codec) +{
- struct sigmatel_spec *spec = codec->spec;
- switch (codec->vendor_id) {
- case 0x111d7608:
/* GPIO 0 */
spec->gpio_led = 0x01;
break;
- case 0x111d7600:
- case 0x111d7601:
- case 0x111d7602:
- case 0x111d7603:
/* GPIO 3 */
spec->gpio_led = 0x08;
break;
- }
+}
/*
- This method searches for the mute LED GPIO configuration
- provided as OEM string in SMBIOS. The format of that string
@@ -4748,6 +4768,14 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res)
- So, HP B-series like systems may have HP_Mute_LED_0 (current models)
- or HP_Mute_LED_0_3 (future models) OEM SMBIOS strings
- The dv-series laptops don't seem to have the HP_Mute_LED* strings in
- SMBIOS - at least the ones I have seen do not have them - which include
- my own system (HP Pavilion dv6-1110ax) and my cousin's
- HP Pavilion dv9500t CTO.
- Need more information on whether it is true across the entire series.
*/
- -- kunal
static int find_mute_led_gpio(struct hda_codec *codec) { @@ -4758,28 +4786,27 @@ static int find_mute_led_gpio(struct hda_codec *codec) while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) { if (sscanf(dev->name, "HP_Mute_LED_%d_%d",
&spec->gpio_led_polarity,
&spec->gpio_led) == 2) {
&spec->gpio_led_polarity,
&spec->gpio_led) == 2) { spec->gpio_led = 1 << spec->gpio_led; return 1; } if (sscanf(dev->name, "HP_Mute_LED_%d",
&spec->gpio_led_polarity) == 1) {
switch (codec->vendor_id) {
case 0x111d7608:
/* GPIO 0 */
spec->gpio_led = 0x01;
return 1;
case 0x111d7600:
case 0x111d7601:
case 0x111d7602:
case 0x111d7603:
/* GPIO 3 */
spec->gpio_led = 0x08;
return 1;
}
&spec->gpio_led_polarity) == 1) {
set_hp_led_gpio(codec);
}return 1; }
/*
* Fallback case - if we don't find the DMI strings,
* we statically set the GPIO - if not a B-series system.
*/
if (!hp_blike_system(codec->subsystem_id)) {
set_hp_led_gpio(codec);
spec->gpio_led_polarity = 1;
return 1;
} return 0;}
} @@ -5603,6 +5630,8 @@ again: spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids); spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e);
- snd_printd("Found board config: %d\n", spec->board_config);
- switch (spec->board_config) { case STAC_HP_M4: /* enable internal microphone */
-- 1.6.6.60.gc2ff1
participants (2)
-
Kunal Gangakhedkar
-
Takashi Iwai