RE: [PATCH v16] pwm: opencores: Add PWM driver support
From: William Qiu
Date: Mon Dec 23 2024 - 23:24:27 EST
> -----Original Message-----
> From: Uwe Kleine-König <ukleinek@xxxxxxxxxx>
> Sent: 2024年12月24日 1:12
> To: William Qiu <william.qiu@xxxxxxxxxxxxxxxx>
> Cc: linux-kernel@xxxxxxxxxxxxxxx; linux-pwm@xxxxxxxxxxxxxxx; Hal Feng
> <hal.feng@xxxxxxxxxxxxxxxx>; Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>
> Subject: Re: [PATCH v16] pwm: opencores: Add PWM driver support
>
> Hello William,
>
> On Mon, Dec 23, 2024 at 02:47:59AM +0000, William Qiu wrote:
> > > > + duty_data = mul_u64_u32_div(state->duty_cycle, ddata->clk_rate,
> > > NSEC_PER_SEC);
> > > > + if (!duty_data)
> > > > + return -EINVAL;
> > >
> > > I can understand that period_data == 0 is an error, but duty_data ==
> > > 0 could/should just work?!
> >
> > It means no need to check whether the duty is valid?
>
> No, it means that I expect that duty_data == 0 is a valid setting and most
> controllers support it.
>
> Best regards
> Uwe
So we just need to check duty < 0?
Best Regards,
William