Skip to contentSkip to conversation

dt-bindings: drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 bindings

PATCH Superseded Marek Vasut 6 participants 19 messages Apr 21, 2021 – Apr 30, 2021

Subsystems (4)

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 dt-bindings: drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 bindings

Add DT binding document for TI SN65DSI83 and SN65DSI84 DSI to LVDS bridge.

Cc Douglas Anderson <[email protected]>
Cc Jagan Teki <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Rob Herring <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Stephen Boyd <[email protected]>

To: [email protected]
---
V2: Add compatible string for SN65DSI84, since this is now tested on it

---
 .../bindings/display/bridge/ti,sn65dsi83.yaml | 134 ++++++++++++++++++
 1 file changed, 134 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml new file +134 -0
new file mode 100644
index 000000000000..42d11b46a1eb
@@ -0,0 +1,134 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/ti,sn65dsi83.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: SN65DSI83 and SN65DSI84 DSI to LVDS bridge chip
+
+maintainers:
+  - Marek Vasut <[email protected]>
+
+description: |
+  Texas Instruments SN65DSI83 1x Single-link MIPI DSI
+  to 1x Single-link LVDS
+  https://www.ti.com/lit/gpn/sn65dsi83
+  Texas Instruments SN65DSI84 1x Single-link MIPI DSI
+  to 1x Dual-link or 2x Single-link LVDS
+  https://www.ti.com/lit/gpn/sn65dsi84
+
+properties:
+  compatible:
+    oneOf:
+      - const: ti,sn65dsi83
+      - const: ti,sn65dsi84
+
+  reg:
+    const: 0x2d
+
+  enable-gpios:
+    maxItems: 1
+    description: GPIO specifier for bridge_en pin (active high).
+
+  ports:
+    type: object
+    additionalProperties: false
+
+    properties:
+      "#address-cells":
+        const: 1
+
+      "#size-cells":
+        const: 0
+
+      port@0:
+        type: object
+        additionalProperties: false
+
+        description:
+          Video port for MIPI DSI input
+
+        properties:
+          reg:
+            const: 0
+
+          endpoint:
+            type: object
+            additionalProperties: false
+            properties:
+              remote-endpoint: true
+              data-lanes:
+                description: array of physical DSI data lane indexes.
+
+        required:
+          - reg
+
+      port@1:
+        type: object
+        additionalProperties: false
+
+        description:
+          Video port for LVDS output (panel or bridge).
+
+        properties:
+          reg:
+            const: 1
+
+          endpoint:
+            type: object
+            additionalProperties: false
+            properties:
+              remote-endpoint: true
+
+        required:
+          - reg
+
+    required:
+      - "#address-cells"
+      - "#size-cells"
+      - port@0
+      - port@1
+
+required:
+  - compatible
+  - reg
+  - enable-gpios
+  - ports
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      bridge@2d {
+        compatible = "ti,sn65dsi83";
+        reg = <0x2d>;
+
+        enable-gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>;
+
+        ports {
+          #address-cells = <1>;
+          #size-cells = <0>;
+
+          port@0 {
+            reg = <0>;
+            endpoint {
+              remote-endpoint = <&dsi0_out>;
+              data-lanes = <1 2 3 4>;
+            };
+          };
+
+          port@1 {
+            reg = <1>;
+            endpoint {
+              remote-endpoint = <&panel_in_lvds>;
+            };
+          };
+        };
+      };
+    };
Signature · 1 line
2.30.2
#1 lore raw

PATCH v2 2/2 drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver

Add driver for TI SN65DSI83 Single-link DSI to Single-link LVDS bridge and TI SN65DSI84 Single-link DSI to Dual-link or 2x Single-link LVDS bridge. TI SN65DSI85 is unsupported due to lack of hardware to test on, but easy to add.

The driver operates the chip via I2C bus. Currently the LVDS clock are always derived from DSI clock lane, which is the usual mode of operation. Support for clock from external oscillator is not implemented, but it is easy to add if ever needed. Only RGB888 pixel format is implemented, the LVDS666 is not supported, but could be added if needed.

Cc Douglas Anderson <[email protected]>
Cc Jagan Teki <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Philippe Schenker <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Valentin Raevsky <[email protected]>

To: [email protected]
---
V2: - Use dev_err_probe()
- Set REG_RC_RESET as volatile
- Wait for PLL stabilization by polling REG_RC_LVDS_PLL
- Use ctx->mode = *adj instead of *mode in sn65dsi83_mode_set
- Add tested DSI84 support in dual-link mode
- Correctly set VCOM
- Fill in missing DSI CHB and LVDS CHB bits from DSI84 and DSI85 datasheets, with that all the reserved bits make far more sense as the DSI83 and DSI84 seems to be reduced version of DSI85

---
 drivers/gpu/drm/bridge/Kconfig        |  10 +
 drivers/gpu/drm/bridge/Makefile       |   1 +
 drivers/gpu/drm/bridge/ti-sn65dsi83.c | 617 ++++++++++++++++++++++++++
 3 files changed, 628 insertions(+)
 create mode 100644 drivers/gpu/drm/bridge/ti-sn65dsi83.c
drivers/gpu/drm/bridge/Kconfig +10 -0
index cc401786962a..4cd2712f90fd 100644
@@ -234,6 +234,16 @@ config DRM_TI_TFP410
 	help
 	  Texas Instruments TFP410 DVI/HDMI Transmitter driver
 
+config DRM_TI_SN65DSI83
+	tristate "TI SN65DSI83 and SN65DSI84 DSI to LVDS bridge"
+	depends on OF
+	select DRM_KMS_HELPER
+	select REGMAP_I2C
+	select DRM_PANEL
+	select DRM_MIPI_DSI
+	help
+	  Texas Instruments SN65DSI83 and SN65DSI84 DSI to LVDS Bridge driver
+
 config DRM_TI_SN65DSI86
 	tristate "TI SN65DSI86 DSI to eDP bridge"
 	depends on OF
drivers/gpu/drm/bridge/Makefile +1 -0
index 21ea8fe09992..e11415db0a31 100644
@@ -21,6 +21,7 @@ obj-$(CONFIG_DRM_TOSHIBA_TC358767) += tc358767.o
 obj-$(CONFIG_DRM_TOSHIBA_TC358768) += tc358768.o
 obj-$(CONFIG_DRM_TOSHIBA_TC358775) += tc358775.o
 obj-$(CONFIG_DRM_I2C_ADV7511) += adv7511/
+obj-$(CONFIG_DRM_TI_SN65DSI83) += ti-sn65dsi83.o
 obj-$(CONFIG_DRM_TI_SN65DSI86) += ti-sn65dsi86.o
 obj-$(CONFIG_DRM_TI_TFP410) += ti-tfp410.o
 obj-$(CONFIG_DRM_TI_TPD12S015) += ti-tpd12s015.o
drivers/gpu/drm/bridge/ti-sn65dsi83.c new file +617 -0

617 lines not on this page · raw message

Signature · 6 lines
2.30.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Tested-by on v2 2/2
#2 lore raw

Re: [PATCH V2 2/2] drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver

Quoted 31 lines · Marek Vasut

Add driver for TI SN65DSI83 Single-link DSI to Single-link LVDS bridge and TI SN65DSI84 Single-link DSI to Dual-link or 2x Single-link LVDS bridge. TI SN65DSI85 is unsupported due to lack of hardware to test on, but easy to add.

