diff options
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 79 |
1 files changed, 55 insertions, 24 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index eeda7beeb57..799ba257090 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -4453,14 +4453,7 @@ static inline int get_pin_presence(struct hda_codec *codec, hda_nid_t nid) | |||
4453 | { | 4453 | { |
4454 | if (!nid) | 4454 | if (!nid) |
4455 | return 0; | 4455 | return 0; |
4456 | /* NOTE: we can't use snd_hda_jack_detect() here because STAC/IDT | 4456 | return snd_hda_jack_detect(codec, nid); |
4457 | * codecs behave wrongly when SET_PIN_SENSE is triggered, although | ||
4458 | * the pincap gives TRIG_REQ bit. | ||
4459 | */ | ||
4460 | if (snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_SENSE, 0) & | ||
4461 | AC_PINSENSE_PRESENCE) | ||
4462 | return 1; | ||
4463 | return 0; | ||
4464 | } | 4457 | } |
4465 | 4458 | ||
4466 | static void stac92xx_line_out_detect(struct hda_codec *codec, | 4459 | static void stac92xx_line_out_detect(struct hda_codec *codec, |
@@ -4737,6 +4730,26 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res) | |||
4737 | } | 4730 | } |
4738 | } | 4731 | } |
4739 | 4732 | ||
4733 | static int hp_blike_system(u32 subsystem_id); | ||
4734 | |||
4735 | static 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 | |||
4740 | /* | 4753 | /* |
4741 | * This method searches for the mute LED GPIO configuration | 4754 | * This method searches for the mute LED GPIO configuration |
4742 | * provided as OEM string in SMBIOS. The format of that string | 4755 | * provided as OEM string in SMBIOS. The format of that string |
@@ -4748,6 +4761,14 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res) | |||
4748 | * | 4761 | * |
4749 | * 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) |
4750 | * 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 | ||
4751 | */ | 4772 | */ |
4752 | static int find_mute_led_gpio(struct hda_codec *codec) | 4773 | static int find_mute_led_gpio(struct hda_codec *codec) |
4753 | { | 4774 | { |
@@ -4758,28 +4779,27 @@ static int find_mute_led_gpio(struct hda_codec *codec) | |||
4758 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, | 4779 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, |
4759 | NULL, dev))) { | 4780 | NULL, dev))) { |
4760 | if (sscanf(dev->name, "HP_Mute_LED_%d_%d", | 4781 | if (sscanf(dev->name, "HP_Mute_LED_%d_%d", |
4761 | &spec->gpio_led_polarity, | 4782 | &spec->gpio_led_polarity, |
4762 | &spec->gpio_led) == 2) { | 4783 | &spec->gpio_led) == 2) { |
4763 | spec->gpio_led = 1 << spec->gpio_led; | 4784 | spec->gpio_led = 1 << spec->gpio_led; |
4764 | return 1; | 4785 | return 1; |
4765 | } | 4786 | } |
4766 | if (sscanf(dev->name, "HP_Mute_LED_%d", | 4787 | if (sscanf(dev->name, "HP_Mute_LED_%d", |
4767 | &spec->gpio_led_polarity) == 1) { | 4788 | &spec->gpio_led_polarity) == 1) { |
4768 | switch (codec->vendor_id) { | 4789 | set_hp_led_gpio(codec); |
4769 | case 0x111d7608: | 4790 | 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 | } | 4791 | } |
4782 | } | 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 | } | ||
4783 | } | 4803 | } |
4784 | return 0; | 4804 | return 0; |
4785 | } | 4805 | } |
@@ -4962,6 +4982,7 @@ static int patch_stac9200(struct hda_codec *codec) | |||
4962 | if (spec == NULL) | 4982 | if (spec == NULL) |
4963 | return -ENOMEM; | 4983 | return -ENOMEM; |
4964 | 4984 | ||
4985 | codec->no_trigger_sense = 1; | ||
4965 | codec->spec = spec; | 4986 | codec->spec = spec; |
4966 | spec->num_pins = ARRAY_SIZE(stac9200_pin_nids); | 4987 | spec->num_pins = ARRAY_SIZE(stac9200_pin_nids); |
4967 | spec->pin_nids = stac9200_pin_nids; | 4988 | spec->pin_nids = stac9200_pin_nids; |
@@ -5024,6 +5045,7 @@ static int patch_stac925x(struct hda_codec *codec) | |||
5024 | if (spec == NULL) | 5045 | if (spec == NULL) |
5025 | return -ENOMEM; | 5046 | return -ENOMEM; |
5026 | 5047 | ||
5048 | codec->no_trigger_sense = 1; | ||
5027 | codec->spec = spec; | 5049 | codec->spec = spec; |
5028 | spec->num_pins = ARRAY_SIZE(stac925x_pin_nids); | 5050 | spec->num_pins = ARRAY_SIZE(stac925x_pin_nids); |
5029 | spec->pin_nids = stac925x_pin_nids; | 5051 | spec->pin_nids = stac925x_pin_nids; |
@@ -5108,6 +5130,7 @@ static int patch_stac92hd73xx(struct hda_codec *codec) | |||
5108 | if (spec == NULL) | 5130 | if (spec == NULL) |
5109 | return -ENOMEM; | 5131 | return -ENOMEM; |
5110 | 5132 | ||
5133 | codec->no_trigger_sense = 1; | ||
5111 | codec->spec = spec; | 5134 | codec->spec = spec; |
5112 | codec->slave_dig_outs = stac92hd73xx_slave_dig_outs; | 5135 | codec->slave_dig_outs = stac92hd73xx_slave_dig_outs; |
5113 | spec->num_pins = ARRAY_SIZE(stac92hd73xx_pin_nids); | 5136 | spec->num_pins = ARRAY_SIZE(stac92hd73xx_pin_nids); |
@@ -5255,6 +5278,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec) | |||
5255 | if (spec == NULL) | 5278 | if (spec == NULL) |
5256 | return -ENOMEM; | 5279 | return -ENOMEM; |
5257 | 5280 | ||
5281 | codec->no_trigger_sense = 1; | ||
5258 | codec->spec = spec; | 5282 | codec->spec = spec; |
5259 | codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs; | 5283 | codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs; |
5260 | spec->digbeep_nid = 0x21; | 5284 | spec->digbeep_nid = 0x21; |
@@ -5418,6 +5442,7 @@ static int patch_stac92hd71bxx(struct hda_codec *codec) | |||
5418 | if (spec == NULL) | 5442 | if (spec == NULL) |
5419 | return -ENOMEM; | 5443 | return -ENOMEM; |
5420 | 5444 | ||
5445 | codec->no_trigger_sense = 1; | ||
5421 | codec->spec = spec; | 5446 | codec->spec = spec; |
5422 | codec->patch_ops = stac92xx_patch_ops; | 5447 | codec->patch_ops = stac92xx_patch_ops; |
5423 | spec->num_pins = STAC92HD71BXX_NUM_PINS; | 5448 | spec->num_pins = STAC92HD71BXX_NUM_PINS; |
@@ -5550,6 +5575,8 @@ again: | |||
5550 | spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids); | 5575 | spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids); |
5551 | spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e); | 5576 | spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e); |
5552 | 5577 | ||
5578 | snd_printdd("Found board config: %d\n", spec->board_config); | ||
5579 | |||
5553 | switch (spec->board_config) { | 5580 | switch (spec->board_config) { |
5554 | case STAC_HP_M4: | 5581 | case STAC_HP_M4: |
5555 | /* enable internal microphone */ | 5582 | /* enable internal microphone */ |
@@ -5661,6 +5688,7 @@ static int patch_stac922x(struct hda_codec *codec) | |||
5661 | if (spec == NULL) | 5688 | if (spec == NULL) |
5662 | return -ENOMEM; | 5689 | return -ENOMEM; |
5663 | 5690 | ||
5691 | codec->no_trigger_sense = 1; | ||
5664 | codec->spec = spec; | 5692 | codec->spec = spec; |
5665 | spec->num_pins = ARRAY_SIZE(stac922x_pin_nids); | 5693 | spec->num_pins = ARRAY_SIZE(stac922x_pin_nids); |
5666 | spec->pin_nids = stac922x_pin_nids; | 5694 | spec->pin_nids = stac922x_pin_nids; |
@@ -5764,6 +5792,7 @@ static int patch_stac927x(struct hda_codec *codec) | |||
5764 | if (spec == NULL) | 5792 | if (spec == NULL) |
5765 | return -ENOMEM; | 5793 | return -ENOMEM; |
5766 | 5794 | ||
5795 | codec->no_trigger_sense = 1; | ||
5767 | codec->spec = spec; | 5796 | codec->spec = spec; |
5768 | codec->slave_dig_outs = stac927x_slave_dig_outs; | 5797 | codec->slave_dig_outs = stac927x_slave_dig_outs; |
5769 | spec->num_pins = ARRAY_SIZE(stac927x_pin_nids); | 5798 | spec->num_pins = ARRAY_SIZE(stac927x_pin_nids); |
@@ -5898,6 +5927,7 @@ static int patch_stac9205(struct hda_codec *codec) | |||
5898 | if (spec == NULL) | 5927 | if (spec == NULL) |
5899 | return -ENOMEM; | 5928 | return -ENOMEM; |
5900 | 5929 | ||
5930 | codec->no_trigger_sense = 1; | ||
5901 | codec->spec = spec; | 5931 | codec->spec = spec; |
5902 | spec->num_pins = ARRAY_SIZE(stac9205_pin_nids); | 5932 | spec->num_pins = ARRAY_SIZE(stac9205_pin_nids); |
5903 | spec->pin_nids = stac9205_pin_nids; | 5933 | spec->pin_nids = stac9205_pin_nids; |
@@ -6053,6 +6083,7 @@ static int patch_stac9872(struct hda_codec *codec) | |||
6053 | spec = kzalloc(sizeof(*spec), GFP_KERNEL); | 6083 | spec = kzalloc(sizeof(*spec), GFP_KERNEL); |
6054 | if (spec == NULL) | 6084 | if (spec == NULL) |
6055 | return -ENOMEM; | 6085 | return -ENOMEM; |
6086 | codec->no_trigger_sense = 1; | ||
6056 | codec->spec = spec; | 6087 | codec->spec = spec; |
6057 | spec->num_pins = ARRAY_SIZE(stac9872_pin_nids); | 6088 | spec->num_pins = ARRAY_SIZE(stac9872_pin_nids); |
6058 | spec->pin_nids = stac9872_pin_nids; | 6089 | spec->pin_nids = stac9872_pin_nids; |