Commit 544c7aad authored by Mark Brown's avatar Mark Brown Committed by Samuel Ortiz

mfd: arizona: Support configuring MICBIASes into bypass mode

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 22c75fe7
...@@ -514,10 +514,16 @@ int arizona_dev_init(struct arizona *arizona) ...@@ -514,10 +514,16 @@ int arizona_dev_init(struct arizona *arizona)
} }
for (i = 0; i < ARIZONA_MAX_MICBIAS; i++) { for (i = 0; i < ARIZONA_MAX_MICBIAS; i++) {
if (!arizona->pdata.micbias[i].mV) if (!arizona->pdata.micbias[i].mV &&
!arizona->pdata.micbias[i].bypass)
continue; continue;
/* Apply default for bypass mode */
if (!arizona->pdata.micbias[i].mV)
arizona->pdata.micbias[i].mV = 2800;
val = (arizona->pdata.micbias[i].mV - 1500) / 100; val = (arizona->pdata.micbias[i].mV - 1500) / 100;
val <<= ARIZONA_MICB1_LVL_SHIFT; val <<= ARIZONA_MICB1_LVL_SHIFT;
if (arizona->pdata.micbias[i].ext_cap) if (arizona->pdata.micbias[i].ext_cap)
...@@ -529,10 +535,14 @@ int arizona_dev_init(struct arizona *arizona) ...@@ -529,10 +535,14 @@ int arizona_dev_init(struct arizona *arizona)
if (arizona->pdata.micbias[i].fast_start) if (arizona->pdata.micbias[i].fast_start)
val |= ARIZONA_MICB1_RATE; val |= ARIZONA_MICB1_RATE;
if (arizona->pdata.micbias[i].bypass)
val |= ARIZONA_MICB1_BYPASS;
regmap_update_bits(arizona->regmap, regmap_update_bits(arizona->regmap,
ARIZONA_MIC_BIAS_CTRL_1 + i, ARIZONA_MIC_BIAS_CTRL_1 + i,
ARIZONA_MICB1_LVL_MASK | ARIZONA_MICB1_LVL_MASK |
ARIZONA_MICB1_DISCH | ARIZONA_MICB1_DISCH |
ARIZONA_MICB1_BYPASS |
ARIZONA_MICB1_RATE, val); ARIZONA_MICB1_RATE, val);
} }
......
...@@ -78,6 +78,7 @@ struct arizona_micbias { ...@@ -78,6 +78,7 @@ struct arizona_micbias {
unsigned int ext_cap:1; /** External capacitor fitted */ unsigned int ext_cap:1; /** External capacitor fitted */
unsigned int discharge:1; /** Actively discharge */ unsigned int discharge:1; /** Actively discharge */
unsigned int fast_start:1; /** Enable aggressive startup ramp rate */ unsigned int fast_start:1; /** Enable aggressive startup ramp rate */
unsigned int bypass:1; /** Use bypass mode */
}; };
struct arizona_micd_config { struct arizona_micd_config {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment