From 685a474c8d4d97ea4fc34880da26f304da324bd2 Mon Sep 17 00:00:00 2001 From: zhangzhaopeng Date: Thu, 16 Jan 2025 14:45:35 +0800 Subject: [PATCH] 1.add option "CONFIG_LCD_REVERT_180_DEGREE" which can revert screen 2.Only 1 touch point by limited TP driver --- .../chips/v851s/configs/fastboot_sl100_back/board.dts | 4 ++-- .../v851s/configs/fastboot_sl100_back/linux/config-4.9 | 1 + .../chips/v851s3/configs/fastboot_sl100_front/board.dts | 4 ++-- .../v851s3/configs/fastboot_sl100_front/linux/config-4.9 | 1 + .../drivers/input/touchscreen/cst9220/hynitron_core.c | 2 +- .../drivers/input/touchscreen/cst9220/hynitron_core.h | 7 ++++++- .../drivers/video/fbdev/sunxi/disp2/disp/lcd/Kconfig | 6 ++++++ .../video/fbdev/sunxi/disp2/disp/lcd/icn6202_2lane.c | 4 ++++ 8 files changed, 23 insertions(+), 6 deletions(-) diff --git a/device/config/chips/v851s/configs/fastboot_sl100_back/board.dts b/device/config/chips/v851s/configs/fastboot_sl100_back/board.dts index f8022b12e..80627719b 100755 --- a/device/config/chips/v851s/configs/fastboot_sl100_back/board.dts +++ b/device/config/chips/v851s/configs/fastboot_sl100_back/board.dts @@ -1421,7 +1421,7 @@ ctp_twi_addr = <0x1a>; ctp_screen_max_x = <0x2d0>; ctp_screen_max_y = <0x500>; - ctp_revert_x_flag = <0x0>; + ctp_revert_x_flag = <0x0>; // ref to hynitron_core.h ctp_revert_y_flag = <0x1>; ctp_exchange_x_y_flag = <0x1>; ctp_int_port = <&pio PE 8 6 1 3 0xffffffff>; @@ -1432,7 +1432,7 @@ //<&pio PE 8 0 0 1 0>; hynitron,reset-gpio = <&pio PE 9 1 1 3 0xffffffff>; //<&pio PE 9 1 0 1 0>; - hynitron,max-touch-number = <5>; + hynitron,max-touch-number = <1>; hynitron,display-coords = <720 1280>; hynitron,have-key; diff --git a/device/config/chips/v851s/configs/fastboot_sl100_back/linux/config-4.9 b/device/config/chips/v851s/configs/fastboot_sl100_back/linux/config-4.9 index b7902ef86..cf8e4c56a 100755 --- a/device/config/chips/v851s/configs/fastboot_sl100_back/linux/config-4.9 +++ b/device/config/chips/v851s/configs/fastboot_sl100_back/linux/config-4.9 @@ -2035,6 +2035,7 @@ CONFIG_LOGO_BACK=y # CONFIG_LCD_SUPPORT_ICN6202 is not set CONFIG_LCD_SUPPORT_ICN6202_2LANE=y # CONFIG_LCD_SUPPORT_NT35510_MIPI is not set +# CONFIG_LCD_REVERT_180_DEGREE is not set # # Display engine feature select diff --git a/device/config/chips/v851s3/configs/fastboot_sl100_front/board.dts b/device/config/chips/v851s3/configs/fastboot_sl100_front/board.dts index a761b04b9..db2171800 100755 --- a/device/config/chips/v851s3/configs/fastboot_sl100_front/board.dts +++ b/device/config/chips/v851s3/configs/fastboot_sl100_front/board.dts @@ -1436,7 +1436,7 @@ ctp_twi_addr = <0x5a>; ctp_screen_max_x = <0x2d0>; ctp_screen_max_y = <0x500>; - ctp_revert_x_flag = <0x0>; + ctp_revert_x_flag = <0x0>; // ref to hynitron_core.h ctp_revert_y_flag = <0x1>; ctp_exchange_x_y_flag = <0x1>; ctp_int_port = <&pio PH 13 7 1 3 0xffffffff>; @@ -1447,7 +1447,7 @@ //<&pio PH 13 0 0 1 0>; hynitron,reset-gpio = <&pio PH 14 1 1 3 0xffffffff>; //<&pio PH 14 1 0 1 0>; - hynitron,max-touch-number = <5>; + hynitron,max-touch-number = <1>; hynitron,display-coords = <720 1280>; hynitron,have-key; diff --git a/device/config/chips/v851s3/configs/fastboot_sl100_front/linux/config-4.9 b/device/config/chips/v851s3/configs/fastboot_sl100_front/linux/config-4.9 index 38ab44428..daead19ee 100755 --- a/device/config/chips/v851s3/configs/fastboot_sl100_front/linux/config-4.9 +++ b/device/config/chips/v851s3/configs/fastboot_sl100_front/linux/config-4.9 @@ -2153,6 +2153,7 @@ CONFIG_LCD_SUPPORT_T050K589=y CONFIG_LCD_SUPPORT_ICN6202=y CONFIG_LCD_SUPPORT_ICN6202_2LANE=y # CONFIG_LCD_SUPPORT_NT35510_MIPI is not set +# CONFIG_LCD_REVERT_180_DEGREE is not set # # Display engine feature select diff --git a/lichee/linux-4.9/drivers/input/touchscreen/cst9220/hynitron_core.c b/lichee/linux-4.9/drivers/input/touchscreen/cst9220/hynitron_core.c index d910f0c3d..fd9f656e6 100755 --- a/lichee/linux-4.9/drivers/input/touchscreen/cst9220/hynitron_core.c +++ b/lichee/linux-4.9/drivers/input/touchscreen/cst9220/hynitron_core.c @@ -775,7 +775,7 @@ static void cst3xx_touch_report(struct work_struct *work) buf[1] = 0x00; ret = cst3xx_i2c_read_register(hyn_ts_data->client, buf, 7); if(ret < 0) { - HYN_ERROR(" iic read touch point data failed.\n"); + pr_emerg(" iic read touch point data failed.\n"); goto OUT_PROCESS; } diff --git a/lichee/linux-4.9/drivers/input/touchscreen/cst9220/hynitron_core.h b/lichee/linux-4.9/drivers/input/touchscreen/cst9220/hynitron_core.h index f52b939ea..2ca2c07a6 100755 --- a/lichee/linux-4.9/drivers/input/touchscreen/cst9220/hynitron_core.h +++ b/lichee/linux-4.9/drivers/input/touchscreen/cst9220/hynitron_core.h @@ -82,12 +82,17 @@ #define HYN_X_DISPLAY_DEFAULT 600 #define HYN_Y_DISPLAY_DEFAULT 1024 +#if defined(CONFIG_LCD_REVERT_180_DEGREE) +#define HYN_X_REVERT 1 // 180 degree +#define HYN_Y_REVERT 1 // 180 degree +#else #define HYN_X_REVERT 0 #define HYN_Y_REVERT 0 +#endif #define HYN_XY_EXCHANGE 0 #define HYN_MAX_KEYS 3 -#define HYN_MAX_POINTS 5 +#define HYN_MAX_POINTS 1 #define HYN_MAX_SELFCAP_ID 2 /**********************************************************/ diff --git a/lichee/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/lcd/Kconfig b/lichee/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/lcd/Kconfig index 08f134ad3..472945862 100644 --- a/lichee/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/lcd/Kconfig +++ b/lichee/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/lcd/Kconfig @@ -239,3 +239,9 @@ config LCD_SUPPORT_NT35510_MIPI help If you want to support nt35510_mipi panel for display driver, select it. +config LCD_REVERT_180_DEGREE + bool "LCD revert 180 degree with TP" + default n + ---help--- + If you want to revert lcd 180 degree with TP, select it. + diff --git a/lichee/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/lcd/icn6202_2lane.c b/lichee/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/lcd/icn6202_2lane.c index 311defaae..05d6c0d0c 100644 --- a/lichee/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/lcd/icn6202_2lane.c +++ b/lichee/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/lcd/icn6202_2lane.c @@ -235,7 +235,11 @@ static struct LCM_setting_table jd9365_initialization_setting[] = { {0xC1,17,{0x53,0x80,0x32,0x32,0x77,0xE4,0xF7,0xF7,0xCC,0xCC,0x7F,0x7F,0x11,0x11,0x00,0x00,0x32}},//18 {0xC7,12,{0x10,0x00,0x0A,0x00,0x00,0x00,0x00,0x00,0xED,0xC7,0x00,0xA5}},//13 {0xC8,4,{0x10,0x40,0x1E,0x03}},//5 +#if defined(CONFIG_LCD_REVERT_180_DEGREE) + {0xCC,1,{0x07}},//2 +#else {0xCC,1,{0x0b}},//2 +#endif {0xE0,34,{0x00,0x01,0x02,0x3D,0x3F,0x3F,0x2D,0x2F,0x04,0x09,0x0C,0x10,0x11,0x0F,0x12,0x0F,0x15,0x00,0x01,0x02,0x3D,0x3F,0x3F,0x2D,0x2F,0x04,0x09,0x0C,0x10,0x11,0x0F,0x12,0x0F,0x15}},//35 {0xE1,7,{0x11,0x11,0x91,0x00,0x00,0x00,0x00}},//8 {0xE3,14,{0x07,0x07,0x0B,0x0B,0x0B,0x0B,0x00,0x00,0x00,0x00,0xFF,0x04,0xC0,0x10}},//15