diff options
author | Wendly Li <wendlyli@google.com> | 2022-09-19 08:03:28 +0000 |
---|---|---|
committer | Wendly Li <wendlyli@google.com> | 2022-09-21 06:29:52 +0000 |
commit | b469db6155901a531f6dc006870cd42bd4f491c2 (patch) | |
tree | 0e1154cadabc2a2565e94203c68aec8253c1c35d | |
parent | ad4cdbcf85ffc81a4242a1305d0e756ff85dd021 (diff) | |
download | goodix_touch-b469db6155901a531f6dc006870cd42bd4f491c2.tar.gz |
touch: goodix: Fix building errors when disabling GTI
Bug: 246200605
Test: Build successfully
Change-Id: I13601ae0e0d5e494415eb5a2ee1fc7d2c5d82b7f
Signed-off-by: Wendly Li <wendlyli@google.com>
-rw-r--r-- | goodix_ts_core.c | 15 | ||||
-rw-r--r-- | goodix_ts_core.h | 1 | ||||
-rw-r--r-- | touch_apis.c | 6 | ||||
-rw-r--r-- | touch_apis.h | 2 |
4 files changed, 14 insertions, 10 deletions
diff --git a/goodix_ts_core.c b/goodix_ts_core.c index 15c6969..002310a 100644 --- a/goodix_ts_core.c +++ b/goodix_ts_core.c @@ -1737,7 +1737,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 @@ -1752,7 +1752,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; @@ -1791,7 +1791,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 @@ -2693,7 +2693,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 @@ -2722,7 +2722,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; @@ -2744,7 +2744,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 @@ -2837,10 +2837,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 4a4173a..66a0fe2 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/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)( |