162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Machine dependent access functions for RTC registers. 462306a36Sopenharmony_ci */ 562306a36Sopenharmony_ci#ifndef _ASM_MC146818RTC_H 662306a36Sopenharmony_ci#define _ASM_MC146818RTC_H 762306a36Sopenharmony_ci 862306a36Sopenharmony_ci 962306a36Sopenharmony_ci#ifdef CONFIG_ATARI 1062306a36Sopenharmony_ci/* RTC in Atari machines */ 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci#include <asm/atarihw.h> 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_ci#define ATARI_RTC_PORT(x) (TT_RTC_BAS + 2*(x)) 1562306a36Sopenharmony_ci#define RTC_ALWAYS_BCD 0 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ci#define CMOS_READ(addr) ({ \ 1862306a36Sopenharmony_ciatari_outb_p((addr), ATARI_RTC_PORT(0)); \ 1962306a36Sopenharmony_ciatari_inb_p(ATARI_RTC_PORT(1)); \ 2062306a36Sopenharmony_ci}) 2162306a36Sopenharmony_ci#define CMOS_WRITE(val, addr) ({ \ 2262306a36Sopenharmony_ciatari_outb_p((addr), ATARI_RTC_PORT(0)); \ 2362306a36Sopenharmony_ciatari_outb_p((val), ATARI_RTC_PORT(1)); \ 2462306a36Sopenharmony_ci}) 2562306a36Sopenharmony_ci#endif /* CONFIG_ATARI */ 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ci#endif /* _ASM_MC146818RTC_H */ 28