mc146818rtc.h 680 B

12345678910111213141516171819202122232425262728
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Machine dependent access functions for RTC registers.
  4. */
  5. #ifndef __ASM_ALPHA_MC146818RTC_H
  6. #define __ASM_ALPHA_MC146818RTC_H
  7. #include <asm/io.h>
  8. #ifndef RTC_PORT
  9. #define RTC_PORT(x) (0x70 + (x))
  10. #define RTC_ALWAYS_BCD 1 /* RTC operates in binary mode */
  11. #endif
  12. /*
  13. * The yet supported machines all access the RTC index register via
  14. * an ISA port access but the way to access the date register differs ...
  15. */
  16. #define CMOS_READ(addr) ({ \
  17. outb_p((addr),RTC_PORT(0)); \
  18. inb_p(RTC_PORT(1)); \
  19. })
  20. #define CMOS_WRITE(val, addr) ({ \
  21. outb_p((addr),RTC_PORT(0)); \
  22. outb_p((val),RTC_PORT(1)); \
  23. })
  24. #endif /* __ASM_ALPHA_MC146818RTC_H */