summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorli feng <li1.feng@intel.com>2015-02-10 16:34:42 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-04-14 19:08:06 +0000
commit26c777c5e0b7533378641f2ab681ea3587bc69ce (patch)
tree80ad0046138c71ee4269d6542a371be93e82938a
parent84e85bd6f0143ae1cb801fc56831ef522ba9f6e5 (diff)
downloadchrome-ec-26c777c5e0b7533378641f2ab681ea3587bc69ce.tar.gz
Strago: Enable and config charger BQ24770
BUG=None BRANCH=None TEST=Battery Charging was valitated. 1.Tested with a Dead Battery and saw it charging. 2.Battery Full charge condition was validated. Signed-off-by: li feng <li1.feng@intel.com> Change-Id: If81d700aff2b929f8f8fc183fea4bdece00c4a46 Signed-off-by: Divya Jyothi <divya.jyothi@intel.com> Reviewed-on: https://chromium-review.googlesource.com/265541 Tested-by: Kevin K Wong <kevin.k.wong@intel.com> Reviewed-by: Shawn N <shawnn@chromium.org> Commit-Queue: Kevin K Wong <kevin.k.wong@intel.com>
-rw-r--r--board/strago/board.c6
-rw-r--r--board/strago/board.h14
-rw-r--r--board/strago/ec.tasklist9
3 files changed, 25 insertions, 4 deletions
diff --git a/board/strago/board.c b/board/strago/board.c
index 586eac8552..06628fcae6 100644
--- a/board/strago/board.c
+++ b/board/strago/board.c
@@ -4,6 +4,7 @@
*/
/* Strago board-specific configuration */
+#include "charger.h"
#include "driver/temp_sensor/tmp432.h"
#include "extpower.h"
#include "gpio.h"
@@ -64,3 +65,8 @@ struct ec_thermal_config thermal_params[] = {
{{0, 0, 0}, 0, 0}, /* TMP432_Sensor_2 */
};
BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT);
+
+int board_discharge_on_ac(int enable)
+{
+ return charger_discharge_on_ac(enable);
+}
diff --git a/board/strago/board.h b/board/strago/board.h
index 4a46c8745c..b8d4b8a132 100644
--- a/board/strago/board.h
+++ b/board/strago/board.h
@@ -34,6 +34,16 @@
#define CONFIG_TEMP_SENSOR
#define CONFIG_TEMP_SENSOR_TMP432
+#define CONFIG_CHARGER
+#define CONFIG_BATTERY_SMART
+#define CONFIG_CHARGER_V2
+#define CONFIG_CHARGER_BQ24770
+#define CONFIG_CHARGER_ILIM_PIN_DISABLED
+#define CONFIG_CHARGER_SENSE_RESISTOR 10
+#define CONFIG_CHARGER_SENSE_RESISTOR_AC 10
+#define CONFIG_CHARGER_INPUT_CURRENT 2240
+#define CONFIG_CHARGER_DISCHARGE_ON_AC
+
#define CONFIG_I2C
/* I2C ports */
@@ -77,6 +87,10 @@ enum temp_sensor_id {
TEMP_SENSOR_COUNT
};
+
+/* Discharge battery when on AC power for factory test. */
+int board_discharge_on_ac(int enable);
+
#endif /* !__ASSEMBLER__ */
#endif /* __BOARD_H */
diff --git a/board/strago/ec.tasklist b/board/strago/ec.tasklist
index bee345cf29..354d7e45fc 100644
--- a/board/strago/ec.tasklist
+++ b/board/strago/ec.tasklist
@@ -18,9 +18,10 @@
*/
#define CONFIG_TASK_LIST \
TASK_ALWAYS(HOOKS, hook_task, NULL, TASK_STACK_SIZE) \
+ TASK_ALWAYS(CHARGER, charger_task, NULL, TASK_STACK_SIZE) \
+ TASK_NOTEST(CHIPSET, chipset_task, NULL, TASK_STACK_SIZE) \
+ TASK_NOTEST(KEYPROTO, keyboard_protocol_task, NULL, TASK_STACK_SIZE) \
TASK_ALWAYS(HOSTCMD, host_command_task, NULL, TASK_STACK_SIZE) \
+ TASK_ALWAYS(CONSOLE, console_task, NULL, TASK_STACK_SIZE) \
TASK_ALWAYS(POWERBTN, power_button_task, NULL, TASK_STACK_SIZE) \
- TASK_NOTEST(KEYPROTO, keyboard_protocol_task, NULL, TASK_STACK_SIZE) \
- TASK_NOTEST(KEYSCAN, keyboard_scan_task, NULL, TASK_STACK_SIZE) \
- TASK_NOTEST(CHIPSET, chipset_task, NULL, TASK_STACK_SIZE) \
- TASK_ALWAYS(CONSOLE, console_task, NULL, TASK_STACK_SIZE)
+ TASK_NOTEST(KEYSCAN, keyboard_scan_task, NULL, TASK_STACK_SIZE)