linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/11] drm/panel: Add 5 DDIC panel drivers for 14 Sony phones
@ 2025-12-21 23:32 Marijn Suijten
  2025-12-21 23:32 ` [PATCH v2 01/11] drm/panel: Clean up SOFEF00 config dependencies Marijn Suijten
                   ` (10 more replies)
  0 siblings, 11 replies; 43+ messages in thread
From: Marijn Suijten @ 2025-12-21 23:32 UTC (permalink / raw)
  To: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Martin Botka, Jami Kettunen, dri-devel, linux-kernel, devicetree,
	linux-arm-msm, Abhinav Kumar, Kuogee Hsieh, Jessica Zhang,
	AngeloGioacchino Del Regno, Konrad Dybcio, Marijn Suijten,
	Konrad Dybcio, Dmitry Baryshkov, Konrad Dybcio

This is the second version of a largely reshaped series that brings 5
new DDIC panel drivers (4 Samsung, 1 LGD) that are compatible with 14
Sony phones:

- LGD LG699QH3-EDB1 (1440x2880@60Hz, DSC):
  - Sony Xperia XZ3
- Samsung SOFEF01 (1080x2520@60Hz):
  - Sony Xperia 5
  - Sony Xperia 10 II
  - Sony Xperia 10 III
  - Sony Xperia 10 IV (yet untested)
  - Sony Xperia 10 V (yet untested)
  - Sony Xperia 10 VI (yet untested)
- Samsung SOFEF03 (1080x2520@120Hz, DSC):
  - Sony Xperia 5 II
  - Sony Xperia 5 III
- Samsung SOUXP00 (1644x3840@60Hz, DSC):
  - Sony Xperia 1
  - Sony Xperia 1 II
- Samsung ANA6707 (1644x3840@120Hz, DSC, dual-DSI):
  - Sony Xperia 1 III
  - Sony Xperia 1 IV (yet untested)
  - Sony Xperia 1 V (yet untested)

DTS changes will follow shortly to collectively enable the GPU,
touchscreen and configure this panel driver for aforementioned (tested)
devices.  After that we can focus on the untested devices and ultimately
all newer devices that are not even mentioned here.

The ANA6707 driver depends on [1] (revert of quad-DSC over dual-DSI) to
function correctly.

A few limitations/issues with these drivers:

- Panels/drivers featuring multiple modes

  Most of these drivers support multiple modes, for example to save
  bandwidth/energy by running on lower resolutions or framerates.
  These can be picked via mode selection by userspace, but are not yet
  forwarded to the drm_panel abstractions.

  Work is underway to bring those atomic modeset calls to drm_panel
  together with moving where drm_dsc_config lives, since its
  configuration depends on the resolution for example.

  For now the choice between either mode has been hardcoded behind a
  static const bool.

- pclk

  The brunt of some older discussion was around getting these command
  mode panels functioning at their desired 60Hz or 120Hz refresh rate
  without tearing/artifacts, and without hacks.  Part of that discussion
  around DSC-specific timing adjustments is happening in [2], but
  the SOFEF01 (non-DSC) Driver-IC is also struggling on the Xperia 5
  specifically, as outlined in that specific patch.  That is currently
  "addressed" with a "porch hack" but should probably have some sort of
  overhead / transfer time taken into account in the MSM DSI driver.

  Let me know what the best place is to collate all the relevant info
  (links to downstream panel DTS, outcomes with different patches and
  tweaks, etc).  A new fd.o drm/msm issue?

- Flickering on brightness changes

  Likely because of the missing "transfer overhead" calculations and/or
  proper sequencing in the DSI host driver, changing brightness results
  in corruption on all (Samsung) panels excluding the LGD panel for the
  XZ3.  It is yet unknown why this is happening and likely requires more
  debugging outside of these panel drivers.

[1]: https://lore.kernel.org/linux-arm-msm/20251219-drm-msm-dpu-revert-quad-pipe-broken-v1-0-654b46505f84@oss.qualcomm.com/
[2]: https://gitlab.freedesktop.org/drm/msm/-/issues/24#note_1917707

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
Changes in v2:
- Names of all panels are now included;
- All drivers are rewritten against the latest _multi() API with dsi_ctx
  struct;
- DSC structures are no longer optional;
- get_brightness is removed;
- set_brightness no longer takes DSI out of LPM - specifically on the
  SOFEF01 brightness changes are ignored otherwise;
- Regulators converted to regulator_bulk_data;
- Panel driver for ANA6707 following up on my dual-DSI-dual-DSC work
  in MSM DPU is now included;
- Possibly more that I've either forgotten or been too careless to
  diff properly with the *over 2.5 years old!* v1:
- Link to v1: https://lore.kernel.org/r/20230521-drm-panels-sony-v1-0-541c341d6bee@somainline.org

---
Marijn Suijten (11):
      drm/panel: Clean up SOFEF00 config dependencies
      dt-bindings: display: panel: Describe LGD LH599QH3-EDB1 panel
      drm/panel: Add LGD LH599QH3-EDB1 panel driver for Sony Xperia XZ3
      dt-bindings: display: panel: Describe Samsung SOFEF01-M DDIC
      drm/panel: Add panel driver for Samsung SOFEF01 DDIC
      dt-bindings: display: panel: Describe Samsung SOFEF03-M DDIC
      drm/panel: Add panel driver for Samsung SOFEF03-M DDIC
      dt-bindings: display: panel: Describe Samsung SOUXP00-A DDIC
      drm/panel: Add panel driver for Samsung SOUXP00-A DDIC
      dt-bindings: display: panel: Describe Samsung ANA6707 DDIC
      drm/panel: Add panel driver for Samsung ANA6707 DDIC

 .../bindings/display/panel/lgd,lh599qh3-edb1.yaml  |  76 ++++
 .../bindings/display/panel/samsung,ana6707.yaml    |  91 ++++
 .../bindings/display/panel/samsung,sofef01-m.yaml  | 120 ++++++
 .../bindings/display/panel/samsung,sofef03-m.yaml  |  79 ++++
 .../bindings/display/panel/samsung,souxp00-a.yaml  |  79 ++++
 MAINTAINERS                                        |  30 ++
 drivers/gpu/drm/panel/Kconfig                      |  84 +++-
 drivers/gpu/drm/panel/Makefile                     |   5 +
 drivers/gpu/drm/panel/panel-lgd-lh599qh3-edb1.c    | 340 +++++++++++++++
 drivers/gpu/drm/panel/panel-samsung-ana6707.c      | 461 ++++++++++++++++++++
 drivers/gpu/drm/panel/panel-samsung-sofef01.c      | 463 +++++++++++++++++++++
 drivers/gpu/drm/panel/panel-samsung-sofef03.c      | 373 +++++++++++++++++
 drivers/gpu/drm/panel/panel-samsung-souxp00.c      | 399 ++++++++++++++++++
 13 files changed, 2599 insertions(+), 1 deletion(-)
---
base-commit: cc3aa43b44bdb43dfbac0fcb51c56594a11338a8
change-id: 20230521-drm-panels-sony-3c5ac3218427

Best regards,
-- 
Marijn Suijten <marijn.suijten@somainline.org>


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH v2 01/11] drm/panel: Clean up SOFEF00 config dependencies
  2025-12-21 23:32 [PATCH v2 00/11] drm/panel: Add 5 DDIC panel drivers for 14 Sony phones Marijn Suijten
@ 2025-12-21 23:32 ` Marijn Suijten
  2025-12-21 23:32 ` [PATCH v2 02/11] dt-bindings: display: panel: Describe LGD LH599QH3-EDB1 panel Marijn Suijten
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 43+ messages in thread
From: Marijn Suijten @ 2025-12-21 23:32 UTC (permalink / raw)
  To: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Martin Botka, Jami Kettunen, dri-devel, linux-kernel, devicetree,
	linux-arm-msm, Abhinav Kumar, Kuogee Hsieh, Jessica Zhang,
	AngeloGioacchino Del Regno, Konrad Dybcio, Marijn Suijten,
	Konrad Dybcio, Dmitry Baryshkov

As per the config name this Display IC features a DSI command-mode
interface (or the command to switch to video mode is not
known/documented) and does not use any of the video-mode helper
utilities, hence should not select VIDEOMODE_HELPERS.  In addition it
uses devm_gpiod_get() and related functions from GPIOLIB.

Fixes: 5933baa36e26 ("drm/panel/samsung-sofef00: Add panel for OnePlus 6/T devices")
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 drivers/gpu/drm/panel/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 307152ad7759..9242fb894511 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -908,10 +908,10 @@ config DRM_PANEL_SAMSUNG_S6E8AA5X01_AMS561RA01
 
 config DRM_PANEL_SAMSUNG_SOFEF00
 	tristate "Samsung SOFEF00 DSI panel controller"
+	depends on GPIOLIB
 	depends on OF
 	depends on DRM_MIPI_DSI
 	depends on BACKLIGHT_CLASS_DEVICE
-	select VIDEOMODE_HELPERS
 	help
 	  Say Y or M here if you want to enable support for the Samsung AMOLED
 	  panel SOFEF00 DDIC and connected panel.

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH v2 02/11] dt-bindings: display: panel: Describe LGD LH599QH3-EDB1 panel
  2025-12-21 23:32 [PATCH v2 00/11] drm/panel: Add 5 DDIC panel drivers for 14 Sony phones Marijn Suijten
  2025-12-21 23:32 ` [PATCH v2 01/11] drm/panel: Clean up SOFEF00 config dependencies Marijn Suijten
@ 2025-12-21 23:32 ` Marijn Suijten
  2025-12-21 23:32 ` [PATCH v2 03/11] drm/panel: Add LGD LH599QH3-EDB1 panel driver for Sony Xperia XZ3 Marijn Suijten
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 43+ messages in thread
From: Marijn Suijten @ 2025-12-21 23:32 UTC (permalink / raw)
  To: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Martin Botka, Jami Kettunen, dri-devel, linux-kernel, devicetree,
	linux-arm-msm, Abhinav Kumar, Kuogee Hsieh, Jessica Zhang,
	AngeloGioacchino Del Regno, Konrad Dybcio, Marijn Suijten,
	Konrad Dybcio, Dmitry Baryshkov

Document the LG-Display LH599QH3-EDB1 OLED DSI panel found on the Sony
Xperia XZ3.

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 .../bindings/display/panel/lgd,lh599qh3-edb1.yaml  | 76 ++++++++++++++++++++++
 MAINTAINERS                                        |  5 ++
 2 files changed, 81 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/panel/lgd,lh599qh3-edb1.yaml b/Documentation/devicetree/bindings/display/panel/lgd,lh599qh3-edb1.yaml
new file mode 100644
index 000000000000..245d14c0a1a2
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/lgd,lh599qh3-edb1.yaml
@@ -0,0 +1,76 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/lgd,lh599qh3-edb1.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: LG Display LH599QH3-EDB1 1440x2880 6.0" OLED DSI command-mode panel
+
+maintainers:
+  - Marijn Suijten <marijn.suijten@somainline.org>
+
+description: |
+  LG Display LH599QH3-EDB1 6.0" 1440x2880 (9:18 aspect ratio) 60Hz panel, found
+  in the Sony Xperia XZ3 smartphone.  It is always programmed with Display
+  Stream Compression 1.1 enabled.
+
+  The assembly features an Atmel maXTouch digitizer, described separately as
+  atmel,maxtouch.
+
+allOf:
+  - $ref: panel-common.yaml#
+
+properties:
+  compatible:
+    const: lgd,lh599qh3-edb1-um1
+
+  port: true
+
+  reg:
+    maxItems: 1
+    description: DSI virtual channel
+
+  reset-gpios: true
+
+  avdd-supply:
+    description: Analog voltage supply (3.0V)
+
+  vddio-supply:
+    description: I/O voltage supply (1.8V)
+
+required:
+  - compatible
+  - port
+  - reg
+  - reset-gpios
+  - avdd-supply
+  - vddio-supply
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    dsi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        panel@0 {
+            compatible = "lgd,lh599qh3-edb1-um1";
+            reg = <0>;
+
+            avdd-supply = <&vreg_l28a_2p8>;
+            vddio-supply = <&vreg_l14a_1p8>;
+
+            reset-gpios = <&tlmm 6 GPIO_ACTIVE_HIGH>;
+
+            port {
+                panel_in: endpoint {
+                    remote-endpoint = <&dsi0_out>;
+                };
+            };
+        };
+    };
+
+...
+
diff --git a/MAINTAINERS b/MAINTAINERS
index 0dbf349fc1ed..6a358fee4cae 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7931,6 +7931,11 @@ T:	git https://gitlab.freedesktop.org/drm/misc/kernel.git
 F:	Documentation/devicetree/bindings/display/panel/lg,sw43408.yaml
 F:	drivers/gpu/drm/panel/panel-lg-sw43408.c
 
+DRM DRIVER FOR LGD LH599QH3-EDB1 PANELS
+M:	Marijn Suijten <marijn.suijten@somainline.org>
+S:	Maintained
+F:	Documentation/devicetree/bindings/display/panel/lgd,lh599qh3-edb1.yaml
+
 DRM DRIVER FOR LOGICVC DISPLAY CONTROLLER
 M:	Paul Kocialkowski <paulk@sys-base.io>
 S:	Supported

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH v2 03/11] drm/panel: Add LGD LH599QH3-EDB1 panel driver for Sony Xperia XZ3
  2025-12-21 23:32 [PATCH v2 00/11] drm/panel: Add 5 DDIC panel drivers for 14 Sony phones Marijn Suijten
  2025-12-21 23:32 ` [PATCH v2 01/11] drm/panel: Clean up SOFEF00 config dependencies Marijn Suijten
  2025-12-21 23:32 ` [PATCH v2 02/11] dt-bindings: display: panel: Describe LGD LH599QH3-EDB1 panel Marijn Suijten
@ 2025-12-21 23:32 ` Marijn Suijten
  2025-12-24  1:12   ` Dmitry Baryshkov
  2025-12-26 13:12   ` Linus Walleij
  2025-12-21 23:32 ` [PATCH v2 04/11] dt-bindings: display: panel: Describe Samsung SOFEF01-M DDIC Marijn Suijten
                   ` (7 subsequent siblings)
  10 siblings, 2 replies; 43+ messages in thread
From: Marijn Suijten @ 2025-12-21 23:32 UTC (permalink / raw)
  To: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Martin Botka, Jami Kettunen, dri-devel, linux-kernel, devicetree,
	linux-arm-msm, Abhinav Kumar, Kuogee Hsieh, Jessica Zhang,
	AngeloGioacchino Del Regno, Konrad Dybcio, Marijn Suijten,
	Konrad Dybcio, Dmitry Baryshkov

Sony provides an LGD LH599QH3-EDB1 panel + Atmel maXTouch assembly in
its Xperia XZ3 (tama akatsuki) phone, with custom DCS commands to match.

The panel is 1440x2880 pixels and runs at 60Hz.  It requires Display
Stream Compression 1.1 to be driven at that mode.

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 MAINTAINERS                                     |   1 +
 drivers/gpu/drm/panel/Kconfig                   |  16 ++
 drivers/gpu/drm/panel/Makefile                  |   1 +
 drivers/gpu/drm/panel/panel-lgd-lh599qh3-edb1.c | 340 ++++++++++++++++++++++++
 4 files changed, 358 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 6a358fee4cae..fcd99a8f9c71 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7935,6 +7935,7 @@ DRM DRIVER FOR LGD LH599QH3-EDB1 PANELS
 M:	Marijn Suijten <marijn.suijten@somainline.org>
 S:	Maintained
 F:	Documentation/devicetree/bindings/display/panel/lgd,lh599qh3-edb1.yaml
+F:	drivers/gpu/drm/panel/panel-lgd-lh599qh3-edb1.c
 
 DRM DRIVER FOR LOGICVC DISPLAY CONTROLLER
 M:	Paul Kocialkowski <paulk@sys-base.io>
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 9242fb894511..10381291707e 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -442,6 +442,22 @@ config DRM_PANEL_LG_SW43408
 	  pixel. It provides a MIPI DSI interface to the host and has a
 	  built-in LED backlight.
 
+config DRM_PANEL_LGD_LH599QH3_EDB1
+	tristate "LGD LH599QH3-EDB1 DSI cmd mode panel"
+	depends on GPIOLIB
+	depends on OF
+	depends on DRM_MIPI_DSI
+	depends on BACKLIGHT_CLASS_DEVICE
+	select DRM_DISPLAY_DSC_HELPER
+	select DRM_DISPLAY_HELPER
+	help
+	  Say Y or M here if you want to enable support for the LGD LH599QH3-EDB1
+	  6.0" OLED DSI command-mode panel found in the Sony
+	  Xperia XZ3.
+
+	  This Display-IC uses Display Stream Compression 1.1 and features a
+	  fixed 1440x2880@60 mode.
+
 config DRM_PANEL_MAGNACHIP_D53E6EA8966
 	tristate "Magnachip D53E6EA8966 DSI panel"
 	depends on OF && SPI
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index aeffaa95666d..186eb895af21 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -44,6 +44,7 @@ obj-$(CONFIG_DRM_PANEL_LG_LB035Q02) += panel-lg-lb035q02.o
 obj-$(CONFIG_DRM_PANEL_LG_LD070WX3) += panel-lg-ld070wx3.o
 obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o
 obj-$(CONFIG_DRM_PANEL_LG_SW43408) += panel-lg-sw43408.o
+obj-$(CONFIG_DRM_PANEL_LGD_LH599QH3_EDB1) += panel-lgd-lh599qh3-edb1.o
 obj-$(CONFIG_DRM_PANEL_MAGNACHIP_D53E6EA8966) += panel-magnachip-d53e6ea8966.o
 obj-$(CONFIG_DRM_PANEL_NEC_NL8048HL11) += panel-nec-nl8048hl11.o
 obj-$(CONFIG_DRM_PANEL_NEWVISION_NV3051D) += panel-newvision-nv3051d.o
diff --git a/drivers/gpu/drm/panel/panel-lgd-lh599qh3-edb1.c b/drivers/gpu/drm/panel/panel-lgd-lh599qh3-edb1.c
new file mode 100644
index 000000000000..02049b37729e
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-lgd-lh599qh3-edb1.c
@@ -0,0 +1,340 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2023 Marijn Suijten <marijn.suijten@somainline.org>
+ *
+ * Based on the following Sony downstream DTS command sequence:
+ * https://github.com/sonyxperiadev/kernel-copyleft/blob/52.0.A.3.xxx/arch/arm64/boot/dts/somc/dsi-panel-akatsuki_vendor.dtsi
+ */
+
+#include <linux/backlight.h>
+#include <linux/delay.h>
+#include <linux/gpio/consumer.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
+#include <linux/regulator/consumer.h>
+
+#include <video/mipi_display.h>
+
+#include <drm/drm_mipi_dsi.h>
+#include <drm/drm_modes.h>
+#include <drm/drm_panel.h>
+#include <drm/drm_probe_helper.h>
+#include <drm/display/drm_dsc.h>
+#include <drm/display/drm_dsc_helper.h>
+
+#define WRITE_CONTROL_DISPLAY_BACKLIGHT BIT(5)
+
+const struct regulator_bulk_data lgd_lh599qh3_edb1_supplies[] = {
+	{ .supply = "vddio", /* 1.8 V */ },
+	{ .supply = "avdd", /* 3.0 V */ },
+};
+
+struct lgd_lh599qh3_edb1 {
+	struct drm_panel panel;
+	struct mipi_dsi_device *dsi;
+	struct drm_dsc_config dsc;
+	struct regulator_bulk_data *supplies;
+	struct gpio_desc *reset_gpio;
+};
+
+static inline struct lgd_lh599qh3_edb1 *
+to_lgd_lh599qh3_edb1(struct drm_panel *panel)
+{
+	return container_of(panel, struct lgd_lh599qh3_edb1, panel);
+}
+
+static int lgd_lh599qh3_edb1_program(struct lgd_lh599qh3_edb1 *ctx)
+{
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
+
+	dsi_ctx.dsi->mode_flags |= MIPI_DSI_MODE_LPM;
+
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x7f, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf1, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf2, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x02, 0x01);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x59, 0x01);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_CONTROL_DISPLAY,
+				     WRITE_CONTROL_DISPLAY_BACKLIGHT);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x57, 0x20, 0x80, 0xde, 0x60, 0x00);
+
+	mipi_dsi_dcs_set_column_address_multi(&dsi_ctx, 0, 1440 - 1);
+	mipi_dsi_dcs_set_page_address_multi(&dsi_ctx, 0, 2880 - 1);
+
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_POWER_SAVE, 0x00);
+
+	mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
+
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x7f, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf1, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf2, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x03);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf6, 0x04);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x05);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf6, 0x01, 0x7f, 0x00);
+
+	mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
+	mipi_dsi_msleep(&dsi_ctx, 120);
+
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xe3, 0xac, 0x19, 0x34, 0x14, 0x7d);
+
+	return 0;
+}
+
+static int lgd_lh599qh3_edb1_prepare(struct drm_panel *panel)
+{
+	struct lgd_lh599qh3_edb1 *ctx = to_lgd_lh599qh3_edb1(panel);
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
+	struct drm_dsc_picture_parameter_set pps;
+	struct device *dev = &ctx->dsi->dev;
+	int ret;
+
+	ret = regulator_bulk_enable(ARRAY_SIZE(lgd_lh599qh3_edb1_supplies), ctx->supplies);
+	if (ret < 0) {
+		dev_err(dev, "Failed to enable regulators: %d\n", ret);
+		return ret;
+	}
+
+	msleep(100);
+
+	gpiod_set_value_cansleep(ctx->reset_gpio, 0);
+	usleep_range(5000, 5100);
+
+	ret = lgd_lh599qh3_edb1_program(ctx);
+	if (ret < 0) {
+		dev_err(dev, "Failed to program panel: %d\n", ret);
+		goto fail;
+	}
+
+	drm_dsc_pps_payload_pack(&pps, &ctx->dsc);
+
+	mipi_dsi_picture_parameter_set_multi(&dsi_ctx, &pps);
+	mipi_dsi_compression_mode_multi(&dsi_ctx, true);
+	mipi_dsi_msleep(&dsi_ctx, 28);
+
+	ret = dsi_ctx.accum_err;
+
+	if (ret < 0)
+		goto fail;
+
+	return 0;
+
+fail:
+	gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+	regulator_bulk_disable(ARRAY_SIZE(lgd_lh599qh3_edb1_supplies), ctx->supplies);
+	return ret;
+}
+
+static int lgd_lh599qh3_edb1_enable(struct drm_panel *panel)
+{
+	struct lgd_lh599qh3_edb1 *ctx = to_lgd_lh599qh3_edb1(panel);
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
+
+	mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
+
+	return dsi_ctx.accum_err;
+}
+
+static int lgd_lh599qh3_edb1_disable(struct drm_panel *panel)
+{
+	struct lgd_lh599qh3_edb1 *ctx = to_lgd_lh599qh3_edb1(panel);
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
+
+	mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
+	mipi_dsi_msleep(&dsi_ctx, 20);
+
+	return dsi_ctx.accum_err;
+}
+
+static int lgd_lh599qh3_edb1_unprepare(struct drm_panel *panel)
+{
+	struct lgd_lh599qh3_edb1 *ctx = to_lgd_lh599qh3_edb1(panel);
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
+
+	mipi_dsi_dcs_set_tear_off_multi(&dsi_ctx);
+	mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
+	mipi_dsi_msleep(&dsi_ctx, 100);
+
+	dsi_ctx.dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
+
+	gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+	regulator_bulk_disable(ARRAY_SIZE(lgd_lh599qh3_edb1_supplies), ctx->supplies);
+
+	usleep_range(5000, 5100);
+
+	return dsi_ctx.accum_err;
+}
+
+/*
+ * Small fake porch to force the DSI pclk/byteclk
+ * high enough to have a smooth panel at 60Hz.
+ */
+static const int fake_porch = 60;
+
+static const struct drm_display_mode lgd_lh599qh3_edb1_mode = {
+	.clock = (1440 + fake_porch) * 2880 * 60 / 1000,
+	.hdisplay = 1440,
+	.hsync_start = 1440 + fake_porch,
+	.hsync_end = 1440 + fake_porch,
+	.htotal = 1440 + fake_porch,
+	.vdisplay = 2880,
+	.vsync_start = 2880,
+	.vsync_end = 2880,
+	.vtotal = 2880,
+	.width_mm = 68,
+	.height_mm = 136,
+	.type = DRM_MODE_TYPE_DRIVER,
+};
+
+static int lgd_lh599qh3_edb1_get_modes(struct drm_panel *panel,
+				       struct drm_connector *connector)
+{
+	return drm_connector_helper_get_modes_fixed(connector,
+						    &lgd_lh599qh3_edb1_mode);
+}
+
+static const struct drm_panel_funcs lgd_lh599qh3_edb1_panel_funcs = {
+	.prepare = lgd_lh599qh3_edb1_prepare,
+	.enable = lgd_lh599qh3_edb1_enable,
+	.disable = lgd_lh599qh3_edb1_disable,
+	.unprepare = lgd_lh599qh3_edb1_unprepare,
+	.get_modes = lgd_lh599qh3_edb1_get_modes,
+};
+
+static int lgd_lh599qh3_edb1_bl_update_status(struct backlight_device *bl)
+{
+	struct mipi_dsi_device *dsi = bl_get_data(bl);
+	u16 brightness = backlight_get_brightness(bl);
+
+	return mipi_dsi_dcs_set_display_brightness_large(dsi, brightness);
+}
+
+static int lgd_lh599qh3_edb1_bl_get_brightness(struct backlight_device *bl)
+{
+	struct mipi_dsi_device *dsi = bl_get_data(bl);
+	u16 brightness;
+	int ret;
+
+	ret = mipi_dsi_dcs_get_display_brightness_large(dsi, &brightness);
+	if (ret < 0)
+		return ret;
+
+	return brightness & 0x3ff;
+}
+
+static const struct backlight_ops lgd_lh599qh3_edb1_bl_ops = {
+	.update_status = lgd_lh599qh3_edb1_bl_update_status,
+	.get_brightness = lgd_lh599qh3_edb1_bl_get_brightness,
+};
+
+static int lgd_lh599qh3_edb1_probe(struct mipi_dsi_device *dsi)
+{
+	const struct backlight_properties props = {
+		.type = BACKLIGHT_RAW,
+		.brightness = 100,
+		.max_brightness = 1023,
+	};
+	struct device *dev = &dsi->dev;
+	struct lgd_lh599qh3_edb1 *ctx;
+	int ret;
+
+	ctx = devm_drm_panel_alloc(dev, struct lgd_lh599qh3_edb1, panel,
+				   &lgd_lh599qh3_edb1_panel_funcs,
+				   DRM_MODE_CONNECTOR_DSI);
+	if (IS_ERR(ctx))
+		return PTR_ERR(ctx);
+
+	ret = devm_regulator_bulk_get_const(
+		dev,
+		ARRAY_SIZE(lgd_lh599qh3_edb1_supplies),
+		lgd_lh599qh3_edb1_supplies,
+		&ctx->supplies);
+	if (ret < 0)
+		return dev_err_probe(dev, ret, "Failed to get regulators\n");
+
+	ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
+	if (IS_ERR(ctx->reset_gpio))
+		return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
+				     "Failed to get reset-gpios\n");
+
+	ctx->dsi = dsi;
+	mipi_dsi_set_drvdata(dsi, ctx);
+
+	dsi->lanes = 4;
+	dsi->format = MIPI_DSI_FMT_RGB888;
+	dsi->mode_flags = MIPI_DSI_CLOCK_NON_CONTINUOUS;
+
+	ctx->panel.prepare_prev_first = true;
+
+	ctx->panel.backlight = devm_backlight_device_register(
+		dev, dev_name(dev), dev, dsi,
+		&lgd_lh599qh3_edb1_bl_ops,
+		&props);
+	if (IS_ERR(ctx->panel.backlight))
+		return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight),
+				     "Failed to create backlight\n");
+
+	drm_panel_add(&ctx->panel);
+
+	/* This panel only supports DSC; unconditionally enable it */
+	dsi->dsc = &ctx->dsc;
+
+	ctx->dsc.dsc_version_major = 1;
+	ctx->dsc.dsc_version_minor = 1;
+
+	ctx->dsc.slice_height = 32;
+	ctx->dsc.slice_count = 2;
+	/*
+	 * hdisplay should be read from the selected mode once
+	 * it is passed back to drm_panel (in prepare?)
+	 */
+	WARN_ON(1440 % ctx->dsc.slice_count);
+	ctx->dsc.slice_width = 1440 / ctx->dsc.slice_count;
+	ctx->dsc.bits_per_component = 8;
+	ctx->dsc.bits_per_pixel = 8 << 4; /* 4 fractional bits */
+	ctx->dsc.block_pred_enable = true;
+
+	ret = mipi_dsi_attach(dsi);
+	if (ret < 0) {
+		dev_err(dev, "Failed to attach to DSI host: %d\n", ret);
+		drm_panel_remove(&ctx->panel);
+		return ret;
+	}
+
+	return 0;
+}
+
+static void lgd_lh599qh3_edb1_remove(struct mipi_dsi_device *dsi)
+{
+	struct lgd_lh599qh3_edb1 *ctx = mipi_dsi_get_drvdata(dsi);
+	int ret;
+
+	ret = mipi_dsi_detach(dsi);
+	if (ret < 0)
+		dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret);
+
+	drm_panel_remove(&ctx->panel);
+}
+
+static const struct of_device_id lgd_lh599qh3_edb1_of_match[] = {
+	{ .compatible = "lgd,lh599qh3-edb1-um1" },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, lgd_lh599qh3_edb1_of_match);
+
+static struct mipi_dsi_driver lgd_lh599qh3_edb1_driver = {
+	.probe = lgd_lh599qh3_edb1_probe,
+	.remove = lgd_lh599qh3_edb1_remove,
+	.driver = {
+		.name = "panel-lgd-lh599qh3-edb1",
+		.of_match_table = lgd_lh599qh3_edb1_of_match,
+	},
+};
+module_mipi_dsi_driver(lgd_lh599qh3_edb1_driver);
+
+MODULE_AUTHOR("Marijn Suijten <marijn.suijten@somainline.org>");
+MODULE_DESCRIPTION("DRM panel driver for an LGD LH599QH3-EDB1 OLED assembly found in the Sony Xperia XZ3");
+MODULE_LICENSE("GPL");

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH v2 04/11] dt-bindings: display: panel: Describe Samsung SOFEF01-M DDIC
  2025-12-21 23:32 [PATCH v2 00/11] drm/panel: Add 5 DDIC panel drivers for 14 Sony phones Marijn Suijten
                   ` (2 preceding siblings ...)
  2025-12-21 23:32 ` [PATCH v2 03/11] drm/panel: Add LGD LH599QH3-EDB1 panel driver for Sony Xperia XZ3 Marijn Suijten
