drivers: input: gt911: always set INT pin during probe
Even in cases where the alt-addr is set, we can still use the INT pin during probe. Some boards require this, as if a reset GPIO is not defined the INT pin may still need to be toggled in order to initialize the GT911 IC correctly. Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
This commit is contained in:
parent
6b928de90c
commit
52d98498bc
1 changed files with 13 additions and 13 deletions
|
|
@ -272,19 +272,19 @@ static int gt911_init(const struct device *dev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config->alt_addr == 0x0) {
|
/*
|
||||||
/*
|
* We need to configure the int-pin to 0, in order to enter the
|
||||||
* We need to configure the int-pin to 0, in order to enter the
|
* AddressMode0. Keeping the INT pin low during the reset sequence
|
||||||
* AddressMode0. Keeping the INT pin low during the reset sequence
|
* should result in the device selecting an I2C address of 0x5D.
|
||||||
* should result in the device selecting an I2C address of 0x5D.
|
* Note that if an alternate I2C address is set, we will probe
|
||||||
* Note we skip this step if an alternate I2C address is set,
|
* for the alternate address if 0x5D does not work. This is useful
|
||||||
* and fall through to probing for the actual address.
|
* for boards that do not route the INT pin, or only permit it
|
||||||
*/
|
* to be used as an input
|
||||||
r = gpio_pin_configure_dt(&config->int_gpio, GPIO_OUTPUT_INACTIVE);
|
*/
|
||||||
if (r < 0) {
|
r = gpio_pin_configure_dt(&config->int_gpio, GPIO_OUTPUT_INACTIVE);
|
||||||
LOG_ERR("Could not configure int GPIO pin");
|
if (r < 0) {
|
||||||
return r;
|
LOG_ERR("Could not configure int GPIO pin");
|
||||||
}
|
return r;
|
||||||
}
|
}
|
||||||
/* Delay at least 10 ms after power on before we configure gt911 */
|
/* Delay at least 10 ms after power on before we configure gt911 */
|
||||||
k_sleep(K_MSEC(20));
|
k_sleep(K_MSEC(20));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue