Re: [PATCH v2] media: rcar-vin: Add support to select data pins for YCbCr422-8bit input

From: Geert Uytterhoeven
Date: Mon Aug 03 2020 - 15:15:25 EST


Hi Niklas,

On Mon, Aug 3, 2020 at 8:06 PM Niklas <niklas.soderlund@xxxxxxxxxxxx> wrote:
> On 2020-08-03 17:02:53 +0100, Lad Prabhakar wrote:
> > Select the data pins for YCbCr422-8bit input format depending on
> > bus_width and data_shift passed as part of DT.
> >
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>
> > Reviewed-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>

> > --- a/drivers/media/platform/rcar-vin/rcar-core.c
> > +++ b/drivers/media/platform/rcar-vin/rcar-core.c
> > @@ -624,6 +624,11 @@ static int rvin_parallel_parse_v4l2(struct device *dev,
> > vin->parallel = rvpe;
> > vin->parallel->mbus_type = vep->bus_type;
> >
> > + /* select VInDATA[15:8] pins for YCbCr422-8bit format */
> > + if (vep->bus.parallel.bus_width == BUS_WIDTH_8 &&
> > + vep->bus.parallel.data_shift == DATA_SHIFT_8)
> > + vin->parallel->ycbcr_8b_g = true;
> > +
>
> I would store the bus_width and bus_shift values in the struct
> rvin_parallel_entity and evaluate them in place rater then create a flag
> for this specific use-case..
>
> Also according to the documentation is the check correct? Do we not wish
> to use the new mode when bus_width == 16 and bus_shift == 8. The check
> you have here seems to describe a 8 lane bus where 0 lanes are used.

The bus width used is 8.

Documentation/devicetree/bindings/media/video-interfaces.txt:

- bus-width: number of data lines actively used, valid for the
parallel busses.
- data-shift: on the parallel data busses, if bus-width is used to specify the
number of data lines, data-shift can be used to specify which data lines are
used, e.g. "bus-width=<8>; data-shift=<2>;" means, that lines 9:2 are used.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds