commit f46a61d107c12dea72d9ae8237370fb4f4b3e9f6 Author: hjy <523319605@qq.com> Date: 2019-08-09 16:37:36 +0800 add tp wakeup for dts diff --git a/kernel/arch/arm64/boot/dts/rockchip/rp-lcd-mipi-10-800-1280-jd9365.dtsi b/kernel/arch/arm64/boot/dts/rockchip/rp-lcd-mipi-10-800-1280-jd9365.dtsi index 00aef7055a..ee4cec4d8d 100755 --- a/kernel/arch/arm64/boot/dts/rockchip/rp-lcd-mipi-10-800-1280-jd9365.dtsi +++ b/kernel/arch/arm64/boot/dts/rockchip/rp-lcd-mipi-10-800-1280-jd9365.dtsi @@ -91,7 +91,8 @@ gtp_change_x2y = <0>; gtp_overturn_x = <0>; gtp_overturn_y = <0>; - gtp_send_cfg = <1>; + gtp_send_cfg = <1>; + gtp_touch_wakeup = <1>; goodix_rst_gpio = <&gpio1 4 GPIO_ACTIVE_LOW>; goodix_irq_gpio = <&gpio1 22 IRQ_TYPE_EDGE_RISING>; diff --git a/kernel/arch/arm64/boot/dts/rockchip/rp-lcd-mipi-800-1280-8inch-jd933-boe.dtsi b/kernel/arch/arm64/boot/dts/rockchip/rp-lcd-mipi-800-1280-8inch-jd933-boe.dtsi index 3f28252de5..ef8fe32fe6 100755 --- a/kernel/arch/arm64/boot/dts/rockchip/rp-lcd-mipi-800-1280-8inch-jd933-boe.dtsi +++ b/kernel/arch/arm64/boot/dts/rockchip/rp-lcd-mipi-800-1280-8inch-jd933-boe.dtsi @@ -92,6 +92,7 @@ gtp_overturn_x = <0>; gtp_overturn_y = <0>; gtp_send_cfg = <1>; + gtp_touch_wakeup = <1>; goodix_rst_gpio = <&gpio1 4 GPIO_ACTIVE_LOW>; goodix_irq_gpio = <&gpio1 22 IRQ_TYPE_EDGE_RISING>; diff --git a/kernel/arch/arm64/boot/dts/rockchip/rp_lcd_mipi_1920_1200.dtsi b/kernel/arch/arm64/boot/dts/rockchip/rp_lcd_mipi_1920_1200.dtsi index 7a07e8b507..09ce21aff7 100755 --- a/kernel/arch/arm64/boot/dts/rockchip/rp_lcd_mipi_1920_1200.dtsi +++ b/kernel/arch/arm64/boot/dts/rockchip/rp_lcd_mipi_1920_1200.dtsi @@ -95,7 +95,8 @@ gtp_change_x2y = <0>; gtp_overturn_x = <0>; gtp_overturn_y = <0>; - gtp_send_cfg = <1>; + gtp_send_cfg = <1>; + gtp_touch_wakeup = <1>; goodix_rst_gpio = <&gpio1 4 GPIO_ACTIVE_LOW>; goodix_irq_gpio = <&gpio1 22 IRQ_TYPE_EDGE_RISING>; diff --git a/kernel/arch/arm64/boot/dts/rockchip/rp_lcd_mipi_720_1280.dtsi b/kernel/arch/arm64/boot/dts/rockchip/rp_lcd_mipi_720_1280.dtsi index 7cd96b8f7b..4355b2719e 100755 --- a/kernel/arch/arm64/boot/dts/rockchip/rp_lcd_mipi_720_1280.dtsi +++ b/kernel/arch/arm64/boot/dts/rockchip/rp_lcd_mipi_720_1280.dtsi @@ -89,7 +89,8 @@ gtp_change_x2y = <0>; gtp_overturn_x = <0>; gtp_overturn_y = <0>; - gtp_send_cfg = <1>; + gtp_send_cfg = <1>; + gtp_touch_wakeup = <1>; goodix_rst_gpio = <&gpio1 4 GPIO_ACTIVE_LOW>; goodix_irq_gpio = <&gpio1 22 IRQ_TYPE_EDGE_RISING>; diff --git a/kernel/arch/arm64/boot/dts/rockchip/rp_lcd_mipi_7_1200_1920-JDIFC070.dtsi b/kernel/arch/arm64/boot/dts/rockchip/rp_lcd_mipi_7_1200_1920-JDIFC070.dtsi index d6cb7e1d48..85aa460499 100755 --- a/kernel/arch/arm64/boot/dts/rockchip/rp_lcd_mipi_7_1200_1920-JDIFC070.dtsi +++ b/kernel/arch/arm64/boot/dts/rockchip/rp_lcd_mipi_7_1200_1920-JDIFC070.dtsi @@ -91,7 +91,8 @@ gtp_change_x2y = <0>; gtp_overturn_x = <0>; gtp_overturn_y = <0>; - gtp_send_cfg = <1>; + gtp_send_cfg = <1>; + gtp_touch_wakeup = <1>; goodix_rst_gpio = <&gpio1 4 GPIO_ACTIVE_LOW>; goodix_irq_gpio = <&gpio1 22 IRQ_TYPE_EDGE_RISING>; diff --git a/kernel/drivers/input/touchscreen/gt9xx/gt9xx.c b/kernel/drivers/input/touchscreen/gt9xx/gt9xx.c index fa8f563c02..9a1443056b 100755 --- a/kernel/drivers/input/touchscreen/gt9xx/gt9xx.c +++ b/kernel/drivers/input/touchscreen/gt9xx/gt9xx.c @@ -32,7 +32,8 @@ struct gtp_config_custom { int gtp_overturn_x; int gtp_overturn_y; int gtp_send_cfgs; - int gtp_int_tarigger; + int gtp_int_tarigger; + int gtp_touch_wakeup; }; struct gtp_config_custom *gtp_config; @@ -64,10 +65,7 @@ u8 config[GTP_CONFIG_MAX_LENGTH + GTP_ADDR_LENGTH] #endif #endif -//add by rpdzkj yang for ronpin MIPI_1920x1080_10.1INCH_TP Firmware compatibility 20181031 -int RP_MIPI_1920_1080_10INCH_TP = 0; -int Im_old = 0;//Old_RP_mipi_1920x1080_10inch_tp -//end + static s8 gtp_i2c_test(struct i2c_client *client); void gtp_reset_guitar(struct i2c_client *client, s32 ms); @@ -388,6 +386,35 @@ void gtp_irq_enable(struct goodix_ts_data *ts) } +long int touch_wakeup_timeVal = 0; +long int touch_wakeup_time_gt9xx(void) +{ + struct timespec tm; + tm = current_kernel_time(); + + return tm.tv_sec; +} + +/******************************************************* +Function: + kernel time difference absolut function +Input: + ts:Value +Output: + ts:kernel time difference absolut +*********************************************************/ +long int time_difference_absolute_gt9xx(long int time_val) +{ + long time_temp = 0; + + time_temp = touch_wakeup_time_gt9xx() - time_val; + + if(time_temp < 0) + time_temp = time_temp*(-1); + + return time_temp; +} + /******************************************************* Function: Report touch point event @@ -448,18 +475,37 @@ static void gtp_touch_down(struct goodix_ts_data* ts,s32 id,s32 x,s32 y,s32 w) } } } -/* - if (!w) - { - click_array[0] = 0; - if (id == 0) - { - click_array[1] = 0; - click_index = 0; - printk("up\n"); - } - } -*/ + if(gtp_config->gtp_touch_wakeup == 1){ + if( ts->gtp_is_suspend != 0){ + touch_wakeup_timeVal = touch_wakeup_time_gt9xx();//touch lcd wakeup start time; + } + + if( (0 == ts->gtp_is_suspend) && ( time_difference_absolute_gt9xx(touch_wakeup_timeVal) > 1 )){ + #if GTP_ICS_SLOT_REPORT + input_mt_slot(ts->input_dev, id); + input_report_abs(ts->input_dev, ABS_MT_TRACKING_ID, id); + input_report_abs(ts->input_dev, ABS_MT_POSITION_X, x); + input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, y); + input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, w); + input_report_abs(ts->input_dev, ABS_MT_WIDTH_MAJOR, w); + #else + input_report_key(ts->input_dev, BTN_TOUCH, 1); + input_report_abs(ts->input_dev, ABS_MT_POSITION_X, x); + input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, y); + input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, w); + input_report_abs(ts->input_dev, ABS_MT_WIDTH_MAJOR, w); + input_report_abs(ts->input_dev, ABS_MT_TRACKING_ID, id); + input_mt_sync(ts->input_dev); + #endif + touch_wakeup_timeVal = 0; + }else if(1 == ts->gtp_is_suspend){ + input_event(ts->input_dev, EV_KEY, KEY_POWER, 1); + input_event(ts->input_dev, EV_KEY, KEY_POWER, 0); + input_sync(ts->input_dev); + ts->gtp_is_suspend = 2; + }else{ + } + }else{ #if GTP_ICS_SLOT_REPORT input_mt_slot(ts->input_dev, id); input_report_abs(ts->input_dev, ABS_MT_TRACKING_ID, id); @@ -476,7 +522,7 @@ static void gtp_touch_down(struct goodix_ts_data* ts,s32 id,s32 x,s32 y,s32 w) input_report_abs(ts->input_dev, ABS_MT_TRACKING_ID, id); input_mt_sync(ts->input_dev); #endif - + } GTP_DEBUG("ID:%d, X:%d, Y:%d, W:%d", id, x, y, w); // printk("ID:%d, X:%d, Y:%d, W:%d\n", id, x, y, w); } @@ -2416,6 +2462,7 @@ static void gtp_parse_dt(struct device *dev) of_property_read_u32(np, "gtp_overturn_y", &(gtp_config->gtp_overturn_y)); of_property_read_u32(np, "gtp_send_cfg", &(gtp_config->gtp_send_cfgs)); of_property_read_u32(np, "gtp_int_tarigger", &(gtp_config->gtp_int_tarigger)); + of_property_read_u32(np, "gtp_touch_wakeup", &(gtp_config->gtp_touch_wakeup)); } @@ -2725,6 +2772,9 @@ static void goodix_ts_suspend(struct goodix_ts_data *ts) s8 ret = -1; GTP_DEBUG_FUNC(); +if(gtp_config->gtp_touch_wakeup == 1){ + ts->gtp_is_suspend = 1; +}else{ if (ts->enter_update) { return; } @@ -2756,6 +2806,7 @@ static void goodix_ts_suspend(struct goodix_ts_data *ts) // delay 48 + 10ms to ensure reliability msleep(58); } +} /******************************************************* Function: diff --git a/kernel/drivers/input/touchscreen/gt9xx/gt9xx.h b/kernel/drivers/input/touchscreen/gt9xx/gt9xx.h index 907490817d..6bf5113433 100755 --- a/kernel/drivers/input/touchscreen/gt9xx/gt9xx.h +++ b/kernel/drivers/input/touchscreen/gt9xx/gt9xx.h @@ -268,7 +268,7 @@ extern int gtp_int_gpio; // STEP_4(optional): If keys are available and reported as keys, config your key info here #if GTP_HAVE_TOUCH_KEY - #define GTP_KEY_TAB {KEY_MENU, KEY_HOME, KEY_BACK} + #define GTP_KEY_TAB {KEY_MENU, KEY_HOME, KEY_BACK, KEY_POWER} #endif //***************************PART3:OTHER define*********************************