Commit 2e4249f5 authored by Dan Murphy's avatar Dan Murphy Committed by Mark Brown

ASoC: tlv320adcx140: Fix mic_bias and vref device tree verification

Fix the range verification check for the mic_bias and vref device tree
entries.

Fixes 37bde5acf040 ("ASoC: tlv320adcx140: Add the tlv320adcx140 codec driver family")
Signed-off-by: default avatarDan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200304193427.16886-1-dmurphy@ti.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent cc6eb9b5
...@@ -748,9 +748,8 @@ static int adcx140_codec_probe(struct snd_soc_component *component) ...@@ -748,9 +748,8 @@ static int adcx140_codec_probe(struct snd_soc_component *component)
if (ret) if (ret)
bias_source = ADCX140_MIC_BIAS_VAL_VREF; bias_source = ADCX140_MIC_BIAS_VAL_VREF;
if (bias_source != ADCX140_MIC_BIAS_VAL_VREF && if (bias_source < ADCX140_MIC_BIAS_VAL_VREF ||
bias_source != ADCX140_MIC_BIAS_VAL_VREF_1096 && bias_source > ADCX140_MIC_BIAS_VAL_AVDD) {
bias_source != ADCX140_MIC_BIAS_VAL_AVDD) {
dev_err(adcx140->dev, "Mic Bias source value is invalid\n"); dev_err(adcx140->dev, "Mic Bias source value is invalid\n");
return -EINVAL; return -EINVAL;
} }
...@@ -760,9 +759,8 @@ static int adcx140_codec_probe(struct snd_soc_component *component) ...@@ -760,9 +759,8 @@ static int adcx140_codec_probe(struct snd_soc_component *component)
if (ret) if (ret)
vref_source = ADCX140_MIC_BIAS_VREF_275V; vref_source = ADCX140_MIC_BIAS_VREF_275V;
if (vref_source != ADCX140_MIC_BIAS_VREF_275V && if (vref_source < ADCX140_MIC_BIAS_VREF_275V ||
vref_source != ADCX140_MIC_BIAS_VREF_25V && vref_source > ADCX140_MIC_BIAS_VREF_1375V) {
vref_source != ADCX140_MIC_BIAS_VREF_1375V) {
dev_err(adcx140->dev, "Mic Bias source value is invalid\n"); dev_err(adcx140->dev, "Mic Bias source value is invalid\n");
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment