Skip to contentSkip to conversation

drm: bridge: add ssd2825 RGB/DSI bridge support

PATCH Superseded Svyatoslav Ryhel 2 participants 6 messages Feb 23, 2025 – Apr 8, 2025

Subsystems (4)

v3 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v3 cover drm: bridge: add ssd2825 RGB/DSI bridge support

Solomon SSD2825 is a RGB to MIPI DSI bridge used in LG Optimus 4D P880 and LG Optimus Vu P895

---
Changes on switching from v2 to v3:
- added mutex guard
- configuration register flags parametrized using panel flags
- removed unneded debug messages
- removed unimplemented modes checks
- added check for maximum pixel row length
- use types header
- remove ssd2825_to_ns
- shift bridge setup into atomic pre-enable
- cleaned default values of hzd and hpd

Changes on switching from v1 to v2:
- added description for clock
- removed clock-names
- added boundries for hs-zero-delay-ns and hs-prep-delay-ns
- added mutex lock for host transfers
- converted to atomic ops
- get drm_display_mode mode with atomic helpers
- parameterized INTERFACE_CTRL_REG_6 configuration
- added video mode validation and fixup
- removed clock name
- switched to devm_regulator_bulk_get_const
- added default timings
---

Svyatoslav Ryhel (2):
dt-bindings: display: bridge: Document Solomon SSD2825
drm: bridge: Add support for Solomon SSD2825 RGB/DSI bridge

 .../display/bridge/solomon,ssd2825.yaml       | 141 +++
 drivers/gpu/drm/bridge/Kconfig                |  13 +
 drivers/gpu/drm/bridge/Makefile               |   1 +
 drivers/gpu/drm/bridge/ssd2825.c              | 821 ++++++++++++++++++
 4 files changed, 976 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/solomon,ssd2825.yaml
 create mode 100644 drivers/gpu/drm/bridge/ssd2825.c
Signature · 1 line
2.43.0
#1 lore raw

PATCH v3 1/2 dt-bindings: display: bridge: Document Solomon SSD2825

Add bindings for Solomon SSD2825 MIPI master bridge chip that connects an application processor with traditional parallel LCD interface and an LCD driver with MIPI slave interface. The SSD2825 supports both parallel RGB interface and serial SPI interface.

---
 .../display/bridge/solomon,ssd2825.yaml       | 141 ++++++++++++++++++
 1 file changed, 141 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/solomon,ssd2825.yaml
Documentation/devicetree/bindings/display/bridge/solomon,ssd2825.yaml new file +141 -0
new file mode 100644
index 000000000000..e2d293d623b8
@@ -0,0 +1,141 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/solomon,ssd2825.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Solomon SSD2825 RGB to MIPI-DSI bridge
+
+maintainers:
+  - Svyatoslav Ryhel <[email protected]>
+
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+properties:
+  compatible:
+    const: solomon,ssd2825
+
+  reg:
+    maxItems: 1
+
+  reset-gpios: true
+
+  dvdd-supply:
+    description: Regulator for 1.2V digital power supply.
+
+  avdd-supply:
+    description: Regulator for 1.2V analog power supply.
+
+  vddio-supply:
+    description: Regulator for 1.8V IO power supply.
+
+  spi-max-frequency:
+    maximum: 1000000
+
+  spi-cpha: true
+  spi-cpol: true
+
+  clocks:
+    maxItems: 1
+    description: Reference TX_CLK used before PLL is locked.
+
+  solomon,hs-zero-delay-ns:
+    description:
+      HS zero delay period
+    minimum: 0
+    maximum: 1700
+    default: 133
+
+  solomon,hs-prep-delay-ns:
+    description:
+      HS prep delay period
+    minimum: 0
+    maximum: 1728
+    default: 40
+
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+
+    properties:
+      port@0:
+        $ref: /schemas/graph.yaml#/$defs/port-base
+        unevaluatedProperties: false
+        description:
+          Video port for RGB input
+
+        properties:
+          endpoint:
+            $ref: /schemas/graph.yaml#/$defs/endpoint-base
+            unevaluatedProperties: false
+
+            properties:
+              bus-width:
+                enum: [ 16, 18, 24 ]
+
+      port@1:
+        $ref: /schemas/graph.yaml#/properties/port
+        description:
+          Video port for DSI output (panel or connector)
+
+    required:
+      - port@0
+      - port@1
+
+required:
+  - compatible
+  - ports
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        dsi@2 {
+            compatible = "solomon,ssd2825";
+            reg = <2>;
+
+            spi-max-frequency = <1000000>;
+
+            spi-cpha;
+            spi-cpol;
+
+            reset-gpios = <&gpio 114 GPIO_ACTIVE_LOW>;
+
+            dvdd-supply = <&vdd_1v2>;
+            avdd-supply = <&vdd_1v2>;
+            vddio-supply = <&vdd_1v8_io>;
+
+            solomon,hs-zero-delay-ns = <300>;
+            solomon,hs-prep-delay-ns = <65>;
+
+            clocks = <&ssd2825_tx_clk>;
+
+            ports {
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                port@0 {
+                    reg = <0>;
+
+                    bridge_input: endpoint {
+                        remote-endpoint = <&dpi_output>;
+                        bus-width = <24>;
+                    };
+                };
+
+                port@1 {
+                    reg = <1>;
+
+                    bridge_output: endpoint {
+                        remote-endpoint = <&panel_input>;
+                    };
+                };
+            };
+        };
+    };
Signature · 1 line
2.43.0
#2 lore raw

