summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sound/soc/codecs/tlv320adcx140.c13
-rw-r--r--sound/soc/codecs/tlv320adcx140.h1
-rw-r--r--sound/soc/codecs/wm8962.c4
3 files changed, 10 insertions, 8 deletions
diff --git a/sound/soc/codecs/tlv320adcx140.c b/sound/soc/codecs/tlv320adcx140.c
index 140a5802a9a9..472d759ba8a3 100644
--- a/sound/soc/codecs/tlv320adcx140.c
+++ b/sound/soc/codecs/tlv320adcx140.c
@@ -758,15 +758,16 @@ static int adcx140_codec_probe(struct snd_soc_component *component)
{
struct adcx140_priv *adcx140 = snd_soc_component_get_drvdata(component);
int sleep_cfg_val = ADCX140_WAKE_DEV;
- u8 bias_source;
- u8 vref_source;
+ u32 bias_source;
+ u32 vref_source;
+ u8 bias_cfg;
int pdm_count;
u32 pdm_edges[ADCX140_NUM_PDM_EDGES];
u32 pdm_edge_val = 0;
int i;
int ret;
- ret = device_property_read_u8(adcx140->dev, "ti,mic-bias-source",
+ ret = device_property_read_u32(adcx140->dev, "ti,mic-bias-source",
&bias_source);
if (ret)
bias_source = ADCX140_MIC_BIAS_VAL_VREF;
@@ -777,7 +778,7 @@ static int adcx140_codec_probe(struct snd_soc_component *component)
return -EINVAL;
}
- ret = device_property_read_u8(adcx140->dev, "ti,vref-source",
+ ret = device_property_read_u32(adcx140->dev, "ti,vref-source",
&vref_source);
if (ret)
vref_source = ADCX140_MIC_BIAS_VREF_275V;
@@ -788,7 +789,7 @@ static int adcx140_codec_probe(struct snd_soc_component *component)
return -EINVAL;
}
- bias_source |= vref_source;
+ bias_cfg = bias_source << ADCX140_MIC_BIAS_SHIFT | vref_source;
pdm_count = device_property_count_u32(adcx140->dev,
"ti,pdm-edge-select");
@@ -826,7 +827,7 @@ static int adcx140_codec_probe(struct snd_soc_component *component)
ret = regmap_update_bits(adcx140->regmap, ADCX140_BIAS_CFG,
ADCX140_MIC_BIAS_VAL_MSK |
- ADCX140_MIC_BIAS_VREF_MSK, bias_source);
+ ADCX140_MIC_BIAS_VREF_MSK, bias_cfg);
if (ret)
dev_err(adcx140->dev, "setting MIC bias failed %d\n", ret);
out:
diff --git a/sound/soc/codecs/tlv320adcx140.h b/sound/soc/codecs/tlv320adcx140.h
index 432eaf25d1a7..247827f315f1 100644
--- a/sound/soc/codecs/tlv320adcx140.h
+++ b/sound/soc/codecs/tlv320adcx140.h
@@ -116,6 +116,7 @@
#define ADCX140_MIC_BIAS_VAL_VREF_1096 1
#define ADCX140_MIC_BIAS_VAL_AVDD 6
#define ADCX140_MIC_BIAS_VAL_MSK GENMASK(6, 4)
+#define ADCX140_MIC_BIAS_SHIFT 4
#define ADCX140_MIC_BIAS_VREF_275V 0
#define ADCX140_MIC_BIAS_VREF_25V 1
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 0a2cfff44441..08d19df8a700 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -3798,8 +3798,8 @@ static int wm8962_runtime_resume(struct device *dev)
/* SYSCLK defaults to on; make sure it is off so we can safely
* write to registers if the device is declocked.
*/
- regmap_update_bits(wm8962->regmap, WM8962_CLOCKING2,
- WM8962_SYSCLK_ENA, 0);
+ regmap_write_bits(wm8962->regmap, WM8962_CLOCKING2,
+ WM8962_SYSCLK_ENA, 0);
/* Ensure we have soft control over all registers */
regmap_update_bits(wm8962->regmap, WM8962_CLOCKING2,