driver: input: touchscreen: gt9xx: add ebc suspend notify support
Signed-off-by: Weixin Zhou <zwx@rock-chips.com> Change-Id: I8ee3be2aec10416d9f742de3e000a915750c23d3
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#include <linux/slab.h>
|
||||
#include "../tp_suspend.h"
|
||||
|
||||
|
||||
//#include <mach/gpio.h>
|
||||
//#include <linux/earlysuspend.h>
|
||||
|
||||
@@ -153,7 +152,6 @@ struct goodix_ts_data {
|
||||
u8 is_950;
|
||||
#endif
|
||||
struct regulator *tp_regulator;
|
||||
|
||||
};
|
||||
|
||||
extern u16 show_len;
|
||||
|
||||
@@ -13,9 +13,11 @@
|
||||
#include <linux/err.h>
|
||||
#include <linux/fb.h>
|
||||
#include <linux/notifier.h>
|
||||
#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
|
||||
|
||||
Reference in New Issue
Block a user