diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2008-08-15 11:22:33 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-08-15 11:43:47 -0400 |
commit | 97bb8129e5deb3c0584391a5d2348966732e2233 (patch) | |
tree | e848e1e8d807a45269d601106f46e64cf942f065 | |
parent | 436a74593c34275807fadef20344bbaca251b8d1 (diff) |
ALSA: wm8990: Implement speaker volume PGA
The latest revisions of the WM8990 provide a programmable gain amplifier
for the speaker - configure the register cache and implement controls
for this. Older revisions of the device ignore writes to these controls.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/soc/codecs/wm8990.c | 8 | ||||
-rw-r--r-- | sound/soc/codecs/wm8990.h | 14 |
2 files changed, 18 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c index 9505a18fa606..e44153fa38de 100644 --- a/sound/soc/codecs/wm8990.c +++ b/sound/soc/codecs/wm8990.c | |||
@@ -82,7 +82,7 @@ static const u16 wm8990_reg[] = { | |||
82 | 0x0003, /* R35 - ClassD1 */ | 82 | 0x0003, /* R35 - ClassD1 */ |
83 | 0x0000, /* R36 */ | 83 | 0x0000, /* R36 */ |
84 | 0x0100, /* R37 - ClassD3 */ | 84 | 0x0100, /* R37 - ClassD3 */ |
85 | 0x0000, /* R38 */ | 85 | 0x0079, /* R38 - ClassD4 */ |
86 | 0x0000, /* R39 - Input Mixer1 */ | 86 | 0x0000, /* R39 - Input Mixer1 */ |
87 | 0x0000, /* R40 - Input Mixer2 */ | 87 | 0x0000, /* R40 - Input Mixer2 */ |
88 | 0x0000, /* R41 - Input Mixer3 */ | 88 | 0x0000, /* R41 - Input Mixer3 */ |
@@ -311,11 +311,15 @@ SOC_SINGLE("Speaker Mode Switch", WM8990_CLASSD1, | |||
311 | WM8990_CDMODE_BIT, 1, 0), | 311 | WM8990_CDMODE_BIT, 1, 0), |
312 | 312 | ||
313 | SOC_SINGLE("Speaker Output Attenuation Volume", WM8990_SPEAKER_VOLUME, | 313 | SOC_SINGLE("Speaker Output Attenuation Volume", WM8990_SPEAKER_VOLUME, |
314 | WM8990_SPKVOL_SHIFT, WM8990_SPKVOL_MASK, 0), | 314 | WM8990_SPKATTN_SHIFT, WM8990_SPKATTN_MASK, 0), |
315 | SOC_SINGLE("Speaker DC Boost Volume", WM8990_CLASSD3, | 315 | SOC_SINGLE("Speaker DC Boost Volume", WM8990_CLASSD3, |
316 | WM8990_DCGAIN_SHIFT, WM8990_DCGAIN_MASK, 0), | 316 | WM8990_DCGAIN_SHIFT, WM8990_DCGAIN_MASK, 0), |
317 | SOC_SINGLE("Speaker AC Boost Volume", WM8990_CLASSD3, | 317 | SOC_SINGLE("Speaker AC Boost Volume", WM8990_CLASSD3, |
318 | WM8990_ACGAIN_SHIFT, WM8990_ACGAIN_MASK, 0), | 318 | WM8990_ACGAIN_SHIFT, WM8990_ACGAIN_MASK, 0), |
319 | SOC_SINGLE_TLV("Speaker Volume", WM8990_CLASSD4, | ||
320 | WM8990_SPKVOL_SHIFT, WM8990_SPKVOL_MASK, 0, out_pga_tlv), | ||
321 | SOC_SINGLE("Speaker ZC Switch", WM8990_CLASSD4, | ||
322 | WM8990_SPKZC_SHIFT, WM8990_SPKZC_MASK, 0), | ||
319 | 323 | ||
320 | SOC_WM899X_OUTPGA_SINGLE_R_TLV("Left DAC Digital Volume", | 324 | SOC_WM899X_OUTPGA_SINGLE_R_TLV("Left DAC Digital Volume", |
321 | WM8990_LEFT_DAC_DIGITAL_VOLUME, | 325 | WM8990_LEFT_DAC_DIGITAL_VOLUME, |
diff --git a/sound/soc/codecs/wm8990.h b/sound/soc/codecs/wm8990.h index 6bea57485283..0a08325d5443 100644 --- a/sound/soc/codecs/wm8990.h +++ b/sound/soc/codecs/wm8990.h | |||
@@ -54,6 +54,7 @@ | |||
54 | #define WM8990_SPEAKER_VOLUME 0x22 | 54 | #define WM8990_SPEAKER_VOLUME 0x22 |
55 | #define WM8990_CLASSD1 0x23 | 55 | #define WM8990_CLASSD1 0x23 |
56 | #define WM8990_CLASSD3 0x25 | 56 | #define WM8990_CLASSD3 0x25 |
57 | #define WM8990_CLASSD4 0x26 | ||
57 | #define WM8990_INPUT_MIXER1 0x27 | 58 | #define WM8990_INPUT_MIXER1 0x27 |
58 | #define WM8990_INPUT_MIXER2 0x28 | 59 | #define WM8990_INPUT_MIXER2 0x28 |
59 | #define WM8990_INPUT_MIXER3 0x29 | 60 | #define WM8990_INPUT_MIXER3 0x29 |
@@ -528,8 +529,8 @@ | |||
528 | /* | 529 | /* |
529 | * R34 (0x22) - Speaker Volume | 530 | * R34 (0x22) - Speaker Volume |
530 | */ | 531 | */ |
531 | #define WM8990_SPKVOL_MASK 0x0003 /* SPKVOL - [1:0] */ | 532 | #define WM8990_SPKATTN_MASK 0x0003 /* SPKATTN - [1:0] */ |
532 | #define WM8990_SPKVOL_SHIFT 0 | 533 | #define WM8990_SPKATTN_SHIFT 0 |
533 | 534 | ||
534 | /* | 535 | /* |
535 | * R35 (0x23) - ClassD1 | 536 | * R35 (0x23) - ClassD1 |
@@ -544,6 +545,15 @@ | |||
544 | #define WM8990_DCGAIN_SHIFT 3 | 545 | #define WM8990_DCGAIN_SHIFT 3 |
545 | #define WM8990_ACGAIN_MASK 0x0007 /* ACGAIN - [2:0] */ | 546 | #define WM8990_ACGAIN_MASK 0x0007 /* ACGAIN - [2:0] */ |
546 | #define WM8990_ACGAIN_SHIFT 0 | 547 | #define WM8990_ACGAIN_SHIFT 0 |
548 | |||
549 | /* | ||
550 | * R38 (0x26) - ClassD4 | ||
551 | */ | ||
552 | #define WM8990_SPKZC_MASK 0x0001 /* SPKZC */ | ||
553 | #define WM8990_SPKZC_SHIFT 7 /* SPKZC */ | ||
554 | #define WM8990_SPKVOL_MASK 0x007F /* SPKVOL - [6:0] */ | ||
555 | #define WM8990_SPKVOL_SHIFT 0 /* SPKVOL - [6:0] */ | ||
556 | |||
547 | /* | 557 | /* |
548 | * R39 (0x27) - Input Mixer1 | 558 | * R39 (0x27) - Input Mixer1 |
549 | */ | 559 | */ |