mutex_unlock(&dev->mutex);
}
EXPORT_SYMBOL(input_close_device);
-static int input_enable_device(struct input_dev *dev)
+int input_enable_device(struct input_dev *dev)
{
int retval;
return retval;
}
-static int input_disable_device(struct input_dev *dev)
+int input_disable_device(struct input_dev *dev)
{
int retval;
#endif
#endif
+#if defined(CONFIG_FB)
+static int touch_fb_notifier_callback(struct notifier_block *self,
+ unsigned long event, void *data);
+extern int input_enable_device(struct input_dev *dev);
+extern int input_disable_device(struct input_dev *dev);
+#endif
+
int sec_ts_read_information(struct sec_ts_data *ts);
#ifdef CONFIG_SECURE_TOUCH
__func__, client->irq);
#endif
+#ifdef CONFIG_FB
+ ts->fb_notif.notifier_call = touch_fb_notifier_callback;
+ ret = fb_register_client(&ts->fb_notif);
+ if (ret < 0) {
+ input_err(true, &ts->client->dev, "%s: Failed to register fb client\n",
+ __func__);
+ goto err_fb_client;
+ }
+#endif
+
/* need remove below resource @ remove driver */
#if !defined(CONFIG_SAMSUNG_PRODUCT_SHIP)
sec_ts_raw_device_init(ts);
sec_ts_fn_remove(ts);
free_irq(client->irq, ts);
#endif
+#ifdef CONFIG_FB
+ fb_unregister_client(&ts->fb_notif);
+
+err_fb_client:
+#endif
err_irq:
if (ts->plat_data->support_dex) {
input_unregister_device(ts->input_dev_pad);
input_info(true, &ts->client->dev, "%s\n", __func__);
+#if defined(CONFIG_FB)
+ if (fb_unregister_client(&ts->fb_notif))
+ input_info(true, &ts->client->dev,
+ "%s: Error occured while unregistering fb_notifier.\n", __func__);
+#endif
+
cancel_delayed_work_sync(&ts->work_read_info);
flush_delayed_work(&ts->work_read_info);
return 0;
}
+
+#if defined(CONFIG_FB)
+static int touch_fb_notifier_callback(struct notifier_block *self,
+ unsigned long event, void *data)
+{
+ struct sec_ts_data *ts =
+ container_of(self, struct sec_ts_data, fb_notif);
+ struct fb_event *ev = (struct fb_event *)data;
+
+ if (ev && ev->data && event == FB_EVENT_BLANK) {
+ int *blank = (int *)ev->data;
+
+ if (*blank == FB_BLANK_UNBLANK)
+ input_enable_device(ts->input_dev);
+ else
+ input_disable_device(ts->input_dev);
+ }
+
+ return 0;
+}
+#endif
#endif
#ifdef CONFIG_TRUSTONIC_TRUSTED_UI
#include <linux/vmalloc.h>
#include <linux/wakelock.h>
+#if defined(CONFIG_FB)
+#include <linux/notifier.h>
+#include <linux/fb.h>
+#endif
+
#if defined(CONFIG_TRUSTONIC_TRUSTED_UI)
#include <linux/t-base-tui.h>
#endif
volatile u8 touch_noise_status;
volatile bool input_closed;
+#if defined(CONFIG_FB)
+ struct notifier_block fb_notif;
+#endif
+
int touch_count;
int tx_count;
int rx_count;
extern void epen_disable_mode(int mode);
#endif
+#if defined(CONFIG_FB)
+static int touch_fb_notifier_callback(struct notifier_block *self,
+ unsigned long event, void *data);
+extern int input_enable_device(struct input_dev *dev);
+extern int input_disable_device(struct input_dev *dev);
+#endif
+
int sec_ts_read_information(struct sec_ts_data *ts);
#ifdef CONFIG_SECURE_TOUCH
__func__, client->irq);
#endif
+#ifdef CONFIG_FB
+ ts->fb_notif.notifier_call = touch_fb_notifier_callback;
+ ret = fb_register_client(&ts->fb_notif);
+ if (ret < 0) {
+ input_err(true, &ts->client->dev, "%s: Failed to register fb client\n",
+ __func__);
+ goto err_fb_client;
+ }
+#endif
+
/* need remove below resource @ remove driver */
#if !defined(CONFIG_SAMSUNG_PRODUCT_SHIP)
sec_ts_raw_device_init(ts);
sec_ts_fn_remove(ts);
free_irq(client->irq, ts);
#endif
+#ifdef CONFIG_FB
+ fb_unregister_client(&ts->fb_notif);
+
+err_fb_client:
+#endif
err_irq:
if (ts->plat_data->support_dex) {
input_unregister_device(ts->input_dev_pad);
input_info(true, &ts->client->dev, "%s\n", __func__);
+#if defined(CONFIG_FB)
+ if (fb_unregister_client(&ts->fb_notif))
+ input_info(true, &ts->client->dev,
+ "%s: Error occured while unregistering fb_notifier.\n", __func__);
+#endif
+
cancel_delayed_work_sync(&ts->work_read_info);
flush_delayed_work(&ts->work_read_info);
return 0;
}
+
+#if defined(CONFIG_FB)
+static int touch_fb_notifier_callback(struct notifier_block *self,
+ unsigned long event, void *data)
+{
+ struct sec_ts_data *ts =
+ container_of(self, struct sec_ts_data, fb_notif);
+ struct fb_event *ev = (struct fb_event *)data;
+
+ if (ev && ev->data && event == FB_EVENT_BLANK) {
+ int *blank = (int *)ev->data;
+
+ if (*blank == FB_BLANK_UNBLANK)
+ input_enable_device(ts->input_dev);
+ else
+ input_disable_device(ts->input_dev);
+ }
+
+ return 0;
+}
+#endif
#endif
#ifdef CONFIG_TRUSTONIC_TRUSTED_UI
#include <linux/wakelock.h>
#include <linux/workqueue.h>
+#if defined(CONFIG_FB)
+#include <linux/notifier.h>
+#include <linux/fb.h>
+#endif
+
#if defined(CONFIG_TRUSTONIC_TRUSTED_UI)
#include <linux/t-base-tui.h>
#endif
volatile u8 touch_noise_status;
volatile bool input_closed;
+#if defined(CONFIG_FB)
+ struct notifier_block fb_notif;
+#endif
+
int touch_count;
int tx_count;
int rx_count;