drivers: gpio: pca95xx: fix build errors
I introduced some errors during the gpio_dt_spec/i2c_dt_spec conversion process. This patch fixes the issues so that driver builds. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
f7f6a5544b
commit
03137a6152
1 changed files with 3 additions and 8 deletions
|
@ -121,8 +121,6 @@ static int read_port_regs(const struct device *dev, uint8_t reg,
|
||||||
uint16_t *cache, uint16_t *buf)
|
uint16_t *cache, uint16_t *buf)
|
||||||
{
|
{
|
||||||
const struct gpio_pca95xx_config * const config = dev->config;
|
const struct gpio_pca95xx_config * const config = dev->config;
|
||||||
struct gpio_pca95xx_drv_data * const drv_data =
|
|
||||||
(struct gpio_pca95xx_drv_data * const)dev->data;
|
|
||||||
uint16_t port_data, value;
|
uint16_t port_data, value;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -160,8 +158,6 @@ static int write_port_regs(const struct device *dev, uint8_t reg,
|
||||||
uint16_t *cache, uint16_t value)
|
uint16_t *cache, uint16_t value)
|
||||||
{
|
{
|
||||||
const struct gpio_pca95xx_config * const config = dev->config;
|
const struct gpio_pca95xx_config * const config = dev->config;
|
||||||
struct gpio_pca95xx_drv_data * const drv_data =
|
|
||||||
(struct gpio_pca95xx_drv_data * const)dev->data;
|
|
||||||
uint8_t buf[3];
|
uint8_t buf[3];
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -592,7 +588,7 @@ static int gpio_pca95xx_pin_interrupt_configure(const struct device *dev,
|
||||||
/* Enable / disable interrupt as needed */
|
/* Enable / disable interrupt as needed */
|
||||||
if (active != drv_data->interrupt_active) {
|
if (active != drv_data->interrupt_active) {
|
||||||
ret = gpio_pin_interrupt_configure_dt(
|
ret = gpio_pin_interrupt_configure_dt(
|
||||||
&int_gpio, active ?
|
&config->int_gpio, active ?
|
||||||
GPIO_INT_EDGE_TO_ACTIVE :
|
GPIO_INT_EDGE_TO_ACTIVE :
|
||||||
GPIO_INT_MODE_DISABLED);
|
GPIO_INT_MODE_DISABLED);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
|
@ -686,8 +682,7 @@ static int gpio_pca95xx_init(const struct device *dev)
|
||||||
if (!device_is_ready(config->int_gpio.port)) {
|
if (!device_is_ready(config->int_gpio.port)) {
|
||||||
LOG_ERR("PCA95XX[0x%X]: interrupt GPIO not ready",
|
LOG_ERR("PCA95XX[0x%X]: interrupt GPIO not ready",
|
||||||
config->bus.addr);
|
config->bus.addr);
|
||||||
err = -ENODEV;
|
return -ENODEV;
|
||||||
goto err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = gpio_pin_configure_dt(&config->int_gpio, GPIO_INPUT);
|
ret = gpio_pin_configure_dt(&config->int_gpio, GPIO_INPUT);
|
||||||
|
@ -702,7 +697,7 @@ static int gpio_pca95xx_init(const struct device *dev)
|
||||||
gpio_init_callback(&drv_data->gpio_callback,
|
gpio_init_callback(&drv_data->gpio_callback,
|
||||||
gpio_pca95xx_interrupt_callback,
|
gpio_pca95xx_interrupt_callback,
|
||||||
BIT(config->int_gpio.pin));
|
BIT(config->int_gpio.pin));
|
||||||
gpio_add_callback(cfg->int_gpio.port, &drv_data->gpio_callback);
|
gpio_add_callback(config->int_gpio.port, &drv_data->gpio_callback);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue