aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_sigmatel.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-01-19 09:53:43 -0500
committerTakashi Iwai <tiwai@suse.de>2010-01-19 09:53:43 -0500
commit9e4c84967ef027fe50a03cf48dd6da9519c8e60c (patch)
tree21d6b8168670f22521f3bb703e3b9d1932566c1c /sound/pci/hda/patch_sigmatel.c
parentd2f2fcd2541bae004db7f4798ffd9d2cb75ae817 (diff)
parent3fb4a508b8e7957aa899f32cd6d9d462e102c7ca (diff)
Merge branch 'fix/hda' into topic/hda
Conflicts: sound/pci/hda/patch_realtek.c
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r--sound/pci/hda/patch_sigmatel.c79
1 files changed, 55 insertions, 24 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index e28c810bc00c..dbffb5b5c69d 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -4460,14 +4460,7 @@ static inline int get_pin_presence(struct hda_codec *codec, hda_nid_t nid)
4460{ 4460{
4461 if (!nid) 4461 if (!nid)
4462 return 0; 4462 return 0;
4463 /* NOTE: we can't use snd_hda_jack_detect() here because STAC/IDT 4463 return snd_hda_jack_detect(codec, nid);
4464 * codecs behave wrongly when SET_PIN_SENSE is triggered, although
4465 * the pincap gives TRIG_REQ bit.
4466 */
4467 if (snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_SENSE, 0) &
4468 AC_PINSENSE_PRESENCE)
4469 return 1;
4470 return 0;
4471} 4464}
4472 4465
4473static void stac92xx_line_out_detect(struct hda_codec *codec, 4466static void stac92xx_line_out_detect(struct hda_codec *codec,
@@ -4744,6 +4737,26 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res)
4744 } 4737 }
4745} 4738}
4746 4739
4740static int hp_blike_system(u32 subsystem_id);
4741
4742static 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
4747/* 4760/*
4748 * This method searches for the mute LED GPIO configuration 4761 * This method searches for the mute LED GPIO configuration
4749 * provided as OEM string in SMBIOS. The format of that string 4762 * provided as OEM string in SMBIOS. The format of that string
@@ -4755,6 +4768,14 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res)
4755 * 4768 *
4756 * 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)
4757 * 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
4758 */ 4779 */
4759static int find_mute_led_gpio(struct hda_codec *codec) 4780static int find_mute_led_gpio(struct hda_codec *codec)
4760{ 4781{
@@ -4765,28 +4786,27 @@ static int find_mute_led_gpio(struct hda_codec *codec)
4765 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, 4786 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING,
4766 NULL, dev))) { 4787 NULL, dev))) {
4767 if (sscanf(dev->name, "HP_Mute_LED_%d_%d", 4788 if (sscanf(dev->name, "HP_Mute_LED_%d_%d",
4768 &spec->gpio_led_polarity, 4789 &spec->gpio_led_polarity,
4769 &spec->gpio_led) == 2) { 4790 &spec->gpio_led) == 2) {
4770 spec->gpio_led = 1 << spec->gpio_led; 4791 spec->gpio_led = 1 << spec->gpio_led;
4771 return 1; 4792 return 1;
4772 } 4793 }
4773 if (sscanf(dev->name, "HP_Mute_LED_%d", 4794 if (sscanf(dev->name, "HP_Mute_LED_%d",
4774 &spec->gpio_led_polarity) == 1) { 4795 &spec->gpio_led_polarity) == 1) {
4775 switch (codec->vendor_id) { 4796 set_hp_led_gpio(codec);
4776 case 0x111d7608: 4797 return 1;
4777 /* GPIO 0 */
4778 spec->gpio_led = 0x01;
4779 return 1;
4780 case 0x111d7600:
4781 case 0x111d7601:
4782 case 0x111d7602:
4783 case 0x111d7603:
4784 /* GPIO 3 */
4785 spec->gpio_led = 0x08;
4786 return 1;
4787 }
4788 } 4798 }
4789 } 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 }
4790 } 4810 }
4791 return 0; 4811 return 0;
4792} 4812}
@@ -4969,6 +4989,7 @@ static int patch_stac9200(struct hda_codec *codec)
4969 if (spec == NULL) 4989 if (spec == NULL)
4970 return -ENOMEM; 4990 return -ENOMEM;
4971 4991
4992 codec->no_trigger_sense = 1;
4972 codec->spec = spec; 4993 codec->spec = spec;
4973 spec->num_pins = ARRAY_SIZE(stac9200_pin_nids); 4994 spec->num_pins = ARRAY_SIZE(stac9200_pin_nids);
4974 spec->pin_nids = stac9200_pin_nids; 4995 spec->pin_nids = stac9200_pin_nids;
@@ -5031,6 +5052,7 @@ static int patch_stac925x(struct hda_codec *codec)
5031 if (spec == NULL) 5052 if (spec == NULL)
5032 return -ENOMEM; 5053 return -ENOMEM;
5033 5054
5055 codec->no_trigger_sense = 1;
5034 codec->spec = spec; 5056 codec->spec = spec;
5035 spec->num_pins = ARRAY_SIZE(stac925x_pin_nids); 5057 spec->num_pins = ARRAY_SIZE(stac925x_pin_nids);
5036 spec->pin_nids = stac925x_pin_nids; 5058 spec->pin_nids = stac925x_pin_nids;
@@ -5115,6 +5137,7 @@ static int patch_stac92hd73xx(struct hda_codec *codec)
5115 if (spec == NULL) 5137 if (spec == NULL)
5116 return -ENOMEM; 5138 return -ENOMEM;
5117 5139
5140 codec->no_trigger_sense = 1;
5118 codec->spec = spec; 5141 codec->spec = spec;
5119 codec->slave_dig_outs = stac92hd73xx_slave_dig_outs; 5142 codec->slave_dig_outs = stac92hd73xx_slave_dig_outs;
5120 spec->num_pins = ARRAY_SIZE(stac92hd73xx_pin_nids); 5143 spec->num_pins = ARRAY_SIZE(stac92hd73xx_pin_nids);
@@ -5262,6 +5285,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
5262 if (spec == NULL) 5285 if (spec == NULL)
5263 return -ENOMEM; 5286 return -ENOMEM;
5264 5287
5288 codec->no_trigger_sense = 1;
5265 codec->spec = spec; 5289 codec->spec = spec;
5266 codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs; 5290 codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs;
5267 spec->digbeep_nid = 0x21; 5291 spec->digbeep_nid = 0x21;
@@ -5473,6 +5497,7 @@ static int patch_stac92hd71bxx(struct hda_codec *codec)
5473 if (spec == NULL) 5497 if (spec == NULL)
5474 return -ENOMEM; 5498 return -ENOMEM;
5475 5499
5500 codec->no_trigger_sense = 1;
5476 codec->spec = spec; 5501 codec->spec = spec;
5477 codec->patch_ops = stac92xx_patch_ops; 5502 codec->patch_ops = stac92xx_patch_ops;
5478 spec->num_pins = STAC92HD71BXX_NUM_PINS; 5503 spec->num_pins = STAC92HD71BXX_NUM_PINS;
@@ -5605,6 +5630,8 @@ again:
5605 spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids); 5630 spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids);
5606 spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e); 5631 spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e);
5607 5632
5633 snd_printdd("Found board config: %d\n", spec->board_config);
5634
5608 switch (spec->board_config) { 5635 switch (spec->board_config) {
5609 case STAC_HP_M4: 5636 case STAC_HP_M4:
5610 /* enable internal microphone */ 5637 /* enable internal microphone */
@@ -5725,6 +5752,7 @@ static int patch_stac922x(struct hda_codec *codec)
5725 if (spec == NULL) 5752 if (spec == NULL)
5726 return -ENOMEM; 5753 return -ENOMEM;
5727 5754
5755 codec->no_trigger_sense = 1;
5728 codec->spec = spec; 5756 codec->spec = spec;
5729 spec->num_pins = ARRAY_SIZE(stac922x_pin_nids); 5757 spec->num_pins = ARRAY_SIZE(stac922x_pin_nids);
5730 spec->pin_nids = stac922x_pin_nids; 5758 spec->pin_nids = stac922x_pin_nids;
@@ -5828,6 +5856,7 @@ static int patch_stac927x(struct hda_codec *codec)
5828 if (spec == NULL) 5856 if (spec == NULL)
5829 return -ENOMEM; 5857 return -ENOMEM;
5830 5858
5859 codec->no_trigger_sense = 1;
5831 codec->spec = spec; 5860 codec->spec = spec;
5832 codec->slave_dig_outs = stac927x_slave_dig_outs; 5861 codec->slave_dig_outs = stac927x_slave_dig_outs;
5833 spec->num_pins = ARRAY_SIZE(stac927x_pin_nids); 5862 spec->num_pins = ARRAY_SIZE(stac927x_pin_nids);
@@ -5962,6 +5991,7 @@ static int patch_stac9205(struct hda_codec *codec)
5962 if (spec == NULL) 5991 if (spec == NULL)
5963 return -ENOMEM; 5992 return -ENOMEM;
5964 5993
5994 codec->no_trigger_sense = 1;
5965 codec->spec = spec; 5995 codec->spec = spec;
5966 spec->num_pins = ARRAY_SIZE(stac9205_pin_nids); 5996 spec->num_pins = ARRAY_SIZE(stac9205_pin_nids);
5967 spec->pin_nids = stac9205_pin_nids; 5997 spec->pin_nids = stac9205_pin_nids;
@@ -6117,6 +6147,7 @@ static int patch_stac9872(struct hda_codec *codec)
6117 spec = kzalloc(sizeof(*spec), GFP_KERNEL); 6147 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
6118 if (spec == NULL) 6148 if (spec == NULL)
6119 return -ENOMEM; 6149 return -ENOMEM;
6150 codec->no_trigger_sense = 1;
6120 codec->spec = spec; 6151 codec->spec = spec;
6121 spec->num_pins = ARRAY_SIZE(stac9872_pin_nids); 6152 spec->num_pins = ARRAY_SIZE(stac9872_pin_nids);
6122 spec->pin_nids = stac9872_pin_nids; 6153 spec->pin_nids = stac9872_pin_nids;