summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2019-06-19 13:33:28 -0700
committerCommit Bot <commit-bot@chromium.org>2019-06-20 21:06:15 +0000
commitf6c19aec0dbbf42091b494ad9ccb4916ac7e6951 (patch)
tree02e250bf6f844a3f4fb93accbff1adb65640de81
parent83be6d22cdfa82740802b6e7938bcc929102671e (diff)
downloadchrome-ec-f6c19aec0dbbf42091b494ad9ccb4916ac7e6951.tar.gz
intel_x86: Use common code to get power signal's level
Removed redundant code in intel_x86 and reusing the common code for getting power signal's level. BUG=none BRANCH=none TEST=make buildall -j Change-Id: I9cd550a2326456189a087459aeb8e6c88a8cad8e Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1667647 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r--include/power.h5
-rw-r--r--power/common.c2
-rw-r--r--power/intel_x86.c7
3 files changed, 7 insertions, 7 deletions
diff --git a/include/power.h b/include/power.h
index 7ce978478b..b2ca21d83d 100644
--- a/include/power.h
+++ b/include/power.h
@@ -89,6 +89,11 @@ uint32_t power_get_signals(void);
int power_signal_is_asserted(const struct power_signal_info *s);
/**
+ * Get the level of provided input signal.
+ */
+int power_signal_get_level(enum gpio_signal signal);
+
+/**
* Enable interrupt for provided input signal.
*/
int power_signal_enable_interrupt(enum gpio_signal signal);
diff --git a/power/common.c b/power/common.c
index 13c620a6b1..7dddd00682 100644
--- a/power/common.c
+++ b/power/common.c
@@ -76,7 +76,7 @@ static uint32_t hibernate_delay = CONFIG_HIBERNATE_DELAY_SEC;
static int pause_in_s5;
#endif
-static int power_signal_get_level(enum gpio_signal signal)
+int power_signal_get_level(enum gpio_signal signal)
{
#ifdef CONFIG_HOSTCMD_ESPI_VW_SLP_SIGNALS
/* Check signal is from GPIOs or VWs */
diff --git a/power/intel_x86.c b/power/intel_x86.c
index 0095cdcf3a..df1b4ee6f7 100644
--- a/power/intel_x86.c
+++ b/power/intel_x86.c
@@ -83,12 +83,7 @@ DECLARE_HOOK(HOOK_BATTERY_SOC_CHANGE, power_up_inhibited_cb, HOOK_PRIO_DEFAULT);
/* Get system sleep state through GPIOs or VWs */
static inline int chipset_get_sleep_signal(enum sys_sleep_state state)
{
-#ifdef CONFIG_HOSTCMD_ESPI_VW_SLP_SIGNALS
- if (espi_signal_is_vw(sleep_sig[state]))
- return espi_vw_get_wire(sleep_sig[state]);
- else
-#endif
- return gpio_get_level(sleep_sig[state]);
+ return power_signal_get_level(sleep_sig[state]);
}
#ifdef CONFIG_BOARD_HAS_RTC_RESET