Add Samsung S6E3HA8 panel driver
Subsystems (5)
Dzmitry Sankouski
maintainerv5 cover Add Samsung S6E3HA8 panel driver
The s6e3ha8 is a 1440x2960 DPI AMOLED display panel from Samsung Mobile
Displays (SMD)
---
Changes in v5:
- Split patchset per subsystem
- Link to v4: https://lore.kernel.org/r/20240913-starqltechn_integration_upstream-v4-0-2d2efd5c5877@gmail.com
---
Dzmitry Sankouski (2):
dt-bindings: panel: add Samsung s6e3ha8 drm/panel: Add support for S6E3HA8 panel driver
Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml | 75 +++++++++++++ MAINTAINERS | 6 + drivers/gpu/drm/panel/Kconfig | 7 ++ drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c | 344 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 433 insertions(+)
---
base-commit: 3469b89bd13f10d679d1b1f5b47fb71953e96349
change-id: 20240617-starqltechn_integration_upstream-bc86850b2fe3
Best regards,
Signature · 1 line
Dzmitry Sankouski <[email protected]>
Dzmitry Sankouski
maintainerPATCH v5 1/2 dt-bindings: panel: add Samsung s6e3ha8
Add binding for the Samsung s6e3ha8 panel found in the Samsung S9.
---
Changes for v5:
- fix required properties order
- fix example indentation
Changes in v4:
- change dts example intendation from tabs
to spaces
- remove reset-gpios description
--- Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ MAINTAINERS | 5 ++++ 2 files changed, 80 insertions(+)
Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml new file +75 -0
@@ -0,0 +1,75 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/samsung,s6e3ha8.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Samsung s6e3ha8 AMOLED DSI panel + +description: The s6e3ha8 is a 1440x2960 DPI display panel from Samsung Mobile + Displays (SMD). + +maintainers: + - Dzmitry Sankouski <[email protected]> + +allOf: + - $ref: panel-common.yaml# + +properties: + compatible: + const: samsung,s6e3ha8 + + reg: + maxItems: 1 + + reset-gpios: true + + port: true + + vdd3-supply: + description: VDD regulator + + vci-supply: + description: VCI regulator + + vddr-supply: + description: VDDR regulator + +required: + - compatible + - reset-gpios + - vdd3-supply + - vci-supply + - vddr-supply + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + + dsi { + #address-cells = <1>; + #size-cells = <0>; + + panel@0 { + compatible = "samsung,s6e3ha8"; + reg = <0>; + vci-supply = <&s2dos05_ldo4>; + vddr-supply = <&s2dos05_buck1>; + vdd3-supply = <&s2dos05_ldo1>; + te-gpios = <&tlmm 10 GPIO_ACTIVE_HIGH>; + reset-gpios = <&tlmm 6 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&sde_dsi_active &sde_te_active_sleep>; + pinctrl-1 = <&sde_dsi_suspend &sde_te_active_sleep>; + pinctrl-names = "default", "sleep"; + + port { + panel_in: endpoint { + remote-endpoint = <&mdss_dsi0_out>; + }; + }; + }; + }; + +...
MAINTAINERS +5 -0
@@ -7388,6 +7388,11 @@ S: Maintained F: Documentation/devicetree/bindings/display/panel/samsung,s6d7aa0.yaml F: drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c +DRM DRIVER FOR SAMSUNG S6E3HA8 PANELS +M: Dzmitry Sankouski <[email protected]> +S: Maintained +F: Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml + DRM DRIVER FOR SITRONIX ST7586 PANELS M: David Lechner <[email protected]> S: Maintained
Signature · 1 line
2.39.2
Dzmitry Sankouski
maintainerPATCH v5 2/2 drm/panel: Add support for S6E3HA8 panel driver
In reply to Dzmitry SankouskiAdd support for MIPI-DSI based S6E3HA8 AMOLED panel driver. This panel has 1440x2960 resolution, 5.8-inch physical size, and can be found in starqltechn device. Brightness regulation is not yet supported.
---
Changes for v5:
- return ctx.accum_err instead of 0 where possible
- switch mipi_dsi_picture_parameter_set to _multi
- replace msleep with mipi_dsi_msleep
Changes in v4:
- inline power related functions
- rework driver using new mipi_dsi_dcs_write_seq_multi macro
- use drm_connector_helper_get_modes_fixed for modes
- remove excessive compression setting
--- MAINTAINERS | 1 + drivers/gpu/drm/panel/Kconfig | 7 ++ drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c | 344 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 353 insertions(+)
MAINTAINERS +1 -0
@@ -7392,6 +7392,7 @@ DRM DRIVER FOR SAMSUNG S6E3HA8 PANELS M: Dzmitry Sankouski <[email protected]> S: Maintained F: Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml +F: drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c DRM DRIVER FOR SITRONIX ST7586 PANELS M: David Lechner <[email protected]>
drivers/gpu/drm/panel/Kconfig +7 -0
@@ -689,6 +689,13 @@ config DRM_PANEL_SAMSUNG_S6E3HA2 depends on BACKLIGHT_CLASS_DEVICE select VIDEOMODE_HELPERS +config DRM_PANEL_SAMSUNG_S6E3HA8 + tristate "Samsung S6E3HA8 DSI video mode panel" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + select VIDEOMODE_HELPERS + config DRM_PANEL_SAMSUNG_S6E63J0X03 tristate "Samsung S6E63J0X03 DSI command mode panel" depends on OF
drivers/gpu/drm/panel/Makefile +1 -0
@@ -70,6 +70,7 @@ obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D27A1) += panel-samsung-s6d27a1.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D7AA0) += panel-samsung-s6d7aa0.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3FA7) += panel-samsung-s6e3fa7.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2) += panel-samsung-s6e3ha2.o +obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA8) += panel-samsung-s6e3ha8.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03) += panel-samsung-s6e63j0x03.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0) += panel-samsung-s6e63m0.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0_SPI) += panel-samsung-s6e63m0-spi.o
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c new file +344 -0
344 lines not on this page · raw message
Signature · 1 line
2.39.2
Re: [PATCH v5 1/2] dt-bindings: panel: add Samsung s6e3ha8
In reply to Dzmitry SankouskiQuoted 24 lines · Dzmitry Sankouski
Add binding for the Samsung s6e3ha8 panel found in the Samsung S9.
Signed-off-by Dzmitry Sankouski <[email protected]>---
Changes for v5:
- fix required properties order
- fix example indentationChanges in v4:
- change dts example intendation from tabs
to spaces
- remove reset-gpios description--- Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ MAINTAINERS | 5 ++++ 2 files changed, 80 insertions(+)Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml new file +0
-0
Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml line 10
Quoted 10 lines
Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml new file +10
-0@@ -0,0 +1,75 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/samsung,s6e3ha8.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Samsung s6e3ha8 AMOLED DSI panel + +description: The s6e3ha8 is a 1440x2960 DPI display panel from Samsung Mobile + Displays (SMD).
if you respin, please start the text on the line after the description. That's just a nit, so
Re: [PATCH v5 2/2] drm/panel: Add support for S6E3HA8 panel driver
In reply to Dzmitry SankouskiHi,
Quoted 133 lines · Dzmitry Sankouski
Add support for MIPI-DSI based S6E3HA8 AMOLED panel driver. This panel has 1440x2960 resolution, 5.8-inch physical size, and can be found in starqltechn device. Brightness regulation is not yet supported.
Signed-off-by Dzmitry Sankouski <[email protected]>---
Changes for v5:
- return ctx.accum_err instead of 0 where possible
- switchmipi_dsi_picture_parameter_setto_multi
- replace msleep withmipi_dsi_msleepChanges in v4:
- inline power related functions
- rework driver using newmipi_dsi_dcs_write_seq_multimacro
- usedrm_connector_helper_get_modes_fixedfor modes
- remove excessive compression setting--- MAINTAINERS | 1 + drivers/gpu/drm/panel/Kconfig | 7 ++ drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c | 344 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 353 insertions(+)MAINTAINERS +1
-0@@ -7392,6 +7392,7 @@ DRM DRIVER FOR SAMSUNG S6E3HA8 PANELS M: Dzmitry Sankouski <[email protected]> S: Maintained F: Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml +F: drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c DRM DRIVER FOR SITRONIX ST7586 PANELS M: David Lechner <[email protected]>drivers/gpu/drm/panel/Kconfig +7
-0@@ -689,6 +689,13 @@ config DRM_PANEL_SAMSUNG_S6E3HA2 depends on BACKLIGHT_CLASS_DEVICE select VIDEOMODE_HELPERS +config DRM_PANEL_SAMSUNG_S6E3HA8 + tristate "Samsung S6E3HA8 DSI video mode panel" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + select VIDEOMODE_HELPERS + config DRM_PANEL_SAMSUNG_S6E63J0X03 tristate "Samsung S6E63J0X03 DSI command mode panel" depends on OFdrivers/gpu/drm/panel/Makefile +1
-0@@ -70,6 +70,7 @@ obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D27A1) += panel-samsung-s6d27a1.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D7AA0) += panel-samsung-s6d7aa0.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3FA7) += panel-samsung-s6e3fa7.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2) += panel-samsung-s6e3ha2.o +obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA8) += panel-samsung-s6e3ha8.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03) += panel-samsung-s6e63j0x03.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0) += panel-samsung-s6e63m0.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0_SPI) += panel-samsung-s6e63m0-spi.odrivers/gpu/drm/panel/panel-samsung-s6e3ha8.c new file +60
-0@@ -0,0 +1,344 @@ +// SPDX-License-Identifier: GPL-2.0-only +// +// Generated with linux-mdss-dsi-panel-driver-generator from vendor device tree: +// Copyright (c) 2013, The Linux Foundation. All rights reserved. +// Copyright (c) 2024 Dzmitry Sankouski <[email protected]> + +#include <linux/delay.h> +#include <linux/gpio/consumer.h> +#include <linux/module.h> +#include <linux/of.h> +#include <linux/regulator/consumer.h> + +#include <drm/display/drm_dsc.h> +#include <drm/display/drm_dsc_helper.h> +#include <drm/drm_mipi_dsi.h> +#include <drm/drm_probe_helper.h> +#include <drm/drm_panel.h> + +struct s6e3ha8 { +struct drm_panel panel; +struct mipi_dsi_device *dsi; +struct drm_dsc_config dsc; +struct gpio_desc *reset_gpio; +struct regulator_bulk_data supplies[3 ]; +}; + +static inline +struct s6e3ha8 *to_s6e3ha8_amb577px01_wqhd (struct drm_panel *panel) +{ + return container_of(panel, struct s6e3ha8, panel); +} + +#define s6e3ha8_test_key_on_lvl2 (ctx) \ + mipi_dsi_dcs_write_seq_multi(ctx, 0xf0, 0x5a, 0x5a) +#define s6e3ha8_test_key_off_lvl2 (ctx) \ + mipi_dsi_dcs_write_seq_multi(ctx, 0xf0, 0xa5, 0xa5) +#define s6e3ha8_test_key_on_lvl3 (ctx) \ + mipi_dsi_dcs_write_seq_multi(ctx, 0xfc, 0x5a, 0x5a) +#define s6e3ha8_test_key_off_lvl3 (ctx) \ + mipi_dsi_dcs_write_seq_multi(ctx, 0xfc, 0xa5, 0xa5) +#define s6e3ha8_test_key_on_lvl1 (ctx) \ + mipi_dsi_dcs_write_seq_multi(ctx, 0x9f, 0xa5, 0xa5) +#define s6e3ha8_test_key_off_lvl1 (ctx) \ + mipi_dsi_dcs_write_seq_multi(ctx, 0x9f, 0x5a, 0x5a) +#define s6e3ha8_afc_off (ctx) \ + mipi_dsi_dcs_write_seq_multi(ctx, 0xe2, 0x00, 0x00) + +static void s6e3ha8_amb577px01_wqhd_reset (struct s6e3ha8 *priv) +{ +gpiod_set_value_cansleep (priv->reset_gpio,1 ); +usleep_range (5000 ,6000 ); +gpiod_set_value_cansleep (priv->reset_gpio,0 ); +usleep_range (5000 ,6000 ); +gpiod_set_value_cansleep (priv->reset_gpio,1 ); +usleep_range (5000 ,6000 ); +} + +static int s6e3ha8_amb577px01_wqhd_on (struct s6e3ha8 *priv) +{ +struct mipi_dsi_device *dsi = priv->dsi;
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c line 70
Quoted 10 lines
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c new file +10
-0+struct device *dev = &dsi->dev; +struct mipi_dsi_multi_context ctx = { .dsi = dsi }; +int ret; + + dsi->mode_flags |=MIPI_DSI_MODE_LPM ; + +s6e3ha8_test_key_on_lvl1 (&ctx); +s6e3ha8_test_key_on_lvl2 (&ctx); + + ret =mipi_dsi_compression_mode (dsi, true);
Either use mipi_dsi_compression_mode_ext_multi(&ctx, true, MIPI_DSI_COMPRESSION_DSC, 0) or add mipi_dsi_compression_mode_multi()
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c line 78
Quoted 8 lines
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c new file +8
-0+if (ret <0 ) { +dev_err (dev,"Failed to set compression mode: %d\n" , ret); +return ret; + } + +s6e3ha8_test_key_off_lvl2 (&ctx); + + ret =mipi_dsi_dcs_exit_sleep_mode (dsi);
Use mipi_dsi_dcs_exit_sleep_mode_multi()
Quoted 66 lines
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c new file +66
-0+if (ret <0 ) { +dev_err (dev,"Failed to exit sleep mode: %d\n" , ret); +return ret; + } +usleep_range (5000 ,6000 ); + +s6e3ha8_test_key_on_lvl2 (&ctx); +mipi_dsi_dcs_write_seq_multi (&ctx,0xf2 ,0x13 ); +s6e3ha8_test_key_off_lvl2 (&ctx); + +usleep_range (10000 ,11000 ); + +s6e3ha8_test_key_on_lvl2 (&ctx); +mipi_dsi_dcs_write_seq_multi (&ctx,0xf2 ,0x13 ); +s6e3ha8_test_key_off_lvl2 (&ctx); + +/* OMOK setting 1 (Initial setting) - Scaler Latch Setting Guide */ +s6e3ha8_test_key_on_lvl2 (&ctx); +mipi_dsi_dcs_write_seq_multi (&ctx,0xb0 ,0x07 ); +/* latch setting 1 : Scaler on/off & address setting & PPS setting -> Image update latch */ +mipi_dsi_dcs_write_seq_multi (&ctx,0xf2 ,0x3c ,0x10 ); +mipi_dsi_dcs_write_seq_multi (&ctx,0xb0 ,0x0b ); +/* latch setting 2 : Ratio change mode -> Image update latch */ +mipi_dsi_dcs_write_seq_multi (&ctx,0xf2 ,0x30 ); +/* OMOK setting 2 - Seamless setting guide : WQHD */ +mipi_dsi_dcs_write_seq_multi (&ctx,0x2a ,0x00 ,0x00 ,0x05 ,0x9f );/* CASET */ +mipi_dsi_dcs_write_seq_multi (&ctx,0x2b ,0x00 ,0x00 ,0x0b ,0x8f );/* PASET */ +mipi_dsi_dcs_write_seq_multi (&ctx,0xba ,0x01 );/* scaler setup : scaler off */ +s6e3ha8_test_key_off_lvl2 (&ctx); +mipi_dsi_dcs_write_seq_multi (&ctx,0x35 ,0x00 );/* TE Vsync ON */ +s6e3ha8_test_key_on_lvl2 (&ctx); +mipi_dsi_dcs_write_seq_multi (&ctx,0xed ,0x4c );/* ERR_FG */ +s6e3ha8_test_key_off_lvl2 (&ctx); +s6e3ha8_test_key_on_lvl3 (&ctx); +/* FFC Setting 897.6Mbps */ +mipi_dsi_dcs_write_seq_multi (&ctx,0xc5 ,0x0d ,0x10 ,0xb4 ,0x3e ,0x01 ); +s6e3ha8_test_key_off_lvl3 (&ctx); +s6e3ha8_test_key_on_lvl2 (&ctx); +mipi_dsi_dcs_write_seq_multi (&ctx,0xb9 , +0x00 ,0xb0 ,0x81 ,0x09 ,0x00 ,0x00 ,0x00 , +0x11 ,0x03 );/* TSP HSYNC Setting */ +s6e3ha8_test_key_off_lvl2 (&ctx); +s6e3ha8_test_key_on_lvl2 (&ctx); +mipi_dsi_dcs_write_seq_multi (&ctx,0xb0 ,0x03 ); +mipi_dsi_dcs_write_seq_multi (&ctx,0xf6 ,0x43 ); +s6e3ha8_test_key_off_lvl2 (&ctx); +s6e3ha8_test_key_on_lvl2 (&ctx); +/* Brightness condition set */ +mipi_dsi_dcs_write_seq_multi (&ctx,0xca , +0x07 ,0x00 ,0x00 ,0x00 ,0x80 ,0x80 ,0x80 , +0x80 ,0x80 ,0x80 ,0x80 ,0x80 ,0x80 ,0x80 , +0x80 ,0x80 ,0x80 ,0x80 ,0x80 ,0x80 ,0x80 , +0x80 ,0x80 ,0x80 ,0x80 ,0x80 ,0x80 ,0x80 , +0x80 ,0x80 ,0x80 ,0x00 ,0x00 ,0x00 ); +mipi_dsi_dcs_write_seq_multi (&ctx,0xb1 ,0x00 ,0x0c );/* AID Set : 0% */ +mipi_dsi_dcs_write_seq_multi (&ctx,0xb5 , +0x19 ,0xdc ,0x16 ,0x01 ,0x34 ,0x67 ,0x9a , +0xcd ,0x01 ,0x22 ,0x33 ,0x44 ,0x00 ,0x00 , +0x05 ,0x55 ,0xcc ,0x0c ,0x01 ,0x11 ,0x11 , +0x10 );/* MPS/ELVSS Setting */ +mipi_dsi_dcs_write_seq_multi (&ctx,0xf4 ,0xeb ,0x28 );/* VINT */ +mipi_dsi_dcs_write_seq_multi (&ctx,0xf7 ,0x03 );/* Gamma, LTPS(AID) update */ +s6e3ha8_test_key_off_lvl2 (&ctx); +s6e3ha8_test_key_off_lvl1 (&ctx); + +return ctx.accum_err;
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c line 154
Quoted 10 lines
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c new file +10
-0+} + +static int s6e3ha8_enable (struct drm_panel *panel) +{ +struct s6e3ha8 *priv =to_s6e3ha8_amb577px01_wqhd (panel); +struct mipi_dsi_device *dsi = priv->dsi; +struct mipi_dsi_multi_context ctx = { .dsi = dsi }; + +s6e3ha8_test_key_on_lvl1 (&ctx); + ctx.accum_err =mipi_dsi_dcs_set_display_on (dsi);
Use mipi_dsi_dcs_set_display_on_multi
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c line 167
Quoted 13 lines
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c new file +13
-0+s6e3ha8_test_key_off_lvl1 (&ctx); + +return ctx.accum_err; +} + +static int s6e3ha8_disable (struct drm_panel *panel) +{ +struct s6e3ha8 *priv =to_s6e3ha8_amb577px01_wqhd (panel); +struct mipi_dsi_device *dsi = priv->dsi; +struct mipi_dsi_multi_context ctx = { .dsi = dsi }; + +s6e3ha8_test_key_on_lvl1 (&ctx); + ctx.accum_err =mipi_dsi_dcs_set_display_off (dsi);
Use mipi_dsi_dcs_set_display_off_multi
Quoted 91 lines
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c new file +91
-0+s6e3ha8_test_key_off_lvl1 (&ctx); +mipi_dsi_msleep (&ctx,20 ); + +s6e3ha8_test_key_on_lvl2 (&ctx); +s6e3ha8_afc_off (&ctx); +s6e3ha8_test_key_off_lvl2 (&ctx); + +mipi_dsi_msleep (&ctx,160 ); + +return ctx.accum_err; +} + +static int s6e3ha8_amb577px01_wqhd_prepare (struct drm_panel *panel) +{ +struct s6e3ha8 *priv =to_s6e3ha8_amb577px01_wqhd (panel); +struct mipi_dsi_device *dsi = priv->dsi; +struct mipi_dsi_multi_context ctx = { .dsi = dsi }; +struct drm_dsc_picture_parameter_set pps; +int ret; + + ret =regulator_bulk_enable (ARRAY_SIZE (priv->supplies), priv->supplies); +if (ret <0 ) +return ret; +mipi_dsi_msleep (&ctx,120 ); +s6e3ha8_amb577px01_wqhd_reset (priv); + + ret =s6e3ha8_amb577px01_wqhd_on (priv); +if (ret <0 ) { +gpiod_set_value_cansleep (priv->reset_gpio,1 ); + goto err; + } + +drm_dsc_pps_payload_pack (&pps, &priv->dsc); + +s6e3ha8_test_key_on_lvl1 (&ctx); +mipi_dsi_picture_parameter_set_multi (&ctx, &pps); +s6e3ha8_test_key_off_lvl1 (&ctx); + +mipi_dsi_msleep (&ctx,28 ); + +return ctx.accum_err; +err: +regulator_bulk_disable (ARRAY_SIZE (priv->supplies), priv->supplies); +return ret; +} + +static int s6e3ha8_amb577px01_wqhd_unprepare (struct drm_panel *panel) +{ +struct s6e3ha8 *priv =to_s6e3ha8_amb577px01_wqhd (panel); + +return regulator_bulk_disable (ARRAY_SIZE (priv->supplies), priv->supplies); +} + +static const struct drm_display_mode s6e3ha8_amb577px01_wqhd_mode = { + .clock = (1440 +116 +44 +120 ) * (2960 +120 +80 +124 ) *60 /1000 , + .hdisplay =1440 , + .hsync_start =1440 +116 , + .hsync_end =1440 +116 +44 , + .htotal =1440 +116 +44 +120 , + .vdisplay =2960 , + .vsync_start =2960 +120 , + .vsync_end =2960 +120 +80 , + .vtotal =2960 +120 +80 +124 , + .width_mm =64 , + .height_mm =132 , +}; + +static int s6e3ha8_amb577px01_wqhd_get_modes (struct drm_panel *panel, +struct drm_connector *connector) +{ +return drm_connector_helper_get_modes_fixed (connector, &s6e3ha8_amb577px01_wqhd_mode); +} + +static const struct drm_panel_funcs s6e3ha8_amb577px01_wqhd_panel_funcs = { + .prepare = s6e3ha8_amb577px01_wqhd_prepare, + .unprepare = s6e3ha8_amb577px01_wqhd_unprepare, + .get_modes = s6e3ha8_amb577px01_wqhd_get_modes, + .enable = s6e3ha8_enable, + .disable = s6e3ha8_disable, +}; + +static int s6e3ha8_amb577px01_wqhd_probe (struct mipi_dsi_device *dsi) +{ +struct device *dev = &dsi->dev; +struct s6e3ha8 *priv; +int ret; + + priv =devm_kzalloc (dev,sizeof (*priv),GFP_KERNEL ); +if (!priv) +return -ENOMEM ; +
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c line 268
Quoted 10 lines
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c new file +10
-0+ priv->supplies[0 ].supply ="vdd3" ; + priv->supplies[1 ].supply ="vci" ; + priv->supplies[2 ].supply ="vddr" ; + + ret =devm_regulator_bulk_get (dev,ARRAY_SIZE (priv->supplies), + priv->supplies); +if (ret <0 ) { +dev_err (dev,"failed to get regulators: %d\n" , ret); +return ret; + }
Perhaps you can try to switch to devm_regulator_bulk_get_const()
Quoted 67 lines
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c new file +66
-0+ + priv->reset_gpio =devm_gpiod_get (dev,"reset" ,GPIOD_OUT_HIGH ); +if (IS_ERR (priv->reset_gpio)) +return dev_err_probe (dev,PTR_ERR (priv->reset_gpio), +"Failed to get reset-gpios\n" ); + + priv->dsi = dsi; +mipi_dsi_set_drvdata (dsi, priv); + + dsi->lanes =4 ; + dsi->format =MIPI_DSI_FMT_RGB888 ; + dsi->mode_flags =MIPI_DSI_CLOCK_NON_CONTINUOUS | +MIPI_DSI_MODE_VIDEO_NO_HFP |MIPI_DSI_MODE_VIDEO_NO_HBP | +MIPI_DSI_MODE_VIDEO_NO_HSA |MIPI_DSI_MODE_NO_EOT_PACKET ; + +drm_panel_init (&priv->panel, dev, &s6e3ha8_amb577px01_wqhd_panel_funcs, +DRM_MODE_CONNECTOR_DSI ); + priv->panel.prepare_prev_first = true; + +drm_panel_add (&priv->panel); + +/* This panel only supports DSC; unconditionally enable it */ + dsi->dsc = &priv->dsc; + + priv->dsc.dsc_version_major =1 ; + priv->dsc.dsc_version_minor =1 ; + + priv->dsc.slice_height =40 ; + priv->dsc.slice_width =720 ; +WARN_ON (1440 % priv->dsc.slice_width); + priv->dsc.slice_count =1440 / priv->dsc.slice_width; + priv->dsc.bits_per_component =8 ; + priv->dsc.bits_per_pixel =8 <<4 ;/* 4 fractional bits */ + priv->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 (&priv->panel); +return ret; + } + +return 0 ; +} + +static void s6e3ha8_amb577px01_wqhd_remove (struct mipi_dsi_device *dsi) +{ +struct s6e3ha8 *priv =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 (&priv->panel); +} + +static const struct of_device_id s6e3ha8_amb577px01_wqhd_of_match[] = { + { .compatible ="samsung,s6e3ha8" }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (of, s6e3ha8_amb577px01_wqhd_of_match); + +static struct mipi_dsi_driver s6e3ha8_amb577px01_wqhd_driver = { + .probe = s6e3ha8_amb577px01_wqhd_probe, + .remove = s6e3ha8_amb577px01_wqhd_remove,
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c line 344
Quoted 10 lines
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c new file +10
-0+ .driver = { + .name = "panel-s6e3ha8", + .of_match_table = s6e3ha8_amb577px01_wqhd_of_match, + }, +}; +module_mipi_dsi_driver (s6e3ha8_amb577px01_wqhd_driver); + +MODULE_AUTHOR ("Dzmitry Sankouski <[email protected]>" ); +MODULE_DESCRIPTION ("DRM driver for S6E3HA8 panel" ); +MODULE_LICENSE ("GPL" );
With that fixes:
Thanks,
Neil