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í
parent e999f7c6fb
commit 1947481cce
22 changed files with 90 additions and 302 deletions

View file

@ -234,41 +234,23 @@ static int gpio_cc13xx_cc26xx_manage_callback(struct device *port,
}
static int gpio_cc13xx_cc26xx_enable_callback(struct device *port,
int access_op, u32_t pin)
u32_t pin)
{
struct gpio_cc13xx_cc26xx_data *data = port->driver_data;
switch (access_op) {
case GPIO_ACCESS_BY_PIN:
__ASSERT_NO_MSG(pin < NUM_IO_MAX);
data->pin_callback_enables |= (1 << pin);
break;
case GPIO_ACCESS_BY_PORT:
data->pin_callback_enables = 0xFFFFFFFF;
break;
default:
return -EINVAL;
}
__ASSERT_NO_MSG(pin < NUM_IO_MAX);
data->pin_callback_enables |= (1 << pin);
return 0;
}
static int gpio_cc13xx_cc26xx_disable_callback(struct device *port,
int access_op, u32_t pin)
u32_t pin)
{
struct gpio_cc13xx_cc26xx_data *data = port->driver_data;
switch (access_op) {
case GPIO_ACCESS_BY_PIN:
__ASSERT_NO_MSG(pin < NUM_IO_MAX);
data->pin_callback_enables &= ~(1 << pin);
break;
case GPIO_ACCESS_BY_PORT:
data->pin_callback_enables = 0U;
break;
default:
return -EINVAL;
}
__ASSERT_NO_MSG(pin < NUM_IO_MAX);
data->pin_callback_enables &= ~(1 << pin);
return 0;
}

View file

@ -257,34 +257,26 @@ static int gpio_cc32xx_manage_callback(struct device *dev,
static int gpio_cc32xx_enable_callback(struct device *dev,
int access_op, u32_t pin)
u32_t pin)
{
struct gpio_cc32xx_data *data = DEV_DATA(dev);
__ASSERT(pin < 8, "Invalid pin number - only 8 pins per port");
if (access_op == GPIO_ACCESS_BY_PIN) {
data->pin_callback_enables |= (1 << pin);
} else {
data->pin_callback_enables = 0xFFFFFFFF;
}
data->pin_callback_enables |= (1 << pin);
return 0;
}
static int gpio_cc32xx_disable_callback(struct device *dev,
int access_op, u32_t pin)
u32_t pin)
{
struct gpio_cc32xx_data *data = DEV_DATA(dev);
__ASSERT(pin < 8, "Invalid pin number - only 8 pins per port");
if (access_op == GPIO_ACCESS_BY_PIN) {
data->pin_callback_enables &= ~(1 << pin);
} else {
data->pin_callback_enables = 0U;
}
data->pin_callback_enables &= ~(1 << pin);
return 0;
}

View file

@ -305,45 +305,21 @@ static int gpio_cmsdk_ahb_manage_callback(struct device *dev,
}
static int gpio_cmsdk_ahb_enable_callback(struct device *dev,
int access_op, u32_t pin)
u32_t pin)
{
const struct gpio_cmsdk_ahb_cfg * const cfg = dev->config->config_info;
u32_t mask;
switch (access_op) {
case GPIO_ACCESS_BY_PIN:
mask = BIT(pin);
break;
case GPIO_ACCESS_BY_PORT:
mask = 0xFFFF;
break;
default:
return -ENOTSUP;
}
cfg->port->intenset |= mask;
cfg->port->intenset |= BIT(pin);
return 0;
}
static int gpio_cmsdk_ahb_disable_callback(struct device *dev,
int access_op, u32_t pin)
u32_t pin)
{
const struct gpio_cmsdk_ahb_cfg * const cfg = dev->config->config_info;
u32_t mask;
switch (access_op) {
case GPIO_ACCESS_BY_PIN:
mask = BIT(pin);
break;
case GPIO_ACCESS_BY_PORT:
mask = 0xFFFF;
break;
default:
return -ENOTSUP;
}
cfg->port->intenclr |= mask;
cfg->port->intenclr |= BIT(pin);
return 0;
}

View file

