1
0
Fork 0

Revert "touch: put touch into sleep when digitizer is in scanning"

This reverts commit 95f5a6b816857ad5b607a1be25cb41ce7c4ff4b2.

Caused a two second delay before the touch screen would
work after using the pen. Disturbed the gestures.
pull/10/head
Lars Ivar Miljeteig 2020-02-18 13:22:10 +01:00 committed by Steinar Bakkemo
parent e0641b5c1d
commit e753c5f29b
3 changed files with 0 additions and 69 deletions

View File

@ -30,7 +30,6 @@
#include <linux/kthread.h>
#include <linux/regulator/consumer.h>
#define CY_WACOM_SCAN_TIMEOUT_MS 500
#define CY_CORE_STARTUP_RETRY_COUNT 3
MODULE_FIRMWARE(CY_FW_FILE_NAME);
@ -39,9 +38,6 @@ static const char *cy_driver_core_name = CYTTSP5_CORE_NAME;
static const char *cy_driver_core_version = CY_DRIVER_VERSION;
static const char *cy_driver_core_date = CY_DRIVER_DATE;
extern int wacom_notifier_register(struct notifier_block *nb);
extern int wacom_notifier_unregister(struct notifier_block *nb);
struct cyttsp5_hid_field {
int report_count;
int report_size;
@ -5674,45 +5670,6 @@ static void cyttsp5_setup_fb_notifier(struct cyttsp5_core_data *cd)
}
#endif
static int cyttsp5_wacom_notifier_call(struct notifier_block *nb,
unsigned long action, void *data)
{
struct cyttsp5_core_data *cd = container_of(nb, struct cyttsp5_core_data, wacom_notifier);
if (atomic_read(&cd->wacom_scanning) == 0) {
atomic_inc(&cd->wacom_scanning);
schedule_work(&cd->wacom_work);
};
mod_timer(&cd->wacom_timer,
jiffies + msecs_to_jiffies(CY_WACOM_SCAN_TIMEOUT_MS));
return 0;
}
static void cyttsp5_wacom_timer(unsigned long data)
{
struct cyttsp5_core_data *cd = (struct cyttsp5_core_data *) data;
atomic_set(&cd->wacom_scanning, 0);
schedule_work(&cd->wacom_work);
}
static void cyttsp5_wacom_work(struct work_struct *work)
{
struct cyttsp5_core_data *cd = container_of(work,
struct cyttsp5_core_data,
wacom_work);
if (atomic_read(&cd->wacom_scanning) == 0) {
dev_dbg(cd->dev, "Power on touch\n");
cyttsp5_hid_cmd_set_power(cd, HID_POWER_ON);
} else {
dev_dbg(cd->dev, "Set touch sleep\n");
cyttsp5_hid_cmd_set_power(cd, HID_POWER_SLEEP);
}
}
static int cyttsp5_setup_irq_gpio(struct cyttsp5_core_data *cd)
{
struct device *dev = cd->dev;
@ -5934,11 +5891,6 @@ int cyttsp5_probe(const struct cyttsp5_bus_ops *ops, struct device *dev,
register_pm_notifier(&cd->pm_notifier);
#endif
INIT_WORK(&cd->wacom_work, cyttsp5_wacom_work);
cd->wacom_notifier.notifier_call = cyttsp5_wacom_notifier_call;
wacom_notifier_register(&cd->wacom_notifier);
setup_timer(&cd->wacom_timer, cyttsp5_wacom_timer, (unsigned long) cd);
return 0;
error_startup_btn:
@ -5980,9 +5932,6 @@ int cyttsp5_release(struct cyttsp5_core_data *cd)
{
struct device *dev = cd->dev;
del_timer(&cd->wacom_timer);
wacom_notifier_unregister(&cd->wacom_notifier);
/* Release successfully probed modules */
cyttsp5_release_modules(cd);

View File

@ -966,10 +966,6 @@ struct cyttsp5_core_data {
struct notifier_block fb_notifier;
enum cyttsp5_fb_state fb_state;
#endif
struct notifier_block wacom_notifier;
struct timer_list wacom_timer;
atomic_t wacom_scanning;
struct work_struct wacom_work;
#ifdef TTHE_TUNER_SUPPORT
struct dentry *tthe_debugfs;
u8 *tthe_buf;

View File

@ -71,8 +71,6 @@
#define WACOM_MAX_DATA_SIZE 22
static ATOMIC_NOTIFIER_HEAD(scanning_notifier);
struct wacom_features {
int x_max;
int y_max;
@ -352,22 +350,10 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id)
input_set_timestamp(input, timestamp);
input_sync(input);
/* Notify that we are in scanning. */
atomic_notifier_call_chain(&scanning_notifier, 0, NULL);
out:
return IRQ_HANDLED;
}
int wacom_notifier_register(struct notifier_block *nb)
{
return atomic_notifier_chain_register(&scanning_notifier, nb);
}
int wacom_notifier_unregister(struct notifier_block *nb)
{
return atomic_notifier_chain_unregister(&scanning_notifier, nb);
}
static int wacom_i2c_open(struct input_dev *dev)
{
struct wacom_i2c *wac_i2c = input_get_drvdata(dev);