Skip to content

Commit

Permalink
mfd: arizona: Sync regcache after reset
Browse files Browse the repository at this point in the history
In the absence of a physical reset line the chip is reset by writing the
first register, which is done after the register patch has been applied.
This patch synchronises the register cache after the reset to preserve
any register changes that had been applied.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Charles Keepax authored and Samuel Ortiz committed Nov 20, 2012
1 parent 3ebef34 commit 46b9d13
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/mfd/arizona-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,19 @@ int __devinit arizona_dev_init(struct arizona *arizona)

/* If we have a /RESET GPIO we'll already be reset */
if (!arizona->pdata.reset) {
regcache_mark_dirty(arizona->regmap);

ret = regmap_write(arizona->regmap, ARIZONA_SOFTWARE_RESET, 0);
if (ret != 0) {
dev_err(dev, "Failed to reset device: %d\n", ret);
goto err_reset;
}

ret = regcache_sync(arizona->regmap);
if (ret != 0) {
dev_err(dev, "Failed to sync device: %d\n", ret);
goto err_reset;
}
}

ret = arizona_wait_for_boot(arizona);
Expand Down

0 comments on commit 46b9d13

Please sign in to comment.