From 5929677d7a74aefa341b61a87d81b788763224b2 Mon Sep 17 00:00:00 2001 From: Stefan Schwendeler Date: Tue, 26 Nov 2024 15:01:21 +0100 Subject: [PATCH] drivers: led_strip: ws2812_i2s: Adds dependency to `i2s-device` Removes the ugly `i2s-dev` property and uses its parent I2S bus device. Signed-off-by: Stefan Schwendeler --- drivers/led_strip/ws2812_i2s.c | 2 +- dts/bindings/led_strip/worldsemi,ws2812-i2s.yaml | 7 +------ .../led/led_strip/boards/esp32s3_devkitc_procpu.overlay | 4 ++-- .../led/led_strip/boards/nrf5340dk_nrf5340_cpuapp.overlay | 4 ++-- .../drivers/led/led_strip/boards/thingy52_nrf52832.overlay | 4 ++-- 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/drivers/led_strip/ws2812_i2s.c b/drivers/led_strip/ws2812_i2s.c index 1c7cf2aa48c..4e2d8a96f5d 100644 --- a/drivers/led_strip/ws2812_i2s.c +++ b/drivers/led_strip/ws2812_i2s.c @@ -230,7 +230,7 @@ static DEVICE_API(led_strip, ws2812_i2s_api) = { DT_INST_PROP(idx, color_mapping); \ \ static const struct ws2812_i2s_cfg ws2812_i2s_##idx##_cfg = { \ - .dev = DEVICE_DT_GET(DT_INST_PROP(idx, i2s_dev)), \ + .dev = DEVICE_DT_GET(DT_INST_BUS(idx)), \ .tx_buf_bytes = WS2812_I2S_BUFSIZE(idx), \ .mem_slab = &ws2812_i2s_##idx##_slab, \ .num_colors = WS2812_NUM_COLORS(idx), \ diff --git a/dts/bindings/led_strip/worldsemi,ws2812-i2s.yaml b/dts/bindings/led_strip/worldsemi,ws2812-i2s.yaml index cd698dbe9e6..341708e2d3c 100644 --- a/dts/bindings/led_strip/worldsemi,ws2812-i2s.yaml +++ b/dts/bindings/led_strip/worldsemi,ws2812-i2s.yaml @@ -9,15 +9,10 @@ description: | compatible: "worldsemi,ws2812-i2s" -include: [base.yaml, ws2812.yaml] +include: [i2s-device.yaml, ws2812.yaml] properties: - i2s-dev: - type: phandle - required: true - description: Pointer to the I2S instance. - out-active-low: type: boolean description: True if the output pin is active low. diff --git a/samples/drivers/led/led_strip/boards/esp32s3_devkitc_procpu.overlay b/samples/drivers/led/led_strip/boards/esp32s3_devkitc_procpu.overlay index 00b7c46871e..8818cbd2384 100644 --- a/samples/drivers/led/led_strip/boards/esp32s3_devkitc_procpu.overlay +++ b/samples/drivers/led/led_strip/boards/esp32s3_devkitc_procpu.overlay @@ -20,10 +20,10 @@ i2s_led: &i2s0 { dmas = <&dma 3>; dma-names = "tx"; - led_strip: ws2812 { + led_strip: ws2812@0 { compatible = "worldsemi,ws2812-i2s"; - i2s-dev = <&i2s_led>; + reg = <0>; chain-length = <46>; color-mapping = ; pinctrl-names = "default"; - led_strip: ws2812 { + led_strip: ws2812@0 { compatible = "worldsemi,ws2812-i2s"; - i2s-dev = <&i2s_led>; + reg = <0>; chain-length = <42>; /* arbitrary; change at will */ color-mapping = ; pinctrl-names = "default"; - led_strip: ws2812 { + led_strip: ws2812@0 { compatible = "worldsemi,ws2812-i2s"; - i2s-dev = < &i2s_led >; + reg = <0>; chain-length = <10>; /* arbitrary; change at will */ color-mapping =