input: gt911: 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:
parent
05ab1c5f77
commit
0e3d0e9b15
3 changed files with 5 additions and 5 deletions
|
@ -30,7 +30,7 @@
|
||||||
compatible = "goodix,gt911";
|
compatible = "goodix,gt911";
|
||||||
reg = <0x5d>;
|
reg = <0x5d>;
|
||||||
irq-gpios = <&nxp_mipi_connector 29 GPIO_ACTIVE_HIGH>;
|
irq-gpios = <&nxp_mipi_connector 29 GPIO_ACTIVE_HIGH>;
|
||||||
reset-gpios = <&nxp_mipi_connector 28 GPIO_ACTIVE_HIGH>;
|
reset-gpios = <&nxp_mipi_connector 28 GPIO_ACTIVE_LOW>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
compatible = "goodix,gt911";
|
compatible = "goodix,gt911";
|
||||||
reg = <0x5d>;
|
reg = <0x5d>;
|
||||||
irq-gpios = <&nxp_mipi_connector 29 GPIO_ACTIVE_HIGH>;
|
irq-gpios = <&nxp_mipi_connector 29 GPIO_ACTIVE_HIGH>;
|
||||||
reset-gpios = <&nxp_mipi_connector 28 GPIO_ACTIVE_HIGH>;
|
reset-gpios = <&nxp_mipi_connector 28 GPIO_ACTIVE_LOW>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -230,7 +230,7 @@ static int gt911_init(const struct device *dev)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
r = gpio_pin_configure_dt(&config->rst_gpio, GPIO_OUTPUT_INACTIVE);
|
r = gpio_pin_configure_dt(&config->rst_gpio, GPIO_OUTPUT_ACTIVE);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
LOG_ERR("Could not configure reset GPIO pin");
|
LOG_ERR("Could not configure reset GPIO pin");
|
||||||
return r;
|
return r;
|
||||||
|
@ -253,10 +253,10 @@ static int gt911_init(const struct device *dev)
|
||||||
/* 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));
|
||||||
/* reset the device and confgiure the addr mode0 */
|
/* reset the device and confgiure the addr mode0 */
|
||||||
gpio_pin_set_dt(&config->rst_gpio, 0);
|
gpio_pin_set_dt(&config->rst_gpio, 1);
|
||||||
/* hold down at least 1us, 1ms here */
|
/* hold down at least 1us, 1ms here */
|
||||||
k_sleep(K_MSEC(1));
|
k_sleep(K_MSEC(1));
|
||||||
gpio_pin_set_dt(&config->rst_gpio, 1);
|
gpio_pin_set_dt(&config->rst_gpio, 0);
|
||||||
/* hold down at least 5ms. This is the point the INT pin must be low. */
|
/* hold down at least 5ms. This is the point the INT pin must be low. */
|
||||||
k_sleep(K_MSEC(5));
|
k_sleep(K_MSEC(5));
|
||||||
/* hold down 50ms to make sure the address available */
|
/* hold down 50ms to make sure the address available */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue