diff options
author | Grover Yen <Grover_Yen@wistron.com> | 2014-08-15 19:29:22 +0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-08-20 06:50:14 +0000 |
commit | d12d537725f0d113958efd576cefd6b81fb39b0b (patch) | |
tree | efbe9c05037a8d14871f5e02d5b9d22ec2575539 | |
parent | e802f2c00cf7c8bb4658c2263f883ed7a3f779b1 (diff) | |
download | chrome-ec-d12d537725f0d113958efd576cefd6b81fb39b0b.tar.gz |
cranky: Implement LAN power control.
Based on the code cloned from rambi, and
1.Apply PM6 as LAN power control pin.
2.Enable LAN power in S0 and S3.
BUG=chrome-os-partner:30749
BRANCH=none
TEST=make -j buildall, make -j tests
Change-Id: I27031b26f595cfcb790c919aff347eb310a626d5
Signed-off-by: Grover Yen <Grover_Yen@wistron.com>
Reviewed-on: https://chromium-review.googlesource.com/212598
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Mohammed Habibulla <moch@chromium.org>
-rw-r--r-- | board/cranky/board.c | 1 | ||||
-rw-r--r-- | board/cranky/board.h | 2 | ||||
-rwxr-xr-x | include/config.h | 5 | ||||
-rwxr-xr-x | power/baytrail.c | 10 |
4 files changed, 18 insertions, 0 deletions
diff --git a/board/cranky/board.c b/board/cranky/board.c index a2afa3b8e8..72ab476965 100644 --- a/board/cranky/board.c +++ b/board/cranky/board.c @@ -93,6 +93,7 @@ const struct gpio_info gpio_list[] = { {"ENABLE_BACKLIGHT", LM4_GPIO_M, (1<<7), GPIO_ODR_HIGH, NULL}, {"ENABLE_TOUCHPAD", LM4_GPIO_N, (1<<1), GPIO_OUT_LOW, NULL}, {"ENTERING_RW", LM4_GPIO_D, (1<<6), GPIO_OUT_LOW, NULL}, + {"LAN_POWER", LM4_GPIO_M, (1<<6), GPIO_OUT_LOW, NULL}, {"LPC_CLKRUN_L", LM4_GPIO_M, (1<<2), GPIO_ODR_HIGH, NULL}, {"PCH_CORE_PWROK", LM4_GPIO_F, (1<<5), GPIO_OUT_LOW, NULL}, {"PCH_PWRBTN_L", LM4_GPIO_H, (1<<0), GPIO_ODR_HIGH, NULL}, diff --git a/board/cranky/board.h b/board/cranky/board.h index b82daac1c8..967b54ec5e 100644 --- a/board/cranky/board.h +++ b/board/cranky/board.h @@ -29,6 +29,7 @@ #define CONFIG_KEYBOARD_COL2_INVERTED #define CONFIG_KEYBOARD_IRQ_GPIO GPIO_KBD_IRQ_L #define CONFIG_KEYBOARD_PROTOCOL_8042 +#define CONFIG_LAN_POWER_S3 GPIO_LAN_POWER #define CONFIG_LED_COMMON #define CONFIG_LOW_POWER_IDLE #undef CONFIG_PECI @@ -109,6 +110,7 @@ enum gpio_signal { GPIO_ENABLE_BACKLIGHT, /* Enable backlight power */ GPIO_ENABLE_TOUCHPAD, /* Enable touchpad power */ GPIO_ENTERING_RW, /* Indicate when EC is entering RW code */ + GPIO_LAN_POWER, /* Enable LAN power supplies*/ GPIO_LPC_CLKRUN_L, /* Request that PCH drive LPC clock */ GPIO_PCH_CORE_PWROK, /* Indicate core well power is stable */ GPIO_PCH_PWRBTN_L, /* Power button output to PCH */ diff --git a/include/config.h b/include/config.h index bd6bb63c87..839bc6d9b1 100755 --- a/include/config.h +++ b/include/config.h @@ -888,6 +888,11 @@ #undef CONFIG_WIRELESS_SUSPEND /* + * Support LAN controller be powered in suspend (S3). + */ +#undef CONFIG_LAN_POWER_S3 + +/* * Write protect signal is active-high. If this is defined, there must be a * GPIO named GPIO_WP; if not defined, there must be a GPIO names GPIO_WP_L. */ diff --git a/power/baytrail.c b/power/baytrail.c index 16764dd803..f6320812bd 100755 --- a/power/baytrail.c +++ b/power/baytrail.c @@ -227,6 +227,11 @@ enum power_state power_handle_state(enum power_state state) */ gpio_set_level(GPIO_ENABLE_TOUCHPAD, 1); +#ifdef CONFIG_LAN_POWER_S3 + /* Turn on LAN controller power */ + gpio_set_level(CONFIG_LAN_POWER_S3, 1); +#endif + /* Call hooks now that rails are up */ hook_notify(HOOK_CHIPSET_STARTUP); return POWER_S3; @@ -384,6 +389,11 @@ enum power_state power_handle_state(enum power_state state) gpio_set_level(GPIO_ENABLE_TOUCHPAD, 0); gpio_set_level(GPIO_TOUCHSCREEN_RESET_L, 0); +#ifdef CONFIG_LAN_POWER_S3 + /* Turn off LAN controller power */ + gpio_set_level(CONFIG_LAN_POWER_S3, 0); +#endif + /* Turn off power to RAM */ gpio_set_level(GPIO_PP1350_EN, 0); |