The driver operates the chip via I2C bus. Currently the LVDS clock are always derived from DSI clock lane, which is the usual mode of operation. Support for clock from external oscillator is not implemented, but it is easy to add if ever needed. Only RGB888 pixel format is implemented, the LVDS666 is not supported, but could be added if needed.

Cc Douglas Anderson <[email protected]>
Cc Jagan Teki <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Philippe Schenker <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Valentin Raevsky <[email protected]>

To: [email protected]
---
V2: - Use dev_err_probe()
- Set REG_RC_RESET as volatile
- Wait for PLL stabilization by polling REG_RC_LVDS_PLL
- Use ctx->mode = *adj instead of *mode in sn65dsi83_mode_set
- Add tested DSI84 support in dual-link mode
- Correctly set VCOM
- Fill in missing DSI CHB and LVDS CHB bits from DSI84 and DSI85 datasheets, with that all the reserved bits make far more sense as the DSI83 and DSI84 seems to be reduced version of DSI85

Quoted 6 lines
---
  drivers/gpu/drm/bridge/Kconfig        |  10 +
  drivers/gpu/drm/bridge/Makefile       |   1 +
  drivers/gpu/drm/bridge/ti-sn65dsi83.c | 617 ++++++++++++++++++++++++++
  3 files changed, 628 insertions(+)

create mode 100644 drivers/gpu/drm/bridge/ti-sn65dsi83.c

Tested on MSC-SM2S-IMX8MINI module with a 1024x768 (VESA-24) single LVDS channel panel.

Loic
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

Re: [PATCH V2 2/2] drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver

In reply to Marek Vasut
Quoted 39 lines · Marek Vasut

Add driver for TI SN65DSI83 Single-link DSI to Single-link LVDS bridge and TI SN65DSI84 Single-link DSI to Dual-link or 2x Single-link LVDS bridge. TI SN65DSI85 is unsupported due to lack of hardware to test on, but easy to add.

The driver operates the chip via I2C bus. Currently the LVDS clock are always derived from DSI clock lane, which is the usual mode of operation. Support for clock from external oscillator is not implemented, but it is easy to add if ever needed. Only RGB888 pixel format is implemented, the LVDS666 is not supported, but could be added if needed.

Cc Douglas Anderson <[email protected]>
Cc Jagan Teki <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Philippe Schenker <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Valentin Raevsky <[email protected]>

To: [email protected]

---
V2: - Use dev_err_probe()
- Set REG_RC_RESET as volatile
- Wait for PLL stabilization by polling REG_RC_LVDS_PLL
- Use ctx->mode = *adj instead of *mode in sn65dsi83_mode_set
- Add tested DSI84 support in dual-link mode
- Correctly set VCOM
- Fill in missing DSI CHB and LVDS CHB bits from DSI84 and DSI85 datasheets, with that all the reserved bits make far more sense as the DSI83 and DSI84 seems to be reduced version of DSI85

---
  drivers/gpu/drm/bridge/Kconfig        |  10 +
  drivers/gpu/drm/bridge/Makefile       |   1 +
  drivers/gpu/drm/bridge/ti-sn65dsi83.c | 617 ++++++++++++++++++++++++++
  3 files changed, 628 insertions(+)

create mode 100644 drivers/gpu/drm/bridge/ti-sn65dsi83.c

[...]

Quoted 12 lines
drivers/gpu/drm/bridge/ti-sn65dsi83.c new file +12 -0
+static int sn65dsi83_probe(struct i2c_client *client,
+			   const struct i2c_device_id *id)
+{
+	struct device *dev = &client->dev;
+	enum sn65dsi83_model model;
+	struct sn65dsi83 *ctx;
+	int ret;
+
+	ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
+	if (!ctx)
+		return -ENOMEM;
+

drivers/gpu/drm/bridge/ti-sn65dsi83.c line 554

Quoted 10 lines
drivers/gpu/drm/bridge/ti-sn65dsi83.c new file +10 -0
+	ctx->dev = dev;
+
+	if (dev->of_node)
+		model = (enum sn65dsi83_model)of_device_get_match_data(dev);
+	else
+		model = id->driver_data;
+
+	/* Default to dual-link LVDS on all but DSI83. */
+	if (model != MODEL_SN65DSI83)
+		ctx->lvds_dual_link = true;

What if I use the DSI84 with a single link LVDS? I can't see any way to configure that right now.

Quoted 12 lines
drivers/gpu/drm/bridge/ti-sn65dsi83.c new file +12 -0
+
+	ctx->enable_gpio = devm_gpiod_get(ctx->dev, "enable", GPIOD_OUT_LOW);
+	if (IS_ERR(ctx->enable_gpio))
+		return PTR_ERR(ctx->enable_gpio);
+
+	ret = sn65dsi83_parse_dt(ctx);
+	if (ret)
+		return ret;
+
+	ctx->regmap = devm_regmap_init_i2c(client, &sn65dsi83_regmap_config);
+	if (IS_ERR(ctx->regmap))
+		return PTR_ERR(ctx->regmap);

drivers/gpu/drm/bridge/ti-sn65dsi83.c line 576

Quoted 10 lines
drivers/gpu/drm/bridge/ti-sn65dsi83.c new file +10 -0
+
+	dev_set_drvdata(dev, ctx);
+	i2c_set_clientdata(client, ctx);
+
+	ctx->bridge.funcs = &sn65dsi83_funcs;
+	ctx->bridge.of_node = dev->of_node;
+	drm_bridge_add(&ctx->bridge);
+
+	return 0;
+}

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw

Re: [PATCH V2 2/2] drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver

Quoted 57 lines · Frieder Schrempf
Quoted 39 lines · Marek Vasut

Add driver for TI SN65DSI83 Single-link DSI to Single-link LVDS bridge and TI SN65DSI84 Single-link DSI to Dual-link or 2x Single-link LVDS bridge. TI SN65DSI85 is unsupported due to lack of hardware to test on, but easy to add.

The driver operates the chip via I2C bus. Currently the LVDS clock are always derived from DSI clock lane, which is the usual mode of operation. Support for clock from external oscillator is not implemented, but it is easy to add if ever needed. Only RGB888 pixel format is implemented, the LVDS666 is not supported, but could be added if needed.

Cc Douglas Anderson <[email protected]>
Cc Jagan Teki <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Philippe Schenker <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Valentin Raevsky <[email protected]>

To: [email protected]

---
V2: - Use dev_err_probe()
     - Set REG_RC_RESET as volatile
     - Wait for PLL stabilization by polling REG_RC_LVDS_PLL
     - Use ctx->mode = *adj instead of *mode in sn65dsi83_mode_set
     - Add tested DSI84 support in dual-link mode
     - Correctly set VCOM
     - Fill in missing DSI CHB and LVDS CHB bits from DSI84 and DSI85 datasheets, with that all the reserved bits make far more sense as the DSI83 and DSI84 seems to be reduced version of DSI85
---
  drivers/gpu/drm/bridge/Kconfig        |  10 + drivers/gpu/drm/bridge/Makefile       |   1 + drivers/gpu/drm/bridge/ti-sn65dsi83.c | 617 ++++++++++++++++++++++++++

  3 files changed, 628 insertions(+)

  create mode 100644 drivers/gpu/drm/bridge/ti-sn65dsi83.c

[...]

