Skip to content

Commit

Permalink
mfd: Add support for multiple arizona PDM speaker outputs
Browse files Browse the repository at this point in the history
The registers have stride 2 so we can write the loop properly now.

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 Jul 10, 2012
1 parent 78a73e5 commit 2a51da0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions drivers/mfd/arizona-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,18 +462,17 @@ int __devinit arizona_dev_init(struct arizona *arizona)
ARIZONA_OUT1_MONO, val);
}

BUILD_BUG_ON(ARIZONA_MAX_PDM_SPK > 1);
for (i = 0; i < ARIZONA_MAX_PDM_SPK; i++) {
if (arizona->pdata.spk_mute[i])
regmap_update_bits(arizona->regmap,
ARIZONA_PDM_SPK1_CTRL_1,
ARIZONA_PDM_SPK1_CTRL_1 + (i * 2),
ARIZONA_SPK1_MUTE_ENDIAN_MASK |
ARIZONA_SPK1_MUTE_SEQ1_MASK,
arizona->pdata.spk_mute[i]);

if (arizona->pdata.spk_fmt[i])
regmap_update_bits(arizona->regmap,
ARIZONA_PDM_SPK1_CTRL_2,
ARIZONA_PDM_SPK1_CTRL_2 + (i * 2),
ARIZONA_SPK1_FMT_MASK,
arizona->pdata.spk_fmt[i]);
}
Expand Down
2 changes: 1 addition & 1 deletion include/linux/mfd/arizona/pdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

#define ARIZONA_MAX_OUTPUT 5

#define ARIZONA_MAX_PDM_SPK 1
#define ARIZONA_MAX_PDM_SPK 2

struct regulator_init_data;

Expand Down

0 comments on commit 2a51da0

Please sign in to comment.