From 36c6ea2a056e7a878c93dd466b0996b157d14226 Mon Sep 17 00:00:00 2001 From: yj Date: Sat, 26 Jan 2013 10:29:04 +0800 Subject: [PATCH] LR097: enable reboot system when shutdown with dc plug in --- arch/arm/mach-rk30/board-rk3168-LR097.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-rk30/board-rk3168-LR097.c b/arch/arm/mach-rk30/board-rk3168-LR097.c index 6c91ed7a73ee..779325cd4004 100755 --- a/arch/arm/mach-rk30/board-rk3168-LR097.c +++ b/arch/arm/mach-rk30/board-rk3168-LR097.c @@ -2015,7 +2015,7 @@ static struct rk29_keys_button key_button[] = { { .desc = "vol-", .code = KEY_VOLUMEDOWN, - .adc_value = 170, + .adc_value = 145, .gpio = INVALID_GPIO, .active_low = PRESS_LEV_LOW, }, @@ -2090,7 +2090,18 @@ static void rk30_pm_power_off(void) #if defined(CONFIG_REGULATOR_ACT8846) if(pmic_is_act8846()) { - act8846_device_shutdown(); + printk("enter dcdet:"); + if(gpio_get_value (RK30_PIN0_PB2) == GPIO_LOW) + { + printk("with dc:enter restart system\n"); + arm_pm_restart(0, NULL); + } + else + { + printk("without dc,shutdown system\n"); + act8846_device_shutdown(); + while(1); + } } #endif -- 2.34.1