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

Commit e8b5b1ac authored by Fei Mao's avatar Fei Mao
Browse files

input: touchscreen: Enable new Focaltech touch driver



Enable this new Focaltech touch driver for internal devices.

Change-Id: I7a2e5f70582f8b886799b77f4d261034d3fc955a
Signed-off-by: default avatarFei Mao <feim1@codeaurora.org>
parent 80fded8c
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -1351,4 +1351,6 @@ config TOUCHSCREEN_SYNAPTICS_TCM


source "drivers/input/touchscreen/synaptics_tcm/Kconfig"
source "drivers/input/touchscreen/synaptics_tcm/Kconfig"


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

endif
endif
+1 −0
Original line number Original line Diff line number Diff line
@@ -112,3 +112,4 @@ obj-$(CONFIG_TOUCHSCREEN_ROHM_BU21023) += rohm_bu21023.o
obj-$(CONFIG_TOUCHSCREEN_ST)		+= st/
obj-$(CONFIG_TOUCHSCREEN_ST)		+= st/
obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_DSX) += synaptics_dsx/
obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_DSX) += synaptics_dsx/
obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_TCM)	+= synaptics_tcm/
obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_TCM)	+= synaptics_tcm/
obj-$(CONFIG_TOUCHSCREEN_FTS)	+= focaltech_touch/
+30 −11
Original line number Original line 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)
static int fts_ts_check_default_tp(struct device_node *dt, const char *prop)
{
{
	const char *active_tp[3 + 1] = {NULL, NULL, NULL, NULL};
	const char **active_tp = NULL;
	int count;
	int count, tmp, score = 0;
	int ret;
	const char *active;
	int ret, i;


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


	if (!of_device_compatible_match(dt, active_tp)) {
	for (i = 0; i < count; i++) {
		pr_err(" %s:no match compatible: %s, %s %s\n",
		active = active_tp[i];
			__func__, active_tp[0]);
		if (active != NULL) {
		return -ENODEV;
			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)
static int fts_ts_probe(struct i2c_client *client, const struct i2c_device_id *id)
+2 −12
Original line number Original line Diff line number Diff line
@@ -45,22 +45,12 @@
/*****************************************************************************
/*****************************************************************************
* Global variable or extern global variabls/functions
* Global variable or extern global variabls/functions
*****************************************************************************/
*****************************************************************************/
u8 fw_file[] = {
u8 fw_file[1] = {
#include FTS_UPGRADE_FW_FILE
0,
};

u8 fw_file2[] = {
#include FTS_UPGRADE_FW2_FILE
};

u8 fw_file3[] = {
#include FTS_UPGRADE_FW3_FILE
};
};


struct upgrade_module module_list[] = {
struct upgrade_module module_list[] = {
	{FTS_MODULE_ID, FTS_MODULE_NAME, fw_file, sizeof(fw_file)},
	{FTS_MODULE_ID, FTS_MODULE_NAME, fw_file, sizeof(fw_file)},
	{FTS_MODULE2_ID, FTS_MODULE2_NAME, fw_file2, sizeof(fw_file2)},
	{FTS_MODULE3_ID, FTS_MODULE3_NAME, fw_file3, sizeof(fw_file3)},
};
};


struct upgrade_func *upgrade_func_list[] = {
struct upgrade_func *upgrade_func_list[] = {