LR097: enable reboot system when shutdown with dc plug in
authoryj <yangjie@rock-chips.com>
Sat, 26 Jan 2013 02:29:04 +0000 (10:29 +0800)
committeryj <yangjie@rock-chips.com>
Sat, 26 Jan 2013 02:29:04 +0000 (10:29 +0800)
arch/arm/mach-rk30/board-rk3168-LR097.c

index 6c91ed7a73ee11a9fcdf6045c482f66099e1187b..779325cd40048ac222048a1af39ca5d962842a33 100755 (executable)
@@ -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