@ -465,10 +465,9 @@ static inline int gpio_dw_manage_callback(struct device *port,
return gpio_manage_callback(&context->callbacks, callback, set);
}
static inline int gpio_dw_enable_callback(struct device *port, int access_op,
static inline int gpio_dw_enable_callback(struct device *port,
u32_t pin)
{
const struct gpio_dw_config *config = port->config->config_info;
struct gpio_dw_runtime *context = port->driver_data;
u32_t base_addr = dw_base_to_block_base(context->base_addr);
u32_t data_port = dw_get_data_port(context->base_addr);
@ -477,21 +476,15 @@ static inline int gpio_dw_enable_callback(struct device *port, int access_op,
return -ENOTSUP;
}
if (GPIO_ACCESS_BY_PIN == access_op) {
dw_write(base_addr, PORTA_EOI, BIT(pin));
dw_set_bit(base_addr, INTMASK, pin, 0);
} else {
dw_write(base_addr, PORTA_EOI, BIT_MASK(config->bits));
dw_write(base_addr, INTMASK, 0);
}
dw_write(base_addr, PORTA_EOI, BIT(pin));
dw_set_bit(base_addr, INTMASK, pin, 0);
return 0;
}
static inline int gpio_dw_disable_callback(struct device *port, int access_op,
static inline int gpio_dw_disable_callback(struct device *port,
u32_t pin)
{
const struct gpio_dw_config *config = port->config->config_info;
struct gpio_dw_runtime *context = port->driver_data;
u32_t base_addr = dw_base_to_block_base(context->base_addr);
u32_t data_port = dw_get_data_port(context->base_addr);
@ -500,11 +493,7 @@ static inline int gpio_dw_disable_callback(struct device *port, int access_op,
return -ENOTSUP;
}
if (GPIO_ACCESS_BY_PIN == access_op) {
dw_set_bit(base_addr, INTMASK, pin, 1);
} else {
dw_write(base_addr, INTMASK, BIT_MASK(config->bits));
}
dw_set_bit(base_addr, INTMASK, pin, 1);
return 0;
}

View file

@ -298,31 +298,23 @@ static int gpio_esp32_manage_callback(struct device *dev,
}
static int gpio_esp32_enable_callback(struct device *dev,
int access_op, u32_t pin)
u32_t pin)
{
struct gpio_esp32_data *data = dev->driver_data;
if (access_op == GPIO_ACCESS_BY_PIN) {
data->cb_pins |= BIT(pin);
data->cb_pins |= BIT(pin);
return 0;
}
return -ENOTSUP;
return 0;
}
static int gpio_esp32_disable_callback(struct device *dev,
int access_op, u32_t pin)
u32_t pin)
{
struct gpio_esp32_data *data = dev->driver_data;
if (access_op == GPIO_ACCESS_BY_PIN) {
data->cb_pins &= ~BIT(pin);
data->cb_pins &= ~BIT(pin);
return 0;
}
return -ENOTSUP;
return 0;
}
static void gpio_esp32_fire_callbacks(struct device *device)

View file

@ -301,14 +301,10 @@ static int gpio_gecko_manage_callback(struct device *dev,
}
static int gpio_gecko_enable_callback(struct device *dev,
int access_op, u32_t pin)
u32_t pin)
{
struct gpio_gecko_data *data = dev->driver_data;
if (access_op == GPIO_ACCESS_BY_PORT) {
return -ENOTSUP;
}
data->pin_callback_enables |= BIT(pin);
GPIO->IEN |= BIT(pin);
@ -316,14 +312,10 @@ static int gpio_gecko_enable_callback(struct device *dev,
}
static int gpio_gecko_disable_callback(struct device *dev,
int access_op, u32_t pin)
u32_t pin)
{
struct gpio_gecko_data *data = dev->driver_data;
if (access_op == GPIO_ACCESS_BY_PORT) {
return -ENOTSUP;
}
data->pin_callback_enables &= ~BIT(pin);
GPIO->IEN &= ~BIT(pin);

View file

@ -68,18 +68,16 @@ static inline int z_vrfy_gpio_pin_interrupt_configure(struct device *port,
#include <syscalls/gpio_pin_interrupt_configure_mrsh.c>
static inline int z_vrfy_gpio_enable_callback(struct device *port,
int access_op, u32_t pin)
u32_t pin)
{
return z_impl_gpio_enable_callback((struct device *)port, access_op,
pin);
return z_impl_gpio_enable_callback((struct device *)port, pin);
}
#include <syscalls/gpio_enable_callback_mrsh.c>
static inline int z_vrfy_gpio_disable_callback(struct device *port,
int access_op, u32_t pin)
u32_t pin)
{
return z_impl_gpio_disable_callback((struct device *)port, access_op,
pin);
return z_impl_gpio_disable_callback((struct device *)port, pin);
}
#include <syscalls/gpio_disable_callback_mrsh.c>

