Lines Matching +full:gpio +full:- +full:n
2 * Copyright (c) 2020-2023 IoT.bzh
4 * SPDX-License-Identifier: Apache-2.0
14 #include <zephyr/drivers/gpio.h>
19 #include <zephyr/drivers/gpio/gpio_utils.h>
25 ((const struct gpio_rcar_cfg *)(_dev)->config)
26 #define DEV_DATA(_dev) ((struct gpio_rcar_data *)(_dev)->data)
83 struct gpio_rcar_data *data = dev->data; in gpio_rcar_port_isr()
91 fsb = find_lsb_set(pending) - 1; in gpio_rcar_port_isr()
92 gpio_fire_callbacks(&data->cb, dev, BIT(fsb)); in gpio_rcar_port_isr()
99 uint32_t gpio, in gpio_rcar_config_general_input_output_mode() argument
102 /* follow steps in the GPIO documentation for in gpio_rcar_config_general_input_output_mode()
108 gpio_rcar_modify_bit(dev, POSNEG, gpio, false); in gpio_rcar_config_general_input_output_mode()
112 gpio_rcar_modify_bit(dev, INEN, gpio, !output); in gpio_rcar_config_general_input_output_mode()
116 gpio_rcar_modify_bit(dev, IOINTSEL, gpio, false); in gpio_rcar_config_general_input_output_mode()
119 gpio_rcar_modify_bit(dev, INOUTSEL, gpio, output); in gpio_rcar_config_general_input_output_mode()
123 gpio_rcar_modify_bit(dev, OUTDTSEL, gpio, false); in gpio_rcar_config_general_input_output_mode()
132 return -ENOTSUP; in gpio_rcar_configure()
135 return -ENOTSUP; in gpio_rcar_configure()
214 return -ENOTSUP; in gpio_rcar_pin_interrupt_configure()
251 const struct gpio_rcar_cfg *config = dev->config; in gpio_rcar_init()
254 if (!device_is_ready(config->clock_dev)) { in gpio_rcar_init()
255 return -ENODEV; in gpio_rcar_init()
258 ret = clock_control_on(config->clock_dev, in gpio_rcar_init()
259 (clock_control_subsys_t) &config->mod_clk); in gpio_rcar_init()
266 config->init_func(dev); in gpio_rcar_init()
274 struct gpio_rcar_data *data = dev->data; in gpio_rcar_manage_callback()
276 return gpio_manage_callback(&data->cb, callback, set); in gpio_rcar_manage_callback()
279 static DEVICE_API(gpio, gpio_rcar_driver_api) = {
291 #define GPIO_RCAR_INIT(n) \ argument
292 static void gpio_rcar_##n##_init(const struct device *dev); \
293 static const struct gpio_rcar_cfg gpio_rcar_cfg_##n = { \
294 DEVICE_MMIO_NAMED_ROM_INIT(reg_base, DT_DRV_INST(n)), \
297 GPIO_PORT_PIN_MASK_FROM_DT_INST(n), \
299 .init_func = gpio_rcar_##n##_init, \
300 .clock_dev = DEVICE_DT_GET(DT_INST_CLOCKS_CTLR(n)), \
302 DT_INST_CLOCKS_CELL_BY_IDX(n, 0, module), \
304 DT_INST_CLOCKS_CELL_BY_IDX(n, 0, domain), \
306 static struct gpio_rcar_data gpio_rcar_data_##n; \
308 DEVICE_DT_INST_DEFINE(n, \
311 &gpio_rcar_data_##n, \
312 &gpio_rcar_cfg_##n, \
317 static void gpio_rcar_##n##_init(const struct device *dev) \
319 IRQ_CONNECT(DT_INST_IRQN(n), \
322 DEVICE_DT_INST_GET(n), 0); \
324 irq_enable(DT_INST_IRQN(n)); \