diff options
| author | jabashque <jabashque@gmail.com> | 2022-11-18 15:49:58 +0000 |
|---|---|---|
| committer | Semavi Ulusoy <doc.divxm@gmail.com> | 2022-11-22 18:27:02 +0100 |
| commit | a1a023f0731c97d35a9034e586eb075904562b98 (patch) | |
| tree | 06f36bfd87c0cc6f538c70123b7538847763ef14 | |
| parent | 1795233b9adcd0bfde660cada7a691a22a625acb (diff) | |
touchscreen: Fix errors due to assumption of CONFIG_FB always being sett13.0-backup
oplus_touchscreen's touchpanel_common.h's touchpanel_data struct
contains the `fb_notif` field only if CONFIG_FB is set. However, that
field gets used to register as notifier clients for both fb and msm_drm.
Fix this by letting this field appear if either CONFIG_FB or
CONFIG_MSM_DRM is set instead.
oplus_touchscreen's touchpanel_common_driver.c's fb_notifier_callback()
would cast the incoming data pointer to a `struct fb_event *`,
regardless of whether this callback was registered for fb or msm_drm.
Fix this by having it cast to a `struct msm_drm_notifier*` instead if
CONFIG_DRM_MSM is defined.
All the oplus touchscreen drivers populated their dev_pm_ops structs
with suspend/resume functions only if CONFIG_FB is set. Fix this by
having the preprocessor check for CONFIG_FB or CONFIG_DRM_MSM instead.
synaptics_dsx's synaptics_dsx_rmi_dev.c calls send_sig_info(), but if
CONFIG_FB isn't set, then the implicit linux/sched/signal.h include gets
lost. Explicitly include linux/sched/signal.h to fix this.
Change-Id: Ibe00a070b57eac78f3492603d73b4869d099a9d9
8 files changed, 11 insertions, 6 deletions
diff --git a/drivers/input/touchscreen/oplus_touchscreen/Goodix/GT9886/goodix_drivers_gt9886.c b/drivers/input/touchscreen/oplus_touchscreen/Goodix/GT9886/goodix_drivers_gt9886.c index 5265a3ea422a..8b6f66c22c4d 100755 --- a/drivers/input/touchscreen/oplus_touchscreen/Goodix/GT9886/goodix_drivers_gt9886.c +++ b/drivers/input/touchscreen/oplus_touchscreen/Goodix/GT9886/goodix_drivers_gt9886.c @@ -5592,7 +5592,7 @@ static struct of_device_id tp_match_table[] = { }; static const struct dev_pm_ops tp_pm_ops = { -#ifdef CONFIG_FB +#if defined(CONFIG_FB) || defined(CONFIG_DRM_MSM) .suspend = goodix_i2c_suspend, .resume = goodix_i2c_resume, #endif diff --git a/drivers/input/touchscreen/oplus_touchscreen/Samsung/S6SY771/sec_drivers_s6sy771.c b/drivers/input/touchscreen/oplus_touchscreen/Samsung/S6SY771/sec_drivers_s6sy771.c index 901fcf011d5d..afe8a54e4fe1 100755 --- a/drivers/input/touchscreen/oplus_touchscreen/Samsung/S6SY771/sec_drivers_s6sy771.c +++ b/drivers/input/touchscreen/oplus_touchscreen/Samsung/S6SY771/sec_drivers_s6sy771.c @@ -4074,7 +4074,7 @@ static struct of_device_id tp_match_table[] = { }; static const struct dev_pm_ops tp_pm_ops = { -#ifdef CONFIG_FB +#if defined(CONFIG_FB) || defined(CONFIG_DRM_MSM) .suspend = sec_i2c_suspend, .resume = sec_i2c_resume, #endif diff --git a/drivers/input/touchscreen/oplus_touchscreen/Samsung/S6SY791/sec_drivers_s6sy791.c b/drivers/input/touchscreen/oplus_touchscreen/Samsung/S6SY791/sec_drivers_s6sy791.c index e21cbb700873..9b434970f62f 100755 --- a/drivers/input/touchscreen/oplus_touchscreen/Samsung/S6SY791/sec_drivers_s6sy791.c +++ b/drivers/input/touchscreen/oplus_touchscreen/Samsung/S6SY791/sec_drivers_s6sy791.c @@ -3993,7 +3993,7 @@ static struct of_device_id tp_match_table[] = { }; static const struct dev_pm_ops tp_pm_ops = { -#ifdef CONFIG_FB +#if defined(CONFIG_FB) || defined(CONFIG_DRM_MSM) .suspend = sec_i2c_suspend, .resume = sec_i2c_resume, #endif diff --git a/drivers/input/touchscreen/oplus_touchscreen/Samsung/S6SY792/sec_drivers_s6sy792.c b/drivers/input/touchscreen/oplus_touchscreen/Samsung/S6SY792/sec_drivers_s6sy792.c index 19f851338bdb..15fec9be1540 100755 --- a/drivers/input/touchscreen/oplus_touchscreen/Samsung/S6SY792/sec_drivers_s6sy792.c +++ b/drivers/input/touchscreen/oplus_touchscreen/Samsung/S6SY792/sec_drivers_s6sy792.c @@ -3897,7 +3897,7 @@ static struct of_device_id tp_match_table[] = { }; static const struct dev_pm_ops tp_pm_ops = { -#ifdef CONFIG_FB +#if defined(CONFIG_FB) || defined(CONFIG_DRM_MSM) .suspend = sec_i2c_suspend, .resume = sec_i2c_resume, #endif diff --git a/drivers/input/touchscreen/oplus_touchscreen/Synaptics/S3706/synaptics_drivers_s3706.c b/drivers/input/touchscreen/oplus_touchscreen/Synaptics/S3706/synaptics_drivers_s3706.c index 10d870af7359..0e3c73bba604 100755 --- a/drivers/input/touchscreen/oplus_touchscreen/Synaptics/S3706/synaptics_drivers_s3706.c +++ b/drivers/input/touchscreen/oplus_touchscreen/Synaptics/S3706/synaptics_drivers_s3706.c @@ -5847,7 +5847,7 @@ static struct of_device_id tp_match_table[] = { }; static const struct dev_pm_ops tp_pm_ops = { -#ifdef CONFIG_FB +#if defined(CONFIG_FB) || defined(CONFIG_DRM_MSM) .suspend = synaptics_i2c_suspend, .resume = synaptics_i2c_resume, #endif diff --git a/drivers/input/touchscreen/oplus_touchscreen/touchpanel_common.h b/drivers/input/touchscreen/oplus_touchscreen/touchpanel_common.h index 3fddd02de790..7b341affbf4e 100755 --- a/drivers/input/touchscreen/oplus_touchscreen/touchpanel_common.h +++ b/drivers/input/touchscreen/oplus_touchscreen/touchpanel_common.h @@ -815,7 +815,7 @@ struct touchpanel_data { #if defined(TPD_USE_EINT) struct hrtimer timer; /*using polling instead of IRQ*/ #endif -#if defined(CONFIG_FB) +#if defined(CONFIG_FB) || defined(CONFIG_DRM_MSM) struct notifier_block fb_notif; /*register to control suspend/resume*/ #endif struct monitor_data monitor_data; diff --git a/drivers/input/touchscreen/oplus_touchscreen/touchpanel_common_driver.c b/drivers/input/touchscreen/oplus_touchscreen/touchpanel_common_driver.c index 5786d6086ba5..e9b46d73373a 100755 --- a/drivers/input/touchscreen/oplus_touchscreen/touchpanel_common_driver.c +++ b/drivers/input/touchscreen/oplus_touchscreen/touchpanel_common_driver.c @@ -7846,7 +7846,11 @@ static int fb_notifier_callback(struct notifier_block *self, unsigned long event { int *blank; int timed_out = -1; +#ifdef CONFIG_DRM_MSM + struct msm_drm_notifier *evdata = data; +#else struct fb_event *evdata = data; +#endif struct touchpanel_data *ts = container_of(self, struct touchpanel_data, fb_notif); //to aviod some kernel bug (at fbmem.c some local veriable are not initialized) diff --git a/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_rmi_dev.c b/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_rmi_dev.c index 8243e9802abb..7a00fd455f15 100755 --- a/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_rmi_dev.c +++ b/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_rmi_dev.c @@ -43,6 +43,7 @@ #include <linux/gpio.h> #include <linux/uaccess.h> #include <linux/cdev.h> +#include <linux/sched/signal.h> #include <linux/platform_device.h> #include <linux/input/synaptics_dsx.h> #include "synaptics_dsx_core.h" |
