Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 357579
b: refs/heads/master
c: 3d91f82
h: refs/heads/master
i:
  357577: b157c55
  357575: cb47c1f
v: v3
  • Loading branch information
Mark Brown authored and Samuel Ortiz committed Feb 13, 2013
1 parent 25594c5 commit 1f90aa9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 648a98808c6319dde03b64550dc64a61aaccc2b4
refs/heads/master: 3d91f8282c66d9edafa3980385324ce6a48edcda
23 changes: 23 additions & 0 deletions trunk/drivers/mfd/arizona-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
12 changes: 12 additions & 0 deletions trunk/include/linux/mfd/arizona/pdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
#define ARIZONA_DMIC_MICBIAS2 2
#define ARIZONA_DMIC_MICBIAS3 3

#define ARIZONA_MAX_MICBIAS 3

#define ARIZONA_INMODE_DIFF 0
#define ARIZONA_INMODE_SE 1
#define ARIZONA_INMODE_DMIC 2
Expand All @@ -69,6 +71,13 @@

struct regulator_init_data;

struct arizona_micbias {
int mV; /** Regulated voltage */
unsigned int ext_cap:1; /** External capacitor fitted */
unsigned int discharge:1; /** Actively discharge */
unsigned int fast_start:1; /** Enable aggressive startup ramp rate */
};

struct arizona_micd_config {
unsigned int src;
unsigned int bias;
Expand Down Expand Up @@ -106,6 +115,9 @@ struct arizona_pdata {
/** Reference voltage for DMIC inputs */
int dmic_ref[ARIZONA_MAX_INPUT];

/** MICBIAS configurations */
struct arizona_micbias micbias[ARIZONA_MAX_MICBIAS];

/** Mode of input structures */
int inmode[ARIZONA_MAX_INPUT];

Expand Down

0 comments on commit 1f90aa9

Please sign in to comment.