diff options
author | Randall Spangler <rspangler@chromium.org> | 2012-03-12 17:55:27 -0700 |
---|---|---|
committer | Randall Spangler <rspangler@chromium.org> | 2012-03-12 17:57:25 -0700 |
commit | b3798eaacd407b4a7a33c099d9461b9acbafc79d (patch) | |
tree | f1e8b3eaea152741bb5395d58968b017b5b4ea1a | |
parent | 9e3e87f802026d1762bb8865f5b2f9125039828f (diff) | |
download | chrome-ec-b3798eaacd407b4a7a33c099d9461b9acbafc79d.tar.gz |
GPIO changes for link proto1
Note that this moves the charger to a different I2C port. If you're
working on battery charging, you'll need to hack board.h in your local
repo to move it back.
Signed-off-by: Randall Spangler <rspangler@chromium.org>
BUG=chrome-os-partner:8458
TEST=manual
Change-Id: Id94ee2ce1ef6c973c1786037e07d0c64a89a9940
-rw-r--r-- | board/link/board.c | 6 | ||||
-rw-r--r-- | board/link/board.h | 9 | ||||
-rw-r--r-- | chip/lm4/i2c.c | 3 | ||||
-rw-r--r-- | common/x86_power.c | 13 |
4 files changed, 25 insertions, 6 deletions
diff --git a/board/link/board.c b/board/link/board.c index 607e1f7fcc..db2551f574 100644 --- a/board/link/board.c +++ b/board/link/board.c @@ -71,13 +71,15 @@ const struct gpio_info gpio_list[GPIO_COUNT] = { {"USB2_STATUSn", LM4_GPIO_E, (1<<1), 0, NULL}, {"WRITE_PROTECTn", LM4_GPIO_J, (1<<4), GPIO_INT_BOTH, power_button_interrupt}, - /* Outputs; all unasserted by default */ + /* Outputs; all unasserted by default except for reset signals */ {"CPU_PROCHOTn", LM4_GPIO_F, (1<<2), GPIO_OUT_HIGH, NULL}, {"ENABLE_1_5V_DDR", LM4_GPIO_H, (1<<5), GPIO_OUT_LOW, NULL}, {"ENABLE_BACKLIGHT", LM4_GPIO_H, (1<<4), GPIO_OUT_LOW, NULL}, + {"ENABLE_TOUCHPAD", LM4_GPIO_C, (1<<6), GPIO_OUT_LOW, NULL}, {"ENABLE_VCORE", LM4_GPIO_F, (1<<7), GPIO_OUT_LOW, NULL}, {"ENABLE_VS", LM4_GPIO_G, (1<<6), GPIO_OUT_LOW, NULL}, {"ENTERING_RW", LM4_GPIO_J, (1<<5), GPIO_OUT_LOW, NULL}, + {"LIGHTBAR_RESETn", LM4_GPIO_B, (1<<1), GPIO_OUT_LOW, NULL}, {"PCH_A20GATE", LM4_GPIO_Q, (1<<6), GPIO_OUT_LOW, NULL}, {"PCH_DPWROK", LM4_GPIO_G, (1<<0), GPIO_OUT_LOW, NULL}, {"PCH_HDA_SDO", LM4_GPIO_G, (1<<1), GPIO_OUT_LOW, NULL}, @@ -86,11 +88,11 @@ const struct gpio_info gpio_list[GPIO_COUNT] = { {"PCH_PWRBTNn", LM4_GPIO_G, (1<<7), GPIO_OUT_HIGH, NULL}, {"PCH_PWROK", LM4_GPIO_F, (1<<5), GPIO_OUT_LOW, NULL}, {"PCH_RCINn", LM4_GPIO_Q, (1<<7), GPIO_OUT_LOW, NULL}, - /* Exception: RSMRST# is asserted at power-on */ {"PCH_RSMRSTn", LM4_GPIO_F, (1<<1), GPIO_OUT_LOW, NULL}, {"PCH_SMIn", LM4_GPIO_F, (1<<4), GPIO_OUT_HIGH, NULL}, {"PCH_SUSACKn", LM4_GPIO_F, (1<<3), GPIO_OUT_HIGH, NULL}, {"SHUNT_1_5V_DDR", LM4_GPIO_F, (1<<6), GPIO_OUT_HIGH, NULL}, + {"TOUCHSCREEN_RESETn", LM4_GPIO_B, (1<<0), GPIO_OUT_LOW, NULL}, {"USB1_CTL1", LM4_GPIO_E, (1<<2), GPIO_OUT_LOW, NULL}, {"USB1_CTL2", LM4_GPIO_E, (1<<3), GPIO_OUT_LOW, NULL}, {"USB1_CTL3", LM4_GPIO_E, (1<<4), GPIO_OUT_LOW, NULL}, diff --git a/board/link/board.h b/board/link/board.h index 5c9bacc158..d8617f7ee9 100644 --- a/board/link/board.h +++ b/board/link/board.h @@ -85,7 +85,7 @@ enum adc_channel /* I2C ports */ #define I2C_PORT_BATTERY 0 -#define I2C_PORT_CHARGER 1 +#define I2C_PORT_CHARGER 0 /* Note: proto0 used port 1 */ #define I2C_PORT_THERMAL 5 #define I2C_PORT_LIGHTBAR 1 /* I2C port speeds in kbps */ @@ -138,9 +138,11 @@ enum gpio_signal { GPIO_CPU_PROCHOTn, /* Force CPU to think it's overheated */ GPIO_ENABLE_1_5V_DDR, /* Enable +1.5V_DDR supply */ GPIO_ENABLE_BACKLIGHT, /* Enable backlight power */ + GPIO_ENABLE_TOUCHPAD, /* Enable touchpad power */ GPIO_ENABLE_VCORE, /* Enable +CPU_CORE and +VGFX_CORE */ GPIO_ENABLE_VS, /* Enable VS power supplies */ GPIO_ENTERING_RW, /* Indicate when EC is entering RW code */ + GPIO_LIGHTBAR_RESETn, /* Reset lightbar controllers (Proto1+) */ GPIO_PCH_A20GATE, /* A20GATE signal to PCH */ GPIO_PCH_DPWROK, /* DPWROK signal to PCH */ GPIO_PCH_HDA_SDO, /* HDA_SDO signal to PCH; when high, ME @@ -153,8 +155,9 @@ enum gpio_signal { GPIO_PCH_RSMRSTn, /* Reset PCH resume power plane logic */ GPIO_PCH_SMIn, /* System management interrupt to PCH */ GPIO_PCH_SUSACKn, /* Acknowledge PCH SUSWARN# signal */ - GPIO_SHUNT_1_5V_DDR, /* Shunt +1.5V_DDR; may also enable +3V_TP - * depending on stuffing. */ + GPIO_SHUNT_1_5V_DDR, /* Shunt +1.5V_DDR (Proto0 only) */ + /* TODO: remove once we move to proto1 */ + GPIO_TOUCHSCREEN_RESETn, /* Reset touch screen (Proto1+) */ GPIO_USB1_CTL1, /* USB charger port 1 CTL1 output */ GPIO_USB1_CTL2, /* USB charger port 1 CTL2 output */ GPIO_USB1_CTL3, /* USB charger port 1 CTL3 output */ diff --git a/chip/lm4/i2c.c b/chip/lm4/i2c.c index 1018d4a7c6..5a2116a5a1 100644 --- a/chip/lm4/i2c.c +++ b/chip/lm4/i2c.c @@ -426,7 +426,8 @@ int i2c_init(void) /* Enable I2C modules and delay a few clocks */ LM4_SYSTEM_RCGCI2C |= (1 << I2C_PORT_THERMAL) | - (1 << I2C_PORT_BATTERY) | (1 << I2C_PORT_CHARGER); + (1 << I2C_PORT_BATTERY) | (1 << I2C_PORT_CHARGER) | + (1 << I2C_PORT_LIGHTBAR); scratch = LM4_SYSTEM_RCGCI2C; /* Configure GPIOs */ diff --git a/common/x86_power.c b/common/x86_power.c index b24e84035b..4435142fcd 100644 --- a/common/x86_power.c +++ b/common/x86_power.c @@ -277,6 +277,11 @@ void x86_power_task(void) gpio_set_level(GPIO_SHUNT_1_5V_DDR, 0); gpio_set_level(GPIO_ENABLE_1_5V_DDR, 1); + /* Enable touchpad power and take touchscreen out of + * reset, so they can wake the system from suspend. */ + gpio_set_level(GPIO_ENABLE_TOUCHPAD, 1); + gpio_set_level(GPIO_TOUCHSCREEN_RESETn, 1); + state = X86_S3; break; @@ -293,6 +298,8 @@ void x86_power_task(void) gpio_set_level(GPIO_ENABLE_VS, 1); /* Enable fan, now that +5VS is turned on */ + /* TODO: On proto1+, fan is on +5VALW, so we can leave + * it on all the time. */ pwm_enable_fan(1); /* Wait for non-core power rails good */ @@ -328,6 +335,8 @@ void x86_power_task(void) gpio_set_level(GPIO_PCH_RCINn, 0); /* Disable fan, since it's powered by +5VS */ + /* TODO: On proto1+, fan is on +5VALW, so we can leave + * it on all the time. */ pwm_enable_fan(0); /* Turn off power rails */ @@ -337,6 +346,10 @@ void x86_power_task(void) break; case X86_S3S5: + /* Disable touchpad power and reset touchscreen. */ + gpio_set_level(GPIO_ENABLE_TOUCHPAD, 0); + gpio_set_level(GPIO_TOUCHSCREEN_RESETn, 0); + /* Turn off power to RAM */ gpio_set_level(GPIO_ENABLE_1_5V_DDR, 0); gpio_set_level(GPIO_SHUNT_1_5V_DDR, 1); |