diff mbox series

[v4,3/5] media: rcar-vin: Add family compatible for R-Car Gen4 family

Message ID 20240624144108.1771189-4-niklas.soderlund+renesas@ragnatech.se (mailing list archive)
State New
Headers show
Series rcar-vin: Add support for R-Car V4M | expand

Commit Message

Niklas Söderlund June 24, 2024, 2:41 p.m. UTC
Add the Gen4 family compatible. This will be used instead of a SoC
specific compatible for the new Gen4 SoC V4M being added. As the first
Gen4 board V4H had already been added prior to the Gen4 family fallback
was added this need to be keep for backward compatibility.

While at it reduce the info structure bloat and reuse the Gen4 info
structure for V3U (R8A779A0), which is the last Gen3 board but that had
a completely new video capture design that is compatible with Gen4 VIN.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
* Changes since v3
- Reworked to deal with a Gen4 family compatible instead of a V4M SoC
  specific one.
- Dropped review tags.

* Changes since v2
- Extend commit message to explain why SoC specific compatibles are use
  in the driver instead of adding a new Gen4 fallback to cover both V4H
  and V4M.
- Add review tags.

* Changes since v1
- Create a shared Gen4 info strucutre.
---
 .../platform/renesas/rcar-vin/rcar-core.c     | 23 +++++++++----------
 1 file changed, 11 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-core.c b/drivers/media/platform/renesas/rcar-vin/rcar-core.c
index 809c3a38cc4a..a8b6895de66d 100644
--- a/drivers/media/platform/renesas/rcar-vin/rcar-core.c
+++ b/drivers/media/platform/renesas/rcar-vin/rcar-core.c
@@ -1274,16 +1274,7 @@  static const struct rvin_info rcar_info_r8a77995 = {
 	.scaler = rvin_scaler_gen3,
 };
 
-static const struct rvin_info rcar_info_r8a779a0 = {
-	.model = RCAR_GEN3,
-	.use_mc = true,
-	.use_isp = true,
-	.nv12 = true,
-	.max_width = 4096,
-	.max_height = 4096,
-};
-
-static const struct rvin_info rcar_info_r8a779g0 = {
+static const struct rvin_info rcar_info_gen4 = {
 	.model = RCAR_GEN3,
 	.use_mc = true,
 	.use_isp = true,
@@ -1355,11 +1346,19 @@  static const struct of_device_id rvin_of_id_table[] = {
 	},
 	{
 		.compatible = "renesas,vin-r8a779a0",
-		.data = &rcar_info_r8a779a0,
+		.data = &rcar_info_gen4,
 	},
 	{
+		/*
+		 * Needed for compatibility with old DTS files as it was added
+		 * before the Gen4 family compatible.
+		 */
 		.compatible = "renesas,vin-r8a779g0",
-		.data = &rcar_info_r8a779g0,
+		.data = &rcar_info_gen4,
+	},
+	{
+		.compatible = "renesas,rcar-gen4-vin",
+		.data = &rcar_info_gen4,
 	},
 	{ /* Sentinel */ },
 };