@ 2025-12-21 23:32 ` Marijn Suijten
  2025-12-26 13:25   ` Linus Walleij
  2025-12-30  1:51   ` Rob Herring
  2025-12-21 23:32 ` [PATCH v2 05/11] drm/panel: Add panel driver for Samsung SOFEF01 DDIC Marijn Suijten
                   ` (6 subsequent siblings)
  10 siblings, 2 replies; 43+ messages in thread
From: Marijn Suijten @ 2025-12-21 23:32 UTC (permalink / raw)
  To: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Martin Botka, Jami Kettunen, dri-devel, linux-kernel, devicetree,
	linux-arm-msm, Abhinav Kumar, Kuogee Hsieh, Jessica Zhang,
	AngeloGioacchino Del Regno, Konrad Dybcio, Marijn Suijten,
	Konrad Dybcio, Dmitry Baryshkov

Document the Samsung SOFEF01-M Display-Driver-IC and 1080x2520@60Hz
command-mode DSI panels found in many Sony phones:
- Sony Xperia 5 (kumano bahamut): amb609tc01
- Sony Xperia 10 II (seine pdx201): ams597ut01
- Sony Xperia 10 III (lena pdx213): ams597ut04
- Sony Xperia 10 IV (murray pdx225): ams597ut05
- Sony Xperia 10 V (zambezi pdx235): ams605dk01
- Sony Xperia 10 VI (columbia pdx246): ams605dk01

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 .../bindings/display/panel/samsung,sofef01-m.yaml  | 120 +++++++++++++++++++++
 MAINTAINERS                                        |   5 +
 2 files changed, 125 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/panel/samsung,sofef01-m.yaml b/Documentation/devicetree/bindings/display/panel/samsung,sofef01-m.yaml
new file mode 100644
index 000000000000..a8ff5223677c
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/samsung,sofef01-m.yaml
@@ -0,0 +1,120 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/samsung,sofef01-m.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Samsung SOFEF01-M DDI for 1080x2520@60Hz 6.0"/6.1" OLED DSI panels
+
+maintainers:
+  - Marijn Suijten <marijn.suijten@somainline.org>
+
+description: |
+  Samsung SOFEF01-M Display-Driver-IC found in multiple Sony smartphones, paired with
+  the following panel:
+   - Sony Xperia 5 (kumano bahamut): amb609tc01
+   - Sony Xperia 10 II (seine pdx201): ams597ut01
+   - Sony Xperia 10 III (lena pdx213): ams597ut04
+   - Sony Xperia 10 IV (murray pdx225): ams597ut05
+   - Sony Xperia 10 V (zambezi pdx235): ams605dk01
+   - Sony Xperia 10 VI (columbia pdx246): ams605dk01
+
+  The assembly features a Samsung touchscreen compatible with
+  samsung,s6sy761.
+
+allOf:
+  - $ref: panel-common.yaml#
+
+  - if:
+      properties:
+        compatible:
+          const: samsung,sofef01-m-amb609tc01
+    then:
+      properties:
+        vci-supply:
+          description: DisplayIC Operation supply (3.0V)
+
+      required:
+        - vci-supply
+
+    else:
+      properties:
+        vci-supply: false
+
+properties:
+  compatible:
+    enum:
+      - samsung,sofef01-m-amb609tc01 # 6.1"
+      - samsung,sofef01-m-ams597ut01 # 6.0"
+      - samsung,sofef01-m-ams597ut04 # 6.0"
+      - samsung,sofef01-m-ams597ut05 # 6.0"
+      - samsung,sofef01-m-ams605dk01 # 6.1"
+
+  port: true
+
+  reg:
+    maxItems: 1
+    description: DSI virtual channel
+
+  reset-gpios: true
+
+  vddio-supply:
+    description: I/O voltage supply (1.8V)
+
+required:
+  - compatible
+  - port
+  - reg
+  - reset-gpios
+  - vddio-supply
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    dsi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        panel@0 {
+            compatible = "samsung,sofef01-m-amb609tc01";
+            reg = <0>;
+
+            reset-gpios = <&tlmm 6 GPIO_ACTIVE_LOW>;
+
+            vci-supply = <&vreg_l17a_3p0>;
+            vddio-supply = <&vreg_l14a_1p8>;
+
+            port {
+                endpoint {
+                    remote-endpoint = <&dsi0_out>;
+                };
+            };
+        };
+    };
+
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    dsi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        panel@0 {
+            compatible = "samsung,sofef01-m-ams597ut01";
+            reg = <0>;
+
+            reset-gpios = <&tlmm 90 GPIO_ACTIVE_LOW>;
+
+            vddio-supply = <&pm6125_l12>;
+
+            port {
+                endpoint {
+                    remote-endpoint = <&dsi0_out>;
+                };
+            };
+        };
+    };
+
+...
+
diff --git a/MAINTAINERS b/MAINTAINERS
index fcd99a8f9c71..93468dde9df2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8194,6 +8194,11 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/display/panel/samsung,sofef00.yaml
 F:	drivers/gpu/drm/panel/panel-samsung-sofef00.c
 
+DRM DRIVER FOR SAMSUNG SOFEF01 DDIC
+M:	Marijn Suijten <marijn.suijten@somainline.org>
+S:	Maintained
+F:	Documentation/devicetree/bindings/display/panel/samsung,sofef01-m.yaml
+
 DRM DRIVER FOR SHARP MEMORY LCD
 M:	Alex Lanzano <lanzano.alex@gmail.com>
 S:	Maintained

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH v2 05/11] drm/panel: Add panel driver for Samsung SOFEF01 DDIC
  2025-12-21 23:32 [PATCH v2 00/11] drm/panel: Add 5 DDIC panel drivers for 14 Sony phones Marijn Suijten
                   ` (3 preceding siblings ...)
  2025-12-21 23:32 ` [PATCH v2 04/11] dt-bindings: display: panel: Describe Samsung SOFEF01-M DDIC Marijn Suijten
@ 2025-12-21 23:32 ` Marijn Suijten
  2025-12-24  1:12   ` Dmitry Baryshkov
                     ` (2 more replies)
  2025-12-21 23:32 ` [PATCH v2 06/11] dt-bindings: display: panel: Describe Samsung SOFEF03-M DDIC Marijn Suijten
                   ` (5 subsequent siblings)
  10 siblings, 3 replies; 43+ messages in thread
From: Marijn Suijten @ 2025-12-21 23:32 UTC (permalink / raw)
  To: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Martin Botka, Jami Kettunen, dri-devel, linux-kernel, devicetree,
	linux-arm-msm, Abhinav Kumar, Kuogee Hsieh, Jessica Zhang,
	AngeloGioacchino Del Regno, Konrad Dybcio, Marijn Suijten,
	Konrad Dybcio, Dmitry Baryshkov

This Samsung SOFEF01-M Display-Driver-IC is used to drive 1080x2520@60Hz
command-mode DSI panels found in many Sony phones:
- Sony Xperia 5 (kumano bahamut): amb609tc01
- Sony Xperia 10 II (seine pdx201): ams597ut01
- Sony Xperia 10 III (lena pdx213): ams597ut04
- Sony Xperia 10 IV (murray pdx225): ams597ut05
- Sony Xperia 10 V (zambezi pdx235): ams605dk01
- Sony Xperia 10 VI (columbia pdx246): ams605dk01

The amb609tc01 and ams605dk01 come in slightly larger at 6.1" while the
others are 6.0".

A "fake" porch calculation is included to artificially bump the clock
rate necessary to account for "transfer overhead" (DSI packet headers)
since this is missing from the MSM DSI host driver; porches aren't
otherwise used on command-mode panels.

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 MAINTAINERS                                   |   1 +
 drivers/gpu/drm/panel/Kconfig                 |  18 +
 drivers/gpu/drm/panel/Makefile                |   1 +
 drivers/gpu/drm/panel/panel-samsung-sofef01.c | 463 ++++++++++++++++++++++++++
 4 files changed, 483 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 93468dde9df2..cd2c924749d3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8198,6 +8198,7 @@ DRM DRIVER FOR SAMSUNG SOFEF01 DDIC
 M:	Marijn Suijten <marijn.suijten@somainline.org>
 S:	Maintained
 F:	Documentation/devicetree/bindings/display/panel/samsung,sofef01-m.yaml
+F:	drivers/gpu/drm/panel/panel-samsung-sofef01.c
 
 DRM DRIVER FOR SHARP MEMORY LCD
 M:	Alex Lanzano <lanzano.alex@gmail.com>
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 10381291707e..2f06b48dfb89 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -935,6 +935,24 @@ config DRM_PANEL_SAMSUNG_SOFEF00
 
 	    Samsung AMS628NW01 (found in OnePlus 6, 1080x2280@60Hz)
 
+config DRM_PANEL_SAMSUNG_SOFEF01
+	tristate "Samsung SOFEF01-M DSI cmd mode panels"
+	depends on GPIOLIB
+	depends on OF
+	depends on DRM_MIPI_DSI
+	depends on BACKLIGHT_CLASS_DEVICE
+	help
+	  Say Y or M here if you want to enable support for the Samsung 6.0"/6.1"
+	  AMOLED DSI command mode panels found in multiple Sony smartphones:
+	  - Sony Xperia 5 (kumano bahamut): amb609tc01
+	  - Sony Xperia 10 II (seine pdx201): ams597ut01
+	  - Sony Xperia 10 III (lena pdx213): ams597ut04
+	  - Sony Xperia 10 IV (murray pdx225): ams597ut05
+	  - Sony Xperia 10 V (zambezi pdx235): ams605dk01
+	  - Sony Xperia 10 VI (columbia pdx246): ams605dk01
+
+	  This Display-IC features a fixed 1080x2520@60 mode.
+
 config DRM_PANEL_SEIKO_43WVF1G
 	tristate "Seiko 43WVF1G panel"
 	depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 186eb895af21..cbd9ef23b8d8 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -94,6 +94,7 @@ obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E88A0_AMS452EF01) += panel-samsung-s6e88a0-ams4
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0) += panel-samsung-s6e8aa0.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA5X01_AMS561RA01) += panel-samsung-s6e8aa5x01-ams561ra01.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_SOFEF00) += panel-samsung-sofef00.o
+obj-$(CONFIG_DRM_PANEL_SAMSUNG_SOFEF01) += panel-samsung-sofef01.o
 obj-$(CONFIG_DRM_PANEL_SEIKO_43WVF1G) += panel-seiko-43wvf1g.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LQ079L1SX01) += panel-sharp-lq079l1sx01.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o
diff --git a/drivers/gpu/drm/panel/panel-samsung-sofef01.c b/drivers/gpu/drm/panel/panel-samsung-sofef01.c
new file mode 100644
index 000000000000..bb1cefd16fe9
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-samsung-sofef01.c
@@ -0,0 +1,463 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2023 Marijn Suijten <marijn.suijten@somainline.org>
+ *
+ * Based on the following Sony downstream DTS command sequences:
+ * - Xperia 5 (kumano bahamut): https://github.com/sonyxperiadev/kernel-copyleft/blob/55.2.A.4.xxx/arch/arm64/boot/dts/somc/dsi-panel-sofef01_m-fhd_plus.dtsi
+ * - Xperia 10 II (seine pdx201): https://github.com/sonyxperiadev/kernel-copyleft/blob/59.1.A.2.xxx/arch/arm64/boot/dts/somc/dsi-panel-sofef01_m-fhd_plus.dtsi
+ * - Xperia 10 III (lena pdx213): https://github.com/sonyxperiadev/kernel-copyleft-dts/blob/62.1.A.0.xxx/qcom/dsi-panel-pdx213-amoled-fhd-cmd.dtsi
+ * - Xperia 10 IV (murray pdx225): https://github.com/sonyxperiadev/kernel-copyleft-dts/blob/65.1.A.4.xxx/qcom/dsi-panel-samsung-amoled-fhd-cmd.dtsi
+ * - Xperia 10 V (zambezi pdx235): https://github.com/sonyxperiadev/kernel-copyleft-dts/blob/68.2.A.2.xxx/qcom/dsi-panel-samsung-amoled-fhd-cmd.dtsi
+ * - Xperia 10 VI (columbia pdx246): https://github.com/sonyxperiadev/kernel-copyleft-dts/blob/70.0.A.2.xxx/qcom/dsi-panel-samsung-amoled-fhd-cmd.dtsi
+ */
+
+#include <linux/backlight.h>
+#include <linux/delay.h>
+#include <linux/gpio/consumer.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/regulator/consumer.h>
+
+#include <video/mipi_display.h>
+
+#include <drm/drm_mipi_dsi.h>
+#include <drm/drm_modes.h>
+#include <drm/drm_panel.h>
+#include <drm/drm_probe_helper.h>
+
+#define WRITE_CONTROL_DISPLAY_AOD_LOW BIT(0)
+#define WRITE_CONTROL_DISPLAY_AOD_ON BIT(1)
+#define WRITE_CONTROL_DISPLAY_DIMMING BIT(3)
+#define WRITE_CONTROL_DISPLAY_LOCAL_HBM BIT(4)
+#define WRITE_CONTROL_DISPLAY_BACKLIGHT BIT(5)
+#define WRITE_CONTROL_DISPLAY_HBM GENMASK(6, 7)
+
+/* Only used to send a few differentiating DCS between the two panel variants,
+ * without exactly knowing what they mean.  These do not seem to be related to
+ * panel functionality nor have any visual impact, but they are sent anyway just
+ * in case.
+ */
+enum panel_type {
+	/* Sony Xperia 5 */
+	PANEL_TYPE_TC01,
+	/* Sony Xperia 10 II */
+	PANEL_TYPE_UT01,
+	/* Sony Xperia 10 III */
+	PANEL_TYPE_UT04,
+	/* Sony Xperia 10 IV */
+	PANEL_TYPE_UT05,
+	/* Sony Xperia 10 V and 10 VI */
+	PANEL_TYPE_DK01,
+};
+
+const struct regulator_bulk_data samsung_sofef01_m_supplies[] = {
+	{ .supply = "vddio", /* 1.8 V */ },
+	{ .supply = "vci", /* 3.0 V */ },
+};
+
+struct samsung_sofef01_m {
+	struct drm_panel panel;
+	struct mipi_dsi_device *dsi;
+	struct regulator_bulk_data *supplies;
+	struct gpio_desc *reset_gpio;
+	const struct drm_display_mode *mode;
+	enum panel_type panel_type;
+};
+
+static inline struct samsung_sofef01_m *
+to_samsung_sofef01_m(struct drm_panel *panel)
+{
+	return container_of(panel, struct samsung_sofef01_m, panel);
+}
+
+static void samsung_sofef01_m_reset(struct samsung_sofef01_m *ctx)
+{
+	gpiod_set_value_cansleep(ctx->reset_gpio, 0);
+	usleep_range(10000, 11000);
+	gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+	usleep_range(10000, 11000);
+	gpiod_set_value_cansleep(ctx->reset_gpio, 0);
+	usleep_range(10000, 11000);
+}
+
+static int samsung_sofef01_m_program(struct samsung_sofef01_m *ctx)
+{
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
+
+	dsi_ctx.dsi->mode_flags |= MIPI_DSI_MODE_LPM;
+
+	mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
+	/* TC01 & UT01 require 10ms, UT04 11ms, and the rest 120ms */
+	mipi_dsi_msleep(&dsi_ctx, 120);
+
+	mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
+
+	if (ctx->panel_type == PANEL_TYPE_TC01 ||
+	    ctx->panel_type == PANEL_TYPE_UT01 ||
+	    ctx->panel_type == PANEL_TYPE_UT04) {
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xdf, 0x03);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xe0, 0x01);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+	}
+
+	if (ctx->panel_type == PANEL_TYPE_UT04) {
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xfc, 0x5a, 0x5a);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xE1, 0x00, 0x00, 0x02, 0x00, 0x1C, 0x1C,
+					     0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0x19);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xfc, 0xa5, 0xa5);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+	}
+
+	mipi_dsi_dcs_set_column_address_multi(&dsi_ctx, 0, 1080 - 1);
+	mipi_dsi_dcs_set_page_address_multi(&dsi_ctx, 0, 2520 - 1);
+
+	if (ctx->panel_type == PANEL_TYPE_UT05 || ctx->panel_type == PANEL_TYPE_DK01) {
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x27, 0xf2);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf2, 0x80);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf7, 0x07);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+		/* Downstream: ERR_FG Enable */
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xe5, 0x15);
+		if (ctx->panel_type == PANEL_TYPE_DK01)
+			mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xed, 0x0f, 0x4c, 0x20);
+		else
+			mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xed, 0x04, 0x4c, 0x20);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x02, 0x8f);
+
+		if (ctx->panel_type == PANEL_TYPE_DK01)
+			/* Downstream Xperia 10 V: FLM1,FLM2 On */
+			mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x8f, 0x27, 0x25);
+		else if (0) /* TODO: Both use the DK01 panel */
+			/* Downstream Xperia 10 VI: FLM1 On, FLM2 On */
+			mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x8f, 0x27, 0x27);
+		else
+			/* Downsteam: FLM1 on, FLM2 off */
+			mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x8f, 0x27, 0x05);
+
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x92, 0x63);
+		/* Downstream: dimming speed setting */
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x63, 0x05);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+	}
+
+	if (ctx->panel_type == PANEL_TYPE_UT05 || ctx->panel_type == PANEL_TYPE_DK01) {
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_CONTROL_DISPLAY,
+					     WRITE_CONTROL_DISPLAY_BACKLIGHT
+					     | WRITE_CONTROL_DISPLAY_DIMMING);
+	} else {
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_CONTROL_DISPLAY,
+					     WRITE_CONTROL_DISPLAY_BACKLIGHT);
+	}
+
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_POWER_SAVE, 0x00);
+
+	if (ctx->panel_type != PANEL_TYPE_UT05 && ctx->panel_type != PANEL_TYPE_DK01) {
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+
+		if (ctx->panel_type == PANEL_TYPE_TC01 || ctx->panel_type == PANEL_TYPE_UT01)
+			mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xbe, 0x92, 0x29);
+		else if (ctx->panel_type == PANEL_TYPE_UT04)
+			mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xbe, 0x92, 0x09);
+
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x06);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb6, 0x90);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+	}
+
+	mipi_dsi_msleep(&dsi_ctx, 110);
+
+	return dsi_ctx.accum_err;
+}
+
+static int samsung_sofef01_m_prepare(struct drm_panel *panel)
+{
+	struct samsung_sofef01_m *ctx = to_samsung_sofef01_m(panel);
+	struct device *dev = &ctx->dsi->dev;
+	int ret;
+
+	ret = regulator_bulk_enable(ARRAY_SIZE(samsung_sofef01_m_supplies), ctx->supplies);
+	if (ret < 0) {
+		dev_err(dev, "Failed to enable regulators: %d\n", ret);
+		return ret;
+	}
+
+	samsung_sofef01_m_reset(ctx);
+
+	ret = samsung_sofef01_m_program(ctx);
+	if (ret < 0) {
+		dev_err(dev, "Failed to program panel: %d\n", ret);
+		goto fail;
+	}
+
+	return 0;
+
+fail:
+	gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+	regulator_bulk_disable(ARRAY_SIZE(samsung_sofef01_m_supplies), ctx->supplies);
+	return ret;
+}
+
+static int samsung_sofef01_m_enable(struct drm_panel *panel)
+{
+	struct samsung_sofef01_m *ctx = to_samsung_sofef01_m(panel);
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
+
+	mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
+	mipi_dsi_usleep_range(&dsi_ctx, 16000, 17000);
+
+	return dsi_ctx.accum_err;
+}
+
+static int samsung_sofef01_m_disable(struct drm_panel *panel)
+{
+	struct samsung_sofef01_m *ctx = to_samsung_sofef01_m(panel);
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
+
+	mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
+	mipi_dsi_usleep_range(&dsi_ctx, 120000, 121000);
+
+	return dsi_ctx.accum_err;
+}
+
+static int samsung_sofef01_m_unprepare(struct drm_panel *panel)
+{
+	struct samsung_sofef01_m *ctx = to_samsung_sofef01_m(panel);
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
+
+	mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
+	mipi_dsi_usleep_range(&dsi_ctx, 100000, 101000);
+
+	ctx->dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
+
+	gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+	regulator_bulk_disable(ARRAY_SIZE(samsung_sofef01_m_supplies), ctx->supplies);
+
+	return dsi_ctx.accum_err;
+}
+
+static int samsung_sofef01_m_get_modes(struct drm_panel *panel,
+				       struct drm_connector *connector)
+{
+	struct samsung_sofef01_m *ctx = to_samsung_sofef01_m(panel);
+
+	return drm_connector_helper_get_modes_fixed(connector, ctx->mode);
+}
+
+static const struct drm_panel_funcs samsung_sofef01_m_panel_funcs = {
+	.prepare = samsung_sofef01_m_prepare,
+	.enable = samsung_sofef01_m_enable,
+	.disable = samsung_sofef01_m_disable,
+	.unprepare = samsung_sofef01_m_unprepare,
+	.get_modes = samsung_sofef01_m_get_modes,
+};
+
+static int samsung_sofef01_m_bl_update_status(struct backlight_device *bl)
+{
+	struct mipi_dsi_device *dsi = bl_get_data(bl);
+	u16 brightness = backlight_get_brightness(bl);
+
+	return mipi_dsi_dcs_set_display_brightness_large(dsi, brightness);
+}
+
+static int samsung_sofef01_m_bl_get_brightness(struct backlight_device *bl)
+{
+	struct mipi_dsi_device *dsi = bl_get_data(bl);
+	u16 brightness;
+	int ret;
+
+	ret = mipi_dsi_dcs_get_display_brightness_large(dsi, &brightness);
+
+	if (ret < 0)
+		return ret;
+
+	return brightness;
+}
+
+static const struct backlight_ops samsung_sofef01_m_bl_ops = {
+	.update_status = samsung_sofef01_m_bl_update_status,
+	.get_brightness = samsung_sofef01_m_bl_get_brightness,
+};
+
+/*
+ * drm/msm's DSI code does not calculate transfer time but instead relies on
+ * fake porch values (which are not a thing in CMD mode) to represent the
+ * transfer time.
+ *
+ * Use the following expressions based on qcom,mdss-dsi-panel-clockrate from
+ * downstream DT to artificially bump the mode's clock that reflects the
+ * necessary transfer time / overhead.
+ */
+static const unsigned int dsi_lanes = 4;
+static const unsigned int bpp = 24;
+/* qcom,mdss-dsi-panel-clockrate from downstream DT */
+static const unsigned long bitclk_hz = 1132293600;
+static const unsigned long stable_clockrate = bitclk_hz * dsi_lanes / bpp;
+static const unsigned long fake_porch = stable_clockrate / (2520 * 60) - 1080;
+
+/* 61x142mm variant, Sony Xperia 5 */
+static const struct drm_display_mode samsung_sofef01_m_61_142_mode = {
+	.clock = (1080 + fake_porch) * 2520 * 60 / 1000,
+	.hdisplay = 1080,
+	.hsync_start = 1080 + fake_porch,
+	.hsync_end = 1080 + fake_porch,
+	.htotal = 1080 + fake_porch,
+	.vdisplay = 2520,
+	.vsync_start = 2520,
+	.vsync_end = 2520,
+	.vtotal = 2520,
+	.width_mm = 61,
+	.height_mm = 142,
+	.type = DRM_MODE_TYPE_DRIVER,
+};
+
+/* 61x141mm variant, Sony Xperia 10 V and 10 VI */
+static const struct drm_display_mode samsung_sofef01_m_61_141_mode = {
+	.clock = (1080 + fake_porch) * 2520 * 60 / 1000,
+	.hdisplay = 1080,
+	.hsync_start = 1080 + fake_porch,
+	.hsync_end = 1080 + fake_porch,
+	.htotal = 1080 + fake_porch,
+	.vdisplay = 2520,
+	.vsync_start = 2520,
+	.vsync_end = 2520,
+	.vtotal = 2520,
+	.width_mm = 61,
+	.height_mm = 141,
+	.type = DRM_MODE_TYPE_DRIVER,
+};
+
+/* 60x139mm variant, Sony Xperia 10 II, 10 III and 10 IV */
+static const struct drm_display_mode samsung_sofef01_m_60_139_mode = {
+	.clock = (1080 + fake_porch) * 2520 * 60 / 1000,
+	.hdisplay = 1080,
+	.hsync_start = 1080 + fake_porch,
+	.hsync_end = 1080 + fake_porch,
+	.htotal = 1080 + fake_porch,
+	.vdisplay = 2520,
+	.vsync_start = 2520,
+	.vsync_end = 2520,
+	.vtotal = 2520,
+	.width_mm = 60,
+	.height_mm = 139,
+	.type = DRM_MODE_TYPE_DRIVER,
+};
+
+static int samsung_sofef01_m_probe(struct mipi_dsi_device *dsi)
+{
+	const struct backlight_properties props = {
+		.type = BACKLIGHT_RAW,
+		.brightness = 100,
+		.max_brightness = 1023,
+	};
+	struct device *dev = &dsi->dev;
+	struct samsung_sofef01_m *ctx;
+	int ret;
+
+	ctx = devm_drm_panel_alloc(dev, struct samsung_sofef01_m, panel,
+				   &samsung_sofef01_m_panel_funcs,
+				   DRM_MODE_CONNECTOR_DSI);
+	if (IS_ERR(ctx))
+		return PTR_ERR(ctx);
+
+	ret = devm_regulator_bulk_get_const(
+		dev,
+		ARRAY_SIZE(samsung_sofef01_m_supplies),
+		samsung_sofef01_m_supplies,
+		&ctx->supplies);
+	if (ret < 0)
+		return dev_err_probe(dev, ret, "Failed to get regulators\n");
+
+	ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
+	if (IS_ERR(ctx->reset_gpio))
+		return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
+				     "Failed to get reset-gpios\n");
+
+	ctx->dsi = dsi;
+	ctx->panel_type = (enum panel_type)of_device_get_match_data(dev);
+	if (ctx->panel_type == PANEL_TYPE_TC01)
+		ctx->mode = &samsung_sofef01_m_61_142_mode;
+	else if (ctx->panel_type == PANEL_TYPE_DK01)
+		ctx->mode = &samsung_sofef01_m_61_141_mode;
+	else
+		ctx->mode = &samsung_sofef01_m_60_139_mode;
+	mipi_dsi_set_drvdata(dsi, ctx);
+
+	dsi->lanes = 4;
+	dsi->format = MIPI_DSI_FMT_RGB888;
+	dsi->mode_flags = MIPI_DSI_CLOCK_NON_CONTINUOUS;
+
+	ctx->panel.prepare_prev_first = true;
+
+	ctx->panel.backlight = devm_backlight_device_register(
+		dev, dev_name(dev), dev, dsi,
+		&samsung_sofef01_m_bl_ops,
+		&props);
+	if (IS_ERR(ctx->panel.backlight))
+		return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight),
+				     "Failed to create backlight\n");
+
+	drm_panel_add(&ctx->panel);
+
+	ret = mipi_dsi_attach(dsi);
+	if (ret < 0) {
+		dev_err(dev, "Failed to attach to DSI host: %d\n", ret);
+		drm_panel_remove(&ctx->panel);
+		return ret;
+	}
+
+	return 0;
+}
+
+static void samsung_sofef01_m_remove(struct mipi_dsi_device *dsi)
+{
+	struct samsung_sofef01_m *ctx = mipi_dsi_get_drvdata(dsi);
+	int ret;
+
+	ret = mipi_dsi_detach(dsi);
+	if (ret < 0)
+		dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret);
+
+	drm_panel_remove(&ctx->panel);
+}
+
+static const struct of_device_id samsung_sofef01_m_of_match[] = {
+	{ .compatible = "samsung,sofef01-m-amb609tc01",
+	  .data = (void *)PANEL_TYPE_TC01 },
+	{ .compatible = "samsung,sofef01-m-ams597ut01",
+	  .data = (void *)PANEL_TYPE_UT01 },
+	{ .compatible = "samsung,sofef01-m-ams597ut04",
+	  .data = (void *)PANEL_TYPE_UT04 },
+	{ .compatible = "samsung,sofef01-m-ams597ut05",
+	  .data = (void *)PANEL_TYPE_UT05 },
+	{ .compatible = "samsung,sofef01-m-ams605dk01",
+	  .data = (void *)PANEL_TYPE_DK01 },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, samsung_sofef01_m_of_match);
+
+static struct mipi_dsi_driver samsung_sofef01_m_driver = {
+	.probe = samsung_sofef01_m_probe,
+	.remove = samsung_sofef01_m_remove,
+	.driver = {
+		.name = "panel-samsung-sofef01-m",
+		.of_match_table = samsung_sofef01_m_of_match,
+	},
+};
+module_mipi_dsi_driver(samsung_sofef01_m_driver);
+
+MODULE_AUTHOR("Marijn Suijten <marijn.suijten@somainline.org>");
+MODULE_DESCRIPTION("DRM panel driver for Samsung SOFEF01-M Display-Driver-IC panels");
+MODULE_LICENSE("GPL");

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH v2 06/11] dt-bindings: display: panel: Describe Samsung SOFEF03-M DDIC
  2025-12-21 23:32 [PATCH v2 00/11] drm/panel: Add 5 DDIC panel drivers for 14 Sony phones Marijn Suijten
                   ` (4 preceding siblings ...)
  2025-12-21 23:32 ` [PATCH v2 05/11] drm/panel: Add panel driver for Samsung SOFEF01 DDIC Marijn Suijten
