Skip to content

Commit

Permalink
ASoC: tlv320adc3xxx: BUG: Correct micbias setting
Browse files Browse the repository at this point in the history
[ Upstream commit e930bea ]

The micbias setting for tlv320adc can also have the value '3' which
means that the micbias ouput pin is connected to the input pin AVDD.

Signed-off-by: Antoine Gennart <gennartan@disroot.org>
Link: https://lore.kernel.org/r/20230929130117.77661-1-gennartan@disroot.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
gennartan authored and gregkh committed Nov 8, 2023
1 parent 30ed998 commit f15dbcd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/soc/codecs/tlv320adc3xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@
#define ADC3XXX_BYPASS_RPGA 0x80

/* MICBIAS control bits */
#define ADC3XXX_MICBIAS_MASK 0x2
#define ADC3XXX_MICBIAS_MASK 0x3
#define ADC3XXX_MICBIAS1_SHIFT 5
#define ADC3XXX_MICBIAS2_SHIFT 3

Expand Down Expand Up @@ -1099,7 +1099,7 @@ static int adc3xxx_parse_dt_micbias(struct adc3xxx *adc3xxx,
unsigned int val;

if (!of_property_read_u32(np, propname, &val)) {
if (val >= ADC3XXX_MICBIAS_AVDD) {
if (val > ADC3XXX_MICBIAS_AVDD) {
dev_err(dev, "Invalid property value for '%s'\n", propname);
return -EINVAL;
}
Expand Down

0 comments on commit f15dbcd

Please sign in to comment.