Re: [PATCH v8 7/8] pwm: pca9685: Restrict period change for enabled PWMs

From: Uwe Kleine-König
Date: Sat Apr 17 2021 - 11:46:24 EST


On Mon, Apr 12, 2021 at 03:27:44PM +0200, Clemens Gruber wrote:
> Previously, the last used PWM channel could change the global prescale
> setting, even if other channels are already in use.
>
> Fix it by only allowing the first enabled PWM to change the global
> chip-wide prescale setting. If there is more than one channel in use,
> the prescale settings resulting from the chosen periods must match.
>
> GPIOs do not count as enabled PWMs as they are not using the prescaler
> and can't change it.
>
> Signed-off-by: Clemens Gruber <clemens.gruber@xxxxxxxxxxxx>

I think this patch could be a tad simpler (by just counting the number
of enabled channels instead of maintaining a bitmap). Still this is
beneficial, so:

Acked-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |

Attachment: signature.asc
Description: PGP signature