aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-29 05:44:41 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2013-04-08 09:20:58 -0400
commit544c7aadd7d4309ed01fcd787d393db67eb7eaea (patch)
tree1637a7d4ed13d629ce930c01cdc487ce7afd62ac
parent22c75fe7c772c4c47df47364d9e807dcf204d7c2 (diff)
mfd: arizona: Support configuring MICBIASes into bypass mode
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r--drivers/mfd/arizona-core.c12
-rw-r--r--include/linux/mfd/arizona/pdata.h1
2 files changed, 12 insertions, 1 deletions
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index 0962c558dc02..dd679e8601da 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -514,10 +514,16 @@ int arizona_dev_init(struct arizona *arizona)
514 } 514 }
515 515
516 for (i = 0; i < ARIZONA_MAX_MICBIAS; i++) { 516 for (i = 0; i < ARIZONA_MAX_MICBIAS; i++) {
517 if (!arizona->pdata.micbias[i].mV) 517 if (!arizona->pdata.micbias[i].mV &&
518 !arizona->pdata.micbias[i].bypass)
518 continue; 519 continue;
519 520
521 /* Apply default for bypass mode */
522 if (!arizona->pdata.micbias[i].mV)
523 arizona->pdata.micbias[i].mV = 2800;
524
520 val = (arizona->pdata.micbias[i].mV - 1500) / 100; 525 val = (arizona->pdata.micbias[i].mV - 1500) / 100;
526
521 val <<= ARIZONA_MICB1_LVL_SHIFT; 527 val <<= ARIZONA_MICB1_LVL_SHIFT;
522 528
523 if (arizona->pdata.micbias[i].ext_cap) 529 if (arizona->pdata.micbias[i].ext_cap)
@@ -529,10 +535,14 @@ int arizona_dev_init(struct arizona *arizona)
529 if (arizona->pdata.micbias[i].fast_start) 535 if (arizona->pdata.micbias[i].fast_start)
530 val |= ARIZONA_MICB1_RATE; 536 val |= ARIZONA_MICB1_RATE;
531 537
538 if (arizona->pdata.micbias[i].bypass)
539 val |= ARIZONA_MICB1_BYPASS;
540
532 regmap_update_bits(arizona->regmap, 541 regmap_update_bits(arizona->regmap,
533 ARIZONA_MIC_BIAS_CTRL_1 + i, 542 ARIZONA_MIC_BIAS_CTRL_1 + i,
534 ARIZONA_MICB1_LVL_MASK | 543 ARIZONA_MICB1_LVL_MASK |
535 ARIZONA_MICB1_DISCH | 544 ARIZONA_MICB1_DISCH |
545 ARIZONA_MICB1_BYPASS |
536 ARIZONA_MICB1_RATE, val); 546 ARIZONA_MICB1_RATE, val);
537 } 547 }
538 548
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h
index 8755dd05ab78..554d903cdf41 100644
--- a/include/linux/mfd/arizona/pdata.h
+++ b/include/linux/mfd/arizona/pdata.h
@@ -78,6 +78,7 @@ struct arizona_micbias {
78 unsigned int ext_cap:1; /** External capacitor fitted */ 78 unsigned int ext_cap:1; /** External capacitor fitted */
79 unsigned int discharge:1; /** Actively discharge */ 79 unsigned int discharge:1; /** Actively discharge */
80 unsigned int fast_start:1; /** Enable aggressive startup ramp rate */ 80 unsigned int fast_start:1; /** Enable aggressive startup ramp rate */
81 unsigned int bypass:1; /** Use bypass mode */
81}; 82};
82 83
83struct arizona_micd_config { 84struct arizona_micd_config {