diff options
author | Jaroslav Kysela <perex@perex.cz> | 2010-02-16 05:19:18 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2010-02-16 05:19:18 -0500 |
commit | ba9341dfef6b0201cd30e3904dcd0a47d3dc35e0 (patch) | |
tree | d83637979db83bb9d5a23e190148b90b60c976d2 /sound/pci/hda | |
parent | d39e82db73eb876c60d00f00219d767b3be30307 (diff) | |
parent | f167e1d073278fe231bbdd5d6c24fb9d091aa544 (diff) |
Merge branch 'fixes' into devel
Diffstat (limited to 'sound/pci/hda')
-rw-r--r-- | sound/pci/hda/hda_beep.c | 16 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.c | 10 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.h | 1 | ||||
-rw-r--r-- | sound/pci/hda/patch_analog.c | 16 | ||||
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 18 |
5 files changed, 43 insertions, 18 deletions
diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c index 5fe34a8d8c81..e4581a42ace5 100644 --- a/sound/pci/hda/hda_beep.c +++ b/sound/pci/hda/hda_beep.c | |||
@@ -42,7 +42,7 @@ static void snd_hda_generate_beep(struct work_struct *work) | |||
42 | return; | 42 | return; |
43 | 43 | ||
44 | /* generate tone */ | 44 | /* generate tone */ |
45 | snd_hda_codec_write_cache(codec, beep->nid, 0, | 45 | snd_hda_codec_write(codec, beep->nid, 0, |
46 | AC_VERB_SET_BEEP_CONTROL, beep->tone); | 46 | AC_VERB_SET_BEEP_CONTROL, beep->tone); |
47 | } | 47 | } |
48 | 48 | ||
@@ -119,7 +119,7 @@ static void snd_hda_do_detach(struct hda_beep *beep) | |||
119 | beep->dev = NULL; | 119 | beep->dev = NULL; |
120 | cancel_work_sync(&beep->beep_work); | 120 | cancel_work_sync(&beep->beep_work); |
121 | /* turn off beep for sure */ | 121 | /* turn off beep for sure */ |
122 | snd_hda_codec_write_cache(beep->codec, beep->nid, 0, | 122 | snd_hda_codec_write(beep->codec, beep->nid, 0, |
123 | AC_VERB_SET_BEEP_CONTROL, 0); | 123 | AC_VERB_SET_BEEP_CONTROL, 0); |
124 | } | 124 | } |
125 | 125 | ||
@@ -192,7 +192,7 @@ int snd_hda_enable_beep_device(struct hda_codec *codec, int enable) | |||
192 | beep->enabled = enable; | 192 | beep->enabled = enable; |
193 | if (!enable) { | 193 | if (!enable) { |
194 | /* turn off beep */ | 194 | /* turn off beep */ |
195 | snd_hda_codec_write_cache(beep->codec, beep->nid, 0, | 195 | snd_hda_codec_write(beep->codec, beep->nid, 0, |
196 | AC_VERB_SET_BEEP_CONTROL, 0); | 196 | AC_VERB_SET_BEEP_CONTROL, 0); |
197 | } | 197 | } |
198 | if (beep->mode == HDA_BEEP_MODE_SWREG) { | 198 | if (beep->mode == HDA_BEEP_MODE_SWREG) { |
@@ -239,8 +239,12 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) | |||
239 | mutex_init(&beep->mutex); | 239 | mutex_init(&beep->mutex); |
240 | 240 | ||
241 | if (beep->mode == HDA_BEEP_MODE_ON) { | 241 | if (beep->mode == HDA_BEEP_MODE_ON) { |
242 | beep->enabled = 1; | 242 | int err = snd_hda_do_attach(beep); |
243 | snd_hda_do_register(&beep->register_work); | 243 | if (err < 0) { |
244 | kfree(beep); | ||
245 | codec->beep = NULL; | ||
246 | return err; | ||
247 | } | ||
244 | } | 248 | } |
245 | 249 | ||
246 | return 0; | 250 | return 0; |
@@ -253,7 +257,7 @@ void snd_hda_detach_beep_device(struct hda_codec *codec) | |||
253 | if (beep) { | 257 | if (beep) { |
254 | cancel_work_sync(&beep->register_work); | 258 | cancel_work_sync(&beep->register_work); |
255 | cancel_delayed_work(&beep->unregister_work); | 259 | cancel_delayed_work(&beep->unregister_work); |
256 | if (beep->enabled) | 260 | if (beep->dev) |
257 | snd_hda_do_detach(beep); | 261 | snd_hda_do_detach(beep); |
258 | codec->beep = NULL; | 262 | codec->beep = NULL; |
259 | kfree(beep); | 263 | kfree(beep); |
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index d02ea8926e7e..26ceace88c96 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -1351,11 +1351,13 @@ EXPORT_SYMBOL_HDA(snd_hda_query_pin_caps); | |||
1351 | */ | 1351 | */ |
1352 | u32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid) | 1352 | u32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid) |
1353 | { | 1353 | { |
1354 | u32 pincap = snd_hda_query_pin_caps(codec, nid); | 1354 | u32 pincap; |
1355 | |||
1356 | if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */ | ||
1357 | snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0); | ||
1358 | 1355 | ||
1356 | if (!codec->no_trigger_sense) { | ||
1357 | pincap = snd_hda_query_pin_caps(codec, nid); | ||
1358 | if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */ | ||
1359 | snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0); | ||
1360 | } | ||
1359 | return snd_hda_codec_read(codec, nid, 0, | 1361 | return snd_hda_codec_read(codec, nid, 0, |
1360 | AC_VERB_GET_PIN_SENSE, 0); | 1362 | AC_VERB_GET_PIN_SENSE, 0); |
1361 | } | 1363 | } |
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 11c4aa8ee996..0c8f05cc56be 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -818,6 +818,7 @@ struct hda_codec { | |||
818 | unsigned int pin_amp_workaround:1; /* pin out-amp takes index | 818 | unsigned int pin_amp_workaround:1; /* pin out-amp takes index |
819 | * (e.g. Conexant codecs) | 819 | * (e.g. Conexant codecs) |
820 | */ | 820 | */ |
821 | unsigned int no_trigger_sense:1; /* don't trigger at pin-sensing */ | ||
821 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 822 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
822 | unsigned int power_on :1; /* current (global) power-state */ | 823 | unsigned int power_on :1; /* current (global) power-state */ |
823 | unsigned int power_transition :1; /* power-state in transition */ | 824 | unsigned int power_transition :1; /* power-state in transition */ |
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 865715e3f938..214301d568fa 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -1276,6 +1276,8 @@ static int patch_ad1986a(struct hda_codec *codec) | |||
1276 | */ | 1276 | */ |
1277 | spec->multiout.no_share_stream = 1; | 1277 | spec->multiout.no_share_stream = 1; |
1278 | 1278 | ||
1279 | codec->no_trigger_sense = 1; | ||
1280 | |||
1279 | return 0; | 1281 | return 0; |
1280 | } | 1282 | } |
1281 | 1283 | ||
@@ -1461,6 +1463,8 @@ static int patch_ad1983(struct hda_codec *codec) | |||
1461 | 1463 | ||
1462 | codec->patch_ops = ad198x_patch_ops; | 1464 | codec->patch_ops = ad198x_patch_ops; |
1463 | 1465 | ||
1466 | codec->no_trigger_sense = 1; | ||
1467 | |||
1464 | return 0; | 1468 | return 0; |
1465 | } | 1469 | } |
1466 | 1470 | ||
@@ -1904,6 +1908,9 @@ static int patch_ad1981(struct hda_codec *codec) | |||
1904 | codec->patch_ops.unsol_event = ad1981_hp_unsol_event; | 1908 | codec->patch_ops.unsol_event = ad1981_hp_unsol_event; |
1905 | break; | 1909 | break; |
1906 | } | 1910 | } |
1911 | |||
1912 | codec->no_trigger_sense = 1; | ||
1913 | |||
1907 | return 0; | 1914 | return 0; |
1908 | } | 1915 | } |
1909 | 1916 | ||
@@ -3220,6 +3227,8 @@ static int patch_ad1988(struct hda_codec *codec) | |||
3220 | #endif | 3227 | #endif |
3221 | spec->vmaster_nid = 0x04; | 3228 | spec->vmaster_nid = 0x04; |
3222 | 3229 | ||
3230 | codec->no_trigger_sense = 1; | ||
3231 | |||
3223 | return 0; | 3232 | return 0; |
3224 | } | 3233 | } |
3225 | 3234 | ||
@@ -3432,6 +3441,8 @@ static int patch_ad1884(struct hda_codec *codec) | |||
3432 | 3441 | ||
3433 | codec->patch_ops = ad198x_patch_ops; | 3442 | codec->patch_ops = ad198x_patch_ops; |
3434 | 3443 | ||
3444 | codec->no_trigger_sense = 1; | ||
3445 | |||
3435 | return 0; | 3446 | return 0; |
3436 | } | 3447 | } |
3437 | 3448 | ||
@@ -4392,6 +4403,8 @@ static int patch_ad1884a(struct hda_codec *codec) | |||
4392 | break; | 4403 | break; |
4393 | } | 4404 | } |
4394 | 4405 | ||
4406 | codec->no_trigger_sense = 1; | ||
4407 | |||
4395 | return 0; | 4408 | return 0; |
4396 | } | 4409 | } |
4397 | 4410 | ||
@@ -4728,6 +4741,9 @@ static int patch_ad1882(struct hda_codec *codec) | |||
4728 | spec->mixers[2] = ad1882_6stack_mixers; | 4741 | spec->mixers[2] = ad1882_6stack_mixers; |
4729 | break; | 4742 | break; |
4730 | } | 4743 | } |
4744 | |||
4745 | codec->no_trigger_sense = 1; | ||
4746 | |||
4731 | return 0; | 4747 | return 0; |
4732 | } | 4748 | } |
4733 | 4749 | ||
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index e28c810bc00c..117919aa17f4 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 | ||
4473 | static void stac92xx_line_out_detect(struct hda_codec *codec, | 4466 | static void stac92xx_line_out_detect(struct hda_codec *codec, |
@@ -4969,6 +4962,7 @@ static int patch_stac9200(struct hda_codec *codec) | |||
4969 | if (spec == NULL) | 4962 | if (spec == NULL) |
4970 | return -ENOMEM; | 4963 | return -ENOMEM; |
4971 | 4964 | ||
4965 | codec->no_trigger_sense = 1; | ||
4972 | codec->spec = spec; | 4966 | codec->spec = spec; |
4973 | spec->num_pins = ARRAY_SIZE(stac9200_pin_nids); | 4967 | spec->num_pins = ARRAY_SIZE(stac9200_pin_nids); |
4974 | spec->pin_nids = stac9200_pin_nids; | 4968 | spec->pin_nids = stac9200_pin_nids; |
@@ -5031,6 +5025,7 @@ static int patch_stac925x(struct hda_codec *codec) | |||
5031 | if (spec == NULL) | 5025 | if (spec == NULL) |
5032 | return -ENOMEM; | 5026 | return -ENOMEM; |
5033 | 5027 | ||
5028 | codec->no_trigger_sense = 1; | ||
5034 | codec->spec = spec; | 5029 | codec->spec = spec; |
5035 | spec->num_pins = ARRAY_SIZE(stac925x_pin_nids); | 5030 | spec->num_pins = ARRAY_SIZE(stac925x_pin_nids); |
5036 | spec->pin_nids = stac925x_pin_nids; | 5031 | spec->pin_nids = stac925x_pin_nids; |
@@ -5115,6 +5110,7 @@ static int patch_stac92hd73xx(struct hda_codec *codec) | |||
5115 | if (spec == NULL) | 5110 | if (spec == NULL) |
5116 | return -ENOMEM; | 5111 | return -ENOMEM; |
5117 | 5112 | ||
5113 | codec->no_trigger_sense = 1; | ||
5118 | codec->spec = spec; | 5114 | codec->spec = spec; |
5119 | codec->slave_dig_outs = stac92hd73xx_slave_dig_outs; | 5115 | codec->slave_dig_outs = stac92hd73xx_slave_dig_outs; |
5120 | spec->num_pins = ARRAY_SIZE(stac92hd73xx_pin_nids); | 5116 | spec->num_pins = ARRAY_SIZE(stac92hd73xx_pin_nids); |
@@ -5262,6 +5258,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec) | |||
5262 | if (spec == NULL) | 5258 | if (spec == NULL) |
5263 | return -ENOMEM; | 5259 | return -ENOMEM; |
5264 | 5260 | ||
5261 | codec->no_trigger_sense = 1; | ||
5265 | codec->spec = spec; | 5262 | codec->spec = spec; |
5266 | codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs; | 5263 | codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs; |
5267 | spec->digbeep_nid = 0x21; | 5264 | spec->digbeep_nid = 0x21; |
@@ -5473,6 +5470,7 @@ static int patch_stac92hd71bxx(struct hda_codec *codec) | |||
5473 | if (spec == NULL) | 5470 | if (spec == NULL) |
5474 | return -ENOMEM; | 5471 | return -ENOMEM; |
5475 | 5472 | ||
5473 | codec->no_trigger_sense = 1; | ||
5476 | codec->spec = spec; | 5474 | codec->spec = spec; |
5477 | codec->patch_ops = stac92xx_patch_ops; | 5475 | codec->patch_ops = stac92xx_patch_ops; |
5478 | spec->num_pins = STAC92HD71BXX_NUM_PINS; | 5476 | spec->num_pins = STAC92HD71BXX_NUM_PINS; |
@@ -5725,6 +5723,7 @@ static int patch_stac922x(struct hda_codec *codec) | |||
5725 | if (spec == NULL) | 5723 | if (spec == NULL) |
5726 | return -ENOMEM; | 5724 | return -ENOMEM; |
5727 | 5725 | ||
5726 | codec->no_trigger_sense = 1; | ||
5728 | codec->spec = spec; | 5727 | codec->spec = spec; |
5729 | spec->num_pins = ARRAY_SIZE(stac922x_pin_nids); | 5728 | spec->num_pins = ARRAY_SIZE(stac922x_pin_nids); |
5730 | spec->pin_nids = stac922x_pin_nids; | 5729 | spec->pin_nids = stac922x_pin_nids; |
@@ -5828,6 +5827,7 @@ static int patch_stac927x(struct hda_codec *codec) | |||
5828 | if (spec == NULL) | 5827 | if (spec == NULL) |
5829 | return -ENOMEM; | 5828 | return -ENOMEM; |
5830 | 5829 | ||
5830 | codec->no_trigger_sense = 1; | ||
5831 | codec->spec = spec; | 5831 | codec->spec = spec; |
5832 | codec->slave_dig_outs = stac927x_slave_dig_outs; | 5832 | codec->slave_dig_outs = stac927x_slave_dig_outs; |
5833 | spec->num_pins = ARRAY_SIZE(stac927x_pin_nids); | 5833 | spec->num_pins = ARRAY_SIZE(stac927x_pin_nids); |
@@ -5962,6 +5962,7 @@ static int patch_stac9205(struct hda_codec *codec) | |||
5962 | if (spec == NULL) | 5962 | if (spec == NULL) |
5963 | return -ENOMEM; | 5963 | return -ENOMEM; |
5964 | 5964 | ||
5965 | codec->no_trigger_sense = 1; | ||
5965 | codec->spec = spec; | 5966 | codec->spec = spec; |
5966 | spec->num_pins = ARRAY_SIZE(stac9205_pin_nids); | 5967 | spec->num_pins = ARRAY_SIZE(stac9205_pin_nids); |
5967 | spec->pin_nids = stac9205_pin_nids; | 5968 | spec->pin_nids = stac9205_pin_nids; |
@@ -6117,6 +6118,7 @@ static int patch_stac9872(struct hda_codec *codec) | |||
6117 | spec = kzalloc(sizeof(*spec), GFP_KERNEL); | 6118 | spec = kzalloc(sizeof(*spec), GFP_KERNEL); |
6118 | if (spec == NULL) | 6119 | if (spec == NULL) |
6119 | return -ENOMEM; | 6120 | return -ENOMEM; |
6121 | codec->no_trigger_sense = 1; | ||
6120 | codec->spec = spec; | 6122 | codec->spec = spec; |
6121 | spec->num_pins = ARRAY_SIZE(stac9872_pin_nids); | 6123 | spec->num_pins = ARRAY_SIZE(stac9872_pin_nids); |
6122 | spec->pin_nids = stac9872_pin_nids; | 6124 | spec->pin_nids = stac9872_pin_nids; |