Quoted 16 lines
drivers/gpu/drm/bridge/ti-sn65dsi83.c new file +16 -0
+static int sn65dsi83_probe(struct i2c_client *client,
+               const struct i2c_device_id *id)
+{
+    struct device *dev = &client->dev;
+    enum sn65dsi83_model model;
+    struct sn65dsi83 *ctx;
+    int ret;
+
+    ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
+    if (!ctx)
+        return -ENOMEM;
+
+    ctx->dev = dev;
+
+    if (dev->of_node)
+        model = (enum sn65dsi83_model)of_device_get_match_data(dev);
Quoted 8 lines
Quoted 6 lines

+    else
+        model = id->driver_data;
+
+    /* Default to dual-link LVDS on all but DSI83. */ +    if (model != MODEL_SN65DSI83)
+        ctx->lvds_dual_link = true;

What if I use the DSI84 with a single link LVDS? I can't see any way to configure that right now.

I just saw the note in the header of the driver that says that single link mode is unsupported for the DSI84.

I have hardware with a single link display and if I set ctx->lvds_dual_link = false it works just fine.

How is this supposed to be selected? Does it need an extra devicetree property? And would you mind adding single-link support in the next version or do you prefer adding it in a follow-up patch?

Quoted 17 lines
Quoted 17 lines

+
+    ctx->enable_gpio = devm_gpiod_get(ctx->dev, "enable", GPIOD_OUT_LOW);
+    if (IS_ERR(ctx->enable_gpio))
+        return PTR_ERR(ctx->enable_gpio);

drivers/gpu/drm/bridge/ti-sn65dsi83.c new file +6 -0
+
+    ret = sn65dsi83_parse_dt(ctx);
+    if (ret)
+        return ret;
+
+    ctx->regmap = devm_regmap_init_i2c(client, 

&sn65dsi83_regmap_config);
+    if (IS_ERR(ctx->regmap))
+        return PTR_ERR(ctx->regmap);
+
+    dev_set_drvdata(dev, ctx);

Quoted 8 lines

drivers/gpu/drm/bridge/ti-sn65dsi83.c line 576

Quoted 8 lines

+    i2c_set_clientdata(client, ctx);

drivers/gpu/drm/bridge/ti-sn65dsi83.c new file +7 -0
+
+    ctx->bridge.funcs = &sn65dsi83_funcs;
+    ctx->bridge.of_node = dev->of_node;
+    drm_bridge_add(&ctx->bridge);
+
+    return 0;
+}

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw

Re: [PATCH V2 2/2] drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver

Quoted 60 lines · Frieder Schrempf
Quoted 58 lines · Frieder Schrempf
Quoted 39 lines · Marek Vasut

Add driver for TI SN65DSI83 Single-link DSI to Single-link LVDS bridge and TI SN65DSI84 Single-link DSI to Dual-link or 2x Single-link LVDS bridge. TI SN65DSI85 is unsupported due to lack of hardware to test on, but easy to add.

The driver operates the chip via I2C bus. Currently the LVDS clock are always derived from DSI clock lane, which is the usual mode of operation. Support for clock from external oscillator is not implemented, but it is easy to add if ever needed. Only RGB888 pixel format is implemented, the LVDS666 is not supported, but could be added if needed.

Cc Douglas Anderson <[email protected]>
Cc Jagan Teki <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Philippe Schenker <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Valentin Raevsky <[email protected]>

To: [email protected]

---
V2: - Use dev_err_probe()
- Set REG_RC_RESET as volatile
- Wait for PLL stabilization by polling REG_RC_LVDS_PLL
- Use ctx->mode = *adj instead of *mode in sn65dsi83_mode_set
- Add tested DSI84 support in dual-link mode
- Correctly set VCOM
- Fill in missing DSI CHB and LVDS CHB bits from DSI84 and DSI85 datasheets, with that all the reserved bits make far more sense as the DSI83 and DSI84 seems to be reduced version of DSI85

---
  drivers/gpu/drm/bridge/Kconfig        |  10 +
  drivers/gpu/drm/bridge/Makefile       |   1 +
  drivers/gpu/drm/bridge/ti-sn65dsi83.c | 617 ++++++++++++++++++++++++++
  3 files changed, 628 insertions(+)

create mode 100644 drivers/gpu/drm/bridge/ti-sn65dsi83.c

[...]

