summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2013-04-24 14:39:53 -0700
committerChromeBot <chrome-bot@google.com>2013-04-24 16:32:58 -0700
commit0bfb7ddd0713b3476a077f905e96dfa9b1e22d86 (patch)
tree9624ef46c4442a77bfd1c025e95635c7b534e903
parent39b0f6ce0c86a2b8adf37624c08279bfe322686e (diff)
downloadchrome-ec-0bfb7ddd0713b3476a077f905e96dfa9b1e22d86.tar.gz
Replace generated CONFIG_TASK_ macros with HAS_TASK_
CONFIG_ macros should be set directly. Expanding the task names in the same way made it difficult to tell what was a configuration choice and what was due to changes in ec.tasklist BUG=chrome-os-partner:18343 TEST=build all, run link BRANCH=none Change-Id: Ib82e34f974238ee2dd216f33b701b6f4c6a4f1f1 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49098 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--Makefile2
-rw-r--r--board/daisy/board.h2
-rw-r--r--board/link/board.h4
-rw-r--r--board/pit/board.h2
-rw-r--r--board/snow/board.h2
-rw-r--r--board/spring/board.h2
-rw-r--r--chip/lm4/build.mk4
-rw-r--r--chip/lm4/flash.c2
-rw-r--r--chip/lm4/lpc.c4
-rw-r--r--chip/lm4/pwm.c6
-rw-r--r--chip/lm4/switch.c6
-rw-r--r--chip/stm32/build.mk4
-rw-r--r--common/build.mk14
-rw-r--r--common/flash_common.c6
-rw-r--r--common/gaia_power.c2
-rw-r--r--common/keyboard_8042.c4
-rw-r--r--common/keyboard_mkbp.c6
-rw-r--r--common/lightbar.c2
-rw-r--r--common/main.c2
-rw-r--r--common/system_common.c2
-rw-r--r--include/charge_state.h2
-rw-r--r--include/chipset.h4
-rw-r--r--include/keyboard_raw.h2
-rw-r--r--include/keyboard_scan.h4
-rw-r--r--include/power_led.h2
-rw-r--r--include/switch.h4
26 files changed, 48 insertions, 48 deletions
diff --git a/Makefile b/Makefile
index 51f8db91d3..2af1aa662f 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,7 @@ else
-Iboard/$(BOARD) -D"TASK_NOTEST(n, r, d, s)=n" \
-D"TASK_ALWAYS(n, r, d, s)=n" -imacros ec.tasklist)
endif
-_tsk_cfg:=$(foreach t,$(_tsk_lst) ,CONFIG_TASK_$(t))
+_tsk_cfg:=$(foreach t,$(_tsk_lst) ,HAS_TASK_$(t))
CPPFLAGS+=$(foreach t,$(_tsk_cfg),-D$(t))
_flag_cfg:=$(shell $(CPP) $(CPPFLAGS) -P -dN chip/$(CHIP)/config.h | \
grep -o "CONFIG_.*") \
diff --git a/board/daisy/board.h b/board/daisy/board.h
index 557f5c646d..2de4079f6f 100644
--- a/board/daisy/board.h
+++ b/board/daisy/board.h
@@ -20,7 +20,7 @@
/* Optional features */
#define CONFIG_BOARD_POST_GPIO_INIT
-#ifdef CONFIG_TASK_CHIPSET
+#ifdef HAS_TASK_CHIPSET
#define CONFIG_CHIPSET_GAIA
#endif
#define CONFIG_EXTPOWER_SNOW
diff --git a/board/link/board.h b/board/link/board.h
index 5e3003f452..f7ee5fba7c 100644
--- a/board/link/board.h
+++ b/board/link/board.h
@@ -19,12 +19,12 @@
#define CONFIG_BATTERY_LINK
#define CONFIG_CHARGER
#define CONFIG_CHARGER_BQ24725
-#ifdef CONFIG_TASK_CHIPSET
+#ifdef HAS_TASK_CHIPSET
#define CONFIG_CHIPSET_X86
#endif
#define CONFIG_CUSTOM_KEYSCAN
#define CONFIG_EXTPOWER_GPIO
-#ifdef CONFIG_TASK_KEYPROTO
+#ifdef HAS_TASK_KEYPROTO
#define CONFIG_KEYBOARD_PROTOCOL_8042
#endif
#define CONFIG_LID_SWITCH
diff --git a/board/pit/board.h b/board/pit/board.h
index 72987bc2dc..11cef6c319 100644
--- a/board/pit/board.h
+++ b/board/pit/board.h
@@ -23,7 +23,7 @@
/* Optional features */
#define CONFIG_BATTERY_BQ20Z453
#define CONFIG_BOARD_POST_GPIO_INIT
-#ifdef CONFIG_TASK_CHIPSET
+#ifdef HAS_TASK_CHIPSET
#define CONFIG_CHIPSET_GAIA
#endif
#define CONFIG_CMD_PMU
diff --git a/board/snow/board.h b/board/snow/board.h
index 36a55e94a4..7eae2ad3a5 100644
--- a/board/snow/board.h
+++ b/board/snow/board.h
@@ -25,7 +25,7 @@
#define CONFIG_BATTERY_BQ20Z453
#define CONFIG_BOARD_PRE_INIT
#define CONFIG_BOARD_POST_GPIO_INIT
-#ifdef CONFIG_TASK_CHIPSET
+#ifdef HAS_TASK_CHIPSET
#define CONFIG_CHIPSET_GAIA
#endif
#define CONFIG_CMD_PMU
diff --git a/board/spring/board.h b/board/spring/board.h
index 93b087e421..71248ef26e 100644
--- a/board/spring/board.h
+++ b/board/spring/board.h
@@ -25,7 +25,7 @@
#define CONFIG_ADC
#define CONFIG_BATTERY_BQ20Z453
#define CONFIG_BOARD_PRE_INIT
-#ifdef CONFIG_TASK_CHIPSET
+#ifdef HAS_TASK_CHIPSET
#define CONFIG_CHIPSET_GAIA
#endif
#define CONFIG_CMD_PMU
diff --git a/chip/lm4/build.mk b/chip/lm4/build.mk
index 9c70e50f82..6799fb64b7 100644
--- a/chip/lm4/build.mk
+++ b/chip/lm4/build.mk
@@ -22,6 +22,6 @@ chip-$(CONFIG_ONEWIRE)+=onewire.o
chip-$(CONFIG_PECI)+=peci.o
chip-$(CONFIG_PWM)+=pwm.o
chip-$(CONFIG_SPI)+=spi.o
-chip-$(CONFIG_TASK_KEYSCAN)+=keyboard_raw.o
-chip-$(CONFIG_TASK_SWITCH)+=switch.o
+chip-$(HAS_TASK_KEYSCAN)+=keyboard_raw.o
+chip-$(HAS_TASK_SWITCH)+=switch.o
chip-$(CONFIG_WATCHDOG)+=watchdog.o
diff --git a/chip/lm4/flash.c b/chip/lm4/flash.c
index 121936c26b..23e31a69f0 100644
--- a/chip/lm4/flash.c
+++ b/chip/lm4/flash.c
@@ -299,7 +299,7 @@ uint32_t flash_get_protect(void)
if (pstate.flags & PERSIST_FLAG_PROTECT_RO)
flags |= EC_FLASH_PROTECT_RO_AT_BOOT;
-#ifdef CONFIG_TASK_SWITCH
+#ifdef HAS_TASK_SWITCH
/* Check if write protect pin is asserted now */
if (switch_get_write_protect())
flags |= EC_FLASH_PROTECT_GPIO_ASSERTED;
diff --git a/chip/lm4/lpc.c b/chip/lm4/lpc.c
index 00f9e7273e..f3cbe41d12 100644
--- a/chip/lm4/lpc.c
+++ b/chip/lm4/lpc.c
@@ -514,7 +514,7 @@ static void lpc_interrupt(void)
/* Clear the interrupt bits we're handling */
LM4_LPC_LPCIC = mis;
-#ifdef CONFIG_TASK_HOSTCMD
+#ifdef HAS_TASK_HOSTCMD
/* Handle ACPI command and data writes */
st = LM4_LPC_ST(LPC_CH_ACPI);
if (st & LM4_LPC_ST_FRMH)
@@ -536,7 +536,7 @@ static void lpc_interrupt(void)
while (LM4_LPC_ST(LPC_CH_PORT80) & LM4_LPC_ST_FRMH)
port_80_write(LPC_POOL_PORT80[0]);
-#ifdef CONFIG_TASK_KEYPROTO
+#ifdef HAS_TASK_KEYPROTO
/* Handle keyboard interface writes */
st = LM4_LPC_ST(LPC_CH_KEYBOARD);
if (st & LM4_LPC_ST_FRMH)
diff --git a/chip/lm4/pwm.c b/chip/lm4/pwm.c
index 3dd4a19bed..e112d67b75 100644
--- a/chip/lm4/pwm.c
+++ b/chip/lm4/pwm.c
@@ -160,7 +160,7 @@ void pwm_set_fan_duty(int percent)
/* Always enable the fan */
pwm_enable_fan(1);
-#ifdef CONFIG_TASK_THERMAL
+#ifdef HAS_TASK_THERMAL
/* Disable thermal engine automatic fan control. */
thermal_control_fan(0);
#endif
@@ -223,7 +223,7 @@ static int command_fan_set(int argc, char **argv)
/* Always enable the fan */
pwm_enable_fan(1);
-#ifdef CONFIG_TASK_THERMAL
+#ifdef HAS_TASK_THERMAL
/* Disable thermal engine automatic fan control. */
thermal_control_fan(0);
#endif
@@ -297,7 +297,7 @@ int pwm_command_set_fan_target_rpm(struct host_cmd_handler_args *args)
{
const struct ec_params_pwm_set_fan_target_rpm *p = args->params;
-#ifdef CONFIG_TASK_THERMAL
+#ifdef HAS_TASK_THERMAL
thermal_control_fan(0);
#endif
pwm_set_rpm_mode(1);
diff --git a/chip/lm4/switch.c b/chip/lm4/switch.c
index 5c08ee4575..f323c81060 100644
--- a/chip/lm4/switch.c
+++ b/chip/lm4/switch.c
@@ -191,7 +191,7 @@ static void power_button_pressed(uint64_t tnow)
pwrbtn_state = PWRBTN_STATE_PRESSED;
tnext_state = tnow;
*memmap_switches |= EC_SWITCH_POWER_BUTTON_PRESSED;
-#ifdef CONFIG_TASK_KEYPROTO
+#ifdef HAS_TASK_KEYPROTO
keyboard_set_power_button(1);
#endif
host_set_single_event(EC_HOST_EVENT_POWER_BUTTON);
@@ -212,7 +212,7 @@ static void power_button_released(uint64_t tnow)
pwrbtn_state = PWRBTN_STATE_RELEASED;
tnext_state = tnow;
*memmap_switches &= ~EC_SWITCH_POWER_BUTTON_PRESSED;
-#ifdef CONFIG_TASK_KEYPROTO
+#ifdef HAS_TASK_KEYPROTO
keyboard_set_power_button(0);
#endif
}
@@ -373,7 +373,7 @@ static void state_machine(uint64_t tnow)
* Otherwise we could power on the AP only to shut it right
* back down due to insufficient battery.
*/
-#ifdef CONFIG_TASK_CHARGER
+#ifdef HAS_TASK_CHARGER
if (charge_get_state() == PWR_STATE_INIT)
break;
#endif
diff --git a/chip/stm32/build.mk b/chip/stm32/build.mk
index 949fffe470..b929958a54 100644
--- a/chip/stm32/build.mk
+++ b/chip/stm32/build.mk
@@ -14,7 +14,7 @@ chip-y+=jtag-$(CHIP_VARIANT).o clock-$(CHIP_VARIANT).o gpio-$(CHIP_VARIANT).o
chip-$(CONFIG_SPI)+=spi.o
chip-$(CONFIG_I2C)+=i2c.o
chip-$(CONFIG_WATCHDOG)+=watchdog.o
-chip-$(CONFIG_TASK_KEYSCAN)+=keyboard_raw.o
-chip-$(CONFIG_TASK_POWERLED)+=power_led.o
+chip-$(HAS_TASK_KEYSCAN)+=keyboard_raw.o
+chip-$(HAS_TASK_POWERLED)+=power_led.o
chip-$(CONFIG_FLASH)+=flash-$(CHIP_VARIANT).o
chip-$(CONFIG_ADC)+=adc.o
diff --git a/common/build.mk b/common/build.mk
index a0203eb2a7..3eb16d01a9 100644
--- a/common/build.mk
+++ b/common/build.mk
@@ -32,13 +32,13 @@ common-$(CONFIG_LPC)+=port80.o
common-$(CONFIG_ONEWIRE_LED)+=onewire_led.o
common-$(CONFIG_PSTORE)+=pstore_commands.o
common-$(CONFIG_SMART_BATTERY)+=smart_battery.o smart_battery_stub.o
-common-$(CONFIG_TASK_CHIPSET)+=chipset.o
-common-$(CONFIG_TASK_CONSOLE)+=console.o
-common-$(CONFIG_TASK_HOSTCMD)+=host_command.o host_event_commands.o
-common-$(CONFIG_TASK_KEYSCAN)+=keyboard_scan.o
-common-$(CONFIG_TASK_LIGHTBAR)+=lightbar.o
-common-$(CONFIG_TASK_THERMAL)+=thermal.o
-common-$(CONFIG_TASK_VBOOTHASH)+=sha256.o vboot_hash.o
+common-$(HAS_TASK_CHIPSET)+=chipset.o
+common-$(HAS_TASK_CONSOLE)+=console.o
+common-$(HAS_TASK_HOSTCMD)+=host_command.o host_event_commands.o
+common-$(HAS_TASK_KEYSCAN)+=keyboard_scan.o
+common-$(HAS_TASK_LIGHTBAR)+=lightbar.o
+common-$(HAS_TASK_THERMAL)+=thermal.o
+common-$(HAS_TASK_VBOOTHASH)+=sha256.o vboot_hash.o
common-$(CONFIG_TEMP_SENSOR)+=temp_sensor.o
common-$(CONFIG_TMP006)+=tmp006.o
common-$(CONFIG_TSU6721)+=tsu6721.o
diff --git a/common/flash_common.c b/common/flash_common.c
index 47938804cf..ff421ad2a7 100644
--- a/common/flash_common.c
+++ b/common/flash_common.c
@@ -49,7 +49,7 @@ test_mockable int flash_write(int offset, int size, const char *data)
if (flash_dataptr(offset, size, CONFIG_FLASH_WRITE_SIZE, NULL) < 0)
return EC_ERROR_INVAL; /* Invalid range */
-#ifdef CONFIG_TASK_VBOOTHASH
+#ifdef HAS_TASK_VBOOTHASH
vboot_hash_invalidate(offset, size);
#endif
@@ -61,7 +61,7 @@ test_mockable int flash_erase(int offset, int size)
if (flash_dataptr(offset, size, CONFIG_FLASH_ERASE_SIZE, NULL) < 0)
return EC_ERROR_INVAL; /* Invalid range */
-#ifdef CONFIG_TASK_VBOOTHASH
+#ifdef HAS_TASK_VBOOTHASH
vboot_hash_invalidate(offset, size);
#endif
@@ -303,7 +303,7 @@ static int flash_command_erase(struct host_cmd_handler_args *args)
return EC_RES_ACCESS_DENIED;
/* Indicate that we might be a while */
-#ifdef CONFIG_TASK_HOSTCMD
+#ifdef HAS_TASK_HOSTCMD
args->result = EC_RES_IN_PROGRESS;
host_send_response(args);
#endif
diff --git a/common/gaia_power.c b/common/gaia_power.c
index 4076e2b130..fe83b66efc 100644
--- a/common/gaia_power.c
+++ b/common/gaia_power.c
@@ -194,7 +194,7 @@ static int check_for_power_off_event(void)
pressed = 1;
}
-#ifdef CONFIG_TASK_KEYSCAN
+#ifdef HAS_TASK_KEYSCAN
/* Dis/Enable keyboard scanning when the power button state changes */
if (!pressed || pressed != power_button_was_pressed)
keyboard_scan_enable(!pressed);
diff --git a/common/keyboard_8042.c b/common/keyboard_8042.c
index 4a058a4f58..a65c935558 100644
--- a/common/keyboard_8042.c
+++ b/common/keyboard_8042.c
@@ -792,7 +792,7 @@ static void keyboard_special(uint16_t k)
static uint8_t s;
static const uint16_t a[] = {0xe048, 0xe048, 0xe050, 0xe050, 0xe04b,
0xe04d, 0xe04b, 0xe04d, 0x0030, 0x001e};
-#ifdef CONFIG_TASK_LIGHTBAR
+#ifdef HAS_TASK_LIGHTBAR
/* Lightbar demo mode: keyboard can fake the battery state */
switch (k) {
case 0xe048: /* up */
@@ -825,7 +825,7 @@ static void keyboard_special(uint16_t k)
if (s == ARRAY_SIZE(a)) {
s = 0;
-#ifdef CONFIG_TASK_LIGHTBAR
+#ifdef HAS_TASK_LIGHTBAR
lightbar_sequence(LIGHTBAR_KONAMI);
#endif
}
diff --git a/common/keyboard_mkbp.c b/common/keyboard_mkbp.c
index 235ac060f2..a77320f030 100644
--- a/common/keyboard_mkbp.c
+++ b/common/keyboard_mkbp.c
@@ -148,7 +148,7 @@ void keyboard_send_battery_key(void)
{
uint8_t state[KEYBOARD_COLS];
-#ifdef CONFIG_TASK_KEYSCAN
+#ifdef HAS_TASK_KEYSCAN
/* Copy debounced state and add battery pseudo-key */
memcpy(state, keyboard_scan_get_state(), sizeof(state));
#else
@@ -198,7 +198,7 @@ static void set_keyscan_config(const struct ec_mkbp_config *src,
struct ec_mkbp_protocol_config *dst,
uint32_t valid_mask, uint8_t new_flags)
{
-#ifdef CONFIG_TASK_KEYSCAN
+#ifdef HAS_TASK_KEYSCAN
struct keyboard_scan_config *ksc = keyboard_scan_get_config();
if (valid_mask & EC_MKBP_VALID_SCAN_PERIOD)
@@ -238,7 +238,7 @@ static void set_keyscan_config(const struct ec_mkbp_config *src,
static void get_keyscan_config(struct ec_mkbp_config *dst)
{
-#ifdef CONFIG_TASK_KEYSCAN
+#ifdef HAS_TASK_KEYSCAN
const struct keyboard_scan_config *ksc = keyboard_scan_get_config();
/* Copy fields from keyscan config to mkbp config */
diff --git a/common/lightbar.c b/common/lightbar.c
index f7dcc2572d..2a8bdf2478 100644
--- a/common/lightbar.c
+++ b/common/lightbar.c
@@ -268,7 +268,7 @@ static void get_battery_level(void)
if (demo_mode)
return;
-#ifdef CONFIG_TASK_CHARGER
+#ifdef HAS_TASK_CHARGER
pct = charge_get_percent();
st.battery_is_charging = (PWR_STATE_DISCHARGE != charge_get_state());
#endif
diff --git a/common/main.c b/common/main.c
index 2430caac79..bd1b6f4543 100644
--- a/common/main.c
+++ b/common/main.c
@@ -119,7 +119,7 @@ int main(void)
#ifdef CONFIG_EOPTION
eoption_init();
#endif
-#ifdef CONFIG_TASK_KEYSCAN
+#ifdef HAS_TASK_KEYSCAN
keyboard_scan_init();
#endif
diff --git a/common/system_common.c b/common/system_common.c
index 7d05eb355d..b47c9e318c 100644
--- a/common/system_common.c
+++ b/common/system_common.c
@@ -863,7 +863,7 @@ int host_command_reboot(struct host_cmd_handler_args *args)
return EC_RES_SUCCESS;
}
-#ifdef CONFIG_TASK_HOSTCMD
+#ifdef HAS_TASK_HOSTCMD
if (p.cmd == EC_REBOOT_JUMP_RO ||
p.cmd == EC_REBOOT_JUMP_RW ||
p.cmd == EC_REBOOT_COLD ||
diff --git a/include/charge_state.h b/include/charge_state.h
index 68ae1d08b4..d9816a7a9d 100644
--- a/include/charge_state.h
+++ b/include/charge_state.h
@@ -146,7 +146,7 @@ int charge_get_percent(void);
/**
* Return non-zero if discharging and battery so low we should shut down.
*/
-#ifdef CONFIG_TASK_CHARGER
+#ifdef HAS_TASK_CHARGER
int charge_want_shutdown(void);
#else
static inline int charge_want_shutdown(void) { return 0; }
diff --git a/include/chipset.h b/include/chipset.h
index fff954032a..03f5ef4318 100644
--- a/include/chipset.h
+++ b/include/chipset.h
@@ -34,7 +34,7 @@ enum chipset_state_mask {
CHIPSET_STATE_SOFT_OFF), /* Any off state */
};
-#ifdef CONFIG_TASK_CHIPSET
+#ifdef HAS_TASK_CHIPSET
/**
* Check if chipset is in a given state.
*
@@ -51,7 +51,7 @@ static inline int chipset_in_state(int state_mask)
}
#endif
-#ifdef CONFIG_TASK_CHIPSET
+#ifdef HAS_TASK_CHIPSET
/**
* Ask the chipset to exit the hard off state.
*
diff --git a/include/keyboard_raw.h b/include/keyboard_raw.h
index 339b5344cb..9bdd1cce8f 100644
--- a/include/keyboard_raw.h
+++ b/include/keyboard_raw.h
@@ -60,7 +60,7 @@ int keyboard_raw_read_rows(void);
*/
void keyboard_raw_enable_interrupt(int enable);
-#ifdef CONFIG_TASK_KEYSCAN
+#ifdef HAS_TASK_KEYSCAN
/**
* GPIO interrupt for raw keyboard input
diff --git a/include/keyboard_scan.h b/include/keyboard_scan.h
index 5ce76cfd1f..bc956cc685 100644
--- a/include/keyboard_scan.h
+++ b/include/keyboard_scan.h
@@ -55,7 +55,7 @@ enum boot_key {
BOOT_KEY_OTHER = -1, /* None of the above */
};
-#ifdef CONFIG_TASK_KEYSCAN
+#ifdef HAS_TASK_KEYSCAN
/**
* Return the key held down at boot time in addition to the keyboard-controlled
* reset keys. Returns BOOT_KEY_OTHER if none of the keys specifically checked
@@ -75,7 +75,7 @@ static inline enum boot_key keyboard_scan_get_boot_key(void)
*/
const uint8_t *keyboard_scan_get_state(void);
-#ifdef CONFIG_TASK_KEYSCAN
+#ifdef HAS_TASK_KEYSCAN
/**
* Enables/disables keyboard matrix scan.
*/
diff --git a/include/power_led.h b/include/power_led.h
index 12ab532bef..2871e73207 100644
--- a/include/power_led.h
+++ b/include/power_led.h
@@ -17,7 +17,7 @@ enum powerled_state {
POWERLED_STATE_COUNT
};
-#ifdef CONFIG_TASK_POWERLED
+#ifdef HAS_TASK_POWERLED
/**
* Set the power LED
diff --git a/include/switch.h b/include/switch.h
index e86711ca49..2cd732774e 100644
--- a/include/switch.h
+++ b/include/switch.h
@@ -11,7 +11,7 @@
#include "common.h"
#include "gpio.h"
-#ifdef CONFIG_TASK_SWITCH
+#ifdef HAS_TASK_SWITCH
/**
* Interrupt handler for switch inputs.
*
@@ -20,7 +20,7 @@
void switch_interrupt(enum gpio_signal signal);
#else
#define switch_interrupt NULL
-#endif /* CONFIG_TASK_SWITCH */
+#endif /* HAS_TASK_SWITCH */
/**
* Return non-zero if write protect signal is asserted.