@ 2025-12-21 23:32 ` Marijn Suijten
  2025-12-22  3:51   ` Rob Herring (Arm)
  2025-12-22  8:33   ` Krzysztof Kozlowski
  2025-12-21 23:32 ` [PATCH v2 07/11] drm/panel: Add panel driver for " Marijn Suijten
                   ` (4 subsequent siblings)
  10 siblings, 2 replies; 43+ messages in thread
From: Marijn Suijten @ 2025-12-21 23:32 UTC (permalink / raw)
  To: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Martin Botka, Jami Kettunen, dri-devel, linux-kernel, devicetree,
	linux-arm-msm, Abhinav Kumar, Kuogee Hsieh, Jessica Zhang,
	AngeloGioacchino Del Regno, Konrad Dybcio, Marijn Suijten,
	Konrad Dybcio, Dmitry Baryshkov

Document the Samsung SOFEF03-M Display-Driver-IC and 1080x2520@120Hz DSI
command-mode panels found in the Sony Xperia 5 II and Sony Xperia 5 III.
It requires Display Stream Compression 1.1 which allows the panels to be
driven at 120Hz, even though a 60Hz mode is available too.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 .../bindings/display/panel/samsung,sofef03-m.yaml  | 79 ++++++++++++++++++++++
 MAINTAINERS                                        |  5 ++
 2 files changed, 84 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/panel/samsung,sofef03-m.yaml b/Documentation/devicetree/bindings/display/panel/samsung,sofef03-m.yaml
new file mode 100644
index 000000000000..5712eca2773d
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/samsung,sofef03-m.yaml
@@ -0,0 +1,79 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/samsung,sofef03-m.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Samsung SOFEF03-M DDI for 1080x2520@120Hz 6.1" OLED DSI panels
+
+maintainers:
+  - Marijn Suijten <marijn.suijten@somainline.org>
+
+description: |
+  Samsung SOFEF03-M Display-Driver-IC found in the Sony Xperia 5 II (edo pdx206, amb609vp01
+  panel) and
+  Sony Xperia 5 III (sagami pdx214, amb609vp04
+  panel) smartphones.  It is always programmed with Display Stream Compression 1.1 enabled.
+
+  The assembly features a Samsung touchscreen compatible with
+  samsung,s6sy761.
+
+allOf:
+  - $ref: panel-common.yaml#
+
+properties:
+  compatible:
+    enum:
+      - samsung,sofef03-m-amb609vp01
+      - samsung,sofef03-m-amb609vp04
+
+  port: true
+
+  reg:
+    maxItems: 1
+    description: DSI virtual channel
+
+  reset-gpios: true
+
+  vci-supply:
+    description: DriverIC Operation supply (3.0V)
+
+  vddio-supply:
+    description: I/O voltage supply (1.8V)
+
+required:
+  - compatible
+  - port
+  - reg
+  - reset-gpios
+  - vci-supply
+  - vddio-supply
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    dsi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        panel@0 {
+            compatible = "samsung,sofef03-m-amb609vp01";
+            reg = <0>;
+
+            reset-gpios = <&tlmm 75 GPIO_ACTIVE_LOW>;
+
+            vci-supply = <&vreg_l11c_3p0>;
+            vddio-supply = <&vreg_l14a_1p8>;
+
+            port {
+                endpoint {
+                    remote-endpoint = <&dsi0_out>;
+                };
+            };
+        };
+    };
+
+...
+
diff --git a/MAINTAINERS b/MAINTAINERS
index cd2c924749d3..e48dd7f5a115 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8200,6 +8200,11 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/display/panel/samsung,sofef01-m.yaml
 F:	drivers/gpu/drm/panel/panel-samsung-sofef01.c
 
+DRM DRIVER FOR SAMSUNG SOFEF03 DDIC
+M:	Marijn Suijten <marijn.suijten@somainline.org>
+S:	Maintained
+F:	Documentation/devicetree/bindings/display/panel/samsung,sofef03-m.yaml
+
 DRM DRIVER FOR SHARP MEMORY LCD
 M:	Alex Lanzano <lanzano.alex@gmail.com>
 S:	Maintained

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH v2 07/11] drm/panel: Add panel driver for Samsung SOFEF03-M DDIC
  2025-12-21 23:32 [PATCH v2 00/11] drm/panel: Add 5 DDIC panel drivers for 14 Sony phones Marijn Suijten
                   ` (5 preceding siblings ...)
  2025-12-21 23:32 ` [PATCH v2 06/11] dt-bindings: display: panel: Describe Samsung SOFEF03-M DDIC Marijn Suijten
@ 2025-12-21 23:32 ` Marijn Suijten
  2025-12-24  1:15   ` Dmitry Baryshkov
  2025-12-24  9:43   ` Marijn Suijten
  2025-12-21 23:32 ` [PATCH v2 08/11] dt-bindings: display: panel: Describe Samsung SOUXP00-A DDIC Marijn Suijten
                   ` (3 subsequent siblings)
  10 siblings, 2 replies; 43+ messages in thread
From: Marijn Suijten @ 2025-12-21 23:32 UTC (permalink / raw)
  To: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Martin Botka, Jami Kettunen, dri-devel, linux-kernel, devicetree,
	linux-arm-msm, Abhinav Kumar, Kuogee Hsieh, Jessica Zhang,
	AngeloGioacchino Del Regno, Konrad Dybcio, Marijn Suijten,
	Konrad Dybcio, Dmitry Baryshkov, Konrad Dybcio

The SOFEF03-M Display-Driver-IC is paired with a amb609vp01 panel on
the Sony Xperia 5 II and amb609vp04 panel on the Sony Xperia 5 III. It
requires Display Stream Compression 1.1 which allows the panels to run
at 120Hz, even though a 60Hz mode is available too.

Downstream porch values are retained; despite not being used in
command-mode they are useful to artificially bump the clock values to
account for "transfer overhead" while that calculation is still missing
from the MSM DSI host driver.

Co-developed-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 MAINTAINERS                                   |   1 +
 drivers/gpu/drm/panel/Kconfig                 |  16 ++
 drivers/gpu/drm/panel/Makefile                |   1 +
 drivers/gpu/drm/panel/panel-samsung-sofef03.c | 373 ++++++++++++++++++++++++++
 4 files changed, 391 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index e48dd7f5a115..28135743ca0c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8204,6 +8204,7 @@ DRM DRIVER FOR SAMSUNG SOFEF03 DDIC
 M:	Marijn Suijten <marijn.suijten@somainline.org>
 S:	Maintained
 F:	Documentation/devicetree/bindings/display/panel/samsung,sofef03-m.yaml
+F:	drivers/gpu/drm/panel/panel-samsung-sofef03.c
 
 DRM DRIVER FOR SHARP MEMORY LCD
 M:	Alex Lanzano <lanzano.alex@gmail.com>
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 2f06b48dfb89..1f148bc5b068 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -953,6 +953,22 @@ config DRM_PANEL_SAMSUNG_SOFEF01
 
 	  This Display-IC features a fixed 1080x2520@60 mode.
 
+config DRM_PANEL_SAMSUNG_SOFEF03
+	tristate "Samsung SOFEF03-M DSI cmd mode panels"
+	depends on GPIOLIB
+	depends on OF
+	depends on DRM_MIPI_DSI
+	depends on BACKLIGHT_CLASS_DEVICE
+	select DRM_DISPLAY_DSC_HELPER
+	select DRM_DISPLAY_HELPER
+	help
+	  Say Y or M here if you want to enable support for the Samsung 6.1" AMOLED
+	  DSI command mode panel found in the Sony Xperia 5 II and Sony Xperia 5 III
+	  smartphones (both amb609vp01 panel).
+
+	  This Display-IC uses Display Stream Compression 1.1 and features a
+	  1080x2520@60 and 1080x2520@120 mode.
+
 config DRM_PANEL_SEIKO_43WVF1G
 	tristate "Seiko 43WVF1G panel"
 	depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index cbd9ef23b8d8..a9636f5f433a 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -95,6 +95,7 @@ obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0) += panel-samsung-s6e8aa0.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA5X01_AMS561RA01) += panel-samsung-s6e8aa5x01-ams561ra01.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_SOFEF00) += panel-samsung-sofef00.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_SOFEF01) += panel-samsung-sofef01.o
+obj-$(CONFIG_DRM_PANEL_SAMSUNG_SOFEF03) += panel-samsung-sofef03.o
 obj-$(CONFIG_DRM_PANEL_SEIKO_43WVF1G) += panel-seiko-43wvf1g.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LQ079L1SX01) += panel-sharp-lq079l1sx01.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o
diff --git a/drivers/gpu/drm/panel/panel-samsung-sofef03.c b/drivers/gpu/drm/panel/panel-samsung-sofef03.c
new file mode 100644
index 000000000000..f9399aab0623
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-samsung-sofef03.c
@@ -0,0 +1,373 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2022 Konrad Dybcio <konrad.dybcio@linaro.org>
+ * Copyright (c) 2023 Marijn Suijten <marijn.suijten@somainline.org>
+ *
+ * Based on the following Sony downstream DTS command sequences:
+ * - Xperia 5 II (edo pdx206): https://github.com/sonyxperiadev/kernel-copyleft-dts/blob/58.2.A.10.xxx/somc/dsi-panel-sofef03_m-fhd_plus.dtsi
+ *  - Xperia 5 III (sagami pdx214): https://github.com/sonyxperiadev/kernel-copyleft-dts/blob/61.2.A.0.xxx/somc/dsi-panel-sofef03_m-amb609vp01-fhd_plus.dtsi
+ */
+
+#include <linux/backlight.h>
+#include <linux/delay.h>
+#include <linux/gpio/consumer.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/regulator/consumer.h>
+
+#include <video/mipi_display.h>
+
+#include <drm/drm_mipi_dsi.h>
+#include <drm/drm_modes.h>
+#include <drm/drm_panel.h>
+#include <drm/drm_probe_helper.h>
+#include <drm/display/drm_dsc.h>
+#include <drm/display/drm_dsc_helper.h>
+
+#define WRITE_CONTROL_DISPLAY_BACKLIGHT BIT(5)
+
+/*
+ * TODO: This should be communicated via the mode when .prepare
+ * receives atomic commit info
+ */
+static const bool enable_120hz = true;
+
+struct samsung_sofef03_m {
+	struct drm_panel panel;
+	struct mipi_dsi_device *dsi;
+	struct drm_dsc_config dsc;
+	struct regulator *vddio, *vci;
+	struct gpio_desc *reset_gpio;
+};
+
+static inline struct samsung_sofef03_m *
+to_samsung_sofef03_m(struct drm_panel *panel)
+{
+	return container_of(panel, struct samsung_sofef03_m, panel);
+}
+
+static void samsung_sofef03_m_reset(struct samsung_sofef03_m *ctx)
+{
+	gpiod_set_value_cansleep(ctx->reset_gpio, 0);
+	usleep_range(10000, 11000);
+	gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+	usleep_range(10000, 11000);
+	gpiod_set_value_cansleep(ctx->reset_gpio, 0);
+	usleep_range(10000, 11000);
+}
+
+static int samsung_sofef03_m_program(struct samsung_sofef03_m *ctx)
+{
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
+
+	dsi_ctx.dsi->mode_flags |= MIPI_DSI_MODE_LPM;
+
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x9d, 0x01);
+
+	mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
+	mipi_dsi_msleep(&dsi_ctx, 10);
+
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x09);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xd5, 0x00, 0x00, 0x00);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x08);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xee, 0x00, 0x00);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+
+	mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
+	mipi_dsi_dcs_set_column_address_multi(&dsi_ctx, 0, 1080 - 1);
+	mipi_dsi_dcs_set_page_address_multi(&dsi_ctx, 0, 2520 - 1);
+
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xdf, 0x83);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x01);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xe6, 0x01);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x02);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xec, 0x02, 0x00, 0x1c, 0x1c);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x0c);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xec, 0x01, 0x19);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_CONTROL_DISPLAY,
+				     WRITE_CONTROL_DISPLAY_BACKLIGHT);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xc2, 0x2d, 0x27);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x60, enable_120hz ? 0x10 : 0x00);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+	mipi_dsi_msleep(&dsi_ctx, 110);
+
+	return dsi_ctx.accum_err;
+}
+
+static int samsung_sofef03_m_prepare(struct drm_panel *panel)
+{
+	struct samsung_sofef03_m *ctx = to_samsung_sofef03_m(panel);
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
+	struct drm_dsc_picture_parameter_set pps;
+	struct device *dev = &ctx->dsi->dev;
+	int ret;
+
+	ret = regulator_enable(ctx->vddio);
+	if (ret < 0) {
+		dev_err(dev, "Failed to enable vddio regulator: %d\n", ret);
+		return ret;
+	}
+
+	ret = regulator_enable(ctx->vci);
+	if (ret < 0) {
+		dev_err(dev, "Failed to enable vci regulator: %d\n", ret);
+		regulator_disable(ctx->vddio);
+		return ret;
+	}
+
+	samsung_sofef03_m_reset(ctx);
+
+	ret = samsung_sofef03_m_program(ctx);
+	if (ret < 0) {
+		dev_err(dev, "Failed to send on command sequence: %d\n", ret);
+		goto fail;
+	}
+
+	drm_dsc_pps_payload_pack(&pps, &ctx->dsc);
+
+	mipi_dsi_picture_parameter_set_multi(&dsi_ctx, &pps);
+	mipi_dsi_compression_mode_multi(&dsi_ctx, true);
+	mipi_dsi_msleep(&dsi_ctx, 28);
+
+	ret = dsi_ctx.accum_err;
+
+	if (ret < 0)
+		goto fail;
+
+	return 0;
+
+fail:
+	gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+	regulator_disable(ctx->vci);
+	regulator_disable(ctx->vddio);
+	return ret;
+}
+
+static int samsung_sofef03_m_enable(struct drm_panel *panel)
+{
+	struct samsung_sofef03_m *ctx = to_samsung_sofef03_m(panel);
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
+
+	mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
+
+	return dsi_ctx.accum_err;
+}
+
+static int samsung_sofef03_m_disable(struct drm_panel *panel)
+{
+	struct samsung_sofef03_m *ctx = to_samsung_sofef03_m(panel);
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
+
+	mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
+	mipi_dsi_msleep(&dsi_ctx, 20);
+
+	return dsi_ctx.accum_err;
+}
+
+static int samsung_sofef03_m_unprepare(struct drm_panel *panel)
+{
+	struct samsung_sofef03_m *ctx = to_samsung_sofef03_m(panel);
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
+
+	mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
+	mipi_dsi_msleep(&dsi_ctx, 100);
+
+	ctx->dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
+
+	gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+	regulator_disable(ctx->vci);
+	regulator_disable(ctx->vddio);
+
+	return dsi_ctx.accum_err;
+}
+
+/*
+ * TODO: These porch values are unused for command-mode panels, but currently
+ * used to artificially bump the clocks to account for transfer overhead.
+ */
+static const struct drm_display_mode samsung_sofef03_m_60hz_mode = {
+	.clock = (1080 + 156 + 8 + 8) * (2520 + 2393 + 8 + 8) * 60 / 1000,
+	.hdisplay = 1080,
+	.hsync_start = 1080 + 156,
+	.hsync_end = 1080 + 156 + 8,
+	.htotal = 1080 + 156 + 8 + 8,
+	.vdisplay = 2520,
+	.vsync_start = 2520 + 2393,
+	.vsync_end = 2520 + 2393 + 8,
+	.vtotal = 2520 + 2393 + 8 + 8,
+	.width_mm = 61,
+	.height_mm = 142,
+	.type = DRM_MODE_TYPE_DRIVER,
+};
+
+static const struct drm_display_mode samsung_sofef03_m_120hz_mode = {
+	.clock = (1080 + 56 + 8 + 8) * (2520 + 499 + 8 + 8) * 120 / 1000,
+	.hdisplay = 1080,
+	.hsync_start = 1080 + 56,
+	.hsync_end = 1080 + 56 + 8,
+	.htotal = 1080 + 56 + 8 + 8,
+	.vdisplay = 2520,
+	.vsync_start = 2520 + 499,
+	.vsync_end = 2520 + 499 + 8,
+	.vtotal = 2520 + 499 + 8 + 8,
+	.width_mm = 61,
+	.height_mm = 142,
+	.type = DRM_MODE_TYPE_DRIVER,
+};
+
+static int samsung_sofef03_m_get_modes(struct drm_panel *panel,
+				       struct drm_connector *connector)
+{
+	if (enable_120hz)
+		return drm_connector_helper_get_modes_fixed(
+			connector, &samsung_sofef03_m_120hz_mode);
+	else
+		return drm_connector_helper_get_modes_fixed(
+			connector, &samsung_sofef03_m_60hz_mode);
+}
+
+static const struct drm_panel_funcs samsung_sofef03_m_panel_funcs = {
+	.prepare = samsung_sofef03_m_prepare,
+	.enable = samsung_sofef03_m_enable,
+	.disable = samsung_sofef03_m_disable,
+	.unprepare = samsung_sofef03_m_unprepare,
+	.get_modes = samsung_sofef03_m_get_modes,
+};
+
+static int samsung_sofef03_m_bl_update_status(struct backlight_device *bl)
+{
+	struct mipi_dsi_device *dsi = bl_get_data(bl);
+	u16 brightness = backlight_get_brightness(bl);
+
+	/* HACK: Setting anything below 0x100 makes the panel go black */
+	if (brightness != 0 && brightness < 256)
+		brightness = 256;
+
+	return mipi_dsi_dcs_set_display_brightness_large(dsi, brightness);
+}
+
+static const struct backlight_ops samsung_sofef03_m_bl_ops = {
+	.update_status = samsung_sofef03_m_bl_update_status,
+};
+
+static int samsung_sofef03_m_probe(struct mipi_dsi_device *dsi)
+{
+	const struct backlight_properties props = {
+		.type = BACKLIGHT_RAW,
+		.brightness = 256,
+		.max_brightness = 1023,
+	};
+	struct device *dev = &dsi->dev;
+	struct samsung_sofef03_m *ctx;
+	int ret;
+
+	ctx = devm_drm_panel_alloc(dev, struct samsung_sofef03_m, panel,
+				   &samsung_sofef03_m_panel_funcs,
+				   DRM_MODE_CONNECTOR_DSI);
+	if (IS_ERR(ctx))
+		return PTR_ERR(ctx);
+
+	ctx->vddio = devm_regulator_get(dev, "vddio");
+	if (IS_ERR(ctx->vddio))
+		return dev_err_probe(dev, PTR_ERR(ctx->vddio),
+				     "Failed to get vddio regulator\n");
+
+	ctx->vci = devm_regulator_get(dev, "vci");
+	if (IS_ERR(ctx->vci))
+		return dev_err_probe(dev, PTR_ERR(ctx->vci),
+				     "Failed to get vci regulator\n");
+
+	ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
+	if (IS_ERR(ctx->reset_gpio))
+		return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
+				     "Failed to get reset-gpios\n");
+
+	ctx->dsi = dsi;
+	mipi_dsi_set_drvdata(dsi, ctx);
+
+	dsi->lanes = 4;
+	dsi->format = MIPI_DSI_FMT_RGB888;
+	dsi->mode_flags = MIPI_DSI_CLOCK_NON_CONTINUOUS;
+
+	ctx->panel.prepare_prev_first = true;
+
+	ctx->panel.backlight = devm_backlight_device_register(
+		dev, dev_name(dev), dev, dsi,
+		&samsung_sofef03_m_bl_ops,
+		&props);
+	if (IS_ERR(ctx->panel.backlight))
+		return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight),
+				     "Failed to create backlight\n");
+
+	drm_panel_add(&ctx->panel);
+
+	/* This panel only supports DSC; unconditionally enable it */
+	dsi->dsc = &ctx->dsc;
+
+	ctx->dsc.dsc_version_major = 1;
+	ctx->dsc.dsc_version_minor = 1;
+
+	ctx->dsc.slice_height = 30;
+	ctx->dsc.slice_width = 540;
+	ctx->dsc.slice_count = 2;
+	ctx->dsc.bits_per_component = 8;
+	ctx->dsc.bits_per_pixel = 8 << 4; /* 4 fractional bits */
+	ctx->dsc.block_pred_enable = true;
+
+	ret = mipi_dsi_attach(dsi);
+	if (ret < 0) {
+		dev_err(dev, "Failed to attach to DSI host: %d\n", ret);
+		drm_panel_remove(&ctx->panel);
+		return ret;
+	}
+
+	return 0;
+}
+
+static void samsung_sofef03_m_remove(struct mipi_dsi_device *dsi)
+{
+	struct samsung_sofef03_m *ctx = mipi_dsi_get_drvdata(dsi);
+	int ret;
+
+	ret = mipi_dsi_detach(dsi);
+	if (ret < 0)
+		dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret);
+
+	drm_panel_remove(&ctx->panel);
+}
+
+static const struct of_device_id samsung_sofef03_m_of_match[] = {
+	/* Sony Xperia 5 II */
+	{ .compatible = "samsung,sofef03-m-amb609vp01" },
+	/* Sony Xperia 5 III */
+	{ .compatible = "samsung,sofef03-m-amb609vp04" },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, samsung_sofef03_m_of_match);
+
+static struct mipi_dsi_driver samsung_sofef03_m_driver = {
+	.probe = samsung_sofef03_m_probe,
+	.remove = samsung_sofef03_m_remove,
+	.driver = {
+		.name = "panel-samsung-sofef03-m",
+		.of_match_table = samsung_sofef03_m_of_match,
+	},
+};
+module_mipi_dsi_driver(samsung_sofef03_m_driver);
+
+MODULE_AUTHOR("Konrad Dybcio <konrad.dybcio@linaro.org>");
+MODULE_AUTHOR("Marijn Suijten <marijn.suijten@somainline.org>");
+MODULE_DESCRIPTION("DRM panel driver for Samsung SOFEF03-M Display-Driver-IC panels");
+MODULE_LICENSE("GPL");

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH v2 08/11] dt-bindings: display: panel: Describe Samsung SOUXP00-A DDIC
  2025-12-21 23:32 [PATCH v2 00/11] drm/panel: Add 5 DDIC panel drivers for 14 Sony phones Marijn Suijten
                   ` (6 preceding siblings ...)
  2025-12-21 23:32 ` [PATCH v2 07/11] drm/panel: Add panel driver for " Marijn Suijten
