gpio: deprecate gpio pin callback enable and disable API

These have been replaced by the appropriate call to
gpio_pin_interrupt_configure().  While the disable function could be
implemented using the new functionality, the enable function cannot
because the interrupt mode is not available.  Consequently we cannot
replace these with equivalent functionality using the legacy API.

Clean up the internal implementation by removing the inaccessible
port-based enable/disable feature, leaving the pin-based capability in
place.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
Peter Bigot 2020-01-30 20:00:01 -06:00 committed by Carles Cufí
commit 1947481cce
22 changed files with 90 additions and 302 deletions

View file

@ -331,47 +331,23 @@ static int gpio_sam_manage_callback(struct device *port,
}
static int gpio_sam_enable_callback(struct device *port,
int access_op, u32_t pin)
u32_t pin)
{
const struct gpio_sam_config * const cfg = DEV_CFG(port);
Pio * const pio = cfg->regs;
u32_t mask;
switch (access_op) {
case GPIO_ACCESS_BY_PIN:
mask = BIT(pin);
break;
case GPIO_ACCESS_BY_PORT:
mask = 0xFFFFFFFF;
break;
default:
return -ENOTSUP;
}
pio->PIO_IER |= mask;
pio->PIO_IER |= BIT(pin);
return 0;
}
static int gpio_sam_disable_callback(struct device *port,
int access_op, u32_t pin)
u32_t pin)
{
const struct gpio_sam_config * const cfg = DEV_CFG(port);
Pio * const pio = cfg->regs;
u32_t mask;
switch (access_op) {
case GPIO_ACCESS_BY_PIN:
mask = BIT(pin);
break;
case GPIO_ACCESS_BY_PORT:
mask = 0xFFFFFFFF;
break;
default:
return -ENOTSUP;
}
pio->PIO_IDR |= mask;
pio->PIO_IDR |= BIT(pin);
return 0;
}