Hello, On Fri, Apr 14, 2023 at 09:53:09AM +0000, Biju Das wrote: > > On Thu, Mar 30, 2023 at 12:16:32PM +0100, Biju Das wrote: > > > + val = RZ_MTU3_TCR_CKEG_RISING | prescale; > > > + if (priv->map->channel == pwm->hwpwm) { > > > + rz_mtu3_8bit_ch_write(priv->mtu, RZ_MTU3_TCR, > > > + RZ_MTU3_TCR_CCLR_TGRA | val); > > > > If the sibling PWM on the same channel is on, you're overwriting its > > prescale value here, are you not? > > Yes, you are correct. Will cache prescale and add the below code > in rz_mtu3_pwm_config(). Is it ok? > > + * Prescalar is shared by multiple channels, so prescale can > + * NOT be modified when there are multiple channels in use with > + * different settings. > + */ > + if (prescale != rz_mtu3_pwm->prescale[ch] && rz_mtu3_pwm->user_count[ch] > 1) > + return -EBUSY; If the other PWM is off, you can (and should) change the prescale value. Also if the current prescale value is less than the one you want to set, you can handle that. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ |
Attachment:
signature.asc
Description: PGP signature