aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ac97/ac97_patch.c
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 /sound/pci/ac97/ac97_patch.c
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>
Diffstat (limited to 'sound/pci/ac97/ac97_patch.c')
-rw-r--r--sound/pci/ac97/ac97_patch.c38
1 files changed, 38 insertions, 0 deletions
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}