aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_sigmatel.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r--sound/pci/hda/patch_sigmatel.c61
1 files changed, 45 insertions, 16 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 2291a8396817..799ba2570902 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -4730,6 +4730,26 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res)
4730 } 4730 }
4731} 4731}
4732 4732
4733static int hp_blike_system(u32 subsystem_id);
4734
4735static void set_hp_led_gpio(struct hda_codec *codec)
4736{
4737 struct sigmatel_spec *spec = codec->spec;
4738 switch (codec->vendor_id) {
4739 case 0x111d7608:
4740 /* GPIO 0 */
4741 spec->gpio_led = 0x01;
4742 break;
4743 case 0x111d7600:
4744 case 0x111d7601:
4745 case 0x111d7602:
4746 case 0x111d7603:
4747 /* GPIO 3 */
4748 spec->gpio_led = 0x08;
4749 break;
4750 }
4751}
4752
4733/* 4753/*
4734 * This method searches for the mute LED GPIO configuration 4754 * This method searches for the mute LED GPIO configuration
4735 * provided as OEM string in SMBIOS. The format of that string 4755 * provided as OEM string in SMBIOS. The format of that string
@@ -4741,6 +4761,14 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res)
4741 * 4761 *
4742 * So, HP B-series like systems may have HP_Mute_LED_0 (current models) 4762 * So, HP B-series like systems may have HP_Mute_LED_0 (current models)
4743 * or HP_Mute_LED_0_3 (future models) OEM SMBIOS strings 4763 * or HP_Mute_LED_0_3 (future models) OEM SMBIOS strings
4764 *
4765 *
4766 * The dv-series laptops don't seem to have the HP_Mute_LED* strings in
4767 * SMBIOS - at least the ones I have seen do not have them - which include
4768 * my own system (HP Pavilion dv6-1110ax) and my cousin's
4769 * HP Pavilion dv9500t CTO.
4770 * Need more information on whether it is true across the entire series.
4771 * -- kunal
4744 */ 4772 */
4745static int find_mute_led_gpio(struct hda_codec *codec) 4773static int find_mute_led_gpio(struct hda_codec *codec)
4746{ 4774{
@@ -4751,28 +4779,27 @@ static int find_mute_led_gpio(struct hda_codec *codec)
4751 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, 4779 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING,
4752 NULL, dev))) { 4780 NULL, dev))) {
4753 if (sscanf(dev->name, "HP_Mute_LED_%d_%d", 4781 if (sscanf(dev->name, "HP_Mute_LED_%d_%d",
4754 &spec->gpio_led_polarity, 4782 &spec->gpio_led_polarity,
4755 &spec->gpio_led) == 2) { 4783 &spec->gpio_led) == 2) {
4756 spec->gpio_led = 1 << spec->gpio_led; 4784 spec->gpio_led = 1 << spec->gpio_led;
4757 return 1; 4785 return 1;
4758 } 4786 }
4759 if (sscanf(dev->name, "HP_Mute_LED_%d", 4787 if (sscanf(dev->name, "HP_Mute_LED_%d",
4760 &spec->gpio_led_polarity) == 1) { 4788 &spec->gpio_led_polarity) == 1) {
4761 switch (codec->vendor_id) { 4789 set_hp_led_gpio(codec);
4762 case 0x111d7608: 4790 return 1;
4763 /* GPIO 0 */
4764 spec->gpio_led = 0x01;
4765 return 1;
4766 case 0x111d7600:
4767 case 0x111d7601:
4768 case 0x111d7602:
4769 case 0x111d7603:
4770 /* GPIO 3 */
4771 spec->gpio_led = 0x08;
4772 return 1;
4773 }
4774 } 4791 }
4775 } 4792 }
4793
4794 /*
4795 * Fallback case - if we don't find the DMI strings,
4796 * we statically set the GPIO - if not a B-series system.
4797 */
4798 if (!hp_blike_system(codec->subsystem_id)) {
4799 set_hp_led_gpio(codec);
4800 spec->gpio_led_polarity = 1;
4801 return 1;
4802 }
4776 } 4803 }
4777 return 0; 4804 return 0;
4778} 4805}
@@ -5548,6 +5575,8 @@ again:
5548 spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids); 5575 spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids);
5549 spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e); 5576 spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e);
5550 5577
5578 snd_printdd("Found board config: %d\n", spec->board_config);
5579
5551 switch (spec->board_config) { 5580 switch (spec->board_config) {
5552 case STAC_HP_M4: 5581 case STAC_HP_M4:
5553 /* enable internal microphone */ 5582 /* enable internal microphone */