]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: rcar-csi2: Improve FLD_FLD_EN macros
authorTomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Thu, 15 Jan 2026 10:06:58 +0000 (12:06 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 11 Mar 2026 00:05:31 +0000 (01:05 +0100)
Instead of having four macros for FLD_FLD_EN for different channels,
have just one FLD_FLD_EN(ch).

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>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/renesas/rcar-csi2.c

index d1b31ab8b8c4a01bd984eadbd72320d597cd2afe..3cd35adb680364b9942997aeed9a543703f939a7 100644 (file)
@@ -71,10 +71,7 @@ struct rcar_csi2;
 #define FLD_REG                                0x1c
 #define FLD_FLD_NUM(n)                 (((n) & 0xff) << 16)
 #define FLD_DET_SEL(n)                 (((n) & 0x3) << 4)
-#define FLD_FLD_EN4                    BIT(3)
-#define FLD_FLD_EN3                    BIT(2)
-#define FLD_FLD_EN2                    BIT(1)
-#define FLD_FLD_EN                     BIT(0)
+#define FLD_FLD_EN(ch)                 BIT(ch)
 
 /* Automatic Standby Control */
 #define ASTBY_REG                      0x20
@@ -1082,8 +1079,8 @@ static int rcsi2_start_receiver_gen3(struct rcar_csi2 *priv,
        }
 
        if (fmt->field == V4L2_FIELD_ALTERNATE)
-               fld = FLD_DET_SEL(1) | FLD_FLD_EN4 | FLD_FLD_EN3 | FLD_FLD_EN2
-                       | FLD_FLD_EN;
+               fld = FLD_DET_SEL(1) | FLD_FLD_EN(3) | FLD_FLD_EN(2) |
+                     FLD_FLD_EN(1) | FLD_FLD_EN(0);
 
        /*
         * Get the number of active data lanes inspecting the remote mbus