summaryrefslogtreecommitdiff
path: root/power
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2017-05-03 13:44:18 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-05-17 19:06:31 -0700
commit760c89fe3746278c9324c981d0adf6d3e79562d0 (patch)
tree1eb56808de7c8e49cb209d77366545de19ace955 /power
parent120ce3eaa054bcdb3f2c33a0e11a6a821fea67ce (diff)
downloadchrome-ec-760c89fe3746278c9324c981d0adf6d3e79562d0.tar.gz
Fizz: Set up charge suppliers at boot
Fizz has two power sources: barrel jack and type-c port. It selects a power source at boot and does not dynamicall switch to the other ports after that. Fizz initializes all power suppliers of all ports to zero then initialize the source supplier (barrel jack or type-c port). When both sources are provided, it prefers a barrel jack. This detection is done by reading the voltage on PPVAR_PWR_IN. If barrel jack is detected as a sink, type-c port works as a source only. If type-c port is detected as a sink, type-c port works as a sink only. Fizz does not have a battery. So, battery module is removed. BUG=b:37573548,b:37316498 BRANCH=none TEST=Boot on both type-c & barrel jack. Change-Id: If4f5ff0c6019d06ac9dacb5dd365f5aa96bffef3 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/499547
Diffstat (limited to 'power')
-rw-r--r--power/intel_x86.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/power/intel_x86.c b/power/intel_x86.c
index c9e28f3d6f..f4b5251d00 100644
--- a/power/intel_x86.c
+++ b/power/intel_x86.c
@@ -180,7 +180,6 @@ enum power_state power_chipset_init(void)
enum power_state common_intel_x86_power_handle_state(enum power_state state)
{
- int tries = 0;
switch (state) {
case POWER_G3:
@@ -241,6 +240,9 @@ enum power_state common_intel_x86_power_handle_state(enum power_state state)
#endif
case POWER_G3S5:
+#ifdef CONFIG_CHARGER
+ {
+ int tries = 0;
/*
* Allow charger to be initialized for upto defined tries,
* in case we're trying to boot the AP with no battery.
@@ -257,6 +259,8 @@ enum power_state common_intel_x86_power_handle_state(enum power_state state)
chipset_force_shutdown();
return POWER_G3;
}
+ }
+#endif
/* Call hooks to initialize PMIC */
hook_notify(HOOK_CHIPSET_PRE_INIT);