Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9cb82611 authored by jabashque's avatar jabashque Committed by MajorP93
Browse files

touchscreen: Fix errors due to assumption of CONFIG_FB always being set

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
parent 9980864c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5499,7 +5499,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
+1 −1
Original line number Diff line number Diff line
@@ -839,7 +839,7 @@ struct touchpanel_data {
	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
+4 −0
Original line number Diff line number Diff line
@@ -9392,7 +9392,11 @@ static int fb_notifier_callback(struct notifier_block *self,
{
	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);

+1 −0
Original line number Diff line number Diff line
@@ -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"