@@ -97,7 +97,7 @@ alpha_rtc_read_time(struct device *dev, struct rtc_time *tm)
97
97
tm -> tm_year = year ;
98
98
}
99
99
100
- return rtc_valid_tm ( tm ) ;
100
+ return 0 ;
101
101
}
102
102
103
103
static int
@@ -114,83 +114,6 @@ alpha_rtc_set_time(struct device *dev, struct rtc_time *tm)
114
114
return mc146818_set_time (tm );
115
115
}
116
116
117
- static int
118
- alpha_rtc_set_mmss (struct device * dev , time64_t nowtime )
119
- {
120
- int retval = 0 ;
121
- int real_seconds , real_minutes , cmos_minutes ;
122
- unsigned char save_control , save_freq_select ;
123
-
124
- /* Note: This code only updates minutes and seconds. Comments
125
- indicate this was to avoid messing with unknown time zones,
126
- and with the epoch nonsense described above. In order for
127
- this to work, the existing clock cannot be off by more than
128
- 15 minutes.
129
-
130
- ??? This choice is may be out of date. The x86 port does
131
- not have problems with timezones, and the epoch processing has
132
- now been fixed in alpha_set_rtc_time.
133
-
134
- In either case, one can always force a full rtc update with
135
- the userland hwclock program, so surely 15 minute accuracy
136
- is no real burden. */
137
-
138
- /* In order to set the CMOS clock precisely, we have to be called
139
- 500 ms after the second nowtime has started, because when
140
- nowtime is written into the registers of the CMOS clock, it will
141
- jump to the next second precisely 500 ms later. Check the Motorola
142
- MC146818A or Dallas DS12887 data sheet for details. */
143
-
144
- /* irq are locally disabled here */
145
- spin_lock (& rtc_lock );
146
- /* Tell the clock it's being set */
147
- save_control = CMOS_READ (RTC_CONTROL );
148
- CMOS_WRITE ((save_control |RTC_SET ), RTC_CONTROL );
149
-
150
- /* Stop and reset prescaler */
151
- save_freq_select = CMOS_READ (RTC_FREQ_SELECT );
152
- CMOS_WRITE ((save_freq_select |RTC_DIV_RESET2 ), RTC_FREQ_SELECT );
153
-
154
- cmos_minutes = CMOS_READ (RTC_MINUTES );
155
- if (!(save_control & RTC_DM_BINARY ) || RTC_ALWAYS_BCD )
156
- cmos_minutes = bcd2bin (cmos_minutes );
157
-
158
- real_seconds = nowtime % 60 ;
159
- real_minutes = nowtime / 60 ;
160
- if (((abs (real_minutes - cmos_minutes ) + 15 ) / 30 ) & 1 ) {
161
- /* correct for half hour time zone */
162
- real_minutes += 30 ;
163
- }
164
- real_minutes %= 60 ;
165
-
166
- if (abs (real_minutes - cmos_minutes ) < 30 ) {
167
- if (!(save_control & RTC_DM_BINARY ) || RTC_ALWAYS_BCD ) {
168
- real_seconds = bin2bcd (real_seconds );
169
- real_minutes = bin2bcd (real_minutes );
170
- }
171
- CMOS_WRITE (real_seconds ,RTC_SECONDS );
172
- CMOS_WRITE (real_minutes ,RTC_MINUTES );
173
- } else {
174
- printk_once (KERN_NOTICE
175
- "set_rtc_mmss: can't update from %d to %d\n" ,
176
- cmos_minutes , real_minutes );
177
- retval = -1 ;
178
- }
179
-
180
- /* The following flags have to be released exactly in this order,
181
- * otherwise the DS12887 (popular MC146818A clone with integrated
182
- * battery and quartz) will not reset the oscillator and will not
183
- * update precisely 500 ms later. You won't find this mentioned in
184
- * the Dallas Semiconductor data sheets, but who believes data
185
- * sheets anyway ... -- Markus Kuhn
186
- */
187
- CMOS_WRITE (save_control , RTC_CONTROL );
188
- CMOS_WRITE (save_freq_select , RTC_FREQ_SELECT );
189
- spin_unlock (& rtc_lock );
190
-
191
- return retval ;
192
- }
193
-
194
117
static int
195
118
alpha_rtc_ioctl (struct device * dev , unsigned int cmd , unsigned long arg )
196
119
{
@@ -210,7 +133,6 @@ alpha_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
210
133
static const struct rtc_class_ops alpha_rtc_ops = {
211
134
.read_time = alpha_rtc_read_time ,
212
135
.set_time = alpha_rtc_set_time ,
213
- .set_mmss64 = alpha_rtc_set_mmss ,
214
136
.ioctl = alpha_rtc_ioctl ,
215
137
};
216
138
@@ -225,7 +147,6 @@ static const struct rtc_class_ops alpha_rtc_ops = {
225
147
226
148
union remote_data {
227
149
struct rtc_time * tm ;
228
- unsigned long now ;
229
150
long retval ;
230
151
};
231
152
@@ -267,29 +188,9 @@ remote_set_time(struct device *dev, struct rtc_time *tm)
267
188
return alpha_rtc_set_time (NULL , tm );
268
189
}
269
190
270
- static void
271
- do_remote_mmss (void * data )
272
- {
273
- union remote_data * x = data ;
274
- x -> retval = alpha_rtc_set_mmss (NULL , x -> now );
275
- }
276
-
277
- static int
278
- remote_set_mmss (struct device * dev , time64_t now )
279
- {
280
- union remote_data x ;
281
- if (smp_processor_id () != boot_cpuid ) {
282
- x .now = now ;
283
- smp_call_function_single (boot_cpuid , do_remote_mmss , & x , 1 );
284
- return x .retval ;
285
- }
286
- return alpha_rtc_set_mmss (NULL , now );
287
- }
288
-
289
191
static const struct rtc_class_ops remote_rtc_ops = {
290
192
.read_time = remote_read_time ,
291
193
.set_time = remote_set_time ,
292
- .set_mmss64 = remote_set_mmss ,
293
194
.ioctl = alpha_rtc_ioctl ,
294
195
};
295
196
#endif
0 commit comments