Skip to contentSkip to conversation

rtc: add support for maxim dallas rtc ds1347

PATCH In review RAGHAVENDRA GANIGA 3 participants 4 messages Mar 20, 2014 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: add support for maxim dallas rtc ds1347

Quoted 1 line

From f18fc68778c210863ca0968e4448375c89e9bb06 Mon Sep 17 00:00:00 2001

From: Raghavendra Ganiga <[email protected]>
Date: Fri, 21 Mar 2014 00:22:32 +0530
Subject: [PATCH] rtc: add support for maxim dallas rtc ds1347

This is a patch to add support for
maxim dallas rtc ds1347

---
 drivers/rtc/Kconfig      |   12 ++++
 drivers/rtc/Makefile     |    1 +
 drivers/rtc/rtc-ds1347.c |  169 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 182 insertions(+)
 create mode 100644 drivers/rtc/rtc-ds1347.c
drivers/rtc/Kconfig +12 -0
index db933de..2e565f8 100644
@@ -573,6 +573,18 @@ config RTC_DRV_DS1305
 	  This driver can also be built as a module. If so, the module
 	  will be called rtc-ds1305.
 
+config RTC_DRV_DS1347
+	tristate "Dallas/Maxim DS1347"
+	help
+	  If you say yes here you get support for the
+	  Dallas/Maxim DS1347 chips.
+
+	  This driver only supports the RTC feature, and not other chip
+	  features such as alarms.
+
+	  This driver can also be built as a module. If so, the module
+	  will be called rtc-ds1347.
+
 config RTC_DRV_DS1390
 	tristate "Dallas/Maxim DS1390/93/94"
 	help
drivers/rtc/Makefile +1 -0
index b427bf7..40a0991 100644
@@ -40,6 +40,7 @@ obj-$(CONFIG_RTC_DRV_DS1286)	+= rtc-ds1286.o
 obj-$(CONFIG_RTC_DRV_DS1302)	+= rtc-ds1302.o
 obj-$(CONFIG_RTC_DRV_DS1305)	+= rtc-ds1305.o
 obj-$(CONFIG_RTC_DRV_DS1307)	+= rtc-ds1307.o
+obj-$(CONFIG_RTC_DRV_DS1347)	+= rtc-ds1347.o
 obj-$(CONFIG_RTC_DRV_DS1374)	+= rtc-ds1374.o
 obj-$(CONFIG_RTC_DRV_DS1390)	+= rtc-ds1390.o
 obj-$(CONFIG_RTC_DRV_DS1511)	+= rtc-ds1511.o
drivers/rtc/rtc-ds1347.c new file +169 -0

169 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 2 lines · RAGHAVENDRA GANIGA

This is a patch to add support for
maxim dallas rtc ds1347

[]

drivers/rtc/rtc-ds1347.c

Quoted 1 line
drivers/rtc/rtc-ds1347.c +0 -0

[]

drivers/rtc/rtc-ds1347.c

Quoted 2 lines
drivers/rtc/rtc-ds1347.c +2 -0
+static int ds1347_read_time(struct device *dev, struct rtc_time *dt)
+{

[]

drivers/rtc/rtc-ds1347.c line 97

Quoted 6 lines
drivers/rtc/rtc-ds1347.c +5 -0
+	/* year in linux is from 1900 i.e in range of 100
+	in rtc it is from 00 to 99 so subtract
+	the linux year by 100 */
 
+	if (dt->tm_year >= 100)
+		dt->tm_year -= 100;

This depends on how long you want to live, but it could be

	while (dt->tm_year >= 100)
#2 lore raw
Quoted 3 lines · On Thu, 20 Mar 2014 12:19:55 -0700 Joe Perches <[email protected]> wrote:

This depends on how long you want to live, but it could be

	while (dt->tm_year >= 100)

dt->tm_year % 100 ?

Signature · 6 lines
 Best regards,

 Alessandro Zummo,
  Tower Technologies - Torino, Italy

  http://www.towertech.it
#3 lore raw
Quoted 5 lines · Alessandro Zummo
Quoted 2 lines · On Thu, 20 Mar 2014 12:19:55 -0700 Joe Perches <[email protected]> wrote:

This depends on how long you want to live, but it could be

	while (dt->tm_year >= 100) 

dt->tm_year % 100 ?

Sure, if you don't mind the divide.