aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8903.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/wm8903.c')
-rw-r--r--sound/soc/codecs/wm8903.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index d015745a886..987476a5895 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -31,6 +31,7 @@
31#include <sound/soc.h> 31#include <sound/soc.h>
32#include <sound/initval.h> 32#include <sound/initval.h>
33#include <sound/wm8903.h> 33#include <sound/wm8903.h>
34#include <trace/events/asoc.h>
34 35
35#include "wm8903.h" 36#include "wm8903.h"
36 37
@@ -213,8 +214,6 @@ static u16 wm8903_reg_defaults[] = {
213 214
214struct wm8903_priv { 215struct wm8903_priv {
215 216
216 u16 reg_cache[ARRAY_SIZE(wm8903_reg_defaults)];
217
218 int sysclk; 217 int sysclk;
219 int irq; 218 int irq;
220 219
@@ -1013,7 +1012,7 @@ static int wm8903_add_widgets(struct snd_soc_codec *codec)
1013static int wm8903_set_bias_level(struct snd_soc_codec *codec, 1012static int wm8903_set_bias_level(struct snd_soc_codec *codec,
1014 enum snd_soc_bias_level level) 1013 enum snd_soc_bias_level level)
1015{ 1014{
1016 u16 reg, reg2; 1015 u16 reg;
1017 1016
1018 switch (level) { 1017 switch (level) {
1019 case SND_SOC_BIAS_ON: 1018 case SND_SOC_BIAS_ON:
@@ -1037,23 +1036,15 @@ static int wm8903_set_bias_level(struct snd_soc_codec *codec,
1037 wm8903_run_sequence(codec, 0); 1036 wm8903_run_sequence(codec, 0);
1038 wm8903_sync_reg_cache(codec, codec->reg_cache); 1037 wm8903_sync_reg_cache(codec, codec->reg_cache);
1039 1038
1040 /* Enable low impedence charge pump output */
1041 reg = snd_soc_read(codec,
1042 WM8903_CONTROL_INTERFACE_TEST_1);
1043 snd_soc_write(codec, WM8903_CONTROL_INTERFACE_TEST_1,
1044 reg | WM8903_TEST_KEY);
1045 reg2 = snd_soc_read(codec, WM8903_CHARGE_PUMP_TEST_1);
1046 snd_soc_write(codec, WM8903_CHARGE_PUMP_TEST_1,
1047 reg2 | WM8903_CP_SW_KELVIN_MODE_MASK);
1048 snd_soc_write(codec, WM8903_CONTROL_INTERFACE_TEST_1,
1049 reg);
1050
1051 /* By default no bypass paths are enabled so 1039 /* By default no bypass paths are enabled so
1052 * enable Class W support. 1040 * enable Class W support.
1053 */ 1041 */
1054 dev_dbg(codec->dev, "Enabling Class W\n"); 1042 dev_dbg(codec->dev, "Enabling Class W\n");
1055 snd_soc_write(codec, WM8903_CLASS_W_0, reg | 1043 snd_soc_update_bits(codec, WM8903_CLASS_W_0,
1056 WM8903_CP_DYN_FREQ | WM8903_CP_DYN_V); 1044 WM8903_CP_DYN_FREQ |
1045 WM8903_CP_DYN_V,
1046 WM8903_CP_DYN_FREQ |
1047 WM8903_CP_DYN_V);
1057 } 1048 }
1058 1049
1059 reg = snd_soc_read(codec, WM8903_VMID_CONTROL_0); 1050 reg = snd_soc_read(codec, WM8903_VMID_CONTROL_0);
@@ -1533,6 +1524,11 @@ static irqreturn_t wm8903_irq(int irq, void *data)
1533 mic_report = wm8903->mic_last_report; 1524 mic_report = wm8903->mic_last_report;
1534 int_pol = snd_soc_read(codec, WM8903_INTERRUPT_POLARITY_1); 1525 int_pol = snd_soc_read(codec, WM8903_INTERRUPT_POLARITY_1);
1535 1526
1527#ifndef CONFIG_SND_SOC_WM8903_MODULE
1528 if (int_val & (WM8903_MICSHRT_EINT | WM8903_MICDET_EINT))
1529 trace_snd_soc_jack_irq(dev_name(codec->dev));
1530#endif
1531
1536 if (int_val & WM8903_MICSHRT_EINT) { 1532 if (int_val & WM8903_MICSHRT_EINT) {
1537 dev_dbg(codec->dev, "Microphone short (pol=%x)\n", int_pol); 1533 dev_dbg(codec->dev, "Microphone short (pol=%x)\n", int_pol);
1538 1534