From 2d8d190c8394b43c0989cdb04a50cb48d4e1f8da Mon Sep 17 00:00:00 2001 From: Uri Mashiach Date: Thu, 19 Jan 2017 10:51:45 +0200 Subject: status_led: Kconfig migration Move all of the status LED feature to drivers/led/Kconfig. The LED status definitions were moved from the board configuration files to the defconfig files. TBD: Move all of the definitions in the include/status_led.h to the relevant board's defconfig files. Tested boards: CL-SOM-AM57x, CM-T335 Signed-off-by: Uri Mashiach --- board/corscience/tricorder/led.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'board/corscience/tricorder/led.c') diff --git a/board/corscience/tricorder/led.c b/board/corscience/tricorder/led.c index 30f2f50..00ffc00 100644 --- a/board/corscience/tricorder/led.c +++ b/board/corscience/tricorder/led.c @@ -23,16 +23,16 @@ void __led_init(led_id_t mask, int state) void __led_toggle(led_id_t mask) { int toggle_gpio = 0; -#ifdef STATUS_LED_BIT - if (!toggle_gpio && STATUS_LED_BIT & mask) +#ifdef CONFIG_LED_STATUS0 + if (!toggle_gpio && CONFIG_LED_STATUS_BIT & mask) toggle_gpio = TRICORDER_STATUS_LED_GREEN; #endif -#ifdef STATUS_LED_BIT1 - if (!toggle_gpio && STATUS_LED_BIT1 & mask) +#ifdef CONFIG_LED_STATUS1 + if (!toggle_gpio && CONFIG_LED_STATUS_BIT1 & mask) toggle_gpio = TRICORDER_STATUS_LED_YELLOW; #endif -#ifdef STATUS_LED_BIT2 - if (!toggle_gpio && STATUS_LED_BIT2 & mask) { +#ifdef CONFIG_LED_STATUS2 + if (!toggle_gpio && CONFIG_LED_STATUS_BIT2 & mask) { uint8_t val; twl4030_i2c_read_u8(TWL4030_CHIP_LED, TWL4030_LED_LEDEN, &val); @@ -51,23 +51,23 @@ void __led_toggle(led_id_t mask) void __led_set(led_id_t mask, int state) { -#ifdef STATUS_LED_BIT - if (STATUS_LED_BIT & mask) { +#ifdef CONFIG_LED_STATUS0 + if (CONFIG_LED_STATUS_BIT & mask) { gpio_request(TRICORDER_STATUS_LED_GREEN, ""); gpio_direction_output(TRICORDER_STATUS_LED_GREEN, 0); gpio_set_value(TRICORDER_STATUS_LED_GREEN, state); } #endif -#ifdef STATUS_LED_BIT1 - if (STATUS_LED_BIT1 & mask) { +#ifdef CONFIG_LED_STATUS1 + if (CONFIG_LED_STATUS_BIT1 & mask) { gpio_request(TRICORDER_STATUS_LED_YELLOW, ""); gpio_direction_output(TRICORDER_STATUS_LED_YELLOW, 0); gpio_set_value(TRICORDER_STATUS_LED_YELLOW, state); } #endif -#ifdef STATUS_LED_BIT2 - if (STATUS_LED_BIT2 & mask) { - if (STATUS_LED_OFF == state) +#ifdef CONFIG_LED_STATUS2 + if (CONFIG_LED_STATUS_BIT2 & mask) { + if (CONFIG_LED_STATUS_OFF == state) twl4030_i2c_write_u8(TWL4030_CHIP_LED, TWL4030_LED_LEDEN, 0); else -- cgit v1.1