diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-01-29 00:47:37 +0800 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-02-14 00:22:48 +0100 |
commit | 3d91f8282c66d9edafa3980385324ce6a48edcda (patch) | |
tree | a847372ae3547ba5887c29b8047b97f48dddf551 /drivers/mfd/arizona-core.c | |
parent | 648a98808c6319dde03b64550dc64a61aaccc2b4 (diff) | |
download | linux-rpi3-3d91f8282c66d9edafa3980385324ce6a48edcda.tar.gz linux-rpi3-3d91f8282c66d9edafa3980385324ce6a48edcda.tar.bz2 linux-rpi3-3d91f8282c66d9edafa3980385324ce6a48edcda.zip |
mfd: arizona: Provide platform data for MICBIAS configuration
Allow the MICBIAS voltages and other attributes to be configured by the
platform.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/arizona-core.c')
-rw-r--r-- | drivers/mfd/arizona-core.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c index 317ba0a4ea25..b562c7bf8a46 100644 --- a/drivers/mfd/arizona-core.c +++ b/drivers/mfd/arizona-core.c @@ -510,6 +510,29 @@ int arizona_dev_init(struct arizona *arizona) goto err_reset; } + for (i = 0; i < ARIZONA_MAX_MICBIAS; i++) { + if (!arizona->pdata.micbias[i].mV) + continue; + + val = (arizona->pdata.micbias[i].mV - 1500) / 100; + val <<= ARIZONA_MICB1_LVL_SHIFT; + + if (arizona->pdata.micbias[i].ext_cap) + val |= ARIZONA_MICB1_EXT_CAP; + + if (arizona->pdata.micbias[i].discharge) + val |= ARIZONA_MICB1_DISCH; + + if (arizona->pdata.micbias[i].fast_start) + val |= ARIZONA_MICB1_RATE; + + regmap_update_bits(arizona->regmap, + ARIZONA_MIC_BIAS_CTRL_1 + i, + ARIZONA_MICB1_LVL_MASK | + ARIZONA_MICB1_DISCH | + ARIZONA_MICB1_RATE, val); + } + for (i = 0; i < ARIZONA_MAX_INPUT; i++) { /* Default for both is 0 so noop with defaults */ val = arizona->pdata.dmic_ref[i] |