summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTing Shen <phoenixshen@google.com>2019-08-07 14:55:16 +0800
committerCommit Bot <commit-bot@chromium.org>2019-08-29 07:37:52 +0000
commit85288f987875b86a657909993dec0584c3d8797d (patch)
tree1c8d47ead6aa278f28d85df2795d08599967597e
parent2c49a96a9215d29d14e41dcc0554c6aa33e46d3a (diff)
downloadchrome-ec-85288f987875b86a657909993dec0584c3d8797d.tar.gz
jacuzzi: disable adc after board version detected
This CL reverts the change in CL:1416074 for devices without POGO pin. To reduce power consumption, we should to disable adc module if it's only used by one-off board/sku id init. For devices with pogo, keep adc enabled for device type detection. BUG=b:138180455 TEST=dut-power in G3, verify that power consumption is lower BRANCH=master Change-Id: I5ca69adf99bba91f86527e377a45e42b021ee310 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1741567 Reviewed-by: Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
-rw-r--r--baseboard/kukui/baseboard.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/baseboard/kukui/baseboard.c b/baseboard/kukui/baseboard.c
index 4e108fba54..98c0348c9f 100644
--- a/baseboard/kukui/baseboard.c
+++ b/baseboard/kukui/baseboard.c
@@ -4,6 +4,7 @@
*/
#include "adc.h"
+#include "adc_chip.h"
#include "gpio.h"
#include "timer.h"
@@ -99,6 +100,15 @@ int board_get_version(void)
}
}
+ /*
+ * For devices without pogo, Disable ADC module after we detect the
+ * board version, since this is the only thing ADC module needs to do
+ * for this board.
+ */
+ if (CONFIG_DEDICATED_CHARGE_PORT_COUNT == 0 &&
+ version != BOARD_VERSION_UNKNOWN)
+ adc_disable();
+
return version;
}