mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 22:40:54 -04:00
input: touchscreen: Enable new Focaltech touch driver
Enable this new Focaltech touch driver for Lahaina device. Change-Id: I34b9b19bbf98ffd2b0a88ebeedf033463b5e4824 Signed-off-by: Fei Mao <feim1@codeaurora.org>
This commit is contained in:
parent
fd5a1a5711
commit
12e6f4f42e
7 changed files with 42 additions and 35 deletions
|
|
@ -1312,4 +1312,6 @@ config TOUCHSCREEN_IQS5XX
|
|||
|
||||
source "drivers/input/touchscreen/st/Kconfig"
|
||||
|
||||
source "drivers/input/touchscreen/focaltech_touch/Kconfig"
|
||||
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -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/
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -1,13 +1,8 @@
|
|||
# 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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -45,22 +45,12 @@
|
|||
/*****************************************************************************
|
||||
* Global variable or extern global variabls/functions
|
||||
*****************************************************************************/
|
||||
u8 fw_file[] = {
|
||||
#include FTS_UPGRADE_FW_FILE
|
||||
};
|
||||
|
||||
u8 fw_file2[] = {
|
||||
#include FTS_UPGRADE_FW2_FILE
|
||||
};
|
||||
|
||||
u8 fw_file3[] = {
|
||||
#include FTS_UPGRADE_FW3_FILE
|
||||
u8 fw_file[1] = {
|
||||
0,
|
||||
};
|
||||
|
||||
struct upgrade_module module_list[] = {
|
||||
{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[] = {
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
obj-$(CONFIG_TOUCHSCREEN_FTS) += focaltech_upgrade_ft3518.o
|
||||
obj-y += focaltech_upgrade_ft3518.o
|
||||
Loading…
Reference in a new issue