Skip to contentSkip to conversation

rtc: rtc-s3c: Add alarm_irq_enable RTC class operation

PATCH New Kukjin Kim 2 participants 2 messages May 18, 2010

Subsystems (2)
lore
Share & tools
lore

Kukjin Kim

author
#0 lore raw

PATCH 4/8 rtc: rtc-s3c: Add alarm_irq_enable RTC class operation

From: Taekgyun Ko <[email protected]>

This patch updates rtc-s3c driver to support 'alarm_irq_enable' RTC class operation.

---
 drivers/rtc/rtc-s3c.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
drivers/rtc/rtc-s3c.c +8 -5
index 4969b60..9364dc2 100644
@@ -59,18 +59,20 @@ static irqreturn_t s3c_rtc_tickirq(int irq, void *id)
 }
 
 /* Update control registers */
-static void s3c_rtc_setaie(int to)
+static int s3c_rtc_setaie(struct device *dev, unsigned int enabled)
 {
 	unsigned int tmp;
 
-	pr_debug("%s: aie=%d\n", __func__, to);
+	pr_debug("%s: aie=%d\n", __func__, enabled);
 
 	tmp = readb(s3c_rtc_base + S3C2410_RTCALM) & ~S3C2410_RTCALM_ALMEN;
 
-	if (to)
+	if (enabled)
 		tmp |= S3C2410_RTCALM_ALMEN;
 
 	writeb(tmp, s3c_rtc_base + S3C2410_RTCALM);
+
+	return 0;
 }
 
 static int s3c_rtc_setpie(struct device *dev, int enabled)
@@ -271,7 +273,7 @@ static int s3c_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
 
 	writeb(alrm_en, base + S3C2410_RTCALM);
 
-	s3c_rtc_setaie(alrm->enabled);
+	s3c_rtc_setaie(0, alrm->enabled);
 
 	if (alrm->enabled)
 		enable_irq_wake(s3c_rtc_alarmno);
@@ -340,6 +342,7 @@ static const struct rtc_class_ops s3c_rtcops = {
 	.set_alarm	= s3c_rtc_setalarm,
 	.irq_set_freq	= s3c_rtc_setfreq,
 	.irq_set_state	= s3c_rtc_setpie,
+	.alarm_irq_enable = s3c_rtc_setaie,
 	.proc	        = s3c_rtc_proc,
 };
 
@@ -391,7 +394,7 @@ static int __devexit s3c_rtc_remove(struct platform_device *dev)
 	rtc_device_unregister(rtc);
 
 	s3c_rtc_setpie(&dev->dev, 0);
-	s3c_rtc_setaie(0);
+	s3c_rtc_setaie(0, 0);
 
 	iounmap(s3c_rtc_base);
 	release_resource(s3c_rtc_mem);
Signature · 1 line
1.6.2.5
#1 lore raw

PATCH 4/8 rtc: rtc-s3c: Add alarm_irq_enable RTC class operation

Quoted 4 lines · Kukjin Kim

From: Taekgyun Ko <[email protected]>

This patch updates rtc-s3c driver to support
'alarm_irq_enable' RTC class operation.

this could have gone on one line.

Quoted 22 lines
---
 drivers/rtc/rtc-s3c.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
drivers/rtc/rtc-s3c.c +2 -2
index 4969b60..9364dc2 100644
@@ -59,18 +59,20 @@ static irqreturn_t s3c_rtc_tickirq(int irq, void *id)
 }
 
 /* Update control registers */
-static void s3c_rtc_setaie(int to)
+static int s3c_rtc_setaie(struct device *dev, unsigned int enabled)
 {
 	unsigned int tmp;
 
-	pr_debug("%s: aie=%d\n", __func__, to);
+	pr_debug("%s: aie=%d\n", __func__, enabled);

drivers/rtc/rtc-s3c.c static irqreturn_t s3c_rtc_tickirq(int irq, void *id) · line 75

Quoted 10 lines
drivers/rtc/rtc-s3c.c +3 -1
 
 	tmp = readb(s3c_rtc_base + S3C2410_RTCALM) & ~S3C2410_RTCALM_ALMEN;
 
-	if (to)
+	if (enabled)
 		tmp |= S3C2410_RTCALM_ALMEN;
 
 	writeb(tmp, s3c_rtc_base + S3C2410_RTCALM);
+
+	return 0;

Please stop changing names jsut because you feel like it.

drivers/rtc/rtc-s3c.c static int s3c_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) · line 276

Quoted 9 lines
drivers/rtc/rtc-s3c.c +1 -1
 }
 
 static int s3c_rtc_setpie(struct device *dev, int enabled)
@@ -271,7 +273,7 @@ static int s3c_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
 
 	writeb(alrm_en, base + S3C2410_RTCALM);
 
-	s3c_rtc_setaie(alrm->enabled);
+	s3c_rtc_setaie(0, alrm->enabled);

if you've got a pointer to device, then please pass it.

Quoted 11 lines
drivers/rtc/rtc-s3c.c +1 -0
 	if (alrm->enabled)
 		enable_irq_wake(s3c_rtc_alarmno);
@@ -340,6 +342,7 @@ static const struct rtc_class_ops s3c_rtcops = {
 	.set_alarm	= s3c_rtc_setalarm,
 	.irq_set_freq	= s3c_rtc_setfreq,
 	.irq_set_state	= s3c_rtc_setpie,
+	.alarm_irq_enable = s3c_rtc_setaie,
 	.proc	        = s3c_rtc_proc,
 };
 

drivers/rtc/rtc-s3c.c static int __devexit s3c_rtc_remove(struct platform_device *dev) · line 397

Quoted 5 lines
drivers/rtc/rtc-s3c.c +1 -1
@@ -391,7 +394,7 @@ static int __devexit s3c_rtc_remove(struct platform_device *dev)
 	rtc_device_unregister(rtc);
 
 	s3c_rtc_setpie(&dev->dev, 0);
-	s3c_rtc_setaie(0);
+	s3c_rtc_setaie(0, 0);

see previous comment about pointers to device.

Quoted 9 lines
drivers/rtc/rtc-s3c.c +0 -0
 	iounmap(s3c_rtc_base);
 	release_resource(s3c_rtc_mem);
Signature · 6 lines
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 5 lines
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.