diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2021-08-17 12:49:11 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-08-17 21:43:56 +0000 |
commit | 6c744430d9d4217958baec91c368b1c577ec9a9e (patch) | |
tree | 21db67dc9b75f6e9f4203c9ee273fbbc37decae6 | |
parent | 26226558f72567e8229d00e8890e2ed270b7b475 (diff) | |
download | chrome-ec-6c744430d9d4217958baec91c368b1c577ec9a9e.tar.gz |
CoachZ: Disable IRQ from CTN730 in RO
When PCHG isn't enabled in RO, a keyboard is disabled until another
USB device is plugged.
This patch restores PCHG in RO but disables it by assigning an
invalid value to the IRQ signal (GPIO_IH_COUNT). A PCHG task
will be started but will not run because there will be no event.
BUG=b:193223400, b:173235954
BRANCH=trogdor
TEST=On CoachZ, stylus charges in normal mode and doesn't charge in
recovery mode.
Change-Id: Icb5702474ac5ef74119455ab4879447cb7a963e4
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3100491
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r-- | board/coachz/board.c | 12 | ||||
-rw-r--r-- | board/coachz/board.h | 3 | ||||
-rw-r--r-- | board/coachz/ec.tasklist | 2 | ||||
-rw-r--r-- | board/coachz/gpio.inc | 2 |
4 files changed, 11 insertions, 8 deletions
diff --git a/board/coachz/board.c b/board/coachz/board.c index 71c45e635c..6b97944eca 100644 --- a/board/coachz/board.c +++ b/board/coachz/board.c @@ -50,7 +50,16 @@ static void ks_interrupt(enum gpio_signal s); #include "gpio_list.h" +/* + * Workaround for b/193223400. This disables the IRQ from CTN730. Fixing this + * here (using a rather awkward way) separates the fix from the common code. + */ #ifdef SECTION_IS_RW +#define GPIO_PCHG_P0 GPIO_WLC_IRQ_CONN +#else +#define GPIO_PCHG_P0 ARRAY_SIZE(gpio_irq_handlers) +#endif + extern struct pchg_drv ctn730_drv; struct pchg pchgs[] = { @@ -58,7 +67,7 @@ struct pchg pchgs[] = { .cfg = &(const struct pchg_config) { .drv = &ctn730_drv, .i2c_port = I2C_PORT_WLC, - .irq_pin = GPIO_WLC_IRQ_CONN, + .irq_pin = GPIO_PCHG_P0, .full_percent = 96, .block_size = 128, }, @@ -66,7 +75,6 @@ struct pchg pchgs[] = { }, }; const int pchg_count = ARRAY_SIZE(pchgs); -#endif /* GPIO Interrupt Handlers */ static void tcpc_alert_event(enum gpio_signal signal) diff --git a/board/coachz/board.h b/board/coachz/board.h index e4adcb6b49..c129500d25 100644 --- a/board/coachz/board.h +++ b/board/coachz/board.h @@ -65,12 +65,9 @@ #define GPIO_KS_OPEN GPIO_LID_INT_N_HALL2 /* WLC pins */ -#ifdef SECTION_IS_RW -#define GPIO_PCHG_P0 GPIO_WLC_IRQ_CONN #define CONFIG_PERIPHERAL_CHARGER #define CONFIG_DEVICE_EVENT #define CONFIG_CTN730 -#endif #ifndef __ASSEMBLER__ diff --git a/board/coachz/ec.tasklist b/board/coachz/ec.tasklist index 819bdb23f1..dc5b32b4cf 100644 --- a/board/coachz/ec.tasklist +++ b/board/coachz/ec.tasklist @@ -9,7 +9,7 @@ #define CONFIG_TASK_LIST \ TASK_ALWAYS(HOOKS, hook_task, NULL, ULTRA_TASK_STACK_SIZE) \ - TASK_ALWAYS_RW(PCHG, pchg_task, NULL, LARGER_TASK_STACK_SIZE) \ + TASK_ALWAYS(PCHG, pchg_task, NULL, LARGER_TASK_STACK_SIZE) \ TASK_ALWAYS(USB_CHG_P0, usb_charger_task, NULL, LARGER_TASK_STACK_SIZE) \ TASK_ALWAYS(USB_CHG_P1, usb_charger_task, NULL, LARGER_TASK_STACK_SIZE) \ TASK_NOTEST(CHIPSET, chipset_task, NULL, ULTRA_TASK_STACK_SIZE) \ diff --git a/board/coachz/gpio.inc b/board/coachz/gpio.inc index 2971a4abbc..8f5f1498a1 100644 --- a/board/coachz/gpio.inc +++ b/board/coachz/gpio.inc @@ -30,9 +30,7 @@ GPIO_INT(AP_SUSPEND, PIN(5, 7), GPIO_INT_BOTH, power_signal_interrupt) / GPIO_INT(DEPRECATED_AP_RST_REQ, PIN(C, 2), GPIO_INT_BOTH | GPIO_PULL_DOWN | GPIO_SEL_1P8V, power_signal_interrupt) /* Deprecated AP initiated reset indicator */ /* WLC interrupt. GPIO_PULL_DOWN ensures no IRQ when WLC chip is off. */ -#ifdef SECTION_IS_RW GPIO_INT(WLC_IRQ_CONN, PIN(7, 4), GPIO_INT_RISING | GPIO_PULL_DOWN, pchg_irq) -#endif /* * When switch-cap is off, the POWER_GOOD signal is floating. Need a pull-down |