drivers: interrupt_controller: Convert drivers to new DT device macros
Convert interrupt_controller drivers from: DEVICE_AND_API_INIT -> DEVICE_DT_INST_DEFINE DEVICE_GET -> DEVICE_DT_INST_GET DEVICE_DECLARE -> DEVICE_DT_INST_DECLARE etc... Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
1706bd2b41
commit
2d754333ad
7 changed files with 28 additions and 27 deletions
|
@ -30,7 +30,7 @@ struct sam0_eic_data {
|
|||
#define DEV_DATA(dev) \
|
||||
((struct sam0_eic_data *const)(dev)->data)
|
||||
|
||||
DEVICE_DECLARE(sam0_eic);
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
|
||||
static void wait_synchronization(void)
|
||||
|
@ -101,7 +101,7 @@ static void sam0_eic_isr(const struct device *dev)
|
|||
int sam0_eic_acquire(int port, int pin, enum sam0_eic_trigger trigger,
|
||||
bool filter, sam0_eic_callback_t cb, void *data)
|
||||
{
|
||||
const struct device *dev = DEVICE_GET(sam0_eic);
|
||||
const struct device *dev = DEVICE_DT_INST_GET(0);
|
||||
struct sam0_eic_data *dev_data = dev->data;
|
||||
struct sam0_eic_port_data *port_data;
|
||||
struct sam0_eic_line_assignment *line_assignment;
|
||||
|
@ -191,7 +191,7 @@ err_in_use:
|
|||
|
||||
static bool sam0_eic_check_ownership(int port, int pin, int line_index)
|
||||
{
|
||||
const struct device *dev = DEVICE_GET(sam0_eic);
|
||||
const struct device *dev = DEVICE_DT_INST_GET(0);
|
||||
struct sam0_eic_data *dev_data = dev->data;
|
||||
struct sam0_eic_line_assignment *line_assignment =
|
||||
&dev_data->lines[line_index];
|
||||
|
@ -210,7 +210,7 @@ static bool sam0_eic_check_ownership(int port, int pin, int line_index)
|
|||
|
||||
int sam0_eic_release(int port, int pin)
|
||||
{
|
||||
const struct device *dev = DEVICE_GET(sam0_eic);
|
||||
const struct device *dev = DEVICE_DT_INST_GET(0);
|
||||
struct sam0_eic_data *dev_data = dev->data;
|
||||
uint32_t mask;
|
||||
int line_index;
|
||||
|
@ -301,7 +301,7 @@ int sam0_eic_disable_interrupt(int port, int pin)
|
|||
|
||||
uint32_t sam0_eic_interrupt_pending(int port)
|
||||
{
|
||||
const struct device *dev = DEVICE_GET(sam0_eic);
|
||||
const struct device *dev = DEVICE_DT_INST_GET(0);
|
||||
struct sam0_eic_data *dev_data = dev->data;
|
||||
struct sam0_eic_line_assignment *line_assignment;
|
||||
uint32_t set = EIC->INTFLAG.reg;
|
||||
|
@ -333,7 +333,7 @@ uint32_t sam0_eic_interrupt_pending(int port)
|
|||
do { \
|
||||
IRQ_CONNECT(DT_INST_IRQ_BY_IDX(0, n, irq), \
|
||||
DT_INST_IRQ_BY_IDX(0, n, priority), \
|
||||
sam0_eic_isr, DEVICE_GET(sam0_eic), 0); \
|
||||
sam0_eic_isr, DEVICE_DT_INST_GET(0), 0); \
|
||||
irq_enable(DT_INST_IRQ_BY_IDX(0, n, irq)); \
|
||||
} while (0)
|
||||
|
||||
|
@ -413,7 +413,7 @@ static int sam0_eic_init(const struct device *dev)
|
|||
}
|
||||
|
||||
static struct sam0_eic_data eic_data;
|
||||
DEVICE_DEFINE(sam0_eic, DT_INST_LABEL(0), sam0_eic_init,
|
||||
NULL, &eic_data, NULL,
|
||||
DEVICE_DT_INST_DEFINE(0, sam0_eic_init,
|
||||
device_pm_control_nop, &eic_data, NULL,
|
||||
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
||||
NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue