Skip to contentSkip to conversation

rtc: rtc-s3c: Set year, month, day value for setting alarm

rtc-linux MyungJoo Ham 1 participant 1 message May 6, 2015 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw
Quoted 14 lines

------- Original Message -------
Sender : Alexandre Belloni<[email protected]> Date : 2015-05-02 23:19 (GMT+09:00)
Title : Re: rtc: rtc-s3c: Set year, month, day value for setting alarm =20
Hi,
=20

Quoted 6 lines · Donggeun Kim

This patch sets year, month, day value for set_alarm function. The current driver omits to set the values.
=20
Signed-off-by: Donggeun Kim=20
Signed-off-by: MyungJoo Ham=20
Signed-off-by: KyungMin Park=20

Quoted 3 lines

=20
This patch never made it to the mainlined but seems useful enough. Do you want to respin it?

Donggeun is no more available with that address and I am not aware of his new address either. I'm adding people who might be interested in S3C-RTC driver.

CC Chanwoo Choi <[email protected]>
CC Marek Szyprowski <[email protected]>

ps. Is there any problem for you to resubmit (conflict resolving) that patch?

Quoted 10 lines

=20

drivers/rtc/rtc-s3c.c static int s3c_rtc_setalarm(struct device *dev, str=

Quoted 9 lines
---
 drivers/rtc/rtc-s3c.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

=20

drivers/rtc/rtc-s3c.c +0 -0
index 16512ec..18e648b 100644
@@ -251,6 +251,7 @@ static int s3c_rtc_setalarm(struct device *dev, str=

uct rtc_wkalrm *alrm)

Quoted 8 lines

drivers/rtc/rtc-s3c.c static int s3c_rtc_setalarm(struct device *dev, st=

Quoted 8 lines
drivers/rtc/rtc-s3c.c +1 -0
  struct rtc_time *tm =3D &alrm->time;
  void __iomem *base =3D s3c_rtc_base;
  unsigned int alrm_en;
+ int year =3D tm->tm_year - 100;

=20
pr_debug("s3c_rtc_setalarm: %d, %04d.%02d.%02d %02d:%02d:%02d\n", alrm->enabled,

drivers/rtc/rtc-s3c.c +0 -0
@@ -276,6 +277,21 @@ static int s3c_rtc_setalarm(struct device *dev, st=

ruct rtc_wkalrm *alrm)

Quoted 18 lines
Quoted 18 lines
drivers/rtc/rtc-s3c.c +0 -0
  writeb(bin2bcd(tm->tm_hour), base + S3C2410_ALMHOUR);
  }

=20
+ if (year < 100 && year >=3D 0) {
+ alrm_en |=3D S3C2410_RTCALM_YEAREN;
+ writeb(bin2bcd(year), base + S3C2410_ALMYEAR);
+ }

drivers/rtc/rtc-s3c.c +11 -0
+
+ if (tm->tm_mon < 12 && tm->tm_mon >=3D 0) {
+ alrm_en |=3D S3C2410_RTCALM_MONEN;
+ writeb(bin2bcd(tm->tm_mon + 1), base + S3C2410_ALMMON);
+ }
+
+ if (tm->tm_mday <=3D 31 && tm->tm_mday >=3D 1) {
+ alrm_en |=3D S3C2410_RTCALM_DAYEN;
+ writeb(bin2bcd(tm->tm_mday), base + S3C2410_ALMDATE);
+ }
+
Quoted 8 lines
Quoted 3 lines

pr_debug("setting S3C2410_RTCALM to %08x\n", alrm_en);
=20
writeb(alrm_en, base + S3C2410_RTCALM);

=20
--=20
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

--
MyungJoo Ham (=ED=95=A8=EB=AA=85=EC=A3=BC), Ph.D.
Frontier CS Lab, Software R&D Center
Samsung Electronics
Cell: +82-10-6714-2858

--=20
--=20
You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---=20
You received this message because you are subscribed to the Google Groups "= rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to [email protected].
For more options, visit https://groups.google.com/d/optout.