]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: pci: mgb4: Add support for GMSL3 coaxial modules
authorMartin Tůma <martin.tuma@digiteqautomotive.com>
Fri, 16 Jan 2026 12:55:54 +0000 (13:55 +0100)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Sat, 17 Jan 2026 08:08:02 +0000 (09:08 +0100)
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@digiteqautomotive.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/pci/mgb4/mgb4_core.h
drivers/media/pci/mgb4/mgb4_vin.c

index 06ef8bb4408955a2db4dc0f1d62e2897192dc700..bfae75f30c7c709cee96cc280aaf224fe7e1985e 100644 (file)
 #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) \
index be55491b52b2427b19a4684e58e2ae1b9dd034cd..e782db79686f0bbaca51b2b3a03297165b0771ec 100644 (file)
@@ -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, 0x02}, {0x300, 0x0C, 0x08}, {0x03, 0xC0, 0x00},
+       {0x1CE, 0x0E, 0x0E}, {0x11, 0x05, 0x05}, {0x05, 0xC0, 0x40},
+       {0x307, 0x0F, 0x00}, {0xA0, 0x03, 0x00}, {0x3E0, 0x07, 0x00},
+       {0x308, 0x01, 0x00}, {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;