Skip to content

Commit 52d9849

Browse files
danieldegrassenashif
authored andcommitted
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 <[email protected]>
1 parent 6b928de commit 52d9849

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

drivers/input/input_gt911.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -272,19 +272,19 @@ static int gt911_init(const struct device *dev)
272272
}
273273
}
274274

275-
if (config->alt_addr == 0x0) {
276-
/*
277-
* We need to configure the int-pin to 0, in order to enter the
278-
* AddressMode0. Keeping the INT pin low during the reset sequence
279-
* should result in the device selecting an I2C address of 0x5D.
280-
* Note we skip this step if an alternate I2C address is set,
281-
* and fall through to probing for the actual address.
282-
*/
283-
r = gpio_pin_configure_dt(&config->int_gpio, GPIO_OUTPUT_INACTIVE);
284-
if (r < 0) {
285-
LOG_ERR("Could not configure int GPIO pin");
286-
return r;
287-
}
275+
/*
276+
* We need to configure the int-pin to 0, in order to enter the
277+
* AddressMode0. Keeping the INT pin low during the reset sequence
278+
* should result in the device selecting an I2C address of 0x5D.
279+
* Note that if an alternate I2C address is set, we will probe
280+
* for the alternate address if 0x5D does not work. This is useful
281+
* for boards that do not route the INT pin, or only permit it
282+
* to be used as an input
283+
*/
284+
r = gpio_pin_configure_dt(&config->int_gpio, GPIO_OUTPUT_INACTIVE);
285+
if (r < 0) {
286+
LOG_ERR("Could not configure int GPIO pin");
287+
return r;
288288
}
289289
/* Delay at least 10 ms after power on before we configure gt911 */
290290
k_sleep(K_MSEC(20));

0 commit comments

Comments
 (0)