13 #include <linux/types.h>
17 #include <linux/rtc.h>
20 #include <linux/export.h>
36 "timer", timer_routine))
37 pr_err(
"Couldn't register timer interrupt\n");
42 #define TICK_SIZE 10000
54 if (
st_mfp.int_pn_b & (1 << 5))
66 #define COPY(v) val->v=(mste_rtc.v & 0xf)
78 static void mste_write(
struct MSTE_RTC *val)
80 #define COPY(v) mste_rtc.v=val->v
92 #define RTC_READ(reg) \
93 ({ unsigned char __val; \
94 (void) atari_writeb(reg,&tt_rtc.regsel); \
95 __val = tt_rtc.data; \
99 #define RTC_WRITE(reg,val) \
101 atari_writeb(reg,&tt_rtc.regsel); \
102 tt_rtc.data = (val); \
106 #define HWCLK_POLL_INTERVAL 5
129 if (hour == 0 || hour == 20)
153 if (hour == 12 || hour == 12 + 20)
271 if (!pm &&
hour == 12)
273 else if (pm &&
hour != 12)
292 short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60;
294 unsigned char rtc_minutes;
298 if ((rtc_minutes < real_minutes
299 ? real_minutes - rtc_minutes
300 : rtc_minutes - real_minutes) < 30)
316 short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60;
317 unsigned char save_control, save_freq_select, rtc_minutes;
327 rtc_minutes =
bcd2bin(rtc_minutes);
332 if ((rtc_minutes < real_minutes
333 ? real_minutes - rtc_minutes
334 : rtc_minutes - real_minutes) < 30)
336 if (!(save_control & RTC_DM_BINARY))
338 real_seconds =
bin2bcd(real_seconds);
339 real_minutes =
bin2bcd(real_minutes);