PATCH v3 2/2 drm: bridge: Add support for Solomon SSD2825 RGB/DSI bridge

In reply to Svyatoslav Ryhel

SSD2825 is a cost-effective MIPI Bridge Chip solution targeting mainly smartphones. It can convert 24bit RGB interface into 4-lane MIPI-DSI interface to drive display modules of up to 800 x 1366, while supporting AMOLED, a-si LCD or LTPS panel technologies for smartphone applications.

---
 drivers/gpu/drm/bridge/Kconfig   |  13 +
 drivers/gpu/drm/bridge/Makefile  |   1 +
 drivers/gpu/drm/bridge/ssd2825.c | 821 +++++++++++++++++++++++++++++++
 3 files changed, 835 insertions(+)
 create mode 100644 drivers/gpu/drm/bridge/ssd2825.c
drivers/gpu/drm/bridge/Kconfig +13 -0
index 6b4664d91faa..8e915bab1cfd 100644
@@ -306,6 +306,19 @@ config DRM_SIMPLE_BRIDGE
 	  Support for non-programmable DRM bridges, such as ADI ADV7123, TI
 	  THS8134 and THS8135 or passive resistor ladder DACs.
 
+config DRM_SOLOMON_SSD2825
+	tristate "SSD2825 RGB/DSI bridge"
+	depends on SPI_MASTER && OF
+	select DRM_MIPI_DSI
+	select DRM_KMS_HELPER
+	select DRM_PANEL
+	help
+	  Say Y here if you want support for the Solomon SSD2825 RGB/DSI
+	  SPI bridge driver.
+
+	  Say M here if you want to support this hardware as a module.
+	  The module will be named "solomon-ssd2825".
+
 config DRM_THINE_THC63LVD1024
 	tristate "Thine THC63LVD1024 LVDS decoder bridge"
 	depends on OF
drivers/gpu/drm/bridge/Makefile +1 -0
index 97304b429a53..c621ab3fa3a9 100644
@@ -23,6 +23,7 @@ obj-$(CONFIG_DRM_SIL_SII8620) += sil-sii8620.o
 obj-$(CONFIG_DRM_SII902X) += sii902x.o
 obj-$(CONFIG_DRM_SII9234) += sii9234.o
 obj-$(CONFIG_DRM_SIMPLE_BRIDGE) += simple-bridge.o
+obj-$(CONFIG_DRM_SOLOMON_SSD2825) += ssd2825.o
 obj-$(CONFIG_DRM_THINE_THC63LVD1024) += thc63lvd1024.o
 obj-$(CONFIG_DRM_TOSHIBA_TC358762) += tc358762.o
 obj-$(CONFIG_DRM_TOSHIBA_TC358764) += tc358764.o
drivers/gpu/drm/bridge/ssd2825.c new file +821 -0

821 lines not on this page · raw message

Signature · 1 line
2.43.0
#3 lore raw

Re: [PATCH v3 2/2] drm: bridge: Add support for Solomon SSD2825 RGB/DSI bridge

Quoted 26 lines · Svyatoslav Ryhel

