Lines Matching refs:disp

265 #define DISPATCHER_REGMAP(disp) \  argument
266 (((const struct irqsteer_config *)disp->dev->config)->regmap_phys)
333 static void _irqstr_disp_enable_disable(struct irqsteer_dispatcher *disp, in _irqstr_disp_enable_disable() argument
336 uint32_t regmap = DISPATCHER_REGMAP(disp); in _irqstr_disp_enable_disable()
339 xtensa_irq_enable(XTENSA_IRQ_NUMBER(disp->irq)); in _irqstr_disp_enable_disable()
341 IRQSTEER_EnableMasterInterrupt(UINT_TO_IRQSTEER(regmap), disp->irq); in _irqstr_disp_enable_disable()
343 IRQSTEER_DisableMasterInterrupt(UINT_TO_IRQSTEER(regmap), disp->irq); in _irqstr_disp_enable_disable()
345 xtensa_irq_disable(XTENSA_IRQ_NUMBER(disp->irq)); in _irqstr_disp_enable_disable()
349 static void _irqstr_disp_get_unlocked(struct irqsteer_dispatcher *disp) in _irqstr_disp_get_unlocked() argument
353 if (disp->refcnt == UINT8_MAX) { in _irqstr_disp_get_unlocked()
354 LOG_WRN("disp for irq %d reference count reached limit", disp->irq); in _irqstr_disp_get_unlocked()
358 if (!disp->refcnt) { in _irqstr_disp_get_unlocked()
359 ret = pm_device_runtime_get(disp->dev); in _irqstr_disp_get_unlocked()
365 _irqstr_disp_enable_disable(disp, true); in _irqstr_disp_get_unlocked()
368 disp->refcnt++; in _irqstr_disp_get_unlocked()
371 disp->irq, disp->refcnt); in _irqstr_disp_get_unlocked()
374 static void _irqstr_disp_put_unlocked(struct irqsteer_dispatcher *disp) in _irqstr_disp_put_unlocked() argument
378 if (!disp->refcnt) { in _irqstr_disp_put_unlocked()
379 LOG_WRN("disp for irq %d already put", disp->irq); in _irqstr_disp_put_unlocked()
383 disp->refcnt--; in _irqstr_disp_put_unlocked()
385 if (!disp->refcnt) { in _irqstr_disp_put_unlocked()
386 _irqstr_disp_enable_disable(disp, false); in _irqstr_disp_put_unlocked()
388 ret = pm_device_runtime_put(disp->dev); in _irqstr_disp_put_unlocked()
396 disp->irq, disp->refcnt); in _irqstr_disp_put_unlocked()
399 static void _irqstr_enable_disable_irq(struct irqsteer_dispatcher *disp, in _irqstr_enable_disable_irq() argument
402 uint32_t regmap = DISPATCHER_REGMAP(disp); in _irqstr_enable_disable_irq()
411 static void irqstr_request_irq_unlocked(struct irqsteer_dispatcher *disp, in irqstr_request_irq_unlocked() argument
414 uint32_t system_irq = from_zephyr_irq(DISPATCHER_REGMAP(disp), in irqstr_request_irq_unlocked()
415 zephyr_irq, disp->master_index); in irqstr_request_irq_unlocked()
418 if (disp->irq_refcnt[zephyr_irq]) { in irqstr_request_irq_unlocked()
424 if (disp->irq_refcnt[zephyr_irq] == UINT8_MAX) { in irqstr_request_irq_unlocked()
429 if (!disp->irq_refcnt[zephyr_irq]) { in irqstr_request_irq_unlocked()
430 _irqstr_disp_get_unlocked(disp); in irqstr_request_irq_unlocked()
431 _irqstr_enable_disable_irq(disp, system_irq, true); in irqstr_request_irq_unlocked()
434 disp->irq_refcnt[zephyr_irq]++; in irqstr_request_irq_unlocked()
437 system_irq, disp->irq_refcnt[zephyr_irq]); in irqstr_request_irq_unlocked()
440 static void irqstr_release_irq_unlocked(struct irqsteer_dispatcher *disp, in irqstr_release_irq_unlocked() argument
443 uint32_t system_irq = from_zephyr_irq(DISPATCHER_REGMAP(disp), in irqstr_release_irq_unlocked()
444 zephyr_irq, disp->master_index); in irqstr_release_irq_unlocked()
446 if (!disp->irq_refcnt[zephyr_irq]) { in irqstr_release_irq_unlocked()
451 disp->irq_refcnt[zephyr_irq]--; in irqstr_release_irq_unlocked()
453 if (!disp->irq_refcnt[zephyr_irq]) { in irqstr_release_irq_unlocked()
454 _irqstr_enable_disable_irq(disp, system_irq, false); in irqstr_release_irq_unlocked()
455 _irqstr_disp_put_unlocked(disp); in irqstr_release_irq_unlocked()
459 system_irq, disp->irq_refcnt[zephyr_irq]); in irqstr_release_irq_unlocked()