[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251107141648.1889-3-tumic@gpxsee.org>
Date: Fri, 7 Nov 2025 15:16:47 +0100
From: tumic@...see.org
To: Mauro Carvalho Chehab <mchehab@...nel.org>,
Hans Verkuil <hverkuil@...all.nl>
Cc: linux-media@...r.kernel.org,
linux-kernel@...r.kernel.org,
Martin Tůma <martin.tuma@...iteqautomotive.com>
Subject: [PATCH 2/3] pci: mgb4: Add support for GMSL3 coaxial module
From: Martin Tůma <martin.tuma@...iteqautomotive.com>
Add support for GMSL3 modules with a coaxial interface, a variant of the
already existing module with the id #4. The FW is the same as for all other
GMSL3 modules.
Signed-off-by: Martin Tůma <martin.tuma@...iteqautomotive.com>
---
drivers/media/pci/mgb4/mgb4_core.h | 7 +++++--
drivers/media/pci/mgb4/mgb4_vin.c | 27 +++++++++++++++++++++++----
2 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/drivers/media/pci/mgb4/mgb4_core.h b/drivers/media/pci/mgb4/mgb4_core.h
index 06ef8bb44089..bfae75f30c7c 100644
--- a/drivers/media/pci/mgb4/mgb4_core.h
+++ b/drivers/media/pci/mgb4/mgb4_core.h
@@ -21,8 +21,11 @@
#define MGB4_IS_GMSL1(mgbdev) \
(((mgbdev)->module_version >> 4) == 6)
#define MGB4_IS_GMSL3(mgbdev) \
- ((((mgbdev)->module_version >> 4) >= 2) && \
- (((mgbdev)->module_version >> 4) <= 4))
+ (((((mgbdev)->module_version >> 4) >= 2) && \
+ (((mgbdev)->module_version >> 4) <= 4)) || \
+ (((mgbdev)->module_version >> 4) == 8))
+#define MGB4_IS_GMSL3C(mgbdev) \
+ (((mgbdev)->module_version >> 4) == 8)
#define MGB4_IS_FPDL3(mgbdev) \
(((mgbdev)->module_version >> 4) == 1)
#define MGB4_HAS_VOUT(mgbdev) \
diff --git a/drivers/media/pci/mgb4/mgb4_vin.c b/drivers/media/pci/mgb4/mgb4_vin.c
index 116eb2fa3266..f66cd69a1284 100644
--- a/drivers/media/pci/mgb4/mgb4_vin.c
+++ b/drivers/media/pci/mgb4/mgb4_vin.c
@@ -50,6 +50,11 @@ static const struct i2c_board_info gmsl3_deser_info[] = {
{I2C_BOARD_INFO("deserializer2", 0x2A)},
};
+static const struct i2c_board_info gmsl3c_deser_info[] = {
+ {I2C_BOARD_INFO("deserializer1", 0x6A)},
+ {I2C_BOARD_INFO("deserializer2", 0x6C)},
+};
+
static const struct i2c_board_info gmsl1_deser_info[] = {
{I2C_BOARD_INFO("deserializer1", 0x2C)},
{I2C_BOARD_INFO("deserializer2", 0x6C)},
@@ -67,6 +72,13 @@ static const struct mgb4_i2c_kv gmsl3_i2c[] = {
{0x308, 0x01, 0x01}, {0x10, 0x20, 0x20}, {0x300, 0x40, 0x40}
};
+static const struct mgb4_i2c_kv gmsl3c_i2c[] = {
+ {0x01, 0x03, 0x03}, {0x300, 0x0C, 0x0C}, {0x03, 0xC0, 0xC0},
+ {0x1CE, 0x0E, 0x0E}, {0x11, 0x05, 0x05}, {0x05, 0xC0, 0x40},
+ {0x307, 0x0F, 0x00}, {0xA0, 0x03, 0x00}, {0x3E0, 0x07, 0x07},
+ {0x308, 0x01, 0x01}, {0x10, 0x20, 0x20}, {0x300, 0x40, 0x40}
+};
+
static const struct mgb4_i2c_kv gmsl1_i2c[] = {
};
@@ -812,10 +824,17 @@ static int deser_init(struct mgb4_vin_dev *vindev, int id)
struct device *dev = &vindev->mgbdev->pdev->dev;
if (MGB4_IS_GMSL3(vindev->mgbdev)) {
- info = &gmsl3_deser_info[id];
- addr_size = 16;
- values = gmsl3_i2c;
- count = ARRAY_SIZE(gmsl3_i2c);
+ if (MGB4_IS_GMSL3C(vindev->mgbdev)) {
+ info = &gmsl3c_deser_info[id];
+ addr_size = 16;
+ values = gmsl3c_i2c;
+ count = ARRAY_SIZE(gmsl3c_i2c);
+ } else {
+ info = &gmsl3_deser_info[id];
+ addr_size = 16;
+ values = gmsl3_i2c;
+ count = ARRAY_SIZE(gmsl3_i2c);
+ }
} else if (MGB4_IS_FPDL3(vindev->mgbdev)) {
info = &fpdl3_deser_info[id];
addr_size = 8;
--
2.51.0
Powered by blists - more mailing lists