Skip to contentSkip to conversation

Add driver for the ST M41T94 SPI RTC

PATCH New Albin Tonnerre 3 participants 5 messages Aug 13, 2009 – Aug 18, 2009 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add driver for the ST M41T94 SPI RTC

This RTC is used in some Calao boards. The driver code is taken from the linux rtc-m41t94 driver

---

I guess the bin2bcd and bcd2bin functions belong somewhere in common/ rather than this particular driver ... Where should I put them ?

 drivers/rtc/Makefile |    1 +
 drivers/rtc/m41t94.c |  137 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 138 insertions(+), 0 deletions(-)
 create mode 100644 drivers/rtc/m41t94.c
drivers/rtc/Makefile +1 -0
index 822dc1a..ea7d899 100644
@@ -44,6 +44,7 @@ COBJS-$(CONFIG_RTC_ISL1208) += isl1208.o
 COBJS-$(CONFIG_RTC_M41T11) += m41t11.o
 COBJS-$(CONFIG_RTC_M41T60) += m41t60.o
 COBJS-$(CONFIG_RTC_M41T62) += m41t62.o
+COBJS-$(CONFIG_RTC_M41T94) += m41t94.o
 COBJS-$(CONFIG_RTC_M48T35A) += m48t35ax.o
 COBJS-$(CONFIG_RTC_MAX6900) += max6900.o
 COBJS-$(CONFIG_RTC_MC13783) += mc13783-rtc.o
drivers/rtc/m41t94.c new file +137 -0

137 lines not on this page · raw message

Signature · 1 line
1.6.0.4
#1 lore raw

PATCH 1/1 Add driver for the ST M41T94 SPI RTC

Quoted 8 lines · On Thursday 13 August 2009 12:14:30 Albin Tonnerre wrote:

This RTC is used in some Calao boards. The driver code is taken from the linux rtc-m41t94 driver

---

I guess the bin2bcd and bcd2bin functions belong somewhere in common/ rather than this particular driver ... Where should I put them ?

Currently we also have BIN2BCD/BCD2BIN macros in include/bcd.h. We should probably move to these lowercase inlined functions though. Perhaps you could create a patch to switch from BIN2BCD to bin2bcd in the RTC drivers and add those functions to bcd.h?

Thanks.

Cheers,
Stefan

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

#2 lore raw

PATCH 1/1 Add driver for the ST M41T94 SPI RTC

Quoted 7 lines · Stefan Roese
Quoted 6 lines · On Thursday 13 August 2009 12:14:30 Albin Tonnerre wrote:

This RTC is used in some Calao boards. The driver code is taken from the linux rtc-m41t94 driver

---

Quoted 7 lines
Quoted 2 lines

I guess the bin2bcd and bcd2bin functions belong somewhere in common/ rather than this particular driver ... Where should I put them ?

Currently we also have BIN2BCD/BCD2BIN macros in include/bcd.h. We should probably move to these lowercase inlined functions though. Perhaps you could create a patch to switch from BIN2BCD to bin2bcd in the RTC drivers and add those functions to bcd.h?

Heh, I see that nearly all the rtc drivers define those functions too ... Will submit a patch to clean that up

Regards,

Signature · 4 lines
Albin Tonnerre, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
#3 lore raw

PATCH v2 1/1 Add driver for the ST M41T94 SPI RTC

In reply to Stefan Roese

This RTC is used in some Calao boards. The driver code is taken from the linux rtc-m41t94 driver

---
Changelog since V1:
- Use the common bin2bcd/bcd2bin functions. This patch depends on:
1250170272-25909-2-git-send-email-albin.tonnerre at free-electrons.com

 drivers/rtc/Makefile |    1 +
 drivers/rtc/m41t94.c |  124 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 125 insertions(+), 0 deletions(-)
 create mode 100644 drivers/rtc/m41t94.c
drivers/rtc/Makefile +1 -0
index 822dc1a..ea7d899 100644
@@ -44,6 +44,7 @@ COBJS-$(CONFIG_RTC_ISL1208) += isl1208.o
 COBJS-$(CONFIG_RTC_M41T11) += m41t11.o
 COBJS-$(CONFIG_RTC_M41T60) += m41t60.o
 COBJS-$(CONFIG_RTC_M41T62) += m41t62.o
+COBJS-$(CONFIG_RTC_M41T94) += m41t94.o
 COBJS-$(CONFIG_RTC_M48T35A) += m48t35ax.o
 COBJS-$(CONFIG_RTC_MAX6900) += max6900.o
 COBJS-$(CONFIG_RTC_MC13783) += mc13783-rtc.o
drivers/rtc/m41t94.c new file +124 -0

124 lines not on this page · raw message

Signature · 1 line
1.6.0.4
#4 lore raw

PATCH v2 1/1 Add driver for the ST M41T94 SPI RTC

Dear Albin Tonnerre,

Quoted 7 lines · In message <1250183564-6140-1-git-send-email-albin.tonnerre@free-electrons.com>…

This RTC is used in some Calao boards. The driver code is taken from the linux rtc-m41t94 driver

---
Changelog since V1:
- Use the common bin2bcd/bcd2bin functions. This patch depends on:

Quoted 6 lines
   1250170272-25909-2-git-send-email-albin.tonnerre at free-electrons.com
 drivers/rtc/Makefile |    1 +
 drivers/rtc/m41t94.c |  124 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 125 insertions(+), 0 deletions(-)
 create mode 100644 drivers/rtc/m41t94.c

Aplied to "next", thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There are three things I always forget. Names, faces -  the  third  I
can't remember.                                         - Italo Svevo