diff options
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r-- | 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 117919aa17f4..dbffb5b5c69d 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) | |||
4737 | } | 4737 | } |
4738 | } | 4738 | } |
4739 | 4739 | ||
4740 | static int hp_blike_system(u32 subsystem_id); | ||
4741 | |||
4742 | static void set_hp_led_gpio(struct hda_codec *codec) | ||
4743 | { | ||
4744 | struct sigmatel_spec *spec = codec->spec; | ||
4745 | switch (codec->vendor_id) { | ||
4746 | case 0x111d7608: | ||
4747 | /* GPIO 0 */ | ||
4748 | spec->gpio_led = 0x01; | ||
4749 | break; | ||
4750 | case 0x111d7600: | ||
4751 | case 0x111d7601: | ||
4752 | case 0x111d7602: | ||
4753 | case 0x111d7603: | ||
4754 | /* GPIO 3 */ | ||
4755 | spec->gpio_led = 0x08; | ||
4756 | break; | ||
4757 | } | ||
4758 | } | ||
4759 | |||
4740 | /* | 4760 | /* |
4741 | * This method searches for the mute LED GPIO configuration | 4761 | * This method searches for the mute LED GPIO configuration |
4742 | * provided as OEM string in SMBIOS. The format of that string | 4762 | * 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) | |||
4748 | * | 4768 | * |
4749 | * So, HP B-series like systems may have HP_Mute_LED_0 (current models) | 4769 | * So, HP B-series like systems may have HP_Mute_LED_0 (current models) |
4750 | * or HP_Mute_LED_0_3 (future models) OEM SMBIOS strings | 4770 | * or HP_Mute_LED_0_3 (future models) OEM SMBIOS strings |
4771 | * | ||
4772 | * | ||
4773 | * The dv-series laptops don't seem to have the HP_Mute_LED* strings in | ||
4774 | * SMBIOS - at least the ones I have seen do not have them - which include | ||
4775 | * my own system (HP Pavilion dv6-1110ax) and my cousin's | ||
4776 | * HP Pavilion dv9500t CTO. | ||
4777 | * Need more information on whether it is true across the entire series. | ||
4778 | * -- kunal | ||
4751 | */ | 4779 | */ |
4752 | static int find_mute_led_gpio(struct hda_codec *codec) | 4780 | static int find_mute_led_gpio(struct hda_codec *codec) |
4753 | { | 4781 | { |
@@ -4758,28 +4786,27 @@ static int find_mute_led_gpio(struct hda_codec *codec) | |||
4758 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, | 4786 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, |
4759 | NULL, dev))) { | 4787 | NULL, dev))) { |
4760 | if (sscanf(dev->name, "HP_Mute_LED_%d_%d", | 4788 | if (sscanf(dev->name, "HP_Mute_LED_%d_%d", |
4761 | &spec->gpio_led_polarity, | 4789 | &spec->gpio_led_polarity, |
4762 | &spec->gpio_led) == 2) { | 4790 | &spec->gpio_led) == 2) { |
4763 | spec->gpio_led = 1 << spec->gpio_led; | 4791 | spec->gpio_led = 1 << spec->gpio_led; |
4764 | return 1; | 4792 | return 1; |
4765 | } | 4793 | } |
4766 | if (sscanf(dev->name, "HP_Mute_LED_%d", | 4794 | if (sscanf(dev->name, "HP_Mute_LED_%d", |
4767 | &spec->gpio_led_polarity) == 1) { | 4795 | &spec->gpio_led_polarity) == 1) { |
4768 | switch (codec->vendor_id) { | 4796 | set_hp_led_gpio(codec); |
4769 | case 0x111d7608: | 4797 | return 1; |
4770 | /* GPIO 0 */ | ||
4771 | spec->gpio_led = 0x01; | ||
4772 | return 1; | ||
4773 | case 0x111d7600: | ||
4774 | case 0x111d7601: | ||
4775 | case 0x111d7602: | ||
4776 | case 0x111d7603: | ||
4777 | /* GPIO 3 */ | ||
4778 | spec->gpio_led = 0x08; | ||
4779 | return 1; | ||
4780 | } | ||
4781 | } | 4798 | } |
4782 | } | 4799 | } |
4800 | |||
4801 | /* | ||
4802 | * Fallback case - if we don't find the DMI strings, | ||
4803 | * we statically set the GPIO - if not a B-series system. | ||
4804 | */ | ||
4805 | if (!hp_blike_system(codec->subsystem_id)) { | ||
4806 | set_hp_led_gpio(codec); | ||
4807 | spec->gpio_led_polarity = 1; | ||
4808 | return 1; | ||
4809 | } | ||
4783 | } | 4810 | } |
4784 | return 0; | 4811 | return 0; |
4785 | } | 4812 | } |
@@ -5603,6 +5630,8 @@ again: | |||
5603 | spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids); | 5630 | spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids); |
5604 | spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e); | 5631 | spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e); |
5605 | 5632 | ||
5633 | snd_printdd("Found board config: %d\n", spec->board_config); | ||
5634 | |||
5606 | switch (spec->board_config) { | 5635 | switch (spec->board_config) { |
5607 | case STAC_HP_M4: | 5636 | case STAC_HP_M4: |
5608 | /* enable internal microphone */ | 5637 | /* enable internal microphone */ |