On Sun, Jun 07, 2020 at 08:18:35PM +0200, Hans de Goede wrote:
> Replace the enable, disable and config pwm_ops with an apply op,
> to support the new atomic PWM API.
...
> -static int crc_pwm_calc_clk_div(int period_ns)
> +static int crc_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
> + const struct pwm_state *state)
> {
> - int clk_div;
> -
> - clk_div = PWM_BASE_CLK_MHZ * period_ns / (256 * NSEC_PER_MHZ);
> - /* clk_div 1 - 128, maps to register values 0-127 */
> - if (clk_div > 0)
> - clk_div--;
> -
> - return clk_div;
> -}
...
> + clk_div = PWM_BASE_CLK_MHZ * state->period /
> + (256 * NSEC_PER_MHZ);
> + /* clk_div 1 - 128, maps to register values 0-127 */
> + if (clk_div > 0)
> + clk_div--;
And again... :-(
--
With Best Regards,
Andy Shevchenko
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel