From 0f34fd3a17d058784a5c5d8a155d9f4a5b260fa8 Mon Sep 17 00:00:00 2001 From: wangjiao Date: Tue, 16 Oct 2018 15:49:34 +0800 Subject: [PATCH] (CR):[Kane]:[factory]add default lcd driver Change-Id: I75f1849fcbab90a53bb952febc27ab1e1560233a Signed-off-by: wangjiao --- .../dts/exynos/exynos9610-display-lcd.dtsi | 36 +++ drivers/video/fbdev/exynos/dpu20/dsim.h | 1 + drivers/video/fbdev/exynos/dpu20/dsim_drv.c | 10 +- .../video/fbdev/exynos/dpu20/panels/Makefile | 3 +- .../exynos/dpu20/panels/default_lcd_ctrl.c | 130 +++++++++++ .../exynos/dpu20/panels/default_mipi_lcd.c | 207 ++++++++++++++++++ .../fbdev/exynos/dpu20/panels/default_param.h | 52 +++++ .../fbdev/exynos/dpu20/panels/lcd_ctrl.h | 11 + 8 files changed, 445 insertions(+), 5 deletions(-) mode change 100644 => 100755 arch/arm64/boot/dts/exynos/exynos9610-display-lcd.dtsi mode change 100644 => 100755 drivers/video/fbdev/exynos/dpu20/dsim.h mode change 100644 => 100755 drivers/video/fbdev/exynos/dpu20/panels/Makefile create mode 100755 drivers/video/fbdev/exynos/dpu20/panels/default_lcd_ctrl.c create mode 100755 drivers/video/fbdev/exynos/dpu20/panels/default_mipi_lcd.c create mode 100755 drivers/video/fbdev/exynos/dpu20/panels/default_param.h mode change 100644 => 100755 drivers/video/fbdev/exynos/dpu20/panels/lcd_ctrl.h diff --git a/arch/arm64/boot/dts/exynos/exynos9610-display-lcd.dtsi b/arch/arm64/boot/dts/exynos/exynos9610-display-lcd.dtsi old mode 100644 new mode 100755 index f8795b5d643e..ff6a2523153a --- a/arch/arm64/boot/dts/exynos/exynos9610-display-lcd.dtsi +++ b/arch/arm64/boot/dts/exynos/exynos9610-display-lcd.dtsi @@ -290,6 +290,42 @@ hdr_max_avg_luma = <1200000>; /* 120 */ hdr_min_luma = <5>; /* 0.0005 */ }; + + default: default { + device_type = "default-lcd-vdo"; + mode = <0>; /* 0: video mode, 1: DP command mode, 2: MIPI command mode */ + resolution = <1080 2270>; + size = <80 120>; + timing,refresh = <60>; + timing,h-porch = <20 40 40>; + timing,v-porch = <2 10 10>; + timing,dsi-hs-clk = <1300>; + /* TODO : pms value to be set */ + timing,pmsk = <1 100 1 0>; + timing,dsi-escape-clk = <20>; + mic_en = <0>; /* 0: Disable, 1: Enable */ + mic_ratio = <0>; /* 0: 1/2 mic, 1: 1/3 mic */ + mic_ver = <0>; /* 0: mic v1.1, 1: v1.2, 2: v2.0 */ + type_of_ddi = <2>; /* 0: Samsung Mobile, 1: MAGNA, 2: Normal(Etc) */ + dsc_en = <0>; /* 0: Disable, 1: Enable */ + dsc_cnt = <0>; /* used DSC count */ + dsc_slice_num = <0>; /* count of dsc slice */ + data_lane = <4>; /* number of using data lane */ + cmd_underrun_lp_ref = <4942>; /* for underrun detect at command mode*/ + vt_compensation = <14>; /* for underrun detect at video mode*/ + mres_en = <0>; + mres_number = <3>; + mres_width = <1440 1080 720>; + mres_height = <2960 2220 1480>; + mres_dsc_width = <720 540 360>; + mres_dsc_height = <40 30 74>; + mres_dsc_en = <1 1 0>; + hdr_num = <1>; /* max: 4 */ + hdr_type = <2 0 0 0>; /* 1: DOLBY_VISION, 2: HDR10, 3: HLG */ + hdr_max_luma = <5400000>; /* 540 */ + hdr_max_avg_luma = <1200000>; /* 120 */ + hdr_min_luma = <5>; /* 0.0005 */ + }; }; }; }; diff --git a/drivers/video/fbdev/exynos/dpu20/dsim.h b/drivers/video/fbdev/exynos/dpu20/dsim.h old mode 100644 new mode 100755 index 396872e93c44..3d7bb26fce6c --- a/drivers/video/fbdev/exynos/dpu20/dsim.h +++ b/drivers/video/fbdev/exynos/dpu20/dsim.h @@ -81,6 +81,7 @@ extern struct dsim_lcd_driver s6e3aa2_mipi_lcd_driver; extern struct dsim_lcd_driver s6e3fa0_mipi_lcd_driver; extern struct dsim_lcd_driver s6e3fa7_mipi_lcd_driver; extern struct dsim_lcd_driver nt36672a_mipi_lcd_driver; +extern struct dsim_lcd_driver default_mipi_lcd_driver; /* define video timer interrupt */ enum { diff --git a/drivers/video/fbdev/exynos/dpu20/dsim_drv.c b/drivers/video/fbdev/exynos/dpu20/dsim_drv.c index 3e24f4e54d9f..92a6c42b5397 100755 --- a/drivers/video/fbdev/exynos/dpu20/dsim_drv.c +++ b/drivers/video/fbdev/exynos/dpu20/dsim_drv.c @@ -1561,8 +1561,9 @@ static void dsim_parse_lcd_info(struct dsim_device *dsim) break; default: - dsim_info("can't read ddi_device_type\n"); - BUG(); + dsim_info("read ddi_device_type default lcd\n"); + ddi_device_type = "default-lcd-vdo"; + dsim_info("ddi type : %s\n", ddi_device_type); break; } @@ -1790,8 +1791,9 @@ static void dsim_register_panel(struct dsim_device *dsim) dsim_info("panel ops : nt36672a_mipi_lcd_driver\n"); break; default: - dsim_info("panel ops is not bind\n"); - BUG(); + dsim_info("panel ops is default lcd\n"); + dsim->panel_ops = &default_mipi_lcd_driver; + dsim_info("panel ops : default_mipi_lcd_driver\n"); break; } } diff --git a/drivers/video/fbdev/exynos/dpu20/panels/Makefile b/drivers/video/fbdev/exynos/dpu20/panels/Makefile old mode 100644 new mode 100755 index 56f166b663dd..bd1967ce542e --- a/drivers/video/fbdev/exynos/dpu20/panels/Makefile +++ b/drivers/video/fbdev/exynos/dpu20/panels/Makefile @@ -1,5 +1,6 @@ obj-$(CONFIG_EXYNOS_DECON_LCD_MULTI) += s6e3fa0_mipi_lcd.o s6e3fa0_lcd_ctrl.o \ - nt36672a_mipi_lcd.o nt36672a_lcd_ctrl.o + nt36672a_mipi_lcd.o nt36672a_lcd_ctrl.o \ + default_mipi_lcd.o default_lcd_ctrl.o obj-$(CONFIG_EXYNOS_DECON_LCD_S6E3HA2K) += s6e3ha2k_mipi_lcd.o s6e3ha2k_lcd_ctrl.o obj-$(CONFIG_EXYNOS_DECON_LCD_S6E3HF4) += s6e3hf4_mipi_lcd.o s6e3hf4_lcd_ctrl.o obj-$(CONFIG_EXYNOS_DECON_LCD_S6E3HA6) += s6e3ha6_mipi_lcd.o s6e3ha6_lcd_ctrl.o diff --git a/drivers/video/fbdev/exynos/dpu20/panels/default_lcd_ctrl.c b/drivers/video/fbdev/exynos/dpu20/panels/default_lcd_ctrl.c new file mode 100755 index 000000000000..db8d789b5b47 --- /dev/null +++ b/drivers/video/fbdev/exynos/dpu20/panels/default_lcd_ctrl.c @@ -0,0 +1,130 @@ +/* drivers/video/fbdev/exynos/dpu20/panels/default_lcd_ctrl.c + * + * Samsung SoC MIPI LCD CONTROL functions + * + * Copyright (c) 2018 Samsung Electronics + * + * Hwangjae Lee, + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ +#include "default_param.h" +#include "lcd_ctrl.h" + +/* use FW_TEST definition when you test CAL on firmware */ +/* #define FW_TEST */ +#ifdef FW_TEST +#include "../dsim_fw.h" +#include "mipi_display.h" +#else +#include "../dsim.h" +#include