aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Rapoport <mike@compulab.co.il>2006-06-29 11:15:33 -0400
committerJaroslav Kysela <perex@suse.cz>2006-09-23 04:37:12 -0400
commit82466ad76d60c35bf1c48ba1b9c98c35d82fc385 (patch)
tree82d374d6b3b3027bff6c43c057293017bbcab7c5
parent6dbe662874ba08585eaf732d126762c25ac8e3f7 (diff)
[ALSA] add codec-specific controls for UCB1400
This patch adds some codec-specific controls for Philips UCB1400 codec. Signed-off-by: Mike Rapoport <mike@compulab.co.il> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r--sound/pci/ac97/ac97_codec.c2
-rw-r--r--sound/pci/ac97/ac97_patch.c38
-rw-r--r--sound/pci/ac97/ac97_patch.h1
3 files changed, 40 insertions, 1 deletions
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index f82c636e99a9..e5d062d640df 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -156,7 +156,7 @@ static const struct ac97_codec_id snd_ac97_codec_ids[] = {
156{ 0x4e534300, 0xffffffff, "LM4540,43,45,46,48", NULL, NULL }, // only guess --jk 156{ 0x4e534300, 0xffffffff, "LM4540,43,45,46,48", NULL, NULL }, // only guess --jk
157{ 0x4e534331, 0xffffffff, "LM4549", NULL, NULL }, 157{ 0x4e534331, 0xffffffff, "LM4549", NULL, NULL },
158{ 0x4e534350, 0xffffffff, "LM4550", patch_lm4550, NULL }, // volume wrap fix 158{ 0x4e534350, 0xffffffff, "LM4550", patch_lm4550, NULL }, // volume wrap fix
159{ 0x50534304, 0xffffffff, "UCB1400", NULL, NULL }, 159{ 0x50534304, 0xffffffff, "UCB1400", patch_ucb1400, NULL },
160{ 0x53494c20, 0xffffffe0, "Si3036,8", mpatch_si3036, mpatch_si3036, AC97_MODEM_PATCH }, 160{ 0x53494c20, 0xffffffe0, "Si3036,8", mpatch_si3036, mpatch_si3036, AC97_MODEM_PATCH },
161{ 0x54524102, 0xffffffff, "TR28022", NULL, NULL }, 161{ 0x54524102, 0xffffffff, "TR28022", NULL, NULL },
162{ 0x54524106, 0xffffffff, "TR28026", NULL, NULL }, 162{ 0x54524106, 0xffffffff, "TR28026", NULL, NULL },
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c
index 094cfc1f3a19..5267b006c5c8 100644
--- a/sound/pci/ac97/ac97_patch.c
+++ b/sound/pci/ac97/ac97_patch.c
@@ -2872,3 +2872,41 @@ int patch_lm4550(struct snd_ac97 *ac97)
2872 ac97->res_table = lm4550_restbl; 2872 ac97->res_table = lm4550_restbl;
2873 return 0; 2873 return 0;
2874} 2874}
2875
2876/*
2877 * UCB1400 codec (http://www.semiconductors.philips.com/acrobat_download/datasheets/UCB1400-02.pdf)
2878 */
2879static const struct snd_kcontrol_new snd_ac97_controls_ucb1400[] = {
2880/* enable/disable headphone driver which allows direct connection to
2881 stereo headphone without the use of external DC blocking
2882 capacitors */
2883AC97_SINGLE("Headphone Driver", 0x6a, 6, 1, 0),
2884/* Filter used to compensate the DC offset is added in the ADC to remove idle
2885 tones from the audio band. */
2886AC97_SINGLE("DC Filter", 0x6a, 4, 1, 0),
2887/* Control smart-low-power mode feature. Allows automatic power down
2888 of unused blocks in the ADC analog front end and the PLL. */
2889AC97_SINGLE("Smart Low Power Mode", 0x6c, 4, 3, 0),
2890};
2891
2892static int patch_ucb1400_specific(struct snd_ac97 * ac97)
2893{
2894 int idx, err;
2895 for (idx = 0; idx < ARRAY_SIZE(snd_ac97_controls_ucb1400); idx++)
2896 if ((err = snd_ctl_add(ac97->bus->card, snd_ctl_new1(&snd_ac97_controls_ucb1400[idx], ac97))) < 0)
2897 return err;
2898 return 0;
2899}
2900
2901static struct snd_ac97_build_ops patch_ucb1400_ops = {
2902 .build_specific = patch_ucb1400_specific,
2903};
2904
2905int patch_ucb1400(struct snd_ac97 * ac97)
2906{
2907 ac97->build_ops = &patch_ucb1400_ops;
2908 /* enable headphone driver and smart low power mode by default */
2909 snd_ac97_write(ac97, 0x6a, 0x0050);
2910 snd_ac97_write(ac97, 0x6c, 0x0030);
2911 return 0;
2912}
diff --git a/sound/pci/ac97/ac97_patch.h b/sound/pci/ac97/ac97_patch.h
index adcaa04586cb..741979217207 100644
--- a/sound/pci/ac97/ac97_patch.h
+++ b/sound/pci/ac97/ac97_patch.h
@@ -58,5 +58,6 @@ int patch_cm9780(struct snd_ac97 * ac97);
58int patch_vt1616(struct snd_ac97 * ac97); 58int patch_vt1616(struct snd_ac97 * ac97);
59int patch_vt1617a(struct snd_ac97 * ac97); 59int patch_vt1617a(struct snd_ac97 * ac97);
60int patch_it2646(struct snd_ac97 * ac97); 60int patch_it2646(struct snd_ac97 * ac97);
61int patch_ucb1400(struct snd_ac97 * ac97);
61int mpatch_si3036(struct snd_ac97 * ac97); 62int mpatch_si3036(struct snd_ac97 * ac97);
62int patch_lm4550(struct snd_ac97 * ac97); 63int patch_lm4550(struct snd_ac97 * ac97);