/* Write a script into a given PWM engine, concluding with PWM_END. If 'kill' is nonzero, the engine will be shut down at the end of the script, producing a zero output. Otherwise the engine will be kept running at the final PWM level indefinitely.  */
static void lm8323_write_pwm(struct lm8323_pwm *pwm, int kill, int len, const u16 *cmds)
/* Write a script into a given PWM engine, concluding with PWM_END. If 'kill' is nonzero, the engine will be shut down at the end of the script, producing a zero output. Otherwise the engine will be kept running at the final PWM level indefinitely.  */
static void lm8323_write_pwm(struct lm8323_pwm *pwm, int kill, int len, const u16 *cmds)
{
	int i;
	for (i = 0; i < len; i++)
		lm8323_write_pwm_one(pwm, i, cmds[i]);
	lm8323_write_pwm_one(pwm, i++, PWM_END(kill));
	lm8323_write(pwm->chip, 2, LM8323_CMD_START_PWM, pwm->id);
	pwm->running = true;
}