summaryrefslogtreecommitdiff
path: root/board
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
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')
-rw-r--r--board/daisy/board.c2
-rw-r--r--board/falco/battery.c4
-rw-r--r--board/host/battery.c (renamed from board/host/smart_battery.c)5
-rw-r--r--board/host/build.mk2
-rw-r--r--board/host/charger.c7
-rw-r--r--board/kirby/battery.c2
-rw-r--r--board/peppy/battery.c4
-rw-r--r--board/pit/board.c2
-rw-r--r--board/puppy/board.c2
-rw-r--r--board/slippy/battery.c2
-rw-r--r--board/snow/board.c2
-rw-r--r--board/spring/battery.c13
-rw-r--r--board/spring/board.c11
-rw-r--r--board/spring/led.c3
14 files changed, 29 insertions, 32 deletions
diff --git a/board/daisy/board.c b/board/daisy/board.c
index 24f4580143..be42ffcbd8 100644
--- a/board/daisy/board.c
+++ b/board/daisy/board.c
@@ -4,7 +4,7 @@
*/
/* Daisy board-specific configuration */
-#include "battery_pack.h"
+#include "battery.h"
#include "common.h"
#include "gaia_power.h"
#include "gpio.h"
diff --git a/board/falco/battery.c b/board/falco/battery.c
index 554e3cf7c2..9acac12c7b 100644
--- a/board/falco/battery.c
+++ b/board/falco/battery.c
@@ -5,9 +5,9 @@
* Battery pack vendor provided charging profile
*/
-#include "battery_pack.h"
+#include "battery.h"
+#include "battery_smart.h"
#include "host_command.h"
-#include "smart_battery.h"
#define SB_SHIP_MODE_DATA 0x0010
diff --git a/board/host/smart_battery.c b/board/host/battery.c
index 3465f83431..02fc263fc1 100644
--- a/board/host/smart_battery.c
+++ b/board/host/battery.c
@@ -5,12 +5,11 @@
* Smart battery driver.
*/
-#include "battery_pack.h"
+#include "battery.h"
+#include "battery_smart.h"
#include "common.h"
#include "console.h"
-#include "smart_battery.h"
#include "test_util.h"
-#include "uart.h"
#include "util.h"
static uint16_t mock_smart_battery[SB_MANUFACTURER_DATA + 1];
diff --git a/board/host/build.mk b/board/host/build.mk
index 42cd2f61b9..21e5383d86 100644
--- a/board/host/build.mk
+++ b/board/host/build.mk
@@ -10,4 +10,4 @@ CHIP:=host
board-y=board.o
board-$(HAS_TASK_CHIPSET)+=chipset.o
-board-$(CONFIG_BATTERY_MOCK)+=smart_battery.o charger.o
+board-$(CONFIG_BATTERY_MOCK)+=battery.o charger.o
diff --git a/board/host/charger.c b/board/host/charger.c
index f63eebbea3..d5396c7418 100644
--- a/board/host/charger.c
+++ b/board/host/charger.c
@@ -5,11 +5,10 @@
* Mock battery charger driver.
*/
+#include "battery_smart.h"
#include "charger.h"
#include "console.h"
#include "common.h"
-#include "smart_battery.h"
-#include "uart.h"
#include "util.h"
static const struct charger_info mock_charger_info = {
@@ -74,7 +73,7 @@ int charger_set_current(int current)
current = info->current_max;
if (mock_current != current)
- uart_printf("Charger set current: %d\n", current);
+ ccprintf("Charger set current: %d\n", current);
mock_current = current;
return EC_SUCCESS;
}
@@ -89,7 +88,7 @@ int charger_get_voltage(int *voltage)
int charger_set_voltage(int voltage)
{
mock_voltage = voltage;
- uart_printf("Charger set voltage: %d\n", voltage);
+ ccprintf("Charger set voltage: %d\n", voltage);
return EC_SUCCESS;
}
diff --git a/board/kirby/battery.c b/board/kirby/battery.c
index a149ba7aed..e57ac9b996 100644
--- a/board/kirby/battery.c
+++ b/board/kirby/battery.c
@@ -5,7 +5,7 @@
* Battery pack info for Kirby
*/
-#include "battery_pack.h"
+#include "battery.h"
/* Battery temperature ranges in degrees C */
const struct battery_temperature_ranges bat_temp_ranges = {
diff --git a/board/peppy/battery.c b/board/peppy/battery.c
index 59a7580bfc..2fd90823fb 100644
--- a/board/peppy/battery.c
+++ b/board/peppy/battery.c
@@ -5,10 +5,10 @@
* Battery pack vendor provided charging profile
*/
-#include "battery_pack.h"
+#include "battery.h"
+#include "battery_smart.h"
#include "gpio.h"
#include "host_command.h"
-#include "smart_battery.h"
#define SB_SHIP_MODE_ADDR 0x3a
#define SB_SHIP_MODE_DATA 0xc574
diff --git a/board/pit/board.c b/board/pit/board.c
index af7d12715f..9f4ca08a1e 100644
--- a/board/pit/board.c
+++ b/board/pit/board.c
@@ -4,7 +4,7 @@
*/
/* Pit board-specific configuration */
-#include "battery_pack.h"
+#include "battery.h"
#include "common.h"
#include "extpower.h"
#include "gaia_power.h"
diff --git a/board/puppy/board.c b/board/puppy/board.c
index 8be5a970a6..f874ed2ad5 100644
--- a/board/puppy/board.c
+++ b/board/puppy/board.c
@@ -4,7 +4,7 @@
*/
/* Puppy board-specific configuration */
-#include "battery_pack.h"
+#include "battery.h"
#include "common.h"
#include "extpower.h"
#include "gaia_power.h"
diff --git a/board/slippy/battery.c b/board/slippy/battery.c
index 75a179f291..27bb494343 100644
--- a/board/slippy/battery.c
+++ b/board/slippy/battery.c
@@ -5,7 +5,7 @@
* Battery pack vendor provided charging profile
*/
-#include "battery_pack.h"
+#include "battery.h"
#include "gpio.h"
/* FIXME: We need REAL values for all this stuff */
diff --git a/board/snow/board.c b/board/snow/board.c
index 4369956924..4120356175 100644
--- a/board/snow/board.c
+++ b/board/snow/board.c
@@ -4,7 +4,7 @@
*/
/* Snow board-specific configuration */
-#include "battery_pack.h"
+#include "battery.h"
#include "board_config.h"
#include "chipset.h"
#include "common.h"
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"