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

Commit 7b05f440 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "input: touchscreen: Enable new Focaltech touch driver"

parents 996874f1 12e6f4f4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1312,4 +1312,6 @@ config TOUCHSCREEN_IQS5XX

source "drivers/input/touchscreen/st/Kconfig"

source "drivers/input/touchscreen/focaltech_touch/Kconfig"

endif
+1 −0
Original line number Diff line number Diff line
@@ -111,3 +111,4 @@ obj-$(CONFIG_TOUCHSCREEN_ROHM_BU21023) += rohm_bu21023.o
obj-$(CONFIG_TOUCHSCREEN_RASPBERRYPI_FW)	+= raspberrypi-ts.o
obj-$(CONFIG_TOUCHSCREEN_IQS5XX)	+= iqs5xx.o
obj-$(CONFIG_TOUCHSCREEN_ST)	+= st/
obj-$(CONFIG_TOUCHSCREEN_FTS)	+= focaltech_touch/
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
#

config TOUCHSCREEN_FTS
	bool "Focaltech Touchscreen"
	tristate "Focaltech Touchscreen"
	help
	  Say Y here if you have Focaltech touch panel.
	  If unsure, say N.
+5 −10
Original line number Diff line number Diff line
# Makefile for the focaltech touchscreen drivers.

obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_fts.o

obj-$(CONFIG_TOUCHSCREEN_FTS)	+=  focaltech_core.o
obj-$(CONFIG_TOUCHSCREEN_FTS)	+=  focaltech_ex_fun.o
obj-$(CONFIG_TOUCHSCREEN_FTS)	+=  focaltech_ex_mode.o
obj-$(CONFIG_TOUCHSCREEN_FTS)	+=  focaltech_gesture.o
obj-$(CONFIG_TOUCHSCREEN_FTS)	+=  focaltech_esdcheck.o
obj-$(CONFIG_TOUCHSCREEN_FTS)	+=  focaltech_point_report_check.o

obj-$(CONFIG_TOUCHSCREEN_FTS)	+=  focaltech_i2c.o
obj-$(CONFIG_TOUCHSCREEN_FTS)	+=  focaltech_flash.o
obj-$(CONFIG_TOUCHSCREEN_FTS)	+=  focaltech_flash/
focaltech_fts-y	:= focaltech_core.o focaltech_ex_fun.o focaltech_ex_mode.o \
	focaltech_gesture.o focaltech_esdcheck.o focaltech_point_report_check.o\
	focaltech_i2c.o focaltech_flash.o \
	focaltech_flash/focaltech_upgrade_ft3518.o
+30 −11
Original line number Diff line number Diff line
@@ -1709,28 +1709,47 @@ static int fts_ts_check_dt(struct device_node *np)

static int fts_ts_check_default_tp(struct device_node *dt, const char *prop)
{
	const char *active_tp[3 + 1] = {NULL, NULL, NULL, NULL};
	int count;
	int ret;
	const char **active_tp = NULL;
	int count, tmp, score = 0;
	const char *active;
	int ret, i;

	count = of_property_count_strings(dt->parent, prop);
	if (count <= 0 || count > 3)
		return -ENODEV;

	active_tp = kcalloc(count, sizeof(char *),  GFP_KERNEL);
	if (!active_tp) {
		FTS_ERROR("FTS alloc failed\n");
		return -ENOMEM;
	}

	ret = of_property_read_string_array(dt->parent, prop,
			(const char **)&active_tp, count);
			active_tp, count);
	if (ret < 0) {
		pr_err(" %s:fail to read %s %d\n", __func__, prop, ret);
		return -ENODEV;
		FTS_ERROR("fail to read %s %d\n", prop, ret);
		ret = -ENODEV;
		goto out;
	}

	if (!of_device_compatible_match(dt, active_tp)) {
		pr_err(" %s:no match compatible: %s, %s %s\n",
			__func__, active_tp[0]);
		return -ENODEV;
	for (i = 0; i < count; i++) {
		active = active_tp[i];
		if (active != NULL) {
			tmp = of_device_is_compatible(dt, active);
			if (tmp > 0)
				score++;
		}
	}

	return 0;
	if (score <= 0) {
		FTS_INFO("not match this driver\n");
		ret = -ENODEV;
		goto out;
	}
	ret = 0;
out:
	kfree(active_tp);
	return ret;
}

static int fts_ts_probe(struct i2c_client *client, const struct i2c_device_id *id)
Loading