baytrail: provide GPIO_ACPI_WAKE configuration

Previously the GPIO_ACPI_SCI meant generate an SCI
and wake the system. However, when using this configuration
for a device which has its interrupt line going to both
an interrupt pin and the wake pin SCIs are generated in
addition to the normal interrupt. This is unnecessary
and a waste of cpu cycles. Therefore provide the granularity
of waking but not generating an SCI. The GPIO_ACPI_SCI
still implies wake.

BUG=none
BRANCH=baytrail
TEST=Manually. Reconfigured pins with GPIO_ACPI_WAKE. Trackpad
     and keyboard still wake the system without causing SCIs.

Change-Id: I437cc4501726835aadc4abf9bbaea3daebf68775
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/184718
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
This commit is contained in:
Aaron Durbin 2014-02-03 16:46:08 -06:00 committed by chrome-internal-fetch
commit 44558c3346
2 changed files with 21 additions and 11 deletions

View file

@ -229,8 +229,17 @@
#define GPIO_FUNC6 GPIO_FUNC(6, PULL_DISABLE, 10K)
/* ACPI GPIO routing. Assume everything is externally pulled and negative edge
* triggered. */
* triggered. SCI implies WAKE, but WAKE doesn't imply SCI. */
#define GPIO_ACPI_SCI \
{ .pad_conf0 = PAD_PULL_DISABLE | PAD_CONFIG0_DEFAULT | PAD_FUNC0, \
.pad_conf1 = PAD_CONFIG1_DEFAULT, \
.pad_val = PAD_VAL_INPUT, \
.use_sel = GPIO_USE_LEGACY, \
.io_sel = GPIO_DIR_INPUT, \
.tne = 1, \
.sci = 1, \
.wake_en = 1, }
#define GPIO_ACPI_WAKE \
{ .pad_conf0 = PAD_PULL_DISABLE | PAD_CONFIG0_DEFAULT | PAD_FUNC0, \
.pad_conf1 = PAD_CONFIG1_DEFAULT, \
.pad_val = PAD_VAL_INPUT, \
@ -281,14 +290,15 @@ struct soc_gpio_map {
u32 pad_conf0;
u32 pad_conf1;
u32 pad_val;
u8 use_sel : 1;
u8 io_sel : 1;
u8 gp_lvl : 1;
u8 tpe : 1;
u8 tne : 1;
u8 wake_en : 1;
u8 smi : 1;
u8 is_gpio : 1;
u32 use_sel : 1;
u32 io_sel : 1;
u32 gp_lvl : 1;
u32 tpe : 1;
u32 tne : 1;
u32 wake_en : 1;
u32 smi : 1;
u32 is_gpio : 1;
u32 sci : 1;
} __attribute__ ((packed));
struct soc_gpio_config {

View file

@ -182,13 +182,13 @@ static void setup_gpio_route(const struct soc_gpio_map *sus,
/* SMI takes precedence and wake_en implies SCI. */
if (sus[i].smi) {
route_reg |= ROUTE_SMI << (2 * i);
} else if (sus[i].wake_en) {
} else if (sus[i].sci) {
route_reg |= ROUTE_SCI << (2 * i);
}
if (core[i].smi) {
route_reg |= ROUTE_SMI << (2 * (i + 8));
} else if (core[i].wake_en) {
} else if (core[i].sci) {
route_reg |= ROUTE_SCI << (2 * (i + 8));
}
}