blob: 007aeb7c23eba46983a073cdad7ced7a8fc621c0 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Bin Meng39f8b082017-04-21 07:24:38 -07002/*
3 * Copyright (C) 2017, Bin Meng <bmeng.cn@gmail.com>
Bin Meng39f8b082017-04-21 07:24:38 -07004 */
5
6#ifndef __EARLY_CMOS_H
7#define __EARLY_CMOS_H
8
Tom Rinidec7ea02024-05-20 13:35:03 -06009#include <linux/types.h>
10
Bin Meng39f8b082017-04-21 07:24:38 -070011/* CMOS actually resides in the RTC SRAM */
12#define CMOS_IO_PORT 0x70
13
14/**
15 * cmos_read8() - Get 8-bit data stored at the given address
16 *
17 * This reads from CMOS for the 8-bit data stored at the given address.
18 *
19 * @addr: RTC SRAM address
20 * @return: 8-bit data stored at the given address
21 */
22u8 cmos_read8(u8 addr);
23
24/**
25 * cmos_read16() - Get 16-bit data stored at the given address
26 *
27 * This reads from CMOS for the 16-bit data stored at the given address.
28 *
29 * @addr: RTC SRAM address
30 * @return: 16-bit data stored at the given address
31 */
32u16 cmos_read16(u8 addr);
33
34/**
35 * cmos_read32() - Get 32-bit data stored at the given address
36 *
37 * This reads from CMOS for the 32-bit data stored at the given address.
38 *
39 * @addr: RTC SRAM address
40 * @return: 32-bit data stored at the given address
41 */
42u32 cmos_read32(u8 addr);
43
44#endif /* __EARLY_CMOS_H */