Skip to content

Commit

Permalink
drivers: adc: lmp90xxx: update to use new GPIO API
Browse files Browse the repository at this point in the history
Update the DRDYB pin interrupt handling code of the TI LMP90xxx ADC
driver to use the new GPIO API.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
  • Loading branch information
henrikbrixandersen committed Jan 27, 2020
1 parent fdde3e5 commit 2ee183d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions drivers/adc/adc_lmp90xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ struct lmp90xxx_config {
u8_t spi_cs_pin;
struct spi_config spi_cfg;
const char *drdyb_dev_name;
u32_t drdyb_pin;
int drdyb_flags;
gpio_pin_t drdyb_pin;
gpio_devicetree_flags_t drdyb_flags;
u8_t rtd_current;
u8_t resolution;
u8_t channels;
Expand Down Expand Up @@ -990,8 +990,7 @@ static int lmp90xxx_init(struct device *dev)
}

err = gpio_pin_configure(drdyb_dev, config->drdyb_pin,
(GPIO_DIR_IN | GPIO_INT |
GPIO_INT_EDGE | config->drdyb_flags));
GPIO_INPUT | config->drdyb_flags);
if (err) {
LOG_ERR("failed to configure DRDYB GPIO pin (err %d)",
err);
Expand All @@ -1015,10 +1014,10 @@ static int lmp90xxx_init(struct device *dev)
return err;
}

err = gpio_pin_enable_callback(drdyb_dev,
config->drdyb_pin);
err = gpio_pin_interrupt_configure(drdyb_dev, config->drdyb_pin,
GPIO_INT_EDGE_TO_ACTIVE);
if (err) {
LOG_ERR("failed to enable DRDBY callback (err %d)",
LOG_ERR("failed to configure DRDBY interrupt (err %d)",
err);
return -EINVAL;
}
Expand Down

0 comments on commit 2ee183d

Please sign in to comment.