SSD2825 is a cost-effective MIPI Bridge Chip solution targeting mainly smartphones. It can convert 24bit RGB interface into 4-lane MIPI-DSI interface to drive display modules of up to 800 x 1366, while supporting AMOLED, a-si LCD or LTPS panel technologies for smartphone applications.

---
 drivers/gpu/drm/bridge/Kconfig   |  13 +
 drivers/gpu/drm/bridge/Makefile  |   1 +
 drivers/gpu/drm/bridge/ssd2825.c | 821 +++++++++++++++++++++++++++++++
 3 files changed, 835 insertions(+)
 create mode 100644 drivers/gpu/drm/bridge/ssd2825.c
drivers/gpu/drm/bridge/ssd2825.c new file +12 -0
+
+	if (buf == MIPI_DCS_SET_DISPLAY_ON) {
+		/*
+		 * NOTE! This is here since it cannot be called in bridge enable because
+		 * bridge pre enable and bridge enable have no gap in between.
+		 *
+		 * Existing framework bridge-panel seq is:
+		 *	panel_prepare > bridge_pre_enable > bridge_enable > panel_enable
+		 *
+		 * Using prepare_prev_first was tested, but it switches seq like this:
+		 *	bridge_pre_enable > panel_prepare > bridge_enable > panel_enable
+		 *

drivers/gpu/drm/bridge/ssd2825.c line 426

Quoted 10 lines
drivers/gpu/drm/bridge/ssd2825.c new file +10 -0
+		 * This will not work since panel hw MUST be prepared before bridge is
+		 * configured. Correct seq should be:
+		 *	panel_prepare > bridge_pre_enable > panel_enable > bridge_enable
+		 *
+		 * Last two functions are swapped related to existing framework. I am not
+		 * aware about method which allows that.
+		 *
+		 * Once there will be such method/flag, code below should be moved into
+		 * bridge_enable since it is basically a bridge configuration completing
+		 * after initial panel DSI sequence is completed.

Will bridge_pre_enable -> panel_prepare (including MIPI_DCS_SET_DISPLAY_ON) -> bridge_enable work?

The rest looks good to me.

Quoted 20 lines
drivers/gpu/drm/bridge/ssd2825.c new file +19 -0
+		 */
+		config = SSD2825_CONF_REG_HS | SSD2825_CONF_REG_DCS |
+			 SSD2825_CONF_REG_ECD | SSD2825_CONF_REG_EOT;
+
+		if (dsi_dev->mode_flags & MIPI_DSI_MODE_VIDEO)
+			config |= SSD2825_CONF_REG_VEN;
+
+		if (dsi_dev->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET)
+			config &= ~SSD2825_CONF_REG_EOT;
+
+		/* Complete configuration after DSI commands were sent */
+		ssd2825_write_reg(priv, SSD2825_CONFIGURATION_REG, config);
+		ssd2825_write_reg(priv, SSD2825_PLL_CTRL_REG, 0x0001);
+		ssd2825_write_reg(priv, SSD2825_VC_CTRL_REG, 0x0000);
+	}
+
+	return 0;
+}
+
Signature · 2 lines
With best wishes
Dmitry
#4 lore raw

Re: [PATCH v3 2/2] drm: bridge: Add support for Solomon SSD2825 RGB/DSI bridge

пн, 24 лют. 2025 р. о 04:10 Dmitry Baryshkov <[email protected]> пише:

Quoted 39 lines · Svyatoslav Ryhel
Quoted 26 lines

SSD2825 is a cost-effective MIPI Bridge Chip solution targeting mainly smartphones. It can convert 24bit RGB interface into 4-lane MIPI-DSI interface to drive display modules of up to 800 x 1366, while supporting AMOLED, a-si LCD or LTPS panel technologies for smartphone applications.

---
 drivers/gpu/drm/bridge/Kconfig   |  13 +
 drivers/gpu/drm/bridge/Makefile  |   1 +
 drivers/gpu/drm/bridge/ssd2825.c | 821 +++++++++++++++++++++++++++++++
 3 files changed, 835 insertions(+)
 create mode 100644 drivers/gpu/drm/bridge/ssd2825.c
