summaryrefslogtreecommitdiffstats
path: root/configs/platform-friendlyarm-mini6410/patches/linux-3.8/PATCH_2_3_rtc-s3c_Disable_alarm_entries_that_are_not_chosen.diff
blob: b7e726a5f05e01101a3dd8908a866fc3fd284654 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From: MyungJoo Ham <myungjoo.ham@samsung.com>
Subject: [PATCH 2/3] rtc: rtc-s3c: Disable alarm entries that are not chosen.

When rtc_setalarm is called, the entries that are not chosen (entries
without valid time values) should be disabled. However, in the previous
rtc-s3c driver, they are not explicitly disabled (did not changed). This
patch allows to disable such entries even if they were previously used.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/rtc/rtc-s3c.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-3.8/drivers/rtc/rtc-s3c.c
===================================================================
--- linux-3.8.orig/drivers/rtc/rtc-s3c.c
+++ linux-3.8/drivers/rtc/rtc-s3c.c
@@ -315,7 +315,8 @@ static int s3c_rtc_setalarm(struct devic
 		 1900 + tm->tm_year, tm->tm_mon + 1, tm->tm_mday,
 		 tm->tm_hour, tm->tm_min, tm->tm_sec);
 
-	alrm_en = readb(base + S3C2410_RTCALM) & S3C2410_RTCALM_ALMEN;
+	/* Disable entires that are not chosen by alarm */
+	alrm_en = S3C2410_RTCALM_ALMEN;
 	writeb(0x00, base + S3C2410_RTCALM);
 
 	if (tm->tm_sec < 60 && tm->tm_sec >= 0) {