RTC-S3C used to print out debug messages incorrectly. This patch corrects incorrect outputs. (undecoded bcd numbers, incorrectly decoded register values) This patch affects the pr-debug messages only.
Unified · Split
| @@ -152,10 +152,6 @@ static int s3c_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) · 151 unmodified lines | ||
| 152 | 152 | goto retry_get_time; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | − pr_debug("read time %04d.%02d.%02d %02d:%02d:%02d\n", | |
| 156 | − 1900 + rtc_tm->tm_year, rtc_tm->tm_mon, rtc_tm->tm_mday, | |
| 157 | − rtc_tm->tm_hour, rtc_tm->tm_min, rtc_tm->tm_sec); | |
| 158 | − | |
| 159 | 155 | rtc_tm->tm_sec = bcd2bin(rtc_tm->tm_sec); |
| 160 | 156 | rtc_tm->tm_min = bcd2bin(rtc_tm->tm_min); |
| 161 | 157 | rtc_tm->tm_hour = bcd2bin(rtc_tm->tm_hour); |
| @@ -164,6 +160,11 @@ static int s3c_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) · 2 unmodified lines | ||
| 164 | 160 | rtc_tm->tm_year = bcd2bin(rtc_tm->tm_year); |
| 165 | 161 | |
| 166 | 162 | rtc_tm->tm_year += 100; |
| 163 | + | |
| 164 | + pr_debug("read time %04d.%02d.%02d %02d:%02d:%02d\n", | |
| 165 | + 1900 + rtc_tm->tm_year, rtc_tm->tm_mon, rtc_tm->tm_mday, | |
| 166 | + rtc_tm->tm_hour, rtc_tm->tm_min, rtc_tm->tm_sec); | |
| 167 | + | |
| 167 | 168 | rtc_tm->tm_mon -= 1; |
| 168 | 169 | |
| 169 | 170 | clk_disable(rtc_clk); |
| @@ -269,10 +270,9 @@ static int s3c_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) · 99 unmodified lines | ||
| 269 | 270 | clk_enable(rtc_clk); |
| 270 | 271 | pr_debug("s3c_rtc_setalarm: %d, %04d.%02d.%02d %02d:%02d:%02d\n", |
| 271 | 272 | alrm->enabled, |
| 272 | − 1900 + tm->tm_year, tm->tm_mon, tm->tm_mday, | |
| 273 | + 1900 + tm->tm_year, tm->tm_mon + 1, tm->tm_mday, | |
| 273 | 274 | tm->tm_hour, tm->tm_min, tm->tm_sec); |
| 274 | 275 | |
| 275 | − | |
| 276 | 276 | alrm_en = readb(base + S3C2410_RTCALM) & S3C2410_RTCALM_ALMEN; |
| 277 | 277 | writeb(0x00, base + S3C2410_RTCALM); |
| 278 | 278 | |