Skip to content

Commit c090d39

Browse files
Wolfram Sangalexandrebelloni
authored andcommitted
rtc: sh: remove update interrupt handling
Since commit e428c6a ("RTC: Clean out UIE icotl implementations"), the flag for UIE cannot be set anymore. Because UIE is now handled via regular alarms and a timerqueue by the RTC core, the UIE handling code can simply go away now. Signed-off-by: Wolfram Sang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 8f2efdb commit c090d39

File tree

1 file changed

+1
-47
lines changed

1 file changed

+1
-47
lines changed

drivers/rtc/rtc-sh.c

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
/* Period Bits */
7676
#define PF_HP 0x100 /* Enable Half Period to support 8,32,128Hz */
7777
#define PF_COUNT 0x200 /* Half periodic counter */
78-
#define PF_OXS 0x400 /* Periodic One x Second */
7978
#define PF_KOU 0x800 /* Kernel or User periodic request 1=kernel */
8079
#define PF_MASK 0xf00
8180

@@ -107,22 +106,6 @@ struct sh_rtc {
107106
unsigned short periodic_freq;
108107
};
109108

110-
static int __sh_rtc_interrupt(struct sh_rtc *rtc)
111-
{
112-
unsigned int tmp, pending;
113-
114-
tmp = readb(rtc->regbase + RCR1);
115-
pending = tmp & RCR1_CF;
116-
tmp &= ~RCR1_CF;
117-
writeb(tmp, rtc->regbase + RCR1);
118-
119-
/* Users have requested One x Second IRQ */
120-
if (pending && rtc->periodic_freq & PF_OXS)
121-
rtc_update_irq(rtc->rtc_dev, 1, RTC_UF | RTC_IRQF);
122-
123-
return pending;
124-
}
125-
126109
static int __sh_rtc_alarm(struct sh_rtc *rtc)
127110
{
128111
unsigned int tmp, pending;
@@ -162,18 +145,6 @@ static int __sh_rtc_periodic(struct sh_rtc *rtc)
162145
return pending;
163146
}
164147

165-
static irqreturn_t sh_rtc_interrupt(int irq, void *dev_id)
166-
{
167-
struct sh_rtc *rtc = dev_id;
168-
int ret;
169-
170-
spin_lock(&rtc->lock);
171-
ret = __sh_rtc_interrupt(rtc);
172-
spin_unlock(&rtc->lock);
173-
174-
return IRQ_RETVAL(ret);
175-
}
176-
177148
static irqreturn_t sh_rtc_alarm(int irq, void *dev_id)
178149
{
179150
struct sh_rtc *rtc = dev_id;
@@ -204,8 +175,7 @@ static irqreturn_t sh_rtc_shared(int irq, void *dev_id)
204175
int ret;
205176

206177
spin_lock(&rtc->lock);
207-
ret = __sh_rtc_interrupt(rtc);
208-
ret |= __sh_rtc_alarm(rtc);
178+
ret = __sh_rtc_alarm(rtc);
209179
ret |= __sh_rtc_periodic(rtc);
210180
spin_unlock(&rtc->lock);
211181

@@ -236,9 +206,6 @@ static int sh_rtc_proc(struct device *dev, struct seq_file *seq)
236206
struct sh_rtc *rtc = dev_get_drvdata(dev);
237207
unsigned int tmp;
238208

239-
tmp = readb(rtc->regbase + RCR1);
240-
seq_printf(seq, "carry_IRQ\t: %s\n", (tmp & RCR1_CIE) ? "yes" : "no");
241-
242209
tmp = readb(rtc->regbase + RCR2);
243210
seq_printf(seq, "periodic_IRQ\t: %s\n",
244211
(tmp & RCR2_PESMASK) ? "yes" : "no");
@@ -320,10 +287,6 @@ static int sh_rtc_read_time(struct device *dev, struct rtc_time *tm)
320287
tm->tm_sec--;
321288
#endif
322289

323-
/* only keep the carry interrupt enabled if UIE is on */
324-
if (!(rtc->periodic_freq & PF_OXS))
325-
sh_rtc_setcie(dev, 0);
326-
327290
dev_dbg(dev, "%s: tm is secs=%d, mins=%d, hours=%d, "
328291
"mday=%d, mon=%d, year=%d, wday=%d\n",
329292
__func__,
@@ -577,15 +540,6 @@ static int __init sh_rtc_probe(struct platform_device *pdev)
577540
goto err_unmap;
578541
}
579542

580-
ret = devm_request_irq(&pdev->dev, rtc->carry_irq,
581-
sh_rtc_interrupt, 0, "sh-rtc carry", rtc);
582-
if (unlikely(ret)) {
583-
dev_err(&pdev->dev,
584-
"request carry IRQ failed with %d, IRQ %d\n",
585-
ret, rtc->carry_irq);
586-
goto err_unmap;
587-
}
588-
589543
ret = devm_request_irq(&pdev->dev, rtc->alarm_irq,
590544
sh_rtc_alarm, 0, "sh-rtc alarm", rtc);
591545
if (unlikely(ret)) {

0 commit comments

Comments
 (0)