]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: rcar-vin: Add RCAR_GEN4 model value
authorTomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Thu, 24 Apr 2025 07:05:33 +0000 (10:05 +0300)
committerHans Verkuil <hverkuil@xs4all.nl>
Fri, 2 May 2025 08:16:43 +0000 (10:16 +0200)
Currently Gen4 VINs are marked as RCAN_GEN3 models. Add a new enum
value, RCAR_GEN4, and use it for Gen4 VINs. No functional changes in
this patch.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://lore.kernel.org/r/20250424-rcar-fix-raw-v2-1-f6afca378124@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/platform/renesas/rcar-vin/rcar-core.c
drivers/media/platform/renesas/rcar-vin/rcar-dma.c
drivers/media/platform/renesas/rcar-vin/rcar-vin.h

index cfbc9ec27706baa7d2784ff15b8d8063a57e8b68..846ae7989b1d3c6d232cd58bac48d02085c4b87a 100644 (file)
@@ -1273,7 +1273,7 @@ static const struct rvin_info rcar_info_r8a77995 = {
 };
 
 static const struct rvin_info rcar_info_gen4 = {
-       .model = RCAR_GEN3,
+       .model = RCAR_GEN4,
        .use_mc = true,
        .use_isp = true,
        .nv12 = true,
index f7b80e61a98751781befef7685a1a56ec0f4fd41..374396bcf8b994c959b869e9ee03d646a947f2f0 100644 (file)
@@ -783,7 +783,7 @@ static int rvin_setup(struct rvin_dev *vin)
        }
 
        /* Make sure input interface and input format is valid. */
-       if (vin->info->model == RCAR_GEN3) {
+       if (vin->info->model == RCAR_GEN3 || vin->info->model == RCAR_GEN4) {
                switch (vnmc & VNMC_INF_MASK) {
                case VNMC_INF_YUV8_BT656:
                case VNMC_INF_YUV10_BT656:
@@ -806,7 +806,7 @@ static int rvin_setup(struct rvin_dev *vin)
        }
 
        /* Enable VSYNC Field Toggle mode after one VSYNC input */
-       if (vin->info->model == RCAR_GEN3)
+       if (vin->info->model == RCAR_GEN3 || vin->info->model == RCAR_GEN4)
                dmr2 = VNDMR2_FTEV;
        else
                dmr2 = VNDMR2_FTEV | VNDMR2_VLV(1);
@@ -906,7 +906,7 @@ static int rvin_setup(struct rvin_dev *vin)
                if (input_is_yuv == output_is_yuv)
                        vnmc |= VNMC_BPS;
 
-               if (vin->info->model == RCAR_GEN3) {
+               if (vin->info->model == RCAR_GEN3 || vin->info->model == RCAR_GEN4) {
                        /* Select between CSI-2 and parallel input */
                        if (vin->is_csi)
                                vnmc &= ~VNMC_DPINE;
@@ -1287,7 +1287,7 @@ static int rvin_mc_validate_format(struct rvin_dev *vin, struct v4l2_subdev *sd,
 
        if (rvin_scaler_needed(vin)) {
                /* Gen3 can't scale NV12 */
-               if (vin->info->model == RCAR_GEN3 &&
+               if ((vin->info->model == RCAR_GEN3 || vin->info->model == RCAR_GEN4) &&
                    vin->format.pixelformat == V4L2_PIX_FMT_NV12)
                        return -EPIPE;
 
index 934474d2334ad7d1c1a1b89c48eea40659340ec7..83d1b2734c4121a51589d7dfcefc2c67f4545287 100644 (file)
@@ -39,6 +39,7 @@ enum model_id {
        RCAR_M1,
        RCAR_GEN2,
        RCAR_GEN3,
+       RCAR_GEN4,
 };
 
 enum rvin_csi_id {