Re: [PATCH v2 21/66] media: sun6i-csi: Always set exclusive module clock rate

Paul Kocialkowski
2022-03-01T15:40:00Z

[-- Attachment #1: Type: text/plain, Size: 1652 bytes --]

Hi Sakari,

On Mon 14 Feb 22, 18:31, Sakari Ailus wrote:
> Hi Paul,
>
> Thanks for the patchbomb.

I'll split it in the next revision.

> On Sat, Feb 05, 2022 at 07:53:44PM +0100, Paul Kocialkowski wrote:
> > In some situations the default rate of the module clock is not the
> > required one for operation (for example when reconfiguring the clock
> > tree to use a different parent). As a result, always set the correct
> > rate for the clock (and take care of cleanup).
> >
> > Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> > ---
> > .../platform/sunxi/sun6i-csi/sun6i_csi.c | 54 ++++++++++++++-----
> > 1 file changed, 41 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
> > index 8155e9560164..2355088fdc37 100644
> > --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
> > +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
> > @@ -856,28 +849,53 @@ static int sun6i_csi_resources_setup(struct sun6i_csi_device *csi_dev,
> > return PTR_ERR(csi_dev->clk_ram);
> > }
> >
> > + if (of_device_is_compatible(dev->of_node, "allwinner,sun50i-a64-csi"))
> > + clk_mod_rate = 300000000;
> > + else
> > + clk_mod_rate = 297000000;
>
> This would be nice to put in OF match data.
>
> Of course the driver did this already before the patch. The approach still
> scales badly.

Agreed, that could be another follow-up patch in the sun6i-csi rework series.

Paul

--
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]