aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorMaxim Levitsky <maximlevitsky@gmail.com>2007-08-31 06:52:19 -0400
committerJaroslav Kysela <perex@perex.cz>2007-10-16 09:59:39 -0400
commitca7c5a8b4b4f61087851bb440118e62a688c1688 (patch)
treeb3188cdbad2f269b4ff0569f8fcb9b29994a2510 /sound/pci
parentaccbe4988c5cf3dc86f0a042396163ed279536a6 (diff)
[ALSA] hda-codec - code cleanups in patch_sigmatel.c
Clean up the mixer entries for Input Source using a macro. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_sigmatel.c65
1 files changed, 17 insertions, 48 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index adca2854e50b..98144f93dff9 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -335,17 +335,21 @@ static struct hda_verb stac9205_core_init[] = {
335 {} 335 {}
336}; 336};
337 337
338#define STAC_INPUT_SOURCE \
339 { \
340 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
341 .name = "Input Source", \
342 .count = 1, \
343 .info = stac92xx_mux_enum_info, \
344 .get = stac92xx_mux_enum_get, \
345 .put = stac92xx_mux_enum_put, \
346 }
347
348
338static struct snd_kcontrol_new stac9200_mixer[] = { 349static struct snd_kcontrol_new stac9200_mixer[] = {
339 HDA_CODEC_VOLUME("Master Playback Volume", 0xb, 0, HDA_OUTPUT), 350 HDA_CODEC_VOLUME("Master Playback Volume", 0xb, 0, HDA_OUTPUT),
340 HDA_CODEC_MUTE("Master Playback Switch", 0xb, 0, HDA_OUTPUT), 351 HDA_CODEC_MUTE("Master Playback Switch", 0xb, 0, HDA_OUTPUT),
341 { 352 STAC_INPUT_SOURCE,
342 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
343 .name = "Input Source",
344 .count = 1,
345 .info = stac92xx_mux_enum_info,
346 .get = stac92xx_mux_enum_get,
347 .put = stac92xx_mux_enum_put,
348 },
349 HDA_CODEC_VOLUME("Capture Volume", 0x0a, 0, HDA_OUTPUT), 353 HDA_CODEC_VOLUME("Capture Volume", 0x0a, 0, HDA_OUTPUT),
350 HDA_CODEC_MUTE("Capture Switch", 0x0a, 0, HDA_OUTPUT), 354 HDA_CODEC_MUTE("Capture Switch", 0x0a, 0, HDA_OUTPUT),
351 HDA_CODEC_VOLUME("Capture Mux Volume", 0x0c, 0, HDA_OUTPUT), 355 HDA_CODEC_VOLUME("Capture Mux Volume", 0x0c, 0, HDA_OUTPUT),
@@ -353,14 +357,7 @@ static struct snd_kcontrol_new stac9200_mixer[] = {
353}; 357};
354 358
355static struct snd_kcontrol_new stac925x_mixer[] = { 359static struct snd_kcontrol_new stac925x_mixer[] = {
356 { 360 STAC_INPUT_SOURCE,
357 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
358 .name = "Input Source",
359 .count = 1,
360 .info = stac92xx_mux_enum_info,
361 .get = stac92xx_mux_enum_get,
362 .put = stac92xx_mux_enum_put,
363 },
364 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0, HDA_OUTPUT), 361 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0, HDA_OUTPUT),
365 HDA_CODEC_MUTE("Capture Switch", 0x09, 0, HDA_OUTPUT), 362 HDA_CODEC_MUTE("Capture Switch", 0x09, 0, HDA_OUTPUT),
366 HDA_CODEC_VOLUME("Capture Mux Volume", 0x0f, 0, HDA_OUTPUT), 363 HDA_CODEC_VOLUME("Capture Mux Volume", 0x0f, 0, HDA_OUTPUT),
@@ -369,14 +366,7 @@ static struct snd_kcontrol_new stac925x_mixer[] = {
369 366
370/* This needs to be generated dynamically based on sequence */ 367/* This needs to be generated dynamically based on sequence */
371static struct snd_kcontrol_new stac922x_mixer[] = { 368static struct snd_kcontrol_new stac922x_mixer[] = {
372 { 369 STAC_INPUT_SOURCE,
373 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
374 .name = "Input Source",
375 .count = 1,
376 .info = stac92xx_mux_enum_info,
377 .get = stac92xx_mux_enum_get,
378 .put = stac92xx_mux_enum_put,
379 },
380 HDA_CODEC_VOLUME("Capture Volume", 0x17, 0x0, HDA_INPUT), 370 HDA_CODEC_VOLUME("Capture Volume", 0x17, 0x0, HDA_INPUT),
381 HDA_CODEC_MUTE("Capture Switch", 0x17, 0x0, HDA_INPUT), 371 HDA_CODEC_MUTE("Capture Switch", 0x17, 0x0, HDA_INPUT),
382 HDA_CODEC_VOLUME("Mux Capture Volume", 0x12, 0x0, HDA_OUTPUT), 372 HDA_CODEC_VOLUME("Mux Capture Volume", 0x12, 0x0, HDA_OUTPUT),
@@ -385,28 +375,14 @@ static struct snd_kcontrol_new stac922x_mixer[] = {
385 375
386/* This needs to be generated dynamically based on sequence */ 376/* This needs to be generated dynamically based on sequence */
387static struct snd_kcontrol_new stac9227_mixer[] = { 377static struct snd_kcontrol_new stac9227_mixer[] = {
388 { 378 STAC_INPUT_SOURCE,
389 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
390 .name = "Input Source",
391 .count = 1,
392 .info = stac92xx_mux_enum_info,
393 .get = stac92xx_mux_enum_get,
394 .put = stac92xx_mux_enum_put,
395 },
396 HDA_CODEC_VOLUME("Capture Volume", 0x15, 0x0, HDA_OUTPUT), 379 HDA_CODEC_VOLUME("Capture Volume", 0x15, 0x0, HDA_OUTPUT),
397 HDA_CODEC_MUTE("Capture Switch", 0x1b, 0x0, HDA_OUTPUT), 380 HDA_CODEC_MUTE("Capture Switch", 0x1b, 0x0, HDA_OUTPUT),
398 { } /* end */ 381 { } /* end */
399}; 382};
400 383
401static struct snd_kcontrol_new stac927x_mixer[] = { 384static struct snd_kcontrol_new stac927x_mixer[] = {
402 { 385 STAC_INPUT_SOURCE,
403 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
404 .name = "Input Source",
405 .count = 1,
406 .info = stac92xx_mux_enum_info,
407 .get = stac92xx_mux_enum_get,
408 .put = stac92xx_mux_enum_put,
409 },
410 HDA_CODEC_VOLUME("InMux Capture Volume", 0x15, 0x0, HDA_OUTPUT), 386 HDA_CODEC_VOLUME("InMux Capture Volume", 0x15, 0x0, HDA_OUTPUT),
411 HDA_CODEC_VOLUME("InVol Capture Volume", 0x18, 0x0, HDA_INPUT), 387 HDA_CODEC_VOLUME("InVol Capture Volume", 0x18, 0x0, HDA_INPUT),
412 HDA_CODEC_MUTE("ADCMux Capture Switch", 0x1b, 0x0, HDA_OUTPUT), 388 HDA_CODEC_MUTE("ADCMux Capture Switch", 0x1b, 0x0, HDA_OUTPUT),
@@ -422,14 +398,7 @@ static struct snd_kcontrol_new stac9205_mixer[] = {
422 .get = stac92xx_dmux_enum_get, 398 .get = stac92xx_dmux_enum_get,
423 .put = stac92xx_dmux_enum_put, 399 .put = stac92xx_dmux_enum_put,
424 }, 400 },
425 { 401 STAC_INPUT_SOURCE,
426 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
427 .name = "Input Source",
428 .count = 1,
429 .info = stac92xx_mux_enum_info,
430 .get = stac92xx_mux_enum_get,
431 .put = stac92xx_mux_enum_put,
432 },
433 HDA_CODEC_VOLUME("InMux Capture Volume", 0x19, 0x0, HDA_OUTPUT), 402 HDA_CODEC_VOLUME("InMux Capture Volume", 0x19, 0x0, HDA_OUTPUT),
434 HDA_CODEC_VOLUME("InVol Capture Volume", 0x1b, 0x0, HDA_INPUT), 403 HDA_CODEC_VOLUME("InVol Capture Volume", 0x1b, 0x0, HDA_INPUT),
435 HDA_CODEC_MUTE("ADCMux Capture Switch", 0x1d, 0x0, HDA_OUTPUT), 404 HDA_CODEC_MUTE("ADCMux Capture Switch", 0x1d, 0x0, HDA_OUTPUT),