diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-03-06 08:04:16 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-03-06 08:04:16 -0500 |
commit | 303076342b8a30aa98f8a53b539155d0b81ff0c3 (patch) | |
tree | 09197f8d7409d2ccd4a98ea6052634fc9f3a7757 /sound/soc/codecs | |
parent | 650d6e25cde82fda425995ba77ed4b0ad3be5b8d (diff) | |
parent | 9d5ef2663fe220a88412a7190942b7d933da0333 (diff) |
Merge tag 'asoc-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into topic/asoc
A few more ASoC updates, the main one is the move of the audmux driver
from arch/arm into sound/soc. There's also some general driver specific
tweaks and fixes.
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r-- | sound/soc/codecs/wm8804.c | 6 | ||||
-rw-r--r-- | sound/soc/codecs/wm8962.c | 18 | ||||
-rw-r--r-- | sound/soc/codecs/wm8994.c | 77 | ||||
-rw-r--r-- | sound/soc/codecs/wm8994.h | 1 |
4 files changed, 58 insertions, 44 deletions
diff --git a/sound/soc/codecs/wm8804.c b/sound/soc/codecs/wm8804.c index 7ee8dcf1fe32..6bd1b767b138 100644 --- a/sound/soc/codecs/wm8804.c +++ b/sound/soc/codecs/wm8804.c | |||
@@ -755,6 +755,12 @@ static __devinit int wm8804_i2c_probe(struct i2c_client *i2c, | |||
755 | if (!wm8804) | 755 | if (!wm8804) |
756 | return -ENOMEM; | 756 | return -ENOMEM; |
757 | 757 | ||
758 | wm8804->regmap = regmap_init_i2c(i2c, &wm8804_regmap_config); | ||
759 | if (IS_ERR(wm8804->regmap)) { | ||
760 | ret = PTR_ERR(wm8804->regmap); | ||
761 | return ret; | ||
762 | } | ||
763 | |||
758 | i2c_set_clientdata(i2c, wm8804); | 764 | i2c_set_clientdata(i2c, wm8804); |
759 | 765 | ||
760 | ret = snd_soc_register_codec(&i2c->dev, | 766 | ret = snd_soc_register_codec(&i2c->dev, |
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index 445d2090661c..5bcb350bacc1 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c | |||
@@ -116,11 +116,11 @@ static struct reg_default wm8962_reg[] = { | |||
116 | { 1, 0x049F }, /* R1 - Right Input volume */ | 116 | { 1, 0x049F }, /* R1 - Right Input volume */ |
117 | { 2, 0x0000 }, /* R2 - HPOUTL volume */ | 117 | { 2, 0x0000 }, /* R2 - HPOUTL volume */ |
118 | { 3, 0x0000 }, /* R3 - HPOUTR volume */ | 118 | { 3, 0x0000 }, /* R3 - HPOUTR volume */ |
119 | { 4, 0x0020 }, /* R4 - Clocking1 */ | 119 | |
120 | { 5, 0x0018 }, /* R5 - ADC & DAC Control 1 */ | 120 | { 5, 0x0018 }, /* R5 - ADC & DAC Control 1 */ |
121 | { 6, 0x2008 }, /* R6 - ADC & DAC Control 2 */ | 121 | { 6, 0x2008 }, /* R6 - ADC & DAC Control 2 */ |
122 | { 7, 0x000A }, /* R7 - Audio Interface 0 */ | 122 | { 7, 0x000A }, /* R7 - Audio Interface 0 */ |
123 | { 8, 0x01E4 }, /* R8 - Clocking2 */ | 123 | |
124 | { 9, 0x0300 }, /* R9 - Audio Interface 1 */ | 124 | { 9, 0x0300 }, /* R9 - Audio Interface 1 */ |
125 | { 10, 0x00C0 }, /* R10 - Left DAC volume */ | 125 | { 10, 0x00C0 }, /* R10 - Left DAC volume */ |
126 | { 11, 0x00C0 }, /* R11 - Right DAC volume */ | 126 | { 11, 0x00C0 }, /* R11 - Right DAC volume */ |
@@ -129,7 +129,7 @@ static struct reg_default wm8962_reg[] = { | |||
129 | { 15, 0x6243 }, /* R15 - Software Reset */ | 129 | { 15, 0x6243 }, /* R15 - Software Reset */ |
130 | 130 | ||
131 | { 17, 0x007B }, /* R17 - ALC1 */ | 131 | { 17, 0x007B }, /* R17 - ALC1 */ |
132 | { 18, 0x0000 }, /* R18 - ALC2 */ | 132 | |
133 | { 19, 0x1C32 }, /* R19 - ALC3 */ | 133 | { 19, 0x1C32 }, /* R19 - ALC3 */ |
134 | { 20, 0x3200 }, /* R20 - Noise Gate */ | 134 | { 20, 0x3200 }, /* R20 - Noise Gate */ |
135 | { 21, 0x00C0 }, /* R21 - Left ADC volume */ | 135 | { 21, 0x00C0 }, /* R21 - Left ADC volume */ |
@@ -153,10 +153,6 @@ static struct reg_default wm8962_reg[] = { | |||
153 | { 40, 0x0000 }, /* R40 - SPKOUTL volume */ | 153 | { 40, 0x0000 }, /* R40 - SPKOUTL volume */ |
154 | { 41, 0x0000 }, /* R41 - SPKOUTR volume */ | 154 | { 41, 0x0000 }, /* R41 - SPKOUTR volume */ |
155 | 155 | ||
156 | { 47, 0x0000 }, /* R47 - Thermal Shutdown Status */ | ||
157 | { 48, 0x8027 }, /* R48 - Additional Control (4) */ | ||
158 | { 49, 0x0010 }, /* R49 - Class D Control 1 */ | ||
159 | |||
160 | { 51, 0x0003 }, /* R51 - Class D Control 2 */ | 156 | { 51, 0x0003 }, /* R51 - Class D Control 2 */ |
161 | 157 | ||
162 | { 56, 0x0506 }, /* R56 - Clocking 4 */ | 158 | { 56, 0x0506 }, /* R56 - Clocking 4 */ |
@@ -168,8 +164,6 @@ static struct reg_default wm8962_reg[] = { | |||
168 | 164 | ||
169 | { 64, 0x0810 }, /* R64 - DC Servo 4 */ | 165 | { 64, 0x0810 }, /* R64 - DC Servo 4 */ |
170 | 166 | ||
171 | { 66, 0x0000 }, /* R66 - DC Servo 6 */ | ||
172 | |||
173 | { 68, 0x001B }, /* R68 - Analogue PGA Bias */ | 167 | { 68, 0x001B }, /* R68 - Analogue PGA Bias */ |
174 | { 69, 0x0000 }, /* R69 - Analogue HP 0 */ | 168 | { 69, 0x0000 }, /* R69 - Analogue HP 0 */ |
175 | 169 | ||
@@ -302,9 +296,6 @@ static struct reg_default wm8962_reg[] = { | |||
302 | { 516, 0x8100 }, /* R516 - GPIO 5 */ | 296 | { 516, 0x8100 }, /* R516 - GPIO 5 */ |
303 | { 517, 0x8100 }, /* R517 - GPIO 6 */ | 297 | { 517, 0x8100 }, /* R517 - GPIO 6 */ |
304 | 298 | ||
305 | { 560, 0x0000 }, /* R560 - Interrupt Status 1 */ | ||
306 | { 561, 0x0000 }, /* R561 - Interrupt Status 2 */ | ||
307 | |||
308 | { 568, 0x0030 }, /* R568 - Interrupt Status 1 Mask */ | 299 | { 568, 0x0030 }, /* R568 - Interrupt Status 1 Mask */ |
309 | { 569, 0xFFED }, /* R569 - Interrupt Status 2 Mask */ | 300 | { 569, 0xFFED }, /* R569 - Interrupt Status 2 Mask */ |
310 | 301 | ||
@@ -316,8 +307,6 @@ static struct reg_default wm8962_reg[] = { | |||
316 | 307 | ||
317 | { 768, 0x1C00 }, /* R768 - DSP2 Power Management */ | 308 | { 768, 0x1C00 }, /* R768 - DSP2 Power Management */ |
318 | 309 | ||
319 | { 1037, 0x0000 }, /* R1037 - DSP2_ExecControl */ | ||
320 | |||
321 | { 8192, 0x0000 }, /* R8192 - DSP2 Instruction RAM 0 */ | 310 | { 8192, 0x0000 }, /* R8192 - DSP2 Instruction RAM 0 */ |
322 | 311 | ||
323 | { 9216, 0x0030 }, /* R9216 - DSP2 Address RAM 2 */ | 312 | { 9216, 0x0030 }, /* R9216 - DSP2 Address RAM 2 */ |
@@ -3673,7 +3662,6 @@ static __devinit int wm8962_i2c_probe(struct i2c_client *i2c, | |||
3673 | ret); | 3662 | ret); |
3674 | } | 3663 | } |
3675 | 3664 | ||
3676 | pm_runtime_set_active(&i2c->dev); | ||
3677 | pm_runtime_enable(&i2c->dev); | 3665 | pm_runtime_enable(&i2c->dev); |
3678 | pm_request_idle(&i2c->dev); | 3666 | pm_request_idle(&i2c->dev); |
3679 | 3667 | ||
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 2417ef9316ed..bc12d097ef0d 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
@@ -685,8 +685,6 @@ SOC_SINGLE_TLV("MIXINL IN1RP Boost Volume", WM8994_INPUT_MIXER_1, 8, 1, 0, | |||
685 | static void wm1811_jackdet_set_mode(struct snd_soc_codec *codec, u16 mode) | 685 | static void wm1811_jackdet_set_mode(struct snd_soc_codec *codec, u16 mode) |
686 | { | 686 | { |
687 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 687 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
688 | u16 old = snd_soc_read(codec, WM8994_ANTIPOP_2) | ||
689 | & WM1811_JACKDET_MODE_MASK; | ||
690 | 688 | ||
691 | if (!wm8994->jackdet || !wm8994->jack_cb) | 689 | if (!wm8994->jackdet || !wm8994->jack_cb) |
692 | return; | 690 | return; |
@@ -694,28 +692,17 @@ static void wm1811_jackdet_set_mode(struct snd_soc_codec *codec, u16 mode) | |||
694 | if (wm8994->active_refcount) | 692 | if (wm8994->active_refcount) |
695 | mode = WM1811_JACKDET_MODE_AUDIO; | 693 | mode = WM1811_JACKDET_MODE_AUDIO; |
696 | 694 | ||
697 | if (mode == old) | 695 | if (mode == wm8994->jackdet_mode) |
698 | return; | 696 | return; |
699 | 697 | ||
700 | snd_soc_update_bits(codec, WM8994_ANTIPOP_2, | 698 | wm8994->jackdet_mode = mode; |
701 | WM1811_JACKDET_MODE_MASK, mode); | ||
702 | |||
703 | switch (mode) { | ||
704 | case WM1811_JACKDET_MODE_MIC: | ||
705 | case WM1811_JACKDET_MODE_AUDIO: | ||
706 | switch (old) { | ||
707 | case WM1811_JACKDET_MODE_MIC: | ||
708 | case WM1811_JACKDET_MODE_AUDIO: | ||
709 | break; | ||
710 | default: | ||
711 | msleep(2); | ||
712 | break; | ||
713 | } | ||
714 | 699 | ||
715 | default: | 700 | /* Always use audio mode to detect while the system is active */ |
716 | break; | 701 | if (mode != WM1811_JACKDET_MODE_NONE) |
717 | } | 702 | mode = WM1811_JACKDET_MODE_AUDIO; |
718 | 703 | ||
704 | snd_soc_update_bits(codec, WM8994_ANTIPOP_2, | ||
705 | WM1811_JACKDET_MODE_MASK, mode); | ||
719 | } | 706 | } |
720 | 707 | ||
721 | static void active_reference(struct snd_soc_codec *codec) | 708 | static void active_reference(struct snd_soc_codec *codec) |
@@ -2749,7 +2736,7 @@ static struct snd_soc_dai_driver wm8994_dai[] = { | |||
2749 | }; | 2736 | }; |
2750 | 2737 | ||
2751 | #ifdef CONFIG_PM | 2738 | #ifdef CONFIG_PM |
2752 | static int wm8994_suspend(struct snd_soc_codec *codec) | 2739 | static int wm8994_codec_suspend(struct snd_soc_codec *codec) |
2753 | { | 2740 | { |
2754 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 2741 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
2755 | struct wm8994 *control = wm8994->wm8994; | 2742 | struct wm8994 *control = wm8994->wm8994; |
@@ -2783,7 +2770,7 @@ static int wm8994_suspend(struct snd_soc_codec *codec) | |||
2783 | return 0; | 2770 | return 0; |
2784 | } | 2771 | } |
2785 | 2772 | ||
2786 | static int wm8994_resume(struct snd_soc_codec *codec) | 2773 | static int wm8994_codec_resume(struct snd_soc_codec *codec) |
2787 | { | 2774 | { |
2788 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 2775 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
2789 | struct wm8994 *control = wm8994->wm8994; | 2776 | struct wm8994 *control = wm8994->wm8994; |
@@ -2842,8 +2829,8 @@ static int wm8994_resume(struct snd_soc_codec *codec) | |||
2842 | return 0; | 2829 | return 0; |
2843 | } | 2830 | } |
2844 | #else | 2831 | #else |
2845 | #define wm8994_suspend NULL | 2832 | #define wm8994_codec_suspend NULL |
2846 | #define wm8994_resume NULL | 2833 | #define wm8994_codec_resume NULL |
2847 | #endif | 2834 | #endif |
2848 | 2835 | ||
2849 | static void wm8994_handle_retune_mobile_pdata(struct wm8994_priv *wm8994) | 2836 | static void wm8994_handle_retune_mobile_pdata(struct wm8994_priv *wm8994) |
@@ -3955,8 +3942,8 @@ static int wm8994_codec_remove(struct snd_soc_codec *codec) | |||
3955 | static struct snd_soc_codec_driver soc_codec_dev_wm8994 = { | 3942 | static struct snd_soc_codec_driver soc_codec_dev_wm8994 = { |
3956 | .probe = wm8994_codec_probe, | 3943 | .probe = wm8994_codec_probe, |
3957 | .remove = wm8994_codec_remove, | 3944 | .remove = wm8994_codec_remove, |
3958 | .suspend = wm8994_suspend, | 3945 | .suspend = wm8994_codec_suspend, |
3959 | .resume = wm8994_resume, | 3946 | .resume = wm8994_codec_resume, |
3960 | .set_bias_level = wm8994_set_bias_level, | 3947 | .set_bias_level = wm8994_set_bias_level, |
3961 | }; | 3948 | }; |
3962 | 3949 | ||
@@ -3983,11 +3970,43 @@ static int __devexit wm8994_remove(struct platform_device *pdev) | |||
3983 | return 0; | 3970 | return 0; |
3984 | } | 3971 | } |
3985 | 3972 | ||
3973 | #ifdef CONFIG_PM_SLEEP | ||
3974 | static int wm8994_suspend(struct device *dev) | ||
3975 | { | ||
3976 | struct wm8994_priv *wm8994 = dev_get_drvdata(dev); | ||
3977 | |||
3978 | /* Drop down to power saving mode when system is suspended */ | ||
3979 | if (wm8994->jackdet && !wm8994->active_refcount) | ||
3980 | regmap_update_bits(wm8994->wm8994->regmap, WM8994_ANTIPOP_2, | ||
3981 | WM1811_JACKDET_MODE_MASK, | ||
3982 | wm8994->jackdet_mode); | ||
3983 | |||
3984 | return 0; | ||
3985 | } | ||
3986 | |||
3987 | static int wm8994_resume(struct device *dev) | ||
3988 | { | ||
3989 | struct wm8994_priv *wm8994 = dev_get_drvdata(dev); | ||
3990 | |||
3991 | if (wm8994->jackdet && wm8994->jack_cb) | ||
3992 | regmap_update_bits(wm8994->wm8994->regmap, WM8994_ANTIPOP_2, | ||
3993 | WM1811_JACKDET_MODE_MASK, | ||
3994 | WM1811_JACKDET_MODE_AUDIO); | ||
3995 | |||
3996 | return 0; | ||
3997 | } | ||
3998 | #endif | ||
3999 | |||
4000 | static const struct dev_pm_ops wm8994_pm_ops = { | ||
4001 | SET_SYSTEM_SLEEP_PM_OPS(wm8994_suspend, wm8994_resume) | ||
4002 | }; | ||
4003 | |||
3986 | static struct platform_driver wm8994_codec_driver = { | 4004 | static struct platform_driver wm8994_codec_driver = { |
3987 | .driver = { | 4005 | .driver = { |
3988 | .name = "wm8994-codec", | 4006 | .name = "wm8994-codec", |
3989 | .owner = THIS_MODULE, | 4007 | .owner = THIS_MODULE, |
3990 | }, | 4008 | .pm = &wm8994_pm_ops, |
4009 | }, | ||
3991 | .probe = wm8994_probe, | 4010 | .probe = wm8994_probe, |
3992 | .remove = __devexit_p(wm8994_remove), | 4011 | .remove = __devexit_p(wm8994_remove), |
3993 | }; | 4012 | }; |
diff --git a/sound/soc/codecs/wm8994.h b/sound/soc/codecs/wm8994.h index f996d14766d9..2f4d2d12a452 100644 --- a/sound/soc/codecs/wm8994.h +++ b/sound/soc/codecs/wm8994.h | |||
@@ -122,6 +122,7 @@ struct wm8994_priv { | |||
122 | bool jack_mic; | 122 | bool jack_mic; |
123 | int btn_mask; | 123 | int btn_mask; |
124 | bool jackdet; | 124 | bool jackdet; |
125 | int jackdet_mode; | ||
125 | 126 | ||
126 | wm8958_micdet_cb jack_cb; | 127 | wm8958_micdet_cb jack_cb; |
127 | void *jack_cb_data; | 128 | void *jack_cb_data; |