summaryrefslogtreecommitdiff
path: root/drivers/rtc/s3c44b0_rtc.c
diff options
context:
space:
mode:
authorAlbin Tonnerre <albin.tonnerre@free-electrons.com>2009-08-13 15:31:11 +0200
committerWolfgang Denk <wd@denx.de>2009-08-25 12:57:55 +0200
commite84aba135ed7145299304ef550e92f08b2c99d7a (patch)
treea70c19d295abf01ca9f53f01fb008cab416a6b6e /drivers/rtc/s3c44b0_rtc.c
parent5b53b29bc2e82b80b669f1d2402068c60d7fecd0 (diff)
downloadu-boot-imx-e84aba135ed7145299304ef550e92f08b2c99d7a.zip
u-boot-imx-e84aba135ed7145299304ef550e92f08b2c99d7a.tar.gz
u-boot-imx-e84aba135ed7145299304ef550e92f08b2c99d7a.tar.bz2
Replace BCD2BIN and BIN2BCD macros with inline functions
In the process, also remove backward-compatiblity macros BIN_TO_BCD and BCD_TO_BIN and update the sole board using them to use the new bin2bcd and bcd2bin instead Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com> Acked-by: Stefan Roese <sr@denx.de> Acked-by: Detlev Zundel <dzu@denx.de>
Diffstat (limited to 'drivers/rtc/s3c44b0_rtc.c')
-rw-r--r--drivers/rtc/s3c44b0_rtc.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/rtc/s3c44b0_rtc.c b/drivers/rtc/s3c44b0_rtc.c
index bfb744a..a027fb1 100644
--- a/drivers/rtc/s3c44b0_rtc.c
+++ b/drivers/rtc/s3c44b0_rtc.c
@@ -37,24 +37,24 @@
int rtc_get (struct rtc_time* tm)
{
RTCCON |= 1;
- tm->tm_year = BCD2BIN(BCDYEAR);
- tm->tm_mon = BCD2BIN(BCDMON);
- tm->tm_wday = BCD2BIN(BCDDATE);
- tm->tm_mday = BCD2BIN(BCDDAY);
- tm->tm_hour = BCD2BIN(BCDHOUR);
- tm->tm_min = BCD2BIN(BCDMIN);
- tm->tm_sec = BCD2BIN(BCDSEC);
+ tm->tm_year = bcd2bin(BCDYEAR);
+ tm->tm_mon = bcd2bin(BCDMON);
+ tm->tm_wday = bcd2bin(BCDDATE);
+ tm->tm_mday = bcd2bin(BCDDAY);
+ tm->tm_hour = bcd2bin(BCDHOUR);
+ tm->tm_min = bcd2bin(BCDMIN);
+ tm->tm_sec = bcd2bin(BCDSEC);
if (tm->tm_sec==0) {
/* we have to re-read the rtc data because of the "one second deviation" problem */
/* see RTC datasheet for more info about it */
- tm->tm_year = BCD2BIN(BCDYEAR);
- tm->tm_mon = BCD2BIN(BCDMON);
- tm->tm_mday = BCD2BIN(BCDDAY);
- tm->tm_wday = BCD2BIN(BCDDATE);
- tm->tm_hour = BCD2BIN(BCDHOUR);
- tm->tm_min = BCD2BIN(BCDMIN);
- tm->tm_sec = BCD2BIN(BCDSEC);
+ tm->tm_year = bcd2bin(BCDYEAR);
+ tm->tm_mon = bcd2bin(BCDMON);
+ tm->tm_mday = bcd2bin(BCDDAY);
+ tm->tm_wday = bcd2bin(BCDDATE);
+ tm->tm_hour = bcd2bin(BCDHOUR);
+ tm->tm_min = bcd2bin(BCDMIN);
+ tm->tm_sec = bcd2bin(BCDSEC);
}
RTCCON &= ~1;
@@ -75,13 +75,13 @@ int rtc_set (struct rtc_time* tm)
tm->tm_year -= 2000;
RTCCON |= 1;
- BCDYEAR = BIN2BCD(tm->tm_year);
- BCDMON = BIN2BCD(tm->tm_mon);
- BCDDAY = BIN2BCD(tm->tm_mday);
- BCDDATE = BIN2BCD(tm->tm_wday);
- BCDHOUR = BIN2BCD(tm->tm_hour);
- BCDMIN = BIN2BCD(tm->tm_min);
- BCDSEC = BIN2BCD(tm->tm_sec);
+ BCDYEAR = bin2bcd(tm->tm_year);
+ BCDMON = bin2bcd(tm->tm_mon);
+ BCDDAY = bin2bcd(tm->tm_mday);
+ BCDDATE = bin2bcd(tm->tm_wday);
+ BCDHOUR = bin2bcd(tm->tm_hour);
+ BCDMIN = bin2bcd(tm->tm_min);
+ BCDSEC = bin2bcd(tm->tm_sec);
RTCCON &= 1;
return 0;