input: cst816s: simplify the reset code

The current code deasserts the reset, just to re-assert it immediately.
Just initialize with OUTPUT_ACTIVE, delay and then de-assert.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit is contained in:
Fabio Baltieri 2023-11-03 17:26:00 +00:00 committed by Fabio Baltieri
parent d5a1a8bf04
commit 9b488103ae

View file

@ -173,12 +173,11 @@ static void cst816s_chip_reset(const struct device *dev)
int ret;
if (gpio_is_ready_dt(&config->rst_gpio)) {
ret = gpio_pin_configure_dt(&config->rst_gpio, GPIO_OUTPUT_INACTIVE);
ret = gpio_pin_configure_dt(&config->rst_gpio, GPIO_OUTPUT_ACTIVE);
if (ret < 0) {
LOG_ERR("Could not configure reset GPIO pin");
return;
}
gpio_pin_set_dt(&config->rst_gpio, 1);
k_msleep(CST816S_RESET_DELAY);
gpio_pin_set_dt(&config->rst_gpio, 0);
k_msleep(CST816S_WAIT_DELAY);