mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
drivers: input: touchscreen: defer probe if panel not found
In many cases display panel information may not be available when the touch driver is being probed. This change defers the probe if the panel is not found to ensure that the correct touch driver is probed. Change-Id: I12d1dd3678a85baa468b332d61be4ba9ce81db43 Signed-off-by: Satya Rama Aditya Pinapala <psraditya30@codeaurora.org>
This commit is contained in:
parent
f7f07211e0
commit
f5c1a1c3e4
3 changed files with 18 additions and 6 deletions
|
|
@ -3428,7 +3428,7 @@ static int mxt_check_dt(struct device_node *np)
|
|||
return 0;
|
||||
}
|
||||
|
||||
return -ENODEV;
|
||||
return PTR_ERR(panel);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -3528,7 +3528,11 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id)
|
|||
|
||||
#ifdef CONFIG_OF
|
||||
#ifdef CONFIG_DRM
|
||||
if (mxt_check_dt(dt)) {
|
||||
error = mxt_check_dt(dt);
|
||||
if (error == -EPROBE_DEFER)
|
||||
return error;
|
||||
|
||||
if (error) {
|
||||
if (!(mxt_check_dedicated_touch(dt, "compatible",
|
||||
"qcom,i2c-touch-active")))
|
||||
return -EPROBE_DEFER;
|
||||
|
|
|
|||
|
|
@ -1704,7 +1704,7 @@ static int fts_ts_check_dt(struct device_node *np)
|
|||
}
|
||||
}
|
||||
|
||||
return -ENODEV;
|
||||
return PTR_ERR(panel);
|
||||
}
|
||||
|
||||
static int fts_ts_check_default_tp(struct device_node *dt, const char *prop)
|
||||
|
|
@ -1764,7 +1764,11 @@ static int fts_ts_probe(struct i2c_client *client, const struct i2c_device_id *i
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (fts_ts_check_dt(dp)) {
|
||||
ret = fts_ts_check_dt(dp);
|
||||
if (ret == -EPROBE_DEFER)
|
||||
return ret;
|
||||
|
||||
if (ret) {
|
||||
if (!fts_ts_check_default_tp(dp, "qcom,i2c-touch-active"))
|
||||
ret = -EPROBE_DEFER;
|
||||
else
|
||||
|
|
|
|||
|
|
@ -4512,7 +4512,7 @@ static int check_dt(struct device_node *np)
|
|||
}
|
||||
}
|
||||
|
||||
return -ENODEV;
|
||||
return PTR_ERR(panel);
|
||||
}
|
||||
|
||||
static int check_default_tp(struct device_node *dt, const char *prop)
|
||||
|
|
@ -4939,7 +4939,11 @@ 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)) {
|
||||
error = check_dt(dp);
|
||||
if (error == -EPROBE_DEFER)
|
||||
return error;
|
||||
|
||||
if (error) {
|
||||
if (!check_default_tp(dp, "qcom,i2c-touch-active"))
|
||||
error = -EPROBE_DEFER;
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in a new issue