Re: [PATCH v5 2/4] clk: rockchip: Add internal support for 24-bit fractional dividers

From: Cunhao Lu

Date: Sun Nov 15 2026 - 22:17:50 EST


Hi,

Thank you very much for your review.

> > Add an internal Rockchip fractional-divider helper and clock branch type
> > for this register layout. This provides the support needed by the RK3572
> > audio fractional clocks.
>
> Please add a paragraph about the "v2" naming.
> I assume the v2 is a Rockchip naming, because v1 was the other one that
> could still fit the regular franctional divider.
>
> > +static inline u32 clk_fd_v2_readl(struct clk_fractional_divider_v2 *fd,
> > + void __iomem *reg)
> > +{
> > + return readl(reg);
> > +}
> > +
> > +static inline void clk_fd_v2_writel(struct clk_fractional_divider_v2 *fd,
> > + void __iomem *reg, u32 val)
> > +{
> > + writel(val, reg);
> > +}
>
> why do we have those? They do not serve any purpose I can see.
> So please just use readl and writel directly at the appropriate places.
>
> [...]
>
> > + if (fd->flags & CLK_FRAC_DIVIDER_ZERO_BASED) {
> > + (*m)--;
> > + (*n)--;
> > + }
>
> ... blank line please ...
>
> > + if (!*m && !(fd->flags & CLK_FRAC_DIVIDER_ZERO_BASED))
> > + return clk_fd_v2_get_low_rate_divider(fd, rate, parent_rate, m, n);
>
> ... blank line please ...
>
> [...]
>
> > +static const struct clk_ops clk_fractional_divider_ops_v2 = {
> > + .recalc_rate = clk_fd_v2_recalc_rate,
> > + .determine_rate = clk_fd_v2_determine_rate,
> > + .set_rate = clk_fd_v2_set_rate,
> > +};
> > +
> > +static struct clk_hw *clk_hw_register_fractional_divider_v2(struct device *dev,
>
> maybe adapt the function name.
> Function above abbreviated things to
>
> clk_fd_v2_something, so naming this clk_hw_register_fd_v2()
> might make that line less unwieldy?

I will fix these issues in v6.

Best regards,
Cunhao Lu

pw-bot: cr