touchscreen: dynamic check the goodix device status

Kernel should not allow two drivers to assign same irq resource,
or else it will cause unknown irq storm issue.

For goodix touch driver, the i2c device driver will always match
device tree node and request irq resource even goodix touch doesn't
exist at all. When the kernel always loads another touch driver,
such as stmicro fts driver, they will compete the irq responsing and
cause lots of cpu hang issue.

Dynamically check the goodix sensor device status according dts config
to avoid the uncessary register driver.

Change-Id: I0c087d2aeaf5ebd04adddb8cbeabae27048fcb92
Signed-off-by: xizx <xizx@motorola.com>
Reviewed-on: https://gerrit.mot.com/2074007
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jichao Zou <zoujc@motorola.com>
Reviewed-by: litong <litong20@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
xizx 2021-09-23 14:17:33 +08:00 • committed by Zhenxin Xi
commit c6c98fe6ef

View file

@ -263,8 +263,13 @@ static struct i2c_driver goodix_i2c_driver = {
int goodix_i2c_bus_init(void)
{
struct device_node *node;
ts_info("Goodix i2c driver init");
return i2c_add_driver(&goodix_i2c_driver);
node = mmi_check_dynamic_device_node("goodix_ts_i2c");
if (!node || mmi_device_is_available(node))
return i2c_add_driver(&goodix_i2c_driver);
return -ENODEV;
}
void goodix_i2c_bus_exit(void)