drivers: ipm: ipm_cavs_idc: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h DT_INST macro APIs. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
a464ae7163
commit
d6e804ac4e
2 changed files with 9 additions and 7 deletions
|
@ -4,6 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define DT_DRV_COMPAT intel_cavs_idc
|
||||
|
||||
#include <stdint.h>
|
||||
#include <device.h>
|
||||
#include <init.h>
|
||||
|
@ -193,7 +195,7 @@ static int cavs_idc_set_enabled(struct device *dev, int enable)
|
|||
/* FIXME: when we have API to enable IRQ on specific core. */
|
||||
sys_set_bit(DT_CAVS_ICTL_BASE_ADDR + 0x04 +
|
||||
CAVS_ICTL_INT_CPU_OFFSET(i),
|
||||
CAVS_IRQ_NUMBER(DT_INST_0_INTEL_CAVS_IDC_IRQ_0));
|
||||
CAVS_IRQ_NUMBER(DT_INST_IRQN(0)));
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -201,11 +203,11 @@ static int cavs_idc_set_enabled(struct device *dev, int enable)
|
|||
|
||||
static int cavs_idc_init(struct device *dev)
|
||||
{
|
||||
IRQ_CONNECT(DT_INST_0_INTEL_CAVS_IDC_IRQ_0,
|
||||
DT_INST_0_INTEL_CAVS_IDC_IRQ_0_PRIORITY,
|
||||
IRQ_CONNECT(DT_INST_IRQN(0),
|
||||
DT_INST_IRQ(0, priority),
|
||||
cavs_idc_isr, DEVICE_GET(cavs_idc), 0);
|
||||
|
||||
irq_enable(DT_INST_0_INTEL_CAVS_IDC_IRQ_0);
|
||||
irq_enable(DT_INST_IRQN(0));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -219,7 +221,7 @@ static const struct ipm_driver_api cavs_idc_driver_api = {
|
|||
};
|
||||
|
||||
DEVICE_AND_API_INIT(IPM_CAVS_IDC_DEV_NAME,
|
||||
DT_INST_0_INTEL_CAVS_IDC_LABEL,
|
||||
DT_INST_LABEL(0),
|
||||
&cavs_idc_init, &cavs_idc_device_data, NULL,
|
||||
PRE_KERNEL_2, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
||||
&cavs_idc_driver_api);
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
#ifndef ZEPHYR_DRIVERS_IPM_IPM_CAVS_IDC_PRIV_H_
|
||||
#define ZEPHYR_DRIVERS_IPM_IPM_CAVS_IDC_PRIV_H_
|
||||
|
||||
#define IDC_REG_SIZE DT_INST_0_INTEL_CAVS_IDC_SIZE
|
||||
#define IDC_REG_SIZE DT_INST_REG_SIZE(0)
|
||||
#define IDC_REG_BASE(x) \
|
||||
(DT_INST_0_INTEL_CAVS_IDC_BASE_ADDRESS + x * IDC_REG_SIZE)
|
||||
(DT_INST_REG_ADDR(0) + x * IDC_REG_SIZE)
|
||||
|
||||
#define IDC_CPU_OFFSET 0x10
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue