diff options
author | Takashi Iwai <tiwai@suse.de> | 2007-07-27 13:15:54 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2007-10-16 09:58:12 -0400 |
commit | 82467611ffc41fba534c95f8b4ae3887a90f5a66 (patch) | |
tree | 9afc5d99795afaba2bb262a935538263649ab17c /sound/pci | |
parent | 532d5381793f3c824f8ff68d7067fab8c76bb811 (diff) |
[ALSA] hda-codec - kernel config for each codec
Create kernel configs to choose the codec support codes to build.
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/Kconfig | 72 | ||||
-rw-r--r-- | sound/pci/hda/Makefile | 20 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.c | 31 | ||||
-rw-r--r-- | sound/pci/hda/hda_patch.h | 16 |
4 files changed, 125 insertions, 14 deletions
diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig index 57426f6fa423..b80b97f7a49a 100644 --- a/sound/pci/Kconfig +++ b/sound/pci/Kconfig | |||
@@ -509,6 +509,78 @@ config SND_HDA_HWDEP | |||
509 | This interface can be used for out-of-bound communication | 509 | This interface can be used for out-of-bound communication |
510 | with codesc for debugging purposes. | 510 | with codesc for debugging purposes. |
511 | 511 | ||
512 | config SND_HDA_CODEC_REALTEK | ||
513 | bool "Build Realtek HD-audio codec support" | ||
514 | depends on SND_HDA_INTEL | ||
515 | default y | ||
516 | help | ||
517 | Say Y here to include Realtek HD-audio codec support in | ||
518 | snd-hda-intel driver, such as ALC880. | ||
519 | |||
520 | config SND_HDA_CODEC_ANALOG | ||
521 | bool "Build Analog Device HD-audio codec support" | ||
522 | depends on SND_HDA_INTEL | ||
523 | default y | ||
524 | help | ||
525 | Say Y here to include Analog Device HD-audio codec support in | ||
526 | snd-hda-intel driver, such as AD1986A. | ||
527 | |||
528 | config SND_HDA_CODEC_SIGMATEL | ||
529 | bool "Build IDT/Sigmatel HD-audio codec support" | ||
530 | depends on SND_HDA_INTEL | ||
531 | default y | ||
532 | help | ||
533 | Say Y here to include IDT (Sigmatel) HD-audio codec support in | ||
534 | snd-hda-intel driver, such as STAC9200. | ||
535 | |||
536 | config SND_HDA_CODEC_VIA | ||
537 | bool "Build VIA HD-audio codec support" | ||
538 | depends on SND_HDA_INTEL | ||
539 | default y | ||
540 | help | ||
541 | Say Y here to include VIA HD-audio codec support in | ||
542 | snd-hda-intel driver, such as VT1708. | ||
543 | |||
544 | config SND_HDA_CODEC_ATIHDMI | ||
545 | bool "Build ATI HDMI HD-audio codec support" | ||
546 | depends on SND_HDA_INTEL | ||
547 | default y | ||
548 | help | ||
549 | Say Y here to include ATI HDMI HD-audio codec support in | ||
550 | snd-hda-intel driver, such as ATI RS600 HDMI. | ||
551 | |||
552 | config SND_HDA_CODEC_CONEXANT | ||
553 | bool "Build Conexant HD-audio codec support" | ||
554 | depends on SND_HDA_INTEL | ||
555 | default y | ||
556 | help | ||
557 | Say Y here to include Conexant HD-audio codec support in | ||
558 | snd-hda-intel driver, such as CX20549. | ||
559 | |||
560 | config SND_HDA_CODEC_CMEDIA | ||
561 | bool "Build C-Media HD-audio codec support" | ||
562 | depends on SND_HDA_INTEL | ||
563 | default y | ||
564 | help | ||
565 | Say Y here to include C-Media HD-audio codec support in | ||
566 | snd-hda-intel driver, such as CMI9880. | ||
567 | |||
568 | config SND_HDA_CODEC_SI3054 | ||
569 | bool "Build Silicon Labs 3054 HD-modem codec support" | ||
570 | depends on SND_HDA_INTEL | ||
571 | default y | ||
572 | help | ||
573 | Say Y here to include Silicon Labs 3054 HD-modem codec | ||
574 | (and compatibles) support in snd-hda-intel driver. | ||
575 | |||
576 | config SND_HDA_GENERIC | ||
577 | bool "Enable generic HD-audio codec parser" | ||
578 | depends on SND_HDA_INTEL | ||
579 | default y | ||
580 | help | ||
581 | Say Y here to enable the generic HD-audio codec parser | ||
582 | in snd-hda-intel driver. | ||
583 | |||
512 | config SND_HDSP | 584 | config SND_HDSP |
513 | tristate "RME Hammerfall DSP Audio" | 585 | tristate "RME Hammerfall DSP Audio" |
514 | depends on SND | 586 | depends on SND |
diff --git a/sound/pci/hda/Makefile b/sound/pci/hda/Makefile index f85c34551ac8..6d43e39b9d0b 100644 --- a/sound/pci/hda/Makefile +++ b/sound/pci/hda/Makefile | |||
@@ -2,17 +2,17 @@ snd-hda-intel-y := hda_intel.o | |||
2 | # since snd-hda-intel is the only driver using hda-codec, | 2 | # since snd-hda-intel is the only driver using hda-codec, |
3 | # merge it into a single module although it was originally | 3 | # merge it into a single module although it was originally |
4 | # designed to be individual modules | 4 | # designed to be individual modules |
5 | snd-hda-intel-y += hda_codec.o \ | 5 | snd-hda-intel-y += hda_codec.o |
6 | hda_generic.o \ | ||
7 | patch_realtek.o \ | ||
8 | patch_cmedia.o \ | ||
9 | patch_analog.o \ | ||
10 | patch_sigmatel.o \ | ||
11 | patch_si3054.o \ | ||
12 | patch_atihdmi.o \ | ||
13 | patch_conexant.o \ | ||
14 | patch_via.o | ||
15 | snd-hda-intel-$(CONFIG_PROC_FS) += hda_proc.o | 6 | snd-hda-intel-$(CONFIG_PROC_FS) += hda_proc.o |
16 | snd-hda-intel-$(CONFIG_SND_HDA_HWDEP) += hda_hwdep.o | 7 | snd-hda-intel-$(CONFIG_SND_HDA_HWDEP) += hda_hwdep.o |
8 | snd-hda-intel-$(CONFIG_SND_HDA_CODEC_GENERIC) += hda_generic.o | ||
9 | snd-hda-intel-$(CONFIG_SND_HDA_CODEC_REALTEK) += patch_realtek.o | ||
10 | snd-hda-intel-$(CONFIG_SND_HDA_CODEC_CMEDIA) += patch_cmedia.o | ||
11 | snd-hda-intel-$(CONFIG_SND_HDA_CODEC_ANALOG) += patch_analog.o | ||
12 | snd-hda-intel-$(CONFIG_SND_HDA_CODEC_SIGMATEL) += patch_sigmatel.o | ||
13 | snd-hda-intel-$(CONFIG_SND_HDA_CODEC_SI3054) += patch_si3054.o | ||
14 | snd-hda-intel-$(CONFIG_SND_HDA_CODEC_ATIHDMI) += patch_atihdmi.o | ||
15 | snd-hda-intel-$(CONFIG_SND_HDA_CODEC_CONEXANT) += patch_conexant.o | ||
16 | snd-hda-intel-$(CONFIG_SND_HDA_CODEC_VIA) += patch_via.o | ||
17 | 17 | ||
18 | obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-intel.o | 18 | obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-intel.o |
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 36879a93eac4..c4cf2c7230ef 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -388,6 +388,13 @@ int __devinit snd_hda_bus_new(struct snd_card *card, | |||
388 | return 0; | 388 | return 0; |
389 | } | 389 | } |
390 | 390 | ||
391 | #ifdef CONFIG_SND_HDA_GENERIC | ||
392 | #define is_generic_config(codec) \ | ||
393 | (codec->bus->modelname && !strcmp(codec->bus->modelname, "generic")) | ||
394 | #else | ||
395 | #define is_generic_config(codec) 0 | ||
396 | #endif | ||
397 | |||
391 | /* | 398 | /* |
392 | * find a matching codec preset | 399 | * find a matching codec preset |
393 | */ | 400 | */ |
@@ -396,7 +403,7 @@ find_codec_preset(struct hda_codec *codec) | |||
396 | { | 403 | { |
397 | const struct hda_codec_preset **tbl, *preset; | 404 | const struct hda_codec_preset **tbl, *preset; |
398 | 405 | ||
399 | if (codec->bus->modelname && !strcmp(codec->bus->modelname, "generic")) | 406 | if (is_generic_config(codec)) |
400 | return NULL; /* use the generic parser */ | 407 | return NULL; /* use the generic parser */ |
401 | 408 | ||
402 | for (tbl = hda_preset_tables; *tbl; tbl++) { | 409 | for (tbl = hda_preset_tables; *tbl; tbl++) { |
@@ -582,10 +589,26 @@ int __devinit snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr, | |||
582 | snd_hda_get_codec_name(codec, bus->card->mixername, | 589 | snd_hda_get_codec_name(codec, bus->card->mixername, |
583 | sizeof(bus->card->mixername)); | 590 | sizeof(bus->card->mixername)); |
584 | 591 | ||
585 | if (codec->preset && codec->preset->patch) | 592 | #ifdef CONFIG_SND_HDA_GENERIC |
586 | err = codec->preset->patch(codec); | 593 | if (is_generic_config(codec)) { |
587 | else | ||
588 | err = snd_hda_parse_generic_codec(codec); | 594 | err = snd_hda_parse_generic_codec(codec); |
595 | goto patched; | ||
596 | } | ||
597 | #endif | ||
598 | if (codec->preset && codec->preset->patch) { | ||
599 | err = codec->preset->patch(codec); | ||
600 | goto patched; | ||
601 | } | ||
602 | |||
603 | /* call the default parser */ | ||
604 | #ifdef CONFIG_SND_HDA_GENERIC | ||
605 | err = snd_hda_parse_generic_codec(codec); | ||
606 | #else | ||
607 | printk(KERN_ERR "hda-codec: No codec parser is available\n"); | ||
608 | err = -ENODEV; | ||
609 | #endif | ||
610 | |||
611 | patched: | ||
589 | if (err < 0) { | 612 | if (err < 0) { |
590 | snd_hda_codec_free(codec); | 613 | snd_hda_codec_free(codec); |
591 | return err; | 614 | return err; |
diff --git a/sound/pci/hda/hda_patch.h b/sound/pci/hda/hda_patch.h index 9f9e9ae44a9d..f5c23bb16d7e 100644 --- a/sound/pci/hda/hda_patch.h +++ b/sound/pci/hda/hda_patch.h | |||
@@ -20,13 +20,29 @@ extern struct hda_codec_preset snd_hda_preset_conexant[]; | |||
20 | extern struct hda_codec_preset snd_hda_preset_via[]; | 20 | extern struct hda_codec_preset snd_hda_preset_via[]; |
21 | 21 | ||
22 | static const struct hda_codec_preset *hda_preset_tables[] = { | 22 | static const struct hda_codec_preset *hda_preset_tables[] = { |
23 | #ifdef CONFIG_SND_HDA_CODEC_REALTEK | ||
23 | snd_hda_preset_realtek, | 24 | snd_hda_preset_realtek, |
25 | #endif | ||
26 | #ifdef CONFIG_SND_HDA_CODEC_CMEDIA | ||
24 | snd_hda_preset_cmedia, | 27 | snd_hda_preset_cmedia, |
28 | #endif | ||
29 | #ifdef CONFIG_SND_HDA_CODEC_ANALOG | ||
25 | snd_hda_preset_analog, | 30 | snd_hda_preset_analog, |
31 | #endif | ||
32 | #ifdef CONFIG_SND_HDA_CODEC_SIGMATEL | ||
26 | snd_hda_preset_sigmatel, | 33 | snd_hda_preset_sigmatel, |
34 | #endif | ||
35 | #ifdef CONFIG_SND_HDA_CODEC_SI3054 | ||
27 | snd_hda_preset_si3054, | 36 | snd_hda_preset_si3054, |
37 | #endif | ||
38 | #ifdef CONFIG_SND_HDA_CODEC_ATIHDMI | ||
28 | snd_hda_preset_atihdmi, | 39 | snd_hda_preset_atihdmi, |
40 | #endif | ||
41 | #ifdef CONFIG_SND_HDA_CODEC_CONEXANT | ||
29 | snd_hda_preset_conexant, | 42 | snd_hda_preset_conexant, |
43 | #endif | ||
44 | #ifdef CONFIG_SND_HDA_CODEC_VIA | ||
30 | snd_hda_preset_via, | 45 | snd_hda_preset_via, |
46 | #endif | ||
31 | NULL | 47 | NULL |
32 | }; | 48 | }; |