summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2021-11-09 17:24:59 -0600
committerCommit Bot <commit-bot@chromium.org>2021-11-18 04:51:54 +0000
commit6fe661db731627a0d2ef82cef4bed594dce469ec (patch)
tree29de8937abdd30f47439386715bc53d64f20dc11
parent34f01d9aec1eb5a71843080e11c47ca3acaaffcb (diff)
downloadchrome-ec-6fe661db731627a0d2ef82cef4bed594dce469ec.tar.gz
Revert "ec_gpio: Add GPIO power down support"
This reverts commit 5b6ec95320d231fb15a9ec69e2eefeb5eed1fd25. BUG=b:200823466 TEST=make buildall -j Change-Id: I651c326be626788ddba7ad2cebe6c473a7d12d9a Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273438 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
-rw-r--r--common/gpio.c33
-rw-r--r--include/config.h6
-rw-r--r--include/gpio.h13
3 files changed, 0 insertions, 52 deletions
diff --git a/common/gpio.c b/common/gpio.c
index 76dbf58e14..cb3723f865 100644
--- a/common/gpio.c
+++ b/common/gpio.c
@@ -162,39 +162,6 @@ int gpio_get_ternary(enum gpio_signal signal)
return pu && !pd ? 2 : pd;
}
-#ifdef CONFIG_GPIO_POWER_DOWN
-/*
- * Power down a group of GPIO pins marked with a module ID
- * in board/board_name/gpio.inc
- * Hibernation/sleep entry:
- * gpio_power_down_module(MODULE_xxxx)
- * Chip level code will power down all pins in module.
- * Wake:
- * Use gpio_config_module to put the module pin(s)
- * back to enabled state. Chip level code will re-power
- * and configure the pin(s).
- * This mechanism does not handle dynamic changing of
- * pin configuration at run time.
- */
-int gpio_power_down_module(enum module_id id)
-{
- const struct gpio_alt_func *af;
- int rv = EC_ERROR_INVAL;
-
- /* Find pins and power down */
- for (af = gpio_alt_funcs;
- af < gpio_alt_funcs + ARRAY_SIZE(gpio_alt_funcs); af++) {
- if (af->module_id != id)
- continue; /* Pins for some other module */
-
- gpio_set_flags_by_mask(af->port, af->mask, GPIO_POWER_DOWN);
- rv = EC_SUCCESS;
- }
-
- return rv;
-}
-#endif /* #ifdef CONFIG_GPIO_POWER_DOWN */
-
__attribute__((weak)) void gpio_set_wakepin(enum gpio_signal signal,
uint32_t flags)
{
diff --git a/include/config.h b/include/config.h
index 75193567c6..c3ad6cacd3 100644
--- a/include/config.h
+++ b/include/config.h
@@ -1203,12 +1203,6 @@
#undef CONFIG_IO_EXPANDER
/*
- * EC's supporting powering down GPIO pins.
- * Add flag GPIO_POWER_DOWN and additional API's.
- */
-#undef CONFIG_GPIO_POWER_DOWN
-
-/*
* Provide common runtime layer code (tasks, hooks ...)
* You want this unless you are doing a really tiny firmware.
*/
diff --git a/include/gpio.h b/include/gpio.h
index b45c47d413..b0291b40f1 100644
--- a/include/gpio.h
+++ b/include/gpio.h
@@ -37,9 +37,6 @@
#define GPIO_HIB_WAKE_LOW BIT(20) /* Hibernate wake on low level */
#define GPIO_HIB_WAKE_RISING BIT(21) /* Hibernate wake on rising edge */
#define GPIO_HIB_WAKE_FALLING BIT(22) /* Hibernate wake on falling edge */
-#ifdef CONFIG_GPIO_POWER_DOWN
-#define GPIO_POWER_DOWN BIT(23) /* Pin and pad is powered off */
-#endif
/* Common flag combinations */
#define GPIO_OUT_LOW (GPIO_OUTPUT | GPIO_LOW)
@@ -280,16 +277,6 @@ void gpio_set_flags_by_mask(uint32_t port, uint32_t mask, uint32_t flags);
*/
void gpio_set_alternate_function(uint32_t port, uint32_t mask, int func);
-#ifdef CONFIG_GPIO_POWER_DOWN
-/**
- * Power down all GPIO pins in a module.
- *
- * @param id Module ID to initialize
- * @return EC_SUCCESS, or non-zero if module_id is not found.
- */
-int gpio_power_down_module(enum module_id id);
-#endif
-
/**
* Configure a GPIO as wake source on a given condition and enable it, or
* disable it.