From cf94d933b87fc63bed87b10dc9b4885ad7fd3fc8 Mon Sep 17 00:00:00 2001 From: Emil Dahl Juhl Date: Tue, 3 Dec 2024 08:20:10 +0100 Subject: [PATCH 1/7] Revert "drivers: led: lp5569: add enable-gpios" This reverts commit 9aecff94d7b786f4ca60b1bf75093a31e27f94ac. We ought to replace this bespoke patch with a direct cherry-pick from upstream main --- drivers/led/lp5569.c | 23 ----------------------- dts/bindings/led/ti,lp5569.yaml | 5 ----- 2 files changed, 28 deletions(-) diff --git a/drivers/led/lp5569.c b/drivers/led/lp5569.c index 9bd1de86022e5..2affa8a76e24f 100644 --- a/drivers/led/lp5569.c +++ b/drivers/led/lp5569.c @@ -13,7 +13,6 @@ * The LP5569 is a 9-channel LED driver that communicates over I2C. */ -#include #include #include #include @@ -38,7 +37,6 @@ LOG_MODULE_REGISTER(lp5569, CONFIG_LED_LOG_LEVEL); struct lp5569_config { struct i2c_dt_spec bus; - struct gpio_dt_spec enable_gpio; const uint8_t cp_mode; }; @@ -87,25 +85,6 @@ static int lp5569_enable(const struct device *dev) return -ENODEV; } - /* flip the enable pin if specified */ - if (config->enable_gpio.port) { - if (!gpio_is_ready_dt(&config->enable_gpio)) { - LOG_ERR("Enable gpio not ready"); - return -ENODEV; - } - - ret = gpio_pin_configure_dt(&config->enable_gpio, - GPIO_OUTPUT_ACTIVE); - if (ret < 0) { - LOG_ERR("Failed to configure enable_gpio, err: %d", - ret); - return ret; - } - - /* datasheet 7.9: t_en max 3 ms for chip initialization */ - k_msleep(3); - } - ret = i2c_reg_write_byte_dt(&config->bus, LP5569_CONFIG, LP5569_CHIP_EN); if (ret < 0) { @@ -180,8 +159,6 @@ static const struct led_driver_api lp5569_led_api = { #define LP5569_DEFINE(id) \ static const struct lp5569_config lp5569_config_##id = { \ .bus = I2C_DT_SPEC_INST_GET(id), \ - .enable_gpio = GPIO_DT_SPEC_GET_OR(DT_DRV_INST(id), \ - enable_gpios, {0}), \ .cp_mode = DT_PROP_OR(DT_DRV_INST(id), \ charge_pump_mode, 0), \ }; \ diff --git a/dts/bindings/led/ti,lp5569.yaml b/dts/bindings/led/ti,lp5569.yaml index 8464543fa75cd..73ee2d0c1e920 100644 --- a/dts/bindings/led/ti,lp5569.yaml +++ b/dts/bindings/led/ti,lp5569.yaml @@ -5,11 +5,6 @@ compatible: "ti,lp5569" include: i2c-device.yaml properties: - enable-gpios: - type: phandle-array - description: | - GPIO used to enable the lp5569. - charge-pump-mode: type: int default: 0 From 713061c407ffab5beae8dfc4a84d200cf2801c66 Mon Sep 17 00:00:00 2001 From: Emil Dahl Juhl Date: Tue, 3 Dec 2024 08:20:49 +0100 Subject: [PATCH 2/7] Revert "drivers: led: lp5569: add charge pump configuration" This reverts commit d3b74c33a5f61912fb06d0d5de55997252c38d6b. We ought to replace this bespoke patch with a direct cherry-pick from upstream main --- drivers/led/lp5569.c | 7 +------ dts/bindings/led/ti,lp5569.yaml | 13 ------------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/led/lp5569.c b/drivers/led/lp5569.c index 2affa8a76e24f..e469c22574e31 100644 --- a/drivers/led/lp5569.c +++ b/drivers/led/lp5569.c @@ -30,14 +30,12 @@ LOG_MODULE_REGISTER(lp5569, CONFIG_LED_LOG_LEVEL); #define LP5569_MISC 0x2F #define LP5569_POWERSAVE_EN BIT(5) -#define LP5569_CP_MODE_SHIFT 3 /* PWM base Register for controlling the duty-cycle */ #define LP5569_LED0_PWM 0x16 struct lp5569_config { struct i2c_dt_spec bus; - const uint8_t cp_mode; }; static int lp5569_led_set_brightness(const struct device *dev, uint32_t led, @@ -93,8 +91,7 @@ static int lp5569_enable(const struct device *dev) } ret = i2c_reg_write_byte_dt(&config->bus, LP5569_MISC, - LP5569_POWERSAVE_EN | - (config->cp_mode << LP5569_CP_MODE_SHIFT)); + LP5569_POWERSAVE_EN); if (ret < 0) { LOG_ERR("LED reg update failed"); return ret; @@ -159,8 +156,6 @@ static const struct led_driver_api lp5569_led_api = { #define LP5569_DEFINE(id) \ static const struct lp5569_config lp5569_config_##id = { \ .bus = I2C_DT_SPEC_INST_GET(id), \ - .cp_mode = DT_PROP_OR(DT_DRV_INST(id), \ - charge_pump_mode, 0), \ }; \ \ PM_DEVICE_DT_INST_DEFINE(id, lp5569_pm_action); \ diff --git a/dts/bindings/led/ti,lp5569.yaml b/dts/bindings/led/ti,lp5569.yaml index 73ee2d0c1e920..1d84ba257c537 100644 --- a/dts/bindings/led/ti,lp5569.yaml +++ b/dts/bindings/led/ti,lp5569.yaml @@ -3,16 +3,3 @@ description: TI LP5569 LED compatible: "ti,lp5569" include: i2c-device.yaml - -properties: - charge-pump-mode: - type: int - default: 0 - description: | - If provided, configures the internal charge-pump mode in the MISC - register following the datasheet: - 0x00 -> disabled (default) - 0x01 -> 1x - 0x10 -> 1.5x - 0x11 -> auto - any other values are considered as undefined configurations. From fcfb503b46dbf1e58ba68ceb16fa10830a5740ce Mon Sep 17 00:00:00 2001 From: Emil Juhl Date: Thu, 21 Mar 2024 10:07:46 +0100 Subject: [PATCH 3/7] drivers: led: lp5569: add charge pump configuration The lp5569 controller contains an internal charge pump which can be useful for driving LEDs with a forward voltage greater than the lp5569 supply. Taking advantage of the charge pump can alleviate the need for an external boost converter. Add a dts property, charge-pump-mode, to the ti,lp5569 binding with which the cp_mode bits of the MISC register will be configured. Following the datasheet, the possible configurations are: 0x00 -> disabled (default) 0x01 -> 1x mode 0x10 -> 1.5x mode 0x11 -> auto mode Signed-off-by: Emil Juhl (cherry picked from commit 47f9040bfa8c90ec05d6b13ae65a0cbe3bb747d9) --- doc/releases/release-notes-4.0.rst | 324 +++++++++++++++++++++++++++++ drivers/led/lp5569.c | 6 +- dts/bindings/led/ti,lp5569.yaml | 15 ++ 3 files changed, 344 insertions(+), 1 deletion(-) create mode 100644 doc/releases/release-notes-4.0.rst diff --git a/doc/releases/release-notes-4.0.rst b/doc/releases/release-notes-4.0.rst new file mode 100644 index 0000000000000..a6735deeef16f --- /dev/null +++ b/doc/releases/release-notes-4.0.rst @@ -0,0 +1,324 @@ +:orphan: + +.. _zephyr_4.0: + +Zephyr 4.0.0 (Working Draft) +############################ + +We are pleased to announce the release of Zephyr version 4.0.0. + +Major enhancements with this release include: + +An overview of the changes required or recommended when migrating your application from Zephyr +v3.7.0 to Zephyr v4.0.0 can be found in the separate :ref:`migration guide`. + +The following sections provide detailed lists of changes by component. + +Security Vulnerability Related +****************************** +The following CVEs are addressed by this release: + +More detailed information can be found in: +https://docs.zephyrproject.org/latest/security/vulnerabilities.html + +API Changes +*********** + +* Removed deprecated arch-level CMSIS header files + ``include/zephyr/arch/arm/cortex_a_r/cmsis.h`` and + ``include/zephyr/arch/arm/cortex_m/cmsis.h``. ``cmsis_core.h`` needs to be + included now. + +* Removed deprecated ``ceiling_fraction`` macro. :c:macro:`DIV_ROUND_UP` needs + to be used now. + +* Deprecated ``EARLY``, ``APPLICATION`` and ``SMP`` init levels can no longer be + used for devices. + +Removed APIs in this release +============================ + +Deprecated in this release +========================== + +* Deprecated the :c:func:`net_buf_put` and :c:func:`net_buf_get` API functions in favor of + :c:func:`k_fifo_put` and :c:func:`k_fifo_get`. + +Architectures +************* + +* ARC + +* ARM + +* ARM64 + +* RISC-V + +* Xtensa + +Kernel +****** + +Bluetooth +********* + +* Audio + +* Host + + * Added API :c:func:`bt_gatt_get_uatt_mtu` to get current Unenhanced ATT MTU of a given + connection (experimental). + +* HCI Drivers + +Boards & SoC Support +******************** + +* Added support for these SoC series: + +* Made these changes in other SoC series: + + * NXP S32Z270: Added support for the new silicon cut version 2.0. Note that the previous + versions (1.0 and 1.1) are no longer supported. + +* Added support for these boards: + +* Made these board changes: + + * :ref:`native_posix` has been deprecated in favour of + :ref:`native_sim`. + +* Added support for the following shields: + +Build system and Infrastructure +******************************* + +Drivers and Sensors +******************* + +* ADC + +* Battery + +* CAN + +* Charger + +* Clock control + +* Counter + +* DAC + +* Disk + +* Display + +* Ethernet + + * LiteX: Renamed the ``compatible`` from ``litex,eth0`` to :dtcompatible:`litex,liteeth`. + +* Flash + +* GNSS + +* GPIO + +* Hardware info + +* I2C + +* I2S + +* I3C + +* Input + +* LED + + * lp5569: added ``charge-pump-mode`` property to configure the charge pump of the lp5569. + +* LED Strip + +* LoRa + +* Mailbox + +* MDIO + +* MFD + +* Modem + +* MIPI-DBI + +* MSPI + +* Pin control + +* PWM + +* Regulators + +* Reset + +* RTC + +* RTIO + +* SDHC + +* Sensors + +* Serial + + * LiteX: Renamed the ``compatible`` from ``litex,uart0`` to :dtcompatible:`litex,uart`. + +* SPI + +* USB + +* Video + +* Watchdog + +* Wi-Fi + +Networking +********** + +* ARP: + +* CoAP: + +* Connection manager: + +* DHCPv4: + +* DHCPv6: + +* DNS/mDNS/LLMNR: + +* gPTP/PTP: + +* HTTP: + +* IPSP: + +* IPv4: + +* IPv6: + +* LwM2M: + * Location object: optional resources altitude, radius, and speed can now be + used optionally as per the location object's specification. Users of these + resources will now need to provide a read buffer. + +* Misc: + +* MQTT: + +* Network Interface: + +* OpenThread + +* PPP + +* Shell: + +* Sockets: + +* Syslog: + +* TCP: + +* Websocket: + +* Wi-Fi: + +* zperf: + +USB +*** + +Devicetree +********** + +Kconfig +******* + +Libraries / Subsystems +********************** + +* Debug + +* Demand Paging + +* Formatted output + +* Management + +* Logging + +* Modem modules + +* Power management + +* Crypto + +* CMSIS-NN + +* FPGA + +* Random + +* SD + +* State Machine Framework + +* Storage + + * LittleFS: The module has been updated with changes committed upstream + from version 2.8.1, the last module update, up to and including + the released version 2.9.3. + +* Task Watchdog + +* POSIX API + +* LoRa/LoRaWAN + +* ZBus + +HALs +**** + +* Nordic + +* STM32 + +* ADI + +* Espressif + +MCUboot +******* + +OSDP +**** + +Trusted Firmware-M +****************** + +LVGL +**** + +Tests and Samples +***************** + +Issue Related Items +******************* + +Known Issues +============ diff --git a/drivers/led/lp5569.c b/drivers/led/lp5569.c index e469c22574e31..72cb50fbce90f 100644 --- a/drivers/led/lp5569.c +++ b/drivers/led/lp5569.c @@ -30,12 +30,14 @@ LOG_MODULE_REGISTER(lp5569, CONFIG_LED_LOG_LEVEL); #define LP5569_MISC 0x2F #define LP5569_POWERSAVE_EN BIT(5) +#define LP5569_CP_MODE_SHIFT 3 /* PWM base Register for controlling the duty-cycle */ #define LP5569_LED0_PWM 0x16 struct lp5569_config { struct i2c_dt_spec bus; + const uint8_t cp_mode; }; static int lp5569_led_set_brightness(const struct device *dev, uint32_t led, @@ -91,7 +93,8 @@ static int lp5569_enable(const struct device *dev) } ret = i2c_reg_write_byte_dt(&config->bus, LP5569_MISC, - LP5569_POWERSAVE_EN); + LP5569_POWERSAVE_EN | + (config->cp_mode << LP5569_CP_MODE_SHIFT)); if (ret < 0) { LOG_ERR("LED reg update failed"); return ret; @@ -156,6 +159,7 @@ static const struct led_driver_api lp5569_led_api = { #define LP5569_DEFINE(id) \ static const struct lp5569_config lp5569_config_##id = { \ .bus = I2C_DT_SPEC_INST_GET(id), \ + .cp_mode = DT_ENUM_IDX(DT_DRV_INST(id), charge_pump_mode), \ }; \ \ PM_DEVICE_DT_INST_DEFINE(id, lp5569_pm_action); \ diff --git a/dts/bindings/led/ti,lp5569.yaml b/dts/bindings/led/ti,lp5569.yaml index 1d84ba257c537..5893b1cbae8ad 100644 --- a/dts/bindings/led/ti,lp5569.yaml +++ b/dts/bindings/led/ti,lp5569.yaml @@ -3,3 +3,18 @@ description: TI LP5569 LED compatible: "ti,lp5569" include: i2c-device.yaml + +properties: + charge-pump-mode: + type: string + default: "disabled" + enum: + - "disabled" + - "1x" + - "1x5" + - "auto" + description: | + If provided, configures the internal charge-pump mode in the MISC + register. This can be useful to supply a higher voltage to the LEDs, than + what the lp5569 is being supplied. + The default corresponds to the reset value of the register. From 7449597efb5af840dba6a4ca0acb3d70e0fc189b Mon Sep 17 00:00:00 2001 From: Emil Juhl Date: Thu, 21 Mar 2024 10:45:45 +0100 Subject: [PATCH 4/7] drivers: led: lp5569: add enable-gpios The lp5569 features a double functioning pin for enable and pwm control. The chip, however, uses the first rising edge to initialize and get ready for i2c communication, and then the pin alters function to pwm mode. Add support for providing enable-gpios to the lp5569 in the dts, which will make sure to assert the pin and wait for the chip to initialize before attempting further configuration of the chip. Signed-off-by: Emil Juhl (cherry picked from commit f53a4017581285ace65239dc018a76cfb96b4020) --- doc/releases/release-notes-4.0.rst | 2 ++ drivers/led/lp5569.c | 22 ++++++++++++++++++++++ dts/bindings/led/ti,lp5569.yaml | 5 +++++ 3 files changed, 29 insertions(+) diff --git a/doc/releases/release-notes-4.0.rst b/doc/releases/release-notes-4.0.rst index a6735deeef16f..49d03f5eb0a2c 100644 --- a/doc/releases/release-notes-4.0.rst +++ b/doc/releases/release-notes-4.0.rst @@ -139,6 +139,8 @@ Drivers and Sensors * lp5569: added ``charge-pump-mode`` property to configure the charge pump of the lp5569. + * lp5569: added ``enable-gpios`` property to describe the EN/PWM GPIO of the lp5569. + * LED Strip * LoRa diff --git a/drivers/led/lp5569.c b/drivers/led/lp5569.c index 72cb50fbce90f..4a345a1c49049 100644 --- a/drivers/led/lp5569.c +++ b/drivers/led/lp5569.c @@ -13,6 +13,7 @@ * The LP5569 is a 9-channel LED driver that communicates over I2C. */ +#include #include #include #include @@ -37,6 +38,7 @@ LOG_MODULE_REGISTER(lp5569, CONFIG_LED_LOG_LEVEL); struct lp5569_config { struct i2c_dt_spec bus; + struct gpio_dt_spec enable_gpio; const uint8_t cp_mode; }; @@ -85,6 +87,25 @@ static int lp5569_enable(const struct device *dev) return -ENODEV; } + /* flip the enable pin if specified */ + if (config->enable_gpio.port) { + if (!gpio_is_ready_dt(&config->enable_gpio)) { + LOG_ERR("Enable GPIO not ready"); + return -ENODEV; + } + + ret = gpio_pin_configure_dt(&config->enable_gpio, + GPIO_OUTPUT_ACTIVE); + if (ret < 0) { + LOG_ERR("Failed to configure enable_gpio, err: %d", + ret); + return ret; + } + + /* datasheet 7.9: t_en max 3 ms for chip initialization */ + k_msleep(3); + } + ret = i2c_reg_write_byte_dt(&config->bus, LP5569_CONFIG, LP5569_CHIP_EN); if (ret < 0) { @@ -159,6 +180,7 @@ static const struct led_driver_api lp5569_led_api = { #define LP5569_DEFINE(id) \ static const struct lp5569_config lp5569_config_##id = { \ .bus = I2C_DT_SPEC_INST_GET(id), \ + .enable_gpio = GPIO_DT_SPEC_INST_GET_OR(id, enable_gpios, {0}), \ .cp_mode = DT_ENUM_IDX(DT_DRV_INST(id), charge_pump_mode), \ }; \ \ diff --git a/dts/bindings/led/ti,lp5569.yaml b/dts/bindings/led/ti,lp5569.yaml index 5893b1cbae8ad..dff5d9c2ec5f1 100644 --- a/dts/bindings/led/ti,lp5569.yaml +++ b/dts/bindings/led/ti,lp5569.yaml @@ -5,6 +5,11 @@ compatible: "ti,lp5569" include: i2c-device.yaml properties: + enable-gpios: + type: phandle-array + description: | + GPIO used to enable the lp5569. + charge-pump-mode: type: string default: "disabled" From aa28bedffed0edfcb0703dbabf3d059d08b3008d Mon Sep 17 00:00:00 2001 From: Emil Dahl Juhl Date: Thu, 22 Aug 2024 10:22:28 +0200 Subject: [PATCH 5/7] drivers: led: lp5569: run clang-format Run clang-format on drivers/led/lp5569.c to align formatting in the file. No functional changes intended. Signed-off-by: Emil Dahl Juhl (cherry picked from commit bc5477ab100e293f84b91273a4af189420d7214f) --- drivers/led/lp5569.c | 59 +++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 34 deletions(-) diff --git a/drivers/led/lp5569.c b/drivers/led/lp5569.c index 4a345a1c49049..f7a9758c4ec2c 100644 --- a/drivers/led/lp5569.c +++ b/drivers/led/lp5569.c @@ -23,18 +23,18 @@ #include LOG_MODULE_REGISTER(lp5569, CONFIG_LED_LOG_LEVEL); -#define LP5569_NUM_LEDS 9 +#define LP5569_NUM_LEDS 9 /* General Registers */ -#define LP5569_CONFIG 0x00 -#define LP5569_CHIP_EN BIT(6) +#define LP5569_CONFIG 0x00 +#define LP5569_CHIP_EN BIT(6) -#define LP5569_MISC 0x2F -#define LP5569_POWERSAVE_EN BIT(5) -#define LP5569_CP_MODE_SHIFT 3 +#define LP5569_MISC 0x2F +#define LP5569_POWERSAVE_EN BIT(5) +#define LP5569_CP_MODE_SHIFT 3 /* PWM base Register for controlling the duty-cycle */ -#define LP5569_LED0_PWM 0x16 +#define LP5569_LED0_PWM 0x16 struct lp5569_config { struct i2c_dt_spec bus; @@ -42,8 +42,7 @@ struct lp5569_config { const uint8_t cp_mode; }; -static int lp5569_led_set_brightness(const struct device *dev, uint32_t led, - uint8_t brightness) +static int lp5569_led_set_brightness(const struct device *dev, uint32_t led, uint8_t brightness) { const struct lp5569_config *config = dev->config; uint8_t val; @@ -94,11 +93,9 @@ static int lp5569_enable(const struct device *dev) return -ENODEV; } - ret = gpio_pin_configure_dt(&config->enable_gpio, - GPIO_OUTPUT_ACTIVE); + ret = gpio_pin_configure_dt(&config->enable_gpio, GPIO_OUTPUT_ACTIVE); if (ret < 0) { - LOG_ERR("Failed to configure enable_gpio, err: %d", - ret); + LOG_ERR("Failed to configure enable_gpio, err: %d", ret); return ret; } @@ -106,8 +103,7 @@ static int lp5569_enable(const struct device *dev) k_msleep(3); } - ret = i2c_reg_write_byte_dt(&config->bus, LP5569_CONFIG, - LP5569_CHIP_EN); + ret = i2c_reg_write_byte_dt(&config->bus, LP5569_CONFIG, LP5569_CHIP_EN); if (ret < 0) { LOG_ERR("Enable LP5569 failed"); return ret; @@ -115,7 +111,7 @@ static int lp5569_enable(const struct device *dev) ret = i2c_reg_write_byte_dt(&config->bus, LP5569_MISC, LP5569_POWERSAVE_EN | - (config->cp_mode << LP5569_CP_MODE_SHIFT)); + (config->cp_mode << LP5569_CP_MODE_SHIFT)); if (ret < 0) { LOG_ERR("LED reg update failed"); return ret; @@ -139,8 +135,7 @@ static int lp5569_init(const struct device *dev) } #ifdef CONFIG_PM_DEVICE -static int lp5569_pm_action(const struct device *dev, - enum pm_device_action action) +static int lp5569_pm_action(const struct device *dev, enum pm_device_action action) { const struct lp5569_config *config = dev->config; int ret; @@ -156,8 +151,7 @@ static int lp5569_pm_action(const struct device *dev, break; case PM_DEVICE_ACTION_TURN_OFF: case PM_DEVICE_ACTION_SUSPEND: - ret = i2c_reg_update_byte_dt(&config->bus, LP5569_CONFIG, - LP5569_CHIP_EN, 0); + ret = i2c_reg_update_byte_dt(&config->bus, LP5569_CONFIG, LP5569_CHIP_EN, 0); if (ret < 0) { LOG_ERR("Disable LP5569 failed"); return ret; @@ -177,20 +171,17 @@ static const struct led_driver_api lp5569_led_api = { .off = lp5569_led_off, }; -#define LP5569_DEFINE(id) \ - static const struct lp5569_config lp5569_config_##id = { \ - .bus = I2C_DT_SPEC_INST_GET(id), \ - .enable_gpio = GPIO_DT_SPEC_INST_GET_OR(id, enable_gpios, {0}), \ - .cp_mode = DT_ENUM_IDX(DT_DRV_INST(id), charge_pump_mode), \ - }; \ - \ - PM_DEVICE_DT_INST_DEFINE(id, lp5569_pm_action); \ - \ - DEVICE_DT_INST_DEFINE(id, &lp5569_init, \ - PM_DEVICE_DT_INST_GET(id), \ - NULL, \ - &lp5569_config_##id, POST_KERNEL, \ - CONFIG_LED_INIT_PRIORITY, \ +#define LP5569_DEFINE(id) \ + static const struct lp5569_config lp5569_config_##id = { \ + .bus = I2C_DT_SPEC_INST_GET(id), \ + .enable_gpio = GPIO_DT_SPEC_INST_GET_OR(id, enable_gpios, {0}), \ + .cp_mode = DT_ENUM_IDX(DT_DRV_INST(id), charge_pump_mode), \ + }; \ + \ + PM_DEVICE_DT_INST_DEFINE(id, lp5569_pm_action); \ + \ + DEVICE_DT_INST_DEFINE(id, &lp5569_init, PM_DEVICE_DT_INST_GET(id), NULL, \ + &lp5569_config_##id, POST_KERNEL, CONFIG_LED_INIT_PRIORITY, \ &lp5569_led_api); DT_INST_FOREACH_STATUS_OKAY(LP5569_DEFINE) From e681e3f9d897cf7f5fe28b9382885f8a81a50325 Mon Sep 17 00:00:00 2001 From: Emil Dahl Juhl Date: Sun, 17 Nov 2024 21:27:59 +0100 Subject: [PATCH 6/7] drivers: led: lp5569: enable auto-increment The lp5569 controller supports auto-increment for its registers. This is by default enabled in the chip, but the driver actively disabled it. Since auto-increment is useful for writing multiple consecutive registers, enable the feature. The driver, however, doesn't perform such consecutive writes and thus the existing behavior is not altered. Signed-off-by: Emil Dahl Juhl (cherry picked from commit 45744b436f34c5f16b0c477274987251b1175a21) --- doc/releases/release-notes-4.1.rst | 324 +++++++++++++++++++++++++++++ drivers/led/lp5569.c | 3 +- 2 files changed, 326 insertions(+), 1 deletion(-) create mode 100644 doc/releases/release-notes-4.1.rst diff --git a/doc/releases/release-notes-4.1.rst b/doc/releases/release-notes-4.1.rst new file mode 100644 index 0000000000000..fa1ebda9eeda6 --- /dev/null +++ b/doc/releases/release-notes-4.1.rst @@ -0,0 +1,324 @@ +:orphan: + +.. _zephyr_4.1: + +Zephyr 4.1.0 (Working Draft) +############################ + +We are pleased to announce the release of Zephyr version 4.1.0. + +Major enhancements with this release include: + +An overview of the changes required or recommended when migrating your application from Zephyr +v4.0.0 to Zephyr v4.1.0 can be found in the separate :ref:`migration guide`. + +The following sections provide detailed lists of changes by component. + +Security Vulnerability Related +****************************** +The following CVEs are addressed by this release: + +More detailed information can be found in: +https://docs.zephyrproject.org/latest/security/vulnerabilities.html + +API Changes +*********** + +Removed APIs in this release +============================ + + * The deprecated Bluetooth HCI driver API has been removed. It has been replaced by a + :c:group:`new API` that follows the normal Zephyr driver model. + +Deprecated in this release +========================== + +Architectures +************* + +* Common + + * Introduced :kconfig:option:`CONFIG_ARCH_HAS_CUSTOM_CURRENT_IMPL`, which can be selected when + an architecture implemented and enabled its own :c:func:`arch_current_thread` and + :c:func:`arch_current_thread_set` functions for faster retrieval of the current CPU's thread + pointer. When enabled, ``_current`` variable will be routed to the + :c:func:`arch_current_thread` (:github:`80716`). + +* ARC + +* ARM + +* ARM64 + +* RISC-V + + * Implements :c:func:`arch_current_thread_set` & :c:func:`arch_current_thread`, which can be enabled + by :kconfig:option:`CONFIG_RISCV_CURRENT_VIA_GP` (:github:`80716`). + +* Xtensa + +* native/POSIX + + * :kconfig:option:`CONFIG_NATIVE_APPLICATION` has been deprecated. + * For the native_sim target :kconfig:option:`CONFIG_NATIVE_SIM_NATIVE_POSIX_COMPAT` has been + switched to ``n`` by default, and this option has been deprecated. + +Kernel +****** + +Bluetooth +********* + +* Audio + +* Host + +* HCI Drivers + +Boards & SoC Support +******************** + +* Added support for these SoC series: + +* Made these changes in other SoC series: + +* Added support for these boards: + +* Made these board changes: + +* Added support for the following shields: + +Build system and Infrastructure +******************************* + +Drivers and Sensors +******************* + +* ADC + +* Battery + +* CAN + +* Charger + +* Clock control + +* Counter + +* DAC + +* Disk + +* Display + + * Added flag ``frame_incomplete`` to ``display_write`` that indicates whether a write is the last + write of the frame, allowing display drivers to implement double buffering / tearing enable + signal handling (:github:`81250`) + * Added ``frame_incomplete`` handling to SDL display driver (:dtcompatible:`zephyr,sdl-dc`) + (:github:`81250`) + * Added transparency support to SDL display driver (:dtcompatible:`zephyr,sdl-dc`) (:github:`81184`) + +* Ethernet + +* Flash + +* GNSS + +* GPIO + +* Hardware info + +* I2C + +* I2S + +* I3C + +* Input + +* LED + + * Added a new set of devicetree based LED APIs, see :c:struct:`led_dt_spec`. + * lp5569: added use of auto-increment functionality. + +* LED Strip + +* LoRa + +* Mailbox + +* MDIO + +* MFD + +* Modem + +* MIPI-DBI + +* MSPI + +* Pin control + +* PWM + +* Regulators + +* Reset + +* RTC + +* RTIO + +* SDHC + +* Sensors + +* Serial + +* SPI + +* USB + +* Video + +* Watchdog + +* Wi-Fi + +Networking +********** + +* ARP: + +* CoAP: + +* Connection manager: + +* DHCPv4: + +* DHCPv6: + +* DNS/mDNS/LLMNR: + +* gPTP/PTP: + +* HTTP: + +* IPSP: + +* IPv4: + +* IPv6: + +* LwM2M: + +* Misc: + +* MQTT: + +* Network Interface: + +* OpenThread + +* PPP + +* Shell: + +* Sockets: + +* Syslog: + +* TCP: + +* Websocket: + +* Wi-Fi: + +* zperf: + +USB +*** + +Devicetree +********** + +Kconfig +******* + +Libraries / Subsystems +********************** + +* Debug + +* Demand Paging + +* Formatted output + +* Management + +* Logging + +* Modem modules + +* Power management + +* Crypto + +* CMSIS-NN + +* FPGA + +* Random + +* SD + +* State Machine Framework + +* Storage + +* Task Watchdog + +* POSIX API + +* LoRa/LoRaWAN + +* ZBus + +HALs +**** + +* Nordic + +* STM32 + +* ADI + +* Espressif + +MCUboot +******* + +OSDP +**** + +Trusted Firmware-M +****************** + +LVGL +**** + +* Added ``frame_incomplete`` support to indicate whether a write is the last + write of the frame (:github:`81250`) + +Tests and Samples +***************** + +* Fixed incorrect alpha values in :zephyr_file:`samples/drivers/display`. (:github:`81184`) +* Added :zephyr_file:`samples/modules/lvgl/screen_transparency`. (:github:`81184`) + +Issue Related Items +******************* + +Known Issues +============ diff --git a/drivers/led/lp5569.c b/drivers/led/lp5569.c index f7a9758c4ec2c..c79a34922aac0 100644 --- a/drivers/led/lp5569.c +++ b/drivers/led/lp5569.c @@ -31,6 +31,7 @@ LOG_MODULE_REGISTER(lp5569, CONFIG_LED_LOG_LEVEL); #define LP5569_MISC 0x2F #define LP5569_POWERSAVE_EN BIT(5) +#define LP5569_EN_AUTO_INCR BIT(6) #define LP5569_CP_MODE_SHIFT 3 /* PWM base Register for controlling the duty-cycle */ @@ -110,7 +111,7 @@ static int lp5569_enable(const struct device *dev) } ret = i2c_reg_write_byte_dt(&config->bus, LP5569_MISC, - LP5569_POWERSAVE_EN | + LP5569_POWERSAVE_EN | LP5569_EN_AUTO_INCR | (config->cp_mode << LP5569_CP_MODE_SHIFT)); if (ret < 0) { LOG_ERR("LED reg update failed"); From 3da571839757645a10303446f28b77165b10ba04 Mon Sep 17 00:00:00 2001 From: Emil Dahl Juhl Date: Sun, 17 Nov 2024 21:32:20 +0100 Subject: [PATCH 7/7] drivers: led: lp5569: implement write_channels api The lp5569 has multiple pwm outputs, and thus implementing the write_channels api to set multiple values in a single call makes sense. Implement the write_channels function with a basic range check on the channel range. Since the lp5569 supports auto-increment, all of the channels can be written in one i2c transfer, starting from the pwm register of the start_channel. Signed-off-by: Emil Dahl Juhl (cherry picked from commit d6ac9e84240284a10680efa6b49541bb95034e76) --- doc/releases/release-notes-4.1.rst | 1 + drivers/led/lp5569.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/doc/releases/release-notes-4.1.rst b/doc/releases/release-notes-4.1.rst index fa1ebda9eeda6..6feba5b3fef32 100644 --- a/doc/releases/release-notes-4.1.rst +++ b/doc/releases/release-notes-4.1.rst @@ -141,6 +141,7 @@ Drivers and Sensors * Added a new set of devicetree based LED APIs, see :c:struct:`led_dt_spec`. * lp5569: added use of auto-increment functionality. + * lp5569: implemented ``write_channels`` api. * LED Strip diff --git a/drivers/led/lp5569.c b/drivers/led/lp5569.c index c79a34922aac0..c87a574900dc1 100644 --- a/drivers/led/lp5569.c +++ b/drivers/led/lp5569.c @@ -77,6 +77,23 @@ static inline int lp5569_led_off(const struct device *dev, uint32_t led) return lp5569_led_set_brightness(dev, led, 0); } +static int lp5569_write_channels(const struct device *dev, uint32_t start_channel, + uint32_t num_channels, const uint8_t *buf) +{ + const struct lp5569_config *config = dev->config; + uint32_t i2c_len = num_channels + 1; + uint8_t i2c_msg[LP5569_NUM_LEDS + 1]; + + if ((uint64_t)start_channel + num_channels > LP5569_NUM_LEDS) { + return -EINVAL; + } + + i2c_msg[0] = LP5569_LED0_PWM + start_channel; + memcpy(&i2c_msg[1], buf, num_channels); + + return i2c_write_dt(&config->bus, i2c_msg, i2c_len); +} + static int lp5569_enable(const struct device *dev) { const struct lp5569_config *config = dev->config; @@ -170,6 +187,7 @@ static const struct led_driver_api lp5569_led_api = { .set_brightness = lp5569_led_set_brightness, .on = lp5569_led_on, .off = lp5569_led_off, + .write_channels = lp5569_write_channels, }; #define LP5569_DEFINE(id) \