#ifndef __DAL_IRQ_TYPES_H__
#define __DAL_IRQ_TYPES_H__
#include "os_types.h"
struct dc_context;
typedef void (*interrupt_handler)(void *);
typedef void *irq_handler_idx;
#define DAL_INVALID_IRQ_HANDLER_IDX NULL
enum dc_irq_source {
DC_IRQ_SOURCE_INVALID = 0,
DC_IRQ_SOURCE_HPD1,
DC_IRQ_SOURCE_HPD2,
DC_IRQ_SOURCE_HPD3,
DC_IRQ_SOURCE_HPD4,
DC_IRQ_SOURCE_HPD5,
DC_IRQ_SOURCE_HPD6,
DC_IRQ_SOURCE_HPD1RX,
DC_IRQ_SOURCE_HPD2RX,
DC_IRQ_SOURCE_HPD3RX,
DC_IRQ_SOURCE_HPD4RX,
DC_IRQ_SOURCE_HPD5RX,
DC_IRQ_SOURCE_HPD6RX,
DC_IRQ_SOURCE_I2C_DDC1,
DC_IRQ_SOURCE_I2C_DDC2,
DC_IRQ_SOURCE_I2C_DDC3,
DC_IRQ_SOURCE_I2C_DDC4,
DC_IRQ_SOURCE_I2C_DDC5,
DC_IRQ_SOURCE_I2C_DDC6,
DC_IRQ_SOURCE_DPSINK1,
DC_IRQ_SOURCE_DPSINK2,
DC_IRQ_SOURCE_DPSINK3,
DC_IRQ_SOURCE_DPSINK4,
DC_IRQ_SOURCE_DPSINK5,
DC_IRQ_SOURCE_DPSINK6,
DC_IRQ_SOURCE_TIMER,
DC_IRQ_SOURCE_PFLIP_FIRST,
DC_IRQ_SOURCE_PFLIP1 = DC_IRQ_SOURCE_PFLIP_FIRST,
DC_IRQ_SOURCE_PFLIP2,
DC_IRQ_SOURCE_PFLIP3,
DC_IRQ_SOURCE_PFLIP4,
DC_IRQ_SOURCE_PFLIP5,
DC_IRQ_SOURCE_PFLIP6,
DC_IRQ_SOURCE_PFLIP_UNDERLAY0,
DC_IRQ_SOURCE_PFLIP_LAST = DC_IRQ_SOURCE_PFLIP_UNDERLAY0,
DC_IRQ_SOURCE_GPIOPAD0,
DC_IRQ_SOURCE_GPIOPAD1,
DC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Q_SOURCE_VUPDATE6,
DC_IRQ_SOURCE_VBLANK1,
DC_IRQ_SOURCE_VBLANK2,
DC_IRQ_SOURCE_VBLANK3,
DC_IRQ_SOURCE_VBLANK4,
DC_IRQ_SOURCE_VBLANK5,
DC_IRQ_SOURCE_VBLANK6,
DC_IRQ_SOURCE_DC1_VLINE0,
DC_IRQ_SOURCE_DC2_VLINE0,
DC_IRQ_SOURCE_DC3_VLINE0,
DC_IRQ_SOURCE_DC4_VLINE0,
DC_IRQ_SOURCE_DC5_VLINE0,
DC_IRQ_SOURCE_DC6_VLINE0,
DC_IRQ_SOURCE_DC1_VLINE1,
DC_IRQ_SOURCE_DC2_VLINE1,
DC_IRQ_SOURCE_DC3_VLINE1,
DC_IRQ_SOURCE_DC4_VLINE1,
DC_IRQ_SOURCE_DC5_VLINE1,
DC_IRQ_SOURCE_DC6_VLINE1,
DC_IRQ_SOURCE_DMCUB_OUTBOX,
DC_IRQ_SOURCE_DMCUB_OUTBOX0,
DC_IRQ_SOURCE_DMCUB_GENERAL_DATAOUT,
DAL_IRQ_SOURCES_NUMBER
};
enum irq_type
{
IRQ_TYPE_PFLIP = DC_IRQ_SOURCE_PFLIP1,
IRQ_TYPE_VUPDATE = DC_IRQ_SOURCE_VUPDATE1,
IRQ_TYPE_VBLANK = DC_IRQ_SOURCE_VBLANK1,
IRQ_TYPE_VLINE0 = DC_IRQ_SOURCE_DC1_VLINE0,
};
#define DAL_VALID_IRQ_SRC_NUM(src) \
((src) < DAL_IRQ_SOURCES_NUMBER && (src) > DC_IRQ_SOURCE_INVALID)
#define DAL_PFLIP_IRQ_SRC_NUM \
(DC_IRQ_SOURCE_PFLIP_LAST - DC_IRQ_SOURCE_PFLIP_FIRST + 1)
enum dc_interrupt_context {
INTERRUPT_LOW_IRQ_CONTEXT = 0,
INTERRUPT_HIGH_IRQ_CONTEXT,
INTERRUPT_CONTEXT_NUMBER
};
enum dc_interrupt_porlarity {
INTERRUPT_POLARITY_DEFAULT = 0,
INTERRUPT_POLARITY_LOW = INTERRUPT_POLARITY_DEFAULT,
INTERRUPT_POLARITY_HIGH,
INTERRUPT_POLARITY_BOTH
};
#define DC_DECODE_INTERRUPT_POLARITY(int_polarity) \
(int_polarity == INTERRUPT_POLARITY_LOW) ? "Low" : \
(int_polarity == INTERRUPT_POLARITY_HIGH) ? "High" : \
(int_polarity == INTERRUPT_POLARITY_BOTH) ? "Both" : "Invalid"
struct dc_timer_interrupt_params {
uint32_t micro_sec_interval;
enum dc_interrupt_context int_context;
};
struct dc_interrupt_params {
enum dc_interrupt_porlarity requested_polarity;
enum dc_interrupt_porlarity current_polarity;
enum dc_irq_source irq_source;
enum dc_interrupt_context int_context;
};
#endif