summaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2008-06-03 20:19:08 +0200
committerStefan Roese <sr@denx.de>2008-06-03 20:19:08 +0200
commit10a3367955bc2033b288915f8f10d0e507fe2fa1 (patch)
treec3ac82364df83db5d5cb963c64b863b77a20445c /drivers/rtc
parent97f7d27c8ecf34879d6b747c10fa9a18c02a4cc0 (diff)
parent1f1554841a4c8e069d331176f0c3059fb2bb8280 (diff)
downloadu-boot-imx-10a3367955bc2033b288915f8f10d0e507fe2fa1.zip
u-boot-imx-10a3367955bc2033b288915f8f10d0e507fe2fa1.tar.gz
u-boot-imx-10a3367955bc2033b288915f8f10d0e507fe2fa1.tar.bz2
Merge branch 'master' of /home/stefan/git/u-boot/u-boot
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/date.c4
-rw-r--r--drivers/rtc/ds12887.c10
-rw-r--r--drivers/rtc/ds1302.c4
-rw-r--r--drivers/rtc/mc146818.c36
4 files changed, 27 insertions, 27 deletions
diff --git a/drivers/rtc/date.c b/drivers/rtc/date.c
index a83a723..d30ad92 100644
--- a/drivers/rtc/date.c
+++ b/drivers/rtc/date.c
@@ -36,8 +36,8 @@
#define SECDAY 86400L
#define SECYR (SECDAY * 365)
#define leapyear(year) ((year) % 4 == 0)
-#define days_in_year(a) (leapyear(a) ? 366 : 365)
-#define days_in_month(a) (month_days[(a) - 1])
+#define days_in_year(a) (leapyear(a) ? 366 : 365)
+#define days_in_month(a) (month_days[(a) - 1])
static int month_days[12] = {
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
diff --git a/drivers/rtc/ds12887.c b/drivers/rtc/ds12887.c
index 57a446d..990ebba 100644
--- a/drivers/rtc/ds12887.c
+++ b/drivers/rtc/ds12887.c
@@ -35,14 +35,14 @@
#define RTC_MINUTES 0x02
#define RTC_MINUTES_ALARM 0x03
#define RTC_HOURS 0x04
-#define RTC_HOURS_ALARM 0x05
-#define RTC_DAY_OF_WEEK 0x06
+#define RTC_HOURS_ALARM 0x05
+#define RTC_DAY_OF_WEEK 0x06
#define RTC_DATE_OF_MONTH 0x07
#define RTC_MONTH 0x08
#define RTC_YEAR 0x09
-#define RTC_CONTROL_A 0x0A
-#define RTC_CONTROL_B 0x0B
-#define RTC_CONTROL_C 0x0C
+#define RTC_CONTROL_A 0x0A
+#define RTC_CONTROL_B 0x0B
+#define RTC_CONTROL_C 0x0C
#define RTC_CONTROL_D 0x0D
#define RTC_CA_UIP 0x80
diff --git a/drivers/rtc/ds1302.c b/drivers/rtc/ds1302.c
index 3a856c8..e4e9154 100644
--- a/drivers/rtc/ds1302.c
+++ b/drivers/rtc/ds1302.c
@@ -66,7 +66,7 @@ struct ds1302_st
unsigned char month:4;
unsigned char zero4:5;
- unsigned char day:3; /* day of week */
+ unsigned char day:3; /* day of week */
unsigned char year10:4;
unsigned char year:4;
@@ -191,7 +191,7 @@ write_ser_drv(unsigned char addr, unsigned char *buf, int count)
void
rtc_init(void)
{
- struct ds1302_st bbclk;
+ struct ds1302_st bbclk;
unsigned char b;
int mod;
diff --git a/drivers/rtc/mc146818.c b/drivers/rtc/mc146818.c
index 70f7017..7c4fe36 100644
--- a/drivers/rtc/mc146818.c
+++ b/drivers/rtc/mc146818.c
@@ -38,21 +38,21 @@ static void rtc_write (uchar reg, uchar val);
static uchar bin2bcd (unsigned int n);
static unsigned bcd2bin(uchar c);
-#define RTC_PORT_MC146818 CFG_ISA_IO_BASE_ADDRESS + 0x70
-#define RTC_SECONDS 0x00
-#define RTC_SECONDS_ALARM 0x01
-#define RTC_MINUTES 0x02
-#define RTC_MINUTES_ALARM 0x03
-#define RTC_HOURS 0x04
-#define RTC_HOURS_ALARM 0x05
-#define RTC_DAY_OF_WEEK 0x06
-#define RTC_DATE_OF_MONTH 0x07
-#define RTC_MONTH 0x08
-#define RTC_YEAR 0x09
-#define RTC_CONFIG_A 0x0A
-#define RTC_CONFIG_B 0x0B
-#define RTC_CONFIG_C 0x0C
-#define RTC_CONFIG_D 0x0D
+#define RTC_PORT_MC146818 CFG_ISA_IO_BASE_ADDRESS + 0x70
+#define RTC_SECONDS 0x00
+#define RTC_SECONDS_ALARM 0x01
+#define RTC_MINUTES 0x02
+#define RTC_MINUTES_ALARM 0x03
+#define RTC_HOURS 0x04
+#define RTC_HOURS_ALARM 0x05
+#define RTC_DAY_OF_WEEK 0x06
+#define RTC_DATE_OF_MONTH 0x07
+#define RTC_MONTH 0x08
+#define RTC_YEAR 0x09
+#define RTC_CONFIG_A 0x0A
+#define RTC_CONFIG_B 0x0B
+#define RTC_CONFIG_C 0x0C
+#define RTC_CONFIG_D 0x0D
/* ------------------------------------------------------------------------- */
@@ -62,12 +62,12 @@ int rtc_get (struct rtc_time *tmp)
uchar sec, min, hour, mday, wday, mon, year;
/* here check if rtc can be accessed */
while((rtc_read(RTC_CONFIG_A)&0x80)==0x80);
- sec = rtc_read (RTC_SECONDS);
- min = rtc_read (RTC_MINUTES);
+ sec = rtc_read (RTC_SECONDS);
+ min = rtc_read (RTC_MINUTES);
hour = rtc_read (RTC_HOURS);
mday = rtc_read (RTC_DATE_OF_MONTH);
wday = rtc_read (RTC_DAY_OF_WEEK);
- mon = rtc_read (RTC_MONTH);
+ mon = rtc_read (RTC_MONTH);
year = rtc_read (RTC_YEAR);
#ifdef CONFIG_AMIGAONEG3SE
wday -= 1; /* VIA 686 stores Sunday = 1, Monday = 2, ... */