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

Unverified Commit 643cb710 authored by Xianzhu ZHANG's avatar Xianzhu ZHANG Committed by Michael Bestas
Browse files

Revert "[ALM:10872955] [FP4]:TP drm notifier debug"

This reverts commit 7560f868.

Change-Id: I3a1d34ff2eb3b20f40c0185bdb5edfc5e794ddc3
parent e80614db
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -4,6 +4,10 @@ ifneq ($(filter y, $(CONFIG_KALLSYMS_ALL)),)
	ccflags-y += -D__KERNEL_KALLSYMS_ALL_ENABLED__
endif

ifneq ($(filter y, $(CONFIG_FB)),)
	ccflags-y += -DHX_CONFIG_FB
endif

ifneq ($(filter y, $(CONFIG_DRM)),)
	ccflags-y += -DHX_CONFIG_DRM
endif
+14 −17
Original line number Diff line number Diff line
@@ -2802,16 +2802,18 @@ static void himax_fb_register(struct work_struct *work)
	ts->fb_notif.notifier_call = fb_notifier_callback;
	ret = fb_register_client(&ts->fb_notif);
#elif defined(HX_CONFIG_DRM)
#if defined(__HIMAX_MOD__)
	hx_msm_drm_register_client =
		(void *)kallsyms_lookup_name("msm_drm_register_client");
	if (hx_msm_drm_register_client != NULL) {
		ts->fb_notif.notifier_call = drm_notifier_callback;
	if (active_panel) {
		ret = drm_panel_notifier_register(active_panel,
			&ts->fb_notif);
		if (ret)
			E("Failed to register fb notifier client");
	}
	else {
		E("active_panel error\n");
	}
		ret = hx_msm_drm_register_client(&ts->fb_notif);
	}	else
		E("hx_msm_drm_register_client is NULL\n");
#else
	ts->fb_notif.notifier_call = drm_notifier_callback;
	ret = msm_drm_register_client(&ts->fb_notif);
#endif
#endif
	if (ret)
		E("Unable to register fb_notifier: %d\n", ret);
@@ -3070,7 +3072,7 @@ int himax_chip_common_init(void)
		err = -ENOMEM;
		goto err_get_intr_bit_failed;
	}
	I("register fb  \n");

	INIT_DELAYED_WORK(&ts->work_att, himax_fb_register);
	queue_delayed_work(ts->himax_att_wq, &ts->work_att,
			msecs_to_jiffies(15000));
@@ -3153,7 +3155,6 @@ int himax_chip_common_init(void)
void himax_chip_common_deinit(void)
{
	struct himax_ts_data *ts = private_ts;
	int ret = 0;

	himax_ts_unregister_interrupt();

@@ -3186,12 +3187,8 @@ void himax_chip_common_deinit(void)
	} else
		E("hx_msm_drm_unregister_client is NULL\n");
#else
    if (active_panel) {
		ret = drm_panel_notifier_unregister(active_panel,
				&ts->fb_notif);
		if (ret < 0)
            E("Failed to unregister fb notifier client");
	}
	if (msm_drm_unregister_client(&ts->fb_notif))
		E("Error occurred while unregistering drm_notifier.\n");
#endif
	cancel_delayed_work_sync(&ts->work_att);
	destroy_workqueue(ts->himax_att_wq);
+0 −2
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@
#include <linux/proc_fs.h>
#include "himax_platform.h"
#include <linux/kallsyms.h>
#include <drm/drm_panel.h>

#if defined(CONFIG_OF)
	#include <linux/of_gpio.h>
@@ -573,7 +572,6 @@ extern struct himax_core_fp g_core_fp;
extern struct himax_ts_data *private_ts;
extern struct himax_ic_data *ic_data;
extern struct device *g_device;
extern struct drm_panel *active_panel;

#if defined(CONFIG_TOUCHSCREEN_HIMAX_DEBUG)
	int himax_debug_init(void);
