aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/arizona-core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-28 11:47:37 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2013-02-13 18:22:48 -0500
commit3d91f8282c66d9edafa3980385324ce6a48edcda (patch)
treea847372ae3547ba5887c29b8047b97f48dddf551 /drivers/mfd/arizona-core.c
parent648a98808c6319dde03b64550dc64a61aaccc2b4 (diff)
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.c23
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)
510 goto err_reset; 510 goto err_reset;
511 } 511 }
512 512
513 for (i = 0; i < ARIZONA_MAX_MICBIAS; i++) {
514 if (!arizona->pdata.micbias[i].mV)
515 continue;
516
517 val = (arizona->pdata.micbias[i].mV - 1500) / 100;
518 val <<= ARIZONA_MICB1_LVL_SHIFT;
519
520 if (arizona->pdata.micbias[i].ext_cap)
521 val |= ARIZONA_MICB1_EXT_CAP;
522
523 if (arizona->pdata.micbias[i].discharge)
524 val |= ARIZONA_MICB1_DISCH;
525
526 if (arizona->pdata.micbias[i].fast_start)
527 val |= ARIZONA_MICB1_RATE;
528
529 regmap_update_bits(arizona->regmap,
530 ARIZONA_MIC_BIAS_CTRL_1 + i,
531 ARIZONA_MICB1_LVL_MASK |
532 ARIZONA_MICB1_DISCH |
533 ARIZONA_MICB1_RATE, val);
534 }
535
513 for (i = 0; i < ARIZONA_MAX_INPUT; i++) { 536 for (i = 0; i < ARIZONA_MAX_INPUT; i++) {
514 /* Default for both is 0 so noop with defaults */ 537 /* Default for both is 0 so noop with defaults */
515 val = arizona->pdata.dmic_ref[i] 538 val = arizona->pdata.dmic_ref[i]