Re: [PATCH 03/16] clk: sunxi-ng: Add fixed factor clock support

Jean-Francois Moine
2016-05-16T13:15:01Z

On Mon, 9 May 2016 18:05:20 +0800
Chen-Yu Tsai <wens@csie.org> wrote:

> > +}
> > +
> > +static long ccu_fixed_factor_round_rate(struct clk_hw *hw,
> > + unsigned long rate,
> > + unsigned long *parent_rate)
> > +{
> > + struct ccu_fixed_factor *fix =3D hw_to_ccu_fixed_factor(hw);
> > +
> > + return *parent_rate / fix->div * fix->mult;
>=20
> Why is this the other way around? With integer math it shouldn't be
> interchangeable. (Though it seems clk_fixed_factor does the same...)
>=20
> Also, clk_fixed_factor handles CLK_SET_RATE_PARENT. Do we need to do the
> same here?

Agree. Otherwise, sound in the H3 does not work.

--=20
Ken ar c'henta=F1 | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/