#include <linux/mfd/wm831x/pdata.h>
#include <linux/mfd/wm831x/core.h>
#include <linux/mfd/wm831x/gpio.h>
+#include <linux/mfd/wm831x/pmu.h>
#include <mach/sram.h>
ret = wm831x_reg_read(parm, WM831X_POWER_STATE) & 0xffff;
wm831x_reg_write(parm, WM831X_POWER_STATE, (ret & 0xfff8) | 0x04);
+ wm831x_set_bits(parm, WM831X_RTC_CONTROL, WM831X_RTC_ALAM_ENA_MASK, 0x0400);//enable rtc alam
//BATT_FET_ENA = 1
wm831x_reg_write(parm, WM831X_SECURITY_KEY, 0x9716); // unlock security key
wm831x_set_bits(parm, WM831X_RESET_CONTROL, 0x1003, 0x1001);
printk("pre WM831X_POWER_STATE = 0x%x\n", wm831x_reg_read(wm831x, WM831X_POWER_STATE));
+ if(wm831x_set_bits(wm831x, WM831X_RTC_CONTROL, WM831X_RTC_ALAM_ENA_MASK, 0) < 0)
+ printk("%s wm831x_set_bits err\n", __FUNCTION__); //disable rtc alam
+
if (pdata && pdata->last_deinit) {
ret = pdata->last_deinit(wm831x);
if (ret != 0) {
dev_info(wm831x->dev, "last_deinit() failed: %d\n", ret);
}
}
-
//if(0 == reboot_cmd_get())
- {
+
if(wm831x_set_bits(wm831x, WM831X_POWER_STATE, WM831X_CHIP_ON_MASK, 0) < 0)
printk("%s wm831x_set_bits err\n", __FUNCTION__);
//printk("post WM831X_POWER_STATE = 0x%x\n", wm831x_reg_read(wm831x, WM831X_POWER_STATE));
- }
return 0;
}
#ifndef __MFD_WM831X_PMU_H__
#define __MFD_WM831X_PMU_H__
-
+/* rtc cntrol (0x4025) */
+#define WM831X_RTC_ALAM_ENA_MASK 0x0400
/*
* R16387 (0x4003) - Power State
*/