Loading drivers/input/touchscreen/st/fts.c +48 −5 Original line number Diff line number Diff line Loading @@ -4537,7 +4537,36 @@ static int check_dt(struct device_node *np) return -ENODEV; } static int fts_probe(struct i2c_client *client, static 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; } static int fts_probe_internal(struct i2c_client *client, const struct i2c_device_id *idp) { struct fts_ts_info *info = NULL; Loading @@ -4548,10 +4577,7 @@ static int fts_probe(struct i2c_client *client, logError(0, "%s %s: driver probe begin!\n", tag, __func__); error = check_dt(dp); if (error != OK || !i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { logError(1, "%s Unsupported I2C functionality\n", tag); error = -EIO; goto ProbeErrorExit_0; Loading Loading @@ -4928,6 +4954,23 @@ static int fts_probe(struct i2c_client *client, return error; } static int fts_probe(struct i2c_client *client, const struct i2c_device_id *idp) { int error = 0; struct device_node *dp = client->dev.of_node; if (check_dt(dp)) { if (!check_default_tp(dp, "qcom,i2c-touch-active")) error = -EPROBE_DEFER; else error = -ENODEV; return error; } return fts_probe_internal(client, idp); } static int fts_remove(struct i2c_client *client) { struct fts_ts_info *info = i2c_get_clientdata(client); Loading drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_i2c.c 100755 → 100644 +39 −3 Original line number Diff line number Diff line Loading @@ -451,7 +451,7 @@ static int synaptics_rmi4_i2c_write(struct synaptics_rmi4_data *rmi4_data, return retval; } int check_dt(struct device_node *np) static int check_dt(struct device_node *np) { int i; int count; Loading @@ -475,6 +475,35 @@ int check_dt(struct device_node *np) return -ENODEV; } static 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; } static struct synaptics_dsx_bus_access bus_access = { .type = BUS_I2C, .read = synaptics_rmi4_i2c_read, Loading @@ -490,9 +519,16 @@ static int synaptics_rmi4_i2c_probe(struct i2c_client *client, const struct i2c_device_id *dev_id) { int retval; struct device_node *dp = client->dev.of_node; if (check_dt(client->dev.of_node)) return -ENODEV; if (check_dt(dp)) { if (!check_default_tp(dp, "qcom,i2c-touch-active")) retval = -EPROBE_DEFER; else retval = -ENODEV; return retval; } if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) { Loading Loading
drivers/input/touchscreen/st/fts.c +48 −5 Original line number Diff line number Diff line Loading @@ -4537,7 +4537,36 @@ static int check_dt(struct device_node *np) return -ENODEV; } static int fts_probe(struct i2c_client *client, static 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; } static int fts_probe_internal(struct i2c_client *client, const struct i2c_device_id *idp) { struct fts_ts_info *info = NULL; Loading @@ -4548,10 +4577,7 @@ static int fts_probe(struct i2c_client *client, logError(0, "%s %s: driver probe begin!\n", tag, __func__); error = check_dt(dp); if (error != OK || !i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { logError(1, "%s Unsupported I2C functionality\n", tag); error = -EIO; goto ProbeErrorExit_0; Loading Loading @@ -4928,6 +4954,23 @@ static int fts_probe(struct i2c_client *client, return error; } static int fts_probe(struct i2c_client *client, const struct i2c_device_id *idp) { int error = 0; struct device_node *dp = client->dev.of_node; if (check_dt(dp)) { if (!check_default_tp(dp, "qcom,i2c-touch-active")) error = -EPROBE_DEFER; else error = -ENODEV; return error; } return fts_probe_internal(client, idp); } static int fts_remove(struct i2c_client *client) { struct fts_ts_info *info = i2c_get_clientdata(client); Loading
drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_i2c.c 100755 → 100644 +39 −3 Original line number Diff line number Diff line Loading @@ -451,7 +451,7 @@ static int synaptics_rmi4_i2c_write(struct synaptics_rmi4_data *rmi4_data, return retval; } int check_dt(struct device_node *np) static int check_dt(struct device_node *np) { int i; int count; Loading @@ -475,6 +475,35 @@ int check_dt(struct device_node *np) return -ENODEV; } static 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; } static struct synaptics_dsx_bus_access bus_access = { .type = BUS_I2C, .read = synaptics_rmi4_i2c_read, Loading @@ -490,9 +519,16 @@ static int synaptics_rmi4_i2c_probe(struct i2c_client *client, const struct i2c_device_id *dev_id) { int retval; struct device_node *dp = client->dev.of_node; if (check_dt(client->dev.of_node)) return -ENODEV; if (check_dt(dp)) { if (!check_default_tp(dp, "qcom,i2c-touch-active")) retval = -EPROBE_DEFER; else retval = -ENODEV; return retval; } if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) { Loading