Skip to contentSkip to conversation

Add support for MAX96714F and MAX96717F GMSL2 ser/des

PATCH Superseded Julien Massot 4 participants 16 messages Dec 8, 2023 – Jan 8, 2024

Subsystems (4)

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

Julien Massot

author maintainer
#0 lore raw

v2 cover Add support for MAX96714F and MAX96717F GMSL2 ser/des

Change in v2:
- move dt-binding changes from 3/4 to 1/4

Hi,

These patches add support for Maxim MAX96714F deserializer and MAX96717F serializer.

MAX96714F has one GMSL2 input port and one CSI2 4 lanes output port, MAX96717F has one CSI2 input port and one GMSL2 output port.

The drivers support the tunnel mode where all the
CSI2 traffic coming from an imager is replicated through the deserializer output port.

Both MAX96714F and MAX96717F are limited to a 3Gbps forward link rate leaving a maximum of 2.6Gbps for the video payload.

Julien Massot (4):
dt-bindings: media: add Maxim MAX96714F GMSL2 Deserializer
dt-bindings: media: add Maxim MAX96717F GMSL2 Serializer
media: i2c: add MAX96714 driver
media: i2c: add MAX96717 driver

 .../bindings/media/i2c/maxim,max96714f.yaml   |  163 +++
 .../bindings/media/i2c/maxim,max96717f.yaml   |  144 +++
 MAINTAINERS                                   |   12 +
 drivers/media/i2c/Kconfig                     |   26 +
 drivers/media/i2c/Makefile                    |    2 +
 drivers/media/i2c/max96714.c                  |  945 ++++++++++++++++
 drivers/media/i2c/max96717.c                  | 1003 +++++++++++++++++
 7 files changed, 2295 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/maxim,max96714f.yaml
 create mode 100644 Documentation/devicetree/bindings/media/i2c/maxim,max96717f.yaml
 create mode 100644 drivers/media/i2c/max96714.c
 create mode 100644 drivers/media/i2c/max96717.c
Signature · 1 line
2.43.0
author maintainer
#1 lore raw

PATCH v2 1/4 dt-bindings: media: add Maxim MAX96714F GMSL2 Deserializer

Add DT bindings for Maxim MAX96714F GMSL2 Deserializer.

---
 .../bindings/media/i2c/maxim,max96714f.yaml   | 163 ++++++++++++++++++
 1 file changed, 163 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/maxim,max96714f.yaml
Documentation/devicetree/bindings/media/i2c/maxim,max96714f.yaml new file +163 -0
new file mode 100644
index 000000000000..8a2a06e7e279
@@ -0,0 +1,163 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) 2023 Collabora Ltd.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/i2c/maxim,max96714f.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: GMSL2 to CSI-2 Deserializer
+
+maintainers:
+  - Julien Massot <[email protected]>
+
+description: |
+  The MAX96714F deserializer converts GMSL2 serial inputs into MIPI
+  CSI-2 D-PHY or C-PHY formatted output. The device allows the GMSL2 link to
+  simultaneously transmit bidirectional control-channel data while forward
+  video transmissions are in progress. The MAX96714F can connect to one
+  remotely located serializer using industry-standard coax or STP
+  interconnects. The device cans operate in pixel or tunnel mode. In pixel mode
+  the MAX96714F can select individual video stream, while the tunnel mode forward all
+  the MIPI data received by the serializer.
+
+  The GMSL2 serial link operates at a fixed rate of 3Gbps in the
+  forward direction and 187.5Mbps in the reverse direction.
+
+properties:
+  compatible:
+    const: maxim,max96714f
+
+  reg:
+    description: I2C device address
+    maxItems: 1
+
+  enable-gpios: true
+
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+
+    properties:
+      port@0:
+        $ref: /schemas/graph.yaml#/properties/port
+        unevaluatedProperties: false
+        description: GMSL Input
+        properties:
+          endpoint:
+            $ref: /schemas/media/video-interfaces.yaml#
+            unevaluatedProperties: false
+            description:
+              Endpoint for GMSL2-Link port.
+
+      port@1:
+        $ref: /schemas/graph.yaml#/$defs/port-base
+        unevaluatedProperties: false
+        description: CSI-2 Output
+
+        properties:
+          endpoint:
+            $ref: /schemas/media/video-interfaces.yaml#
+            unevaluatedProperties: false
+
+            properties:
+              data-lanes: true
+              bus-type:
+                enum:
+                  - 4 # MEDIA_BUS_TYPE_CSI2_DPHY
+
+            required:
+              - data-lanes
+              - bus-type
+
+    required:
+      - port@1
+
+  i2c-gate:
+    $ref: /schemas/i2c/i2c-controller.yaml
+    unevaluatedProperties: false
+    description: |
+      The MAX96714 will pass through and forward the I2C requests from the
+      incoming I2C bus over the GMSL2 link. Therefore it supports an i2c-gate
+      subnode to configure a serializer.
+
+  port0-poc-supply:
+    description: Regulator providing Power over Coax for a particular port
+
+required:
+  - compatible
+  - reg
+  - ports
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/media/video-interfaces.h>
+
+    main_i2c2 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        gmsl-deserializer@28 {
+            compatible = "maxim,max96714f";
+            reg = <0x28>;
+            enable-gpios = <&main_gpio0 37 GPIO_ACTIVE_HIGH>;
+
+            ports {
+                #address-cells = <1>;
+                #size-cells = <0>;
+                port@0 {
+                    reg = <0>;
+                    max96714_gmsl_in: endpoint {
+                        remote-endpoint = <&max96917f_gmsl_out>;
+                    };
+                };
+
+                port@1 {
+                    reg = <1>;
+                    max96714_csi_out: endpoint {
+                        bus-type = <MEDIA_BUS_TYPE_CSI2_DPHY>;
+                        clock-lanes = <0>;
+                        data-lanes = <1 2 3 4>;
+                        link-frequencies = /bits/ 64 <400000000>;
+                        remote-endpoint = <&csi_in>;
+                    };
+                };
+            };
+
+            i2c-gate {
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                gmsl-serializer@40 {
+                    compatible = "maxim,max96717f";
+                    reg = <0x40>;
+                    gpio-controller;
+                    #gpio-cells = <2>;
+                    #clock-cells = <0>;
+
+                    ports {
+                        #address-cells = <1>;
+                        #size-cells = <0>;
+
+                        port@0 {
+                            reg = <0>;
+                            max96717f_csi_in: endpoint {
+                                data-lanes = <1 2>;
+                                lane-polarities = <1 0 1>;
+                                remote-endpoint = <&vd5661_csi>;
+                            };
+                        };
+
+                        port@1 {
+                            reg = <1>;
+                            max96917f_gmsl_out: endpoint {
+                                remote-endpoint = <&max96714_gmsl_in>;
+                            };
+                        };
+                    };
+                };
+            };
+        };
+    };
+...
Signature · 1 line
2.43.0
maintainer
#2 lore raw

Re: [PATCH v2 1/4] dt-bindings: media: add Maxim MAX96714F GMSL2 Deserializer

Quoted 8 lines · Julien Massot

Add DT bindings for Maxim MAX96714F GMSL2 Deserializer.

---
 .../bindings/media/i2c/maxim,max96714f.yaml   | 163 ++++++++++++++++++
 1 file changed, 163 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/maxim,max96714f.yaml

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/media/i2c/maxim,max96714f.example.dtb: /example-0/main_i2c2/gmsl-deserializer@28/i2c-gate/gmsl-serializer@40: failed to match any schema with compatible: ['maxim,max96717f']

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

#3 lore raw

Re: [PATCH v2 1/4] dt-bindings: media: add Maxim MAX96714F GMSL2 Deserializer

In reply to Julien Massot
Quoted 3 lines · Julien Massot

Add DT bindings for Maxim MAX96714F GMSL2 Deserializer.

Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC (and consider --no-git-fallback argument). It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.

Limited review follows, as robot already pointed out issues...

Quoted 32 lines
---
 .../bindings/media/i2c/maxim,max96714f.yaml   | 163 ++++++++++++++++++
 1 file changed, 163 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/maxim,max96714f.yaml
Documentation/devicetree/bindings/media/i2c/maxim,max96714f.yaml new file +21 -0
new file mode 100644
index 000000000000..8a2a06e7e279
@@ -0,0 +1,163 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) 2023 Collabora Ltd.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/i2c/maxim,max96714f.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: GMSL2 to CSI-2 Deserializer
+
+maintainers:
+  - Julien Massot <[email protected]>
+
+description: |
+  The MAX96714F deserializer converts GMSL2 serial inputs into MIPI
+  CSI-2 D-PHY or C-PHY formatted output. The device allows the GMSL2 link to
+  simultaneously transmit bidirectional control-channel data while forward
+  video transmissions are in progress. The MAX96714F can connect to one
+  remotely located serializer using industry-standard coax or STP
+  interconnects. The device cans operate in pixel or tunnel mode. In pixel mode
+  the MAX96714F can select individual video stream, while the tunnel mode forward all
+  the MIPI data received by the serializer.

Documentation/devicetree/bindings/media/i2c/maxim,max96714f.yaml line 31

Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/maxim,max96714f.yaml new file +10 -0
+
+  The GMSL2 serial link operates at a fixed rate of 3Gbps in the
+  forward direction and 187.5Mbps in the reverse direction.
+
+properties:
+  compatible:
+    const: maxim,max96714f
+
+  reg:
+    description: I2C device address

Drop

Quoted 56 lines
Documentation/devicetree/bindings/media/i2c/maxim,max96714f.yaml new file +56 -0
+    maxItems: 1
+
+  enable-gpios: true
+
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+
+    properties:
+      port@0:
+        $ref: /schemas/graph.yaml#/properties/port
+        unevaluatedProperties: false
+        description: GMSL Input
+        properties:
+          endpoint:
+            $ref: /schemas/media/video-interfaces.yaml#
+            unevaluatedProperties: false
+            description:
+              Endpoint for GMSL2-Link port.
+
+      port@1:
+        $ref: /schemas/graph.yaml#/$defs/port-base
+        unevaluatedProperties: false
+        description: CSI-2 Output
+
+        properties:
+          endpoint:
+            $ref: /schemas/media/video-interfaces.yaml#
+            unevaluatedProperties: false
+
+            properties:
+              data-lanes: true
+              bus-type:
+                enum:
+                  - 4 # MEDIA_BUS_TYPE_CSI2_DPHY
+
+            required:
+              - data-lanes
+              - bus-type
+
+    required:
+      - port@1
+
+  i2c-gate:
+    $ref: /schemas/i2c/i2c-controller.yaml
+    unevaluatedProperties: false
+    description: |
+      The MAX96714 will pass through and forward the I2C requests from the
+      incoming I2C bus over the GMSL2 link. Therefore it supports an i2c-gate
+      subnode to configure a serializer.
+
+  port0-poc-supply:
+    description: Regulator providing Power over Coax for a particular port
+
+required:
+  - compatible
+  - reg

