diff options
-rw-r--r-- | goodix_ts_core.c | 19 | ||||
-rw-r--r-- | goodix_ts_core.h | 1 | ||||
-rw-r--r-- | goodix_ts_proc.c | 11 | ||||
-rw-r--r-- | touch_apis.c | 6 | ||||
-rw-r--r-- | touch_apis.h | 2 |
5 files changed, 23 insertions, 16 deletions
diff --git a/goodix_ts_core.c b/goodix_ts_core.c index a7a0470..d2888c5 100644 --- a/goodix_ts_core.c +++ b/goodix_ts_core.c @@ -19,6 +19,7 @@ #include <linux/seq_file.h> #include <linux/uaccess.h> #include <linux/version.h> +#include <drm/drm_panel.h> #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 38) #include <linux/input/mt.h> @@ -1752,7 +1753,7 @@ static irqreturn_t goodix_ts_threadirq_func(int irq, void *data) struct goodix_ts_esd *ts_esd = &core_data->ts_esd; int ret; -#if IS_ENABLED(CONFIG_GTI_PM) +#if IS_ENABLED(CONFIG_GOOG_TOUCH_INTERFACE) && IS_ENABLED(CONFIG_GTI_PM) goog_pm_wake_lock(core_data->gti, GTI_PM_WAKELOCK_TYPE_IRQ, true); #endif @@ -1767,7 +1768,7 @@ static irqreturn_t goodix_ts_threadirq_func(int irq, void *data) ret = ext_module->funcs->irq_event(core_data, ext_module); if (ret == EVT_CANCEL_IRQEVT) { mutex_unlock(&goodix_modules.mutex); -#if IS_ENABLED(CONFIG_GTI_PM) +#if IS_ENABLED(CONFIG_GOOG_TOUCH_INTERFACE) && IS_ENABLED(CONFIG_GTI_PM) goog_pm_wake_unlock(core_data->gti, GTI_PM_WAKELOCK_TYPE_IRQ); #endif return IRQ_HANDLED; @@ -1806,7 +1807,7 @@ static irqreturn_t goodix_ts_threadirq_func(int irq, void *data) hw_ops->after_event_handler(core_data); } -#if IS_ENABLED(CONFIG_GTI_PM) +#if IS_ENABLED(CONFIG_GOOG_TOUCH_INTERFACE) && IS_ENABLED(CONFIG_GTI_PM) goog_pm_wake_unlock(core_data->gti, GTI_PM_WAKELOCK_TYPE_IRQ); #endif @@ -2042,6 +2043,7 @@ static int goodix_ts_input_dev_config(struct goodix_ts_core *core_data) input_dev->name = GOODIX_CORE_DRIVER_NAME; input_dev->phys = GOOIDX_INPUT_PHYS; + input_dev->uniq = "goodix_ts"; input_dev->id.product = 0xDEAD; input_dev->id.vendor = 0xBEEF; input_dev->id.version = 10427; @@ -2102,6 +2104,8 @@ static int goodix_ts_pen_dev_config(struct goodix_ts_core *core_data) input_set_drvdata(pen_dev, core_data); pen_dev->name = GOODIX_PEN_DRIVER_NAME; + pen_dev->phys = "goodix_ts,pen/input0"; + pen_dev->uniq = "goodix_ts,pen"; pen_dev->id.product = 0xDEAD; pen_dev->id.vendor = 0xBEEF; pen_dev->id.version = 10427; @@ -2708,7 +2712,7 @@ int goodix_ts_stage2_init(struct goodix_ts_core *cd) cd->apis_data.hardware_reset = hardware_reset; cd->apis_data.set_scan_mode = set_scan_mode; cd->apis_data.set_sensing_enabled = set_sensing_enabled; -#if IS_ENABLED(CONFIG_GTI_PM) +#if IS_ENABLED(CONFIG_GOOG_TOUCH_INTERFACE) && IS_ENABLED(CONFIG_GTI_PM) cd->apis_data.get_wake_lock_state = get_wake_lock_state; cd->apis_data.set_wake_lock_state = set_wake_lock_state; #endif @@ -2737,7 +2741,7 @@ int goodix_ts_stage2_init(struct goodix_ts_core *cd) if (options == NULL) { ts_err("Failed to alloc gti options\n"); ret = -ENOMEM; - goto err_init_tpm; + goto err_alloc_gti_options; } options->get_mutual_sensor_data = get_mutual_sensor_data; options->get_self_sensor_data = get_self_sensor_data; @@ -2759,7 +2763,7 @@ int goodix_ts_stage2_init(struct goodix_ts_core *cd) #if IS_ENABLED(CONFIG_GTI_PM) ret = goog_pm_register_notification(cd->gti, &dev_pm_ops); if (ret < 0) { - ts_info("Failed to egister gti pm"); + ts_info("Failed to register gti pm"); goto err_init_tpm; } #endif @@ -2852,10 +2856,13 @@ err_init_gesture: err_init_esd: goodix_ts_procfs_exit(cd); err_init_procfs: +#if IS_ENABLED(CONFIG_GOOG_TOUCH_INTERFACE) #if IS_ENABLED(CONFIG_GTI_PM) goog_pm_unregister_notification(cd->gti); err_init_tpm: #endif +err_alloc_gti_options: +#endif destroy_workqueue(cd->event_wq); err_alloc_workqueue: touch_apis_deinit(&cd->pdev->dev); diff --git a/goodix_ts_core.h b/goodix_ts_core.h index 10cb3e3..1c6e823 100644 --- a/goodix_ts_core.h +++ b/goodix_ts_core.h @@ -31,6 +31,7 @@ #include <linux/platform_device.h> #include <linux/slab.h> #include <linux/vmalloc.h> +#include <drm/drm_panel.h> #if IS_ENABLED(CONFIG_OF) #include <linux/of_gpio.h> #include <linux/regulator/consumer.h> diff --git a/goodix_ts_proc.c b/goodix_ts_proc.c index 547b303..7b5bc07 100644 --- a/goodix_ts_proc.c +++ b/goodix_ts_proc.c @@ -3008,7 +3008,7 @@ static void goodix_get_dump_log(void) static void goodix_get_stylus_data(void) { struct goodix_stylus_data stylus_data; - u8 temp_buf[320] = { 0 }; + u8 temp_buf[40] = {0}; u32 flag_addr = cd->ic_info.misc.touch_data_addr; int tx = cd->ic_info.parm.drv_num; int rx = cd->ic_info.parm.sen_num; @@ -3069,11 +3069,10 @@ static void goodix_get_stylus_data(void) angle_y = le16_to_cpup((__le16 *)(temp_buf + 18)) / 100; stylus_struct_addr = cd->ic_info.misc.frame_data_addr + - cd->ic_info.misc.frame_data_head_len + - cd->ic_info.misc.fw_attr_len + - cd->ic_info.misc.fw_log_len; - ret = cd->hw_ops->read( - cd, stylus_struct_addr, temp_buf, sizeof(stylus_data)); + cd->ic_info.misc.frame_data_head_len + + cd->ic_info.misc.fw_attr_len + + cd->ic_info.misc.fw_log_len; + ret = cd->hw_ops->read(cd, stylus_struct_addr, (u8 *)&stylus_data, sizeof(stylus_data)); if (ret < 0) { ts_err("read stylus struct data failed"); goto exit; diff --git a/touch_apis.c b/touch_apis.c index b4fe602..515e6a2 100644 --- a/touch_apis.c +++ b/touch_apis.c @@ -293,7 +293,7 @@ static ssize_t sensing_enabled_store(struct device *dev, return count; } -#if IS_ENABLED(CONFIG_GTI_PM) +#if IS_ENABLED(CONFIG_GOOG_TOUCH_INTERFACE) && IS_ENABLED(CONFIG_GTI_PM) static ssize_t wake_lock_show( struct device *dev, struct device_attribute *attr, char *buf) { @@ -350,7 +350,7 @@ static DEVICE_ATTR_RO(ping); static DEVICE_ATTR_RW(reset); static DEVICE_ATTR_RW(scan_mode); static DEVICE_ATTR_RW(sensing_enabled); -#if IS_ENABLED(CONFIG_GTI_PM) +#if IS_ENABLED(CONFIG_GOOG_TOUCH_INTERFACE) && IS_ENABLED(CONFIG_GTI_PM) static DEVICE_ATTR_RW(wake_lock); #endif @@ -366,7 +366,7 @@ static struct attribute *sysfs_attrs[] = { &dev_attr_reset.attr, &dev_attr_scan_mode.attr, &dev_attr_sensing_enabled.attr, -#if IS_ENABLED(CONFIG_GTI_PM) +#if IS_ENABLED(CONFIG_GOOG_TOUCH_INTERFACE) && IS_ENABLED(CONFIG_GTI_PM) &dev_attr_wake_lock.attr, #endif NULL, diff --git a/touch_apis.h b/touch_apis.h index c7aa20d..1aa72d0 100644 --- a/touch_apis.h +++ b/touch_apis.h @@ -48,7 +48,7 @@ struct touch_apis_data { int (*software_reset)(struct device *dev); int (*set_scan_mode)(struct device *dev, enum scan_mode mode); int (*set_sensing_enabled)(struct device *dev, bool enabled); -#if IS_ENABLED(CONFIG_GTI_PM) +#if IS_ENABLED(CONFIG_GOOG_TOUCH_INTERFACE) && IS_ENABLED(CONFIG_GTI_PM) bool (*get_wake_lock_state)( struct device *dev, enum gti_pm_wakelock_type type); int (*set_wake_lock_state)( |