diff options
author | Fang, Yang A <yang.a.fang@intel.com> | 2015-05-29 11:56:10 -0700 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-06-02 18:11:03 +0100 |
commit | bb13f0e08d16a6a303aab786b2aaf2ca76747cfb (patch) | |
tree | cc33bc2ce075a98330bb25b4672146acb424ce59 /sound/soc/codecs/max98090.c | |
parent | b787f68c36d49bb1d9236f403813641efa74a031 (diff) | |
download | linux-bb13f0e08d16a6a303aab786b2aaf2ca76747cfb.tar.gz linux-bb13f0e08d16a6a303aab786b2aaf2ca76747cfb.tar.bz2 linux-bb13f0e08d16a6a303aab786b2aaf2ca76747cfb.zip |
ASoC: max98090: read micbias from device property
This patch reads max98090 micbias from acpi or dt
Signed-off-by: Fang, Yang A <yang.a.fang@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/max98090.c')
-rw-r--r-- | sound/soc/codecs/max98090.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index 3e33ef2acf3c..9d80c68abdd5 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c @@ -2422,6 +2422,8 @@ static int max98090_probe(struct snd_soc_codec *codec) struct max98090_cdata *cdata; enum max98090_type devtype; int ret = 0; + int err; + unsigned int micbias; dev_dbg(codec->dev, "max98090_probe\n"); @@ -2506,8 +2508,17 @@ static int max98090_probe(struct snd_soc_codec *codec) snd_soc_write(codec, M98090_REG_BIAS_CONTROL, M98090_VCM_MODE_MASK); + err = device_property_read_u32(codec->dev, "maxim,micbias", &micbias); + if (err) { + micbias = M98090_MBVSEL_2V8; + dev_info(codec->dev, "use default 2.8v micbias\n"); + } else if (micbias < M98090_MBVSEL_2V2 || micbias > M98090_MBVSEL_2V8) { + dev_err(codec->dev, "micbias out of range 0x%x\n", micbias); + micbias = M98090_MBVSEL_2V8; + } + snd_soc_update_bits(codec, M98090_REG_MIC_BIAS_VOLTAGE, - M98090_MBVSEL_MASK, M98090_MBVSEL_2V8); + M98090_MBVSEL_MASK, micbias); max98090_add_widgets(codec); |