Documentation/devicetree/bindings/media/i2c/maxim,max96714f.yaml line 97

Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/maxim,max96714f.yaml new file +10 -0
+  - ports
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/media/video-interfaces.h>
+
+    main_i2c2 {

Node names should be generic. See also an explanation and list of examples (not exhaustive) in DT specification:
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation

Documentation/devicetree/bindings/media/i2c/maxim,max96714f.yaml line 134

Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/maxim,max96714f.yaml new file +9 -0
+        #address-cells = <1>;
+        #size-cells = <0>;
 
+            i2c-gate {
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                gmsl-serializer@40 {
+                    compatible = "maxim,max96717f";
+                    reg = <0x40>;

Not documented.

Quoted 1 line

+...

Best regards,
Krzysztof

author maintainer
#4 lore raw

Re: [PATCH v2 1/4] dt-bindings: media: add Maxim MAX96714F GMSL2 Deserializer

Hi Krzysztof,

Thanks for the review.

Quoted 10 lines · Krzysztof Kozlowski
Quoted 3 lines · Julien Massot

Add DT bindings for Maxim MAX96714F GMSL2 Deserializer.

Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC (and consider --no-git-fallback argument). It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.

Will do

Quoted 38 lines

Limited review follows, as robot already pointed out issues.. >

Quoted 36 lines
---
  .../bindings/media/i2c/maxim,max96714f.yaml   | 163 ++++++++++++++++++
  1 file changed, 163 insertions(+)

create mode 100644 Documentation/devicetree/bindings/media/i2c/maxim,max96714f.yaml

Documentation/devicetree/bindings/media/i2c/maxim,max96714f.yaml new file +25 -0
new file mode 100644
index 000000000000..8a2a06e7e279
@@ -0,0 +1,163 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) 2023 Collabora Ltd.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/i2c/maxim,max96714f.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: GMSL2 to CSI-2 Deserializer
+
+maintainers:
+  - Julien Massot <[email protected]>
+
+description: |
+  The MAX96714F deserializer converts GMSL2 serial inputs into MIPI
+  CSI-2 D-PHY or C-PHY formatted output. The device allows the GMSL2 link to
+  simultaneously transmit bidirectional control-channel data while forward
+  video transmissions are in progress. The MAX96714F can connect to one
+  remotely located serializer using industry-standard coax or STP
+  interconnects. The device cans operate in pixel or tunnel mode. In pixel mode
+  the MAX96714F can select individual video stream, while the tunnel mode forward all
+  the MIPI data received by the serializer.
+
+  The GMSL2 serial link operates at a fixed rate of 3Gbps in the
+  forward direction and 187.5Mbps in the reverse direction.
+
Quoted 8 lines

Documentation/devicetree/bindings/media/i2c/maxim,max96714f.yaml line 31

Quoted 6 lines
Documentation/devicetree/bindings/media/i2c/maxim,max96714f.yaml new file +6 -0
+properties:
+  compatible:
+    const: maxim,max96714f
+
+  reg:
+    description: I2C device address

Drop

Ok

Quoted 63 lines
Quoted 63 lines
Documentation/devicetree/bindings/media/i2c/maxim,max96714f.yaml new file +62 -0
+    maxItems: 1
+
+  enable-gpios: true
+
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+
+    properties:
+      port@0:
+        $ref: /schemas/graph.yaml#/properties/port
+        unevaluatedProperties: false
+        description: GMSL Input
+        properties:
+          endpoint:
+            $ref: /schemas/media/video-interfaces.yaml#
+            unevaluatedProperties: false
+            description:
+              Endpoint for GMSL2-Link port.
+
+      port@1:
+        $ref: /schemas/graph.yaml#/$defs/port-base
+        unevaluatedProperties: false
+        description: CSI-2 Output
+
+        properties:
+          endpoint:
+            $ref: /schemas/media/video-interfaces.yaml#
+            unevaluatedProperties: false
+
+            properties:
+              data-lanes: true
+              bus-type:
+                enum:
+                  - 4 # MEDIA_BUS_TYPE_CSI2_DPHY
+
+            required:
+              - data-lanes
+              - bus-type
+
+    required:
+      - port@1
+
+  i2c-gate:
+    $ref: /schemas/i2c/i2c-controller.yaml
+    unevaluatedProperties: false
+    description: |
+      The MAX96714 will pass through and forward the I2C requests from the
+      incoming I2C bus over the GMSL2 link. Therefore it supports an i2c-gate
+      subnode to configure a serializer.
+
+  port0-poc-supply:
+    description: Regulator providing Power over Coax for a particular port
+
+required:
+  - compatible
+  - reg
+  - ports
+
+additionalProperties: false
+
+examples:
+  - |
Quoted 8 lines

Documentation/devicetree/bindings/media/i2c/maxim,max96714f.yaml line 97

Quoted 4 lines
Documentation/devicetree/bindings/media/i2c/maxim,max96714f.yaml new file +4 -0
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/media/video-interfaces.h>
+
+    main_i2c2 {

Node names should be generic. See also an explanation and list of examples (not exhaustive) in DT specification:
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation

Ok V3 will use generic node names.

Quoted 13 lines

Documentation/devicetree/bindings/media/i2c/maxim,max96714f.yaml line 134

Quoted 12 lines
Documentation/devicetree/bindings/media/i2c/maxim,max96714f.yaml new file +9 -0
+        #address-cells = <1>;
+        #size-cells = <0>;
 
+            i2c-gate {
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                gmsl-serializer@40 {
+                    compatible = "maxim,max96717f";
+                    reg = <0x40>;
Quoted 1 line

Not documented.

Ok I will re-post max96717f binding first and then the max96714f binding.

Thank you,

Signature · 1 line
Julien Massot
author maintainer
#5 lore raw

PATCH v2 2/4 dt-bindings: media: add Maxim MAX96717F GMSL2 Serializer

In reply to Julien Massot

Add DT bindings for Maxim MAX96717F GMSL2 Serializer.

---
 .../bindings/media/i2c/maxim,max96717f.yaml   | 144 ++++++++++++++++++
 1 file changed, 144 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/maxim,max96717f.yaml
Documentation/devicetree/bindings/media/i2c/maxim,max96717f.yaml new file +144 -0
new file mode 100644
index 000000000000..ae649c3041a6
@@ -0,0 +1,144 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) 2023 Collabora Ltd.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/i2c/maxim,max96717f.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: GMSL2 to CSI-2 Serializer
+
+maintainers:
+  - Julien Massot <[email protected]>
+
+description: |
+  The MAX96717F serializer converts MIPI CSI-2 D-PHY or C-PHY formatted input
+  into GMSL2 serial outputs. The device allows the GMSL2 link to
+  simultaneously transmit bidirectional control-channel data while forward
+  video transmissions are in progress. The MAX96717F can connect to one
+  remotely located deserializer using industry-standard coax or STP
+  interconnects. The device cans operate in pixel or tunnel mode. In pixel mode
+  the MAX96717F can select the MIPI datatype, while the tunnel mode forward all the MIPI
+  data received by the serializer.
+  The MAX96717F supports Reference Over Reverse (channel),
+  to generate a clock output for the sensor from the GMSL reverse channel.
+
+  The GMSL2 serial link operates at a fixed rate of 3Gbps in the
+  forward direction and 187.5Mbps in the reverse direction.
+
+properties:
+  compatible:
+    const: maxim,max96717f
+
+  '#gpio-cells':
+    const: 2
+    description:
+      First cell is the GPIO pin number, second cell is the flags. The GPIO pin
+      number must be in range of [0, 10].
+
+  gpio-controller: true
+
+  '#clock-cells':
+    const: 0
+
+  reg:
+    description: I2C device address
+    maxItems: 1
+
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+
+    properties:
+      port@0:
+        $ref: /schemas/graph.yaml#/$defs/port-base
+        unevaluatedProperties: false
+        description: CSI-2 Input port
+
+        properties:
+          endpoint:
+            $ref: /schemas/media/video-interfaces.yaml#
+            unevaluatedProperties: false
+
+            required:
+              - data-lanes
+
+      port@1:
+        $ref: /schemas/graph.yaml#/properties/port
+        unevaluatedProperties: false
+        description: GMSL Output port
+
+    required:
+      - port@1
+
+  i2c-gate:
+    $ref: /schemas/i2c/i2c-controller.yaml
+    unevaluatedProperties: false
+    description: |
+      The MAX96717F will pass through and forward the I2C requests from the
+      incoming GMSL2 link. Therefore it supports an i2c-gate
+      subnode to configure a sensor.
+
+required:
+  - compatible
+  - reg
+  - ports
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/media/video-interfaces.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        serializer: serializer@40 {
+            compatible = "maxim,max96717f";
+            reg = <0x40>;
+            gpio-controller;
+            #gpio-cells = <2>;
+            #clock-cells = <0>;
+
+            ports {
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                port@0 {
+                    reg = <0>;
+                    max96717f_csi_in: endpoint {
+                        data-lanes = <1 2>;
+                        lane-polarities = <1 0 1>;
+                        remote-endpoint = <&vd5661_csi>;
+                    };
+                };
+
+                port@1 {
+                    reg = <1>;
+                    max96917f_gmsl_out: endpoint {
+                        remote-endpoint = <&max96714_gmsl_in>;
+                    };
+                };
+            };
+
+            i2c-gate {
+                #address-cells = <1>;
+                #size-cells = <0>;
+                vd5661@10 {
+                    compatible = "st,st-vgxy61";
+                    reg = <0x10>;
+                    reset-gpios = <&serializer 0 GPIO_ACTIVE_LOW>;
+                    clocks = <&serializer>;
+                    VCORE-supply = <&v1v2>;
+                    VDDIO-supply = <&v1v8>;
+                    VANA-supply = <&v2v8>;
+                    port {
+                        vd5661_csi: endpoint {
+                            data-lanes = <1 2>;
+                            remote-endpoint = <&max96717f_csi_in>;
+                        };
+                    };
+                };
+            };
+        };
+    };
+...
Signature · 1 line
2.43.0
maintainer
#6 lore raw

Re: [PATCH v2 2/4] dt-bindings: media: add Maxim MAX96717F GMSL2 Serializer

Quoted 8 lines · Julien Massot

Add DT bindings for Maxim MAX96717F GMSL2 Serializer.

---
 .../bindings/media/i2c/maxim,max96717f.yaml   | 144 ++++++++++++++++++
 1 file changed, 144 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/maxim,max96717f.yaml

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/i2c/maxim,max96717f.example.dtb: vd5661@10: port:endpoint:data-lanes:0: [1, 2] is too short
from schema $id: http://devicetree.org/schemas/media/i2c/st,st-vgxy61.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

#7 lore raw

Re: [PATCH v2 2/4] dt-bindings: media: add Maxim MAX96717F GMSL2 Serializer

In reply to Julien Massot
Quoted 8 lines · Julien Massot

Add DT bindings for Maxim MAX96717F GMSL2 Serializer.

---
 .../bindings/media/i2c/maxim,max96717f.yaml   | 144 ++++++++++++++++++
 1 file changed, 144 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/maxim,max96717f.yaml

...

Documentation/devicetree/bindings/media/i2c/maxim,max96717f.yaml line 44

Quoted 3 lines
Documentation/devicetree/bindings/media/i2c/maxim,max96717f.yaml new file +3 -0
+
+  reg:
+    description: I2C device address

drop description

Quoted 2 lines
(quoted diff) +2 -0
+    maxItems: 1
+

...

Documentation/devicetree/bindings/media/i2c/maxim,max96717f.yaml line 126

Quoted 5 lines
Documentation/devicetree/bindings/media/i2c/maxim,max96717f.yaml new file +5 -0
+
+            i2c-gate {
+                #address-cells = <1>;
+                #size-cells = <0>;
+                vd5661@10 {

Node names should be generic. See also an explanation and list of examples (not exhaustive) in DT specification:
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation

Best regards,
Krzysztof

author maintainer
#8 lore raw

PATCH v2 3/4 media: i2c: add MAX96714 driver

In reply to Julien Massot

This driver handle the MAX96714 deserializer in tunnel mode. The CSI output will replicate all the CSI traffic capture by the remote serializer.

---
 MAINTAINERS                  |   6 +
 drivers/media/i2c/Kconfig    |  13 +
 drivers/media/i2c/Makefile   |   1 +
 drivers/media/i2c/max96714.c | 945 +++++++++++++++++++++++++++++++++++
 4 files changed, 965 insertions(+)
 create mode 100644 drivers/media/i2c/max96714.c
MAINTAINERS +6 -0
index 10a981abd6ec..1010e7db32f2 100644
@@ -13016,6 +13016,12 @@ L:	[email protected]
 S:	Maintained
 F:	drivers/staging/media/max96712/max96712.c
 
+MAX96714 GMSL2 DESERIALIZER DRIVER
+M:	Julien Massot <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	drivers/media/i2c/max96714.c
+
 MAX9860 MONO AUDIO VOICE CODEC DRIVER
 M:	Peter Rosin <[email protected]>
 L:	[email protected] (moderated for non-subscribers)
drivers/media/i2c/Kconfig +13 -0
index 59ee0ca2c978..6e2819a9ba96 100644
@@ -1498,6 +1498,19 @@ config VIDEO_DS90UB960
 	  Device driver for the Texas Instruments DS90UB960
 	  FPD-Link III Deserializer and DS90UB9702 FPD-Link IV Deserializer.
 
+config VIDEO_MAX96714
+	tristate "Maxim MAX96714 GMSL2 deserializer"
+	depends on OF && I2C && VIDEO_DEV
+	select I2C_MUX
+	select MEDIA_CONTROLLER
+	select GPIOLIB
+	select REGMAP_I2C
+	select V4L2_FWNODE
+	select VIDEO_V4L2_SUBDEV_API
+	help
+	  Device driver for the Maxim MAX96714
+	  GMSL2 Deserializer.
+
 endmenu
 
 endif # VIDEO_DEV
drivers/media/i2c/Makefile +1 -0
index f5010f80a21f..c6e23d3fdc22 100644
@@ -61,6 +61,7 @@ obj-$(CONFIG_VIDEO_LM3646) += lm3646.o
 obj-$(CONFIG_VIDEO_M52790) += m52790.o
 obj-$(CONFIG_VIDEO_MAX9271_LIB) += max9271.o
 obj-$(CONFIG_VIDEO_MAX9286) += max9286.o
+obj-$(CONFIG_VIDEO_MAX96714) += max96714.o
 obj-$(CONFIG_VIDEO_ML86V7667) += ml86v7667.o
 obj-$(CONFIG_VIDEO_MSP3400) += msp3400.o
 obj-$(CONFIG_VIDEO_MT9M001) += mt9m001.o
drivers/media/i2c/max96714.c new file +945 -0

945 lines not on this page · raw message

Signature · 1 line
2.43.0
#9 lore raw

Re: [PATCH v2 3/4] media: i2c: add MAX96714 driver

Quoted 5 lines · Julien Massot

This driver handle the MAX96714 deserializer in tunnel mode. The CSI output will replicate all the CSI traffic capture by the remote serializer.

...

drivers/media/i2c/max96714.c line 850

Quoted 13 lines
drivers/media/i2c/max96714.c new file +13 -0
+static int max96714_get_hw_resources(struct max96714_priv *priv)
+{
+	struct device *dev = &priv->client->dev;
+
+	priv->regmap = devm_regmap_init_i2c(priv->client,
+					    &max96714_regmap_config);
+	if (IS_ERR(priv->regmap))
+		return PTR_ERR(priv->regmap);
+
+	priv->gpiod_pwdn = devm_gpiod_get_optional(&priv->client->dev, "enable",
+						   GPIOD_OUT_HIGH);
+	if (IS_ERR(priv->gpiod_pwdn))
+		return dev_err_probe(dev, PTR_ERR(priv->gpiod_pwdn),

A powerdown GPIO is not an enable GPIO. Please use correct name - see gpio-consumers-common.yaml

The same applies to other patch and potentially all others...

Best regards,
Krzysztof

author maintainer
#10 lore raw

Re: [PATCH v2 3/4] media: i2c: add MAX96714 driver

Quoted 9 lines · Krzysztof Kozlowski
Quoted 5 lines · Julien Massot

This driver handle the MAX96714 deserializer in tunnel mode. The CSI output will replicate all the CSI traffic capture by the remote serializer.

...

Quoted 16 lines

drivers/media/i2c/max96714.c line 850

Quoted 13 lines
drivers/media/i2c/max96714.c new file +13 -0
+static int max96714_get_hw_resources(struct max96714_priv *priv)
+{
+	struct device *dev = &priv->client->dev;
+
+	priv->regmap = devm_regmap_init_i2c(priv->client,
+					    &max96714_regmap_config);
+	if (IS_ERR(priv->regmap))
+		return PTR_ERR(priv->regmap);
+
+	priv->gpiod_pwdn = devm_gpiod_get_optional(&priv->client->dev, "enable",
+						   GPIOD_OUT_HIGH);
+	if (IS_ERR(priv->gpiod_pwdn))
+		return dev_err_probe(dev, PTR_ERR(priv->gpiod_pwdn),

A powerdown GPIO is not an enable GPIO. Please use correct name - see gpio-consumers-common.yaml

Ok I will rename it 'pwdn' instead.
Thanks,

Signature · 1 line
Julien Massot
#11 lore raw

Re: [PATCH v2 3/4] media: i2c: add MAX96714 driver

Quoted 16 lines · Julien Massot
Quoted 8 lines
Quoted 8 lines
drivers/media/i2c/max96714.c new file +8 -0
+static int max96714_get_hw_resources(struct max96714_priv *priv)
+{
+	struct device *dev = &priv->client->dev;
+
+	priv->regmap = devm_regmap_init_i2c(priv->client,
+					    &max96714_regmap_config);
+	if (IS_ERR(priv->regmap))
+		return PTR_ERR(priv->regmap);
Quoted 8 lines

drivers/media/i2c/max96714.c line 850

Quoted 5 lines
drivers/media/i2c/max96714.c new file +5 -0
+
+	priv->gpiod_pwdn = devm_gpiod_get_optional(&priv->client->dev, "enable",
+						   GPIOD_OUT_HIGH);
+	if (IS_ERR(priv->gpiod_pwdn))
+		return dev_err_probe(dev, PTR_ERR(priv->gpiod_pwdn),

A powerdown GPIO is not an enable GPIO. Please use correct name - see gpio-consumers-common.yaml

Quoted 1 line

Ok I will rename it 'pwdn' instead.

Did you open that file and read it?

Best regards,
Krzysztof

#12 lore raw

Re: [PATCH v2 3/4] media: i2c: add MAX96714 driver

In reply to Julien Massot
kernel test robot noticed the following build errors:

Hi Julien,

kernel test robot noticed the following build errors:

[auto build test ERROR on media-tree/master]
[also build test ERROR on linuxtv-media-stage/master linus/master v6.7-rc4 next-20231208] [cannot apply to sailus-media-tree/streams]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Julien-Massot/dt-bindings-media-add-Maxim-MAX96714F-GMSL2-Deserializer/20231208-223758
base:   git://linuxtv.org/media_tree.git master
patch link:    https://lore.kernel.org/r/20231208143359.469049-4-julien.massot%40collabora.com
patch subject: [PATCH v2 3/4] media: i2c: add MAX96714 driver
config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20231209/[email protected]/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231209/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

drivers/media/i2c/max96714.c: In function 'max96714_csi_status':

>> drivers/media/i2c/max96714.c:380:16: error: implicit declaration of function 'FIELD_GET' [-Werror=implicit-function-declaration]
     380 |         freq = FIELD_GET(CSI_DPLL_FREQ_MASK, freq);
         |                ^~~~~~~~~
   drivers/media/i2c/max96714.c: In function 'max96714_init_tx_port':
>> drivers/media/i2c/max96714.c:600:15: error: implicit declaration of function 'FIELD_PREP' [-Werror=implicit-function-declaration]
     600 |         val = FIELD_PREP(MAX96714_CSI2_LANE_CNT_MASK, mipi->num_data_lanes - 1);
         |               ^~~~~~~~~~

cc1: some warnings being treated as errors

vim +/FIELD_GET +380 drivers/media/i2c/max96714.c

373
374 static void max96714_csi_status(struct max96714_priv *priv)
375 {
376 struct device *dev = &priv->client->dev;
377 u8 freq;
378
379 max96714_read(priv, MAX96714_BACKTOP25, &freq);

 > 380		freq = FIELD_GET(CSI_DPLL_FREQ_MASK, freq);

381
382 dev_info(dev, "CSI controller DPLL freq:%u00MHz CSIPHY enabled:%d\n",
383 freq, max96714_tx_port_enabled(priv));
384 }
385

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#13 lore raw

Re: [PATCH v2 3/4] media: i2c: add MAX96714 driver

In reply to Julien Massot
kernel test robot noticed the following build errors:

Hi Julien,

kernel test robot noticed the following build errors:

[auto build test ERROR on media-tree/master]
[also build test ERROR on linuxtv-media-stage/master linus/master v6.7-rc4 next-20231208] [cannot apply to sailus-media-tree/streams]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Julien-Massot/dt-bindings-media-add-Maxim-MAX96714F-GMSL2-Deserializer/20231208-223758
base:   git://linuxtv.org/media_tree.git master
patch link:    https://lore.kernel.org/r/20231208143359.469049-4-julien.massot%40collabora.com
patch subject: [PATCH v2 3/4] media: i2c: add MAX96714 driver
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20231210/[email protected]/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231210/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> drivers/media/i2c/max96714.c:380:9: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
           freq = FIELD_GET(CSI_DPLL_FREQ_MASK, freq);
                  ^
>> drivers/media/i2c/max96714.c:600:8: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
           val = FIELD_PREP(MAX96714_CSI2_LANE_CNT_MASK, mipi->num_data_lanes - 1);
                 ^

2 errors generated.

vim +/FIELD_GET +380 drivers/media/i2c/max96714.c

373
374 static void max96714_csi_status(struct max96714_priv *priv)
375 {
376 struct device *dev = &priv->client->dev;
377 u8 freq;
378
379 max96714_read(priv, MAX96714_BACKTOP25, &freq);

 > 380		freq = FIELD_GET(CSI_DPLL_FREQ_MASK, freq);

381
382 dev_info(dev, "CSI controller DPLL freq:%u00MHz CSIPHY enabled:%d\n",
383 freq, max96714_tx_port_enabled(priv));
384 }
385

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
author maintainer
#14 lore raw

PATCH v2 4/4 media: i2c: add MAX96717 driver

In reply to Julien Massot

This driver handle the MAX96717 serializer in tunnel mode. All incoming CSI traffic will be tunneled through the GMSL2 link.

---
 MAINTAINERS                  |    6 +
 drivers/media/i2c/Kconfig    |   13 +
 drivers/media/i2c/Makefile   |    1 +
 drivers/media/i2c/max96717.c | 1003 ++++++++++++++++++++++++++++++++++
 4 files changed, 1023 insertions(+)
 create mode 100644 drivers/media/i2c/max96717.c
MAINTAINERS +6 -0
index 1010e7db32f2..232f74998b57 100644
@@ -13022,6 +13022,12 @@ L:	[email protected]
 S:	Maintained
 F:	drivers/media/i2c/max96714.c
 
+MAX96717 GMSL2 SERIALIZER DRIVER
+M:	Julien Massot <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	drivers/media/i2c/max96717.c
+
 MAX9860 MONO AUDIO VOICE CODEC DRIVER
 M:	Peter Rosin <[email protected]>
 L:	[email protected] (moderated for non-subscribers)
drivers/media/i2c/Kconfig +13 -0
index 6e2819a9ba96..87858169c39a 100644
@@ -1511,6 +1511,19 @@ config VIDEO_MAX96714
 	  Device driver for the Maxim MAX96714
 	  GMSL2 Deserializer.
 
+config VIDEO_MAX96717
+	tristate "Maxim MAX96717 GMSL2 Serializer support"
+	depends on OF && I2C && VIDEO_DEV && COMMON_CLK
+	select I2C_MUX
+	select MEDIA_CONTROLLER
+	select GPIOLIB
+	select REGMAP_I2C
+	select V4L2_FWNODE
+	select VIDEO_V4L2_SUBDEV_API
+	help
+	  Device driver for the Maxim MAX96717
+	  GMSL2 Serializer.
+
 endmenu
 
 endif # VIDEO_DEV
drivers/media/i2c/Makefile +1 -0
index c6e23d3fdc22..4362b905edfd 100644
@@ -62,6 +62,7 @@ obj-$(CONFIG_VIDEO_M52790) += m52790.o
 obj-$(CONFIG_VIDEO_MAX9271_LIB) += max9271.o
 obj-$(CONFIG_VIDEO_MAX9286) += max9286.o
 obj-$(CONFIG_VIDEO_MAX96714) += max96714.o
+obj-$(CONFIG_VIDEO_MAX96717) += max96717.o
 obj-$(CONFIG_VIDEO_ML86V7667) += ml86v7667.o
 obj-$(CONFIG_VIDEO_MSP3400) += msp3400.o
 obj-$(CONFIG_VIDEO_MT9M001) += mt9m001.o
drivers/media/i2c/max96717.c new file +1003 -0

1,003 lines not on this page · raw message

Signature · 1 line
2.43.0
#15 lore raw

Re: [PATCH v2 4/4] media: i2c: add MAX96717 driver

kernel test robot noticed the following build warnings:

Hi Julien,

kernel test robot noticed the following build warnings:

[auto build test WARNING on media-tree/master]
[also build test WARNING on linuxtv-media-stage/master linus/master v6.7-rc4 next-20231208] [cannot apply to sailus-media-tree/streams]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Julien-Massot/dt-bindings-media-add-Maxim-MAX96714F-GMSL2-Deserializer/20231208-223758
base:   git://linuxtv.org/media_tree.git master
patch link:    https://lore.kernel.org/r/20231208143359.469049-5-julien.massot%40collabora.com
patch subject: [PATCH v2 4/4] media: i2c: add MAX96717 driver
config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20231209/[email protected]/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231209/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

drivers/media/i2c/max96717.c: In function 'max96717_set_fmt':

>> drivers/media/i2c/max96717.c:332:13: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
     332 |         int ret;
         |             ^~~
   drivers/media/i2c/max96717.c: In function 'max96717_clk_set_rate':
   drivers/media/i2c/max96717.c:697:15: error: implicit declaration of function 'FIELD_PREP' [-Werror=implicit-function-declaration]
     697 |         val = FIELD_PREP(REFGEN_PREDEF_FREQ_MASK,
         |               ^~~~~~~~~~
   drivers/media/i2c/max96717.c: In function 'max96717_init_csi_lanes':
   drivers/media/i2c/max96717.c:804:12: warning: 'ret' is used uninitialized [-Wuninitialized]
     804 |         if (ret)
         |            ^
   drivers/media/i2c/max96717.c:798:13: note: 'ret' was declared here
     798 |         int ret;
         |             ^~~

cc1: some warnings being treated as errors

vim +/ret +332 drivers/media/i2c/max96717.c

325
326 static int max96717_set_fmt(struct v4l2_subdev *sd,
327 struct v4l2_subdev_state *state,
328 struct v4l2_subdev_format *format)
329 {
330 struct max96717_priv *priv = sd_to_max96717(sd);
331 struct v4l2_mbus_framefmt *fmt;

 > 332		int ret;

333 u64 stream_source_mask;
334
335 if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE &&
336 priv->enabled_source_streams)
337 return -EBUSY;
338
339 /* No transcoding, source and sink formats must match. */
340 if (format->pad == MAX96717_PAD_SOURCE)
341 return v4l2_subdev_get_fmt(sd, state, format);
342
343 /* Set sink format */
344 fmt = v4l2_subdev_state_get_format(state, format->pad, format->stream);
345 if (!fmt)
346 return -EINVAL;
347
348 *fmt = format->format;
349
350 /* Propagate to source format */
351 fmt = v4l2_subdev_state_get_opposite_stream_format(state, format->pad,
352 format->stream);
353 if (!fmt)
354 return -EINVAL;
355 *fmt = format->format;
356
357 stream_source_mask = BIT(format->stream);
358 ret = v4l2_subdev_state_xlate_streams(state, MAX96717_PAD_SOURCE,
359 MAX96717_PAD_SINK,
360 &stream_source_mask);
361 return 0;
362 }
363

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki