input: ft5336: fix reset control polarity

This chip uses an active low reset, so the correct behavior here is to
define the pin as ACTIVE_LOW, using GPIO_OUTPUT_ACTIVE to assert the
reset and set to 0 to deassert.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit is contained in:
Fabio Baltieri 2023-11-03 17:27:20 +00:00 committed by Fabio Baltieri
commit 05ab1c5f77
2 changed files with 4 additions and 4 deletions

View file

@ -33,7 +33,7 @@
compatible = "focaltech,ft5336";
reg = <0x38>;
int-gpios = <&nxp_mipi_connector 29 GPIO_ACTIVE_LOW>;
reset-gpios = <&nxp_mipi_connector 28 GPIO_ACTIVE_HIGH>;
reset-gpios = <&nxp_mipi_connector 28 GPIO_ACTIVE_LOW>;
};
};

View file

@ -153,8 +153,8 @@ static int ft5336_init(const struct device *dev)
k_work_init(&data->work, ft5336_work_handler);
if (config->reset_gpio.port != NULL) {
/* Enable reset GPIO, and pull down */
r = gpio_pin_configure_dt(&config->reset_gpio, GPIO_OUTPUT_INACTIVE);
/* Enable reset GPIO and assert reset */
r = gpio_pin_configure_dt(&config->reset_gpio, GPIO_OUTPUT_ACTIVE);
if (r < 0) {
LOG_ERR("Could not enable reset GPIO");
return r;
@ -166,7 +166,7 @@ static int ft5336_init(const struct device *dev)
*/
k_sleep(K_MSEC(5));
/* Pull reset pin high to complete reset sequence */
r = gpio_pin_set_dt(&config->reset_gpio, 1);
r = gpio_pin_set_dt(&config->reset_gpio, 0);
if (r < 0) {
return r;
}