From d49a55265efff415b3ef1fb8cdad24da63d58058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Fri, 31 Oct 2025 13:08:43 +0100 Subject: [PATCH] drivers: led: i2c: replace use of i2c_burst_write MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit i2c_burst_write is not portable, as it is not supported by some drivers, replace its use with i2c_write. Signed-off-by: Fin Maaß --- drivers/led/ncp5623.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/led/ncp5623.c b/drivers/led/ncp5623.c index e7ace970355..fcae2552f4b 100644 --- a/drivers/led/ncp5623.c +++ b/drivers/led/ncp5623.c @@ -121,7 +121,13 @@ static int ncp5623_led_init(const struct device *dev) const struct ncp5623_config *config = dev->config; const struct led_info *led_info = NULL; int i; - uint8_t buf[6] = {0x70, NCP5623_LED_PWM0, 0x70, NCP5623_LED_PWM1, 0x70, NCP5623_LED_PWM2}; + uint8_t buf[7] = {NCP5623_LED_CURRENT | NCP5623_MAX_BRIGHTNESS, + 0x70, + NCP5623_LED_PWM0, + 0x70, + NCP5623_LED_PWM1, + 0x70, + NCP5623_LED_PWM2}; if (!i2c_is_ready_dt(&config->bus)) { LOG_ERR("%s: I2C device not ready", dev->name); @@ -161,8 +167,7 @@ static int ncp5623_led_init(const struct device *dev) return -EINVAL; } - if (i2c_burst_write_dt(&config->bus, NCP5623_LED_CURRENT | NCP5623_MAX_BRIGHTNESS, buf, - 6)) { + if (i2c_write_dt(&config->bus, buf, sizeof(buf))) { LOG_ERR("%s: LED write failed", dev->name); return -EIO; }