Skip to content

Commit de736cd

Browse files
committed
drivers: counter: Enables support for MFD in counter
Enabled support for MFD in CMOS counter. Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
1 parent ff34ca5 commit de736cd

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

drivers/counter/Kconfig.cmos

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
config COUNTER_CMOS
77
bool "Counter driver for x86 CMOS/RTC clock"
88
default y if !RTC
9+
select MFD
910
depends on DT_HAS_MOTOROLA_MC146818_ENABLED

drivers/counter/counter_cmos.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
/* The "CMOS" device is accessed via an address latch and data port. */
2121

22-
#define X86_CMOS_ADDR (DT_INST_REG_ADDR_BY_IDX(0, 0))
23-
#define X86_CMOS_DATA (DT_INST_REG_ADDR_BY_IDX(0, 1))
22+
#define X86_CMOS_ADDR (DT_REG_ADDR_BY_IDX(DT_INST_PARENT(0), 0))
23+
#define X86_CMOS_DATA (DT_REG_ADDR_BY_IDX(DT_INST_PARENT(0), 1))
2424

2525
/*
2626
* A snapshot of the RTC state, or at least the state we're
@@ -204,4 +204,5 @@ static DEVICE_API(counter, api) = {
204204
};
205205

206206
DEVICE_DT_INST_DEFINE(0, NULL, NULL, NULL, &info, POST_KERNEL,
207-
CONFIG_COUNTER_INIT_PRIORITY, &api);
207+
UTIL_INC(CONFIG_MFD_MOTOROLA_MC146818_INIT_PRIORITY),
208+
&api);

0 commit comments

Comments
 (0)