diff options
author | Andrew McRae <amcrae@google.com> | 2022-07-19 15:42:17 +1000 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-07-20 02:38:03 +0000 |
commit | 0dea801e9a72f4eb7b34dded8aeca80bda584fd0 (patch) | |
tree | 25f81d8b37b780d3b3b64d4ee0626e2c96905a66 /zephyr/projects/nissa/src/xivu/charger.c | |
parent | fba0a2092ae80395754ebb2a310024ce2e2eaaf5 (diff) | |
download | chrome-ec-0dea801e9a72f4eb7b34dded8aeca80bda584fd0.tar.gz |
nissa: Rearrange projects into sub-directories
Rearrange the projects into separate sub-directories
to improve clarity and separation.
BUG=none
TEST=zmake testall
BRANCH=none
Signed-off-by: Andrew McRae <amcrae@google.com>
Change-Id: I14c3324760d195807f831bd72bdbc129fe76912b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3771363
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Diffstat (limited to 'zephyr/projects/nissa/src/xivu/charger.c')
-rw-r--r-- | zephyr/projects/nissa/src/xivu/charger.c | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/zephyr/projects/nissa/src/xivu/charger.c b/zephyr/projects/nissa/src/xivu/charger.c deleted file mode 100644 index 459f6f1cff..0000000000 --- a/zephyr/projects/nissa/src/xivu/charger.c +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright 2022 The Chromium OS Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include <zephyr/logging/log.h> - -#include "battery.h" -#include "charger.h" -#include "charger/isl923x_public.h" -#include "console.h" -#include "extpower.h" -#include "usb_pd.h" -#include "nissa_common.h" - -LOG_MODULE_DECLARE(nissa, CONFIG_NISSA_LOG_LEVEL); - -int extpower_is_present(void) -{ - int port; - int rv; - bool acok; - - for (port = 0; port < board_get_usb_pd_port_count(); port++) { - rv = raa489000_is_acok(port, &acok); - if ((rv == EC_SUCCESS) && acok) - return 1; - } - - return 0; -} - -/* - * Xivu does not have a GPIO indicating whether extpower is present, - * so detect using the charger(s). - */ -__override void board_check_extpower(void) -{ - int extpower_present_p0; - int extpower_present_p1; - - if (pd_is_connected(0)) - extpower_present_p0 = extpower_is_present(); - else if (pd_is_connected(1)) - extpower_present_p1 = extpower_is_present(); - - gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_ec_acok_otg_c0), - extpower_present_p0); - gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_ec_acok_otg_c1), - extpower_present_p1); -} - -__override void board_hibernate(void) -{ - /* Shut down the chargers */ - if (board_get_usb_pd_port_count() == 2) - raa489000_hibernate(CHARGER_SECONDARY, true); - raa489000_hibernate(CHARGER_PRIMARY, true); - LOG_INF("Charger(s) hibernated"); - cflush(); -} |