EXYNOS: Add API for power reset and exit wakeup
authorRajeshwari Shinde <rajeshwari.s@samsung.com>
Thu, 4 Jul 2013 06:59:14 +0000 (12:29 +0530)
committerMinkyu Kang <mk7.kang@samsung.com>
Fri, 5 Jul 2013 08:06:54 +0000 (17:06 +0900)
This patch adds APIs to get power reset status and exit the wakeup condition for
both exynos5 and exynos4

Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
arch/arm/cpu/armv7/exynos/power.c
arch/arm/include/asm/arch-exynos/power.h

index 6375a81fd436386f2382b1c631bbd1ea1ad7fe8a..5d3bda2ad8ca45ec552d1b72b32fb3bbb09212a0 100644 (file)
@@ -140,3 +140,53 @@ void set_hw_thermal_trip(void)
                setbits_le32(&power->ps_hold_control, POWER_ENABLE_HW_TRIP);
        }
 }
+
+static uint32_t exynos5_get_reset_status(void)
+{
+       struct exynos5_power *power =
+               (struct exynos5_power *)samsung_get_base_power();
+
+       return power->inform1;
+}
+
+static uint32_t exynos4_get_reset_status(void)
+{
+       struct exynos4_power *power =
+               (struct exynos4_power *)samsung_get_base_power();
+
+       return power->inform1;
+}
+
+uint32_t get_reset_status(void)
+{
+       if (cpu_is_exynos5())
+               return exynos5_get_reset_status();
+       else
+               return  exynos4_get_reset_status();
+}
+
+static void exynos5_power_exit_wakeup(void)
+{
+       struct exynos5_power *power =
+               (struct exynos5_power *)samsung_get_base_power();
+       typedef void (*resume_func)(void);
+
+       ((resume_func)power->inform0)();
+}
+
+static void exynos4_power_exit_wakeup(void)
+{
+       struct exynos4_power *power =
+               (struct exynos4_power *)samsung_get_base_power();
+       typedef void (*resume_func)(void);
+
+       ((resume_func)power->inform0)();
+}
+
+void power_exit_wakeup(void)
+{
+       if (cpu_is_exynos5())
+               exynos5_power_exit_wakeup();
+       else
+               exynos4_power_exit_wakeup();
+}
index 3549667d91844b5a757e7831d2df552d3ba4223c..44ad8d339122e0d54938e568afd11a335d823c8f 100644 (file)
@@ -888,4 +888,16 @@ void set_ps_hold_ctrl(void);
  * source as XXTI
  */
 void set_xclkout(void);
+
+/*
+ *  Read inform1 to get the reset status.
+ *  @return: the value can be either S5P_CHECK_SLEEP or
+ *  S5P_CHECK_DIDLE or S5P_CHECK_LPA as stored in inform1
+ *  if none of these then its normal booting.
+ */
+uint32_t get_reset_status(void);
+
+
+/* Read the resume function and call it */
+void power_exit_wakeup(void);
 #endif