diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-10-23 11:25:11 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-10-23 23:53:23 +0000 |
commit | 251a80add32509d258ada5dd5744371f50253b43 (patch) | |
tree | b5ac83771fcdbfd81705309fa3eefbbd185890cd | |
parent | 2ad076f8a02c8a3165a76dfb093cefd79fdbfc67 (diff) | |
download | chrome-ec-251a80add32509d258ada5dd5744371f50253b43.tar.gz |
throttle_ap.c should only be compiled if there's a chipset/power task
It doesn't need to be compiled if there would be nothing for it to talk to.
BUG=chrome-os-partner:20739
BRANCH=none
TEST=build all platforms, pass unit tests
comment out chipset task in Rambi ec.tasklist; code still compiles
Change-Id: I004364b8c1fdf02c420162b5ad2843068a26b452
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174302
-rw-r--r-- | common/build.mk | 3 | ||||
-rw-r--r-- | include/throttle_ap.h | 9 |
2 files changed, 9 insertions, 3 deletions
diff --git a/common/build.mk b/common/build.mk index bd1bccdc82..15669a5dfe 100644 --- a/common/build.mk +++ b/common/build.mk @@ -9,7 +9,6 @@ common-y=main.o util.o console_output.o uart_buffering.o common-y+=memory_commands.o shared_mem.o system.o hooks.o common-y+=gpio.o version.o printf.o queue.o -common-y+=throttle_ap.o common-$(CONFIG_BACKLIGHT_LID)+=backlight_lid.o # TODO(rspangler): Why do these include battery_common but the other batteries @@ -52,7 +51,7 @@ common-$(CONFIG_TEMP_SENSOR)+=temp_sensor.o thermal.o common-$(CONFIG_USB_PORT_POWER_DUMB)+=usb_port_power_dumb.o common-$(CONFIG_USB_PORT_POWER_SMART)+=usb_port_power_smart.o common-$(CONFIG_WIRELESS)+=wireless.o -common-$(HAS_TASK_CHIPSET)+=chipset.o +common-$(HAS_TASK_CHIPSET)+=chipset.o throttle_ap.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 diff --git a/include/throttle_ap.h b/include/throttle_ap.h index e66a5c6bec..54a4b9fc40 100644 --- a/include/throttle_ap.h +++ b/include/throttle_ap.h @@ -33,7 +33,6 @@ enum throttle_sources { THROTTLE_SRC_POWER, }; - /** * Enable/disable CPU throttling. * @@ -44,8 +43,16 @@ enum throttle_sources { * @param type Type of throttling desired * @param source Which task is requesting throttling */ +#ifdef HAS_TASK_CHIPSET void throttle_ap(enum throttle_level level, enum throttle_type type, enum throttle_sources source); +#else +static inline void throttle_ap(enum throttle_level level, + enum throttle_type type, + enum throttle_sources source) +{} +#endif + #endif /* __CROS_EC_THROTTLE_AP_H */ |