cleanup: move board-specific battery files to board dirs

The battery files contain board-specific constants and a few small
methods like battery-detect and battery-cut.  Most of these aren't
reused across platforms.  The battery files have also been cleaned up
so those board-specific constants basically all that's left in them.

Where a file is used by a single board only, move it to
board/(boardname)/battery.c.  Batteries used by more than one board
(e.g. battery_link.c used by both link and bolt) are still in
common/battery_*.c, since that's cleaner than duplicating the file in
each board's directory.

No code changes, just moving files.

BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all boards and pass unit tests

Change-Id: I946c8eb874672c77f9b77105e5b900f98fa48d0f
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/169893
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Randall Spangler
2013-09-16 15:19:29 -07:00
committed by chrome-internal-fetch
parent 6aa88ffa4e
commit a95e80dd47
15 changed files with 22 additions and 59 deletions

View File

@@ -27,6 +27,7 @@
#define CONFIG_POWER_BUTTON_X86
#define CONFIG_WP_ACTIVE_HIGH
#define CONFIG_BATTERY_LINK
#define CONFIG_BATTERY_SMART
#define CONFIG_BACKLIGHT_X86
#define CONFIG_CHARGER

View File

@@ -9,4 +9,4 @@
# the IC is TI Stellaris LM4
CHIP:=lm4
board-y=board.o panel.o
board-y=board.o battery.o panel.o

View File

@@ -10,4 +10,4 @@ CHIP:=stm32
CHIP_FAMILY:=stm32l
CHIP_VARIANT:=stm32l15x
board-y=board.o
board-y=board.o battery.o

View File

@@ -10,6 +10,7 @@
/* Optional features */
#define CONFIG_BACKLIGHT_X86
#define CONFIG_BATTERY_LINK
#define CONFIG_BATTERY_SMART
#define CONFIG_BATTERY_VENDOR_PARAMS
#define CONFIG_BOARD_VERSION

View File

@@ -9,4 +9,4 @@
# the IC is TI Stellaris LM4
CHIP:=lm4
board-y=board.o
board-y=board.o battery.o

View File

@@ -9,4 +9,4 @@
# the IC is TI Stellaris LM4
CHIP:=lm4
board-y=board.o
board-y=board.o battery.o

View File

@@ -9,4 +9,4 @@ CHIP:=stm32
CHIP_FAMILY:=stm32f
CHIP_VARIANT:=stm32f100
board-y=board.o
board-y=board.o battery.o

View File

@@ -1,42 +0,0 @@
/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* Battery pack vendor provided charging profile
*/
#include "battery_pack.h"
#include "gpio.h"
/* FIXME: We need REAL values for all this stuff */
const struct battery_temperature_ranges bat_temp_ranges = {
.start_charging_min_c = 0,
.start_charging_max_c = 50,
.charging_min_c = 0,
.charging_max_c = 50,
.discharging_min_c = -20,
.discharging_max_c = 60,
};
static const struct battery_info info = {
/* Based on 3S1P, same as peppy */
.voltage_max = 12600,
.voltage_normal = 11100,
.voltage_min = 9000,
/* Pre-charge values. */
.precharge_current = 256, /* mA */
};
const struct battery_info *battery_get_info(void)
{
return &info;
}
/* FIXME: The smart battery should do the right thing - that's why it's
* called "smart". Do we really want to second-guess it? For now, let's not. */
void battery_vendor_params(struct batt_params *batt)
{
}

View File

@@ -11,19 +11,17 @@ common-y+=memory_commands.o shared_mem.o system_common.o hooks.o
common-y+=gpio_common.o version.o printf.o queue.o
common-y+=throttle_ap.o
common-$(BOARD_bolt)+=battery_link.o
common-$(BOARD_daisy)+=extpower_snow.o
common-$(BOARD_falco)+=battery_falco.o led_falco.o
common-$(BOARD_kirby)+=battery_kirby.o led_kirby.o
common-$(BOARD_link)+=battery_link.o
common-$(BOARD_peppy)+=battery_peppy.o led_common.o led_peppy.o
common-$(BOARD_slippy)+=battery_slippy.o led_slippy.o
common-$(BOARD_falco)+=led_falco.o
common-$(BOARD_kirby)+=led_kirby.o
common-$(BOARD_peppy)+=led_common.o led_peppy.o
common-$(BOARD_slippy)+=led_slippy.o
common-$(BOARD_snow)+=extpower_snow.o
common-$(BOARD_spring)+=battery_spring.o
common-$(CONFIG_BACKLIGHT_X86)+=backlight_x86.o
common-$(CONFIG_BATTERY_BQ20Z453)+=battery_bq20z453.o
common-$(CONFIG_BATTERY_BQ27541)+=battery.o battery_bq27541.o
common-$(CONFIG_BATTERY_LINK)+=battery_link.o
common-$(CONFIG_BATTERY_MOCK)+=mock_smart_battery.o mock_charger.o
common-$(CONFIG_BATTERY_SMART)+=battery.o smart_battery.o
common-$(CONFIG_CHARGER)+=charge_state.o charger_common.o

View File

@@ -55,11 +55,16 @@
/*****************************************************************************/
/* Battery config */
/* Compile support for the BQ20Z453 battery used on some of the ARM laptops */
#undef CONFIG_BATTERY_BQ20Z453
/* Compile support for the BQ27541 battery */
#undef CONFIG_BATTERY_BQ27541
/*
* Compile battery-specific code. Choose at most one.
*
* Note that some boards have their own unique battery constants / functions.
* In this case, those are provided in board/(boardname)/battery.c, and none of
* these are defined.
*/
#undef CONFIG_BATTERY_BQ20Z453 /* BQ20Z453 battery used on some ARM laptops */
#undef CONFIG_BATTERY_BQ27541 /* BQ27541 battery */
#undef CONFIG_BATTERY_LINK /* Battery used on Link, Bolt, etc. */
/* Compile mock battery support; used by tests. */
#undef CONFIG_BATTERY_MOCK