@ 2025-12-21 23:32 ` Marijn Suijten
  2025-12-22  3:51   ` Rob Herring (Arm)
  2025-12-21 23:32 ` [PATCH v2 09/11] drm/panel: Add panel driver for " Marijn Suijten
                   ` (2 subsequent siblings)
  10 siblings, 1 reply; 43+ messages in thread
From: Marijn Suijten @ 2025-12-21 23:32 UTC (permalink / raw)
  To: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Martin Botka, Jami Kettunen, dri-devel, linux-kernel, devicetree,
	linux-arm-msm, Abhinav Kumar, Kuogee Hsieh, Jessica Zhang,
	AngeloGioacchino Del Regno, Konrad Dybcio, Marijn Suijten,
	Konrad Dybcio, Dmitry Baryshkov

Document the Samsung SOUXP00-A Display-Driver-IC and 11644x3840@60Hz
6.5" DSI command-mode panels found in the Sony Xperia 1 with amb650wh01
panel and Sony Xperia 1 II with amb650wh07 panel. It requires Display
Stream Compression 1.1.

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 .../bindings/display/panel/samsung,souxp00-a.yaml  | 79 ++++++++++++++++++++++
 MAINTAINERS                                        |  5 ++
 2 files changed, 84 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/panel/samsung,souxp00-a.yaml b/Documentation/devicetree/bindings/display/panel/samsung,souxp00-a.yaml
new file mode 100644
index 000000000000..bfbb8c0a41cf
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/samsung,souxp00-a.yaml
@@ -0,0 +1,79 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/samsung,souxp00-a.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Samsung SOUXP00-A DDI for 1644x3840@60Hz 6.5" OLED DSI panels
+
+maintainers:
+  - Marijn Suijten <marijn.suijten@somainline.org>
+
+description: |
+  Samsung SOUXP00-A Display-Driver-IC found in the Sony Xperia 1 (kumano
+  griffin, amb650wh01 panel) and Sony Xperia 1 II (edo pdx203, amb650wh07 panel)
+  smartphones.  It is always programmed with Display Stream Compression 1.1
+  enabled.
+
+  The assembly features a Samsung touchscreen compatible with
+  samsung,s6sy761.
+
+allOf:
+  - $ref: panel-common.yaml#
+
+properties:
+  compatible:
+    enum:
+      - samsung,souxp00-a-amb650wh01
+      - samsung,souxp00-a-amb650wh07
+
+  port: true
+
+  reg:
+    maxItems: 1
+    description: DSI virtual channel
+
+  reset-gpios: true
+
+  vci-supply:
+    description: DriverIC Operation supply (3.0V)
+
+  vddio-supply:
+    description: I/O voltage supply (1.8V)
+
+required:
+  - compatible
+  - port
+  - reg
+  - reset-gpios
+  - vci-supply
+  - vddio-supply
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    dsi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        panel@0 {
+            compatible = "samsung,souxp00-a-amb650wh01";
+            reg = <0>;
+
+            reset-gpios = <&tlmm 6 GPIO_ACTIVE_LOW>;
+
+            vci-supply = <&vreg_l17a_3p0>;
+            vddio-supply = <&vreg_l14a_1p8>;
+
+            port {
+                endpoint {
+                    remote-endpoint = <&dsi0_out>;
+                };
+            };
+        };
+    };
+
+...
+
diff --git a/MAINTAINERS b/MAINTAINERS
index 28135743ca0c..7f32ff371799 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8206,6 +8206,11 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/display/panel/samsung,sofef03-m.yaml
 F:	drivers/gpu/drm/panel/panel-samsung-sofef03.c
 
+DRM DRIVER FOR SAMSUNG SOUXP00 DDIC
+M:	Marijn Suijten <marijn.suijten@somainline.org>
+S:	Maintained
+F:	Documentation/devicetree/bindings/display/panel/samsung,souxp00-a.yaml
+
 DRM DRIVER FOR SHARP MEMORY LCD
 M:	Alex Lanzano <lanzano.alex@gmail.com>
 S:	Maintained

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH v2 09/11] drm/panel: Add panel driver for Samsung SOUXP00-A DDIC
  2025-12-21 23:32 [PATCH v2 00/11] drm/panel: Add 5 DDIC panel drivers for 14 Sony phones Marijn Suijten
                   ` (7 preceding siblings ...)
  2025-12-21 23:32 ` [PATCH v2 08/11] dt-bindings: display: panel: Describe Samsung SOUXP00-A DDIC Marijn Suijten
@ 2025-12-21 23:32 ` Marijn Suijten
  2025-12-24  1:15   ` Dmitry Baryshkov
  2025-12-24 17:26   ` kernel test robot
  2025-12-21 23:32 ` [PATCH v2 10/11] dt-bindings: display: panel: Describe Samsung ANA6707 DDIC Marijn Suijten
  2025-12-21 23:32 ` [PATCH v2 11/11] drm/panel: Add panel driver for " Marijn Suijten
  10 siblings, 2 replies; 43+ messages in thread
From: Marijn Suijten @ 2025-12-21 23:32 UTC (permalink / raw)
  To: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Martin Botka, Jami Kettunen, dri-devel, linux-kernel, devicetree,
	linux-arm-msm, Abhinav Kumar, Kuogee Hsieh, Jessica Zhang,
	AngeloGioacchino Del Regno, Konrad Dybcio, Marijn Suijten,
	Konrad Dybcio, Dmitry Baryshkov

The Samsung SOUXP00-A Display-Driver-IC is used to drive 11644x3840@60Hz
6.5" DSI command-mode panels found in the Sony Xperia 1 with amb650wh01
panel and Sony Xperia 1 II with amb650wh07 panel.  It requires Display
Stream Compression 1.1.  The panels can also be driven at a 1096x2560@60
mode.

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 MAINTAINERS                                   |   1 +
 drivers/gpu/drm/panel/Kconfig                 |  16 ++
 drivers/gpu/drm/panel/Makefile                |   1 +
 drivers/gpu/drm/panel/panel-samsung-souxp00.c | 399 ++++++++++++++++++++++++++
 4 files changed, 417 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 7f32ff371799..37c5ce4b3ba5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8210,6 +8210,7 @@ DRM DRIVER FOR SAMSUNG SOUXP00 DDIC
 M:	Marijn Suijten <marijn.suijten@somainline.org>
 S:	Maintained
 F:	Documentation/devicetree/bindings/display/panel/samsung,souxp00-a.yaml
+F:	drivers/gpu/drm/panel/panel-samsung-souxp00.c
 
 DRM DRIVER FOR SHARP MEMORY LCD
 M:	Alex Lanzano <lanzano.alex@gmail.com>
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 1f148bc5b068..3cca1c580d50 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -969,6 +969,22 @@ config DRM_PANEL_SAMSUNG_SOFEF03
 	  This Display-IC uses Display Stream Compression 1.1 and features a
 	  1080x2520@60 and 1080x2520@120 mode.
 
+config DRM_PANEL_SAMSUNG_SOUXP00
+	tristate "Samsung SOUXP00-A DSI cmd mode panels"
+	depends on GPIOLIB
+	depends on OF
+	depends on DRM_MIPI_DSI
+	depends on BACKLIGHT_CLASS_DEVICE
+	select DRM_DISPLAY_DSC_HELPER
+	select DRM_DISPLAY_HELPER
+	help
+	  Say Y here if you want to enable support for the Samsung 4k 6.5" OLED DSI
+	  command mode panel found in the Sony Xperia 1 (amb650wh01 panel) and Sony
+	  Xperia 1 II (amb650wh07 panel).
+
+	  This Display-IC uses Display Stream Compression 1.1 and features a
+	  1644x3840@60 and 1096x2560@60 mode.
+
 config DRM_PANEL_SEIKO_43WVF1G
 	tristate "Seiko 43WVF1G panel"
 	depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index a9636f5f433a..c19429b9e48d 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -96,6 +96,7 @@ obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA5X01_AMS561RA01) += panel-samsung-s6e8aa5x0
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_SOFEF00) += panel-samsung-sofef00.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_SOFEF01) += panel-samsung-sofef01.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_SOFEF03) += panel-samsung-sofef03.o
+obj-$(CONFIG_DRM_PANEL_SAMSUNG_SOUXP00) += panel-samsung-souxp00.o
 obj-$(CONFIG_DRM_PANEL_SEIKO_43WVF1G) += panel-seiko-43wvf1g.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LQ079L1SX01) += panel-sharp-lq079l1sx01.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o
diff --git a/drivers/gpu/drm/panel/panel-samsung-souxp00.c b/drivers/gpu/drm/panel/panel-samsung-souxp00.c
new file mode 100644
index 000000000000..4d86fe40d963
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-samsung-souxp00.c
@@ -0,0 +1,399 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2023 Marijn Suijten <marijn.suijten@somainline.org>
+ *
+ * Based on the following Sony downstream DTS command sequences:
+ * - Xperia 1 (kumano griffin): https://github.com/sonyxperiadev/kernel-copyleft/blob/55.2.A.4.xxx/arch/arm64/boot/dts/somc/dsi-panel-4koled.dtsi
+ * - Xperia 1 II (edo pdx203): https://github.com/sonyxperiadev/kernel-copyleft-dts/blob/58.2.A.10.xxx/somc/dsi-panel-souxp00_a-amb650wh07-uhd.dtsi
+ */
+
+#include <linux/backlight.h>
+#include <linux/delay.h>
+#include <linux/gpio/consumer.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/regulator/consumer.h>
+
+#include <video/mipi_display.h>
+
+#include <drm/drm_mipi_dsi.h>
+#include <drm/drm_modes.h>
+#include <drm/drm_panel.h>
+#include <drm/drm_probe_helper.h>
+#include <drm/display/drm_dsc.h>
+#include <drm/display/drm_dsc_helper.h>
+
+#define WRITE_CONTROL_DISPLAY_BACKLIGHT BIT(5)
+
+/* Only used to send a few differentiating DCS between the two panel variants,
+ * without exactly knowing what they mean.  These do not seem to be related to
+ * panel functionality nor have any visual impact, but they are sent anyway just
+ * in case.
+ */
+enum panel_type {
+	/* Sony Xperia 1 */
+	PANEL_TYPE_01,
+	/* Sony Xperia 1 II */
+	PANEL_TYPE_07,
+};
+
+/*
+ * TODO: This should be communicated via the mode when .prepare
+ * receives atomic commit info
+ */
+static const bool enable_4k = true;
+
+const struct regulator_bulk_data samsung_souxp00_a_supplies[] = {
+	{ .supply = "vddio", /* 1.8 V */ },
+	{ .supply = "vci", /* 3.0 V */ },
+};
+
+struct samsung_souxp00_a {
+	struct drm_panel panel;
+	struct mipi_dsi_device *dsi;
+	struct drm_dsc_config dsc;
+	struct regulator_bulk_data *supplies;
+	struct gpio_desc *reset_gpio;
+	enum panel_type panel_type;
+};
+
+static inline struct samsung_souxp00_a *
+to_samsung_souxp00_a(struct drm_panel *panel)
+{
+	return container_of(panel, struct samsung_souxp00_a, panel);
+}
+
+static int samsung_souxp00_a_program(struct samsung_souxp00_a *ctx)
+{
+	const u16 hdisplay = enable_4k ? 1644 : 1096;
+	const u16 vdisplay = enable_4k ? 3840 : 2560;
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
+
+	dsi_ctx.dsi->mode_flags |= MIPI_DSI_MODE_LPM;
+
+	mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
+	mipi_dsi_msleep(&dsi_ctx, 10);
+
+	if (ctx->panel_type == PANEL_TYPE_07) {
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xdd, 0x00, 0x80, 0x00, 0x00);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+	}
+
+	mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
+
+	mipi_dsi_compression_mode_multi(&dsi_ctx, true);
+
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x05);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xd7, 0x07);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xe2, enable_4k ? 0 : 1);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+
+	mipi_dsi_dcs_set_column_address_multi(&dsi_ctx, 0, hdisplay - 1);
+	mipi_dsi_dcs_set_page_address_multi(&dsi_ctx, 0, vdisplay - 1);
+
+	if (ctx->panel_type == PANEL_TYPE_01) {
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x70);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb9, 0x00, 0x60);
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+	}
+
+	/* Enable backlight control */
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_CONTROL_DISPLAY,
+				     WRITE_CONTROL_DISPLAY_BACKLIGHT);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xc5, 0x2e, 0x21);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+	mipi_dsi_msleep(&dsi_ctx, 110);
+
+	return dsi_ctx.accum_err;
+}
+
+static int samsung_souxp00_a_prepare(struct drm_panel *panel)
+{
+	struct samsung_souxp00_a *ctx = to_samsung_souxp00_a(panel);
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
+	struct drm_dsc_picture_parameter_set pps;
+	struct device *dev = &ctx->dsi->dev;
+	int ret;
+
+	ret = regulator_bulk_enable(ARRAY_SIZE(samsung_souxp00_a_supplies), ctx->supplies);
+	if (ret < 0) {
+		dev_err(dev, "Failed to enable regulators: %d\n", ret);
+		return ret;
+	}
+
+	gpiod_set_value_cansleep(ctx->reset_gpio, 0);
+	usleep_range(10000, 11000);
+
+	ret = samsung_souxp00_a_program(ctx);
+	if (ret < 0) {
+		dev_err(dev, "Failed to program panel: %d\n", ret);
+		goto fail;
+	}
+
+	drm_dsc_pps_payload_pack(&pps, &ctx->dsc);
+
+	mipi_dsi_picture_parameter_set_multi(&dsi_ctx, &pps);
+	mipi_dsi_compression_mode_multi(&dsi_ctx, true);
+	mipi_dsi_msleep(&dsi_ctx, 28);
+
+	ret = dsi_ctx.accum_err;
+
+	if (ret < 0)
+		goto fail;
+
+	return 0;
+
+fail:
+	gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+	regulator_bulk_disable(ARRAY_SIZE(samsung_souxp00_a_supplies), ctx->supplies);
+	return ret;
+}
+
+static int samsung_souxp00_a_enable(struct drm_panel *panel)
+{
+	struct samsung_souxp00_a *ctx = to_samsung_souxp00_a(panel);
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
+
+	mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
+
+	return dsi_ctx.accum_err;
+}
+
+static int samsung_souxp00_a_disable(struct drm_panel *panel)
+{
+	struct samsung_souxp00_a *ctx = to_samsung_souxp00_a(panel);
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
+
+	mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
+	mipi_dsi_msleep(&dsi_ctx, 17);
+
+	return dsi_ctx.accum_err;
+}
+
+static int samsung_souxp00_a_unprepare(struct drm_panel *panel)
+{
+	struct samsung_souxp00_a *ctx = to_samsung_souxp00_a(panel);
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
+
+	if (ctx->panel_type == PANEL_TYPE_01) {
+		mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_CONTROL_DISPLAY,
+					     WRITE_CONTROL_DISPLAY_BACKLIGHT);
+		mipi_dsi_msleep(&dsi_ctx, 17);
+	}
+
+	mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
+	mipi_dsi_msleep(&dsi_ctx, 100);
+
+	dsi_ctx.dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
+
+	gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+	regulator_bulk_disable(ARRAY_SIZE(samsung_souxp00_a_supplies), ctx->supplies);
+
+	return dsi_ctx.accum_err;
+}
+
+/*
+ * Small fake porch to force the DSI pclk/byteclk
+ * high enough to have a smooth panel at 60Hz.
+ *
+ * 60 for 4k, or 40 for 2.5k is fine for Griffin, but not PDX203.
+ * Even at 84 there's still the occasional hiccup.
+ */
+static const int fake_porch = 98;
+
+static const struct drm_display_mode samsung_souxp00_a_2_5k_mode = {
+	.clock = (1096 + fake_porch) * 2560 * 60 / 1000,
+	.hdisplay = 1096,
+	.hsync_start = 1096 + fake_porch,
+	.hsync_end = 1096 + fake_porch,
+	.htotal = 1096 + fake_porch,
+	.vdisplay = 2560,
+	.vsync_start = 2560,
+	.vsync_end = 2560,
+	.vtotal = 2560,
+	.width_mm = 65,
+	.height_mm = 152,
+	.type = DRM_MODE_TYPE_DRIVER,
+};
+
+static const struct drm_display_mode samsung_souxp00_a_4k_mode = {
+	.clock = (1644 + fake_porch) * 3840 * 60 / 1000,
+	.hdisplay = 1644,
+	.hsync_start = 1644 + fake_porch,
+	.hsync_end = 1644 + fake_porch,
+	.htotal = 1644 + fake_porch,
+	.vdisplay = 3840,
+	.vsync_start = 3840,
+	.vsync_end = 3840,
+	.vtotal = 3840,
+	.width_mm = 65,
+	.height_mm = 152,
+	.type = DRM_MODE_TYPE_DRIVER,
+};
+
+static int samsung_souxp00_a_get_modes(struct drm_panel *panel,
+				     struct drm_connector *connector)
+{
+	if (enable_4k)
+		return drm_connector_helper_get_modes_fixed(
+			connector, &samsung_souxp00_a_4k_mode);
+	else
+		return drm_connector_helper_get_modes_fixed(
+			connector, &samsung_souxp00_a_2_5k_mode);
+}
+
+static const struct drm_panel_funcs samsung_souxp00_a_panel_funcs = {
+	.prepare = samsung_souxp00_a_prepare,
+	.enable = samsung_souxp00_a_enable,
+	.disable = samsung_souxp00_a_disable,
+	.unprepare = samsung_souxp00_a_unprepare,
+	.get_modes = samsung_souxp00_a_get_modes,
+};
+
+static int samsung_souxp00_a_bl_update_status(struct backlight_device *bl)
+{
+	struct mipi_dsi_device *dsi = bl_get_data(bl);
+	u16 brightness = backlight_get_brightness(bl);
+
+	return mipi_dsi_dcs_set_display_brightness_large(dsi, brightness);
+}
+
+static int samsung_souxp00_a_bl_get_brightness(struct backlight_device *bl)
+{
+	struct mipi_dsi_device *dsi = bl_get_data(bl);
+	u16 brightness;
+	int ret;
+
+	ret = mipi_dsi_dcs_get_display_brightness_large(dsi, &brightness);
+
+	if (ret < 0)
+		return ret;
+
+	return brightness;
+}
+
+static const struct backlight_ops samsung_souxp00_a_bl_ops = {
+	.update_status = samsung_souxp00_a_bl_update_status,
+	.get_brightness = samsung_souxp00_a_bl_get_brightness,
+};
+
+static int samsung_souxp00_a_probe(struct mipi_dsi_device *dsi)
+{
+	const struct backlight_properties props = {
+		.type = BACKLIGHT_RAW,
+		.brightness = 400,
+		.max_brightness = 4095,
+	};
+	const u16 hdisplay = enable_4k ? 1644 : 1096;
+	struct device *dev = &dsi->dev;
+	struct samsung_souxp00_a *ctx;
+	int ret;
+
+	ctx = devm_drm_panel_alloc(dev, struct samsung_souxp00_a, panel,
+				   &samsung_souxp00_a_panel_funcs,
+				   DRM_MODE_CONNECTOR_DSI);
+	if (IS_ERR(ctx))
+		return PTR_ERR(ctx);
+
+	ctx->panel_type = (enum panel_type)of_device_get_match_data(dev);
+
+	ret = devm_regulator_bulk_get_const(
+		dev,
+		ARRAY_SIZE(samsung_souxp00_a_supplies),
+		samsung_souxp00_a_supplies,
+		&ctx->supplies);
+	if (ret < 0)
+		return dev_err_probe(dev, ret, "Failed to get regulators\n");
+
+	ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
+	if (IS_ERR(ctx->reset_gpio))
+		return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
+				     "Failed to get reset-gpios\n");
+
+	ctx->dsi = dsi;
+	mipi_dsi_set_drvdata(dsi, ctx);
+
+	dsi->lanes = 4;
+	dsi->format = MIPI_DSI_FMT_RGB888;
+	dsi->mode_flags = MIPI_DSI_CLOCK_NON_CONTINUOUS;
+
+	ctx->panel.prepare_prev_first = true;
+
+	ctx->panel.backlight = devm_backlight_device_register(
+		dev, dev_name(dev), dev, dsi,
+		&samsung_souxp00_a_bl_ops,
+		&props);
+	if (IS_ERR(ctx->panel.backlight))
+		return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight),
+				     "Failed to create backlight\n");
+
+	drm_panel_add(&ctx->panel);
+
+	/* This panel only supports DSC; unconditionally enable it */
+	dsi->dsc = &ctx->dsc;
+
+	ctx->dsc.dsc_version_major = 1;
+	ctx->dsc.dsc_version_minor = 1;
+
+	ctx->dsc.slice_height = 32;
+	ctx->dsc.slice_count = 2;
+	/*
+	 * hdisplay should be read from the selected mode once
+	 * it is passed back to drm_panel (in prepare?)
+	 */
+	WARN_ON(hdisplay % ctx->dsc.slice_count);
+	ctx->dsc.slice_width = hdisplay / ctx->dsc.slice_count;
+	ctx->dsc.bits_per_component = 8;
+	ctx->dsc.bits_per_pixel = 8 << 4; /* 4 fractional bits */
+	ctx->dsc.block_pred_enable = true;
+
+	ret = mipi_dsi_attach(dsi);
+	if (ret < 0) {
+		dev_err(dev, "Failed to attach to DSI host: %d\n", ret);
+		drm_panel_remove(&ctx->panel);
+		return ret;
+	}
+
+	return 0;
+}
+
+static void samsung_souxp00_a_remove(struct mipi_dsi_device *dsi)
+{
+	struct samsung_souxp00_a *ctx = mipi_dsi_get_drvdata(dsi);
+	int ret;
+
+	ret = mipi_dsi_detach(dsi);
+	if (ret < 0)
+		dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret);
+
+	drm_panel_remove(&ctx->panel);
+}
+
+static const struct of_device_id samsung_souxp00_a_of_match[] = {
+	{ .compatible = "samsung,souxp00-a-amb650wh01",
+	  .data = (void *)PANEL_TYPE_01 },
+	{ .compatible = "samsung,souxp00-a-amb650wh07",
+	  .data = (void *)PANEL_TYPE_07 },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, samsung_souxp00_a_of_match);
+
+static struct mipi_dsi_driver samsung_souxp00_a_driver = {
+	.probe = samsung_souxp00_a_probe,
+	.remove = samsung_souxp00_a_remove,
+	.driver = {
+		.name = "panel-samsung-souxp00-a",
+		.of_match_table = samsung_souxp00_a_of_match,
+	},
+};
+module_mipi_dsi_driver(samsung_souxp00_a_driver);
+
+MODULE_AUTHOR("Marijn Suijten <marijn.suijten@somainline.org>");
+MODULE_DESCRIPTION("DRM panel driver for Samsung SOUXP00-A Display-Driver-IC panels");
+MODULE_LICENSE("GPL");

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH v2 10/11] dt-bindings: display: panel: Describe Samsung ANA6707 DDIC
  2025-12-21 23:32 [PATCH v2 00/11] drm/panel: Add 5 DDIC panel drivers for 14 Sony phones Marijn Suijten
                   ` (8 preceding siblings ...)
  2025-12-21 23:32 ` [PATCH v2 09/11] drm/panel: Add panel driver for " Marijn Suijten
@ 2025-12-21 23:32 ` Marijn Suijten
  2025-12-22  3:51   ` Rob Herring (Arm)
  2025-12-21 23:32 ` [PATCH v2 11/11] drm/panel: Add panel driver for " Marijn Suijten
  10 siblings, 1 reply; 43+ messages in thread
