diff options
author | Markus Pargmann <mpa@pengutronix.de> | 2014-09-08 07:01:11 (GMT) |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2014-09-26 07:23:50 (GMT) |
commit | 34a4958e4cfe1a379ed18fb3e2d0b93ba08f28d3 (patch) | |
tree | d3e1a8c014481b758fe9b28681f0b35e91fc327f /drivers/mfd/mc13xxx-core.c | |
parent | 970d9fbca95c2f5277a4f55c2fba9a8b615c38f7 (diff) | |
download | linux-34a4958e4cfe1a379ed18fb3e2d0b93ba08f28d3.tar.xz |
mfd: mc13xxx: Configure WDI reset
Setup the PMIC to make a restart when a watchdog interrupt occures.
If this is not configured, the PMIC will shut down the power supply
without a restart.
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/mc13xxx-core.c')
-rw-r--r-- | drivers/mfd/mc13xxx-core.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c index 2b6bc86..64dde5d 100644 --- a/drivers/mfd/mc13xxx-core.c +++ b/drivers/mfd/mc13xxx-core.c @@ -36,6 +36,9 @@ #define MC34708_REVISION_FIN (0x07 << 6) #define MC34708_REVISION_FAB (0x07 << 9) +#define MC13XXX_PWRCTRL 15 +#define MC13XXX_PWRCTRL_WDIRESET (1 << 12) + #define MC13XXX_ADC1 44 #define MC13XXX_ADC1_ADEN (1 << 0) #define MC13XXX_ADC1_RAND (1 << 1) @@ -416,6 +419,11 @@ int mc13xxx_common_init(struct device *dev) mc13xxx->variant->print_revision(mc13xxx, revision); + ret = mc13xxx_reg_rmw(mc13xxx, MC13XXX_PWRCTRL, + MC13XXX_PWRCTRL_WDIRESET, MC13XXX_PWRCTRL_WDIRESET); + if (ret) + return ret; + for (i = 0; i < ARRAY_SIZE(mc13xxx->irqs); i++) { mc13xxx->irqs[i].reg_offset = i / MC13XXX_IRQ_PER_REG; mc13xxx->irqs[i].mask = BIT(i % MC13XXX_IRQ_PER_REG); |