This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit afd7be0c8b7909fdf530219cce4d89fa73231568
Author: Kerogit <[email protected]>
AuthorDate: Fri Feb 27 23:23:05 2026 +0100

    drivers/leds: do not enforce SPI for non-SPI WS2812 driver variant
    
    There are two variants of WS2812 programmable LED driver. The older
    one only supports data transmission via SPI peripheral, the newer
    one can use any hardware supported by architecture-specific lower
    half.
    
    This patch changes the Kconfig settings for this driver so it only
    enforces CONFIG_SPI when the older variant is built. Previously,
    CONFIG_SPI was forced even when the newer variant was chosen.
    
    To achieve this, the top-level option now uses conditional selection
    (select SPI if !WS2812_NON_SPI_DRIVER), which preserves backwards
    compatibility while allowing non-SPI implementations to build without SPI.
    
    Signed-off-by: Kerogit <[email protected]>
---
 drivers/leds/Kconfig | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 5f0a1088d86..f84dc200724 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -172,7 +172,7 @@ config NCP5623C
 config WS2812
        bool "WS2812 LED Driver"
        default n
-       select SPI
+       select SPI if !WS2812_NON_SPI_DRIVER
        ---help---
                Enable support for the Worldsemi WS2812 LED driver which 
commonly
                found in LED strips.
@@ -180,9 +180,6 @@ config WS2812
                exclusive use of an SPI bus as ws2812 LEDs have no CS or
                RESET line.
 
-# NOTE: Once the older SPI driver is migrated to the new model
-#       we should remove the "select SPI" in the above config.
-
 config WS2812_NON_SPI_DRIVER
        bool "Support the new non-SPI WS2812 driver."
        default n
@@ -193,6 +190,13 @@ config WS2812_NON_SPI_DRIVER
                implementations.  Selecting this option builds the new
                model driver.
 
+               Note that this option's wording is somewhat misleading.
+               The hardware actually used to transmit data to the LEDs
+               is chosen by architecture/board implementation.
+
+               In other words - even named "non-SPI driver", this driver
+               can support SPI hardware as well as other options.
+
 config WS2812_LED_COUNT
        int "Number of ws2812s connected."
        default 1

Reply via email to