From: Marijn Suijten @ 2025-12-21 23:32 UTC (permalink / raw)
  To: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Martin Botka, Jami Kettunen, dri-devel, linux-kernel, devicetree,
	linux-arm-msm, Abhinav Kumar, Kuogee Hsieh, Jessica Zhang,
	AngeloGioacchino Del Regno, Konrad Dybcio, Marijn Suijten,
	Konrad Dybcio, Dmitry Baryshkov

The ANA6707 Display-Driver-IC is paired with the amb650yl01 panel in the
Sony Xperia 1 III, Sony Xperia 1 IV and Sony Xperia V smartphones.  It
uses Display Stream Compression 1.1 and requires dual DSI interfaces to
satisfy the bandwidth requirements to run at 1644x3840 at 120Hz.

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 .../bindings/display/panel/samsung,ana6707.yaml    | 91 ++++++++++++++++++++++
 MAINTAINERS                                        |  5 ++
 2 files changed, 96 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/panel/samsung,ana6707.yaml b/Documentation/devicetree/bindings/display/panel/samsung,ana6707.yaml
new file mode 100644
index 000000000000..f627e10ca271
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/samsung,ana6707.yaml
@@ -0,0 +1,91 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/samsung,ana6707.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Samsung ANA6707 DDI for 1644x3840@120Hz 6.5" OLED DSI panels
+
+maintainers:
+  - Marijn Suijten <marijn.suijten@somainline.org>
+
+description: |
+  Samsung ANA6707 Display-Driver-IC found in the Sony Xperia 1 III, Sony Xperia
+  1 IV and Sony Xperia 1 V smartphones, paired with the amb650yl01 panel.  It
+  is always programmed with Display Stream Compression 1.1 enabled, and requires
+  two DSI interfaces.
+
+  The assembly features a Samsung touchscreen compatible with
+  samsung,s6sy761.
+
+allOf:
+  - $ref: panel-common.yaml#
+
+properties:
+  compatible:
+    const: samsung,ana6707-amb650yl01
+
+  port: true
+
+  reg:
+    maxItems: 1
+    description: DSI virtual channel
+
+  reset-gpios: true
+
+  vci-supply:
+    description: DriverIC Operation supply (3.0V)
+
+  vddio-supply:
+    description: I/O voltage supply (1.8V)
+
+required:
+  - compatible
+  - port
+  - reg
+  - reset-gpios
+  - vci-supply
+  - vddio-supply
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    dsi0 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        panel@0 {
+            compatible = "samsung,ana6707-amb650yl01";
+            reg = <0>;
+
+            reset-gpios = <&tlmm 24 GPIO_ACTIVE_LOW>;
+
+            vci-supply = <&pm8350c_l13>;
+            vddio-supply = <&pm8350c_l12>;
+
+            ports {
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                port@0 {
+                    reg = <0>;
+
+                    panel_in_0: endpoint {
+                        remote-endpoint = <&mdss_dsi0_out>;
+                    };
+                };
+                port@1 {
+                    reg = <1>;
+
+                    panel_in_1: endpoint {
+                        remote-endpoint = <&mdss_dsi1_out>;
+                    };
+                };
+            };
+        };
+    };
+
+...
+
diff --git a/MAINTAINERS b/MAINTAINERS
index 37c5ce4b3ba5..148b1f66c98b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8146,6 +8146,11 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/display/panel/raydium,rm67191.yaml
 F:	drivers/gpu/drm/panel/panel-raydium-rm67191.c
 
+DRM DRIVER FOR SAMSUNG ANA6707 DDIC
+M:	Marijn Suijten <marijn.suijten@somainline.org>
+S:	Maintained
+F:	Documentation/devicetree/bindings/display/panel/samsung,ana6707.yaml
+
 DRM DRIVER FOR SAMSUNG DB7430 PANELS
 M:	Linus Walleij <linusw@kernel.org>
 S:	Maintained

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH v2 11/11] drm/panel: Add panel driver for Samsung ANA6707 DDIC
  2025-12-21 23:32 [PATCH v2 00/11] drm/panel: Add 5 DDIC panel drivers for 14 Sony phones Marijn Suijten
                   ` (9 preceding siblings ...)
  2025-12-21 23:32 ` [PATCH v2 10/11] dt-bindings: display: panel: Describe Samsung ANA6707 DDIC Marijn Suijten
@ 2025-12-21 23:32 ` Marijn Suijten
  2025-12-24  1:16   ` Dmitry Baryshkov
  10 siblings, 1 reply; 43+ messages in thread
From: Marijn Suijten @ 2025-12-21 23:32 UTC (permalink / raw)
  To: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Martin Botka, Jami Kettunen, dri-devel, linux-kernel, devicetree,
	linux-arm-msm, Abhinav Kumar, Kuogee Hsieh, Jessica Zhang,
	AngeloGioacchino Del Regno, Konrad Dybcio, Marijn Suijten,
	Konrad Dybcio, Dmitry Baryshkov

The ANA6707 Display-Driver-IC is paired with the amb650yl01 panel in the
Sony Xperia 1 III, Sony Xperia 1 IV and Sony Xperia V smartphones.  It
uses Display Stream Compression 1.1 and requires dual DSI interfaces to
satisfy the bandwidth requirements to run at 1644x3840 at 120Hz.

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 MAINTAINERS                                   |   1 +
 drivers/gpu/drm/panel/Kconfig                 |  16 +
 drivers/gpu/drm/panel/Makefile                |   1 +
 drivers/gpu/drm/panel/panel-samsung-ana6707.c | 461 ++++++++++++++++++++++++++
 4 files changed, 479 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 148b1f66c98b..b29adf972dfc 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8150,6 +8150,7 @@ DRM DRIVER FOR SAMSUNG ANA6707 DDIC
 M:	Marijn Suijten <marijn.suijten@somainline.org>
 S:	Maintained
 F:	Documentation/devicetree/bindings/display/panel/samsung,ana6707.yaml
+F:	drivers/gpu/drm/panel/panel-samsung-ana6707.c
 
 DRM DRIVER FOR SAMSUNG DB7430 PANELS
 M:	Linus Walleij <linusw@kernel.org>
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 3cca1c580d50..eda808b9d466 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -752,6 +752,22 @@ config DRM_PANEL_SAMSUNG_AMS639RQ08
 	  Say Y or M here if you want to enable support for the
 	  Samsung AMS639RQ08 FHD Plus (2340x1080@60Hz) CMD mode panel.
 
+config DRM_PANEL_SAMSUNG_ANA6707
+	tristate "Samsung ANA6707 DSI cmd mode panels"
+	depends on GPIOLIB
+	depends on OF
+	depends on DRM_MIPI_DSI
+	depends on BACKLIGHT_CLASS_DEVICE
+	select DRM_DISPLAY_DSC_HELPER
+	select DRM_DISPLAY_HELPER
+	help
+	  Say Y here if you want to enable support for the Samsung 4k 6.5" OLED dual-DSI
+	  command mode amb650yl01 panel found in the Sony Xperia 1 III, Sony Xperia 1 IV
+	  and Sony Xperia V smartphones.
+
+	  This Display-IC uses Display Stream Compression 1.1 and features a 1644x3840
+	  and 1096x2560 resolution which can both be driven at 60Hz and 120Hz.
+
 config DRM_PANEL_SAMSUNG_S6E88A0_AMS427AP24
 	tristate "Samsung AMS427AP24 panel with S6E88A0 controller"
 	depends on GPIOLIB && OF && REGULATOR
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index c19429b9e48d..146750b93455 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -74,6 +74,7 @@ obj-$(CONFIG_DRM_PANEL_RENESAS_R69328) += panel-renesas-r69328.o
 obj-$(CONFIG_DRM_PANEL_RONBO_RB070D30) += panel-ronbo-rb070d30.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_AMS581VF01) += panel-samsung-ams581vf01.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_AMS639RQ08) += panel-samsung-ams639rq08.o
+obj-$(CONFIG_DRM_PANEL_SAMSUNG_ANA6707) += panel-samsung-ana6707.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_ATNA33XC20) += panel-samsung-atna33xc20.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_DB7430) += panel-samsung-db7430.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += panel-samsung-ld9040.o
diff --git a/drivers/gpu/drm/panel/panel-samsung-ana6707.c b/drivers/gpu/drm/panel/panel-samsung-ana6707.c
new file mode 100644
index 000000000000..83bf954e89d3
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-samsung-ana6707.c
@@ -0,0 +1,461 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2023 Marijn Suijten <marijn.suijten@somainline.org>
+ *
+ * Based on the following Sony downstream DTS command sequences:
+ * - Xperia 1 III (sagami pdx215): https://github.com/sonyxperiadev/kernel-copyleft-dts/blob/61.2.A.0.xxx/somc/dsi-panel-ana6707_amb650yl01-uhd-pvt.dtsi
+ * - Xperia 1 IV (nagara pdx223): https://github.com/sonyxperiadev/kernel-copyleft-dts/blob/64.1.A.0.xxx/display-devicetree/display/dsi-panel-ana6707_amb650yl01-uhd-pdx223.dtsi
+ * - Xperia 1 V (yodo pdx234): https://github.com/sonyxperiadev/kernel-copyleft-dts/blob/67.0.A.1.xxx/display-devicetree/display/dsi-panel-ana6707_amb650yl01-uhd.dtsi
+ */
+
+#include <linux/backlight.h>
+#include <linux/delay.h>
+#include <linux/gpio/consumer.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
+#include <linux/of_graph.h>
+#include <linux/regulator/consumer.h>
+
+#include <video/mipi_display.h>
+
+#include <drm/drm_mipi_dsi.h>
+#include <drm/drm_modes.h>
+#include <drm/drm_panel.h>
+#include <drm/drm_probe_helper.h>
+#include <drm/display/drm_dsc.h>
+#include <drm/display/drm_dsc_helper.h>
+
+#define WRITE_CONTROL_DISPLAY_BACKLIGHT BIT(5)
+
+/*
+ * TODO: This should be communicated via the mode when .prepare
+ * receives atomic commit info
+ */
+static const bool enable_4k = false, enable_120hz = true;
+
+const struct regulator_bulk_data samsung_ana6707_supplies[] = {
+	{ .supply = "vddio", /* 1.8 V */ },
+	{ .supply = "vci", /* 3.0 V */ },
+};
+
+struct samsung_ana6707 {
+	struct drm_panel panel;
+	struct mipi_dsi_device *dsi[2];
+	struct drm_dsc_config dsc;
+	struct regulator_bulk_data *supplies;
+	struct gpio_desc *reset_gpio;
+};
+
+static inline struct samsung_ana6707 *
+to_samsung_ana6707(struct drm_panel *panel)
+{
+	return container_of(panel, struct samsung_ana6707, panel);
+}
+
+static void samsung_ana6707_reset(struct samsung_ana6707 *ctx)
+{
+	gpiod_set_value_cansleep(ctx->reset_gpio, 0);
+	usleep_range(5000, 6000);
+	gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+	usleep_range(1000, 2000);
+	gpiod_set_value_cansleep(ctx->reset_gpio, 0);
+	usleep_range(10000, 11000);
+}
+
+static int samsung_ana6707_program(struct samsung_ana6707 *ctx)
+{
+	const u16 hdisplay = enable_4k ? 1644 : 1096;
+	const u16 vdisplay = enable_4k ? 3840 : 2560;
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi[0] };
+
+	ctx->dsi[0]->mode_flags &= ~MIPI_DSI_MODE_LPM;
+	ctx->dsi[1]->mode_flags |= MIPI_DSI_MODE_LPM;
+
+	mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
+	mipi_dsi_msleep(&dsi_ctx, 15);
+
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x16);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xe6, 0x44);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x04);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xbd, 0x00, 0xa0);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xed, 0x46, 0x00, 0x0e, 0x90);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x60,
+				     enable_4k ? 0x00 : 0x04,
+				     enable_120hz ? 0x00 : 0xc0);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+
+	mipi_dsi_dcs_set_column_address_multi(&dsi_ctx, 0, hdisplay - 1);
+	mipi_dsi_dcs_set_page_address_multi(&dsi_ctx, 0, vdisplay - 1);
+	mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
+
+	/*
+	 * Warning: downstream codes this to 3840 only in 1069x2560@60Hz mode, which causes
+	 * tearing and an ugly DSC-corruption-like line at the top of the screen.
+	 * enable_4k | enable_120hz ? 0 : 3840
+	 */
+	mipi_dsi_dcs_set_tear_scanline_multi(&dsi_ctx, 0);
+
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x09);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb9, 0x09, 0x78);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_CONTROL_DISPLAY,
+				     WRITE_CONTROL_DISPLAY_BACKLIGHT);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x0b);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x92, 0x27, 0x25);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xd7, 0x82);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
+	mipi_dsi_msleep(&dsi_ctx, 110);
+
+	return 0;
+}
+
+static int samsung_ana6707_prepare(struct drm_panel *panel)
+{
+	struct samsung_ana6707 *ctx = to_samsung_ana6707(panel);
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi[0] };
+	struct mipi_dsi_device *dsi = ctx->dsi[0];
+	struct device *dev = &dsi->dev;
+	struct drm_dsc_picture_parameter_set pps;
+	int ret;
+
+	ret = regulator_bulk_enable(ARRAY_SIZE(samsung_ana6707_supplies), ctx->supplies);
+	if (ret < 0) {
+		dev_err(dev, "Failed to enable regulators: %d\n", ret);
+		return ret;
+	}
+
+	samsung_ana6707_reset(ctx);
+
+	msleep(120);
+
+	ret = samsung_ana6707_program(ctx);
+	if (ret < 0) {
+		dev_err(dev, "Failed to initialize panel: %d\n", ret);
+		goto fail;
+	}
+
+	msleep(120);
+
+	drm_dsc_pps_payload_pack(&pps, &ctx->dsc);
+
+	mipi_dsi_picture_parameter_set_multi(&dsi_ctx, &pps);
+	mipi_dsi_compression_mode_multi(&dsi_ctx, true);
+	mipi_dsi_msleep(&dsi_ctx, 28);
+
+	ret = dsi_ctx.accum_err;
+
+	if (ret < 0)
+		goto fail;
+
+	return 0;
+
+fail:
+	gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+	regulator_bulk_disable(ARRAY_SIZE(samsung_ana6707_supplies), ctx->supplies);
+	return ret;
+}
+
+static int samsung_ana6707_enable(struct drm_panel *panel)
+{
+	struct samsung_ana6707 *ctx = to_samsung_ana6707(panel);
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi[0] };
+
+	mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
+	mipi_dsi_msleep(&dsi_ctx, 10);
+
+	return dsi_ctx.accum_err;
+}
+
+static int samsung_ana6707_disable(struct drm_panel *panel)
+{
+	struct samsung_ana6707 *ctx = to_samsung_ana6707(panel);
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi[0] };
+
+	mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
+	mipi_dsi_msleep(&dsi_ctx, 20);
+
+	return dsi_ctx.accum_err;
+}
+
+static int samsung_ana6707_unprepare(struct drm_panel *panel)
+{
+	struct samsung_ana6707 *ctx = to_samsung_ana6707(panel);
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi[0] };
+
+	mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
+	mipi_dsi_msleep(&dsi_ctx, 120);
+
+	ctx->dsi[0]->mode_flags &= ~MIPI_DSI_MODE_LPM;
+	ctx->dsi[1]->mode_flags &= ~MIPI_DSI_MODE_LPM;
+
+	gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+	regulator_bulk_disable(ARRAY_SIZE(samsung_ana6707_supplies), ctx->supplies);
+
+	return dsi_ctx.accum_err;
+}
+
+static const int fake_porch_4k = 120;
+
+/*
+ * All of the horizontal values here are x2 of what's specified in the downstream device-tree,
+ * as the information there has already been pre-divided by the number of DSI hosts
+ */
+
+static const struct drm_display_mode samsung_ana6707_mode_4k = {
+	.clock = (1644 + fake_porch_4k) * 3840 * 60 / 1000,
+	.hdisplay = 1644,
+	.hsync_start = 1644,
+	.hsync_end = 1644,
+	.htotal = 1644 + fake_porch_4k,
+	.vdisplay = 3840,
+	.vsync_start = 3840,
+	.vsync_end = 3840,
+	.vtotal = 3840,
+	.width_mm = 65,
+	.height_mm = 152,
+	.type = DRM_MODE_TYPE_DRIVER,
+};
+
+static const int fake_porch_4k_120 = 216;
+
+static const struct drm_display_mode samsung_ana6707_mode_4k_120 = {
+	.clock = (1644 + fake_porch_4k_120) * 3840 * 120 / 1000,
+	.hdisplay = 1644,
+	.hsync_start = 1644,
+	.hsync_end = 1644,
+	.htotal = 1644 + fake_porch_4k_120,
+	.vdisplay = 3840,
+	.vsync_start = 3840,
+	.vsync_end = 3840,
+	.vtotal = 3840,
+	.width_mm = 65,
+	.height_mm = 152,
+	.type = DRM_MODE_TYPE_DRIVER,
+};
+
+static const int fake_porch = 100;
+
+static const struct drm_display_mode samsung_ana6707_mode = {
+	.clock = (1096 + fake_porch) * 2560 * 60 / 1000,
+	.hdisplay = 1096,
+	.hsync_start = 1096,
+	.hsync_end = 1096,
+	.htotal = 1096 + fake_porch,
+	.vdisplay = 2560,
+	.vsync_start = 2560,
+	.vsync_end = 2560,
+	.vtotal = 2560,
+	.width_mm = 65,
+	.height_mm = 152,
+	.type = DRM_MODE_TYPE_DRIVER,
+};
+
+static const int fake_porch_120 = 130;
+
+static const struct drm_display_mode samsung_ana6707_mode_120 = {
+	.clock = (1096 + fake_porch_120) * 2560 * 120 / 1000,
+	.hdisplay = 1096,
+	.hsync_start = 1096,
+	.hsync_end = 1096,
+	.htotal = 1096 + fake_porch_120,
+	.vdisplay = 2560,
+	.vsync_start = 2560,
+	.vsync_end = 2560,
+	.vtotal = 2560,
+	.width_mm = 65,
+	.height_mm = 152,
+	.type = DRM_MODE_TYPE_DRIVER,
+};
+
+static int samsung_ana6707_get_modes(struct drm_panel *panel,
+					struct drm_connector *connector)
+{
+	const struct drm_display_mode *mode;
+
+	/*
+	 * TODO: return all 4 modes when drm_bridge/drm_panel get it back in an
+	 * atomic_prepare callback
+	 */
+	if (enable_4k) {
+		if (enable_120hz)
+			mode = &samsung_ana6707_mode_4k_120;
+		else
+			mode = &samsung_ana6707_mode_4k;
+	} else {
+		if (enable_120hz)
+			mode = &samsung_ana6707_mode_120;
+		else
+			mode = &samsung_ana6707_mode;
+	}
+
+	return drm_connector_helper_get_modes_fixed(connector, mode);
+}
+
+static const struct drm_panel_funcs samsung_ana6707_panel_funcs = {
+	.prepare = samsung_ana6707_prepare,
+	.enable = samsung_ana6707_enable,
+	.disable = samsung_ana6707_disable,
+	.unprepare = samsung_ana6707_unprepare,
+	.get_modes = samsung_ana6707_get_modes,
+};
+
+static int samsung_ana6707_bl_update_status(struct backlight_device *bl)
+{
+	struct mipi_dsi_device *dsi = bl_get_data(bl);
+	u16 brightness = backlight_get_brightness(bl);
+
+	return mipi_dsi_dcs_set_display_brightness_large(dsi, brightness);
+}
+
+static const struct backlight_ops samsung_ana6707_bl_ops = {
+	.update_status = samsung_ana6707_bl_update_status,
+};
+
+static int samsung_ana6707_probe(struct mipi_dsi_device *dsi)
+{
+	const struct backlight_properties props = {
+		.type = BACKLIGHT_RAW,
+		.brightness = 3000,
+		.max_brightness = 4095,
+	};
+	const u16 hdisplay = enable_4k ? 1644 : 1096;
+	struct mipi_dsi_host *dsi_sec_host;
+	struct samsung_ana6707 *ctx;
+	struct device *dev = &dsi->dev;
+	struct device_node *dsi_sec;
+	int ret, i;
+
+	ctx = devm_drm_panel_alloc(dev, struct samsung_ana6707, panel,
+				   &samsung_ana6707_panel_funcs,
+				   DRM_MODE_CONNECTOR_DSI);
+	if (IS_ERR(ctx))
+		return PTR_ERR(ctx);
+
+	ret = devm_regulator_bulk_get_const(
+		dev,
+		ARRAY_SIZE(samsung_ana6707_supplies),
+		samsung_ana6707_supplies,
+		&ctx->supplies);
+	if (ret < 0)
+		return dev_err_probe(dev, ret, "Failed to get regulators\n");
+
+	ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
+	if (IS_ERR(ctx->reset_gpio))
+		return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
+				     "Failed to get reset-gpios\n");
+
+	dsi_sec = of_graph_get_remote_node(dsi->dev.of_node, 1, -1);
+	if (!dsi_sec)
+		return dev_err_probe(dev, -ENODEV,
+				     "Cannot find secondary DSI OF node\n");
+
+	dev_info(dev, "Using Dual-DSI with OF node `%s`\n", dsi_sec->name);
+	const struct mipi_dsi_device_info info = { "ANA6707", 0,
+						   dsi_sec };
+
+
+	dsi_sec_host = of_find_mipi_dsi_host_by_node(dsi_sec);
+	of_node_put(dsi_sec);
+	if (!dsi_sec_host)
+		return dev_err_probe(dev, -EPROBE_DEFER,
+				     "Cannot get secondary DSI host\n");
+
+	ctx->dsi[1] = devm_mipi_dsi_device_register_full(dev, dsi_sec_host, &info);
+	if (IS_ERR(ctx->dsi[1]))
+		return dev_err_probe(dev, PTR_ERR(ctx->dsi[1]),
+				     "Cannot register secondary DSI device\n");
+
+	mipi_dsi_set_drvdata(ctx->dsi[1], ctx);
+
+	ctx->dsi[0] = dsi;
+	mipi_dsi_set_drvdata(dsi, ctx);
+
+	ctx->panel.prepare_prev_first = true;
+
+	ctx->panel.backlight = devm_backlight_device_register(
+		dev, dev_name(dev), dev, dsi,
+		&samsung_ana6707_bl_ops,
+		&props);
+	if (IS_ERR(ctx->panel.backlight))
+		return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight),
+				     "Failed to create backlight\n");
+
+	drm_panel_add(&ctx->panel);
+
+	ctx->dsc.dsc_version_major = 1;
+	ctx->dsc.dsc_version_minor = 1;
+
+	ctx->dsc.slice_height = 32;
+	/* One slice per encoder */
+	ctx->dsc.slice_count = 1;
+	ctx->dsc.slice_width = hdisplay / 2; /* 2 encoders */
+	ctx->dsc.bits_per_component = 8;
+	ctx->dsc.bits_per_pixel = 8 << 4; /* 4 fractional bits */
+	ctx->dsc.block_pred_enable = true;
+
+	for (i = 0; i < ARRAY_SIZE(ctx->dsi); i++) {
+		/* This panel only supports DSC; unconditionally enable it */
+		ctx->dsi[i]->dsc = &ctx->dsc;
+
+		ctx->dsi[i]->lanes = 4;
+		ctx->dsi[i]->format = MIPI_DSI_FMT_RGB888;
+		ctx->dsi[i]->mode_flags = MIPI_DSI_CLOCK_NON_CONTINUOUS;
+
+		ret = devm_mipi_dsi_attach(dev, ctx->dsi[i]);
+		/* TODO: Detach dsi0 if dsi1 failed? */
+		if (ret < 0) {
+			drm_panel_remove(&ctx->panel);
+			return dev_err_probe(dev, ret,
+					     "Failed to attach to DSI%d\n", i);
+		}
+	}
+
+	return 0;
+}
+
+static void samsung_ana6707_remove(struct mipi_dsi_device *dsi)
+{
+	struct samsung_ana6707 *ctx = mipi_dsi_get_drvdata(dsi);
+	int ret, i;
+
+	for (i = 0; i < ARRAY_SIZE(ctx->dsi); i++) {
+		ret = mipi_dsi_detach(ctx->dsi[i]);
+		if (ret < 0)
+			dev_err(&ctx->dsi[i]->dev, "Failed to detach from DSI%d host: %d\n",
+				i, ret);
+	}
+
+	drm_panel_remove(&ctx->panel);
+}
+
+static const struct of_device_id samsung_ana6707_of_match[] = {
+	{ .compatible = "samsung,ana6707-amb650yl01" },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, samsung_ana6707_of_match);
+
+static struct mipi_dsi_driver samsung_ana6707_driver = {
+	.probe = samsung_ana6707_probe,
+	.remove = samsung_ana6707_remove,
+	.driver = {
+		.name = "panel-samsung-ana6707",
+		.of_match_table = samsung_ana6707_of_match,
+	},
+};
+module_mipi_dsi_driver(samsung_ana6707_driver);
+
+MODULE_AUTHOR("Marijn Suijten <marijn.suijten@somainline.org>");
+MODULE_DESCRIPTION("DRM panel driver for Samsung ANA6707 Display-Driver-IC panels");
+MODULE_LICENSE("GPL");

-- 
2.52.0


^ permalink raw reply related	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 06/11] dt-bindings: display: panel: Describe Samsung SOFEF03-M DDIC
  2025-12-21 23:32 ` [PATCH v2 06/11] dt-bindings: display: panel: Describe Samsung SOFEF03-M DDIC Marijn Suijten
@ 2025-12-22  3:51   ` Rob Herring (Arm)
  2025-12-22  8:33   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 43+ messages in thread
From: Rob Herring (Arm) @ 2025-12-22  3:51 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Simona Vetter, AngeloGioacchino Del Regno, Krzysztof Kozlowski,
	linux-kernel, Jessica Zhang, Casey Connolly,
	~postmarketos/upstreaming, Maarten Lankhorst, David Airlie,
	AngeloGioacchino Del Regno, Jami Kettunen, Dmitry Baryshkov,
	Andy Gross, devicetree, Jessica Zhang, linux-arm-msm,
	Neil Armstrong, dri-devel, Martin Botka, Conor Dooley,
	Simona Vetter, Konrad Dybcio, Thomas Zimmermann, Maxime Ripard,
	Rob Herring, Bjorn Andersson, Abhinav Kumar, Sam Ravnborg,
	Krzysztof Kozlowski, Kuogee Hsieh, Konrad Dybcio


