m68k: Remove unused set_clock_mmss() helpers
Commit 397ac99c6c
("m68k: remove dead timer code") removed set_rtc_mmss()
because it was unused in 2012. However, this was itself the only user of the
mach_set_clock_mmss() callback and the many implementations of that callback,
which are equally unused.
This removes all of those as well.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Greg Ungerer <gerg@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
This commit is contained in:

committed by
Geert Uytterhoeven

parent
5b9bfb8ec4
commit
d7de1c3af1
@@ -285,69 +285,6 @@ int atari_tt_hwclk( int op, struct rtc_time *t )
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
|
||||
int atari_mste_set_clock_mmss (unsigned long nowtime)
|
||||
{
|
||||
short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60;
|
||||
struct MSTE_RTC val;
|
||||
unsigned char rtc_minutes;
|
||||
|
||||
mste_read(&val);
|
||||
rtc_minutes= val.min_ones + val.min_tens * 10;
|
||||
if ((rtc_minutes < real_minutes
|
||||
? real_minutes - rtc_minutes
|
||||
: rtc_minutes - real_minutes) < 30)
|
||||
{
|
||||
val.sec_ones = real_seconds % 10;
|
||||
val.sec_tens = real_seconds / 10;
|
||||
val.min_ones = real_minutes % 10;
|
||||
val.min_tens = real_minutes / 10;
|
||||
mste_write(&val);
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int atari_tt_set_clock_mmss (unsigned long nowtime)
|
||||
{
|
||||
int retval = 0;
|
||||
short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60;
|
||||
unsigned char save_control, save_freq_select, rtc_minutes;
|
||||
|
||||
save_control = RTC_READ (RTC_CONTROL); /* tell the clock it's being set */
|
||||
RTC_WRITE (RTC_CONTROL, save_control | RTC_SET);
|
||||
|
||||
save_freq_select = RTC_READ (RTC_FREQ_SELECT); /* stop and reset prescaler */
|
||||
RTC_WRITE (RTC_FREQ_SELECT, save_freq_select | RTC_DIV_RESET2);
|
||||
|
||||
rtc_minutes = RTC_READ (RTC_MINUTES);
|
||||
if (!(save_control & RTC_DM_BINARY))
|
||||
rtc_minutes = bcd2bin(rtc_minutes);
|
||||
|
||||
/* Since we're only adjusting minutes and seconds, don't interfere
|
||||
with hour overflow. This avoids messing with unknown time zones
|
||||
but requires your RTC not to be off by more than 30 minutes. */
|
||||
if ((rtc_minutes < real_minutes
|
||||
? real_minutes - rtc_minutes
|
||||
: rtc_minutes - real_minutes) < 30)
|
||||
{
|
||||
if (!(save_control & RTC_DM_BINARY))
|
||||
{
|
||||
real_seconds = bin2bcd(real_seconds);
|
||||
real_minutes = bin2bcd(real_minutes);
|
||||
}
|
||||
RTC_WRITE (RTC_SECONDS, real_seconds);
|
||||
RTC_WRITE (RTC_MINUTES, real_minutes);
|
||||
}
|
||||
else
|
||||
retval = -1;
|
||||
|
||||
RTC_WRITE (RTC_FREQ_SELECT, save_freq_select);
|
||||
RTC_WRITE (RTC_CONTROL, save_control);
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* c-indent-level: 4
|
||||
|
Reference in New Issue
Block a user