+1 −7
Original line number Diff line number Diff line
@@ -158,13 +158,7 @@ void himax_get_arraydata_edge(int *RAW)
{
	int temp, i, j;
	int len = ic_data->HX_RX_NUM * ic_data->HX_TX_NUM;
	int *ArrayData;
 
	ArrayData = kcalloc(len, sizeof(int), GFP_KERNEL);
	if (ArrayData == NULL) {
		E("%s: allocate ArrayData failed\n", __func__);
		return;
	}
	int ArrayData[len];

	for (i = 0; i < len; i++)
		ArrayData[i] = RAW[i];
+37 −107
Original line number Diff line number Diff line
@@ -19,61 +19,6 @@
int i2c_error_count;
u8 *gp_rw_buf;

struct drm_panel *active_panel;

int check_dt(struct device_node *np)
{
	int i;
	int count;
	struct device_node *node;
	struct drm_panel *panel;

	count = of_count_phandle_with_args(np, "panel", NULL);
	if (count <= 0)
		return 0;

	for (i = 0; i < count; i++) {
		node = of_parse_phandle(np, "panel", i);
		panel = of_drm_find_panel(node);
		of_node_put(node);
		if (!IS_ERR(panel)) {
			active_panel = panel;
			return 0;
		}
	}

	return -ENODEV;
}

int check_default_tp(struct device_node *dt, const char *prop)
{
	const char *active_tp;
	const char *compatible;
	char *start;
	int ret;

	ret = of_property_read_string(dt->parent, prop, &active_tp);
	if (ret) {
		pr_err(" %s:fail to read %s %d\n", __func__, prop, ret);
		return -ENODEV;
	}

	ret = of_property_read_string(dt, "compatible", &compatible);
	if (ret < 0) {
		pr_err(" %s:fail to read %s %d\n", __func__, "compatible", ret);
		return -ENODEV;
	}

	start = strnstr(active_tp, compatible, strlen(active_tp));
	if (start == NULL) {
		pr_err(" %s:no match compatible, %s, %s\n",
			__func__, compatible, active_tp);
		ret = -ENODEV;
	}

	return ret;
}

int himax_dev_set(struct himax_ts_data *ts)
{
	int ret = 0;
@@ -968,48 +913,43 @@ int fb_notifier_callback(struct notifier_block *self,
int drm_notifier_callback(struct notifier_block *self,
		unsigned long event, void *data)
{
    struct drm_panel_notifier *evdata = data;
    int *blank = NULL;
	struct msm_drm_notifier *evdata = data;
	int *blank;
	struct himax_ts_data *ts =
		container_of(self, struct himax_ts_data, fb_notif);

    I("in\n");
 
    if (!evdata)
	if (!evdata || (evdata->id != 0))
		return 0;

    if (!(event == DRM_PANEL_EARLY_EVENT_BLANK ||
        event == DRM_PANEL_EVENT_BLANK)) {
        I("event(%lu) do not need process\n", event);
        return 0;
    }
	D("DRM  %s\n", __func__);

	if (evdata->data
	&& event == MSM_DRM_EARLY_EVENT_BLANK
	&& ts
	&& ts->client) {
		blank = evdata->data;
    I("FB event:%lu,blank:%d", event, *blank);
		switch (*blank) {
    case DRM_PANEL_BLANK_UNBLANK:
        if (event == DRM_PANEL_EARLY_EVENT_BLANK) {
            I("resume: event = %lu, not care\n", event);
        } else if (event == DRM_PANEL_EVENT_BLANK) {
            himax_common_resume(ts->dev);
        }
		case MSM_DRM_BLANK_POWERDOWN:
			if (!ts->initialized)
				return -ECANCELED;
			himax_common_suspend(&ts->client->dev);
			break;
 
    case DRM_PANEL_BLANK_POWERDOWN:
        if (event == DRM_PANEL_EARLY_EVENT_BLANK) {
            himax_common_suspend(ts->dev);
        } else if (event == DRM_PANEL_EVENT_BLANK) {
            I("suspend: event = %lu, not care\n", event);
		}
        break;
	}

    default:
        E("FB BLANK(%d) do not need process\n", *blank);
	if (evdata->data
	&& event == MSM_DRM_EVENT_BLANK
	&& ts
	&& ts->client) {
		blank = evdata->data;
		switch (*blank) {
		case MSM_DRM_BLANK_UNBLANK:
			himax_common_resume(&ts->client->dev);
			break;
		}
	}

	return 0;

}
#endif

@@ -1018,7 +958,6 @@ int himax_chip_common_probe(struct i2c_client *client,
{
	int ret = 0;
	struct himax_ts_data *ts;
	struct device_node *dp = client->dev.of_node;

	I("%s:Enter\n", __func__);

@@ -1035,15 +974,6 @@ int himax_chip_common_probe(struct i2c_client *client,
		return -ENODEV;
	}

	if (check_dt(dp)) {
		if (!check_default_tp(dp, "qcom,i2c-touch-active"))
			ret = -EPROBE_DEFER;
		else
			ret = -ENODEV;
        	E("check_dt failed, error=%d", ret);
		return ret;
	}

	ts = kzalloc(sizeof(struct himax_ts_data), GFP_KERNEL);
	if (ts == NULL) {
		E("%s: allocate himax_ts_data failed\n", __func__);