summaryrefslogtreecommitdiff
path: root/board/spring
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-10-04 12:38:18 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-10-07 18:30:50 +0000
commit99157c265c8353e166059e17d250d9991d4e7ae0 (patch)
tree386a582966b8b34afa652602a21eec6e6feab931 /board/spring
parent90a6676ad531fd8c53e6398050f8093a921245fc (diff)
downloadchrome-ec-99157c265c8353e166059e17d250d9991d4e7ae0.tar.gz
cleanup: Battery header files and filenames
battery.h is the high-level interface. battery_smart.h is the low-level interface. Most things don't need the low-level interface, but were including smart_battery.h solely to get at battery.h. Fixed this. Also merged battery_pack.h into battery.h, since it was odd to split that data across multiple header files. Tidied the function comments in battery.h as well. No functional changes, just renaming files and adding comments. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all boards; pass unit tests Change-Id: I5ef372f0a5f8f5f36e09a3a1ce24008685c1fd0d Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/171967 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'board/spring')
-rw-r--r--board/spring/battery.c13
-rw-r--r--board/spring/board.c11
-rw-r--r--board/spring/led.c3
3 files changed, 13 insertions, 14 deletions
diff --git a/board/spring/battery.c b/board/spring/battery.c
index 4604671b8e..c5a9393b01 100644
--- a/board/spring/battery.c
+++ b/board/spring/battery.c
@@ -5,14 +5,25 @@
* Smart battery driver for Spring.
*/
+#include "battery.h"
+#include "battery_smart.h"
#include "host_command.h"
#include "i2c.h"
-#include "smart_battery.h"
#include "util.h"
#define PARAM_CUT_OFF_LOW 0x10
#define PARAM_CUT_OFF_HIGH 0x00
+/* Battery temperature ranges in degrees C */
+const struct battery_temperature_ranges bat_temp_ranges = {
+ .start_charging_min_c = 5,
+ .start_charging_max_c = 45,
+ .charging_min_c = 5,
+ .charging_max_c = 60,
+ .discharging_min_c = 0,
+ .discharging_max_c = 100,
+};
+
int battery_command_cut_off(struct host_cmd_handler_args *args)
{
int rv;
diff --git a/board/spring/board.c b/board/spring/board.c
index 58cb4ed9bd..fd9acaf6d5 100644
--- a/board/spring/board.c
+++ b/board/spring/board.c
@@ -5,7 +5,6 @@
/* Spring board-specific configuration */
#include "adc.h"
-#include "battery_pack.h"
#include "board_config.h"
#include "chipset.h"
#include "common.h"
@@ -106,16 +105,6 @@ const struct gpio_alt_func gpio_alt_funcs[] = {
};
const int gpio_alt_funcs_count = ARRAY_SIZE(gpio_alt_funcs);
-/* Battery temperature ranges in degrees C */
-const struct battery_temperature_ranges bat_temp_ranges = {
- .start_charging_min_c = 5,
- .start_charging_max_c = 45,
- .charging_min_c = 5,
- .charging_max_c = 60,
- .discharging_min_c = 0,
- .discharging_max_c = 100,
-};
-
/* ADC channels */
const struct adc_t adc_channels[] = {
/*
diff --git a/board/spring/led.c b/board/spring/led.c
index 3d6e316426..a793afda33 100644
--- a/board/spring/led.c
+++ b/board/spring/led.c
@@ -5,14 +5,13 @@
* Battery LED state machine to drive RGB LED on LP5562
*/
+#include "battery.h"
#include "common.h"
-#include "ec_commands.h"
#include "extpower.h"
#include "hooks.h"
#include "host_command.h"
#include "lp5562.h"
#include "pmu_tpschrome.h"
-#include "smart_battery.h"
#include "timer.h"
#include "util.h"