aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-v3020.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-v3020.c')
-rw-r--r--drivers/rtc/rtc-v3020.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/rtc/rtc-v3020.c b/drivers/rtc/rtc-v3020.c
index 10025d84026..14d4f036a76 100644
--- a/drivers/rtc/rtc-v3020.c
+++ b/drivers/rtc/rtc-v3020.c
@@ -92,19 +92,19 @@ static int v3020_read_time(struct device *dev, struct rtc_time *dt)
92 92
93 /* ...and then read constant values. */ 93 /* ...and then read constant values. */
94 tmp = v3020_get_reg(chip, V3020_SECONDS); 94 tmp = v3020_get_reg(chip, V3020_SECONDS);
95 dt->tm_sec = BCD2BIN(tmp); 95 dt->tm_sec = bcd2bin(tmp);
96 tmp = v3020_get_reg(chip, V3020_MINUTES); 96 tmp = v3020_get_reg(chip, V3020_MINUTES);
97 dt->tm_min = BCD2BIN(tmp); 97 dt->tm_min = bcd2bin(tmp);
98 tmp = v3020_get_reg(chip, V3020_HOURS); 98 tmp = v3020_get_reg(chip, V3020_HOURS);
99 dt->tm_hour = BCD2BIN(tmp); 99 dt->tm_hour = bcd2bin(tmp);
100 tmp = v3020_get_reg(chip, V3020_MONTH_DAY); 100 tmp = v3020_get_reg(chip, V3020_MONTH_DAY);
101 dt->tm_mday = BCD2BIN(tmp); 101 dt->tm_mday = bcd2bin(tmp);
102 tmp = v3020_get_reg(chip, V3020_MONTH); 102 tmp = v3020_get_reg(chip, V3020_MONTH);
103 dt->tm_mon = BCD2BIN(tmp) - 1; 103 dt->tm_mon = bcd2bin(tmp) - 1;
104 tmp = v3020_get_reg(chip, V3020_WEEK_DAY); 104 tmp = v3020_get_reg(chip, V3020_WEEK_DAY);
105 dt->tm_wday = BCD2BIN(tmp); 105 dt->tm_wday = bcd2bin(tmp);
106 tmp = v3020_get_reg(chip, V3020_YEAR); 106 tmp = v3020_get_reg(chip, V3020_YEAR);
107 dt->tm_year = BCD2BIN(tmp)+100; 107 dt->tm_year = bcd2bin(tmp)+100;
108 108
109#ifdef DEBUG 109#ifdef DEBUG
110 printk("\n%s : Read RTC values\n",__func__); 110 printk("\n%s : Read RTC values\n",__func__);
@@ -136,13 +136,13 @@ static int v3020_set_time(struct device *dev, struct rtc_time *dt)
136#endif 136#endif
137 137
138 /* Write all the values to ram... */ 138 /* Write all the values to ram... */
139 v3020_set_reg(chip, V3020_SECONDS, BIN2BCD(dt->tm_sec)); 139 v3020_set_reg(chip, V3020_SECONDS, bin2bcd(dt->tm_sec));
140 v3020_set_reg(chip, V3020_MINUTES, BIN2BCD(dt->tm_min)); 140 v3020_set_reg(chip, V3020_MINUTES, bin2bcd(dt->tm_min));
141 v3020_set_reg(chip, V3020_HOURS, BIN2BCD(dt->tm_hour)); 141 v3020_set_reg(chip, V3020_HOURS, bin2bcd(dt->tm_hour));
142 v3020_set_reg(chip, V3020_MONTH_DAY, BIN2BCD(dt->tm_mday)); 142 v3020_set_reg(chip, V3020_MONTH_DAY, bin2bcd(dt->tm_mday));
143 v3020_set_reg(chip, V3020_MONTH, BIN2BCD(dt->tm_mon + 1)); 143 v3020_set_reg(chip, V3020_MONTH, bin2bcd(dt->tm_mon + 1));
144 v3020_set_reg(chip, V3020_WEEK_DAY, BIN2BCD(dt->tm_wday)); 144 v3020_set_reg(chip, V3020_WEEK_DAY, bin2bcd(dt->tm_wday));
145 v3020_set_reg(chip, V3020_YEAR, BIN2BCD(dt->tm_year % 100)); 145 v3020_set_reg(chip, V3020_YEAR, bin2bcd(dt->tm_year % 100));
146 146
147 /* ...and set the clock. */ 147 /* ...and set the clock. */
148 v3020_set_reg(chip, V3020_CMD_RAM2CLOCK, 0); 148 v3020_set_reg(chip, V3020_CMD_RAM2CLOCK, 0);