From ef45d556725b6e29196e805795a9a2756fa6d706 Mon Sep 17 00:00:00 2001 From: Jack Knightly Date: Fri, 14 Oct 2022 20:58:17 +0200 Subject: [PATCH 08/13] Add s6evr02 panel This adds the s6evr02 panel which the Samsung Galaxy Note II uses. After this is merged I will create another MR for t0lte to be added as a new device. PLEASE NOTE - I did not write the panel driver, but merely brought up an old driver that worked with mainline a few years ago. The driver was written by forkbomb and can be found here: https://github.com/fourkbomb/linux/blob/master/drivers/gpu/drm/panel/panel-samsung-s6evr02.c Given it is based on another panel driver that is still in mainline today, I applied the commits that that panel driver underwent between then and now, and it works. --- arch/arm/boot/dts/exynos4412-n710x.dts | 69 ++ drivers/gpu/drm/panel/Kconfig | 6 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-samsung-s6evr02.c | 764 ++++++++++++++++++ 4 files changed, 840 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-samsung-s6evr02.c diff --git a/arch/arm/boot/dts/exynos4412-n710x.dts b/arch/arm/boot/dts/exynos4412-n710x.dts index 9ae05b0d684c..da0e475b1063 100644 --- a/arch/arm/boot/dts/exynos4412-n710x.dts +++ b/arch/arm/boot/dts/exynos4412-n710x.dts @@ -38,6 +38,75 @@ &cam_io_reg { status = "okay"; }; + +&dsi_0 { + vddcore-supply = <&ldo8_reg>; + vddio-supply = <&ldo10_reg>; + samsung,burst-clock-frequency = <500000000>; + samsung,esc-clock-frequency = <20000000>; + samsung,pll-clock-frequency = <24000000>; + status = "okay"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@1 { + reg = <1>; + + dsi_out: endpoint@0 { + samsung,burst-clock-frequency = <500000000>; + samsung,esc-clock-frequency = <20000000>; + //status = "disabled"; + remote-endpoint = <&dsi_in_s6evr02>; + status = "okay"; + }; + + }; + + }; + + s6evr02: panel-s6evr02@0 { + compatible = "samsung,s6evr02"; + reg = <0>; + vdd3-supply = <&ldo13_reg>; + vci-supply = <&ldo25_reg>; + reset-gpios = <&gpf2 1 GPIO_ACTIVE_HIGH>; + power-on-delay = <50>; + reset-delay = <100>; + init-delay = <100>; + panel-width-mm = <69>; + panel-height-mm = <123>; + // HIGH means s6evr02 + present-gpios = <&gpf1 0 GPIO_ACTIVE_HIGH>; + //status = "disabled"; + status = "okay"; + + display-timings { + timing0_s6evr02: timing-0 { + clock-frequency = <62614944>; + hactive = <720>; + vactive = <1280>; + hfront-porch = <70>; + hback-porch = <40>; + hsync-len = <3>; + vfront-porch = <13>; + vback-porch = <1>; + vsync-len = <2>; + }; + }; + + port { + dsi_in_s6evr02: endpoint { + //status = "disabled"; + remote-endpoint = <&dsi_out>; + status = "okay"; + }; + }; + }; + +}; + &i2c_3 { samsung,i2c-sda-delay = <100>; samsung,i2c-slave-addr = <0x10>; diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index a9043eacce97..6b7c6ef55a01 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -536,6 +536,12 @@ config DRM_PANEL_SAMSUNG_S6E8AA0 depends on OF select DRM_MIPI_DSI select VIDEOMODE_HELPERS + +config DRM_PANEL_SAMSUNG_S6EVR02 + tristate "Samsung S6EVR02 DSI video mode panel" + depends on OF + select DRM_MIPI_DSI + select VIDEOMODE_HELPERS config DRM_PANEL_SAMSUNG_SOFEF00 tristate "Samsung sofef00/s6e3fc2x01 OnePlus 6/6T DSI cmd mode panels" diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 34e717382dbb..b3d149475a38 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -54,6 +54,7 @@ obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0_SPI) += panel-samsung-s6e63m0-spi.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0_DSI) += panel-samsung-s6e63m0-dsi.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E88A0_AMS452EF01) += panel-samsung-s6e88a0-ams452ef01.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0) += panel-samsung-s6e8aa0.o +obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6EVR02) += panel-samsung-s6evr02.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_SOFEF00) += panel-samsung-sofef00.o obj-$(CONFIG_DRM_PANEL_SEIKO_43WVF1G) += panel-seiko-43wvf1g.o obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o diff --git a/drivers/gpu/drm/panel/panel-samsung-s6evr02.c b/drivers/gpu/drm/panel/panel-samsung-s6evr02.c new file mode 100644 index 000000000000..f1612a6c262c --- /dev/null +++ b/drivers/gpu/drm/panel/panel-samsung-s6evr02.c @@ -0,0 +1,764 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * MIPI-DSI based S6EVR02 AMOLED LCD 5.5 inch panel driver. + * + * Copyright (c) 2017 Simon Shields, + * + * Based on the s6e8aa0 panel driver, + * Copyright (c) 2013 Samsung Electronics Co., Ltd + * + * Inki Dae, + * Donghwa Lee, + * Joongmock Shin + * Eunchul Kim + * Tomasz Figa + * Andrzej Hajda +*/ + +#include +#include +#include +#include +#include + +#include +#include