Source
138
138
/* Day of the week in linux range is 0~6 while 1~7 in RTC chip */
139
139
time->tm_wday = bcd2bin(week) - 1;
140
140
time->tm_mday = bcd2bin(day);
141
141
/* linux tm_mon range:0~11, while month range is 1~12 in RTC chip */
142
142
time->tm_mon = bcd2bin(month & 0x7F) - 1;
143
143
if (century)
144
144
add_century = 100;
145
145
146
146
time->tm_year = bcd2bin(year) + add_century;
147
147
148
-
return rtc_valid_tm(time);
148
+
return 0;
149
149
}
150
150
151
151
static int ds3232_set_time(struct device *dev, struct rtc_time *time)
152
152
{
153
153
struct ds3232 *ds3232 = dev_get_drvdata(dev);
154
154
u8 buf[7];
155
155
156
156
/* Extract time from rtc_time and load into ds3232*/
157
157
158
158
buf[0] = bin2bcd(time->tm_sec);