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; }