summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorQuentin Schulz <[email protected]>2025-11-20 13:48:06 +0100
committerTom Rini <[email protected]>2026-03-18 13:07:36 -0600
commitfcbf81694c9399a71ac100b4de15089c3e09dd8c (patch)
tree1f990094541a531354af372ed4fd2e044227391a /drivers
parent765a126a2f1f5eff82276e9fecbb0745e9fce77b (diff)
led: remove legacy API
No user of the legacy LED API anymore (except Sunxi with the PinePhone but that is now a Sunxi-specific implementation), so let's remove anything related. Signed-off-by: Quentin Schulz <[email protected]>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/led/Kconfig323
-rw-r--r--drivers/misc/Makefile2
-rw-r--r--drivers/misc/gpio_led.c52
-rw-r--r--drivers/misc/status_led.c124
4 files changed, 0 insertions, 501 deletions
diff --git a/drivers/led/Kconfig b/drivers/led/Kconfig
index 1cd3638cb16..de95a1debdc 100644
--- a/drivers/led/Kconfig
+++ b/drivers/led/Kconfig
@@ -138,327 +138,4 @@ config SPL_LED_GPIO
This option is an SPL-variant of the LED_GPIO option.
See the help of LED_GPIO for details.
-config LED_STATUS
- bool "Enable legacy status LED API"
- depends on !LED
- help
- Allows common u-boot commands to use a board's leds to
- provide status for activities like booting and downloading files.
-
-if LED_STATUS
-
-# Hidden constants
-
-config LED_STATUS_OFF
- int
- default 0
-
-config LED_STATUS_BLINKING
- int
- default 1
-
-config LED_STATUS_ON
- int
- default 2
-
-# Hidden constants end
-
-config LED_STATUS_GPIO
- bool "GPIO status LED implementation"
- help
- The status LED can be connected to a GPIO pin. In such cases, the
- gpio_led driver can be used as a status LED backend implementation.
-
-config LED_STATUS_BOARD_SPECIFIC
- bool "Specific board"
- default y
- help
- LED support is only for a specific board.
-
-comment "LEDs parameters"
-
-config LED_STATUS0
- bool "Enable status LED 0"
-
-if LED_STATUS0
-
-config LED_STATUS_BIT
- int "identification"
- help
- CONFIG_LED_STATUS_BIT is passed into the __led_* functions to identify
- which LED is being acted on. As such, the chosen value must be unique
- with respect to the other CONFIG_LED_STATUS_BIT's. Mapping the value
- to a physical LED is the responsibility of the __led_* function.
-
-config LED_STATUS_STATE
- int "initial state"
- range LED_STATUS_OFF LED_STATUS_ON
- default LED_STATUS_OFF
- help
- Should be set one of the following:
- 0 - off
- 1 - blinking
- 2 - on
-
-config LED_STATUS_FREQ
- int "blink frequency"
- range 2 10
- default 2
- help
- The LED blink period calculated from LED_STATUS_FREQ:
- LED_STATUS_PERIOD = CONFIG_SYS_HZ/LED_STATUS_FREQ
- Values range: 2 - 10
-
-endif # LED_STATUS0
-
-config LED_STATUS1
- bool "Enable status LED 1"
-
-if LED_STATUS1
-
-config LED_STATUS_BIT1
- int "identification"
- help
- CONFIG_LED_STATUS_BIT1 is passed into the __led_* functions to
- identify which LED is being acted on. As such, the chosen value must
- be unique with respect to the other CONFIG_LED_STATUS_BIT's. Mapping
- the value to a physical LED is the responsibility of the __led_*
- function.
-
-config LED_STATUS_STATE1
- int "initial state"
- range LED_STATUS_OFF LED_STATUS_ON
- default LED_STATUS_OFF
- help
- Should be set one of the following:
- 0 - off
- 1 - blinking
- 2 - on
-
-config LED_STATUS_FREQ1
- int "blink frequency"
- range 2 10
- default 2
- help
- The LED blink period calculated from LED_STATUS_FREQ1:
- LED_STATUS_PERIOD1 = CONFIG_SYS_HZ/LED_STATUS_FREQ1
- Values range: 2 - 10
-
-endif # LED_STATUS1
-
-config LED_STATUS2
- bool "Enable status LED 2"
-
-if LED_STATUS2
-
-config LED_STATUS_BIT2
- int "identification"
- help
- CONFIG_LED_STATUS_BIT2 is passed into the __led_* functions to
- identify which LED is being acted on. As such, the chosen value must
- be unique with respect to the other CONFIG_LED_STATUS_BIT's. Mapping
- the value to a physical LED is the responsibility of the __led_*
- function.
-
-config LED_STATUS_STATE2
- int "initial state"
- range LED_STATUS_OFF LED_STATUS_ON
- default LED_STATUS_OFF
- help
- Should be set one of the following:
- 0 - off
- 1 - blinking
- 2 - on
-
-config LED_STATUS_FREQ2
- int "blink frequency"
- range 2 10
- default 2
- help
- The LED blink period calculated from LED_STATUS_FREQ2:
- LED_STATUS_PERIOD2 = CONFIG_SYS_HZ/LED_STATUS_FREQ2
- Values range: 2 - 10
-
-endif # LED_STATUS2
-
-config LED_STATUS3
- bool "Enable status LED 3"
-
-if LED_STATUS3
-
-config LED_STATUS_BIT3
- int "identification"
- help
- CONFIG_LED_STATUS_BIT3 is passed into the __led_* functions to
- identify which LED is being acted on. As such, the chosen value must
- be unique with respect to the other CONFIG_LED_STATUS_BIT's. Mapping
- the value to a physical LED is the responsibility of the __led_*
- function.
-
-config LED_STATUS_STATE3
- int "initial state"
- range LED_STATUS_OFF LED_STATUS_ON
- default LED_STATUS_OFF
- help
- Should be set one of the following:
- 0 - off
- 1 - blinking
- 2 - on
-
-config LED_STATUS_FREQ3
- int "blink frequency"
- range 2 10
- default 2
- help
- The LED blink period calculated from LED_STATUS_FREQ3:
- LED_STATUS_PERIOD3 = CONFIG_SYS_HZ/LED_STATUS_FREQ3
- Values range: 2 - 10
-
-endif # LED_STATUS3
-
-config LED_STATUS4
- bool "Enable status LED 4"
-
-if LED_STATUS4
-
-config LED_STATUS_BIT4
- int "identification"
- help
- CONFIG_LED_STATUS_BIT4 is passed into the __led_* functions to
- identify which LED is being acted on. As such, the chosen value must
- be unique with respect to the other CONFIG_LED_STATUS_BIT's. Mapping
- the value to a physical LED is the responsibility of the __led_*
- function.
-
-config LED_STATUS_STATE4
- int "initial state"
- range LED_STATUS_OFF LED_STATUS_ON
- default LED_STATUS_OFF
- help
- Should be set one of the following:
- 0 - off
- 1 - blinking
- 2 - on
-
-config LED_STATUS_FREQ4
- int "blink frequency"
- range 2 10
- default 2
- help
- The LED blink period calculated from LED_STATUS_FREQ4:
- LED_STATUS_PERIOD4 = CONFIG_SYS_HZ/LED_STATUS_FREQ4
- Values range: 2 - 10
-
-endif # LED_STATUS4
-
-config LED_STATUS5
- bool "Enable status LED 5"
-
-if LED_STATUS5
-
-config LED_STATUS_BIT5
- int "identification"
- help
- CONFIG_LED_STATUS_BIT5 is passed into the __led_* functions to
- identify which LED is being acted on. As such, the chosen value must
- be unique with respect to the other CONFIG_LED_STATUS_BIT's. Mapping
- the value to a physical LED is the responsibility of the __led_*
- function.
-
-config LED_STATUS_STATE5
- int "initial state"
- range LED_STATUS_OFF LED_STATUS_ON
- default LED_STATUS_OFF
- help
- Should be set one of the following:
- 0 - off
- 1 - blinking
- 2 - on
-
-config LED_STATUS_FREQ5
- int "blink frequency"
- range 2 10
- default 2
- help
- The LED blink period calculated from LED_STATUS_FREQ5:
- LED_STATUS_PERIOD5 = CONFIG_SYS_HZ/LED_STATUS_FREQ5
- Values range: 2 - 10
-
-endif # LED_STATUS5
-
-config LED_STATUS_BOOT_ENABLE
- bool "Enable BOOT LED"
- help
- Enable to turn an LED on when the board is booting.
-
-if LED_STATUS_BOOT_ENABLE
-
-config LED_STATUS_BOOT
- int "LED to light when the board is booting"
- help
- Valid enabled LED device number.
-
-endif # LED_STATUS_BOOT_ENABLE
-
-config LED_STATUS_RED_ENABLE
- bool "Enable red LED"
- help
- Enable red status LED.
-
-if LED_STATUS_RED_ENABLE
-
-config LED_STATUS_RED
- int "Red LED identification"
- help
- Valid enabled LED device number.
-
-endif # LED_STATUS_RED_ENABLE
-
-config LED_STATUS_YELLOW_ENABLE
- bool "Enable yellow LED"
- help
- Enable yellow status LED.
-
-if LED_STATUS_YELLOW_ENABLE
-
-config LED_STATUS_YELLOW
- int "Yellow LED identification"
- help
- Valid enabled LED device number.
-
-endif # LED_STATUS_YELLOW_ENABLE
-
-config LED_STATUS_BLUE_ENABLE
- bool "Enable blue LED"
- help
- Enable blue status LED.
-
-if LED_STATUS_BLUE_ENABLE
-
-config LED_STATUS_BLUE
- int "Blue LED identification"
- help
- Valid enabled LED device number.
-
-endif # LED_STATUS_BLUE_ENABLE
-
-config LED_STATUS_GREEN_ENABLE
- bool "Enable green LED"
- help
- Enable green status LED.
-
-if LED_STATUS_GREEN_ENABLE
-
-config LED_STATUS_GREEN
- int "Green LED identification"
- help
- Valid enabled LED device number (0-5).
-
-endif # LED_STATUS_GREEN_ENABLE
-
-config LED_STATUS_CMD
- bool "Enable status LED commands"
-
-endif # LED_STATUS
-
endmenu
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 1d950f7a0ab..e2170212e5a 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -48,8 +48,6 @@ obj-$(CONFIG_IHS_FPGA) += ihs_fpga.o
obj-$(CONFIG_IMX8) += imx8/
obj-$(CONFIG_IMX_ELE) += imx_ele/
obj-$(CONFIG_K3_FUSE) += k3_fuse.o
-obj-$(CONFIG_LED_STATUS) += status_led.o
-obj-$(CONFIG_LED_STATUS_GPIO) += gpio_led.o
obj-$(CONFIG_MPC83XX_SERDES) += mpc83xx_serdes.o
obj-$(CONFIG_$(PHASE_)LS2_SFP) += ls2_sfp.o
obj-$(CONFIG_$(PHASE_)MXC_OCOTP) += mxc_ocotp.o
diff --git a/drivers/misc/gpio_led.c b/drivers/misc/gpio_led.c
index e63689967a7..69b2e2f76bd 100644
--- a/drivers/misc/gpio_led.c
+++ b/drivers/misc/gpio_led.c
@@ -1,55 +1,3 @@
-/*
- * Status LED driver based on GPIO access conventions of Linux
- *
- * Copyright (C) 2010 Thomas Chou <[email protected]>
- * Licensed under the GPL-2 or later.
- */
-
-#include <status_led.h>
-#include <asm/gpio.h>
-
-#ifndef CFG_GPIO_LED_INVERTED_TABLE
-#define CFG_GPIO_LED_INVERTED_TABLE {}
-#endif
-
-static led_id_t gpio_led_inv[] = CFG_GPIO_LED_INVERTED_TABLE;
-
-static int gpio_led_gpio_value(led_id_t mask, int state)
-{
- int i, gpio_value = (state == CONFIG_LED_STATUS_ON);
-
- for (i = 0; i < ARRAY_SIZE(gpio_led_inv); i++) {
- if (gpio_led_inv[i] == mask)
- gpio_value = !gpio_value;
- }
-
- return gpio_value;
-}
-
-void __led_init(led_id_t mask, int state)
-{
- int gpio_value;
-
- if (gpio_request(mask, "gpio_led") != 0) {
- printf("%s: failed requesting GPIO%lu!\n", __func__, mask);
- return;
- }
-
- gpio_value = gpio_led_gpio_value(mask, state);
- gpio_direction_output(mask, gpio_value);
-}
-
-void __led_set(led_id_t mask, int state)
-{
- int gpio_value = gpio_led_gpio_value(mask, state);
-
- gpio_set_value(mask, gpio_value);
-}
-
-void __led_toggle(led_id_t mask)
-{
- gpio_set_value(mask, !gpio_get_value(mask));
-}
#ifdef CONFIG_GPIO_LED_STUBS
diff --git a/drivers/misc/status_led.c b/drivers/misc/status_led.c
deleted file mode 100644
index 3b1baa4f840..00000000000
--- a/drivers/misc/status_led.c
+++ /dev/null
@@ -1,124 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2000-2003
- * Wolfgang Denk, DENX Software Engineering, [email protected].
- */
-
-#include <status_led.h>
-#include <linux/types.h>
-
-/*
- * The purpose of this code is to signal the operational status of a
- * target which usually boots over the network; while running in
- * U-Boot, a status LED is blinking. As soon as a valid BOOTP reply
- * message has been received, the LED is turned off. The Linux
- * kernel, once it is running, will start blinking the LED again,
- * with another frequency.
- */
-
-/* ------------------------------------------------------------------------- */
-
-typedef struct {
- led_id_t mask;
- int state;
- int period;
- int cnt;
-} led_dev_t;
-
-led_dev_t led_dev[] = {
- { CONFIG_LED_STATUS_BIT,
- CONFIG_LED_STATUS_STATE,
- LED_STATUS_PERIOD,
- 0,
- },
-#if defined(CONFIG_LED_STATUS1)
- { CONFIG_LED_STATUS_BIT1,
- CONFIG_LED_STATUS_STATE1,
- LED_STATUS_PERIOD1,
- 0,
- },
-#endif
-#if defined(CONFIG_LED_STATUS2)
- { CONFIG_LED_STATUS_BIT2,
- CONFIG_LED_STATUS_STATE2,
- LED_STATUS_PERIOD2,
- 0,
- },
-#endif
-#if defined(CONFIG_LED_STATUS3)
- { CONFIG_LED_STATUS_BIT3,
- CONFIG_LED_STATUS_STATE3,
- LED_STATUS_PERIOD3,
- 0,
- },
-#endif
-#if defined(CONFIG_LED_STATUS4)
- { CONFIG_LED_STATUS_BIT4,
- CONFIG_LED_STATUS_STATE4,
- LED_STATUS_PERIOD4,
- 0,
- },
-#endif
-#if defined(CONFIG_LED_STATUS5)
- { CONFIG_LED_STATUS_BIT5,
- CONFIG_LED_STATUS_STATE5,
- LED_STATUS_PERIOD5,
- 0,
- },
-#endif
-};
-
-#define MAX_LED_DEV (sizeof(led_dev)/sizeof(led_dev_t))
-
-static int status_led_init_done = 0;
-
-void status_led_init(void)
-{
- led_dev_t *ld;
- int i;
-
- for (i = 0, ld = led_dev; i < MAX_LED_DEV; i++, ld++)
- __led_init (ld->mask, ld->state);
- status_led_init_done = 1;
-}
-
-void status_led_tick(ulong timestamp)
-{
- led_dev_t *ld;
- int i;
-
- if (!status_led_init_done)
- status_led_init();
-
- for (i = 0, ld = led_dev; i < MAX_LED_DEV; i++, ld++) {
-
- if (ld->state != CONFIG_LED_STATUS_BLINKING)
- continue;
-
- if (++ld->cnt >= ld->period) {
- __led_toggle (ld->mask);
- ld->cnt -= ld->period;
- }
-
- }
-}
-
-void status_led_set(int led, int state)
-{
- led_dev_t *ld;
-
- if (led < 0 || led >= MAX_LED_DEV)
- return;
-
- if (!status_led_init_done)
- status_led_init();
-
- ld = &led_dev[led];
-
- ld->state = state;
- if (state == CONFIG_LED_STATUS_BLINKING) {
- ld->cnt = 0; /* always start with full period */
- state = CONFIG_LED_STATUS_ON; /* always start with LED _ON_ */
- }
- __led_set (ld->mask, state);
-}