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:
parent
b2c6d960cb
commit
13fe09c5b9
1 changed files with 5 additions and 4 deletions
|
@ -1684,6 +1684,11 @@ static int gpio_pca_series_init(const struct device *dev)
|
||||||
LOG_ERR("i2c bus device not found");
|
LOG_ERR("i2c bus device not found");
|
||||||
goto out_bus;
|
goto out_bus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** device reset */
|
||||||
|
gpio_pca_series_reset(dev);
|
||||||
|
LOG_DBG("device reset done");
|
||||||
|
|
||||||
#ifdef GPIO_NXP_PCA_SERIES_DEBUG
|
#ifdef GPIO_NXP_PCA_SERIES_DEBUG
|
||||||
# ifdef CONFIG_GPIO_PCA_SERIES_CACHE_ALL
|
# ifdef CONFIG_GPIO_PCA_SERIES_CACHE_ALL
|
||||||
gpio_pca_series_cache_test(dev);
|
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");
|
LOG_DBG("cache init done");
|
||||||
|
|
||||||
/** device reset */
|
|
||||||
gpio_pca_series_reset(dev);
|
|
||||||
LOG_DBG("device reset done");
|
|
||||||
|
|
||||||
/** configure interrupt */
|
/** configure interrupt */
|
||||||
#ifdef CONFIG_GPIO_PCA_SERIES_INTERRUPT
|
#ifdef CONFIG_GPIO_PCA_SERIES_INTERRUPT
|
||||||
/** save dev pointer */
|
/** save dev pointer */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue