summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2012-04-25 22:28:22 +0000
committerVincent Palatin <vpalatin@chromium.org>2012-04-25 23:59:23 +0000
commit93a4ed6bcdaef3b36865b04a41c3e26ffd96108c (patch)
tree1860d7ead8631bada8186be966aba1ace5bc0e51
parentf93b95cac9ee4cb5baeeac21e6010404c7c71385 (diff)
downloadchrome-ec-93a4ed6bcdaef3b36865b04a41c3e26ffd96108c.tar.gz
Fix test configurations build errors
fix small modularity issues to ensure we are able to compile all boards in "tests" configuration. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:8546 TEST=make BOARD=link tests && make BOARD=bds tests make BOARD=daisy tests && make BOARD=adv tests && make BOARD=discovery tests Change-Id: I9eed0195af6bfd3b47ef74e3cb27966c4365c345
-rw-r--r--board/adv/board.c7
-rw-r--r--board/bds/board.h3
-rw-r--r--board/bds/board_temp_sensor.c4
-rw-r--r--board/bds/build.mk2
-rw-r--r--board/daisy/board.c7
-rw-r--r--board/daisy/board.h3
-rw-r--r--board/discovery/board.c4
-rw-r--r--board/link/board.h2
-rw-r--r--board/link/board_temp_sensor.c6
-rw-r--r--board/link/build.mk2
-rw-r--r--chip/stm32l/build.mk4
-rw-r--r--common/build.mk6
-rw-r--r--common/message.c2
13 files changed, 37 insertions, 15 deletions
diff --git a/board/adv/board.c b/board/adv/board.c
index 364cc59031..1569c42c35 100644
--- a/board/adv/board.c
+++ b/board/adv/board.c
@@ -14,7 +14,14 @@
#define GPIO_KB_OUTPUT (GPIO_OUTPUT | GPIO_PULL_UP | GPIO_OPEN_DRAIN)
/* GPIO interrupt handlers prototypes */
+#ifndef CONFIG_TASK_GAIAPOWER
+#define gaia_power_event NULL
+#else
void gaia_power_event(enum gpio_signal signal);
+#endif
+#ifndef CONFIG_TASK_KEYSCAN
+#define matrix_interrupt NULL
+#endif
/* GPIO signal list. Must match order from enum gpio_signal. */
const struct gpio_info gpio_list[GPIO_COUNT] = {
diff --git a/board/bds/board.h b/board/bds/board.h
index 16c5f972b6..54d4a47c94 100644
--- a/board/bds/board.h
+++ b/board/bds/board.h
@@ -8,9 +8,6 @@
#ifndef __BOARD_H
#define __BOARD_H
-/* Config flags */
-#define CONFIG_LIGHTBAR
-
/* Fan PWM channels */
#define FAN_CH_KBLIGHT 1 /* Keyboard backlight */
#define FAN_CH_POWER_LED 3 /* Power adapter LED */
diff --git a/board/bds/board_temp_sensor.c b/board/bds/board_temp_sensor.c
index d519f8cc61..fbc82b7e46 100644
--- a/board/bds/board_temp_sensor.c
+++ b/board/bds/board_temp_sensor.c
@@ -20,12 +20,16 @@
* temp_sensor_id.
*/
const struct temp_sensor_t temp_sensors[TEMP_SENSOR_COUNT] = {
+#ifdef CONFIG_TASK_TEMPSENSOR
{"ECInternal", TEMP_SENSOR_POWER_NONE, TEMP_SENSOR_TYPE_BOARD,
chip_temp_sensor_get_val, 0},
+#endif
+#ifdef CONFIG_TMP006
{"CaseDie", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_BOARD,
tmp006_get_val, 0},
{"Object", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_CASE,
tmp006_get_val, 1},
+#endif
};
const struct tmp006_t tmp006_sensors[TMP006_COUNT] = {
diff --git a/board/bds/build.mk b/board/bds/build.mk
index 993dd04a05..b8e0572b53 100644
--- a/board/bds/build.mk
+++ b/board/bds/build.mk
@@ -10,4 +10,4 @@ CHIP:=lm4
board-y=board.o
board-$(CONFIG_CHARGER)+=dummy_charger.o
-board-$(CONFIG_TASK_TEMPSENSOR)+=board_temp_sensor.o
+board-y+=board_temp_sensor.o
diff --git a/board/daisy/board.c b/board/daisy/board.c
index 35cf55452f..3923fc3104 100644
--- a/board/daisy/board.c
+++ b/board/daisy/board.c
@@ -30,7 +30,14 @@
#define GPIO_KB_OUTPUT (GPIO_OUTPUT | GPIO_PULL_UP | GPIO_OPEN_DRAIN)
/* GPIO interrupt handlers prototypes */
+#ifndef CONFIG_TASK_GAIAPOWER
+#define gaia_power_event NULL
+#else
void gaia_power_event(enum gpio_signal signal);
+#endif
+#ifndef CONFIG_TASK_KEYSCAN
+#define matrix_interrupt NULL
+#endif
/* GPIO signal list. Must match order from enum gpio_signal. */
const struct gpio_info gpio_list[GPIO_COUNT] = {
diff --git a/board/daisy/board.h b/board/daisy/board.h
index 53b3cbca64..3466aa3476 100644
--- a/board/daisy/board.h
+++ b/board/daisy/board.h
@@ -14,9 +14,6 @@
/* Use USART1 as console serial port */
#define CONFIG_CONSOLE_UART 1
-#define CONFIG_SPI
-#define CONFIG_I2C
-
#define USB_CHARGE_PORT_COUNT 0
/* GPIO signal list */
diff --git a/board/discovery/board.c b/board/discovery/board.c
index cda9af673d..491830164c 100644
--- a/board/discovery/board.c
+++ b/board/discovery/board.c
@@ -12,6 +12,10 @@
#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH)
#define GPIO_KB_OUTPUT (GPIO_OUTPUT | GPIO_PULL_UP | GPIO_OPEN_DRAIN)
+#ifndef CONFIG_TASK_KEYSCAN
+#define matrix_interrupt NULL
+#endif
+
/* GPIO signal list. Must match order from enum gpio_signal. */
const struct gpio_info gpio_list[GPIO_COUNT] = {
/* Inputs with interrupt handlers are first for efficiency */
diff --git a/board/link/board.h b/board/link/board.h
index 8fcc6a1846..a01604a6ef 100644
--- a/board/link/board.h
+++ b/board/link/board.h
@@ -13,12 +13,10 @@
#define CONFIG_CHARGER
#define CONFIG_CHARGER_BQ24725
#define CONFIG_EOPTION
-#define CONFIG_LIGHTBAR
#define CONFIG_ONEWIRE
#define CONFIG_PECI
#define CONFIG_POWER_LED
#define CONFIG_PSTORE
-#define CONFIG_SMART_BATTERY
#define CONFIG_TASK_PROFILING
#define CONFIG_TMP006
#define CONFIG_USB_CHARGE
diff --git a/board/link/board_temp_sensor.c b/board/link/board_temp_sensor.c
index 35a5d3b4bb..2728f49dfa 100644
--- a/board/link/board_temp_sensor.c
+++ b/board/link/board_temp_sensor.c
@@ -27,6 +27,7 @@
* temp_sensor_id.
*/
const struct temp_sensor_t temp_sensors[TEMP_SENSOR_COUNT] = {
+#ifdef CONFIG_TMP006
{"I2C_CPU-Die", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_CPU,
tmp006_get_val, 0},
{"I2C_CPU-Object", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_CASE,
@@ -43,10 +44,15 @@ const struct temp_sensor_t temp_sensors[TEMP_SENSOR_COUNT] = {
tmp006_get_val, 6},
{"I2C_Charger-Object", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_CASE,
tmp006_get_val, 7},
+#endif
+#ifdef CONFIG_TASK_TEMPSENSOR
{"ECInternal", TEMP_SENSOR_POWER_NONE, TEMP_SENSOR_TYPE_BOARD,
chip_temp_sensor_get_val, 0},
+#endif
+#ifdef CONFIG_PECI
{"PECI", TEMP_SENSOR_POWER_CPU, TEMP_SENSOR_TYPE_CPU,
peci_temp_sensor_get_val, 0},
+#endif
};
const struct tmp006_t tmp006_sensors[TMP006_COUNT] = {
diff --git a/board/link/build.mk b/board/link/build.mk
index 545950e249..7ddc9b4f32 100644
--- a/board/link/build.mk
+++ b/board/link/build.mk
@@ -9,4 +9,4 @@
CHIP:=lm4
board-y=board.o
-board-$(CONFIG_TASK_TEMPSENSOR)+=board_temp_sensor.o
+board-y+=board_temp_sensor.o
diff --git a/chip/stm32l/build.mk b/chip/stm32l/build.mk
index cf2769480e..2fcf94114c 100644
--- a/chip/stm32l/build.mk
+++ b/chip/stm32l/build.mk
@@ -9,7 +9,7 @@
CORE:=cortex-m
chip-y=clock.o dma.o gpio.o hwtimer.o jtag.o system.o uart.o
-chip-$(CONFIG_SPI)+=spi.o
-chip-$(CONFIG_I2C)+=i2c.o
+chip-$(CONFIG_TASK_SPI_WORK)+=spi.o
+chip-$(CONFIG_TASK_I2C2_WORK)+=i2c.o
chip-$(CONFIG_TASK_WATCHDOG)+=watchdog.o
chip-$(CONFIG_TASK_KEYSCAN)+=keyboard_scan.o
diff --git a/common/build.mk b/common/build.mk
index dcece87b59..6595e5d263 100644
--- a/common/build.mk
+++ b/common/build.mk
@@ -12,16 +12,16 @@ common-$(CONFIG_BATTERY_ATL706486)+=battery_atl706486.o
common-$(CONFIG_CHARGER_BQ24725)+=charger_bq24725.o
common-$(CONFIG_EOPTION)+=eoption.o
common-$(CONFIG_FLASH)+=flash_common.o flash_commands.o
-common-$(CONFIG_LIGHTBAR)+=lightbar.o
common-$(CONFIG_LPC)+=port80.o host_event_commands.o
common-$(CONFIG_POWER_LED)+=power_led.o
common-$(CONFIG_PSTORE)+=pstore_commands.o
common-$(CONFIG_PWM)+=pwm_commands.o
-common-$(CONFIG_SMART_BATTERY)+=smart_battery.o charge_state.o \
- battery_precharge.o
common-$(CONFIG_TASK_GAIAPOWER)+=gaia_power.o
common-$(CONFIG_TASK_HOSTCMD)+=host_command.o
common-$(CONFIG_TASK_I8042CMD)+=i8042.o keyboard.o
+common-$(CONFIG_TASK_LIGHTBAR)+=lightbar.o
+common-$(CONFIG_TASK_POWERSTATE)+=smart_battery.o charge_state.o \
+ battery_precharge.o
common-$(CONFIG_TASK_TEMPSENSOR)+=temp_sensor.o
common-$(CONFIG_TASK_THERMAL)+=thermal.o thermal_commands.o
common-$(CONFIG_TASK_X86POWER)+=x86_power.o
diff --git a/common/message.c b/common/message.c
index 0040f479f4..76a451b55b 100644
--- a/common/message.c
+++ b/common/message.c
@@ -46,8 +46,10 @@ static int message_get_response(int cmd, uint8_t **buffp, int max_len)
case CMDC_ID:
*buffp = (char *)ec_id;
return sizeof(ec_id) - 1;
+#ifdef CONFIG_TASK_KEYSCAN
case CMDC_KEY_STATE:
return keyboard_get_scan(buffp, max_len);
+#endif
default:
return -1;
}