Skip to contentSkip to conversation

Add LT9611 DSI to HDMI bridge

PATCH Superseded Vinod Koul 3 participants 12 messages Jul 8, 2020 – Jul 23, 2020

Subsystems (6)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Vinod Koul

author
#0 lore raw

v5 cover Add LT9611 DSI to HDMI bridge

Hi,

This series adds driver and bindings for Lontium LT9611 bridge chip which takes MIPI DSI as input and HDMI as output.

This chip can be found in 96boards RB3 platform [1] commonly called DB845c.

[1]: https://www.96boards.org/product/rb3-platform/

Changes in v5:
- make symbol static, reported by kbuild-bot

Changes in v4:
- Add msm/dsi patch to create connector and support DRM_BRIDGE_ATTACH_NO_CONNECTOR
- Fix comments provided by Sam

Changes in v3:
- fix kbuild reported error
- rebase on v5.8-rc1

Changes in v2:
- Add acks by Rob
- Fix comments reported by Emil and rename the file to lontium-lt9611.c
- Fix comments reported by Laurent on binding and driver
- Add HDMI audio support

Vinod Koul (4):
dt-bindings: vendor-prefixes: Add Lontium vendor prefix
dt-bindings: display: bridge: Add documentation for LT9611 drm/bridge: Introduce LT9611 DSI to HDMI bridge drm/msm/dsi: attach external bridge with
DRM_BRIDGE_ATTACH_NO_CONNECTOR

 .../display/bridge/lontium,lt9611.yaml        |  176 +++
 .../devicetree/bindings/vendor-prefixes.yaml  |    2 +
 drivers/gpu/drm/bridge/Kconfig                |   13 +
 drivers/gpu/drm/bridge/Makefile               |    1 +
 drivers/gpu/drm/bridge/lontium-lt9611.c       | 1142 +++++++++++++++++
 drivers/gpu/drm/msm/dsi/dsi.c                 |    7 +-
 drivers/gpu/drm/msm/dsi/dsi_manager.c         |   27 +-
 7 files changed, 1348 insertions(+), 20 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/lontium,lt9611.yaml
 create mode 100644 drivers/gpu/drm/bridge/lontium-lt9611.c
Signature · 1 line
2.26.2
author
#1 lore raw

PATCH v5 1/4 dt-bindings: vendor-prefixes: Add Lontium vendor prefix

Add prefix for Lontium Semiconductor Corporation

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 9aeab66be85f..31cdb21a3d22 100644
@@ -595,6 +595,8 @@ patternProperties:
     description: Logic Technologies Limited
   "^longcheer,.*":
     description: Longcheer Technology (Shanghai) Co., Ltd.
+  "^lontium,.*":
+    description: Lontium Semiconductor Corporation
   "^loongson,.*":
     description: Loongson Technology Corporation Limited
   "^lsi,.*":
Signature · 1 line
2.26.2
author
#2 lore raw

PATCH v5 2/4 dt-bindings: display: bridge: Add documentation for LT9611

In reply to Vinod Koul

Lontium LT9611 is a DSI to HDMI bridge which supports 2 DSI ports and I2S port as input and one HDMI port as output

---
 .../display/bridge/lontium,lt9611.yaml        | 176 ++++++++++++++++++
 1 file changed, 176 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/lontium,lt9611.yaml
Documentation/devicetree/bindings/display/bridge/lontium,lt9611.yaml new file +176 -0
new file mode 100644
index 000000000000..d60208359234
@@ -0,0 +1,176 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/lontium,lt9611.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Lontium LT9611 2 Port MIPI to HDMI Bridge
+
+maintainers:
+  - Vinod Koul <[email protected]>
+
+description: |
+  The LT9611 is a bridge device which converts DSI to HDMI
+
+properties:
+  compatible:
+    enum:
+      - lontium,lt9611
+
+  reg:
+    maxItems: 1
+
+  "#sound-dai-cells":
+    const: 1
+
+  interrupts:
+    maxItems: 1
+
+  reset-gpios:
+    maxItems: 1
+    description: GPIO connected to active high RESET pin.
+
+  vdd-supply:
+    description: Regulator for 1.8V MIPI phy power.
+
+  vcc-supply:
+    description: Regulator for 3.3V IO power.
+
+  ports:
+    type: object
+
+    properties:
+      "#address-cells":
+        const: 1
+
+      "#size-cells":
+        const: 0
+
+      port@0:
+        type: object
+        description: |
+          Primary MIPI port-1 for MIPI input
+
+        properties:
+          reg:
+            const: 0
+
+        patternProperties:
+          "^endpoint(@[0-9])$":
+            type: object
+            additionalProperties: false
+
+            properties:
+              remote-endpoint:
+                $ref: /schemas/types.yaml#/definitions/phandle
+
+        required:
+          - reg
+
+      port@1:
+        type: object
+        description: |
+          Additional MIPI port-2 for MIPI input, used in combination
+          with primary MIPI port-1 to drive higher resolution displays
+
+        properties:
+          reg:
+            const: 1
+
+        patternProperties:
+          "^endpoint(@[0-9])$":
+            type: object
+            additionalProperties: false
+
+            properties:
+              remote-endpoint:
+                $ref: /schemas/types.yaml#/definitions/phandle
+
+        required:
+          - reg
+
+      port@2:
+        type: object
+        description: |
+          HDMI port for HDMI output
+
+        properties:
+          reg:
+            const: 2
+
+        patternProperties:
+          "^endpoint(@[0-9])$":
+            type: object
+            additionalProperties: false
+
+            properties:
+              remote-endpoint:
+                $ref: /schemas/types.yaml#/definitions/phandle
+
+        required:
+          - reg
+
+    required:
+      - "#address-cells"
+      - "#size-cells"
+      - port@0
+      - port@2
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - vdd-supply
+  - vcc-supply
+  - ports
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    i2c10 {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      hdmi-bridge@3b {
+        compatible = "lontium,lt9611";
+        reg = <0x3b>;
+
+        reset-gpios = <&tlmm 128 GPIO_ACTIVE_HIGH>;
+        interrupts-extended = <&tlmm 84 IRQ_TYPE_EDGE_FALLING>;
+
+        vdd-supply = <&lt9611_1v8>;
+        vcc-supply = <&lt9611_3v3>;
+
+        ports {
+          #address-cells = <1>;
+          #size-cells = <0>;
+
+          port@0 {
+            reg = <0>;
+            lt9611_a: endpoint {
+              remote-endpoint = <&dsi0_out>;
+            };
+          };
+
+          port@1 {
+            reg = <1>;
+            lt9611_b: endpoint {
+              remote-endpoint = <&dsi1_out>;
+            };
+          };
+
+          port@2 {
+            reg = <2>;
+            lt9611_out: endpoint {
+              remote-endpoint = <&hdmi_con>;
+            };
+          };
+        };
+      };
+    };
+
+...
Signature · 6 lines
2.26.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#3 lore raw

PATCH v5 3/4 drm/bridge: Introduce LT9611 DSI to HDMI bridge

In reply to Vinod Koul

Lontium Lt9611 is a DSI to HDMI bridge which supports two DSI ports and I2S port as an input and HDMI port as output

---
 drivers/gpu/drm/bridge/Kconfig          |   13 +
 drivers/gpu/drm/bridge/Makefile         |    1 +
 drivers/gpu/drm/bridge/lontium-lt9611.c | 1142 +++++++++++++++++++++++
 3 files changed, 1156 insertions(+)
 create mode 100644 drivers/gpu/drm/bridge/lontium-lt9611.c
drivers/gpu/drm/bridge/Kconfig +13 -0
index 43271c21d3fc..c7f0dacfb57a 100644
@@ -48,6 +48,19 @@ config DRM_DISPLAY_CONNECTOR
 	  on ARM-based platforms. Saying Y here when this driver is not needed
 	  will not cause any issue.
 
+config DRM_LONTIUM_LT9611
+	tristate "Lontium LT9611 DSI/HDMI bridge"
+	select SND_SOC_HDMI_CODEC if SND_SOC
+	depends on OF
+	select DRM_PANEL_BRIDGE
+	select DRM_KMS_HELPER
+	select REGMAP_I2C
+	help
+	  Driver for Lontium LT9611 DSI to HDMI bridge
+	  chip driver that converts dual DSI and I2S to
+	  HDMI signals
+	  Please say Y if you have such hardware.
+
 config DRM_LVDS_CODEC
 	tristate "Transparent LVDS encoders and decoders support"
 	depends on OF
