Lines Matching +full:interrupt +full:- +full:direction

5  * SPDX-License-Identifier: Apache-2.0
42 struct airoc_wifi_data *data = dev->data; in airoc_wifi_init_primary()
43 const struct airoc_wifi_config *config = dev->config; in airoc_wifi_init_primary()
52 .host_oob_pin = (void *)&config->wifi_host_wake_gpio, in airoc_wifi_init_primary()
62 return -ENODEV; in airoc_wifi_init_primary()
65 if (!device_is_ready(config->bus_dev.bus_sdio)) { in airoc_wifi_init_primary()
67 return -ENODEV; in airoc_wifi_init_primary()
70 ret = sd_init(config->bus_dev.bus_sdio, &data->card); in airoc_wifi_init_primary()
76 ret = sdio_init_func(&data->card, &data->sdio_func1, BACKPLANE_FUNCTION); in airoc_wifi_init_primary()
81 ret = sdio_init_func(&data->card, &data->sdio_func2, WLAN_FUNCTION); in airoc_wifi_init_primary()
86 ret = sdio_set_block_size(&data->sdio_func1, SDIO_64B_BLOCK); in airoc_wifi_init_primary()
91 ret = sdio_set_block_size(&data->sdio_func2, SDIO_64B_BLOCK); in airoc_wifi_init_primary()
98 cy_rslt_t whd_ret = whd_init(&data->whd_drv, &init_config_default, &resource_ops, buffer_if, in airoc_wifi_init_primary()
101 whd_ret = whd_bus_sdio_attach(data->whd_drv, &whd_sdio_config, in airoc_wifi_init_primary()
102 (whd_sdio_t)&data->card); in airoc_wifi_init_primary()
105 whd_ret = whd_wifi_on(data->whd_drv, interface); in airoc_wifi_init_primary()
110 return -ENODEV; in airoc_wifi_init_primary()
123 struct sdio_func *func[] = {&sd->func0, &data->sdio_func1, &data->sdio_func2}; in airoc_wifi_get_sdio_func()
132 whd_result_t whd_bus_sdio_cmd52(whd_driver_t whd_driver, whd_bus_transfer_direction_t direction, in whd_bus_sdio_cmd52() argument
137 struct sd_card *sd = whd_driver->bus_priv->sdio_obj; in whd_bus_sdio_cmd52()
140 WHD_BUS_STATS_INCREMENT_VARIABLE(whd_driver->bus_priv, cmd52); in whd_bus_sdio_cmd52()
142 if (direction == BUS_WRITE) { in whd_bus_sdio_cmd52()
147 WHD_BUS_STATS_CONDITIONAL_INCREMENT_VARIABLE(whd_driver->bus_priv, (ret != WHD_SUCCESS), in whd_bus_sdio_cmd52()
159 whd_result_t whd_bus_sdio_cmd53(whd_driver_t whd_driver, whd_bus_transfer_direction_t direction, in whd_bus_sdio_cmd53() argument
165 struct sd_card *sd = whd_driver->bus_priv->sdio_obj; in whd_bus_sdio_cmd53()
168 if (direction == BUS_WRITE) { in whd_bus_sdio_cmd53()
169 WHD_BUS_STATS_INCREMENT_VARIABLE(whd_driver->bus_priv, cmd53_write); in whd_bus_sdio_cmd53()
172 WHD_BUS_STATS_INCREMENT_VARIABLE(whd_driver->bus_priv, cmd53_read); in whd_bus_sdio_cmd53()
177 whd_driver->bus_priv, ((ret != WHD_SUCCESS) && (direction == BUS_READ)), in whd_bus_sdio_cmd53()
180 whd_driver->bus_priv, ((ret != WHD_SUCCESS) && (direction == BUS_WRITE)), in whd_bus_sdio_cmd53()
188 * Implement SDIO Card interrupt
196 WHD_BUS_STATS_INCREMENT_VARIABLE(whd_driver->bus_priv, sdio_intrs); in whd_bus_sdio_irq_handler()
212 struct sd_card *sd = whd_driver->bus_priv->sdio_obj; in whd_bus_sdio_irq_enable()
216 ret = sdhc_enable_interrupt(sd->sdhc, whd_bus_sdio_irq_handler, SDHC_INT_SDIO, in whd_bus_sdio_irq_enable()
219 ret = sdhc_disable_interrupt(sd->sdhc, SDHC_INT_SDIO); in whd_bus_sdio_irq_enable()
235 const whd_oob_config_t *oob_config = &data->whd_drv->bus_priv->sdio_config.oob_config; in whd_bus_sdio_oob_irq_handler()
236 const struct gpio_dt_spec *host_oob_pin = oob_config->host_oob_pin; in whd_bus_sdio_oob_irq_handler()
239 int expected_event = (oob_config->is_falling_edge == WHD_TRUE) ? 0 : 1; in whd_bus_sdio_oob_irq_handler()
241 if (!(pins & BIT(host_oob_pin->pin)) || (gpio_pin_get_dt(host_oob_pin) != expected_event)) { in whd_bus_sdio_oob_irq_handler()
242 WPRINT_WHD_ERROR(("Unexpected interrupt event %d\n", expected_event)); in whd_bus_sdio_oob_irq_handler()
243 WHD_BUS_STATS_INCREMENT_VARIABLE(data->whd_drv->bus_priv, error_intrs); in whd_bus_sdio_oob_irq_handler()
247 WHD_BUS_STATS_INCREMENT_VARIABLE(data->whd_drv->bus_priv, oob_intrs); in whd_bus_sdio_oob_irq_handler()
250 whd_thread_notify_irq(data->whd_drv); in whd_bus_sdio_oob_irq_handler()
252 #endif /* DT_INST_NODE_HAS_PROP(0, wifi-host-wake-gpios) */ in whd_bus_sdio_oob_irq_handler()
260 struct airoc_wifi_data *data = dev->data; in whd_bus_sdio_register_oob_intr()
263 const whd_oob_config_t *oob_config = &whd_driver->bus_priv->sdio_config.oob_config; in whd_bus_sdio_register_oob_intr()
264 const struct gpio_dt_spec *host_oob_pin = oob_config->host_oob_pin; in whd_bus_sdio_register_oob_intr()
282 gpio_init_callback(&data->host_oob_pin_cb, whd_bus_sdio_oob_irq_handler, in whd_bus_sdio_register_oob_intr()
283 BIT(host_oob_pin->pin)); in whd_bus_sdio_register_oob_intr()
285 ret = gpio_add_callback_dt(host_oob_pin, &data->host_oob_pin_cb); in whd_bus_sdio_register_oob_intr()
301 const whd_oob_config_t *oob_config = &whd_driver->bus_priv->sdio_config.oob_config; in whd_bus_sdio_unregister_oob_intr()
304 ret = gpio_pin_interrupt_configure_dt(oob_config->host_oob_pin, GPIO_INT_DISABLE); in whd_bus_sdio_unregister_oob_intr()
319 const whd_oob_config_t *oob_config = &whd_driver->bus_priv->sdio_config.oob_config; in whd_bus_sdio_enable_oob_intr()
321 (oob_config->is_falling_edge == WHD_TRUE) ? GPIO_INT_TRIG_LOW : GPIO_INT_TRIG_HIGH; in whd_bus_sdio_enable_oob_intr()
324 ret = gpio_pin_interrupt_configure_dt(oob_config->host_oob_pin, in whd_bus_sdio_enable_oob_intr()