提交 34a4958e 编写于 作者: M Markus Pargmann 提交者: Lee Jones

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: NMarkus Pargmann <mpa@pengutronix.de>
Signed-off-by: NLee Jones <lee.jones@linaro.org>
上级 970d9fbc
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册