On Mon, 22 Dec 2025 00:32:12 +0100, Marijn Suijten wrote:
> Document the Samsung SOFEF03-M Display-Driver-IC and 1080x2520@120Hz DSI
> command-mode panels found in the Sony Xperia 5 II and Sony Xperia 5 III.
> It requires Display Stream Compression 1.1 which allows the panels to be
> driven at 120Hz, even though a 60Hz mode is available too.
> 
> Reviewed-by: Rob Herring <robh@kernel.org>
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
>  .../bindings/display/panel/samsung,sofef03-m.yaml  | 79 ++++++++++++++++++++++
>  MAINTAINERS                                        |  5 ++
>  2 files changed, 84 insertions(+)
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/display/panel/samsung,sofef01-m.example.dtb: panel@0 (samsung,sofef01-m-amb609tc01): 'vci-supply' does not match any of the regexes: '^pinctrl-[0-9]+$'
	from schema $id: http://devicetree.org/schemas/display/panel/samsung,sofef01-m.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.kernel.org/project/devicetree/patch/20251222-drm-panels-sony-v2-6-82a87465d163@somainline.org

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

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

pip3 install dtschema --upgrade

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


^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 08/11] dt-bindings: display: panel: Describe Samsung SOUXP00-A DDIC
  2025-12-21 23:32 ` [PATCH v2 08/11] dt-bindings: display: panel: Describe Samsung SOUXP00-A DDIC Marijn Suijten
@ 2025-12-22  3:51   ` Rob Herring (Arm)
  0 siblings, 0 replies; 43+ messages in thread
From: Rob Herring (Arm) @ 2025-12-22  3:51 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Simona Vetter, dri-devel, Jessica Zhang, Dmitry Baryshkov,
	devicetree, Bjorn Andersson, Neil Armstrong, Jami Kettunen,
	Krzysztof Kozlowski, Conor Dooley, Maxime Ripard,
	~postmarketos/upstreaming, Krzysztof Kozlowski,
	AngeloGioacchino Del Regno, Konrad Dybcio, David Airlie,
	Andy Gross, Rob Herring, Simona Vetter, linux-kernel,
	Jessica Zhang, linux-arm-msm, Konrad Dybcio, Martin Botka,
	Sam Ravnborg, Casey Connolly, Thomas Zimmermann, Abhinav Kumar,
	AngeloGioacchino Del Regno, Kuogee Hsieh, Maarten Lankhorst


On Mon, 22 Dec 2025 00:32:14 +0100, Marijn Suijten wrote:
> Document the Samsung SOUXP00-A Display-Driver-IC and 11644x3840@60Hz
> 6.5" DSI command-mode panels found in the Sony Xperia 1 with amb650wh01
> panel and Sony Xperia 1 II with amb650wh07 panel. It requires Display
> Stream Compression 1.1.
> 
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
>  .../bindings/display/panel/samsung,souxp00-a.yaml  | 79 ++++++++++++++++++++++
>  MAINTAINERS                                        |  5 ++
>  2 files changed, 84 insertions(+)
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/display/panel/samsung,sofef01-m.example.dtb: panel@0 (samsung,sofef01-m-amb609tc01): 'vci-supply' does not match any of the regexes: '^pinctrl-[0-9]+$'
	from schema $id: http://devicetree.org/schemas/display/panel/samsung,sofef01-m.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.kernel.org/project/devicetree/patch/20251222-drm-panels-sony-v2-8-82a87465d163@somainline.org

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

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

pip3 install dtschema --upgrade

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


^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 10/11] dt-bindings: display: panel: Describe Samsung ANA6707 DDIC
  2025-12-21 23:32 ` [PATCH v2 10/11] dt-bindings: display: panel: Describe Samsung ANA6707 DDIC Marijn Suijten
@ 2025-12-22  3:51   ` Rob Herring (Arm)
  0 siblings, 0 replies; 43+ messages in thread
From: Rob Herring (Arm) @ 2025-12-22  3:51 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Konrad Dybcio, Kuogee Hsieh, Andy Gross, Krzysztof Kozlowski,
	Simona Vetter, Dmitry Baryshkov, Jessica Zhang,
	AngeloGioacchino Del Regno, Maxime Ripard, Krzysztof Kozlowski,
	linux-arm-msm, David Airlie, Maarten Lankhorst, Bjorn Andersson,
	Conor Dooley, Abhinav Kumar, Thomas Zimmermann, Martin Botka,
	Jessica Zhang, Casey Connolly, Neil Armstrong,
	~postmarketos/upstreaming, Simona Vetter, linux-kernel,
	devicetree, Jami Kettunen, Konrad Dybcio, Sam Ravnborg,
	AngeloGioacchino Del Regno, dri-devel, Rob Herring


On Mon, 22 Dec 2025 00:32:16 +0100, Marijn Suijten wrote:
> The ANA6707 Display-Driver-IC is paired with the amb650yl01 panel in the
> Sony Xperia 1 III, Sony Xperia 1 IV and Sony Xperia V smartphones.  It
> uses Display Stream Compression 1.1 and requires dual DSI interfaces to
> satisfy the bandwidth requirements to run at 1644x3840 at 120Hz.
> 
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
>  .../bindings/display/panel/samsung,ana6707.yaml    | 91 ++++++++++++++++++++++
>  MAINTAINERS                                        |  5 ++
>  2 files changed, 96 insertions(+)
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/display/panel/samsung,sofef01-m.example.dtb: panel@0 (samsung,sofef01-m-amb609tc01): 'vci-supply' does not match any of the regexes: '^pinctrl-[0-9]+$'
	from schema $id: http://devicetree.org/schemas/display/panel/samsung,sofef01-m.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/display/panel/samsung,ana6707.example.dtb: panel@0 (samsung,ana6707-amb650yl01): 'ports' does not match any of the regexes: '^pinctrl-[0-9]+$'
	from schema $id: http://devicetree.org/schemas/display/panel/samsung,ana6707.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/display/panel/samsung,ana6707.example.dtb: panel@0 (samsung,ana6707-amb650yl01): 'port' is a required property
	from schema $id: http://devicetree.org/schemas/display/panel/samsung,ana6707.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.kernel.org/project/devicetree/patch/20251222-drm-panels-sony-v2-10-82a87465d163@somainline.org

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

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

pip3 install dtschema --upgrade

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


^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 06/11] dt-bindings: display: panel: Describe Samsung SOFEF03-M DDIC
  2025-12-21 23:32 ` [PATCH v2 06/11] dt-bindings: display: panel: Describe Samsung SOFEF03-M DDIC Marijn Suijten
  2025-12-22  3:51   ` Rob Herring (Arm)
@ 2025-12-22  8:33   ` Krzysztof Kozlowski
  2025-12-22  8:36     ` Krzysztof Kozlowski
  2025-12-28 22:31     ` Marijn Suijten
  1 sibling, 2 replies; 43+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-22  8:33 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Jessica Zhang, AngeloGioacchino Del Regno,
	Konrad Dybcio, Konrad Dybcio, Dmitry Baryshkov

On Mon, Dec 22, 2025 at 12:32:12AM +0100, Marijn Suijten wrote:
> Document the Samsung SOFEF03-M Display-Driver-IC and 1080x2520@120Hz DSI
> command-mode panels found in the Sony Xperia 5 II and Sony Xperia 5 III.
> It requires Display Stream Compression 1.1 which allows the panels to be
> driven at 120Hz, even though a 60Hz mode is available too.
> 
> Reviewed-by: Rob Herring <robh@kernel.org>
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>

Your patchset has multiple white space warnings. Apply and see...

> ---
>  .../bindings/display/panel/samsung,sofef03-m.yaml  | 79 ++++++++++++++++++++++
>  MAINTAINERS                                        |  5 ++
>  2 files changed, 84 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/display/panel/samsung,sofef03-m.yaml b/Documentation/devicetree/bindings/display/panel/samsung,sofef03-m.yaml
> new file mode 100644
> index 000000000000..5712eca2773d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/panel/samsung,sofef03-m.yaml
> @@ -0,0 +1,79 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/panel/samsung,sofef03-m.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Samsung SOFEF03-M DDI for 1080x2520@120Hz 6.1" OLED DSI panels
> +
> +maintainers:
> +  - Marijn Suijten <marijn.suijten@somainline.org>
> +
> +description: |
> +  Samsung SOFEF03-M Display-Driver-IC found in the Sony Xperia 5 II (edo pdx206, amb609vp01
> +  panel) and
> +  Sony Xperia 5 III (sagami pdx214, amb609vp04
> +  panel) smartphones.  It is always programmed with Display Stream Compression 1.1 enabled.

Please wrap according to Linux coding style.

> +
> +  The assembly features a Samsung touchscreen compatible with
> +  samsung,s6sy761.
> +
> +allOf:
> +  - $ref: panel-common.yaml#
> +
> +properties:
> +  compatible:
> +    enum:
> +      - samsung,sofef03-m-amb609vp01
> +      - samsung,sofef03-m-amb609vp04
> +
> +  port: true
> +
> +  reg:
> +    maxItems: 1
> +    description: DSI virtual channel
> +
> +  reset-gpios: true
> +
> +  vci-supply:
> +    description: DriverIC Operation supply (3.0V)
> +
> +  vddio-supply:
> +    description: I/O voltage supply (1.8V)
> +
> +required:
> +  - compatible
> +  - port
> +  - reg
> +  - reset-gpios
> +  - vci-supply
> +  - vddio-supply
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +
> +    dsi {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        panel@0 {
> +            compatible = "samsung,sofef03-m-amb609vp01";
> +            reg = <0>;
> +
> +            reset-gpios = <&tlmm 75 GPIO_ACTIVE_LOW>;
> +
> +            vci-supply = <&vreg_l11c_3p0>;
> +            vddio-supply = <&vreg_l14a_1p8>;
> +
> +            port {

Not tested :/


Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 06/11] dt-bindings: display: panel: Describe Samsung SOFEF03-M DDIC
  2025-12-22  8:33   ` Krzysztof Kozlowski
@ 2025-12-22  8:36     ` Krzysztof Kozlowski
  2025-12-28 22:49       ` Marijn Suijten
  2025-12-28 22:31     ` Marijn Suijten
  1 sibling, 1 reply; 43+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-22  8:36 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Jessica Zhang, AngeloGioacchino Del Regno,
	Konrad Dybcio, Konrad Dybcio, Dmitry Baryshkov

On 22/12/2025 09:33, Krzysztof Kozlowski wrote:
>> +  - |
>> +    #include <dt-bindings/gpio/gpio.h>
>> +
>> +    dsi {
>> +        #address-cells = <1>;
>> +        #size-cells = <0>;
>> +        panel@0 {
>> +            compatible = "samsung,sofef03-m-amb609vp01";
>> +            reg = <0>;
>> +
>> +            reset-gpios = <&tlmm 75 GPIO_ACTIVE_LOW>;
>> +
>> +            vci-supply = <&vreg_l11c_3p0>;
>> +            vddio-supply = <&vreg_l14a_1p8>;
>> +
>> +            port {
> 
> Not tested :/

Ah no, this one is correct. It's the other patch with similar compatible
which was not tested.

Actually two others were not tested. We are not a testing service - it
is your task.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 03/11] drm/panel: Add LGD LH599QH3-EDB1 panel driver for Sony Xperia XZ3
  2025-12-21 23:32 ` [PATCH v2 03/11] drm/panel: Add LGD LH599QH3-EDB1 panel driver for Sony Xperia XZ3 Marijn Suijten
@ 2025-12-24  1:12   ` Dmitry Baryshkov
  2025-12-26 13:12   ` Linus Walleij
  1 sibling, 0 replies; 43+ messages in thread
From: Dmitry Baryshkov @ 2025-12-24  1:12 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Jessica Zhang, AngeloGioacchino Del Regno,
	Konrad Dybcio, Konrad Dybcio, Dmitry Baryshkov

On Mon, Dec 22, 2025 at 12:32:09AM +0100, Marijn Suijten wrote:
> Sony provides an LGD LH599QH3-EDB1 panel + Atmel maXTouch assembly in
> its Xperia XZ3 (tama akatsuki) phone, with custom DCS commands to match.
> 
> The panel is 1440x2880 pixels and runs at 60Hz.  It requires Display
> Stream Compression 1.1 to be driven at that mode.
> 
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
>  MAINTAINERS                                     |   1 +
>  drivers/gpu/drm/panel/Kconfig                   |  16 ++
>  drivers/gpu/drm/panel/Makefile                  |   1 +
>  drivers/gpu/drm/panel/panel-lgd-lh599qh3-edb1.c | 340 ++++++++++++++++++++++++
>  4 files changed, 358 insertions(+)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 05/11] drm/panel: Add panel driver for Samsung SOFEF01 DDIC
  2025-12-21 23:32 ` [PATCH v2 05/11] drm/panel: Add panel driver for Samsung SOFEF01 DDIC Marijn Suijten
@ 2025-12-24  1:12   ` Dmitry Baryshkov
  2025-12-24 16:13   ` kernel test robot
  2025-12-26 13:21   ` Linus Walleij
  2 siblings, 0 replies; 43+ messages in thread
From: Dmitry Baryshkov @ 2025-12-24  1:12 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Jessica Zhang, AngeloGioacchino Del Regno,
	Konrad Dybcio, Konrad Dybcio, Dmitry Baryshkov

On Mon, Dec 22, 2025 at 12:32:11AM +0100, Marijn Suijten wrote:
> This Samsung SOFEF01-M Display-Driver-IC is used to drive 1080x2520@60Hz
> command-mode DSI panels found in many Sony phones:
> - Sony Xperia 5 (kumano bahamut): amb609tc01
> - Sony Xperia 10 II (seine pdx201): ams597ut01
> - Sony Xperia 10 III (lena pdx213): ams597ut04
> - Sony Xperia 10 IV (murray pdx225): ams597ut05
> - Sony Xperia 10 V (zambezi pdx235): ams605dk01
> - Sony Xperia 10 VI (columbia pdx246): ams605dk01
> 
> The amb609tc01 and ams605dk01 come in slightly larger at 6.1" while the
> others are 6.0".
> 
> A "fake" porch calculation is included to artificially bump the clock
> rate necessary to account for "transfer overhead" (DSI packet headers)
> since this is missing from the MSM DSI host driver; porches aren't
> otherwise used on command-mode panels.
> 
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
>  MAINTAINERS                                   |   1 +
>  drivers/gpu/drm/panel/Kconfig                 |  18 +
>  drivers/gpu/drm/panel/Makefile                |   1 +
>  drivers/gpu/drm/panel/panel-samsung-sofef01.c | 463 ++++++++++++++++++++++++++
>  4 files changed, 483 insertions(+)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 07/11] drm/panel: Add panel driver for Samsung SOFEF03-M DDIC
  2025-12-21 23:32 ` [PATCH v2 07/11] drm/panel: Add panel driver for " Marijn Suijten
@ 2025-12-24  1:15   ` Dmitry Baryshkov
  2025-12-24  9:43   ` Marijn Suijten
  1 sibling, 0 replies; 43+ messages in thread
From: Dmitry Baryshkov @ 2025-12-24  1:15 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Jessica Zhang, AngeloGioacchino Del Regno,
	Konrad Dybcio, Konrad Dybcio, Dmitry Baryshkov

On Mon, Dec 22, 2025 at 12:32:13AM +0100, Marijn Suijten wrote:
> The SOFEF03-M Display-Driver-IC is paired with a amb609vp01 panel on
> the Sony Xperia 5 II and amb609vp04 panel on the Sony Xperia 5 III. It
> requires Display Stream Compression 1.1 which allows the panels to run
> at 120Hz, even though a 60Hz mode is available too.
> 
> Downstream porch values are retained; despite not being used in
> command-mode they are useful to artificially bump the clock values to
> account for "transfer overhead" while that calculation is still missing
> from the MSM DSI host driver.
> 
> Co-developed-by: Konrad Dybcio <konrad.dybcio@somainline.org>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
>  MAINTAINERS                                   |   1 +
>  drivers/gpu/drm/panel/Kconfig                 |  16 ++
>  drivers/gpu/drm/panel/Makefile                |   1 +
>  drivers/gpu/drm/panel/panel-samsung-sofef03.c | 373 ++++++++++++++++++++++++++
>  4 files changed, 391 insertions(+)
> 
> + * Based on the following Sony downstream DTS command sequences:
> + * - Xperia 5 II (edo pdx206): https://github.com/sonyxperiadev/kernel-copyleft-dts/blob/58.2.A.10.xxx/somc/dsi-panel-sofef03_m-fhd_plus.dtsi
> + *  - Xperia 5 III (sagami pdx214): https://github.com/sonyxperiadev/kernel-copyleft-dts/blob/61.2.A.0.xxx/somc/dsi-panel-sofef03_m-amb609vp01-fhd_plus.dtsi

Nit: please align.

> + */
> +

With that fixed:


Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>



-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 09/11] drm/panel: Add panel driver for Samsung SOUXP00-A DDIC
  2025-12-21 23:32 ` [PATCH v2 09/11] drm/panel: Add panel driver for " Marijn Suijten
@ 2025-12-24  1:15   ` Dmitry Baryshkov
  2025-12-24 17:26   ` kernel test robot
  1 sibling, 0 replies; 43+ messages in thread
From: Dmitry Baryshkov @ 2025-12-24  1:15 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Jessica Zhang, AngeloGioacchino Del Regno,
	Konrad Dybcio, Konrad Dybcio, Dmitry Baryshkov

On Mon, Dec 22, 2025 at 12:32:15AM +0100, Marijn Suijten wrote:
> The Samsung SOUXP00-A Display-Driver-IC is used to drive 11644x3840@60Hz
> 6.5" DSI command-mode panels found in the Sony Xperia 1 with amb650wh01
> panel and Sony Xperia 1 II with amb650wh07 panel.  It requires Display
> Stream Compression 1.1.  The panels can also be driven at a 1096x2560@60
> mode.
> 
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
>  MAINTAINERS                                   |   1 +
>  drivers/gpu/drm/panel/Kconfig                 |  16 ++
>  drivers/gpu/drm/panel/Makefile                |   1 +
>  drivers/gpu/drm/panel/panel-samsung-souxp00.c | 399 ++++++++++++++++++++++++++
>  4 files changed, 417 insertions(+)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 11/11] drm/panel: Add panel driver for Samsung ANA6707 DDIC
  2025-12-21 23:32 ` [PATCH v2 11/11] drm/panel: Add panel driver for " Marijn Suijten
@ 2025-12-24  1:16   ` Dmitry Baryshkov
  0 siblings, 0 replies; 43+ messages in thread
From: Dmitry Baryshkov @ 2025-12-24  1:16 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Jessica Zhang, AngeloGioacchino Del Regno,
	Konrad Dybcio, Konrad Dybcio, Dmitry Baryshkov

On Mon, Dec 22, 2025 at 12:32:17AM +0100, Marijn Suijten wrote:
> The ANA6707 Display-Driver-IC is paired with the amb650yl01 panel in the
> Sony Xperia 1 III, Sony Xperia 1 IV and Sony Xperia V smartphones.  It
> uses Display Stream Compression 1.1 and requires dual DSI interfaces to
> satisfy the bandwidth requirements to run at 1644x3840 at 120Hz.
> 
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
>  MAINTAINERS                                   |   1 +
>  drivers/gpu/drm/panel/Kconfig                 |  16 +
>  drivers/gpu/drm/panel/Makefile                |   1 +
>  drivers/gpu/drm/panel/panel-samsung-ana6707.c | 461 ++++++++++++++++++++++++++
>  4 files changed, 479 insertions(+)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 07/11] drm/panel: Add panel driver for Samsung SOFEF03-M DDIC
  2025-12-21 23:32 ` [PATCH v2 07/11] drm/panel: Add panel driver for " Marijn Suijten
  2025-12-24  1:15   ` Dmitry Baryshkov
@ 2025-12-24  9:43   ` Marijn Suijten
  1 sibling, 0 replies; 43+ messages in thread
From: Marijn Suijten @ 2025-12-24  9:43 UTC (permalink / raw)
  To: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Martin Botka, Jami Kettunen, dri-devel, linux-kernel, devicetree,
	linux-arm-msm, Abhinav Kumar, Kuogee Hsieh, Jessica Zhang,
	AngeloGioacchino Del Regno, Konrad Dybcio, Konrad Dybcio,
	Dmitry Baryshkov

On 2025-12-22 00:32:13, Marijn Suijten wrote:
...
> +static int samsung_sofef03_m_probe(struct mipi_dsi_device *dsi)
> +{
...
> +	ctx->vddio = devm_regulator_get(dev, "vddio");
> +	if (IS_ERR(ctx->vddio))
> +		return dev_err_probe(dev, PTR_ERR(ctx->vddio),
> +				     "Failed to get vddio regulator\n");
> +
> +	ctx->vci = devm_regulator_get(dev, "vci");
> +	if (IS_ERR(ctx->vci))
> +		return dev_err_probe(dev, PTR_ERR(ctx->vci),
> +				     "Failed to get vci regulator\n");
> +
 
In case someone wonders why this is inconsistently *NOT* using regulator_bulk
while the other patches are; this was a last-minute clean-up whose fixup! commit
I seem to have lost in a separate branch.  This will be incorporated in v3
together with the whitespace fix in the comment.

- Marijn

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 05/11] drm/panel: Add panel driver for Samsung SOFEF01 DDIC
  2025-12-21 23:32 ` [PATCH v2 05/11] drm/panel: Add panel driver for Samsung SOFEF01 DDIC Marijn Suijten
  2025-12-24  1:12   ` Dmitry Baryshkov
@ 2025-12-24 16:13   ` kernel test robot
  2025-12-26 13:21   ` Linus Walleij
  2 siblings, 0 replies; 43+ messages in thread
From: kernel test robot @ 2025-12-24 16:13 UTC (permalink / raw)
  To: Marijn Suijten, Neil Armstrong, Sam Ravnborg, David Airlie,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andy Gross,
	Bjorn Andersson, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly
  Cc: llvm, oe-kbuild-all, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Konrad Dybcio, Marijn Suijten, Dmitry Baryshkov

Hi Marijn,

kernel test robot noticed the following build warnings:

[auto build test WARNING on cc3aa43b44bdb43dfbac0fcb51c56594a11338a8]

url:    https://github.com/intel-lab-lkp/linux/commits/Marijn-Suijten/drm-panel-Clean-up-SOFEF00-config-dependencies/20251222-073548
base:   cc3aa43b44bdb43dfbac0fcb51c56594a11338a8
patch link:    https://lore.kernel.org/r/20251222-drm-panels-sony-v2-5-82a87465d163%40somainline.org
patch subject: [PATCH v2 05/11] drm/panel: Add panel driver for Samsung SOFEF01 DDIC
config: riscv-allyesconfig (https://download.01.org/0day-ci/archive/20251224/202512242356.EwESE8Qv-lkp@intel.com/config)
compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251224/202512242356.EwESE8Qv-lkp@intel.com/reproduce)

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

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/panel/panel-samsung-sofef01.c:389:20: warning: cast to smaller integer type 'enum panel_type' from 'const void *' [-Wvoid-pointer-to-enum-cast]
           ctx->panel_type = (enum panel_type)of_device_get_match_data(dev);
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +389 drivers/gpu/drm/panel/panel-samsung-sofef01.c

   357	
   358	static int samsung_sofef01_m_probe(struct mipi_dsi_device *dsi)
   359	{
   360		const struct backlight_properties props = {
   361			.type = BACKLIGHT_RAW,
   362			.brightness = 100,
   363			.max_brightness = 1023,
   364		};
   365		struct device *dev = &dsi->dev;
   366		struct samsung_sofef01_m *ctx;
   367		int ret;
   368	
   369		ctx = devm_drm_panel_alloc(dev, struct samsung_sofef01_m, panel,
   370					   &samsung_sofef01_m_panel_funcs,
   371					   DRM_MODE_CONNECTOR_DSI);
   372		if (IS_ERR(ctx))
   373			return PTR_ERR(ctx);
   374	
   375		ret = devm_regulator_bulk_get_const(
   376			dev,
   377			ARRAY_SIZE(samsung_sofef01_m_supplies),
   378			samsung_sofef01_m_supplies,
   379			&ctx->supplies);
   380		if (ret < 0)
   381			return dev_err_probe(dev, ret, "Failed to get regulators\n");
   382	
   383		ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
   384		if (IS_ERR(ctx->reset_gpio))
   385			return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
   386					     "Failed to get reset-gpios\n");
   387	
   388		ctx->dsi = dsi;
 > 389		ctx->panel_type = (enum panel_type)of_device_get_match_data(dev);
   390		if (ctx->panel_type == PANEL_TYPE_TC01)
   391			ctx->mode = &samsung_sofef01_m_61_142_mode;
   392		else if (ctx->panel_type == PANEL_TYPE_DK01)
   393			ctx->mode = &samsung_sofef01_m_61_141_mode;
   394		else
   395			ctx->mode = &samsung_sofef01_m_60_139_mode;
   396		mipi_dsi_set_drvdata(dsi, ctx);
   397	
   398		dsi->lanes = 4;
   399		dsi->format = MIPI_DSI_FMT_RGB888;
   400		dsi->mode_flags = MIPI_DSI_CLOCK_NON_CONTINUOUS;
   401	
   402		ctx->panel.prepare_prev_first = true;
   403	
   404		ctx->panel.backlight = devm_backlight_device_register(
   405			dev, dev_name(dev), dev, dsi,
   406			&samsung_sofef01_m_bl_ops,
   407			&props);
   408		if (IS_ERR(ctx->panel.backlight))
   409			return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight),
   410					     "Failed to create backlight\n");
   411	
   412		drm_panel_add(&ctx->panel);
   413	
   414		ret = mipi_dsi_attach(dsi);
   415		if (ret < 0) {
   416			dev_err(dev, "Failed to attach to DSI host: %d\n", ret);
   417			drm_panel_remove(&ctx->panel);
   418			return ret;
   419		}
   420	
   421		return 0;
   422	}
   423	

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

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 09/11] drm/panel: Add panel driver for Samsung SOUXP00-A DDIC
  2025-12-21 23:32 ` [PATCH v2 09/11] drm/panel: Add panel driver for " Marijn Suijten
  2025-12-24  1:15   ` Dmitry Baryshkov
@ 2025-12-24 17:26   ` kernel test robot
  1 sibling, 0 replies; 43+ messages in thread
From: kernel test robot @ 2025-12-24 17:26 UTC (permalink / raw)
  To: Marijn Suijten, Neil Armstrong, Sam Ravnborg, David Airlie,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andy Gross,
	Bjorn Andersson, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly
  Cc: llvm, oe-kbuild-all, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Konrad Dybcio, Marijn Suijten, Dmitry Baryshkov

Hi Marijn,

