[PATCH v8 1/1] pwm: imx27: workaround of the pwm output bug when decrease the duty cycle

Marek Vasut marex at denx.de
Wed Oct 9 18:18:58 PDT 2024


On 10/9/24 5:37 PM, Frank Li wrote:
> On Wed, Oct 09, 2024 at 03:55:35AM +0200, Marek Vasut wrote:
>> On 10/8/24 9:41 PM, Frank Li wrote:
>>
>> [...]
>>
>>> +	c = clkrate * 1500;
>>> +	do_div(c, NSEC_PER_SEC);
>>> +
>>> +	local_irq_save(flags);
>>> +	val = FIELD_GET(MX3_PWMSR_FIFOAV, readl_relaxed(imx->mmio_base + MX3_PWMSR));
>>> +
>>> +	if (duty_cycles < imx->duty_cycle && (cr & MX3_PWMCR_EN)) {
>>
>> I think you can use state->enabled instead of (cr & MX3_PWMCR_EN).
> 
> state->enabled is new state. Need check old state here. If old state is
> disable, needn't this workaround at all.
Can you add code comment like this please ?

Thank you !



More information about the linux-arm-kernel mailing list