diff --git a/drivers/input/touchscreen/gt9xx/gt9xx.c b/drivers/input/touchscreen/gt9xx/gt9xx.c index da511563bac3..02798b9c9c95 100644 --- a/drivers/input/touchscreen/gt9xx/gt9xx.c +++ b/drivers/input/touchscreen/gt9xx/gt9xx.c @@ -2669,8 +2669,8 @@ static int goodix_ts_probe(struct i2c_client *client, const struct i2c_device_id } else if (val == 9111) { m89or101 = FALSE; bgt9111 = TRUE; - gtp_change_x2y = FALSE; - gtp_x_reverse = TRUE; + gtp_change_x2y = TRUE; + gtp_x_reverse = FALSE; gtp_y_reverse = FALSE; } else if (val == 970) { m89or101 = FALSE; @@ -2833,7 +2833,11 @@ static int goodix_ts_probe(struct i2c_client *client, const struct i2c_device_id { gtp_irq_enable(ts); } - + +#ifdef CONFIG_ROCKCHIP_EBC_DEV + enable_irq_wake(ts->irq); +#endif + #if GTP_CREATE_WR_NODE init_wr_node(client); #endif @@ -2845,7 +2849,6 @@ static int goodix_ts_probe(struct i2c_client *client, const struct i2c_device_id probe_init_error: printk(" <%s>_%d prob error !!!!!!!!!!!!!!!\n", __func__, __LINE__); - tp_unregister_fb(&ts->tp); GTP_GPIO_FREE(ts->rst_pin); GTP_GPIO_FREE(ts->irq_pin); probe_init_error_requireio: diff --git a/drivers/input/touchscreen/gt9xx/gt9xx.h b/drivers/input/touchscreen/gt9xx/gt9xx.h index 249d034f29a6..acc288575691 100644 --- a/drivers/input/touchscreen/gt9xx/gt9xx.h +++ b/drivers/input/touchscreen/gt9xx/gt9xx.h @@ -36,7 +36,6 @@ #include #include "../tp_suspend.h" - //#include //#include @@ -153,7 +152,6 @@ struct goodix_ts_data { u8 is_950; #endif struct regulator *tp_regulator; - }; extern u16 show_len; diff --git a/drivers/input/touchscreen/tp_suspend.h b/drivers/input/touchscreen/tp_suspend.h index 23a6fc958296..afa978fec3ef 100644 --- a/drivers/input/touchscreen/tp_suspend.h +++ b/drivers/input/touchscreen/tp_suspend.h @@ -13,9 +13,11 @@ #include #include #include +#include "../../gpu/drm/rockchip/ebc-dev/ebc_dev.h" struct tp_device{ struct notifier_block fb_notif; + struct notifier_block ebc_notif; int(*tp_suspend)(struct tp_device*); int(*tp_resume)(struct tp_device*); struct mutex ops_lock; @@ -68,18 +70,43 @@ static inline int fb_notifier_callback(struct notifier_block *self, return NOTIFY_OK; } +static int ebc_notifier_callback(struct notifier_block *self, + unsigned long action, void *data) +{ + struct tp_device *tp; + int ret; + + tp = container_of(self, struct tp_device, ebc_notif); + + mutex_lock(&tp->ops_lock); + + if (action == EBC_FB_BLANK) + ret = tp->tp_suspend(tp); + else if (action == EBC_FB_UNBLANK) + tp->tp_resume(tp); + + mutex_unlock(&tp->ops_lock); + + return NOTIFY_OK; +} + static inline int tp_register_fb(struct tp_device *tp) { memset(&tp->fb_notif, 0, sizeof(tp->fb_notif)); tp->fb_notif.notifier_call = fb_notifier_callback; + tp->ebc_notif.notifier_call = ebc_notifier_callback; mutex_init(&tp->ops_lock); tp->status = FB_BLANK_UNBLANK; - return fb_register_client(&tp->fb_notif); + ebc_register_notifier(&tp->ebc_notif); + fb_register_client(&tp->fb_notif); + + return 0; } static inline void tp_unregister_fb(struct tp_device *tp) { + ebc_unregister_notifier(&tp->ebc_notif); fb_unregister_client(&tp->fb_notif); } #endif