/* Change the brightness of a running blink program. 
In order to change the brightness during blinking, we overwrite only the first command and start execution again. */
static int lp5562_update_blinking_brightness(const struct device *dev, enum lp5562_led_sources engine, uint8_t brightness_on)
/* Change the brightness of a running blink program. 
In order to change the brightness during blinking, we overwrite only the first command and start execution again. */
static int lp5562_update_blinking_brightness(const struct device *dev, enum lp5562_led_sources engine, uint8_t brightness_on)
{
	int ret;
	ret = lp5562_stop_program_exec(dev, engine);
	if (ret) {
		return ret;
	}
	ret = lp5562_set_engine_op_mode(dev, engine, LP5562_OP_MODE_LOAD);
	if (ret) {
		return ret;
	}
	ret = lp5562_program_set_brightness(dev, engine, 0, brightness_on);
	if (ret) {
		return ret;
	}
	ret = lp5562_start_program_exec(dev, engine);
	if (ret) {
		LOG_ERR("Failed to execute program.");
		return ret;
	}
	return 0;
}