diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2012-10-11 09:01:20 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-10-11 23:32:24 -0700 |
commit | fbc4c150d2c88d2f133286d588ceebf9c6d68ef9 (patch) | |
tree | 7d97d399e076e269ab513f084736b16496babc5d | |
parent | 07aa700e92d90f5471494491ef2abe6e684ff07f (diff) | |
download | chrome-ec-fbc4c150d2c88d2f133286d588ceebf9c6d68ef9.tar.gz |
stm32: make power led optional
The spring board doesn't have one and we doesn't want to mess up with
that pin.
When the POWERLED task is not present, let's de-activate cleanly that
code.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:14324
TEST=make BOARD=spring (no power_led.o compiled)
make BOARD=snow (power_led.o compiled)
make BOARD=link && make BOARD=bds
run on Snow and see the power LED working
Change-Id: Ib44f5df54ec4fdee1863814e6c7052fd6620fee8
Reviewed-on: https://gerrit.chromium.org/gerrit/35272
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | chip/stm32/build.mk | 3 | ||||
-rw-r--r-- | include/power_led.h | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/chip/stm32/build.mk b/chip/stm32/build.mk index ebce4cf35a..b58953e995 100644 --- a/chip/stm32/build.mk +++ b/chip/stm32/build.mk @@ -9,11 +9,12 @@ # STM32 SoC family has a Cortex-M3 ARM core CORE:=cortex-m -chip-y=dma.o gpio.o hwtimer.o power_led.o system.o uart.o +chip-y=dma.o gpio.o hwtimer.o system.o uart.o 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_TASK_WATCHDOG)+=watchdog.o chip-$(CONFIG_TASK_KEYSCAN)+=keyboard_scan.o +chip-$(CONFIG_TASK_POWERLED)+=power_led.o chip-$(CONFIG_FLASH)+=flash-$(CHIP_VARIANT).o chip-$(CONFIG_ADC)+=adc.o diff --git a/include/power_led.h b/include/power_led.h index b255c557bb..ccee086f70 100644 --- a/include/power_led.h +++ b/include/power_led.h @@ -31,10 +31,16 @@ enum powerled_config { POWERLED_CONFIG_PWM, }; +#if defined(CONFIG_TASK_POWERLED) || defined(CONFIG_POWER_LED) /* Set the power adapter LED to the specified color. */ int powerled_set(enum powerled_color color); /* Set the power LED according to the specified state. */ void powerled_set_state(enum powerled_state state); +#else /* CONFIG_TASK_POWERLED */ +static inline int powerled_set(enum powerled_color color) { return 0; } +static inline void powerled_set_state(enum powerled_state state) {} +#endif /* CONFIG_TASK_POWERLED */ + #endif /* __CROS_EC_POWER_LED_H */ |