72
72
/* ALARM Bits - or with BCD encoded value */
73
73
#define AR_ENB 0x80 /* Enable for alarm cmp */
74
74
75
- /* Period Bits */
76
- #define PF_HP 0x100 /* Enable Half Period to support 8,32,128Hz */
77
- #define PF_COUNT 0x200 /* Half periodic counter */
78
- #define PF_KOU 0x800 /* Kernel or User periodic request 1=kernel */
79
- #define PF_MASK 0xf00
80
-
81
75
/* RCR1 Bits */
82
76
#define RCR1_CF 0x80 /* Carry Flag */
83
77
#define RCR1_CIE 0x10 /* Carry Interrupt Enable */
84
78
#define RCR1_AIE 0x08 /* Alarm Interrupt Enable */
85
79
#define RCR1_AF 0x01 /* Alarm Flag */
86
80
87
81
/* RCR2 Bits */
88
- #define RCR2_PEF 0x80 /* PEriodic interrupt Flag */
89
- #define RCR2_PESMASK 0x70 /* Periodic interrupt Set */
90
82
#define RCR2_RTCEN 0x08 /* ENable RTC */
91
83
#define RCR2_ADJ 0x04 /* ADJustment (30-second) */
92
84
#define RCR2_RESET 0x02 /* Reset bit */
@@ -103,7 +95,6 @@ struct sh_rtc {
103
95
struct rtc_device * rtc_dev ;
104
96
spinlock_t lock ;
105
97
unsigned long capabilities ; /* See asm/rtc.h for cap bits */
106
- unsigned short periodic_freq ;
107
98
};
108
99
109
100
static int __sh_rtc_alarm (struct sh_rtc * rtc )
@@ -121,30 +112,6 @@ static int __sh_rtc_alarm(struct sh_rtc *rtc)
121
112
return pending ;
122
113
}
123
114
124
- static int __sh_rtc_periodic (struct sh_rtc * rtc )
125
- {
126
- unsigned int tmp , pending ;
127
-
128
- tmp = readb (rtc -> regbase + RCR2 );
129
- pending = tmp & RCR2_PEF ;
130
- tmp &= ~RCR2_PEF ;
131
- writeb (tmp , rtc -> regbase + RCR2 );
132
-
133
- if (!pending )
134
- return 0 ;
135
-
136
- /* Half period enabled than one skipped and the next notified */
137
- if ((rtc -> periodic_freq & PF_HP ) && (rtc -> periodic_freq & PF_COUNT ))
138
- rtc -> periodic_freq &= ~PF_COUNT ;
139
- else {
140
- if (rtc -> periodic_freq & PF_HP )
141
- rtc -> periodic_freq |= PF_COUNT ;
142
- rtc_update_irq (rtc -> rtc_dev , 1 , RTC_PF | RTC_IRQF );
143
- }
144
-
145
- return pending ;
146
- }
147
-
148
115
static irqreturn_t sh_rtc_alarm (int irq , void * dev_id )
149
116
{
150
117
struct sh_rtc * rtc = dev_id ;
@@ -157,26 +124,13 @@ static irqreturn_t sh_rtc_alarm(int irq, void *dev_id)
157
124
return IRQ_RETVAL (ret );
158
125
}
159
126
160
- static irqreturn_t sh_rtc_periodic (int irq , void * dev_id )
161
- {
162
- struct sh_rtc * rtc = dev_id ;
163
- int ret ;
164
-
165
- spin_lock (& rtc -> lock );
166
- ret = __sh_rtc_periodic (rtc );
167
- spin_unlock (& rtc -> lock );
168
-
169
- return IRQ_RETVAL (ret );
170
- }
171
-
172
127
static irqreturn_t sh_rtc_shared (int irq , void * dev_id )
173
128
{
174
129
struct sh_rtc * rtc = dev_id ;
175
130
int ret ;
176
131
177
132
spin_lock (& rtc -> lock );
178
133
ret = __sh_rtc_alarm (rtc );
179
- ret |= __sh_rtc_periodic (rtc );
180
134
spin_unlock (& rtc -> lock );
181
135
182
136
return IRQ_RETVAL (ret );
@@ -201,18 +155,6 @@ static inline void sh_rtc_setaie(struct device *dev, unsigned int enable)
201
155
spin_unlock_irq (& rtc -> lock );
202
156
}
203
157
204
- static int sh_rtc_proc (struct device * dev , struct seq_file * seq )
205
- {
206
- struct sh_rtc * rtc = dev_get_drvdata (dev );
207
- unsigned int tmp ;
208
-
209
- tmp = readb (rtc -> regbase + RCR2 );
210
- seq_printf (seq , "periodic_IRQ\t: %s\n" ,
211
- (tmp & RCR2_PESMASK ) ? "yes" : "no" );
212
-
213
- return 0 ;
214
- }
215
-
216
158
static int sh_rtc_alarm_irq_enable (struct device * dev , unsigned int enabled )
217
159
{
218
160
sh_rtc_setaie (dev , enabled );
@@ -405,7 +347,6 @@ static const struct rtc_class_ops sh_rtc_ops = {
405
347
.set_time = sh_rtc_set_time ,
406
348
.read_alarm = sh_rtc_read_alarm ,
407
349
.set_alarm = sh_rtc_set_alarm ,
408
- .proc = sh_rtc_proc ,
409
350
.alarm_irq_enable = sh_rtc_alarm_irq_enable ,
410
351
};
411
352
@@ -512,16 +453,6 @@ static int __init sh_rtc_probe(struct platform_device *pdev)
512
453
goto err_unmap ;
513
454
}
514
455
} else {
515
- /* register periodic/carry/alarm irqs */
516
- ret = devm_request_irq (& pdev -> dev , rtc -> periodic_irq ,
517
- sh_rtc_periodic , 0 , "sh-rtc period" , rtc );
518
- if (unlikely (ret )) {
519
- dev_err (& pdev -> dev ,
520
- "request period IRQ failed with %d, IRQ %d\n" ,
521
- ret , rtc -> periodic_irq );
522
- goto err_unmap ;
523
- }
524
-
525
456
ret = devm_request_irq (& pdev -> dev , rtc -> alarm_irq ,
526
457
sh_rtc_alarm , 0 , "sh-rtc alarm" , rtc );
527
458
if (unlikely (ret )) {
0 commit comments