Lines Matching +full:port +full:- +full:irqs

4  * SPDX-License-Identifier: Apache-2.0
15 #include <zephyr/dt-bindings/gpio/renesas-rzt2m-gpio.h>
32 /* config defines in include/zephyr/dt-bindings/gpio/renesas-rzt2m-gpio.h */
59 uint8_t port; member
90 /* Port m output data store */
93 const struct rzt2m_gpio_config *config = dev->config; in rzt2m_gpio_get_p_reg()
95 return (volatile uint8_t *)(config->port_nsr + config->port); in rzt2m_gpio_get_p_reg()
98 /* Port m input data store */
101 const struct rzt2m_gpio_config *config = dev->config; in rzt2m_gpio_get_pin_reg()
103 return (volatile uint8_t *)(config->port_nsr + PINm_OFFSET + config->port); in rzt2m_gpio_get_pin_reg()
106 /* Port m mode register */
109 const struct rzt2m_gpio_config *config = dev->config; in rzt2m_gpio_get_pm_reg()
111 return (volatile uint16_t *)(config->port_nsr + PMm_OFFSET + PMm_SIZE * config->port); in rzt2m_gpio_get_pm_reg()
117 const struct rzt2m_gpio_config *config = dev->config; in rzt2m_gpio_get_drctl_reg()
119 return (volatile uint64_t *)(config->port_nsr + DRCTLm_OFFSET + DRCTLm_SIZE * config->port); in rzt2m_gpio_get_drctl_reg()
122 /* Port m region select register */
125 const struct rzt2m_gpio_config *config = dev->config; in rzt2m_gpio_get_rselp_reg()
127 return (volatile uint8_t *)(config->ptadr + config->port); in rzt2m_gpio_get_rselp_reg()
130 /* Port m mode control register */
131 static volatile uint8_t *rzt2m_gpio_get_pmc_reg(const struct device *dev, uint8_t port) in rzt2m_gpio_get_pmc_reg() argument
133 const struct rzt2m_gpio_config *config = dev->config; in rzt2m_gpio_get_pmc_reg()
135 return (volatile uint8_t *)(config->port_nsr + PMCm_OFFSET + port); in rzt2m_gpio_get_pmc_reg()
138 /* Port m function control register */
139 static volatile uint32_t *rzt2m_gpio_get_pfc_reg(const struct device *dev, uint8_t port) in rzt2m_gpio_get_pfc_reg() argument
141 const struct rzt2m_gpio_config *config = dev->config; in rzt2m_gpio_get_pfc_reg()
143 return (volatile uint32_t *)(config->port_nsr + PFCm_OFFSET + PFCm_SIZE * port); in rzt2m_gpio_get_pfc_reg()
239 return -EINVAL; in rzt2m_gpio_configure()
253 (flags & RZT2M_GPIO_DRIVE_MASK) >> (RZT2M_GPIO_DRIVE_OFFSET - DRIVE_SHIFT); in rzt2m_gpio_configure()
255 (RZT2M_GPIO_SCHMITT_TRIGGER_OFFSET - SCHMITT_TRIGGER_SHIFT); in rzt2m_gpio_configure()
257 (RZT2M_GPIO_SLEW_RATE_OFFSET - SLEW_RATE_SHIFT); in rzt2m_gpio_configure()
269 const struct rzt2m_gpio_config *config = dev->config; in rzt2m_gpio_get_pin_irq()
272 return -1; in rzt2m_gpio_get_pin_irq()
274 return config->pin_irqs[pin] - 1; in rzt2m_gpio_get_pin_irq()
297 struct rzt2m_gpio_data *data = dev->data; in rzt2m_gpio_isr()
301 gpio_fire_callbacks(&data->cb, dev, 1 << irq_pin); in rzt2m_gpio_isr()
309 const struct rzt2m_gpio_config *config = dev->config; in rzt2m_gpio_pin_interrupt_configure()
310 volatile uint8_t *pmc_reg = rzt2m_gpio_get_pmc_reg(dev, config->port); in rzt2m_gpio_pin_interrupt_configure()
311 volatile uint32_t *pfc_reg = rzt2m_gpio_get_pfc_reg(dev, config->port); in rzt2m_gpio_pin_interrupt_configure()
318 return -ENOTSUP; in rzt2m_gpio_pin_interrupt_configure()
325 return -ENOTSUP; in rzt2m_gpio_pin_interrupt_configure()
328 /* secure range - currently not supported*/ in rzt2m_gpio_pin_interrupt_configure()
330 return -ENOSYS; in rzt2m_gpio_pin_interrupt_configure()
349 return -EBUSY; in rzt2m_gpio_pin_interrupt_configure()
365 return -EINVAL; in rzt2m_gpio_pin_interrupt_configure()
377 /* in case of every pin on every port irq function number is 0 */ in rzt2m_gpio_pin_interrupt_configure()
380 /* register handling interrupt in isr for selected port and pin */ in rzt2m_gpio_pin_interrupt_configure()
391 struct rzt2m_gpio_data *data = dev->data; in rzt2m_gpio_manage_callback()
393 return gpio_manage_callback(&data->cb, cb, set); in rzt2m_gpio_manage_callback()
415 struct rzt2m_gpio_common_data *data = dev->data; in rzt2m_gpio_common_init()
421 data->irq_registered_ports[i].dev = NULL; in rzt2m_gpio_common_init()
439 COND_CODE_1(DT_INST_PROP_HAS_IDX(inst, irqs, idx), \
440 ([DT_INST_PROP_BY_IDX(inst, irqs, idx)] = \
441 DT_INST_PROP_BY_IDX(inst, irqs, UTIL_INC(idx)) + 1,), \
446 LISTIFY(DT_INST_PROP_LEN_OR(inst, irqs, 0), VALUE_2X, (,)))
453 .port = DT_INST_REG_ADDR(inst), \