input: touchscreen: synaptics_tcm: 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: I52b8cd49342b6213639eefb8f10876178612af49
Signed-off-by: Ritesh Kumar <[email protected]>
This commit is contained in:
Ritesh Kumar 2020-08-14 15:29:23 +05:30 • committed by Gerrit - the friendly Code Review server
commit 94c76c0d74

View file

@ -371,7 +371,7 @@ static int syna_tcm_check_dt(struct device_node *np)
}
}
return -ENODEV;
return PTR_ERR(panel);
}
static int syna_tcm_check_default_tp(struct device_node *dt, const char *prop)
@ -409,7 +409,11 @@ static int syna_tcm_i2c_probe(struct i2c_client *i2c,
int retval;
struct device_node *dt = i2c->dev.of_node;
if (syna_tcm_check_dt(dt)) {
retval = syna_tcm_check_dt(dt);
if (retval == -EPROBE_DEFER)
return retval;
if (retval) {
if (!syna_tcm_check_default_tp(dt, "qcom,i2c-touch-active"))
retval = -EPROBE_DEFER;
else