View file

@ -161,7 +161,6 @@ static int gpio_ht16k33_manage_callback(struct device *dev,
}
static int gpio_ht16k33_enable_callback(struct device *dev,
int access_op,
u32_t pin)
{
/* All callbacks are always enabled */
@ -169,7 +168,6 @@ static int gpio_ht16k33_enable_callback(struct device *dev,
}
static int gpio_ht16k33_disable_callback(struct device *dev,
int access_op,
u32_t pin)
{
/* Individual callbacks can not be disabled */

View file

@ -218,42 +218,26 @@ static int imx_gpio_manage_callback(struct device *port,
return gpio_manage_callback(&data->callbacks, cb, set);
}
static int imx_gpio_enable_callback(struct device *port, int access_op,
static int imx_gpio_enable_callback(struct device *port,
u32_t pin)
{
const struct imx_gpio_config *config = port->config->config_info;
struct imx_gpio_data *data = port->driver_data;
u32_t i;
if (access_op == GPIO_ACCESS_BY_PIN) {
data->pin_callback_enables |= BIT(pin);
GPIO_SetPinIntMode(config->base, pin, true);
} else {
data->pin_callback_enables = 0xFFFFFFFFU;
for (i = 0U; i < 32U; i++) {
GPIO_SetPinIntMode(config->base, i, true);
}
}
data->pin_callback_enables |= BIT(pin);
GPIO_SetPinIntMode(config->base, pin, true);
return 0;
}
static int imx_gpio_disable_callback(struct device *port, int access_op,
static int imx_gpio_disable_callback(struct device *port,
u32_t pin)
{
const struct imx_gpio_config *config = port->config->config_info;
struct imx_gpio_data *data = port->driver_data;
u32_t i;
if (access_op == GPIO_ACCESS_BY_PIN) {
GPIO_SetPinIntMode(config->base, pin, false);
data->pin_callback_enables &= ~BIT(pin);
} else {
for (i = 0U; i < 32U; i++) {
GPIO_SetPinIntMode(config->base, i, false);
}
data->pin_callback_enables = 0U;
}
GPIO_SetPinIntMode(config->base, pin, false);
data->pin_callback_enables &= ~BIT(pin);
return 0;
}

View file

@ -433,15 +433,11 @@ static int gpio_intel_apl_manage_callback(struct device *dev,
}
static int gpio_intel_apl_enable_callback(struct device *dev,
int access_op, u32_t pin)
u32_t pin)
{
const struct gpio_intel_apl_config *cfg = dev->config->config_info;
u32_t raw_pin, reg;
if (access_op != GPIO_ACCESS_BY_PIN) {
return -ENOTSUP;
}
pin = k_array_index_sanitize(pin, cfg->num_pins + 1);
raw_pin = cfg->pin_offset + pin;
@ -462,15 +458,11 @@ static int gpio_intel_apl_enable_callback(struct device *dev,
}
static int gpio_intel_apl_disable_callback(struct device *dev,
int access_op, u32_t pin)
u32_t pin)
{
const struct gpio_intel_apl_config *cfg = dev->config->config_info;
u32_t raw_pin, reg;
if (access_op != GPIO_ACCESS_BY_PIN) {
return -ENOTSUP;
}
pin = k_array_index_sanitize(pin, cfg->num_pins + 1);
raw_pin = cfg->pin_offset + pin;

View file

@ -323,29 +323,22 @@ static int gpio_xec_manage_callback(struct device *dev,
}
static int gpio_xec_enable_callback(struct device *dev,
int access_op, u32_t pin)
u32_t pin)
{
struct gpio_xec_data *data = dev->driver_data;
if (access_op == GPIO_ACCESS_BY_PIN) {
data->pin_callback_enables |= BIT(pin);
} else { /* GPIO_ACCESS_BY_PORT not supported */
return -EINVAL;
}
data->pin_callback_enables |= BIT(pin);
return 0;
}
static int gpio_xec_disable_callback(struct device *dev,
int access_op, u32_t pin)
u32_t pin)
{
struct gpio_xec_data *data = dev->driver_data;
if (access_op == GPIO_ACCESS_BY_PIN) {
data->pin_callback_enables &= ~BIT(pin);
} else { /* GPIO_ACCESS_BY_PORT not supported */
return -EINVAL;
}
data->pin_callback_enables &= ~BIT(pin);
return 0;
}

View file

@ -289,29 +289,21 @@ static int gpio_mcux_manage_callback(struct device *dev,
}
static int gpio_mcux_enable_callback(struct device *dev,
int access_op, u32_t pin)
u32_t pin)
{
struct gpio_mcux_data *data = dev->driver_data;
if (access_op == GPIO_ACCESS_BY_PIN) {
data->pin_callback_enables |= BIT(pin);
} else {
data->pin_callback_enables = 0xFFFFFFFF;
}
data->pin_callback_enables |= BIT(pin);
return 0;
}
static int gpio_mcux_disable_callback(struct device *dev,
int access_op, u32_t pin)
u32_t pin)
{
struct gpio_mcux_data *data = dev->driver_data;
if (access_op == GPIO_ACCESS_BY_PIN) {
data->pin_callback_enables &= ~BIT(pin);
} else {
data->pin_callback_enables = 0U;
}
data->pin_callback_enables &= ~BIT(pin);
return 0;
}

