lkml.org 
[lkml]   [2018]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 6/6] ARM: PWM: add allwinner sun8i R40/T3/V40 PWM support.
Hello,

On Mon, Nov 26, 2018 at 10:31:58PM +0100, Uwe Kleine-König wrote:
> > +static int sun8i_pwm_config(struct sun8i_pwm_chip *sun8i_pwm, u8 ch,
> > + struct pwm_state *state)
> > +{
> > +[...]
> > + clk_rate = clk_get_rate(clk);
> > + val = state->period * clk_rate;
> > + do_div(val, NSEC_PER_SEC);
> > + if (val <= 1) {
> > + dev_err(sun8i_pwm->chip.dev,
> > + "Period expects a larger value\n");
> > + return -EINVAL;
> > + }
> > +
> > + /* change clock source to "mux-1" */
> > + clk_disable_unprepare(sun8i_pwm->clk);
> > + devm_clk_put(sun8i_pwm->chip.dev, sun8i_pwm->clk);
> > + sun8i_pwm->clk = clk;
>
> sun8i_pwm is shared for all 8 PWMs, right? So if you assign mux-1 here
> for the second mux, how does this influence the first PWM?

To clearify my question:

after the first pwm is used and enabled (maybe using mux-0) changing
sun8i_pwm->clk for the second pwm is broken because then when the first
pwm is disabled the wrong clock is stopped.

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |

\
 
 \ /
  Last update: 2018-12-03 10:49    [W:0.088 / U:0.872 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site