drivers/gpu/drm/bridge/ssd2825.c new file +12 -0
+
+     if (buf == MIPI_DCS_SET_DISPLAY_ON) {
+             /*
+              * NOTE! This is here since it cannot be called in bridge enable because
+              * bridge pre enable and bridge enable have no gap in between.
+              *
+              * Existing framework bridge-panel seq is:
+              *      panel_prepare > bridge_pre_enable > bridge_enable > panel_enable
+              *
+              * Using prepare_prev_first was tested, but it switches seq like this:
+              *      bridge_pre_enable > panel_prepare > bridge_enable > panel_enable
+              *

drivers/gpu/drm/bridge/ssd2825.c line 426

Quoted 10 lines
drivers/gpu/drm/bridge/ssd2825.c new file +10 -0
+              * This will not work since panel hw MUST be prepared before bridge is
+              * configured. Correct seq should be:
+              *      panel_prepare > bridge_pre_enable > panel_enable > bridge_enable
+              *
+              * Last two functions are swapped related to existing framework. I am not
+              * aware about method which allows that.
+              *
+              * Once there will be such method/flag, code below should be moved into
+              * bridge_enable since it is basically a bridge configuration completing
+              * after initial panel DSI sequence is completed.
Quoted 5 lines

Will bridge_pre_enable -> panel_prepare (including MIPI_DCS_SET_DISPLAY_ON) -> bridge_enable work?

The rest looks good to me.

I wish. I have tested that configuration already and panel did not work. Problem here is that panel must be enabled before bridge. Correct sequence should be:

Panel is enabled (power seq, reset, etc.) > bridge is enabled (power seq, reset, initial configuration) > panel sends init DSI seq > bridge completes setup with code below.

Basically this part of transfer should be called after last DSI command is sent, but ATM I see no valid solution to this issue apart this quirk (keep in mind that panel must be enabled before bridge so drm_panel.prepare_prev_first will not work).

The most appropriate solution would be addition of atomic_post_enable call just after panel or next bridge enable, this would ensure that cases with bridge like I have could be properly configured. Though, I really do not want to touch framework, since it never ended up well. Or, alternatively, a flag for a bridge which can swap bridge enable and panel enable, like drm_panel.prepare_prev_first does for pre_enable and prepare.

Quoted 24 lines
Quoted 10 lines
drivers/gpu/drm/bridge/ssd2825.c new file +9 -0
+              */
+             config = SSD2825_CONF_REG_HS | SSD2825_CONF_REG_DCS |
+                      SSD2825_CONF_REG_ECD | SSD2825_CONF_REG_EOT;
+
+             if (dsi_dev->mode_flags & MIPI_DSI_MODE_VIDEO)
+                     config |= SSD2825_CONF_REG_VEN;
+
+             if (dsi_dev->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET)
+                     config &= ~SSD2825_CONF_REG_EOT;

drivers/gpu/drm/bridge/ssd2825.c line 445

Quoted 10 lines
drivers/gpu/drm/bridge/ssd2825.c new file +10 -0
+
+             /* Complete configuration after DSI commands were sent */
+             ssd2825_write_reg(priv, SSD2825_CONFIGURATION_REG, config);
+             ssd2825_write_reg(priv, SSD2825_PLL_CTRL_REG, 0x0001);
+             ssd2825_write_reg(priv, SSD2825_VC_CTRL_REG, 0x0000);
+     }
+
+     return 0;
+}
+

--
With best wishes
Dmitry

#5 lore raw

Re: [PATCH v3 2/2] drm: bridge: Add support for Solomon SSD2825 RGB/DSI bridge

In reply to Svyatoslav Ryhel

нд, 23 лют. 2025 р. о 17:33 Svyatoslav Ryhel <[email protected]> пише:

Quoted 6 lines

SSD2825 is a cost-effective MIPI Bridge Chip solution targeting mainly smartphones. It can convert 24bit RGB interface into 4-lane MIPI-DSI interface to drive display modules of up to 800 x 1366, while supporting AMOLED, a-si LCD or LTPS panel technologies for smartphone applications.

Quoted 7 lines
---
 drivers/gpu/drm/bridge/Kconfig   |  13 +
 drivers/gpu/drm/bridge/Makefile  |   1 +
 drivers/gpu/drm/bridge/ssd2825.c | 821 +++++++++++++++++++++++++++++++
 3 files changed, 835 insertions(+)
 create mode 100644 drivers/gpu/drm/bridge/ssd2825.c

These patches had no activity/feedback from maintainers for a while, so, in case they got lost in the depths of email box, this is a friendly reminder that they are still relevant and I would like them to move on.

Best regards,
Svyatoslav R.