summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2019-04-18 15:22:22 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-04-20 03:58:32 -0700
commite25a0bc9539161c0222166b2d63057a4ecca4f7a (patch)
treed2ee14930b91eecbbdacd8dc1712d1b2d6db9554
parented6936cf4218f6c316615da1b9f3658a845ce24b (diff)
downloadchrome-ec-e25a0bc9539161c0222166b2d63057a4ecca4f7a.tar.gz
max14637: Add config guard to is_chg_det_activated
The function is_chg_det_activated() is only called if either CONFIG_CHARGE_RAMP_SW or CONFIG_CHARGE_RAMP_HW are defined. This function should be guarded by these same 2 config options. BUG=b:130197995 BRANCH=none TEST=Verfied that 'make -j BOARD=kohaku' builds successfully which does not have either RAMP_SW or RAMP_HW defined. Change-Id: I223f52413d9e4244d191fd40f0a0a0dd0a933ec2 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1574787 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
-rw-r--r--driver/bc12/max14637.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/driver/bc12/max14637.c b/driver/bc12/max14637.c
index 1990ad268f..26156480be 100644
--- a/driver/bc12/max14637.c
+++ b/driver/bc12/max14637.c
@@ -29,6 +29,7 @@
#define CPRINTS(format, args...) cprints(CC_USBPD, format, ## args)
+#if defined(CONFIG_CHARGE_RAMP_SW) || defined(CONFIG_CHARGE_RAMP_HW)
/**
* Returns true if the charger detect pin is activated.
*
@@ -41,6 +42,7 @@ static int is_chg_det_activated(const struct max14637_config_t * const cfg)
return !!gpio_get_level(cfg->chg_det_pin) ^
!!(cfg->flags & MAX14637_FLAGS_CHG_DET_ACTIVE_LOW);
}
+#endif
/**
* Activates the Chip Enable GPIO based on the enabled value.