aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-05-26 09:18:58 -0400
committerTakashi Iwai <tiwai@suse.de>2009-05-26 09:18:58 -0400
commit86d190e77c44cb057742dcc871b12ebd4633c387 (patch)
tree5c342070ce494fb54dea1604b8db4e20e985110d
parent4fcd39207f4c91185cc89e3e6a28cbb643034ff1 (diff)
ALSA: hda - Minor clean up of patch_sigmatel.c
- Remove unneeded semicolons - Introduce spec->gpio_led to specify the GPIO bit for LED control Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/patch_sigmatel.c48
1 files changed, 16 insertions, 32 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 17310814f121..26d8707173b2 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -193,6 +193,7 @@ struct sigmatel_spec {
193 unsigned int gpio_dir; 193 unsigned int gpio_dir;
194 unsigned int gpio_data; 194 unsigned int gpio_data;
195 unsigned int gpio_mute; 195 unsigned int gpio_mute;
196 unsigned int gpio_led;
196 197
197 /* stream */ 198 /* stream */
198 unsigned int stream_delay; 199 unsigned int stream_delay;
@@ -4651,22 +4652,13 @@ static int stac92xx_hp_check_power_status(struct hda_codec *codec,
4651 hda_nid_t nid) 4652 hda_nid_t nid)
4652{ 4653{
4653 struct sigmatel_spec *spec = codec->spec; 4654 struct sigmatel_spec *spec = codec->spec;
4654 unsigned int gpio_bit = 0; /* gets rid of compiler warning */
4655
4656 switch (spec->board_config) {
4657 case STAC_HP_DV4_1222NR:
4658 gpio_bit = 0x01;
4659 break;
4660 case STAC_HP_HDX:
4661 gpio_bit = 0x08;
4662 }
4663 4655
4664 if (nid == 0x10) { 4656 if (nid == 0x10) {
4665 if (snd_hda_codec_amp_read(codec, nid, 0, HDA_OUTPUT, 0) & 4657 if (snd_hda_codec_amp_read(codec, nid, 0, HDA_OUTPUT, 0) &
4666 HDA_AMP_MUTE) 4658 HDA_AMP_MUTE)
4667 spec->gpio_data &= ~gpio_bit; /* orange */ 4659 spec->gpio_data |= spec->gpio_led; /* white */
4668 else 4660 else
4669 spec->gpio_data |= gpio_bit; /* white */ 4661 spec->gpio_data &= ~spec->gpio_led; /* orange */
4670 4662
4671 stac_gpio_set(codec, spec->gpio_mask, 4663 stac_gpio_set(codec, spec->gpio_mask,
4672 spec->gpio_dir, 4664 spec->gpio_dir,
@@ -5352,14 +5344,7 @@ again:
5352 */ 5344 */
5353 spec->num_smuxes = 1; 5345 spec->num_smuxes = 1;
5354 spec->num_dmuxes = 1; 5346 spec->num_dmuxes = 1;
5355#ifdef CONFIG_SND_HDA_POWER_SAVE 5347 spec->gpio_led = 0x01;
5356 /* This controls MUTE LED */
5357 spec->gpio_mask |= 0x01;
5358 spec->gpio_dir |= 0x01;
5359 spec->gpio_data |= 0x01;
5360 codec->patch_ops.check_power_status =
5361 stac92xx_hp_check_power_status;
5362#endif
5363 /* fallthrough */ 5348 /* fallthrough */
5364 case STAC_HP_DV5: 5349 case STAC_HP_DV5:
5365 snd_hda_codec_set_pincfg(codec, 0x0d, 0x90170010); 5350 snd_hda_codec_set_pincfg(codec, 0x0d, 0x90170010);
@@ -5369,22 +5354,21 @@ again:
5369 spec->num_dmics = 1; 5354 spec->num_dmics = 1;
5370 spec->num_dmuxes = 1; 5355 spec->num_dmuxes = 1;
5371 spec->num_smuxes = 1; 5356 spec->num_smuxes = 1;
5372 /*
5373 * For controlling MUTE LED on HP HDX16/HDX18 notebooks,
5374 * the CONFIG_SND_HDA_POWER_SAVE is needed to be set.
5375 */
5376#ifdef CONFIG_SND_HDA_POWER_SAVE
5377 /* orange/white mute led on GPIO3, orange=0, white=1 */ 5357 /* orange/white mute led on GPIO3, orange=0, white=1 */
5378 spec->gpio_mask |= 0x08; 5358 spec->gpio_led = 0x08;
5379 spec->gpio_dir |= 0x08; 5359 break;
5380 spec->gpio_data |= 0x08; /* set to white */ 5360 }
5381 5361
5362#ifdef CONFIG_SND_HDA_POWER_SAVE
5363 if (spec->gpio_led) {
5364 spec->gpio_mask |= spec->gpio_led;
5365 spec->gpio_dir |= spec->gpio_led;
5366 spec->gpio_data |= spec->gpio_led;
5382 /* register check_power_status callback. */ 5367 /* register check_power_status callback. */
5383 codec->patch_ops.check_power_status = 5368 codec->patch_ops.check_power_status =
5384 stac92xx_hp_check_power_status; 5369 stac92xx_hp_check_power_status;
5370 }
5385#endif 5371#endif
5386 break;
5387 };
5388 5372
5389 spec->multiout.dac_nids = spec->dac_nids; 5373 spec->multiout.dac_nids = spec->dac_nids;
5390 if (spec->dinput_mux) 5374 if (spec->dinput_mux)
@@ -5409,7 +5393,7 @@ again:
5409 codec->proc_widget_hook = stac92hd7x_proc_hook; 5393 codec->proc_widget_hook = stac92hd7x_proc_hook;
5410 5394
5411 return 0; 5395 return 0;
5412}; 5396}
5413 5397
5414static int patch_stac922x(struct hda_codec *codec) 5398static int patch_stac922x(struct hda_codec *codec)
5415{ 5399{
@@ -5564,7 +5548,7 @@ static int patch_stac927x(struct hda_codec *codec)
5564 /* correct the device field to SPDIF out */ 5548 /* correct the device field to SPDIF out */
5565 snd_hda_codec_set_pincfg(codec, 0x21, 0x01442070); 5549 snd_hda_codec_set_pincfg(codec, 0x21, 0x01442070);
5566 break; 5550 break;
5567 }; 5551 }
5568 /* configure the analog microphone on some laptops */ 5552 /* configure the analog microphone on some laptops */
5569 snd_hda_codec_set_pincfg(codec, 0x0c, 0x90a79130); 5553 snd_hda_codec_set_pincfg(codec, 0x0c, 0x90a79130);
5570 /* correct the front output jack as a hp out */ 5554 /* correct the front output jack as a hp out */