View file

@ -197,29 +197,21 @@ static int mcux_igpio_manage_callback(struct device *dev,
}
static int mcux_igpio_enable_callback(struct device *dev,
int access_op, u32_t pin)
u32_t pin)
{
struct mcux_igpio_data *data = dev->driver_data;
if (access_op == GPIO_ACCESS_BY_PIN) {
data->pin_callback_enables |= BIT(pin);
} else {
data->pin_callback_enables = 0xFFFFFFFF;
}
data->pin_callback_enables |= BIT(pin);
return 0;
}
static int mcux_igpio_disable_callback(struct device *dev,
int access_op, u32_t pin)
u32_t pin)
{
struct mcux_igpio_data *data = dev->driver_data;
if (access_op == GPIO_ACCESS_BY_PIN) {
data->pin_callback_enables &= ~BIT(pin);
} else {
data->pin_callback_enables = 0U;
}
data->pin_callback_enables &= ~BIT(pin);
return 0;
}

View file

@ -341,30 +341,22 @@ static int gpio_mcux_lpc_manage_cb(struct device *port,
return gpio_manage_callback(&data->callbacks, callback, set);
}
static int gpio_mcux_lpc_enable_cb(struct device *port, int access_op,
static int gpio_mcux_lpc_enable_cb(struct device *port,
u32_t pin)
{
struct gpio_mcux_lpc_data *data = port->driver_data;
if (access_op == GPIO_ACCESS_BY_PIN) {
data->pin_callback_enables |= BIT(pin);
} else {
data->pin_callback_enables = 0xFFFFFFFF;
}
data->pin_callback_enables |= BIT(pin);
return 0;
}
static int gpio_mcux_lpc_disable_cb(struct device *port, int access_op,
static int gpio_mcux_lpc_disable_cb(struct device *port,
u32_t pin)
{
struct gpio_mcux_lpc_data *data = port->driver_data;
if (access_op == GPIO_ACCESS_BY_PIN) {
data->pin_callback_enables &= ~BIT(pin);
} else {
data->pin_callback_enables = 0U;
}
data->pin_callback_enables &= ~BIT(pin);
return 0;
}

View file

@ -337,47 +337,26 @@ static int gpio_nrfx_manage_callback(struct device *port,
}
static int gpio_nrfx_pin_manage_callback(struct device *port,
int access_op,
u32_t pin,
bool enable)
{
struct gpio_nrfx_data *data = get_port_data(port);
int res = 0;
u8_t from_pin;
u8_t to_pin;
if (access_op == GPIO_ACCESS_BY_PORT) {
from_pin = 0U;
to_pin = 31U;
} else {
from_pin = pin;
to_pin = pin;
}
WRITE_BIT(data->int_en, pin, enable);
for (u8_t curr_pin = from_pin; curr_pin <= to_pin; ++curr_pin) {
WRITE_BIT(data->int_en, curr_pin, enable);
res = gpiote_pin_int_cfg(port, curr_pin);
if (res != 0) {
return res;
}
}
return res;
return gpiote_pin_int_cfg(port, pin);
}
static inline int gpio_nrfx_pin_enable_callback(struct device *port,
int access_op,
u32_t pin)
{
return gpio_nrfx_pin_manage_callback(port, access_op, pin, true);
return gpio_nrfx_pin_manage_callback(port, pin, true);
}
static inline int gpio_nrfx_pin_disable_callback(struct device *port,
int access_op,
u32_t pin)
{
return gpio_nrfx_pin_manage_callback(port, access_op, pin, false);
return gpio_nrfx_pin_manage_callback(port, pin, false);
}
static const struct gpio_driver_api gpio_nrfx_drv_api_funcs = {

View file

@ -313,29 +313,21 @@ static int gpio_rv32m1_manage_callback(struct device *dev,
}
static int gpio_rv32m1_enable_callback(struct device *dev,
int access_op, u32_t pin)
u32_t pin)
{
struct gpio_rv32m1_data *data = dev->driver_data;
if (access_op == GPIO_ACCESS_BY_PIN) {
data->pin_callback_enables |= BIT(pin);
} else {
data->pin_callback_enables = 0xFFFFFFFF;
}
data->pin_callback_enables |= BIT(pin);
return 0;
}
static int gpio_rv32m1_disable_callback(struct device *dev,
int access_op, u32_t pin)
u32_t pin)
{
struct gpio_rv32m1_data *data = dev->driver_data;
if (access_op == GPIO_ACCESS_BY_PIN) {
data->pin_callback_enables &= ~BIT(pin);
} else {
data->pin_callback_enables = 0U;
}
data->pin_callback_enables &= ~BIT(pin);
return 0;
}

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;
}

View file

@ -282,14 +282,14 @@ static int gpio_sam0_manage_callback(struct device *dev,
return gpio_manage_callback(&data->callbacks, callback, set);
}
int gpio_sam0_enable_callback(struct device *dev, int access_op, u32_t pin)
int gpio_sam0_enable_callback(struct device *dev, u32_t pin)
{
const struct gpio_sam0_config *config = DEV_CFG(dev);
return sam0_eic_enable_interrupt(config->id, pin);
}
int gpio_sam0_disable_callback(struct device *dev, int access_op, u32_t pin)
int gpio_sam0_disable_callback(struct device *dev, u32_t pin)
{
const struct gpio_sam0_config *config = DEV_CFG(dev);

View file

@ -408,15 +408,10 @@ static int gpio_sifive_manage_callback(struct device *dev,
}
static int gpio_sifive_enable_callback(struct device *dev,
int access_op,
u32_t pin)
{
const struct gpio_sifive_config *cfg = DEV_GPIO_CFG(dev);
if (access_op != GPIO_ACCESS_BY_PIN) {
return -ENOTSUP;
}
if (pin >= SIFIVE_PINMUX_PINS) {
return -EINVAL;
}
@ -428,15 +423,10 @@ static int gpio_sifive_enable_callback(struct device *dev,
}
static int gpio_sifive_disable_callback(struct device *dev,
int access_op,
u32_t pin)
{
const struct gpio_sifive_config *cfg = DEV_GPIO_CFG(dev);
if (access_op != GPIO_ACCESS_BY_PIN) {
return -ENOTSUP;
}
if (pin >= SIFIVE_PINMUX_PINS) {
return -EINVAL;
}

View file

@ -261,30 +261,22 @@ static int gpio_stellaris_init(struct device *dev)
}
static int gpio_stellaris_enable_callback(struct device *dev,
int access_op, u32_t pin)
u32_t pin)
{
const struct gpio_stellaris_config * const cfg = DEV_CFG(dev);
u32_t base = cfg->base;
if (access_op != GPIO_ACCESS_BY_PIN) {
return -EINVAL;
}
sys_set_bit(GPIO_REG_ADDR(base, GPIO_IM_OFFSET), pin);
return 0;
}
static int gpio_stellaris_disable_callback(struct device *dev,
int access_op, u32_t pin)
u32_t pin)
{
const struct gpio_stellaris_config * const cfg = DEV_CFG(dev);
u32_t base = cfg->base;
if (access_op != GPIO_ACCESS_BY_PIN) {
return -EINVAL;
}
sys_clear_bit(GPIO_REG_ADDR(base, GPIO_IM_OFFSET), pin);
return 0;

View file

@ -538,28 +538,20 @@ static int gpio_stm32_manage_callback(struct device *dev,
}
static int gpio_stm32_enable_callback(struct device *dev,
int access_op, u32_t pin)
u32_t pin)
{
struct gpio_stm32_data *data = dev->driver_data;
if (access_op != GPIO_ACCESS_BY_PIN) {
return -ENOTSUP;
}
data->cb_pins |= BIT(pin);
return 0;
}
static int gpio_stm32_disable_callback(struct device *dev,
int access_op, u32_t pin)
u32_t pin)
{
struct gpio_stm32_data *data = dev->driver_data;
if (access_op != GPIO_ACCESS_BY_PIN) {
return -ENOTSUP;
}
data->cb_pins &= ~BIT(pin);
return 0;

View file

@ -566,8 +566,8 @@ struct gpio_driver_api {
enum gpio_int_mode, enum gpio_int_trig);
int (*manage_callback)(struct device *port, struct gpio_callback *cb,
bool set);
int (*enable_callback)(struct device *port, int access_op, u32_t pin);
int (*disable_callback)(struct device *port, int access_op, u32_t pin);
int (*enable_callback)(struct device *port, u32_t pin);
int (*disable_callback)(struct device *port, u32_t pin);
u32_t (*get_pending_int)(struct device *dev);
};
@ -583,11 +583,10 @@ static inline int z_impl_gpio_config(struct device *port, int access_op,
return api->config(port, access_op, pin, (int)flags);
}
__syscall int gpio_enable_callback(struct device *port, int access_op,
u32_t pin);
__syscall int gpio_enable_callback(struct device *port, u32_t pin);
static inline int z_impl_gpio_enable_callback(struct device *port,
int access_op, u32_t pin)
u32_t pin)
{
const struct gpio_driver_api *api =
(const struct gpio_driver_api *)port->driver_api;
@ -602,14 +601,14 @@ static inline int z_impl_gpio_enable_callback(struct device *port,
return -ENOTSUP;
}
return api->enable_callback(port, access_op, pin);
return api->enable_callback(port, pin);
}
__syscall int gpio_disable_callback(struct device *port, int access_op,
__syscall int gpio_disable_callback(struct device *port,
u32_t pin);
static inline int z_impl_gpio_disable_callback(struct device *port,
int access_op, u32_t pin)
u32_t pin)
{
const struct gpio_driver_api *api =
(const struct gpio_driver_api *)port->driver_api;
@ -624,7 +623,7 @@ static inline int z_impl_gpio_disable_callback(struct device *port,
return -ENOTSUP;
}
return api->disable_callback(port, access_op, pin);
return api->disable_callback(port, pin);
}
/**
* @endcond
@ -1331,9 +1330,11 @@ static inline int gpio_remove_callback(struct device *port,
* @deprecated Replace with ``gpio_pin_interrupt_configure()`` passing
* interrupt configuration flags such as ``GPIO_INT_EDGE_TO_ACTIVE``.
*/
static inline int gpio_pin_enable_callback(struct device *port, u32_t pin)
/* Deprecated in 2.2 release */
__deprecated static inline int gpio_pin_enable_callback(struct device *port,
u32_t pin)
{
return gpio_enable_callback(port, GPIO_ACCESS_BY_PIN, pin);
return gpio_enable_callback(port, pin);
}
/**
@ -1345,9 +1346,11 @@ static inline int gpio_pin_enable_callback(struct device *port, u32_t pin)
* @deprecated Replace with ``gpio_pin_interrupt_configure()`` with
* ``GPIO_INT_DISABLE``.
*/
static inline int gpio_pin_disable_callback(struct device *port, u32_t pin)
/* Deprecated in 2.2 release */
__deprecated static inline int gpio_pin_disable_callback(struct device *port,
u32_t pin)
{
return gpio_disable_callback(port, GPIO_ACCESS_BY_PIN, pin);
return gpio_disable_callback(port, pin);
}
/**