Files
2026-09-22 09:38:26 +08:00

718 lines
18 KiB
Diff
Executable File

From a1990df8e3268324c787614d40ef2812190d21e7 Mon Sep 17 00:00:00 2001
From: sunwen.he <[email protected]>
Date: Fri, 10 Jul 2026 13:14:06 +0800
Subject: [PATCH] Bug #3548825 - bananapi(2c10) lcd ili9881c porting
[root cause ]: none
[changes ]: display
[side effects]: none
[self test ]: none
[download normally]: ok
[power on/off normally]: ok
[do common repository/branch inspection]: none
[is there dependence]: none
[confirm dependent commit]: none
[board]: uis7885
[test case]: selftest
[reviewers]: rui.zhang1 yang.li3 jen.li guangqiao.she bo.zhou
commit_template_version:v1
Change-Id: Idfcb0b7c166ab60178273af04a3bee90c0972437
Signed-off-by: sunwen.he <[email protected]>
---
diff --git a/arch/arm/dts/lcd/lcd_ili9881c_truly_mipi_wxga.dtsi b/arch/arm/dts/lcd/lcd_ili9881c_truly_mipi_wxga.dtsi
new file mode 100755
index 0000000..2c946c4
--- /dev/null
+++ b/arch/arm/dts/lcd/lcd_ili9881c_truly_mipi_wxga.dtsi
@@ -0,0 +1,265 @@
+// SPDX-License-Identifier: GPL-2.0+ OR MIT
+/*
+ * ILI9881C Truly LCD config dtsi file
+ *
+ * Copyright (C) 2026, Unisoc Inc.
+ */
+
+/ { lcds {
+ lcd_ili9881c_truly_mipi_wxga: lcd_ili9881c_truly_mipi_wxga {
+
+ sprd,dsi-work-mode = <1>;
+ sprd,dsi-lane-number = <4>;
+ /*sprd,dual-dsi-en <1>;*/
+ sprd,dsi-color-format = "rgb888";
+
+ sprd,phy-bit-clock = <460800>;
+ sprd,phy-escape-clock = <20000>;/* kHz */
+ /* panel interface type: 2:MIPI; 3:SPI */
+ sprd,panel-if-type = <2>;
+ sprd,power-gpio-delay = <20>;
+ sprd,mipi-port = <1>;
+ /*sprd,dpi-clk-div = <8>;*/
+
+ /*sprd,dsi-switch = <1>;*/
+ /*----Id register ----*/
+ sprd,lcd-id-register = [00 01];
+ sprd,lcd-id-value-len = <1 1>;
+ sprd,lcd-id-value = [98 81];
+ sprd,lcd-id-command = [FF 98 81 01];
+ sprd,lcd-id-tokernel = <0x9881>;
+
+ /*---Bias Power---*/
+ /*sprd,power-i2c-bus = <5>;*/
+ /*sprd,power-i2c-addr = <0x3E>;*/
+ /*sprd,power-i2c-speed = <400000>;*/
+ /*sprd,power-i2c-reg = [00 01 03 FF];*/
+ /*sprd,power-i2c-val = [12 12 03 80];*/
+
+ sprd,reset-on-sequence = <1 5>, <0 5>, <1 20>;
+ sprd,reset-off-sequence = <0 20>;
+
+ sprd,use-dcs-write;
+ sprd,initial-command = [
+ 39 00 00 04 FF 98 81 03
+ 39 00 00 04 FF 98 81 03
+ 23 00 00 02 01 00
+ 23 00 00 02 02 00
+ 23 00 00 02 03 73
+ 23 00 00 02 04 13
+ 23 00 00 02 05 00
+ 23 00 00 02 06 0A
+ 23 00 00 02 07 05
+ 23 00 00 02 08 00
+ 23 00 00 02 09 28
+ 23 00 00 02 0a 00
+ 23 00 00 02 0b 00
+ 23 00 00 02 0c 00
+ 23 00 00 02 0d 28
+ 23 00 00 02 0e 00
+ 23 00 00 02 0f 28
+ 23 00 00 02 10 28
+ 23 00 00 02 11 00
+ 23 00 00 02 12 00
+ 23 00 00 02 13 00
+ 23 00 00 02 14 00
+ 23 00 00 02 15 00
+ 23 00 00 02 16 00
+ 23 00 00 02 17 00
+ 23 00 00 02 18 00
+ 23 00 00 02 19 00
+ 23 00 00 02 1a 00
+ 23 00 00 02 1b 00
+ 23 00 00 02 1c 00
+ 23 00 00 02 1d 00
+ 23 00 00 02 1e 40
+ 23 00 00 02 1f 80
+ 23 00 00 02 20 06
+ 23 00 00 02 21 01
+ 23 00 00 02 22 00
+ 23 00 00 02 23 00
+ 23 00 00 02 24 00
+ 23 00 00 02 25 00
+ 23 00 00 02 26 00
+ 23 00 00 02 27 00
+ 23 00 00 02 28 33
+ 23 00 00 02 29 33
+ 23 00 00 02 2a 00
+ 23 00 00 02 2b 00
+ 23 00 00 02 2c 04
+ 23 00 00 02 2d 04
+ 23 00 00 02 2e 05
+ 23 00 00 02 2f 05
+ 23 00 00 02 30 00
+ 23 00 00 02 31 00
+ 23 00 00 02 32 31
+ 23 00 00 02 33 00
+ 23 00 00 02 34 00
+ 23 00 00 02 35 0A
+ 23 00 00 02 36 00
+ 23 00 00 02 37 08
+ 23 00 00 02 38 00
+ 23 00 00 02 39 00
+ 23 00 00 02 3a 00
+ 23 00 00 02 3b 00
+ 23 00 00 02 3c 00
+ 23 00 00 02 3d 00
+ 23 00 00 02 3e 00
+ 23 00 00 02 3f 00
+ 23 00 00 02 40 00
+ 23 00 00 02 41 00
+ 23 00 00 02 42 00
+ 23 00 00 02 43 08
+ 23 00 00 02 44 00
+ 23 00 00 02 50 01
+ 23 00 00 02 51 23
+ 23 00 00 02 52 44
+ 23 00 00 02 53 67
+ 23 00 00 02 54 89
+ 23 00 00 02 55 ab
+ 23 00 00 02 56 01
+ 23 00 00 02 57 23
+ 23 00 00 02 58 45
+ 23 00 00 02 59 67
+ 23 00 00 02 5a 89
+ 23 00 00 02 5b ab
+ 23 00 00 02 5c cd
+ 23 00 00 02 5d ef
+ 23 00 00 02 5e 11
+ 23 00 00 02 5f 02
+ 23 00 00 02 60 08
+ 23 00 00 02 61 0E
+ 23 00 00 02 62 0F
+ 23 00 00 02 63 0C
+ 23 00 00 02 64 0D
+ 23 00 00 02 65 17
+ 23 00 00 02 66 01
+ 23 00 00 02 67 01
+ 23 00 00 02 68 02
+ 23 00 00 02 69 02
+ 23 00 00 02 6a 00
+ 23 00 00 02 6b 00
+ 23 00 00 02 6c 02
+ 23 00 00 02 6d 02
+ 23 00 00 02 6e 16
+ 23 00 00 02 6f 16
+ 23 00 00 02 70 06
+ 23 00 00 02 71 06
+ 23 00 00 02 72 07
+ 23 00 00 02 73 07
+ 23 00 00 02 74 02
+ 23 00 00 02 75 02
+ 23 00 00 02 76 08
+ 23 00 00 02 77 0E
+ 23 00 00 02 78 0F
+ 23 00 00 02 79 0C
+ 23 00 00 02 7a 0D
+ 23 00 00 02 7b 17
+ 23 00 00 02 7c 01
+ 23 00 00 02 7d 01
+ 23 00 00 02 7e 02
+ 23 00 00 02 7f 02
+ 23 00 00 02 80 00
+ 23 00 00 02 81 00
+ 23 00 00 02 82 02
+ 23 00 00 02 83 02
+ 23 00 00 02 84 16
+ 23 00 00 02 85 16
+ 23 00 00 02 86 06
+ 23 00 00 02 87 06
+ 23 00 00 02 88 07
+ 23 00 00 02 89 07
+ 23 00 00 02 8A 02
+ 39 00 00 04 FF 98 81 04
+ 23 00 00 02 6E 1A
+ 23 00 00 02 6F 37
+ 23 00 00 02 3B C0
+ 23 00 00 02 8D 1F
+ 23 00 00 02 87 BA
+ 23 00 00 02 B2 D1
+ 23 00 00 02 88 0B
+ 23 00 00 02 38 01
+ 23 00 00 02 39 00
+ 23 00 00 02 B5 02
+ 23 00 00 02 31 25
+ 23 00 00 02 3B 98
+ 39 00 00 04 FF 98 81 01
+ 23 00 00 02 22 0A
+ 23 00 00 02 31 00
+ 23 00 00 02 53 62
+ 23 00 00 02 55 7B
+ 23 00 00 02 50 9E
+ 23 00 00 02 51 99
+ 23 00 00 02 60 06
+ 23 00 00 02 62 20
+ 23 00 00 02 B7 00
+ 23 00 00 02 A0 00
+ 23 00 00 02 A1 17
+ 23 00 00 02 A2 26
+ 23 00 00 02 A3 13
+ 23 00 00 02 A4 16
+ 23 00 00 02 A5 29
+ 23 00 00 02 A6 1E
+ 23 00 00 02 A7 1F
+ 23 00 00 02 A8 8B
+ 23 00 00 02 A9 1D
+ 23 00 00 02 AA 2A
+ 23 00 00 02 AB 7B
+ 23 00 00 02 AC 1A
+ 23 00 00 02 AD 19
+ 23 00 00 02 AE 4E
+ 23 00 00 02 AF 24
+ 23 00 00 02 B0 29
+ 23 00 00 02 B1 4F
+ 23 00 00 02 B2 5C
+ 23 00 00 02 B3 23
+ 23 00 00 02 C0 00
+ 23 00 00 02 C1 17
+ 23 00 00 02 C2 26
+ 23 00 00 02 C3 13
+ 23 00 00 02 C4 16
+ 23 00 00 02 C5 29
+ 23 00 00 02 C6 1E
+ 23 00 00 02 C7 1F
+ 23 00 00 02 C8 8B
+ 23 00 00 02 C9 1D
+ 23 00 00 02 CA 2A
+ 23 00 00 02 CB 7B
+ 23 00 00 02 CC 1A
+ 23 00 00 02 CD 19
+ 23 00 00 02 CE 4E
+ 23 00 00 02 CF 24
+ 23 00 00 02 D0 29
+ 23 00 00 02 D1 4F
+ 23 00 00 02 D2 5C
+ 23 00 00 02 D3 23
+ 39 00 00 04 FF 98 81 00
+ 23 78 00 02 11 00
+ 23 32 00 02 29 00
+ ];
+
+ sprd,sleep-in-command = [
+ 13 0A 00 01 28
+ 13 78 00 01 10
+ ];
+ sprd,sleep-out-command = [
+ 13 78 00 01 11
+ 13 64 00 01 29
+ ];
+
+ display-timings {
+ timing0 {
+ clock-frequency = <64000000>;
+ hactive = <800>;
+ vactive = <1280>;
+ hback-porch = <8>;
+ hfront-porch = <24>;
+ vback-porch = <8>;
+ vfront-porch = <24>;
+ hsync-len = <18>;
+ vsync-len = <4>;
+
+ };
+ };
+ };
+};};
diff --git a/arch/arm/dts/uis7885_2c10.dts b/arch/arm/dts/uis7885_2c10.dts
index cd16e99..5fad283 100644
--- a/arch/arm/dts/uis7885_2c10.dts
+++ b/arch/arm/dts/uis7885_2c10.dts
@@ -7,8 +7,9 @@
#include <dt-bindings/gpio/gpio.h>
#include "ums9620.dtsi"
//#include "lcd/lcd_hx8279_revo_mipi.dtsi"
+//#include "lcd/lcd_dummy_mipi.dtsi"
+#include "lcd/lcd_ili9881c_truly_mipi_wxga.dtsi"
#include "lcd/lcd_lt8912b_bridge_mipi_fhd.dtsi"
-#include "lcd/lcd_dummy_mipi.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
diff --git a/arch/arm/dts/uis7885_2h10.dts b/arch/arm/dts/uis7885_2h10.dts
index 38a049e..259e999 100644
--- a/arch/arm/dts/uis7885_2h10.dts
+++ b/arch/arm/dts/uis7885_2h10.dts
@@ -6,10 +6,11 @@
/dts-v1/;
#include <dt-bindings/gpio/gpio.h>
#include "ums9620.dtsi"
-#include "lcd/lcd_g40396_truly_mipi_fhd.dtsi"
-#include "lcd/lcd_nt36672e_truly_mipi_fhd_nodsc.dtsi"
-#include "lcd/lcd_ili7806s_truly_mipi_hdplus.dtsi"
-#include "lcd/lcd_dummy_mipi.dtsi"
+//#include "lcd/lcd_g40396_truly_mipi_fhd.dtsi"
+//#include "lcd/lcd_nt36672e_truly_mipi_fhd_nodsc.dtsi"
+//#include "lcd/lcd_ili7806s_truly_mipi_hdplus.dtsi"
+#include "lcd/lcd_ili9881c_truly_mipi_wxga.dtsi"
+//#include "lcd/lcd_dummy_mipi.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
@@ -185,9 +186,10 @@
lcd-panel {
compatible = "sprd,generic-mipi-panel";
- sprd,lcd-avdd-gpio = <&ap_gpio 192 GPIO_ACTIVE_HIGH>;
- sprd,lcd-avee-gpio = <&ap_gpio 191 GPIO_ACTIVE_HIGH>;
- sprd,lcd-reset-gpio = <&ap_gpio 11 GPIO_ACTIVE_HIGH>;
+ sprd,lcd-iovdd-gpio = <&ap_gpio 187 GPIO_ACTIVE_HIGH>;
+ sprd,lcd-avdd-gpio = <&ap_gpio 153 GPIO_ACTIVE_HIGH>;
+ sprd,lcd-avee-gpio = <&ap_gpio 178 GPIO_ACTIVE_HIGH>;
+ sprd,lcd-reset-gpio = <&ap_gpio 152 GPIO_ACTIVE_HIGH>;
};
lcd-video {
@@ -205,7 +207,3 @@
pcbversion_gpio = <133>;
};
};
-
-&lcd_g40396_truly_mipi_fhd {
- sprd,power-i2c-bus = <6>;
-};
diff --git a/arch/arm/mach-sprd/include/sprd_panel.h b/arch/arm/mach-sprd/include/sprd_panel.h
index 23f75f7..3fb26e5 100644
--- a/arch/arm/mach-sprd/include/sprd_panel.h
+++ b/arch/arm/mach-sprd/include/sprd_panel.h
@@ -179,6 +179,7 @@
/* common parameters */
const char *lcd_name;
u8 type;
+ u8 mipi_port;
// uint8_t fps;
u16 width;
u16 height;
diff --git a/configs/uis7885_2h10_defconfig b/configs/uis7885_2h10_defconfig
index a5effb5..8f32d73 100644
--- a/configs/uis7885_2h10_defconfig
+++ b/configs/uis7885_2h10_defconfig
@@ -162,7 +162,7 @@
CONFIG_LOG_2_FLASH=y
CONFIG_LOG=y
-CONFIG_LOGLEVEL=4
+CONFIG_LOGLEVEL=7
CONFIG_WDT=y
# CONFIG_HW_WATCHDOG is not set
diff --git a/drivers/video/sprd/dispc/dpu_r6p0.c b/drivers/video/sprd/dispc/dpu_r6p0.c
index 0ef99ee..41ebc7a 100644
--- a/drivers/video/sprd/dispc/dpu_r6p0.c
+++ b/drivers/video/sprd/dispc/dpu_r6p0.c
@@ -1022,6 +1022,11 @@
/* disalbe halt enable for SPRD DSI */
reg_val |= BIT(16);
+ /* swap mipi0 & mipi1 output*/
+ if(panel->mipi_port == 1){
+ reg_val |= BIT(1);
+ }
+
if (panel->work_mode == SPRD_MIPI_MODE_CMD && panel->dsc_en)
reg_val |= BIT(0);
diff --git a/drivers/video/sprd/panel-if/panel_ops_mipi.c b/drivers/video/sprd/panel-if/panel_ops_mipi.c
index 77e1759..860b132 100644
--- a/drivers/video/sprd/panel-if/panel_ops_mipi.c
+++ b/drivers/video/sprd/panel-if/panel_ops_mipi.c
@@ -136,7 +136,6 @@
struct dsi_cmd_desc *cmds = (struct dsi_cmd_desc *)data;
int (*mipi_write)(struct sprd_dsi *dsi, u8 *param, u16 len) =
mipi_dsi_gen_write;
-
if (!cmds || !dsi)
return -1;
@@ -239,7 +238,6 @@
int ret;
#endif
struct panel_info *info = &panel_device;
-
dump_panel_info(info);
#ifdef CONFIG_LCDC_MIPI
@@ -249,7 +247,6 @@
printf("%s, mipi lcdc download init code success!\n", __func__);
#else
mipi_dsi_lp_cmd_enable(dsi, true);
-
mipi_dsi_send_cmds(dsi, info->cmds[CMD_CODE_INIT], info->cmds_len[CMD_CODE_INIT]);
if (info->work_mode == SPRD_MIPI_MODE_CMD) {
@@ -276,17 +273,24 @@
struct panel_info *info = &panel_device;
dump_panel_info(info);
-
+#ifdef CONFIG_LCDC_MIPI
+ //before send init code, may be lcdc_reset and dsi config and panel reset
+ ret = mipi_lcdc_send_cmds(info->cmds[CMD_CODE_INIT], info->cmds_len[CMD_CODE_INIT]);
+ if (!ret)
+ printf("%s, mipi lcdc download init code success!\n", __func__);
+#else
mipi_dsi_lp_cmd_enable(dsi, true);
-
+ mipi_dsi_send_cmds(dsi, info->cmds[CMD_CODE_INIT], info->cmds_len[CMD_CODE_INIT]);
if (info->work_mode == SPRD_MIPI_MODE_CMD)
mipi_dsi_set_work_mode(dsi, SPRD_MIPI_MODE_CMD);
- else
+ else{
mipi_dsi_set_work_mode(dsi, SPRD_MIPI_MODE_VIDEO);
-
+ if (info->video_lp_cmd_enable)
+ mipi_dsi_lp_cmd_enable(dsi, true);
+ }
mipi_dsi_state_reset(dsi);
mipi_dphy_hs_clk_en(dphy, true);
-
+#endif
pr_info("Set Slave Status Success!\n");
return 0;
@@ -307,7 +311,8 @@
int read_len = 0;
struct udevice *panel_dev = NULL;
int ret;
-
+ if(info->mipi_port == 1)
+ dsi = &dsi_slave_device;
ret = uclass_get_device(UCLASS_PANEL, 0, &panel_dev);
if (ret) {
pr_info("can't get panel parse dts\n");
@@ -363,8 +368,8 @@
info->cmds_len[CMD_CODE_READ_ID]);
}
- mipi_dsi_set_max_return_size(dsi, id->val_items);
-
+ //mipi_dsi_set_max_return_size(dsi, id->val_items);
+ mipi_dsi_set_max_return_size(dsi, 1);
//Read LCM Register ID
for (i = 0; i < id->reg_items; i++) {
int t = 0;
diff --git a/drivers/video/sprd/qogirn6pro/global_dphy.c b/drivers/video/sprd/qogirn6pro/global_dphy.c
index 5921f49..3d8e41a 100644
--- a/drivers/video/sprd/qogirn6pro/global_dphy.c
+++ b/drivers/video/sprd/qogirn6pro/global_dphy.c
@@ -39,9 +39,13 @@
static void dphy_s_glb_enable(struct dphy_context *ctx)
{
/* dual-dphy use the same pll*/
- sci_glb_set(SPRD_AON_ANLG_PHY_G3_PHYS + 0x64, BIT(29) | BIT(30) | BIT(31));
- sci_glb_clr(SPRD_AON_ANLG_PHY_G3_PHYS, BIT(1));
- sci_glb_set(SPRD_AON_ANLG_PHY_G3_PHYS, BIT(0) | BIT(2));
+ if(ctx->mipi_port == 1)
+ sci_glb_set(SPRD_AON_ANLG_PHY_G3_PHYS, BIT(1));
+ else{
+ sci_glb_set(SPRD_AON_ANLG_PHY_G3_PHYS + 0x64, BIT(29) | BIT(30) | BIT(31));
+ sci_glb_clr(SPRD_AON_ANLG_PHY_G3_PHYS, BIT(1));
+ sci_glb_set(SPRD_AON_ANLG_PHY_G3_PHYS, BIT(0) | BIT(2));
+ }
sci_glb_set(SPRD_DPU_VSP_APB_REG_PHYS + 0x1c, BIT(2) | BIT(3));
}
diff --git a/drivers/video/sprd/qogirn6pro/global_dsi.c b/drivers/video/sprd/qogirn6pro/global_dsi.c
index ad71123..aaa3274 100644
--- a/drivers/video/sprd/qogirn6pro/global_dsi.c
+++ b/drivers/video/sprd/qogirn6pro/global_dsi.c
@@ -83,7 +83,7 @@
.reset = dsi_s_reset,
.enable = dsi_s_glb_enable,
.disable = dsi_s_glb_disable,
- .power = NULL,
+ .power = dsi_power_domain,
};
struct dsi_glb_ops *dsi_glb_ops_attach(void)
diff --git a/drivers/video/sprd/sprd_dphy.c b/drivers/video/sprd/sprd_dphy.c
index 9107d60..172025d 100644
--- a/drivers/video/sprd/sprd_dphy.c
+++ b/drivers/video/sprd/sprd_dphy.c
@@ -120,6 +120,7 @@
dphy->ctx.freq = dphy->panel->phy_freq;
dphy->ctx.lanes = dphy->panel->lane_num;
dphy->ctx.is_dsi_switch = dphy->panel->is_dsi_switch;
+ dphy->ctx.mipi_port = dphy->panel->mipi_port;
return 0;
}
diff --git a/drivers/video/sprd/sprd_dphy.h b/drivers/video/sprd/sprd_dphy.h
index 32c502a..830e1edc 100644
--- a/drivers/video/sprd/sprd_dphy.h
+++ b/drivers/video/sprd/sprd_dphy.h
@@ -25,6 +25,7 @@
u8 lanes;
u8 id;
bool is_dsi_switch;
+ u32 mipi_port;
};
struct dphy_pll_ops {
diff --git a/drivers/video/sprd/sprd_main.c b/drivers/video/sprd/sprd_main.c
index f6d6972..4d0358f 100644
--- a/drivers/video/sprd/sprd_main.c
+++ b/drivers/video/sprd/sprd_main.c
@@ -285,7 +285,6 @@
#else
int ret;
struct udevice *pwm = NULL;
-
if (brightness > 250) {
brightness = 250;
pr_info("brightness exceed limit value set maxvalue\n");
@@ -294,8 +293,7 @@
ret = uclass_get_device(UCLASS_PWM, 0, &pwm);
if (ret)
- pr_err("Can't get pwm: %d\n", ret);
-
+ pr_err("Can't get pwm: %d\n", ret);
pwm_set_config(pwm, 0, 10000, value);
#endif
}
@@ -423,6 +421,7 @@
sci_glb_clr(REG_AON_APB_APB_EB1, BIT_AON_APB_AON_CAM_EB);
#endif
}
+
set_backlight(backlight_value);
#endif
backlight_on_time = sprd_get_tick_count();
@@ -430,6 +429,8 @@
uboot_consume_time = backlight_on_time - uboot_start_time;
printf("uboot consume time:%dms, lcd init consume:%dms, backlight on time:%dms\n",
uboot_consume_time, lcd_init_time, backlight_on_time);
+
+ //while(1){}
}
int get_logo_bin_info(u8 *bmp, char *logo_part_name)
diff --git a/drivers/video/sprd/sprd_panel.c b/drivers/video/sprd/sprd_panel.c
index a73c239..b6c9b88 100644
--- a/drivers/video/sprd/sprd_panel.c
+++ b/drivers/video/sprd/sprd_panel.c
@@ -116,6 +116,7 @@
case SPRD_PANEL_TYPE_MIPI:
sprd_dsi_slave_probe();
sprd_dphy_slave_probe();
+ panel_drv->ops = mipi_ops_attach();
return 0;
case SPRD_PANEL_TYPE_SPI:
@@ -155,6 +156,31 @@
return -1;
}
}
+static int panel_slave_if_uinit(struct udevice *dev)
+{
+ int type = panel_drv->info->type;
+
+ switch (type) {
+ case SPRD_PANEL_TYPE_MIPI:
+ sprd_dphy_suspend(&dphy_slave_device);
+ sprd_dsi_suspend(&dsi_slave_device);
+ panel_drv->ops = NULL;
+ return 0;
+
+ case SPRD_PANEL_TYPE_SPI:
+ panel_drv->ops = NULL;
+#ifdef CONFIG_LCDC_R1P0
+ dm_gpio_free(dev, &panel_device.spi_cd_pin);
+#endif
+ return 0;
+ case SPRD_PANEL_TYPE_RGB:
+ return 0;
+
+ default:
+ pr_err("doesn't support current interface type %d\n", type);
+ return -1;
+ }
+}
int fdt_getprop_u32(const void *fdt, int off, const char *prop, u32 *dflt)
{
@@ -252,6 +278,7 @@
const void *str = NULL;
#ifdef CONFIG_LCDC_R1P0
+
str = fdt_getprop(fdt, offset, "init-data", &len);
if (!str) {
pr_err("can't get init-data\n");
@@ -276,6 +303,7 @@
info->cmds[CMD_CODE_SLEEP_OUT] = str;
info->cmds_len[CMD_CODE_SLEEP_OUT] = len;
#else
+
str = fdt_getprop(fdt, offset, "sprd,initial-command", &len);
if (!str) {
pr_err("Can't get sprd,initial-command\n");
@@ -656,7 +684,12 @@
if (!ret)
info->bias_volt.i2c_speed = val;
}
-
+ ret = fdt_getprop_u32(fdt, offset, "sprd,mipi-port", &val);
+ if (!ret)
+ info->mipi_port = val;
+ else
+ info->mipi_port = 0;
+ pr_info("lcd info->mipi_port=%d\n",info->mipi_port);
/*------If Use Panel internal backlight-------*/
ret = fdt_getprop_u32(fdt, offset, "sprd,bl-i2c-bus", &val);
if (!ret) {
@@ -850,7 +883,10 @@
of_parse_timing(fdt, offset, info);
}
//get ops
- panel_if_init();
+ if(info->mipi_port == 0)
+ panel_if_init();
+ else
+ panel_slave_if_init();
ops = panel_drv->ops;
if (ops && ops->power) {
printf("enter power panel\n");
@@ -859,7 +895,8 @@
if (ops && ops->read_id) {
ret = ops->read_id();
- if (!ret) {
+ if (!ret)
+ {
of_parse_initdata(fdt, offset, info);
printf("attach panel 0x%x success\n",
info->lcd_id);
@@ -869,8 +906,10 @@
if (ops && ops->power)
ops->power(dev, false);
-
- panel_if_uinit(panel_dev);
+ if(info->mipi_port == 0)
+ panel_if_uinit(panel_dev);
+ else
+ panel_slave_if_uinit(panel_dev);
pr_err("Try to attach panel 0x%x failed, try next...\n",
info->lcd_id);
@@ -878,17 +917,31 @@
if (ret) {
pr_err("No Panel Attached!\n");
- return -1;
+ //return -1;
}
- if (info->dual_dsi_en)
- panel_slave_if_init();
+ if (info->dual_dsi_en){
+ if(info->mipi_port == 0)
+ panel_slave_if_init();
+ else
+ panel_if_init();
+ }
- if (ops && ops->init)
- ops->init();
+ if (ops && ops->init){
+ if(info->mipi_port == 0){
+ ops->init();
+ }
+ else
+ ops->slave_init();
+ }
+ if (info->dual_dsi_en){
+ if(info->mipi_port == 0)
+ ops->slave_init();
- if (info->dual_dsi_en)
- ops->slave_init();
+ else
+ ops->init();
+ }
+
panel_info.vl_row = info->height;
panel_info.vl_col = info->width;