Re: [PATCH v4 04/16] pwm: lpss: Add range limit check for the base_unit register value

2020-07-10 Thread Andy Shevchenko
On Thu, Jul 09, 2020 at 04:33:50PM +0200, Hans de Goede wrote: > On 7/9/20 4:21 PM, Andy Shevchenko wrote: > > On Thu, Jul 09, 2020 at 03:23:13PM +0200, Hans de Goede wrote: ... > > You can use clamp_val(). > > I did not know about that, that will work nicely I will switch to clamp_val > for

Re: [PATCH v4 04/16] pwm: lpss: Add range limit check for the base_unit register value

2020-07-10 Thread Andy Shevchenko
On Wed, Jul 08, 2020 at 11:14:20PM +0200, Hans de Goede wrote: > When the user requests a high enough period ns value, then the > calculations in pwm_lpss_prepare() might result in a base_unit value of 0. > > But according to the data-sheet the way the PWM controller works is that > each input

Re: [PATCH v4 04/16] pwm: lpss: Add range limit check for the base_unit register value

2020-07-10 Thread Andy Shevchenko
On Thu, Jul 09, 2020 at 03:23:13PM +0200, Hans de Goede wrote: > On 7/9/20 2:53 PM, Andy Shevchenko wrote: > > On Wed, Jul 08, 2020 at 11:14:20PM +0200, Hans de Goede wrote: > > > When the user requests a high enough period ns value, then the > > > calculations in pwm_lpss_prepare() might result

Re: [PATCH v4 04/16] pwm: lpss: Add range limit check for the base_unit register value

2020-07-09 Thread Hans de Goede
Hi, On 7/9/20 4:21 PM, Andy Shevchenko wrote: On Thu, Jul 09, 2020 at 03:23:13PM +0200, Hans de Goede wrote: On 7/9/20 2:53 PM, Andy Shevchenko wrote: On Wed, Jul 08, 2020 at 11:14:20PM +0200, Hans de Goede wrote: When the user requests a high enough period ns value, then the calculations in

Re: [PATCH v4 04/16] pwm: lpss: Add range limit check for the base_unit register value

2020-07-09 Thread Hans de Goede
Hi, On 7/9/20 2:53 PM, Andy Shevchenko wrote: On Wed, Jul 08, 2020 at 11:14:20PM +0200, Hans de Goede wrote: When the user requests a high enough period ns value, then the calculations in pwm_lpss_prepare() might result in a base_unit value of 0. But according to the data-sheet the way the

[PATCH v4 04/16] pwm: lpss: Add range limit check for the base_unit register value

2020-07-08 Thread Hans de Goede
When the user requests a high enough period ns value, then the calculations in pwm_lpss_prepare() might result in a base_unit value of 0. But according to the data-sheet the way the PWM controller works is that each input clock-cycle the base_unit gets added to a N bit counter and that counter