drivers/gpu/drm/bridge/Makefile +1 -0
index d63d4b7e4347..7d7c123a95e4 100644
@@ -2,6 +2,7 @@
 obj-$(CONFIG_DRM_CDNS_DSI) += cdns-dsi.o
 obj-$(CONFIG_DRM_CHRONTEL_CH7033) += chrontel-ch7033.o
 obj-$(CONFIG_DRM_DISPLAY_CONNECTOR) += display-connector.o
+obj-$(CONFIG_DRM_LONTIUM_LT9611) += lontium-lt9611.o
 obj-$(CONFIG_DRM_LVDS_CODEC) += lvds-codec.o
 obj-$(CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW) += megachips-stdpxxxx-ge-b850v3-fw.o
 obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o
drivers/gpu/drm/bridge/lontium-lt9611.c new file +1142 -0

1,142 lines not on this page · raw message

Signature · 6 lines
2.26.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v5 3/4
#4 lore raw

Re: [PATCH v5 3/4] drm/bridge: Introduce LT9611 DSI to HDMI bridge

Hi Vinod.

Three trivial points below.
The rest looks good.

With these fixed you can add:

Sam

Quoted 16 lines · Vinod Koul

Lontium Lt9611 is a DSI to HDMI bridge which supports two DSI ports and I2S port as an input and HDMI port as output

---
 drivers/gpu/drm/bridge/Kconfig          |   13 +
 drivers/gpu/drm/bridge/Makefile         |    1 +
 drivers/gpu/drm/bridge/lontium-lt9611.c | 1142 +++++++++++++++++++++++
 3 files changed, 1156 insertions(+)
 create mode 100644 drivers/gpu/drm/bridge/lontium-lt9611.c

drivers/gpu/drm/bridge/lontium-lt9611.c line 21

Quoted 6 lines
drivers/gpu/drm/bridge/lontium-lt9611.c new file +6 -0
+
+#include <drm/drm_probe_helper.h>
+#include <drm/drm_atomic_helper.h>
+#include <drm/drm_bridge.h>
+#include <drm/drm_mipi_dsi.h>
+#include <drm/drm_print.h>

In alphabetical order. drm_probe_helper needs to be moved.

