Skip to content

Commit 8fd5a7d

Browse files
committed
drivers: rtc: mc146818: Move data struct definition to a header file
Moved rtc_mc146818_data struct definition to a header file. Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
1 parent 8ab712a commit 8fd5a7d

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

drivers/rtc/rtc_mc146818.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <zephyr/devicetree.h>
1616
#include <zephyr/drivers/rtc.h>
1717
#include <zephyr/sys/sys_io.h>
18+
#include <zephyr/drivers/rtc/mc146818.h>
1819

1920
#define RTC_STD_INDEX (DT_INST_REG_ADDR_BY_IDX(0, 0))
2021
#define RTC_STD_TARGET (DT_INST_REG_ADDR_BY_IDX(0, 1))
@@ -118,15 +119,6 @@
118119
#define RTC_IN_CLK_DIV_BITS_1048576 (1 << 4)
119120
#define RTC_IN_CLK_DIV_BITS_32768 (2 << 4)
120121

121-
struct rtc_mc146818_data {
122-
struct k_spinlock lock;
123-
bool alarm_pending;
124-
rtc_alarm_callback cb;
125-
void *cb_data;
126-
rtc_update_callback update_cb;
127-
void *update_cb_data;
128-
};
129-
130122
static uint8_t rtc_read(int reg)
131123
{
132124
uint8_t value;

include/zephyr/drivers/rtc/mc146818.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright (c) 2025 Intel Corporation.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef ZEPHYR_INCLUDE_DRIVERS_RTC_MC146818_H_
8+
#define ZEPHYR_INCLUDE_DRIVERS_RTC_MC146818_H_
9+
10+
#include <zephyr/drivers/rtc.h>
11+
12+
struct rtc_mc146818_data {
13+
struct k_spinlock lock;
14+
bool alarm_pending;
15+
rtc_alarm_callback cb;
16+
void *cb_data;
17+
rtc_update_callback update_cb;
18+
void *update_cb_data;
19+
};
20+
21+
#endif /* ZEPHYR_INCLUDE_DRIVERS_RTC_MC146818_H_ */

0 commit comments

Comments
 (0)