summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-10-17 15:05:04 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-10-23 21:27:40 +0000
commit2ad076f8a02c8a3165a76dfb093cefd79fdbfc67 (patch)
tree13f9d0505f564f07c9867aabf11b7083613666d4 /common
parent8cf03ac0563294fbdeca2dc133d06f0b51c9a546 (diff)
downloadchrome-ec-2ad076f8a02c8a3165a76dfb093cefd79fdbfc67.tar.gz
cleanup: Rename and move header files
Device-specific headers belong in driver/ or chip/. The include/ directory should be for common interfaces. Code should not normally need to include driver-specific headers. If it does, it should use the full relative path from the EC project root (for example, drivers/charger/bq24715.h). Change-Id: Id23db37a431e2d802a74ec601db6f69b613352ba Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/173746 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/extpower_falco.c2
-rw-r--r--common/extpower_kirby.c2
-rw-r--r--common/extpower_spring.c5
-rw-r--r--common/temp_sensor.c13
4 files changed, 7 insertions, 15 deletions
diff --git a/common/extpower_falco.c b/common/extpower_falco.c
index abcfadfa14..815d76edfb 100644
--- a/common/extpower_falco.c
+++ b/common/extpower_falco.c
@@ -18,10 +18,10 @@
#include "battery_smart.h"
#include "charge_state.h"
#include "charger.h"
-#include "charger_bq24738.h"
#include "chipset.h"
#include "common.h"
#include "console.h"
+#include "driver/charger/bq24738.h"
#include "extpower.h"
#include "extpower_falco.h"
#include "hooks.h"
diff --git a/common/extpower_kirby.c b/common/extpower_kirby.c
index a10e42b1d3..1eb16607ae 100644
--- a/common/extpower_kirby.c
+++ b/common/extpower_kirby.c
@@ -9,12 +9,12 @@
#include "charger.h"
#include "chipset.h"
#include "console.h"
+#include "driver/tsu6721.h"
#include "extpower.h"
#include "gpio.h"
#include "hooks.h"
#include "task.h"
#include "timer.h"
-#include "tsu6721.h"
#include "util.h"
/* Console output macros */
diff --git a/common/extpower_spring.c b/common/extpower_spring.c
index 2e14d82e13..14bc864cf1 100644
--- a/common/extpower_spring.c
+++ b/common/extpower_spring.c
@@ -6,10 +6,12 @@
/* USB charging control for spring board */
#include "adc.h"
+#include "adc_chip.h"
#include "battery.h"
#include "chipset.h"
#include "clock.h"
#include "console.h"
+#include "driver/tsu6721.h"
#include "extpower.h"
#include "gpio.h"
#include "hooks.h"
@@ -17,12 +19,11 @@
#include "keyboard_protocol.h"
#include "pmu_tpschrome.h"
#include "pwm.h"
+/* TODO(rspangler): files in common should not use chip registers directly */
#include "registers.h"
-#include "stm32_adc.h"
#include "system.h"
#include "task.h"
#include "timer.h"
-#include "tsu6721.h"
#include "util.h"
#define PWM_FREQUENCY 32000 /* Hz */
diff --git a/common/temp_sensor.c b/common/temp_sensor.c
index 221219bce9..9be87d9ece 100644
--- a/common/temp_sensor.c
+++ b/common/temp_sensor.c
@@ -5,24 +5,15 @@
/* Temperature sensor module for Chrome EC */
-#include "chip_temp_sensor.h"
-#include "chipset.h"
#include "common.h"
#include "console.h"
-#include "gpio.h"
-#include "i2c.h"
#include "hooks.h"
#include "host_command.h"
-#include "peci.h"
#include "task.h"
#include "temp_sensor.h"
#include "timer.h"
-#include "tmp006.h"
#include "util.h"
-/* Default temperature to report in mapped memory */
-#define MAPPED_TEMP_DEFAULT (296 - EC_TEMP_SENSOR_OFFSET)
-
int temp_sensor_read(enum temp_sensor_id id, int *temp_ptr)
{
const struct temp_sensor_t *sensor;
@@ -82,10 +73,10 @@ static void temp_sensor_init(void)
base_b = host_get_memmap(EC_MEMMAP_TEMP_SENSOR_B);
for (i = 0; i < TEMP_SENSOR_COUNT; ++i) {
if (i < EC_TEMP_SENSOR_ENTRIES)
- base[i] = MAPPED_TEMP_DEFAULT;
+ base[i] = EC_TEMP_SENSOR_DEFAULT;
else
base_b[i - EC_TEMP_SENSOR_ENTRIES] =
- MAPPED_TEMP_DEFAULT;
+ EC_TEMP_SENSOR_DEFAULT;
}
/* Set the rest of memory region to SENSOR_NOT_PRESENT */