Quoted 32 lines
(quoted diff) +30 -0
+
+#define EDID_SEG_SIZE	256
+#define EDID_LEN	32
+#define EDID_LOOP	8
+#define KEY_DDC_ACCS_DONE 0x02
+#define DDC_NO_ACK	0x50
+
 
 
+static void lt9611_pcr_setup(struct lt9611 *lt9611, const struct drm_display_mode *mode)
+{
+	const struct reg_sequence reg_cfg[] = {
+		{ 0x830b, 0x01 },
+		{ 0x830c, 0x10 },
+		{ 0x8348, 0x00 },
+		{ 0x8349, 0x81 },
+
+		/* stage 1 */
+		{ 0x8321, 0x4a },
+		{ 0x8324, 0x71 },
+		{ 0x8325, 0x30 },
+		{ 0x832a, 0x01 },
+
+		/* stage 2 */
+		{ 0x834a, 0x40 },
+		{ 0x831d, 0x10 },
+
+		/* MK limit */
+		{ 0x832d, 0x38 },
+		{ 0x8331, 0x08 },
+	};
+	const struct reg_sequence reg_cfg2[] = {

Review

Quoted 10 lines
(quoted diff) +10 -0
+			{ 0x830b, 0x03 },
+			{ 0x830c, 0xd0 },
+			{ 0x8348, 0x03 },
+			{ 0x8349, 0xe0 },
+			{ 0x8324, 0x72 },
+			{ 0x8325, 0x00 },
+			{ 0x832a, 0x01 },
+			{ 0x834a, 0x10 },
+			{ 0x831d, 0x10 },
+			{ 0x8326, 0x37 },

Block above is indented one tab too much.

drivers/gpu/drm/bridge/lontium-lt9611.c line 752

Quoted 10 lines
drivers/gpu/drm/bridge/lontium-lt9611.c new file +10 -0
+static int lt9611_bridge_attach(struct drm_bridge *bridge,
+				enum drm_bridge_attach_flags flags)
+{
+	struct lt9611 *lt9611 = bridge_to_lt9611(bridge);
+	int ret;
+
+	if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) {
+		dev_err(lt9611->dev, "Fix bridge driver to make connector optional!");
+		return -EINVAL;
+	}

This should say that the display driver should be fixed. If a display driver expects this bridge to create the connector it would not work.

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

author
#5 lore raw

Re: [PATCH v5 3/4] drm/bridge: Introduce LT9611 DSI to HDMI bridge

Hi Sam,

Quoted 7 lines · Sam Ravnborg

Hi Vinod.

Three trivial points below.
The rest looks good.

With these fixed you can add:

Thanks, I will send an update with nits fixed

Signature · 1 line
~Vinod
#6 lore raw

Re: [PATCH v5 3/4] drm/bridge: Introduce LT9611 DSI to HDMI bridge

In reply to Sam Ravnborg

Hello,

Quoted 80 lines · Sam Ravnborg

Hi Vinod.

Three trivial points below.
The rest looks good.

With these fixed you can add:

Sam

Quoted 16 lines · Vinod Koul

Lontium Lt9611 is a DSI to HDMI bridge which supports two DSI ports and I2S port as an input and HDMI port as output

---
 drivers/gpu/drm/bridge/Kconfig          |   13 +
 drivers/gpu/drm/bridge/Makefile         |    1 +
 drivers/gpu/drm/bridge/lontium-lt9611.c | 1142 +++++++++++++++++++++++
 3 files changed, 1156 insertions(+)
 create mode 100644 drivers/gpu/drm/bridge/lontium-lt9611.c

drivers/gpu/drm/bridge/lontium-lt9611.c line 21

Quoted 6 lines
drivers/gpu/drm/bridge/lontium-lt9611.c new file +6 -0
+
+#include <drm/drm_probe_helper.h>
+#include <drm/drm_atomic_helper.h>
+#include <drm/drm_bridge.h>
+#include <drm/drm_mipi_dsi.h>
+#include <drm/drm_print.h>

In alphabetical order. drm_probe_helper needs to be moved.

Quoted 31 lines
(quoted diff) +30 -0
+
+#define EDID_SEG_SIZE	256
+#define EDID_LEN	32
+#define EDID_LOOP	8
+#define KEY_DDC_ACCS_DONE 0x02
+#define DDC_NO_ACK	0x50
+
 
+static void lt9611_pcr_setup(struct lt9611 *lt9611, const struct drm_display_mode *mode)
+{
+	const struct reg_sequence reg_cfg[] = {
+		{ 0x830b, 0x01 },
+		{ 0x830c, 0x10 },
+		{ 0x8348, 0x00 },
+		{ 0x8349, 0x81 },
+
+		/* stage 1 */
+		{ 0x8321, 0x4a },
+		{ 0x8324, 0x71 },
+		{ 0x8325, 0x30 },
+		{ 0x832a, 0x01 },
+
+		/* stage 2 */
+		{ 0x834a, 0x40 },
+		{ 0x831d, 0x10 },
+
+		/* MK limit */
+		{ 0x832d, 0x38 },
+		{ 0x8331, 0x08 },
+	};
+	const struct reg_sequence reg_cfg2[] = {

Review

Quoted 10 lines
(quoted diff) +10 -0
+			{ 0x830b, 0x03 },
+			{ 0x830c, 0xd0 },
+			{ 0x8348, 0x03 },
+			{ 0x8349, 0xe0 },
+			{ 0x8324, 0x72 },
+			{ 0x8325, 0x00 },
+			{ 0x832a, 0x01 },
+			{ 0x834a, 0x10 },
+			{ 0x831d, 0x10 },
+			{ 0x8326, 0x37 },

Block above is indented one tab too much.

Quoted 14 lines

drivers/gpu/drm/bridge/lontium-lt9611.c line 752

Quoted 10 lines
drivers/gpu/drm/bridge/lontium-lt9611.c new file +10 -0
+static int lt9611_bridge_attach(struct drm_bridge *bridge,
+				enum drm_bridge_attach_flags flags)
+{
+	struct lt9611 *lt9611 = bridge_to_lt9611(bridge);
+	int ret;
+
+	if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) {
+		dev_err(lt9611->dev, "Fix bridge driver to make connector optional!");
+		return -EINVAL;
+	}

This should say that the display driver should be fixed. If a display driver expects this bridge to create the connector it would not work.

Actually, for new bridge drivers, connector creation should be optional from the start. We don't want a failure in that case, the feature should be implemented.

Signature · 3 lines
Regards,

Laurent Pinchart
author
#7 lore raw

Re: [PATCH v5 3/4] drm/bridge: Introduce LT9611 DSI to HDMI bridge

Hi Sam, Laurent,

Quoted 15 lines · Laurent Pinchart
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/bridge/lontium-lt9611.c new file +6 -0
+static int lt9611_bridge_attach(struct drm_bridge *bridge,
+				enum drm_bridge_attach_flags flags)
+{
+	struct lt9611 *lt9611 = bridge_to_lt9611(bridge);
+	int ret;
+
Quoted 8 lines

drivers/gpu/drm/bridge/lontium-lt9611.c line 752

Quoted 4 lines
drivers/gpu/drm/bridge/lontium-lt9611.c new file +4 -0
+	if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) {
+		dev_err(lt9611->dev, "Fix bridge driver to make connector optional!");
+		return -EINVAL;
+	}

This should say that the display driver should be fixed. If a display driver expects this bridge to create the connector it would not work.

Quoted 3 lines

Actually, for new bridge drivers, connector creation should be optional from the start. We don't want a failure in that case, the feature should be implemented.

Yes this is causing issues for me now !. The patch 4/4 adds support in msm/dsi but causes regression on qualcomm laptops with ti-sn65dsi86 eDP bridge. I tried to fix that up with changes like Laurent has done for adv7511, but it hasnt worked yet for me (remote debug of this is bit painful)

So I am going to drop patch 4 from this series and add support for both DRM_BRIDGE_ATTACH_NO_CONNECTOR set and cleared (like we have in adv7511) so that it can work in both cases, while I fix all bridge uses of msm/dsi and then we can drop these. Does that sound okay to you folks?

Signature · 5 lines
~Vinod
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#8 lore raw

Re: [PATCH v5 3/4] drm/bridge: Introduce LT9611 DSI to HDMI bridge

Quoted 28 lines · Vinod Koul

Hi Sam, Laurent,

Quoted 15 lines · Laurent Pinchart
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/bridge/lontium-lt9611.c new file +6 -0
+static int lt9611_bridge_attach(struct drm_bridge *bridge,
+				enum drm_bridge_attach_flags flags)
+{
+	struct lt9611 *lt9611 = bridge_to_lt9611(bridge);
+	int ret;
+
Quoted 8 lines

drivers/gpu/drm/bridge/lontium-lt9611.c line 752

Quoted 4 lines
drivers/gpu/drm/bridge/lontium-lt9611.c new file +4 -0
+	if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) {
+		dev_err(lt9611->dev, "Fix bridge driver to make connector optional!");
+		return -EINVAL;
+	}

This should say that the display driver should be fixed. If a display driver expects this bridge to create the connector it would not work.

Quoted 3 lines

Actually, for new bridge drivers, connector creation should be optional from the start. We don't want a failure in that case, the feature should be implemented.

Yes this is causing issues for me now !. The patch 4/4 adds support in msm/dsi but causes regression on qualcomm laptops with ti-sn65dsi86 eDP bridge. I tried to fix that up with changes like Laurent has done for adv7511, but it hasnt worked yet for me (remote debug of this is bit painful)

Quoted 4 lines

So I am going to drop patch 4 from this series and add support for both DRM_BRIDGE_ATTACH_NO_CONNECTOR set and cleared (like we have in adv7511) so that it can work in both cases, while I fix all bridge uses of msm/dsi and then we can drop these. Does that sound okay to you folks?

Yes, sounds like a good plan.
Only when all display drivers are migrated over can we drop all the workarounds in the bridge drivers.
I had hoped all users of this bridge was converted - alas that was not the case.

Sam

author
#9 lore raw

Re: [PATCH v5 3/4] drm/bridge: Introduce LT9611 DSI to HDMI bridge

Quoted 33 lines · Sam Ravnborg
Quoted 28 lines · Vinod Koul

Hi Sam, Laurent,

Quoted 15 lines · Laurent Pinchart
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/bridge/lontium-lt9611.c new file +6 -0
+static int lt9611_bridge_attach(struct drm_bridge *bridge,
+				enum drm_bridge_attach_flags flags)
+{
+	struct lt9611 *lt9611 = bridge_to_lt9611(bridge);
+	int ret;
+
Quoted 8 lines

drivers/gpu/drm/bridge/lontium-lt9611.c line 752

Quoted 4 lines
drivers/gpu/drm/bridge/lontium-lt9611.c new file +4 -0
+	if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) {
+		dev_err(lt9611->dev, "Fix bridge driver to make connector optional!");
+		return -EINVAL;
+	}

This should say that the display driver should be fixed. If a display driver expects this bridge to create the connector it would not work.

Quoted 3 lines

Actually, for new bridge drivers, connector creation should be optional from the start. We don't want a failure in that case, the feature should be implemented.

Yes this is causing issues for me now !. The patch 4/4 adds support in msm/dsi but causes regression on qualcomm laptops with ti-sn65dsi86 eDP bridge. I tried to fix that up with changes like Laurent has done for adv7511, but it hasnt worked yet for me (remote debug of this is bit painful)

Quoted 4 lines

So I am going to drop patch 4 from this series and add support for both DRM_BRIDGE_ATTACH_NO_CONNECTOR set and cleared (like we have in adv7511) so that it can work in both cases, while I fix all bridge uses of msm/dsi and then we can drop these. Does that sound okay to you folks?

Quoted 5 lines

Yes, sounds like a good plan.
Only when all display drivers are migrated over can we drop all the workarounds in the bridge drivers.
I had hoped all users of this bridge was converted - alas that was not the case.

Thanks, I will send updated patchset fixing the nits and supporting both the cases and will drop msm/dsi patch for now

Signature · 1 line
~Vinod
author
#10 lore raw

PATCH v5 4/4 drm/msm/dsi: attach external bridge with DRM_BRIDGE_ATTACH_NO_CONNECTOR

In reply to Vinod Koul

Modern bridges do not create the connector and expect the display driver to do so. Hence, create the drm connector in msm display driver and add use flag DRM_BRIDGE_ATTACH_NO_CONNECTOR to attach bridges

---
 drivers/gpu/drm/msm/dsi/dsi.c         |  7 +------
 drivers/gpu/drm/msm/dsi/dsi_manager.c | 27 +++++++++++++--------------
 2 files changed, 14 insertions(+), 20 deletions(-)
drivers/gpu/drm/msm/dsi/dsi.c +1 -6
index 55ea4bc2ee9c..617075e3e3f0 100644
@@ -219,12 +219,7 @@ int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev,
 		goto fail;
 	}
 
-	/*
-	 * check if the dsi encoder output is connected to a panel or an
-	 * external bridge. We create a connector only if we're connected to a
-	 * drm_panel device. When we're connected to an external bridge, we
-	 * assume that the drm_bridge driver will create the connector itself.
-	 */
+	/* Initialize the internal panel or external bridge */
 	ext_bridge = msm_dsi_host_get_bridge(msm_dsi->host);
 
 	if (ext_bridge)
drivers/gpu/drm/msm/dsi/dsi_manager.c +13 -14
index 4b363bd7ddff..72cfd0a8187b 100644
@@ -3,6 +3,7 @@
  * Copyright (c) 2015, The Linux Foundation. All rights reserved.
  */
 
+#include <drm/drm_bridge_connector.h>
 #include "msm_kms.h"
 #include "dsi.h"
 
@@ -689,7 +690,7 @@ struct drm_bridge *msm_dsi_manager_bridge_init(u8 id)
 	bridge = &dsi_bridge->base;
 	bridge->funcs = &dsi_mgr_bridge_funcs;
 
-	ret = drm_bridge_attach(encoder, bridge, NULL, 0);
+	ret = drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
 	if (ret)
 		goto fail;
 
@@ -709,7 +710,6 @@ struct drm_connector *msm_dsi_manager_ext_bridge_init(u8 id)
 	struct drm_encoder *encoder;
 	struct drm_bridge *int_bridge, *ext_bridge;
 	struct drm_connector *connector;
-	struct list_head *connector_list;
 
 	int_bridge = msm_dsi->bridge;
 	ext_bridge = msm_dsi->external_bridge =
@@ -717,22 +717,21 @@ struct drm_connector *msm_dsi_manager_ext_bridge_init(u8 id)
 
 	encoder = msm_dsi->encoder;
 
-	/* link the internal dsi bridge to the external bridge */
-	drm_bridge_attach(encoder, ext_bridge, int_bridge, 0);
-
-	/*
-	 * we need the drm_connector created by the external bridge
-	 * driver (or someone else) to feed it to our driver's
-	 * priv->connector[] list, mainly for msm_fbdev_init()
+	/* link the internal dsi bridge to the external bridge and attach
+	 * the connector, we are supporting DRM_BRIDGE_ATTACH_NO_CONNECTOR
+	 * so always create connector
 	 */
-	connector_list = &dev->mode_config.connector_list;
+	drm_bridge_attach(encoder, ext_bridge, int_bridge, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
 
-	list_for_each_entry(connector, connector_list, head) {
-		if (drm_connector_has_possible_encoder(connector, encoder))
-			return connector;
+	connector = drm_bridge_connector_init(dev, encoder);
+	if (IS_ERR(connector)) {
+		DRM_DEV_ERROR(dev->dev, "drm_bridge_connector_init failed: %ld\n",
+			      PTR_ERR(connector));
+		return ERR_PTR(-ENODEV);
 	}
 
-	return ERR_PTR(-ENODEV);
+	drm_connector_attach_encoder(connector, msm_dsi->encoder);
+	return connector;
 }
 
 void msm_dsi_manager_bridge_destroy(struct drm_bridge *bridge)
Signature · 6 lines
2.26.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#11 lore raw
In reply to Vinod Koul

Hello,

Quoted 6 lines · Vinod Koul

Hi,

This series adds driver and bindings for Lontium LT9611 bridge chip which takes MIPI DSI as input and HDMI as output.

This chip can be found in 96boards RB3 platform [1] commonly called DB845c.

Any feedback on this series?

Quoted 40 lines

[1]: https://www.96boards.org/product/rb3-platform/

Changes in v5:
- make symbol static, reported by kbuild-bot

Changes in v4:
- Add msm/dsi patch to create connector and support DRM_BRIDGE_ATTACH_NO_CONNECTOR
- Fix comments provided by Sam

Changes in v3:
- fix kbuild reported error
- rebase on v5.8-rc1

Changes in v2:
- Add acks by Rob
- Fix comments reported by Emil and rename the file to lontium-lt9611.c
- Fix comments reported by Laurent on binding and driver
- Add HDMI audio support

Vinod Koul (4):
dt-bindings: vendor-prefixes: Add Lontium vendor prefix
dt-bindings: display: bridge: Add documentation for LT9611 drm/bridge: Introduce LT9611 DSI to HDMI bridge drm/msm/dsi: attach external bridge with
DRM_BRIDGE_ATTACH_NO_CONNECTOR

 .../display/bridge/lontium,lt9611.yaml        |  176 +++
 .../devicetree/bindings/vendor-prefixes.yaml  |    2 +
 drivers/gpu/drm/bridge/Kconfig                |   13 +
 drivers/gpu/drm/bridge/Makefile               |    1 +
 drivers/gpu/drm/bridge/lontium-lt9611.c       | 1142 +++++++++++++++++
 drivers/gpu/drm/msm/dsi/dsi.c                 |    7 +-
 drivers/gpu/drm/msm/dsi/dsi_manager.c         |   27 +-
 7 files changed, 1348 insertions(+), 20 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/lontium,lt9611.yaml
 create mode 100644 drivers/gpu/drm/bridge/lontium-lt9611.c
Signature · 1 line
2.26.2
Signature · 1 line
~Vinod