From 4c5f8acf4a1254b8df81fc166716209df6bd336d Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 25 Mar 2020 11:24:49 -0500 Subject: [PATCH] drivers: timer: hpet: 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 --- drivers/timer/hpet.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/timer/hpet.c b/drivers/timer/hpet.c index 6da35df57f0..8cccfd6474f 100644 --- a/drivers/timer/hpet.c +++ b/drivers/timer/hpet.c @@ -3,13 +3,15 @@ * * SPDX-License-Identifier: Apache-2.0 */ + +#define DT_DRV_COMPAT intel_hpet #include #include #include #include #define HPET_REG32(off) (*(volatile u32_t *)(long) \ - (DT_INST_0_INTEL_HPET_BASE_ADDRESS + (off))) + (DT_INST_REG_ADDR(0) + (off))) #define CLK_PERIOD_REG HPET_REG32(0x04) /* High dword of caps reg */ #define GENERAL_CONF_REG HPET_REG32(0x10) @@ -84,11 +86,11 @@ int z_clock_driver_init(struct device *device) extern int z_clock_hw_cycles_per_sec; u32_t hz; - IRQ_CONNECT(DT_INST_0_INTEL_HPET_IRQ_0, - DT_INST_0_INTEL_HPET_IRQ_0_PRIORITY, + IRQ_CONNECT(DT_INST_IRQN(0), + DT_INST_IRQ(0, priority), hpet_isr, 0, 0); - set_timer0_irq(DT_INST_0_INTEL_HPET_IRQ_0); - irq_enable(DT_INST_0_INTEL_HPET_IRQ_0); + set_timer0_irq(DT_INST_IRQN(0)); + irq_enable(DT_INST_IRQN(0)); /* CLK_PERIOD_REG is in femtoseconds (1e-15 sec) */ hz = (u32_t)(1000000000000000ull / CLK_PERIOD_REG);