Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Machine dependent access functions for RTC registers.
0004  */
0005 #ifndef _ASM_MC146818RTC_H
0006 #define _ASM_MC146818RTC_H
0007 
0008 #include <linux/io.h>
0009 #include <linux/kernel.h>
0010 
0011 #define RTC_IRQ BUILD_BUG_ON(1)
0012 
0013 #ifndef RTC_PORT
0014 #define RTC_PORT(x) (0x70 + (x))
0015 #define RTC_ALWAYS_BCD  1   /* RTC operates in binary mode */
0016 #endif
0017 
0018 /*
0019  * The yet supported machines all access the RTC index register via
0020  * an ISA port access but the way to access the date register differs ...
0021  */
0022 #define CMOS_READ(addr) ({ \
0023 outb_p((addr),RTC_PORT(0)); \
0024 inb_p(RTC_PORT(1)); \
0025 })
0026 #define CMOS_WRITE(val, addr) ({ \
0027 outb_p((addr),RTC_PORT(0)); \
0028 outb_p((val),RTC_PORT(1)); \
0029 })
0030 
0031 #endif /* _ASM_MC146818RTC_H */