mirror of https://github.com/thesofproject/sof.git
interrupt: unify interrupt_clear() and interrupt_set() functions
Currently the SOF API in addition to interrupt_clear() and interrupt_set() functions also has platform_interrupt_clear() and platform_interrupt_set(). Those functions are partially overlapping and their choice is confusing. Unify them to only use the former variant - without the platform_ prefix. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This commit is contained in:
parent
d229b1ba21
commit
45f29f0bec
|
@ -171,8 +171,7 @@ static void dw_dma_interrupt_clear(struct dma *dma, unsigned int channel)
|
|||
dw_write(dma, DW_CLEAR_ERR, DW_CHAN(channel));
|
||||
|
||||
/* clear platform interrupt */
|
||||
platform_interrupt_clear(dma_irq(dma, cpu_get_id()),
|
||||
DW_CHAN(channel));
|
||||
interrupt_clear_mask(dma_irq(dma, cpu_get_id()), DW_CHAN(channel));
|
||||
}
|
||||
|
||||
/* allocate next free DMA channel */
|
||||
|
@ -1094,8 +1093,8 @@ static void dw_dma_irq_handler(void *data)
|
|||
}
|
||||
|
||||
/* clear platform and DSP interrupt */
|
||||
platform_interrupt_clear(dma_irq(dma, cpu_get_id()),
|
||||
status_src | status_err);
|
||||
interrupt_clear_mask(dma_irq(dma, cpu_get_id()),
|
||||
status_src | status_err);
|
||||
|
||||
for (i = 0; i < dma->plat_data.channels; i++) {
|
||||
/* skip if channel is not running */
|
||||
|
|
|
@ -15,7 +15,7 @@ struct irq_desc *platform_irq_get_parent(uint32_t irq)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void platform_interrupt_set(int irq)
|
||||
void platform_interrupt_set(uint32_t irq)
|
||||
{
|
||||
arch_interrupt_set(irq);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ struct irq_desc *platform_irq_get_parent(uint32_t irq)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void platform_interrupt_set(int irq)
|
||||
void platform_interrupt_set(uint32_t irq)
|
||||
{
|
||||
arch_interrupt_set(irq);
|
||||
}
|
||||
|
@ -27,6 +27,14 @@ void platform_interrupt_set(int irq)
|
|||
void platform_interrupt_clear(uint32_t irq, uint32_t mask)
|
||||
{
|
||||
switch (irq) {
|
||||
case IRQ_NUM_EXT_PMC:
|
||||
case IRQ_NUM_EXT_IA:
|
||||
case IRQ_NUM_SOFTWARE2:
|
||||
case IRQ_NUM_SOFTWARE3:
|
||||
case IRQ_NUM_SOFTWARE4:
|
||||
case IRQ_NUM_SOFTWARE5:
|
||||
arch_interrupt_clear(irq);
|
||||
break;
|
||||
case IRQ_NUM_EXT_SSP0:
|
||||
shim_write(SHIM_PISR, mask << 3);
|
||||
arch_interrupt_clear(irq);
|
||||
|
|
|
@ -210,8 +210,16 @@ void platform_interrupt_unmask(uint32_t irq, uint32_t mask)
|
|||
}
|
||||
}
|
||||
|
||||
void platform_interrupt_set(uint32_t irq)
|
||||
{
|
||||
if (!platform_irq_get_parent(irq))
|
||||
arch_interrupt_set(SOF_IRQ_NUMBER(irq));
|
||||
}
|
||||
|
||||
void platform_interrupt_clear(uint32_t irq, uint32_t mask)
|
||||
{
|
||||
if (!platform_irq_get_parent(irq))
|
||||
arch_interrupt_clear(SOF_IRQ_NUMBER(irq));
|
||||
}
|
||||
|
||||
void platform_interrupt_init(void)
|
||||
|
|
|
@ -19,7 +19,7 @@ struct irq_desc *platform_irq_get_parent(uint32_t irq)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void platform_interrupt_set(int irq)
|
||||
void platform_interrupt_set(uint32_t irq)
|
||||
{
|
||||
arch_interrupt_set(irq);
|
||||
}
|
||||
|
@ -32,6 +32,9 @@ void platform_interrupt_clear(uint32_t irq, uint32_t mask)
|
|||
case IRQ_NUM_EXT_DMAC1:
|
||||
case IRQ_NUM_EXT_SSP0:
|
||||
case IRQ_NUM_EXT_SSP1:
|
||||
case IRQ_NUM_EXT_IA:
|
||||
case IRQ_NUM_SOFTWARE1:
|
||||
case IRQ_NUM_SOFTWARE2:
|
||||
arch_interrupt_clear(irq);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -63,7 +63,7 @@ uint32_t interrupt_disable(uint32_t irq);
|
|||
void platform_interrupt_init(void);
|
||||
|
||||
struct irq_desc *platform_irq_get_parent(uint32_t irq);
|
||||
void platform_interrupt_set(int irq);
|
||||
void platform_interrupt_set(uint32_t irq);
|
||||
void platform_interrupt_clear(uint32_t irq, uint32_t mask);
|
||||
uint32_t platform_interrupt_get_enabled(void);
|
||||
void platform_interrupt_mask(uint32_t irq, uint32_t mask);
|
||||
|
@ -71,12 +71,17 @@ void platform_interrupt_unmask(uint32_t irq, uint32_t mask);
|
|||
|
||||
static inline void interrupt_set(int irq)
|
||||
{
|
||||
arch_interrupt_set(SOF_IRQ_NUMBER(irq));
|
||||
platform_interrupt_set(irq);
|
||||
}
|
||||
|
||||
static inline void interrupt_clear_mask(int irq, uint32_t mask)
|
||||
{
|
||||
platform_interrupt_clear(irq, mask);
|
||||
}
|
||||
|
||||
static inline void interrupt_clear(int irq)
|
||||
{
|
||||
arch_interrupt_clear(SOF_IRQ_NUMBER(irq));
|
||||
interrupt_clear_mask(irq, 1);
|
||||
}
|
||||
|
||||
static inline uint32_t interrupt_global_disable(void)
|
||||
|
|
Loading…
Reference in New Issue