}
#define POWER_ON_PIN RK29_PIN4_PA4
-extern void wm831x_power_off(void);
static void rk29_pm_power_off(void)
{
printk(KERN_ERR "rk29_pm_power_off start...\n");
+ gpio_direction_output(POWER_ON_PIN, GPIO_LOW);
#if defined(CONFIG_MFD_WM831X)
wm831x_device_shutdown(gWm831x);
#endif
while (1);
}
+static void rk29_pm_power_restart(void)
+{
+ printk("%s\n",__FUNCTION__);
+ mdelay(2);
+#if defined(CONFIG_MFD_WM831X)
+ wm831x_device_restart(gWm831x);
+#endif
+
+}
static void __init machine_rk29_board_init(void)
{
gpio_set_value(POWER_ON_PIN, GPIO_HIGH);
gpio_direction_output(POWER_ON_PIN, GPIO_HIGH);
pm_power_off = rk29_pm_power_off;
+ arm_pm_restart = rk29_pm_power_restart;
platform_add_devices(devices, ARRAY_SIZE(devices));
#ifdef CONFIG_I2C0_RK29
#endif
while (1);
}
+static void rk29_pm_power_restart(void)
+{
+ printk("%s\n",__FUNCTION__);
+ mdelay(2);
+#if defined(CONFIG_MFD_WM831X)
+ wm831x_device_restart(gWm831x);
+#endif
+
+}
static void __init machine_rk29_board_init(void)
{
gpio_set_value(POWER_ON_PIN, GPIO_HIGH);
gpio_direction_output(POWER_ON_PIN, GPIO_HIGH);
pm_power_off = rk29_pm_power_off;
+ arm_pm_restart = rk29_pm_power_restart;
platform_add_devices(devices, ARRAY_SIZE(devices));
#ifdef CONFIG_I2C0_RK29
EXPORT_SYMBOL_GPL(wm831x_device_shutdown);
+
+int wm831x_device_restart(struct wm831x *wm831x)
+{
+ wm831x_reg_write(wm831x,WM831X_RESET_ID, 0xffff);
+
+ return 0;
+}
+
+
MODULE_DESCRIPTION("Core support for the WM831X AudioPlus PMIC");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Mark Brown");
int wm831x_device_suspend(struct wm831x *wm831x);
int wm831x_device_resume(struct wm831x *wm831x);
int wm831x_device_shutdown(struct wm831x *wm831x);
+int wm831x_device_restart(struct wm831x *wm831x);
int wm831x_irq_init(struct wm831x *wm831x, int irq);
void wm831x_irq_exit(struct wm831x *wm831x);