drivers: gpio: pca-series: Reset device before register access

Reset the port expander before accessing any register
or updating the cache.

Signed-off-by: Lars Thiemann <thiemann@cognid.de>
This commit is contained in:
Lars Thiemann 2025-05-09 13:22:16 +02:00 committed by Benjamin Cabé
commit 13fe09c5b9

View file

@ -1684,6 +1684,11 @@ static int gpio_pca_series_init(const struct device *dev)
LOG_ERR("i2c bus device not found");
goto out_bus;
}
/** device reset */
gpio_pca_series_reset(dev);
LOG_DBG("device reset done");
#ifdef GPIO_NXP_PCA_SERIES_DEBUG
# ifdef CONFIG_GPIO_PCA_SERIES_CACHE_ALL
gpio_pca_series_cache_test(dev);
@ -1702,10 +1707,6 @@ static int gpio_pca_series_init(const struct device *dev)
}
LOG_DBG("cache init done");
/** device reset */
gpio_pca_series_reset(dev);
LOG_DBG("device reset done");
/** configure interrupt */
#ifdef CONFIG_GPIO_PCA_SERIES_INTERRUPT
/** save dev pointer */