Quoted 17 lines
drivers/gpu/drm/bridge/ti-sn65dsi83.c new file +17 -0
+static int sn65dsi83_probe(struct i2c_client *client,
+               const struct i2c_device_id *id)
+{
+    struct device *dev = &client->dev;
+    enum sn65dsi83_model model;
+    struct sn65dsi83 *ctx;
+    int ret;
+
+    ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
+    if (!ctx)
+        return -ENOMEM;
+
+    ctx->dev = dev;
+
+    if (dev->of_node)
+        model = (enum sn65dsi83_model)of_device_get_match_data(dev);
+    else
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/bridge/ti-sn65dsi83.c line 554

Quoted 5 lines
drivers/gpu/drm/bridge/ti-sn65dsi83.c new file +5 -0
+        model = id->driver_data;
+
+    /* Default to dual-link LVDS on all but DSI83. */
+    if (model != MODEL_SN65DSI83)
+        ctx->lvds_dual_link = true;

What if I use the DSI84 with a single link LVDS? I can't see any way to configure that right now.

I assume the simplest way would be to use the "ti,sn65dsi83" compatible string in your dts, since the way you wired it is 'compatible' with sn65dsi83, right?

Quoted 10 lines

I just saw the note in the header of the driver that says that single link mode is unsupported for the DSI84.

I have hardware with a single link display and if I set ctx->lvds_dual_link = false it works just fine.

How is this supposed to be selected? Does it need an extra devicetree property? And would you mind adding single-link support in the next version or do you prefer adding it in a follow-up patch?

If this has to be supported I think the proper way would be to support two output ports in the dts (e.g. lvds0_out, lvds1_out), in the same way as supported by the 'advantech,idk-2121wr' panel.

Regards,
Loic
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw

Re: [PATCH V2 2/2] drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver

Quoted 71 lines · Loic Poulain
Quoted 60 lines · Frieder Schrempf
Quoted 58 lines · Frieder Schrempf
Quoted 39 lines · Marek Vasut

Add driver for TI SN65DSI83 Single-link DSI to Single-link LVDS bridge and TI SN65DSI84 Single-link DSI to Dual-link or 2x Single-link LVDS bridge. TI SN65DSI85 is unsupported due to lack of hardware to test on, but easy to add.

The driver operates the chip via I2C bus. Currently the LVDS clock are always derived from DSI clock lane, which is the usual mode of operation. Support for clock from external oscillator is not implemented, but it is easy to add if ever needed. Only RGB888 pixel format is implemented, the LVDS666 is not supported, but could be added if needed.

Cc Douglas Anderson <[email protected]>
Cc Jagan Teki <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Philippe Schenker <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Valentin Raevsky <[email protected]>

To: [email protected]

---
V2: - Use dev_err_probe()
- Set REG_RC_RESET as volatile
- Wait for PLL stabilization by polling REG_RC_LVDS_PLL
- Use ctx->mode = *adj instead of *mode in sn65dsi83_mode_set
- Add tested DSI84 support in dual-link mode
- Correctly set VCOM
- Fill in missing DSI CHB and LVDS CHB bits from DSI84 and DSI85 datasheets, with that all the reserved bits make far more sense as the DSI83 and DSI84 seems to be reduced version of DSI85

---
  drivers/gpu/drm/bridge/Kconfig        |  10 +
  drivers/gpu/drm/bridge/Makefile       |   1 +
  drivers/gpu/drm/bridge/ti-sn65dsi83.c | 617 ++++++++++++++++++++++++++
  3 files changed, 628 insertions(+)

create mode 100644 drivers/gpu/drm/bridge/ti-sn65dsi83.c

[...]

Quoted 17 lines
drivers/gpu/drm/bridge/ti-sn65dsi83.c new file +17 -0
+static int sn65dsi83_probe(struct i2c_client *client,
+               const struct i2c_device_id *id)
+{
+    struct device *dev = &client->dev;
+    enum sn65dsi83_model model;
+    struct sn65dsi83 *ctx;
+    int ret;
+
+    ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
+    if (!ctx)
+        return -ENOMEM;
+
+    ctx->dev = dev;
+
+    if (dev->of_node)
+        model = (enum sn65dsi83_model)of_device_get_match_data(dev);
+    else
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/bridge/ti-sn65dsi83.c line 554

Quoted 5 lines
drivers/gpu/drm/bridge/ti-sn65dsi83.c new file +5 -0
+        model = id->driver_data;
+
+    /* Default to dual-link LVDS on all but DSI83. */
+    if (model != MODEL_SN65DSI83)
+        ctx->lvds_dual_link = true;

What if I use the DSI84 with a single link LVDS? I can't see any way to configure that right now.

Quoted 3 lines

I assume the simplest way would be to use the "ti,sn65dsi83" compatible string in your dts, since the way you wired it is 'compatible' with sn65dsi83, right?

No this isn't the right way to to, if sn65dsi84 is supported and the bindings only support single lvds link, the driver must only support single link on sn65dsi84, or add the dual link lvds in the bindings only for sn65dsi84.

Quoted 8 lines
Quoted 8 lines

I just saw the note in the header of the driver that says that single link mode is unsupported for the DSI84.

I have hardware with a single link display and if I set ctx->lvds_dual_link = false it works just fine.

Quoted 7 lines
Quoted 3 lines

How is this supposed to be selected? Does it need an extra devicetree property? And would you mind adding single-link support in the next version or do you prefer adding it in a follow-up patch?

If this has to be supported I think the proper way would be to support two output ports in the dts (e.g. lvds0_out, lvds1_out), in the same way as supported by the 'advantech,idk-2121wr' panel.

Yes, this is why I asked to have the dual-link lvds in the bindings.

Neil

Quoted 8 lines

Regards,
Loic
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw

Re: [PATCH V2 2/2] drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver

Quoted 92 lines · Neil Armstrong
Quoted 71 lines · Loic Poulain
Quoted 60 lines · Frieder Schrempf
Quoted 58 lines · Frieder Schrempf
Quoted 39 lines · Marek Vasut

Add driver for TI SN65DSI83 Single-link DSI to Single-link LVDS bridge and TI SN65DSI84 Single-link DSI to Dual-link or 2x Single-link LVDS bridge. TI SN65DSI85 is unsupported due to lack of hardware to test on, but easy to add.

The driver operates the chip via I2C bus. Currently the LVDS clock are always derived from DSI clock lane, which is the usual mode of operation. Support for clock from external oscillator is not implemented, but it is easy to add if ever needed. Only RGB888 pixel format is implemented, the LVDS666 is not supported, but could be added if needed.

Cc Douglas Anderson <[email protected]>
Cc Jagan Teki <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Philippe Schenker <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Valentin Raevsky <[email protected]>

To: [email protected]

---
V2: - Use dev_err_probe()
- Set REG_RC_RESET as volatile
- Wait for PLL stabilization by polling REG_RC_LVDS_PLL
- Use ctx->mode = *adj instead of *mode in sn65dsi83_mode_set
- Add tested DSI84 support in dual-link mode
- Correctly set VCOM
- Fill in missing DSI CHB and LVDS CHB bits from DSI84 and DSI85 datasheets, with that all the reserved bits make far more sense as the DSI83 and DSI84 seems to be reduced version of DSI85

---
  drivers/gpu/drm/bridge/Kconfig        |  10 +
  drivers/gpu/drm/bridge/Makefile       |   1 +
  drivers/gpu/drm/bridge/ti-sn65dsi83.c | 617 ++++++++++++++++++++++++++
  3 files changed, 628 insertions(+)

create mode 100644 drivers/gpu/drm/bridge/ti-sn65dsi83.c

[...]

Quoted 17 lines
drivers/gpu/drm/bridge/ti-sn65dsi83.c new file +17 -0
+static int sn65dsi83_probe(struct i2c_client *client,
+               const struct i2c_device_id *id)
+{
+    struct device *dev = &client->dev;
+    enum sn65dsi83_model model;
+    struct sn65dsi83 *ctx;
+    int ret;
+
+    ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
+    if (!ctx)
+        return -ENOMEM;
+
+    ctx->dev = dev;
+
+    if (dev->of_node)
+        model = (enum sn65dsi83_model)of_device_get_match_data(dev);
+    else
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/bridge/ti-sn65dsi83.c line 554

Quoted 5 lines
drivers/gpu/drm/bridge/ti-sn65dsi83.c new file +5 -0
+        model = id->driver_data;
+
+    /* Default to dual-link LVDS on all but DSI83. */
+    if (model != MODEL_SN65DSI83)
+        ctx->lvds_dual_link = true;

What if I use the DSI84 with a single link LVDS? I can't see any way to configure that right now.

Quoted 3 lines

I assume the simplest way would be to use the "ti,sn65dsi83" compatible string in your dts, since the way you wired it is 'compatible' with sn65dsi83, right?

No this isn't the right way to to, if sn65dsi84 is supported and the bindings only support single lvds link, the driver must only support single link on sn65dsi84, or add the dual link lvds in the bindings only for sn65dsi84.

Quoted 12 lines
Quoted 11 lines

I just saw the note in the header of the driver that says that single link mode is unsupported for the DSI84.

I have hardware with a single link display and if I set ctx->lvds_dual_link = false it works just fine.

How is this supposed to be selected? Does it need an extra devicetree property? And would you mind adding single-link support in the next version or do you prefer adding it in a follow-up patch?

Quoted 5 lines
Quoted 3 lines

If this has to be supported I think the proper way would be to support two output ports in the dts (e.g. lvds0_out, lvds1_out), in the same way as supported by the 'advantech,idk-2121wr' panel.

Yes, this is why I asked to have the dual-link lvds in the bindings.

Agreed with Neil, this is what we discussed on my v3. Each of these 3 chips has its own compatible and supporting dual-link lvds and dual-link dsi as to be done by 84/85 and 85 respectively.

Maybe I can push my configuration changes in gist if required?

Jagan.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw

Re: [PATCH V2 2/2] drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver

On 4/28/21 11:49 AM, Jagan Teki wrote:
[...]

Quoted 14 lines
Quoted 14 lines
Quoted 13 lines
Quoted 9 lines

I just saw the note in the header of the driver that says that single link mode is unsupported for the DSI84.

I have hardware with a single link display and if I set ctx->lvds_dual_link = false it works just fine.

How is this supposed to be selected? Does it need an extra devicetree property? And would you mind adding single-link support in the next version or do you prefer adding it in a follow-up patch?

If this has to be supported I think the proper way would be to support two output ports in the dts (e.g. lvds0_out, lvds1_out), in the same way as supported by the 'advantech,idk-2121wr' panel.

Quoted 5 lines
Quoted 1 line

Yes, this is why I asked to have the dual-link lvds in the bindings.

Agreed with Neil, this is what we discussed on my v3. Each of these 3 chips has its own compatible and supporting dual-link lvds and dual-link dsi as to be done by 84/85 and 85 respectively.

I have a counter-proposal to this single/dual link LVDS panel handling, maybe this should really be done using DRM_BUS_FLAG added to the panel, to indicate whether it is single or dual link. Then the bridge can figure that out, without any extra DT props.

Quoted 1 line

Maybe I can push my configuration changes in gist if required?

Please summarize the v3 discussion, yes.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#9 lore raw

Re: [PATCH V2 2/2] drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver

In reply to Neil Armstrong

On 4/28/21 11:24 AM, Neil Armstrong wrote:
[...]

Quoted 26 lines
Quoted 26 lines
Quoted 25 lines
Quoted 25 lines
Quoted 12 lines
drivers/gpu/drm/bridge/ti-sn65dsi83.c new file +12 -0
+static int sn65dsi83_probe(struct i2c_client *client,
+               const struct i2c_device_id *id)
+{
+    struct device *dev = &client->dev;
+    enum sn65dsi83_model model;
+    struct sn65dsi83 *ctx;
+    int ret;
+
+    ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
+    if (!ctx)
+        return -ENOMEM;
+

drivers/gpu/drm/bridge/ti-sn65dsi83.c line 554

Quoted 10 lines
drivers/gpu/drm/bridge/ti-sn65dsi83.c new file +10 -0
+    ctx->dev = dev;
+
+    if (dev->of_node)
+        model = (enum sn65dsi83_model)of_device_get_match_data(dev);
+    else
+        model = id->driver_data;
+
+    /* Default to dual-link LVDS on all but DSI83. */
+    if (model != MODEL_SN65DSI83)
+        ctx->lvds_dual_link = true;

What if I use the DSI84 with a single link LVDS? I can't see any way to configure that right now.

Quoted 6 lines
Quoted 3 lines

I assume the simplest way would be to use the "ti,sn65dsi83" compatible string in your dts, since the way you wired it is 'compatible' with sn65dsi83, right?

No this isn't the right way to to, if sn65dsi84 is supported and the bindings only support single lvds link, the driver must only support single link on sn65dsi84, or add the dual link lvds in the bindings only for sn65dsi84.

The driver has a comment about what is supported and tested, as Frieder already pointed out:

Currently supported:
- SN65DSI83
= 1x Single-link DSI ~ 1x Single-link LVDS
- Supported
- Single-link LVDS mode tested
- SN65DSI84
= 1x Single-link DSI ~ 2x Single-link or 1x Dual-link LVDS
- Supported
- Dual-link LVDS mode tested
- 2x Single-link LVDS mode unsupported
(should be easy to add by someone who has the HW)
- SN65DSI85
= 2x Single-link or 1x Dual-link DSI ~ 2x Single-link or 1x Dual-link
LVDS
- Unsupported
(should be easy to add by someone who has the HW)

So,
DSI83 is always single-link DSI, single-link LVDS.
DSI84 is always single-link DSI, and currently always dual-link LVDS.

The DSI83 can do one thing on the LVDS end:
- 1x single link lVDS

The DSI84 can do two things on the LVDS end:
- 1x single link lVDS
- 1x dual link LVDS

There is also some sort of mention in the DSI84 datasheet about 2x single link LVDS, but I suspect that might be copied from DSI85 datasheet instead, which would make sense. The other option is that it behaves as a mirror (i.e. same pixels are scanned out of LVDS channel A and B). Either option can be added by either adding a DT property which would enable the mirror mode, or new port linking the LVDS endpoint to the same panel twice, and/or two new ports for DSI85, so there is no problem to extend the bindings without breaking them. So for now I would ignore this mode.

So ultimately, what we have to sort out is the 1x single / 1x dual link LVDS mode setting on DSI84. Frieder already pointed out how the driver can be tweaked to support the single-link mode on DSI84, so now we need to tie it into DT bindings.

Currently, neither the LVDS panels in upstream in panel-simple nor lvds.yaml provide any indication that the panel is single-link or dual-link. Those dual-link LVDS panels seem to always set 2x pixel clock and let the bridge somehow sort it out.

Maybe that isn't always the best approach, maybe we should add a new DRM_BUS_FLAG for those panels and handle the flag in the bridge driver ? Such a new flag could be added over time to panels where applicable, so old setups won't be broken by that either, they will just ignore the new flag and work as before.

Quoted 10 lines
Quoted 10 lines
Quoted 9 lines

I just saw the note in the header of the driver that says that single link mode is unsupported for the DSI84.

I have hardware with a single link display and if I set ctx->lvds_dual_link = false it works just fine.

How is this supposed to be selected? Does it need an extra devicetree property? And would you mind adding single-link support in the next version or do you prefer adding it in a follow-up patch?

Quoted 5 lines
Quoted 3 lines

If this has to be supported I think the proper way would be to support two output ports in the dts (e.g. lvds0_out, lvds1_out), in the same way as supported by the 'advantech,idk-2121wr' panel.

Yes, this is why I asked to have the dual-link lvds in the bindings.

Maybe it shouldn't really be in the bindings, see above.
_______________________________________________
dri-devel mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#10 lore raw

Re: [PATCH V2 2/2] drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver

Quoted 59 lines · Marek Vasut

On 4/28/21 11:24 AM, Neil Armstrong wrote:
[...]

Quoted 26 lines
Quoted 26 lines
Quoted 25 lines
Quoted 25 lines
Quoted 12 lines
drivers/gpu/drm/bridge/ti-sn65dsi83.c new file +12 -0
+static int sn65dsi83_probe(struct i2c_client *client,
+               const struct i2c_device_id *id)
+{
+    struct device *dev = &client->dev;
+    enum sn65dsi83_model model;
+    struct sn65dsi83 *ctx;
+    int ret;
+
+    ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
+    if (!ctx)
+        return -ENOMEM;
+

drivers/gpu/drm/bridge/ti-sn65dsi83.c line 554

Quoted 10 lines
drivers/gpu/drm/bridge/ti-sn65dsi83.c new file +10 -0
+    ctx->dev = dev;
+
+    if (dev->of_node)
+        model = (enum sn65dsi83_model)of_device_get_match_data(dev);
+    else
+        model = id->driver_data;
+
+    /* Default to dual-link LVDS on all but DSI83. */
+    if (model != MODEL_SN65DSI83)
+        ctx->lvds_dual_link = true;

What if I use the DSI84 with a single link LVDS? I can't see any way to configure that right now.

Quoted 6 lines
Quoted 3 lines

I assume the simplest way would be to use the "ti,sn65dsi83" compatible string in your dts, since the way you wired it is 'compatible' with sn65dsi83, right?

No this isn't the right way to to, if sn65dsi84 is supported and the bindings only support single lvds link, the driver must only support single link on sn65dsi84, or add the dual link lvds in the bindings only for sn65dsi84.

The driver has a comment about what is supported and tested, as Frieder already pointed out:

Currently supported:
- SN65DSI83
  = 1x Single-link DSI ~ 1x Single-link LVDS
  - Supported
  - Single-link LVDS mode tested
- SN65DSI84
  = 1x Single-link DSI ~ 2x Single-link or 1x Dual-link LVDS
  - Supported
  - Dual-link LVDS mode tested
  - 2x Single-link LVDS mode unsupported
    (should be easy to add by someone who has the HW)
- SN65DSI85
  = 2x Single-link or 1x Dual-link DSI ~ 2x Single-link or 1x Dual-link
LVDS
  - Unsupported
    (should be easy to add by someone who has the HW)

So,
DSI83 is always single-link DSI, single-link LVDS.
DSI84 is always single-link DSI, and currently always dual-link LVDS.

Quoted 8 lines

The DSI83 can do one thing on the LVDS end:
- 1x single link lVDS

The DSI84 can do two things on the LVDS end:
- 1x single link lVDS
- 1x dual link LVDS

There is also some sort of mention in the DSI84 datasheet about 2x single link LVDS, but I suspect that might be copied from DSI85 datasheet instead, which would make sense. The other option is that it behaves as a mirror (i.e. same pixels are scanned out of LVDS channel A and B). Either option can be added by either adding a DT property which would enable the mirror mode, or new port linking the LVDS endpoint to the same panel twice, and/or two new ports for DSI85, so there is no problem to extend the bindings without breaking them. So for now I would ignore this mode.

Agreed.

Quoted 6 lines

So ultimately, what we have to sort out is the 1x single / 1x dual link LVDS mode setting on DSI84. Frieder already pointed out how the driver can be tweaked to support the single-link mode on DSI84, so now we need to tie it into DT bindings.

Currently, neither the LVDS panels in upstream in panel-simple nor lvds.yaml provide any indication that the panel is single-link or dual-link. Those dual-link LVDS panels seem to always set 2x pixel clock and let the bridge somehow sort it out.

Maybe that isn't always the best approach, maybe we should add a new DRM_BUS_FLAG for those panels and handle the flag in the bridge driver ? Such a new flag could be added over time to panels where applicable, so old setups won't be broken by that either, they will just ignore the new flag and work as before.

I agree that the panel driver should report whether the LVDS input is expected to be single or dual link. So introducing a DRM_BUS_FLAG for this seems like a good solution.

This wouldn't reflect the physical ports, but I don't really know how we could use two ports connected to the same panel for this case, as all the existing dual link panels don't follow this scheme.

I would suggest, that the driver defaults to single link for the DSI84 and then switches to dual link if the panel requests it using the flag.

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines

I just saw the note in the header of the driver that says that single link mode is unsupported for the DSI84.

I have hardware with a single link display and if I set ctx->lvds_dual_link = false it works just fine.

How is this supposed to be selected? Does it need an extra devicetree property? And would you mind adding single-link support in the next version or do you prefer adding it in a follow-up patch?

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

If this has to be supported I think the proper way would be to support two output ports in the dts (e.g. lvds0_out, lvds1_out), in the same way as supported by the 'advantech,idk-2121wr' panel.

Yes, this is why I asked to have the dual-link lvds in the bindings.

Maybe it shouldn't really be in the bindings, see above.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#11 lore raw

Re: [PATCH V2 2/2] drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver

Quoted 73 lines · Frieder Schrempf
Quoted 58 lines · Marek Vasut

On 4/28/21 11:24 AM, Neil Armstrong wrote:
[...]

Quoted 26 lines
Quoted 26 lines
Quoted 25 lines
Quoted 25 lines
Quoted 12 lines
(quoted diff) +12 -0
+static int sn65dsi83_probe(struct i2c_client *client,
+               const struct i2c_device_id *id)
+{
+    struct device *dev = &client->dev;
+    enum sn65dsi83_model model;
+    struct sn65dsi83 *ctx;
+    int ret;
+
+    ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
+    if (!ctx)
+        return -ENOMEM;
+

Review

Quoted 10 lines
(quoted diff) +10 -0
+    ctx->dev = dev;
+
+    if (dev->of_node)
+        model = (enum sn65dsi83_model)of_device_get_match_data(dev);
+    else
+        model = id->driver_data;
+
+    /* Default to dual-link LVDS on all but DSI83. */
+    if (model != MODEL_SN65DSI83)
+        ctx->lvds_dual_link = true;

What if I use the DSI84 with a single link LVDS? I can't see any way to configure that right now.

Quoted 6 lines
Quoted 3 lines

I assume the simplest way would be to use the "ti,sn65dsi83" compatible string in your dts, since the way you wired it is 'compatible' with sn65dsi83, right?

No this isn't the right way to to, if sn65dsi84 is supported and the bindings only support single lvds link, the driver must only support single link on sn65dsi84, or add the dual link lvds in the bindings only for sn65dsi84.

The driver has a comment about what is supported and tested, as Frieder already pointed out:

Currently supported:
- SN65DSI83
   = 1x Single-link DSI ~ 1x Single-link LVDS
   - Supported
   - Single-link LVDS mode tested
- SN65DSI84
   = 1x Single-link DSI ~ 2x Single-link or 1x Dual-link LVDS
   - Supported
   - Dual-link LVDS mode tested
   - 2x Single-link LVDS mode unsupported
     (should be easy to add by someone who has the HW)
- SN65DSI85
   = 2x Single-link or 1x Dual-link DSI ~ 2x Single-link or 1x Dual-link LVDS
   - Unsupported
     (should be easy to add by someone who has the HW)

So,
DSI83 is always single-link DSI, single-link LVDS.
DSI84 is always single-link DSI, and currently always dual-link LVDS.

Quoted 8 lines

The DSI83 can do one thing on the LVDS end:
- 1x single link lVDS

The DSI84 can do two things on the LVDS end:
- 1x single link lVDS
- 1x dual link LVDS

There is also some sort of mention in the DSI84 datasheet about 2x single link LVDS, but I suspect that might be copied from DSI85 datasheet instead, which would make sense. The other option is that it behaves as a mirror (i.e. same pixels are scanned out of LVDS channel A and B). Either option can be added by either adding a DT property which would enable the mirror mode, or new port linking the LVDS endpoint to the same panel twice, and/or two new ports for DSI85, so there is no problem to extend the bindings without breaking them. So for now I would ignore this mode.

Agreed.

Quoted 3 lines

So ultimately, what we have to sort out is the 1x single / 1x dual link LVDS mode setting on DSI84. Frieder already pointed out how the driver can be tweaked to support the single-link mode on DSI84, so now we need to tie it into DT bindings.

Quoted 7 lines
Quoted 3 lines

Currently, neither the LVDS panels in upstream in panel-simple nor lvds.yaml provide any indication that the panel is single-link or dual-link. Those dual-link LVDS panels seem to always set 2x pixel clock and let the bridge somehow sort it out.

Maybe that isn't always the best approach, maybe we should add a new DRM_BUS_FLAG for those panels and handle the flag in the bridge driver ? Such a new flag could be added over time to panels where applicable, so old setups won't be broken by that either, they will just ignore the new flag and work as before.

I agree that the panel driver should report whether the LVDS input is expected to be single or dual link. So introducing a DRM_BUS_FLAG for this seems like a good solution.

This wouldn't reflect the physical ports, but I don't really know how we could use two ports connected to the same panel for this case, as all the existing dual link panels don't follow this scheme.

A dual-link LVDS panel should need 2 ports, because each LVDS link could come from different controllers, here by the same but simply connect the 2 panel ports to the 2 controller's ports.

Neil

Quoted 21 lines

I would suggest, that the driver defaults to single link for the DSI84 and then switches to dual link if the panel requests it using the flag.

Quoted 18 lines
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines

I just saw the note in the header of the driver that says that single link mode is unsupported for the DSI84.

I have hardware with a single link display and if I set ctx->lvds_dual_link = false it works just fine.

How is this supposed to be selected? Does it need an extra devicetree property? And would you mind adding single-link support in the next version or do you prefer adding it in a follow-up patch?

Quoted 5 lines
Quoted 3 lines

If this has to be supported I think the proper way would be to support two output ports in the dts (e.g. lvds0_out, lvds1_out), in the same way as supported by the 'advantech,idk-2121wr' panel.

Yes, this is why I asked to have the dual-link lvds in the bindings.

Maybe it shouldn't really be in the bindings, see above.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#12 lore raw
In reply to Marek Vasut

Hi Marek,

Thank you for the patch.

Quoted 49 lines · Marek Vasut

Add DT binding document for TI SN65DSI83 and SN65DSI84 DSI to LVDS bridge.

Cc Douglas Anderson <[email protected]>
Cc Jagan Teki <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Rob Herring <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Stephen Boyd <[email protected]>

To: [email protected]
---
V2: Add compatible string for SN65DSI84, since this is now tested on it

---
 .../bindings/display/bridge/ti,sn65dsi83.yaml | 134 ++++++++++++++++++
 1 file changed, 134 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml new file +24 -0
new file mode 100644
index 000000000000..42d11b46a1eb
@@ -0,0 +1,134 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/ti,sn65dsi83.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: SN65DSI83 and SN65DSI84 DSI to LVDS bridge chip
+
+maintainers:
+  - Marek Vasut <[email protected]>
+
+description: |
+  Texas Instruments SN65DSI83 1x Single-link MIPI DSI
+  to 1x Single-link LVDS
+  https://www.ti.com/lit/gpn/sn65dsi83
+  Texas Instruments SN65DSI84 1x Single-link MIPI DSI
+  to 1x Dual-link or 2x Single-link LVDS
+  https://www.ti.com/lit/gpn/sn65dsi84
+
+properties:
+  compatible:
+    oneOf:
+      - const: ti,sn65dsi83
+      - const: ti,sn65dsi84

Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml line 34

Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml new file +10 -0
+
+  reg:
+    const: 0x2d
+
+  enable-gpios:
+    maxItems: 1
+    description: GPIO specifier for bridge_en pin (active high).
+
+  ports:
+    type: object

Could you use the OF graph schema, now that it is available ? There should be plenty of examples in bindings, both in display and in media. You will be able to drop quite a bit of boilerplate.

Quoted 62 lines
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml new file +62 -0
+    additionalProperties: false
+
+    properties:
+      "#address-cells":
+        const: 1
+
+      "#size-cells":
+        const: 0
+
+      port@0:
+        type: object
+        additionalProperties: false
+
+        description:
+          Video port for MIPI DSI input
+
+        properties:
+          reg:
+            const: 0
+
+          endpoint:
+            type: object
+            additionalProperties: false
+            properties:
+              remote-endpoint: true
+              data-lanes:
+                description: array of physical DSI data lane indexes.
+
+        required:
+          - reg
+
+      port@1:
+        type: object
+        additionalProperties: false
+
+        description:
+          Video port for LVDS output (panel or bridge).
+
+        properties:
+          reg:
+            const: 1
+
+          endpoint:
+            type: object
+            additionalProperties: false
+            properties:
+              remote-endpoint: true
+
+        required:
+          - reg
+
+    required:
+      - "#address-cells"
+      - "#size-cells"
+      - port@0
+      - port@1
+
+required:
+  - compatible
+  - reg
+  - enable-gpios
+  - ports

Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml line 106

Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml new file +10 -0
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;

While not a hard rule, it's customary to indent DT examples with 4 spaces. I find it to increase readability, but if you feel otherwise, that's OK.

Quoted 28 lines
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml new file +28 -0
+
+      bridge@2d {
+        compatible = "ti,sn65dsi83";
+        reg = <0x2d>;
+
+        enable-gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>;
+
+        ports {
+          #address-cells = <1>;
+          #size-cells = <0>;
+
+          port@0 {
+            reg = <0>;
+            endpoint {
+              remote-endpoint = <&dsi0_out>;
+              data-lanes = <1 2 3 4>;
+            };
+          };
+
+          port@1 {
+            reg = <1>;
+            endpoint {
+              remote-endpoint = <&panel_in_lvds>;
+            };
+          };
+        };
+      };
+    };
Signature · 7 lines
Regards,

Laurent Pinchart
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#13 lore raw
In reply to Marek Vasut
Quoted 96 lines · Marek Vasut

Add DT binding document for TI SN65DSI83 and SN65DSI84 DSI to LVDS bridge.

Cc Douglas Anderson <[email protected]>
Cc Jagan Teki <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Rob Herring <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Stephen Boyd <[email protected]>

To: [email protected]
---
V2: Add compatible string for SN65DSI84, since this is now tested on it

---
 .../bindings/display/bridge/ti,sn65dsi83.yaml | 134 ++++++++++++++++++
 1 file changed, 134 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml new file +71 -0
new file mode 100644
index 000000000000..42d11b46a1eb
@@ -0,0 +1,134 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/ti,sn65dsi83.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: SN65DSI83 and SN65DSI84 DSI to LVDS bridge chip
+
+maintainers:
+  - Marek Vasut <[email protected]>
+
+description: |
+  Texas Instruments SN65DSI83 1x Single-link MIPI DSI
+  to 1x Single-link LVDS
+  https://www.ti.com/lit/gpn/sn65dsi83
+  Texas Instruments SN65DSI84 1x Single-link MIPI DSI
+  to 1x Dual-link or 2x Single-link LVDS
+  https://www.ti.com/lit/gpn/sn65dsi84
+
+properties:
+  compatible:
+    oneOf:
+      - const: ti,sn65dsi83
+      - const: ti,sn65dsi84
+
+  reg:
+    const: 0x2d
+
+  enable-gpios:
+    maxItems: 1
+    description: GPIO specifier for bridge_en pin (active high).
+
+  ports:
+    type: object
+    additionalProperties: false
+
+    properties:
+      "#address-cells":
+        const: 1
+
+      "#size-cells":
+        const: 0
+
+      port@0:
+        type: object
+        additionalProperties: false
+
+        description:
+          Video port for MIPI DSI input
+
+        properties:
+          reg:
+            const: 0
+
+          endpoint:
+            type: object
+            additionalProperties: false
+            properties:
+              remote-endpoint: true
+              data-lanes:
+                description: array of physical DSI data lane indexes.
+
+        required:
+          - reg
+
+      port@1:
+        type: object
+        additionalProperties: false
+
+        description:
+          Video port for LVDS output (panel or bridge).

Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml line 81

Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml new file +10 -0
+
+        properties:
+          reg:
+            const: 1
+
+          endpoint:
+            type: object
+            additionalProperties: false
+            properties:
+              remote-endpoint: true

Similar to Jagan's serie, would be great to add bindings for the dual-link LVDS even if not supported by the driver (the driver can fails with a verbose error).

Neil

Quoted 44 lines
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml new file +43 -0
+
+        required:
+          - reg
+
+    required:
+      - "#address-cells"
+      - "#size-cells"
+      - port@0
+      - port@1
+
+required:
+  - compatible
+  - reg
+  - enable-gpios
+  - ports
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      bridge@2d {
+        compatible = "ti,sn65dsi83";
+        reg = <0x2d>;
+
+        enable-gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>;
+
+        ports {
+          #address-cells = <1>;
+          #size-cells = <0>;
+
+          port@0 {
+            reg = <0>;
+            endpoint {
+              remote-endpoint = <&dsi0_out>;
+              data-lanes = <1 2 3 4>;
+            };
+          };

Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml line 134

Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml new file +10 -0
+
+          port@1 {
+            reg = <1>;
+            endpoint {
+              remote-endpoint = <&panel_in_lvds>;
+            };
+          };
+        };
+      };
+    };

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#14 lore raw

On 4/22/21 10:38 AM, Neil Armstrong wrote:
[...]

Quoted 11 lines
Quoted 11 lines
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml new file +11 -0
+      port@1:
+        type: object
+        additionalProperties: false
+
+        description:
+          Video port for LVDS output (panel or bridge).
+
+        properties:
+          reg:
+            const: 1
+
Quoted 8 lines

Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml line 59

Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml new file +5 -0
+          endpoint:
+            type: object
+            additionalProperties: false
+            properties:
+              remote-endpoint: true

Similar to Jagan's serie, would be great to add bindings for the dual-link LVDS even if not supported by the driver (the driver can fails with a verbose error).

I don't want to add any sort of bindings which I cannot validate against real hardware. I would argue that adding the 2x single / dual link LVDS DT property could be added when someone has a need for it and can test it on real hardware, and such a binding should be simple develop and add. And that is better, because we won't end up with some possibly misdesigned untested DT binding which would become part of the ABI and would have to be supported forever.

#15 lore raw
In reply to Marek Vasut
Quoted 26 lines · Marek Vasut

Add DT binding document for TI SN65DSI83 and SN65DSI84 DSI to LVDS bridge.

Cc Douglas Anderson <[email protected]>
Cc Jagan Teki <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Rob Herring <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Stephen Boyd <[email protected]>

To: [email protected]
---
V2: Add compatible string for SN65DSI84, since this is now tested on it

---
 .../bindings/display/bridge/ti,sn65dsi83.yaml | 134 ++++++++++++++++++
 1 file changed, 134 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml new file +0 -0
new file mode 100644
index 000000000000..42d11b46a1eb

Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml line 7

Quoted 7 lines
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml new file +7 -0
@@ -0,0 +1,134 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/ti,sn65dsi83.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: SN65DSI83 and SN65DSI84 DSI to LVDS bridge chip

Can it possible to wait for my v4 to have dual-link LVDS supported which is quite discussing points on previous versions?

Jagan.

#16 lore raw

On 4/22/21 10:43 AM, Jagan Teki wrote:

[...]

Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml new file +2 -0
new file mode 100644
index 000000000000..42d11b46a1eb
@@ -0,0 +1,134 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
Quoted 8 lines

Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml line 7

Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml new file +5 -0
+---
+$id: http://devicetree.org/schemas/display/bridge/ti,sn65dsi83.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: SN65DSI83 and SN65DSI84 DSI to LVDS bridge chip

Can it possible to wait for my v4 to have dual-link LVDS supported which is quite discussing points on previous versions?

This driver already has the dual-link LVDS support on DSI84 and it is tested on real hardware. So is the single-link LVDS on DSI83, on multiple hardware instances.

In addition to that, this driver has proper regmap support and constant time calculation of DSI83/84 clock register settings.

Note that I did wait for your v4 for over two weeks already, it just didn't materialize, so I determined it might be a good idea to restart work on this driver instead.

Maybe you can test this driver and check what is missing for your usecase?
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#17 lore raw
In reply to Marek Vasut
Quoted 42 lines · Marek Vasut

Add DT binding document for TI SN65DSI83 and SN65DSI84 DSI to LVDS bridge.

Cc Douglas Anderson <[email protected]>
Cc Jagan Teki <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Rob Herring <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Stephen Boyd <[email protected]>

To: [email protected]
---
V2: Add compatible string for SN65DSI84, since this is now tested on it

---
  .../bindings/display/bridge/ti,sn65dsi83.yaml | 134 ++++++++++++++++++
  1 file changed, 134 insertions(+)

create mode 100644 Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml

Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml new file +17 -0
new file mode 100644
index 000000000000..42d11b46a1eb
@@ -0,0 +1,134 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/ti,sn65dsi83.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: SN65DSI83 and SN65DSI84 DSI to LVDS bridge chip
+
+maintainers:
+  - Marek Vasut <[email protected]>
+
+description: |
+  Texas Instruments SN65DSI83 1x Single-link MIPI DSI
+  to 1x Single-link LVDS
+  https://www.ti.com/lit/gpn/sn65dsi83
+  Texas Instruments SN65DSI84 1x Single-link MIPI DSI
+  to 1x Dual-link or 2x Single-link LVDS

Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml line 27

Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml new file +10 -0
+  https://www.ti.com/lit/gpn/sn65dsi84
+
+properties:
+  compatible:
+    oneOf:
+      - const: ti,sn65dsi83
+      - const: ti,sn65dsi84
+
+  reg:
+    const: 0x2d

There is a strapping pin to select the last bit of the address, so apart from 0x2d also 0x2c is valid here.

Quoted 108 lines
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml new file +107 -0
+
+  enable-gpios:
+    maxItems: 1
+    description: GPIO specifier for bridge_en pin (active high).
+
+  ports:
+    type: object
+    additionalProperties: false
+
+    properties:
+      "#address-cells":
+        const: 1
+
+      "#size-cells":
+        const: 0
+
+      port@0:
+        type: object
+        additionalProperties: false
+
+        description:
+          Video port for MIPI DSI input
+
+        properties:
+          reg:
+            const: 0
+
+          endpoint:
+            type: object
+            additionalProperties: false
+            properties:
+              remote-endpoint: true
+              data-lanes:
+                description: array of physical DSI data lane indexes.
+
+        required:
+          - reg
+
+      port@1:
+        type: object
+        additionalProperties: false
+
+        description:
+          Video port for LVDS output (panel or bridge).
+
+        properties:
+          reg:
+            const: 1
+
+          endpoint:
+            type: object
+            additionalProperties: false
+            properties:
+              remote-endpoint: true
+
+        required:
+          - reg
+
+    required:
+      - "#address-cells"
+      - "#size-cells"
+      - port@0
+      - port@1
+
+required:
+  - compatible
+  - reg
+  - enable-gpios
+  - ports
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      bridge@2d {
+        compatible = "ti,sn65dsi83";
+        reg = <0x2d>;
+
+        enable-gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>;
+
+        ports {
+          #address-cells = <1>;
+          #size-cells = <0>;
+
+          port@0 {
+            reg = <0>;
+            endpoint {
+              remote-endpoint = <&dsi0_out>;
+              data-lanes = <1 2 3 4>;
+            };
+          };
+
+          port@1 {
+            reg = <1>;
+            endpoint {
+              remote-endpoint = <&panel_in_lvds>;
+            };
+          };
+        };
+      };
+    };
#18 lore raw

On 4/28/21 9:56 AM, Frieder Schrempf wrote:
[...]

Quoted 10 lines

Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml line 27

Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml new file +8 -0
+properties:
+  compatible:
+    oneOf:
+      - const: ti,sn65dsi83
+      - const: ti,sn65dsi84
+
+  reg:
+    const: 0x2d

There is a strapping pin to select the last bit of the address, so apart from 0x2d also 0x2c is valid here.

Fixed, along with the other DT details pointed out by Laurent, thanks.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel