Skip to content

Commit

Permalink
mfd: arizona: Support configuring MICBIASes into bypass mode
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Mark Brown authored and Samuel Ortiz committed Apr 8, 2013
1 parent 22c75fe commit 544c7aa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion drivers/mfd/arizona-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,10 +514,16 @@ int arizona_dev_init(struct arizona *arizona)
}

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;

/* 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_MICB1_LVL_SHIFT;

if (arizona->pdata.micbias[i].ext_cap)
Expand All @@ -529,10 +535,14 @@ int arizona_dev_init(struct arizona *arizona)
if (arizona->pdata.micbias[i].fast_start)
val |= ARIZONA_MICB1_RATE;

if (arizona->pdata.micbias[i].bypass)
val |= ARIZONA_MICB1_BYPASS;

regmap_update_bits(arizona->regmap,
ARIZONA_MIC_BIAS_CTRL_1 + i,
ARIZONA_MICB1_LVL_MASK |
ARIZONA_MICB1_DISCH |
ARIZONA_MICB1_BYPASS |
ARIZONA_MICB1_RATE, val);
}

Expand Down
1 change: 1 addition & 0 deletions include/linux/mfd/arizona/pdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ struct arizona_micbias {
unsigned int ext_cap:1; /** External capacitor fitted */
unsigned int discharge:1; /** Actively discharge */
unsigned int fast_start:1; /** Enable aggressive startup ramp rate */
unsigned int bypass:1; /** Use bypass mode */
};

struct arizona_micd_config {
Expand Down

0 comments on commit 544c7aa

Please sign in to comment.