summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorJustin TerAvest <teravest@chromium.org>2018-04-16 14:45:17 -0600
committerchrome-bot <chrome-bot@chromium.org>2018-04-17 04:02:24 -0700
commit6d5cccefa09d28d6b0f9c29799ccd5f8254b7e07 (patch)
treeb1759a8efcc7ccb03b600ccabc4f4c69704c7145 /driver
parentab94e7ac45d394fefc5cd3221401090a5f225734 (diff)
downloadchrome-ec-6d5cccefa09d28d6b0f9c29799ccd5f8254b7e07.tar.gz
yorp: Keep 5V rail high on jump to RW
The BQ24392 driver controls power on the PP5000_A rail so that BC1.2 detection can be performed when the AP is off. However, that rail is also controlled by the chipset task, so CONFIG_POWER_PP5000_CONTROL needs to be defined to keep 5V rail up when necessary. Calls to power_5v_enable() must only be done when the build has a chipset task (otherwise, that function is not defined). BRANCH=none BUG=b:77874283 TEST=Booted Yorp with software sync enabled Signed-off-by: Justin TerAvest <teravest@chromium.org> Change-Id: Ib75655944aa05e381da922da8e916dc5d4dd9f85 Reviewed-on: https://chromium-review.googlesource.com/1014397 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Divya S Sasidharan <divya.s.sasidharan@intel.com> Reviewed-by: Divya S Sasidharan <divya.s.sasidharan@intel.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r--driver/bc12/bq24392.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/driver/bc12/bq24392.c b/driver/bc12/bq24392.c
index 354305883a..3092f9f794 100644
--- a/driver/bc12/bq24392.c
+++ b/driver/bc12/bq24392.c
@@ -133,7 +133,7 @@ static void detect_or_power_down_ic(const int port)
if (vbus_present) {
/* Turn on the 5V rail to allow the chip to be powered. */
-#ifdef CONFIG_POWER_PP5000_CONTROL
+#if defined(CONFIG_POWER_PP5000_CONTROL) && defined(HAS_TASK_CHIPSET)
power_5v_enable(task_get_current(), 1);
#else
gpio_set_level(GPIO_EN_PP5000, 1);
@@ -141,8 +141,8 @@ static void detect_or_power_down_ic(const int port)
bc12_detect(port);
} else {
power_down_ic(port);
-#ifdef CONFIG_POWER_PP5000_CONTROL
/* Issue a request to turn off the rail. */
+#if defined(CONFIG_POWER_PP5000_CONTROL) && defined(HAS_TASK_CHIPSET)
power_5v_enable(task_get_current(), 0);
#else
gpio_set_level(GPIO_EN_PP5000, 0);