kernel test robot noticed the following build warnings:

[auto build test WARNING on cc3aa43b44bdb43dfbac0fcb51c56594a11338a8]

url:    https://github.com/intel-lab-lkp/linux/commits/Marijn-Suijten/drm-panel-Clean-up-SOFEF00-config-dependencies/20251222-073548
base:   cc3aa43b44bdb43dfbac0fcb51c56594a11338a8
patch link:    https://lore.kernel.org/r/20251222-drm-panels-sony-v2-9-82a87465d163%40somainline.org
patch subject: [PATCH v2 09/11] drm/panel: Add panel driver for Samsung SOUXP00-A DDIC
config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20251225/202512250101.ljTix9QV-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251225/202512250101.ljTix9QV-lkp@intel.com/reproduce)

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

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/panel/panel-samsung-souxp00.c:304:20: warning: cast to smaller integer type 'enum panel_type' from 'const void *' [-Wvoid-pointer-to-enum-cast]
     304 |         ctx->panel_type = (enum panel_type)of_device_get_match_data(dev);
         |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +304 drivers/gpu/drm/panel/panel-samsung-souxp00.c

   285	
   286	static int samsung_souxp00_a_probe(struct mipi_dsi_device *dsi)
   287	{
   288		const struct backlight_properties props = {
   289			.type = BACKLIGHT_RAW,
   290			.brightness = 400,
   291			.max_brightness = 4095,
   292		};
   293		const u16 hdisplay = enable_4k ? 1644 : 1096;
   294		struct device *dev = &dsi->dev;
   295		struct samsung_souxp00_a *ctx;
   296		int ret;
   297	
   298		ctx = devm_drm_panel_alloc(dev, struct samsung_souxp00_a, panel,
   299					   &samsung_souxp00_a_panel_funcs,
   300					   DRM_MODE_CONNECTOR_DSI);
   301		if (IS_ERR(ctx))
   302			return PTR_ERR(ctx);
   303	
 > 304		ctx->panel_type = (enum panel_type)of_device_get_match_data(dev);
   305	
   306		ret = devm_regulator_bulk_get_const(
   307			dev,
   308			ARRAY_SIZE(samsung_souxp00_a_supplies),
   309			samsung_souxp00_a_supplies,
   310			&ctx->supplies);
   311		if (ret < 0)
   312			return dev_err_probe(dev, ret, "Failed to get regulators\n");
   313	
   314		ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
   315		if (IS_ERR(ctx->reset_gpio))
   316			return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
   317					     "Failed to get reset-gpios\n");
   318	
   319		ctx->dsi = dsi;
   320		mipi_dsi_set_drvdata(dsi, ctx);
   321	
   322		dsi->lanes = 4;
   323		dsi->format = MIPI_DSI_FMT_RGB888;
   324		dsi->mode_flags = MIPI_DSI_CLOCK_NON_CONTINUOUS;
   325	
   326		ctx->panel.prepare_prev_first = true;
   327	
   328		ctx->panel.backlight = devm_backlight_device_register(
   329			dev, dev_name(dev), dev, dsi,
   330			&samsung_souxp00_a_bl_ops,
   331			&props);
   332		if (IS_ERR(ctx->panel.backlight))
   333			return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight),
   334					     "Failed to create backlight\n");
   335	
   336		drm_panel_add(&ctx->panel);
   337	
   338		/* This panel only supports DSC; unconditionally enable it */
   339		dsi->dsc = &ctx->dsc;
   340	
   341		ctx->dsc.dsc_version_major = 1;
   342		ctx->dsc.dsc_version_minor = 1;
   343	
   344		ctx->dsc.slice_height = 32;
   345		ctx->dsc.slice_count = 2;
   346		/*
   347		 * hdisplay should be read from the selected mode once
   348		 * it is passed back to drm_panel (in prepare?)
   349		 */
   350		WARN_ON(hdisplay % ctx->dsc.slice_count);
   351		ctx->dsc.slice_width = hdisplay / ctx->dsc.slice_count;
   352		ctx->dsc.bits_per_component = 8;
   353		ctx->dsc.bits_per_pixel = 8 << 4; /* 4 fractional bits */
   354		ctx->dsc.block_pred_enable = true;
   355	
   356		ret = mipi_dsi_attach(dsi);
   357		if (ret < 0) {
   358			dev_err(dev, "Failed to attach to DSI host: %d\n", ret);
   359			drm_panel_remove(&ctx->panel);
   360			return ret;
   361		}
   362	
   363		return 0;
   364	}
   365	

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

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 03/11] drm/panel: Add LGD LH599QH3-EDB1 panel driver for Sony Xperia XZ3
  2025-12-21 23:32 ` [PATCH v2 03/11] drm/panel: Add LGD LH599QH3-EDB1 panel driver for Sony Xperia XZ3 Marijn Suijten
  2025-12-24  1:12   ` Dmitry Baryshkov
@ 2025-12-26 13:12   ` Linus Walleij
  2025-12-29 11:21     ` Marijn Suijten
  1 sibling, 1 reply; 43+ messages in thread
From: Linus Walleij @ 2025-12-26 13:12 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Jessica Zhang, AngeloGioacchino Del Regno,
	Konrad Dybcio, Konrad Dybcio, Dmitry Baryshkov

Hi Marijn,

thanks for your patch!

overall this looks very nice.

When adding new panels it's nice if we can figure out which display controller
it is actually using, because that makes it possible to share a driver between
multiple displays using a per-display-controller driver.

But this one beats me, so keep it as-is... no idea what display controller
(DDIC) this is.

On Mon, Dec 22, 2025 at 12:32 AM Marijn Suijten
<marijn.suijten@somainline.org> wrote:
>
> Sony provides an LGD LH599QH3-EDB1 panel + Atmel maXTouch assembly in
> its Xperia XZ3 (tama akatsuki) phone, with custom DCS commands to match.
>
> The panel is 1440x2880 pixels and runs at 60Hz.  It requires Display
> Stream Compression 1.1 to be driven at that mode.
>
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>

(...)
> +config DRM_PANEL_LGD_LH599QH3_EDB1
> +       tristate "LGD LH599QH3-EDB1 DSI cmd mode panel"
> +       depends on GPIOLIB
> +       depends on OF
> +       depends on DRM_MIPI_DSI
> +       depends on BACKLIGHT_CLASS_DEVICE
> +       select DRM_DISPLAY_DSC_HELPER
> +       select DRM_DISPLAY_HELPER

Nice use of helpers!

> +static int lgd_lh599qh3_edb1_program(struct lgd_lh599qh3_edb1 *ctx)
> +{
> +       struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
> +
> +       dsi_ctx.dsi->mode_flags |= MIPI_DSI_MODE_LPM;
> +
> +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x7f, 0x5a, 0x5a);
> +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
> +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf1, 0x5a, 0x5a);
> +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf2, 0x5a, 0x5a);

Clearly an "unlock" sequence.

> +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x02, 0x01);
> +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x59, 0x01);
> +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_CONTROL_DISPLAY,
> +                                    WRITE_CONTROL_DISPLAY_BACKLIGHT);
> +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x57, 0x20, 0x80, 0xde, 0x60, 0x00);
> +       mipi_dsi_dcs_set_column_address_multi(&dsi_ctx, 0, 1440 - 1);
> +       mipi_dsi_dcs_set_page_address_multi(&dsi_ctx, 0, 2880 - 1);
> +
> +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_POWER_SAVE, 0x00);
> +
> +       mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
> +
> +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x7f, 0x5a, 0x5a);
> +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
> +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf1, 0x5a, 0x5a);
> +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf2, 0x5a, 0x5a);

Cleary another copy of the "unlock" sequence.

Can you break it out to a subroutine?
lgd_lh599qh3_edb1_unlock()?

+/- this nitpick:
Reviewed-by: Linus Walleij <linusw@kernel.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 05/11] drm/panel: Add panel driver for Samsung SOFEF01 DDIC
  2025-12-21 23:32 ` [PATCH v2 05/11] drm/panel: Add panel driver for Samsung SOFEF01 DDIC Marijn Suijten
  2025-12-24  1:12   ` Dmitry Baryshkov
  2025-12-24 16:13   ` kernel test robot
@ 2025-12-26 13:21   ` Linus Walleij
  2025-12-26 14:16     ` Marijn Suijten
  2 siblings, 1 reply; 43+ messages in thread
From: Linus Walleij @ 2025-12-26 13:21 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Jessica Zhang, AngeloGioacchino Del Regno,
	Konrad Dybcio, Konrad Dybcio, Dmitry Baryshkov

Hi Marijn,

thanks for your patch!

On Mon, Dec 22, 2025 at 12:32 AM Marijn Suijten
<marijn.suijten@somainline.org> wrote:

> This Samsung SOFEF01-M Display-Driver-IC is used to drive 1080x2520@60Hz
> command-mode DSI panels found in many Sony phones:
> - Sony Xperia 5 (kumano bahamut): amb609tc01
> - Sony Xperia 10 II (seine pdx201): ams597ut01
> - Sony Xperia 10 III (lena pdx213): ams597ut04
> - Sony Xperia 10 IV (murray pdx225): ams597ut05
> - Sony Xperia 10 V (zambezi pdx235): ams605dk01
> - Sony Xperia 10 VI (columbia pdx246): ams605dk01
>
> The amb609tc01 and ams605dk01 come in slightly larger at 6.1" while the
> others are 6.0".
>
> A "fake" porch calculation is included to artificially bump the clock
> rate necessary to account for "transfer overhead" (DSI packet headers)
> since this is missing from the MSM DSI host driver; porches aren't
> otherwise used on command-mode panels.
>
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>

Excellent work with abstracting all the sofef01-m panels!

Only nitpicks follow:

> +       if (ctx->panel_type == PANEL_TYPE_TC01 ||
> +           ctx->panel_type == PANEL_TYPE_UT01 ||
> +           ctx->panel_type == PANEL_TYPE_UT04) {
> +               mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);

The sofef00 driver tell us exactly what this sequence is:

#define sofef00_test_key_on_lvl2(ctx) \
        mipi_dsi_dcs_write_seq_multi(ctx, 0xf0, 0x5a, 0x5a)
#define sofef00_test_key_off_lvl2(ctx) \
        mipi_dsi_dcs_write_seq_multi(ctx, 0xf0, 0xa5, 0xa5)

I would just rename these two to sofef01_test_key_on/off_lvl2()
and use the same helpers in this driver to follow the sofef00 pattern.

> +       if (ctx->panel_type == PANEL_TYPE_UT04) {
> +               mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);

Like here

> +               mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xfc, 0x5a, 0x5a);
> +               mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xE1, 0x00, 0x00, 0x02, 0x00, 0x1C, 0x1C,
> +                                            0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0x19);
> +               mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xfc, 0xa5, 0xa5);
> +               mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);

And here.

> +       if (ctx->panel_type == PANEL_TYPE_UT05 || ctx->panel_type == PANEL_TYPE_DK01) {
> +               mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);

And here.

> +               mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x27, 0xf2);
> +               mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf2, 0x80);
> +               mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf7, 0x07);
> +               mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);

And here.

> +               mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);

And here.

> +               /* Downstream: ERR_FG Enable */
> +               mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xe5, 0x15);
> +               if (ctx->panel_type == PANEL_TYPE_DK01)
> +                       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xed, 0x0f, 0x4c, 0x20);
> +               else
> +                       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xed, 0x04, 0x4c, 0x20);
> +               mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);

And here.

> +
> +               mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);

And here.

> +               mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x02, 0x8f);
> +
> +               if (ctx->panel_type == PANEL_TYPE_DK01)
> +                       /* Downstream Xperia 10 V: FLM1,FLM2 On */
> +                       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x8f, 0x27, 0x25);
> +               else if (0) /* TODO: Both use the DK01 panel */
> +                       /* Downstream Xperia 10 VI: FLM1 On, FLM2 On */
> +                       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x8f, 0x27, 0x27);
> +               else
> +                       /* Downsteam: FLM1 on, FLM2 off */
> +                       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x8f, 0x27, 0x05);
> +
> +               mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);

And here.
(etc).

+/- these changes:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 04/11] dt-bindings: display: panel: Describe Samsung SOFEF01-M DDIC
  2025-12-21 23:32 ` [PATCH v2 04/11] dt-bindings: display: panel: Describe Samsung SOFEF01-M DDIC Marijn Suijten
@ 2025-12-26 13:25   ` Linus Walleij
  2025-12-26 13:48     ` Marijn Suijten
  2025-12-30  1:51   ` Rob Herring
  1 sibling, 1 reply; 43+ messages in thread
From: Linus Walleij @ 2025-12-26 13:25 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Jessica Zhang, AngeloGioacchino Del Regno,
	Konrad Dybcio, Konrad Dybcio, Dmitry Baryshkov

Hi Marijn,

thanks for your patch!

On Mon, Dec 22, 2025 at 12:32 AM Marijn Suijten
<marijn.suijten@somainline.org> wrote:

> Document the Samsung SOFEF01-M Display-Driver-IC and 1080x2520@60Hz
> command-mode DSI panels found in many Sony phones:
> - Sony Xperia 5 (kumano bahamut): amb609tc01
> - Sony Xperia 10 II (seine pdx201): ams597ut01
> - Sony Xperia 10 III (lena pdx213): ams597ut04
> - Sony Xperia 10 IV (murray pdx225): ams597ut05
> - Sony Xperia 10 V (zambezi pdx235): ams605dk01
> - Sony Xperia 10 VI (columbia pdx246): ams605dk01
>
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
(...)
> +      - samsung,sofef01-m-amb609tc01 # 6.1"
> +      - samsung,sofef01-m-ams597ut01 # 6.0"
> +      - samsung,sofef01-m-ams597ut04 # 6.0"
> +      - samsung,sofef01-m-ams597ut05 # 6.0"
> +      - samsung,sofef01-m-ams605dk01 # 6.1"

So is the assembled product really named like that?

Samsung S0FEF01-M AMS605DK01?

I would more expect the compatible strings to be excluding the DDIC
name, like:

samsung,ams605dk01

...but it's not like the vendor is helping us here, so I'm practically
fine either way. They are clearly using the S0FEF01-M display
controller.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 04/11] dt-bindings: display: panel: Describe Samsung SOFEF01-M DDIC
  2025-12-26 13:25   ` Linus Walleij
@ 2025-12-26 13:48     ` Marijn Suijten
  2025-12-26 17:38       ` Linus Walleij
  0 siblings, 1 reply; 43+ messages in thread
From: Marijn Suijten @ 2025-12-26 13:48 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Jessica Zhang, AngeloGioacchino Del Regno,
	Konrad Dybcio, Konrad Dybcio, Dmitry Baryshkov

On 2025-12-26 14:25:04, Linus Walleij wrote:
> Hi Marijn,
> 
> thanks for your patch!
> 
> On Mon, Dec 22, 2025 at 12:32 AM Marijn Suijten
> <marijn.suijten@somainline.org> wrote:
> 
> > Document the Samsung SOFEF01-M Display-Driver-IC and 1080x2520@60Hz
> > command-mode DSI panels found in many Sony phones:
> > - Sony Xperia 5 (kumano bahamut): amb609tc01
> > - Sony Xperia 10 II (seine pdx201): ams597ut01
> > - Sony Xperia 10 III (lena pdx213): ams597ut04
> > - Sony Xperia 10 IV (murray pdx225): ams597ut05
> > - Sony Xperia 10 V (zambezi pdx235): ams605dk01
> > - Sony Xperia 10 VI (columbia pdx246): ams605dk01
> >
> > Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> (...)
> > +      - samsung,sofef01-m-amb609tc01 # 6.1"
> > +      - samsung,sofef01-m-ams597ut01 # 6.0"
> > +      - samsung,sofef01-m-ams597ut04 # 6.0"
> > +      - samsung,sofef01-m-ams597ut05 # 6.0"
> > +      - samsung,sofef01-m-ams605dk01 # 6.1"
> 
> So is the assembled product really named like that?
> 
> Samsung S0FEF01-M AMS605DK01?
> 
> I would more expect the compatible strings to be excluding the DDIC
> name, like:
> 
> samsung,ams605dk01
> 
> ...but it's not like the vendor is helping us here, so I'm practically
> fine either way.

Unfortunately I'm not that familiar with display manufacturers and panel
assemblies.  Most of the what I presume to be panel names were gleaned from
online screen replacement photos; those don't ever include the DDIC name.  Those
mostly come from the DTS though isn't mentioned exactly for every phone (only
the first two in the DTS name).

> They are clearly using the S0FEF01-M display controller.

So you're implying or certain that these panel names here are always bundled
with exactly the same controller (making the SOFEF01 part "redundant" in the
compatible)?

Also, divergence of the driver commands got significant with the last two panels
/ three phones, though that might be down to vendor configuration/calibration.

- Marijn

> Yours,
> Linus Walleij

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 05/11] drm/panel: Add panel driver for Samsung SOFEF01 DDIC
  2025-12-26 13:21   ` Linus Walleij
@ 2025-12-26 14:16     ` Marijn Suijten
  2025-12-26 14:23       ` Marijn Suijten
  2025-12-26 17:43       ` Linus Walleij
  0 siblings, 2 replies; 43+ messages in thread
From: Marijn Suijten @ 2025-12-26 14:16 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Jessica Zhang, AngeloGioacchino Del Regno,
	Konrad Dybcio, Konrad Dybcio, Dmitry Baryshkov

On 2025-12-26 14:21:37, Linus Walleij wrote:
...
> Only nitpicks follow:
> 
> > +       if (ctx->panel_type == PANEL_TYPE_TC01 ||
> > +           ctx->panel_type == PANEL_TYPE_UT01 ||
> > +           ctx->panel_type == PANEL_TYPE_UT04) {
> > +               mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
> 
> The sofef00 driver tell us exactly what this sequence is:
> 
> #define sofef00_test_key_on_lvl2(ctx) \
>         mipi_dsi_dcs_write_seq_multi(ctx, 0xf0, 0x5a, 0x5a)
> #define sofef00_test_key_off_lvl2(ctx) \
>         mipi_dsi_dcs_write_seq_multi(ctx, 0xf0, 0xa5, 0xa5)
> 
> I would just rename these two to sofef01_test_key_on/off_lvl2()
> and use the same helpers in this driver to follow the sofef00 pattern.

Right, yes.  I think I already brought this up in V1, that some existing
Samsung drivers call this (the 0xf0 part) the MCS PASSWORD, others call it the
LEVEL_2_KEY or USER_KEY or ACCESSPROT.

I'm curious (though should probably look up the patch history) where these names
come from, which of these names match the sofef01/03/souxp00 DDICs provided
here, and what they're supposed to mean (MCS: Magic Command Sequence?).

Then there are possibly a lot more constants we can glean from other drivers,
though again without confirmation that it's identical on this DDIC.

- Marijn

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 05/11] drm/panel: Add panel driver for Samsung SOFEF01 DDIC
  2025-12-26 14:16     ` Marijn Suijten
@ 2025-12-26 14:23       ` Marijn Suijten
  2025-12-26 17:43       ` Linus Walleij
  1 sibling, 0 replies; 43+ messages in thread
From: Marijn Suijten @ 2025-12-26 14:23 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Kuogee Hsieh,
	AngeloGioacchino Del Regno, Konrad Dybcio, Konrad Dybcio,
	Dmitry Baryshkov

On 2025-12-26 15:16:30, Marijn Suijten wrote:
> On 2025-12-26 14:21:37, Linus Walleij wrote:
> ...
> > Only nitpicks follow:
> > 
> > > +       if (ctx->panel_type == PANEL_TYPE_TC01 ||
> > > +           ctx->panel_type == PANEL_TYPE_UT01 ||
> > > +           ctx->panel_type == PANEL_TYPE_UT04) {
> > > +               mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
> > 
> > The sofef00 driver tell us exactly what this sequence is:
> > 
> > #define sofef00_test_key_on_lvl2(ctx) \
> >         mipi_dsi_dcs_write_seq_multi(ctx, 0xf0, 0x5a, 0x5a)
> > #define sofef00_test_key_off_lvl2(ctx) \
> >         mipi_dsi_dcs_write_seq_multi(ctx, 0xf0, 0xa5, 0xa5)
> > 
> > I would just rename these two to sofef01_test_key_on/off_lvl2()
> > and use the same helpers in this driver to follow the sofef00 pattern.
> 
> Right, yes.  I think I already brought this up in V1, that some existing
> Samsung drivers call this (the 0xf0 part) the MCS PASSWORD, others call it the
> LEVEL_2_KEY or USER_KEY or ACCESSPROT.
> 
> I'm curious (though should probably look up the patch history) where these names
> come from, which of these names match the sofef01/03/souxp00 DDICs provided
> here, and what they're supposed to mean (MCS: Magic Command Sequence?).

I should have probably looked this up before asking; Manufacturer Command
Sequence.

Likely a generic prefix someone came up with to label commands that are not
part of DCS.

> Then there are possibly a lot more constants we can glean from other drivers,
> though again without confirmation that it's identical on this DDIC.
> 
> - Marijn

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 04/11] dt-bindings: display: panel: Describe Samsung SOFEF01-M DDIC
  2025-12-26 13:48     ` Marijn Suijten
@ 2025-12-26 17:38       ` Linus Walleij
  2025-12-29 11:52         ` Marijn Suijten
  0 siblings, 1 reply; 43+ messages in thread
From: Linus Walleij @ 2025-12-26 17:38 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Jessica Zhang, AngeloGioacchino Del Regno,
	Konrad Dybcio, Konrad Dybcio, Dmitry Baryshkov

On Fri, Dec 26, 2025 at 2:48 PM Marijn Suijten
<marijn.suijten@somainline.org> wrote:
> On 2025-12-26 14:25:04, Linus Walleij wrote:

> > They are clearly using the S0FEF01-M display controller.
>
> So you're implying or certain that these panel names here are always bundled
> with exactly the same controller (making the SOFEF01 part "redundant" in the
> compatible)?

Yes that's what I suspect.

See my comment in the driver that all s6e* panels are suspected to be
some s0fef00/1 variant.

> Also, divergence of the driver commands got significant with the last two panels
> / three phones, though that might be down to vendor configuration/calibration.

That's kind of normal. The defaults suffice for a while, then engineers
want to start poking at different voltages to the display to improve
and tweak things.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 05/11] drm/panel: Add panel driver for Samsung SOFEF01 DDIC
  2025-12-26 14:16     ` Marijn Suijten
  2025-12-26 14:23       ` Marijn Suijten
@ 2025-12-26 17:43       ` Linus Walleij
  2025-12-29 11:43         ` Marijn Suijten
  1 sibling, 1 reply; 43+ messages in thread
From: Linus Walleij @ 2025-12-26 17:43 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Jessica Zhang, AngeloGioacchino Del Regno,
	Konrad Dybcio, Konrad Dybcio, Dmitry Baryshkov

On Fri, Dec 26, 2025 at 3:16 PM Marijn Suijten
<marijn.suijten@somainline.org> wrote:
> On 2025-12-26 14:21:37, Linus Walleij wrote:

> > The sofef00 driver tell us exactly what this sequence is:
> >
> > #define sofef00_test_key_on_lvl2(ctx) \
> >         mipi_dsi_dcs_write_seq_multi(ctx, 0xf0, 0x5a, 0x5a)
> > #define sofef00_test_key_off_lvl2(ctx) \
> >         mipi_dsi_dcs_write_seq_multi(ctx, 0xf0, 0xa5, 0xa5)
> >
> > I would just rename these two to sofef01_test_key_on/off_lvl2()
> > and use the same helpers in this driver to follow the sofef00 pattern.
>
> Right, yes.  I think I already brought this up in V1, that some existing
> Samsung drivers call this (the 0xf0 part) the MCS PASSWORD, others call it the
> LEVEL_2_KEY or USER_KEY or ACCESSPROT.

Actually all of the samsung s6e panels are suspected to be s0fef0/1
display controller variants, which you see if you look inside
panel-samsung-s6e*, for example panel-samsung-s6e3fc2x01.c has this:

#define s6e3fc2x01_test_key_on_lvl1(ctx) \
        mipi_dsi_dcs_write_seq_multi(ctx, 0x9f, 0xa5, 0xa5)
#define s6e3fc2x01_test_key_off_lvl1(ctx) \
        mipi_dsi_dcs_write_seq_multi(ctx, 0x9f, 0x5a, 0x5a)
#define s6e3fc2x01_test_key_on_lvl2(ctx) \
        mipi_dsi_dcs_write_seq_multi(ctx, 0xf0, 0x5a, 0x5a)
#define s6e3fc2x01_test_key_off_lvl2(ctx) \
        mipi_dsi_dcs_write_seq_multi(ctx, 0xf0, 0xa5, 0xa5)
#define s6e3fc2x01_test_key_on_lvl3(ctx) \
        mipi_dsi_dcs_write_seq_multi(ctx, 0xfc, 0x5a, 0x5a)
#define s6e3fc2x01_test_key_off_lvl3(ctx) \
        mipi_dsi_dcs_write_seq_multi(ctx, 0xfc, 0xa5, 0xa5)

So there is also the explanation of the 0xfc command.

> Then there are possibly a lot more constants we can glean from other drivers,
> though again without confirmation that it's identical on this DDIC.

I think the s0fef0/1 drivers and all the panel-samsung-s6e* drivers
should probably be unified a bit maybe we can just create a
local s0fef.h file with the above for all these drivers to use?

(If someone has actual datasheets for s0fef0/1 that would be great.)

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 06/11] dt-bindings: display: panel: Describe Samsung SOFEF03-M DDIC
  2025-12-22  8:33   ` Krzysztof Kozlowski
  2025-12-22  8:36     ` Krzysztof Kozlowski
@ 2025-12-28 22:31     ` Marijn Suijten
  1 sibling, 0 replies; 43+ messages in thread
From: Marijn Suijten @ 2025-12-28 22:31 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Jessica Zhang, AngeloGioacchino Del Regno,
	Konrad Dybcio, Konrad Dybcio, Dmitry Baryshkov

On 2025-12-22 09:33:04, Krzysztof Kozlowski wrote:
> On Mon, Dec 22, 2025 at 12:32:12AM +0100, Marijn Suijten wrote:
> > Document the Samsung SOFEF03-M Display-Driver-IC and 1080x2520@120Hz DSI
> > command-mode panels found in the Sony Xperia 5 II and Sony Xperia 5 III.
> > It requires Display Stream Compression 1.1 which allows the panels to be
> > driven at 120Hz, even though a 60Hz mode is available too.
> > 
> > Reviewed-by: Rob Herring <robh@kernel.org>
> > Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> 
> Your patchset has multiple white space warnings. Apply and see...

I am sorry for missing this.  I've asked b4 upstream to include diff --check
validation in their prep --check pass as I did not save + reapply my own series
before sending with this workflow.

- Marijn

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 06/11] dt-bindings: display: panel: Describe Samsung SOFEF03-M DDIC
  2025-12-22  8:36     ` Krzysztof Kozlowski
@ 2025-12-28 22:49       ` Marijn Suijten
  2025-12-30  1:53         ` Rob Herring
  0 siblings, 1 reply; 43+ messages in thread
From: Marijn Suijten @ 2025-12-28 22:49 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Jessica Zhang, AngeloGioacchino Del Regno,
	Konrad Dybcio, Konrad Dybcio, Dmitry Baryshkov

On 2025-12-22 09:36:23, Krzysztof Kozlowski wrote:
> On 22/12/2025 09:33, Krzysztof Kozlowski wrote:
> >> +  - |
> >> +    #include <dt-bindings/gpio/gpio.h>
> >> +
> >> +    dsi {
> >> +        #address-cells = <1>;
> >> +        #size-cells = <0>;
> >> +        panel@0 {
> >> +            compatible = "samsung,sofef03-m-amb609vp01";
> >> +            reg = <0>;
> >> +
> >> +            reset-gpios = <&tlmm 75 GPIO_ACTIVE_LOW>;
> >> +
> >> +            vci-supply = <&vreg_l11c_3p0>;
> >> +            vddio-supply = <&vreg_l14a_1p8>;
> >> +
> >> +            port {
> > 
> > Not tested :/
> 
> Ah no, this one is correct. It's the other patch with similar compatible
> which was not tested.

I think you mean:

	.output/Documentation/devicetree/bindings/display/panel/samsung,ana6707.example.dtb: panel@0 (samsung,ana6707-amb650yl01): 'ports' does not match any of the regexes: '^pinctrl-[0-9]+$'
		from schema $id: http://devicetree.org/schemas/display/panel/samsung,ana6707.yaml
	.output/Documentation/devicetree/bindings/display/panel/samsung,ana6707.example.dtb: panel@0 (samsung,ana6707-amb650yl01): 'port' is a required property
		from schema $id: http://devicetree.org/schemas/display/panel/samsung,ana6707.yaml

Which looks to be fixed by including panel-common-dual.yaml and changing `port`
to `ports` in the properties and required table?  At least the errors are gone,
just asking if that is acceptable.

Then:

	.output/Documentation/devicetree/bindings/display/panel/samsung,sofef01-m.example.dtb: panel@0 (samsung,sofef01-m-amb609tc01): 'vci-supply' does not match any of the regexes: '^pinctrl-[0-9]+$'
		from schema $id: http://devicetree.org/schemas/display/panel/samsung,sofef01-m.yaml

Which I do not immediately understand how to resolve.  I'd believe there's a
problem with the conditional inclusion of this vci-supply property based on the
compatible name, but do not see where the problem lies as other dt-bindings seem
to write it this way as well.  Can you point this out to me?

Alternatively I'll drop the example with vci-supply, but this'll return when
said panel is committed to DTS.

Lastly checkpatch complains that the "lgd" prefix isn't a valid vendor.  Should
I add "LG Display" to the list or rename it to "lg,"?

> Actually two others were not tested. We are not a testing service - it
> is your task.

That is not very kind; sometimes things might slip through and it's nice if CI
catches them at a last resort.

- Marijn

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 03/11] drm/panel: Add LGD LH599QH3-EDB1 panel driver for Sony Xperia XZ3
  2025-12-26 13:12   ` Linus Walleij
@ 2025-12-29 11:21     ` Marijn Suijten
  2025-12-29 12:33       ` Linus Walleij
  0 siblings, 1 reply; 43+ messages in thread
From: Marijn Suijten @ 2025-12-29 11:21 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Jessica Zhang, AngeloGioacchino Del Regno,
	Konrad Dybcio, Konrad Dybcio, Dmitry Baryshkov

On 2025-12-26 14:12:25, Linus Walleij wrote:
...
> > +static int lgd_lh599qh3_edb1_program(struct lgd_lh599qh3_edb1 *ctx)
> > +{
> > +       struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
> > +
> > +       dsi_ctx.dsi->mode_flags |= MIPI_DSI_MODE_LPM;
> > +
> > +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x7f, 0x5a, 0x5a);
> > +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
> > +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf1, 0x5a, 0x5a);
> > +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf2, 0x5a, 0x5a);
> 
> Clearly an "unlock" sequence.
> 
> > +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x02, 0x01);
> > +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x59, 0x01);
> > +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_CONTROL_DISPLAY,
> > +                                    WRITE_CONTROL_DISPLAY_BACKLIGHT);
> > +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x57, 0x20, 0x80, 0xde, 0x60, 0x00);
> > +       mipi_dsi_dcs_set_column_address_multi(&dsi_ctx, 0, 1440 - 1);
> > +       mipi_dsi_dcs_set_page_address_multi(&dsi_ctx, 0, 2880 - 1);
> > +
> > +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_POWER_SAVE, 0x00);
> > +
> > +       mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
> > +
> > +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x7f, 0x5a, 0x5a);
> > +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
> > +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf1, 0x5a, 0x5a);
> > +       mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf2, 0x5a, 0x5a);
> 
> Cleary another copy of the "unlock" sequence.
> 
> Can you break it out to a subroutine?
> lgd_lh599qh3_edb1_unlock()?

Sure, though unsure where the "lock" sequence resides (and why it needs to be
unlocked twice, unless this was autogenerated and is unnecessary, or implies a
"flush" of sorts) or why it looks so familiar to the Samsung panels.

Will rename it to lgd_lh599qh3_edb1_unlock_multi() and pass it a
mipi_dsi_multi_context so that no extra return-code handling needs to be
implemented.

> +/- this nitpick:
> Reviewed-by: Linus Walleij <linusw@kernel.org>

Just making sure, you reviewed the SOFEF01 driver with your Linaro address,
which one do you prefer or should I keep this distinction?

- Marijn

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 05/11] drm/panel: Add panel driver for Samsung SOFEF01 DDIC
  2025-12-26 17:43       ` Linus Walleij
@ 2025-12-29 11:43         ` Marijn Suijten
  2025-12-29 12:39           ` Linus Walleij
  0 siblings, 1 reply; 43+ messages in thread
From: Marijn Suijten @ 2025-12-29 11:43 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Jessica Zhang, AngeloGioacchino Del Regno,
	Konrad Dybcio, Konrad Dybcio, Dmitry Baryshkov

On 2025-12-26 18:43:03, Linus Walleij wrote:
> On Fri, Dec 26, 2025 at 3:16 PM Marijn Suijten
> <marijn.suijten@somainline.org> wrote:
> > On 2025-12-26 14:21:37, Linus Walleij wrote:
> 
> > > The sofef00 driver tell us exactly what this sequence is:
> > >
> > > #define sofef00_test_key_on_lvl2(ctx) \
> > >         mipi_dsi_dcs_write_seq_multi(ctx, 0xf0, 0x5a, 0x5a)
> > > #define sofef00_test_key_off_lvl2(ctx) \
> > >         mipi_dsi_dcs_write_seq_multi(ctx, 0xf0, 0xa5, 0xa5)
> > >
> > > I would just rename these two to sofef01_test_key_on/off_lvl2()
> > > and use the same helpers in this driver to follow the sofef00 pattern.
> >
> > Right, yes.  I think I already brought this up in V1, that some existing
> > Samsung drivers call this (the 0xf0 part) the MCS PASSWORD, others call it the
> > LEVEL_2_KEY or USER_KEY or ACCESSPROT.
> 
> Actually all of the samsung s6e panels are suspected to be s0fef0/1

Just noting the first 0 is actually the letter o.

> display controller variants, which you see if you look inside
> panel-samsung-s6e*, for example panel-samsung-s6e3fc2x01.c has this:

...

> I think the s0fef0/1 drivers and all the panel-samsung-s6e* drivers
> should probably be unified a bit maybe we can just create a
> local s0fef.h file with the above for all these drivers to use?
> 
> (If someone has actual datasheets for s0fef0/1 that would be great.)

If we know exactly what the commands are, and have their arguments documented,
it'd be nice to have these as constants and functions in a global reusable
header, but it does require being absolutely certain on their meaning and
equivalence.

- Marijn

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 04/11] dt-bindings: display: panel: Describe Samsung SOFEF01-M DDIC
  2025-12-26 17:38       ` Linus Walleij
@ 2025-12-29 11:52         ` Marijn Suijten
  2025-12-29 12:37           ` Linus Walleij
  0 siblings, 1 reply; 43+ messages in thread
From: Marijn Suijten @ 2025-12-29 11:52 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Jessica Zhang, AngeloGioacchino Del Regno,
	Konrad Dybcio, Konrad Dybcio, Dmitry Baryshkov

On 2025-12-26 18:38:56, Linus Walleij wrote:
> On Fri, Dec 26, 2025 at 2:48 PM Marijn Suijten
> <marijn.suijten@somainline.org> wrote:
> > On 2025-12-26 14:25:04, Linus Walleij wrote:
> 
> > > They are clearly using the S0FEF01-M display controller.
> >
> > So you're implying or certain that these panel names here are always bundled
> > with exactly the same controller (making the SOFEF01 part "redundant" in the
> > compatible)?
> 
> Yes that's what I suspect.

Do you still want me to drop it from the compatible, but definitely keep it in
the driver filename unless we unify all of the drivers (hopefully in a later
patch)?

> > Also, divergence of the driver commands got significant with the last two panels
> > / three phones, though that might be down to vendor configuration/calibration.
> 
> That's kind of normal. The defaults suffice for a while, then engineers
> want to start poking at different voltages to the display to improve
> and tweak things.

Makes one wonder if the changes are down to the panel used, or vendor tuning
when they started using these panels in their phones.  To note, I think I booted
all these phones on the "original" SOFEF01 driver without problems, before
ultimately implementing all diverging commands because I don't know if they're
defaults, related to color tuning, timings, thermals, manufacturer tolerances or
anything else.

- Marijn

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 03/11] drm/panel: Add LGD LH599QH3-EDB1 panel driver for Sony Xperia XZ3
  2025-12-29 11:21     ` Marijn Suijten
@ 2025-12-29 12:33       ` Linus Walleij
  0 siblings, 0 replies; 43+ messages in thread
From: Linus Walleij @ 2025-12-29 12:33 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Jessica Zhang, AngeloGioacchino Del Regno,
	Konrad Dybcio, Konrad Dybcio, Dmitry Baryshkov

On Mon, Dec 29, 2025 at 12:21 PM Marijn Suijten
<marijn.suijten@somainline.org> wrote:

> > Can you break it out to a subroutine?
> > lgd_lh599qh3_edb1_unlock()?
>
> Sure, though unsure where the "lock" sequence resides (and why it needs to be
> unlocked twice, unless this was autogenerated and is unnecessary, or implies a
> "flush" of sorts) or why it looks so familiar to the Samsung panels.
>
> Will rename it to lgd_lh599qh3_edb1_unlock_multi() and pass it a
> mipi_dsi_multi_context so that no extra return-code handling needs to be
> implemented.

I think extracting the unlock macros from the s6e* drivers and put into
a separate .h file is the best for starting to unify these drivers a bit,
but no big deal, I can do it later.

> > +/- this nitpick:
> > Reviewed-by: Linus Walleij <linusw@kernel.org>
>
> Just making sure, you reviewed the SOFEF01 driver with your Linaro address,
> which one do you prefer or should I keep this distinction?

The Linaro address stops working at the end of this year,
I'm sorry if my fingers sometimes type the wrong address...
linusw@kernel.org is what I should be using henceforth.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 04/11] dt-bindings: display: panel: Describe Samsung SOFEF01-M DDIC
  2025-12-29 11:52         ` Marijn Suijten
@ 2025-12-29 12:37           ` Linus Walleij
  0 siblings, 0 replies; 43+ messages in thread
From: Linus Walleij @ 2025-12-29 12:37 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Jessica Zhang, AngeloGioacchino Del Regno,
	Konrad Dybcio, Konrad Dybcio, Dmitry Baryshkov

On Mon, Dec 29, 2025 at 12:53 PM Marijn Suijten
<marijn.suijten@somainline.org> wrote:

> > Yes that's what I suspect.
>
> Do you still want me to drop it from the compatible, but definitely keep it in
> the driver filename unless we unify all of the drivers (hopefully in a later
> patch)?

The compatible should be as precise as possible, so indicate the
assembled display with display controller, typically
samsung,ams605dk01 etc, then the Linux driver is basically
a Linux intrinsic matter, but we would name that after the display
controller so as to make the basis of code sharing obvious between
the compatibles.

> > > Also, divergence of the driver commands got significant with the last two panels
> > > / three phones, though that might be down to vendor configuration/calibration.
> >
> > That's kind of normal. The defaults suffice for a while, then engineers
> > want to start poking at different voltages to the display to improve
> > and tweak things.
>
> Makes one wonder if the changes are down to the panel used, or vendor tuning
> when they started using these panels in their phones.  To note, I think I booted
> all these phones on the "original" SOFEF01 driver without problems, before
> ultimately implementing all diverging commands because I don't know if they're
> defaults, related to color tuning, timings, thermals, manufacturer tolerances or
> anything else.

Yeah a datasheet would really help :/

Samsung, if you're reading this, you know what to do: give us the
datasheets, pretty please with sugar on top.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 05/11] drm/panel: Add panel driver for Samsung SOFEF01 DDIC
  2025-12-29 11:43         ` Marijn Suijten
@ 2025-12-29 12:39           ` Linus Walleij
  0 siblings, 0 replies; 43+ messages in thread
From: Linus Walleij @ 2025-12-29 12:39 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly, Rob Herring,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, AngeloGioacchino Del Regno, Konrad Dybcio,
	Konrad Dybcio, Dmitry Baryshkov

On Mon, Dec 29, 2025 at 12:43 PM Marijn Suijten
<marijn.suijten@somainline.org> wrote:

> > Actually all of the samsung s6e panels are suspected to be s0fef0/1
>
> Just noting the first 0 is actually the letter o.

Yeah I'm sloppy :D sorry.

> > display controller variants, which you see if you look inside
> > panel-samsung-s6e*, for example panel-samsung-s6e3fc2x01.c has this:
> ...
>
> > I think the s0fef0/1 drivers and all the panel-samsung-s6e* drivers
> > should probably be unified a bit maybe we can just create a
> > local s0fef.h file with the above for all these drivers to use?
> >
> > (If someone has actual datasheets for s0fef0/1 that would be great.)
>
> If we know exactly what the commands are, and have their arguments documented,
> it'd be nice to have these as constants and functions in a global reusable
> header, but it does require being absolutely certain on their meaning and
> equivalence.

Yeah well. When all we have is code dumps all we can do is try to
split out the stuff we know for sure is shared. Like the different
unlock commands...

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 04/11] dt-bindings: display: panel: Describe Samsung SOFEF01-M DDIC
  2025-12-21 23:32 ` [PATCH v2 04/11] dt-bindings: display: panel: Describe Samsung SOFEF01-M DDIC Marijn Suijten
  2025-12-26 13:25   ` Linus Walleij
@ 2025-12-30  1:51   ` Rob Herring
  1 sibling, 0 replies; 43+ messages in thread
From: Rob Herring @ 2025-12-30  1:51 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Neil Armstrong, Sam Ravnborg, David Airlie, Krzysztof Kozlowski,
	Conor Dooley, Andy Gross, Bjorn Andersson, Jessica Zhang,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Simona Vetter, Casey Connolly, Krzysztof Kozlowski, Simona Vetter,
	~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Martin Botka, Jami Kettunen, dri-devel, linux-kernel, devicetree,
	linux-arm-msm, Abhinav Kumar, Kuogee Hsieh, Jessica Zhang,
	AngeloGioacchino Del Regno, Konrad Dybcio, Konrad Dybcio,
	Dmitry Baryshkov

On Mon, Dec 22, 2025 at 12:32:10AM +0100, Marijn Suijten wrote:
> Document the Samsung SOFEF01-M Display-Driver-IC and 1080x2520@60Hz
> command-mode DSI panels found in many Sony phones:
> - Sony Xperia 5 (kumano bahamut): amb609tc01
> - Sony Xperia 10 II (seine pdx201): ams597ut01
> - Sony Xperia 10 III (lena pdx213): ams597ut04
> - Sony Xperia 10 IV (murray pdx225): ams597ut05
> - Sony Xperia 10 V (zambezi pdx235): ams605dk01
> - Sony Xperia 10 VI (columbia pdx246): ams605dk01
> 
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
>  .../bindings/display/panel/samsung,sofef01-m.yaml  | 120 +++++++++++++++++++++
>  MAINTAINERS                                        |   5 +
>  2 files changed, 125 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/display/panel/samsung,sofef01-m.yaml b/Documentation/devicetree/bindings/display/panel/samsung,sofef01-m.yaml
> new file mode 100644
> index 000000000000..a8ff5223677c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/panel/samsung,sofef01-m.yaml
> @@ -0,0 +1,120 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/panel/samsung,sofef01-m.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Samsung SOFEF01-M DDI for 1080x2520@60Hz 6.0"/6.1" OLED DSI panels
> +
> +maintainers:
> +  - Marijn Suijten <marijn.suijten@somainline.org>
> +
> +description: |
> +  Samsung SOFEF01-M Display-Driver-IC found in multiple Sony smartphones, paired with
> +  the following panel:
> +   - Sony Xperia 5 (kumano bahamut): amb609tc01
> +   - Sony Xperia 10 II (seine pdx201): ams597ut01
> +   - Sony Xperia 10 III (lena pdx213): ams597ut04
> +   - Sony Xperia 10 IV (murray pdx225): ams597ut05
> +   - Sony Xperia 10 V (zambezi pdx235): ams605dk01
> +   - Sony Xperia 10 VI (columbia pdx246): ams605dk01
> +
> +  The assembly features a Samsung touchscreen compatible with
> +  samsung,s6sy761.
> +
> +allOf:
> +  - $ref: panel-common.yaml#
> +
> +  - if:
> +      properties:
> +        compatible:
> +          const: samsung,sofef01-m-amb609tc01
> +    then:
> +      properties:
> +        vci-supply:
> +          description: DisplayIC Operation supply (3.0V)

The error reported is on the wrong patch. Not sure why, but the problem 
is here. With 'additionalProperties: false', this property is not 
factored in and is considered unknown. That can be fixed using 
'unevaluatedProperties', but instead, move this to the top level 
'properties'.

> +
> +      required:
> +        - vci-supply
> +
> +    else:
> +      properties:
> +        vci-supply: false
> +
> +properties:
> +  compatible:
> +    enum:
> +      - samsung,sofef01-m-amb609tc01 # 6.1"
> +      - samsung,sofef01-m-ams597ut01 # 6.0"
> +      - samsung,sofef01-m-ams597ut04 # 6.0"
> +      - samsung,sofef01-m-ams597ut05 # 6.0"
> +      - samsung,sofef01-m-ams605dk01 # 6.1"
> +
> +  port: true
> +
> +  reg:
> +    maxItems: 1
> +    description: DSI virtual channel
> +
> +  reset-gpios: true
> +
> +  vddio-supply:
> +    description: I/O voltage supply (1.8V)
> +
> +required:
> +  - compatible
> +  - port
> +  - reg
> +  - reset-gpios
> +  - vddio-supply
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +
> +    dsi {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        panel@0 {
> +            compatible = "samsung,sofef01-m-amb609tc01";
> +            reg = <0>;
> +
> +            reset-gpios = <&tlmm 6 GPIO_ACTIVE_LOW>;
> +
> +            vci-supply = <&vreg_l17a_3p0>;
> +            vddio-supply = <&vreg_l14a_1p8>;
> +
> +            port {
> +                endpoint {
> +                    remote-endpoint = <&dsi0_out>;
> +                };
> +            };
> +        };
> +    };
> +
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +
> +    dsi {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        panel@0 {
> +            compatible = "samsung,sofef01-m-ams597ut01";
> +            reg = <0>;
> +
> +            reset-gpios = <&tlmm 90 GPIO_ACTIVE_LOW>;
> +
> +            vddio-supply = <&pm6125_l12>;
> +
> +            port {
> +                endpoint {
> +                    remote-endpoint = <&dsi0_out>;
> +                };
> +            };
> +        };
> +    };

The first example is enough.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 06/11] dt-bindings: display: panel: Describe Samsung SOFEF03-M DDIC
  2025-12-28 22:49       ` Marijn Suijten
@ 2025-12-30  1:53         ` Rob Herring
  0 siblings, 0 replies; 43+ messages in thread
From: Rob Herring @ 2025-12-30  1:53 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Krzysztof Kozlowski, Neil Armstrong, Sam Ravnborg, David Airlie,
	Krzysztof Kozlowski, Conor Dooley, Andy Gross, Bjorn Andersson,
	Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Simona Vetter, Casey Connolly,
	Krzysztof Kozlowski, Simona Vetter, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	dri-devel, linux-kernel, devicetree, linux-arm-msm, Abhinav Kumar,
	Kuogee Hsieh, Jessica Zhang, AngeloGioacchino Del Regno,
	Konrad Dybcio, Konrad Dybcio, Dmitry Baryshkov

On Sun, Dec 28, 2025 at 11:49:13PM +0100, Marijn Suijten wrote:
> On 2025-12-22 09:36:23, Krzysztof Kozlowski wrote:
> > On 22/12/2025 09:33, Krzysztof Kozlowski wrote:
> > >> +  - |
> > >> +    #include <dt-bindings/gpio/gpio.h>
> > >> +
> > >> +    dsi {
> > >> +        #address-cells = <1>;
> > >> +        #size-cells = <0>;
> > >> +        panel@0 {
> > >> +            compatible = "samsung,sofef03-m-amb609vp01";
> > >> +            reg = <0>;
> > >> +
> > >> +            reset-gpios = <&tlmm 75 GPIO_ACTIVE_LOW>;
> > >> +
> > >> +            vci-supply = <&vreg_l11c_3p0>;
> > >> +            vddio-supply = <&vreg_l14a_1p8>;
> > >> +
> > >> +            port {
> > > 
> > > Not tested :/
> > 
> > Ah no, this one is correct. It's the other patch with similar compatible
> > which was not tested.
> 
> I think you mean:
> 
> 	.output/Documentation/devicetree/bindings/display/panel/samsung,ana6707.example.dtb: panel@0 (samsung,ana6707-amb650yl01): 'ports' does not match any of the regexes: '^pinctrl-[0-9]+$'
> 		from schema $id: http://devicetree.org/schemas/display/panel/samsung,ana6707.yaml
> 	.output/Documentation/devicetree/bindings/display/panel/samsung,ana6707.example.dtb: panel@0 (samsung,ana6707-amb650yl01): 'port' is a required property
> 		from schema $id: http://devicetree.org/schemas/display/panel/samsung,ana6707.yaml
> 
> Which looks to be fixed by including panel-common-dual.yaml and changing `port`
> to `ports` in the properties and required table?  At least the errors are gone,
> just asking if that is acceptable.

Considering it's a dual interface panel, yes, that's the right change.

Rob

^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2025-12-30  1:54 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-21 23:32 [PATCH v2 00/11] drm/panel: Add 5 DDIC panel drivers for 14 Sony phones Marijn Suijten
2025-12-21 23:32 ` [PATCH v2 01/11] drm/panel: Clean up SOFEF00 config dependencies Marijn Suijten
2025-12-21 23:32 ` [PATCH v2 02/11] dt-bindings: display: panel: Describe LGD LH599QH3-EDB1 panel Marijn Suijten
2025-12-21 23:32 ` [PATCH v2 03/11] drm/panel: Add LGD LH599QH3-EDB1 panel driver for Sony Xperia XZ3 Marijn Suijten
2025-12-24  1:12   ` Dmitry Baryshkov
2025-12-26 13:12   ` Linus Walleij
2025-12-29 11:21     ` Marijn Suijten
2025-12-29 12:33       ` Linus Walleij
2025-12-21 23:32 ` [PATCH v2 04/11] dt-bindings: display: panel: Describe Samsung SOFEF01-M DDIC Marijn Suijten
2025-12-26 13:25   ` Linus Walleij
2025-12-26 13:48     ` Marijn Suijten
2025-12-26 17:38       ` Linus Walleij
2025-12-29 11:52         ` Marijn Suijten
2025-12-29 12:37           ` Linus Walleij
2025-12-30  1:51   ` Rob Herring
2025-12-21 23:32 ` [PATCH v2 05/11] drm/panel: Add panel driver for Samsung SOFEF01 DDIC Marijn Suijten
2025-12-24  1:12   ` Dmitry Baryshkov
2025-12-24 16:13   ` kernel test robot
2025-12-26 13:21   ` Linus Walleij
2025-12-26 14:16     ` Marijn Suijten
2025-12-26 14:23       ` Marijn Suijten
2025-12-26 17:43       ` Linus Walleij
2025-12-29 11:43         ` Marijn Suijten
2025-12-29 12:39           ` Linus Walleij
2025-12-21 23:32 ` [PATCH v2 06/11] dt-bindings: display: panel: Describe Samsung SOFEF03-M DDIC Marijn Suijten
2025-12-22  3:51   ` Rob Herring (Arm)
2025-12-22  8:33   ` Krzysztof Kozlowski
2025-12-22  8:36     ` Krzysztof Kozlowski
2025-12-28 22:49       ` Marijn Suijten
2025-12-30  1:53         ` Rob Herring
2025-12-28 22:31     ` Marijn Suijten
2025-12-21 23:32 ` [PATCH v2 07/11] drm/panel: Add panel driver for " Marijn Suijten
2025-12-24  1:15   ` Dmitry Baryshkov
2025-12-24  9:43   ` Marijn Suijten
2025-12-21 23:32 ` [PATCH v2 08/11] dt-bindings: display: panel: Describe Samsung SOUXP00-A DDIC Marijn Suijten
2025-12-22  3:51   ` Rob Herring (Arm)
2025-12-21 23:32 ` [PATCH v2 09/11] drm/panel: Add panel driver for " Marijn Suijten
2025-12-24  1:15   ` Dmitry Baryshkov
2025-12-24 17:26   ` kernel test robot
2025-12-21 23:32 ` [PATCH v2 10/11] dt-bindings: display: panel: Describe Samsung ANA6707 DDIC Marijn Suijten
2025-12-22  3:51   ` Rob Herring (Arm)
2025-12-21 23:32 ` [PATCH v2 11/11] drm/panel: Add panel driver for " Marijn Suijten
2025-12-24  1:16   ` Dmitry Baryshkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).