arch/arm64/imx9: skip unused PWM channel slots

A channel number of zero marks an unused slot, as pwm.rst documents.
pwm_start() handed every slot to pwm_update_duty(), which refuses
channel 0, so a caller that fills only some slots, like PX4's tone
alarm, got EINVAL.

Signed-off-by: Royyan Zahir <royzah@gmail.com>
This commit is contained in:
Royyan Zahir 2026-10-01 07:18:13 +04:00 • committed by GUIDINGLI
parent e65ca99128
commit dfd1bf6738
2 changed files with 10 additions and 0 deletions

View file

@ -602,6 +602,11 @@ static int pwm_start(struct pwm_lowerhalf_s *dev,
break;
}
if (info->channels[i].channel == 0)
{
continue;
}
ret = pwm_update_duty(priv, info->channels[i].channel,
info->channels[i].duty);
}

View file

@ -541,6 +541,11 @@ static int pwm_start(struct pwm_lowerhalf_s *dev,
break;
}
if (info->channels[i].channel == 0)
{
continue;
}
ret = pwm_update_duty(priv, info->channels[i].channel,
info->channels[i].duty);
}