Re: [PATCH v2 04/15] pwm: lpss: Fix off by one error in base_unit math in pwm_lpss_prepare()

2020-06-09 Thread Andy Shevchenko
On Mon, Jun 08, 2020 at 01:13:01PM +0200, Hans de Goede wrote: > On 6/8/20 5:55 AM, Andy Shevchenko wrote: > > On Sun, Jun 07, 2020 at 08:18:29PM +0200, Hans de Goede wrote: > > > According to the data-sheet the way the PWM controller works is that > > > each input clock-cycle the base_unit gets

Re: [PATCH v2 04/15] pwm: lpss: Fix off by one error in base_unit math in pwm_lpss_prepare()

2020-06-08 Thread Hans de Goede
Hi, On 6/8/20 5:55 AM, Andy Shevchenko wrote: On Sun, Jun 07, 2020 at 08:18:29PM +0200, Hans de Goede wrote: 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 overflowing determines the PWM

Re: [PATCH v2 04/15] pwm: lpss: Fix off by one error in base_unit math in pwm_lpss_prepare()

2020-06-08 Thread Andy Shevchenko
On Sun, Jun 07, 2020 at 08:18:29PM +0200, Hans de Goede wrote: > 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 overflowing determines the PWM output frequency. > > So assuming e.g. a 16

[PATCH v2 04/15] pwm: lpss: Fix off by one error in base_unit math in pwm_lpss_prepare()

2020-06-07 Thread Hans de Goede
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 overflowing determines the PWM output frequency. So assuming e.g. a 16 bit counter this means that if base_unit is set to 1, after 65535 input