Skip to contentSkip to conversation

Add max6902 RTC support

PATCH In review Raphael Assenat 4 participants 9 messages May 30, 2006 – Jun 2, 2006 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add max6902 RTC support

This patch adds support for the MAX6902 SPI RTC chip. Applies on 2.6.17-rc5. Tested on a pxa2xx cpu.

---

drivers/rtc/Kconfig +10 -0
@@ -172,4 +172,14 @@
 	  This driver can also be built as a module. If so, the module
 	  will be called rtc-test.
 
+config RTC_DRV_MAX6902
+	tristate "Maxim 6902"
+	depends on RTC_CLASS && SPI 
+	help
+	  If you say yes here you will get support for the
+	  Maxim MAX6902 spi RTC chip.
+
+	  This driver can also be built as a module. If so, the module
+	  will be called rtc-max6902.
+
 endmenu
drivers/rtc/Makefile +1 -0
@@ -20,3 +20,4 @@
 obj-$(CONFIG_RTC_DRV_EP93XX)	+= rtc-ep93xx.o
 obj-$(CONFIG_RTC_DRV_SA1100)	+= rtc-sa1100.o
 obj-$(CONFIG_RTC_DRV_VR41XX)	+= rtc-vr41xx.o
+obj-$(CONFIG_RTC_DRV_MAX6902)	+= rtc-max6902.o
drivers/rtc/rtc-max6902.c +289 -0

289 lines not on this page · raw message

#1 lore raw
Quoted 1 line · On Tue, 30 May 2006 11:09:14 -0400 Raphael Assenat <[email protected]> wrote:

+//#define RTC_DEBUG

Please remove it or use #undef
(and maybe rename it to MAX6902_DEBUG :) )

The driver seems fine to me, you may
want to send it to Andrew for inclusion
in -mm.

thanks!

Signature · 6 lines
 Best regards,

 Alessandro Zummo,
  Tower Technologies - Turin, Italy

  http://www.towertech.it
#2 lore raw

This is the second version of my patch to add support for the MAX6902 SPI RTC chip. Renamed RTC_DEBUG to MAX6902_DEBUG and use #undef instead of a comment, as suggested by Alessandro Zummo.

Applies on 2.6.17-rc5. Tested on a pxa2xx cpu.

---

drivers/rtc/Kconfig +10 -0
@@ -172,4 +172,14 @@
 	  This driver can also be built as a module. If so, the module
 	  will be called rtc-test.
 
+config RTC_DRV_MAX6902
+	tristate "Maxim 6902"
+	depends on RTC_CLASS && SPI 
+	help
+	  If you say yes here you will get support for the
+	  Maxim MAX6902 spi RTC chip.
+
+	  This driver can also be built as a module. If so, the module
+	  will be called rtc-max6902.
+
 endmenu
drivers/rtc/Makefile +1 -0
@@ -20,3 +20,4 @@
 obj-$(CONFIG_RTC_DRV_EP93XX)	+= rtc-ep93xx.o
 obj-$(CONFIG_RTC_DRV_SA1100)	+= rtc-sa1100.o
 obj-$(CONFIG_RTC_DRV_VR41XX)	+= rtc-vr41xx.o
+obj-$(CONFIG_RTC_DRV_MAX6902)	+= rtc-max6902.o
drivers/rtc/rtc-max6902.c +289 -0

289 lines not on this page · raw message

#3 lore raw
Quoted 8 lines · On Tue, 30 May 2006 14:49:49 -0400 Raphael Assenat <[email protected]> wrote:

+ * Changelog:
+ *
+ * 24-May-2006: Raphael Assenat <[email protected]>
+ * - Major rework
+ * Converted to rtc_device and uses the SPI layer.
+ *
+ * ??-???-2005: Someone at Compulab
+ * - Initial driver creation.

That's a problem. According to the Developer's Certificate of Origin process we'd need "Someone at Compulab" to send us a Signed-off-by:, along with the assertions which that carries.

I mean, maybe you've finally found that code wot we stole from sco ;)

#4 lore raw
Quoted 3 lines · Andrew Morton

That's a problem. According to the Developer's Certificate of Origin process we'd need "Someone at Compulab" to send us a Signed-off-by:, along with the assertions which that carries.

Don't clauses (a) and/or (b) include provisions that mean Raphael takes on this responsibility if he believes that CompuLab released the patch under a suitable open source license? In particular the "to the best of my knowledge, is covered under an appropriate open source license" bit in (b).

(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

...

Ian.

Signature · 4 lines
Ian Campbell

zeal, n.:
	Quality seen in new graduates -- if you're quick.
#5 lore raw
Quoted 10 lines · On Wed, 31 May 2006 07:32:11 +0100 Ian Campbell <[email protected]> wrote:
Quoted 3 lines · Andrew Morton

That's a problem. According to the Developer's Certificate of Origin process we'd need "Someone at Compulab" to send us a Signed-off-by:, along with the assertions which that carries.

Don't clauses (a) and/or (b) include provisions that mean Raphael takes on this responsibility if he believes that CompuLab released the patch under a suitable open source license? In particular the "to the best of my knowledge, is covered under an appropriate open source license" bit in (b).

hm, sometimes it helps to read things.

Quoted 11 lines

(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

Yes, I think that would work, if Rafael is prepared to make that assertion.

If so, please send along a few words describing where the Compulab code came from and some substantiation of your belief that it was appropriately licensed. (It probably had some license words at the top of the file..)

#6 lore raw
Quoted 2 lines · Andrew Morton
Quoted 1 line · Ian Campbell

On Tue, 2006-05-30 at 15:01 -0700, Andrew Morton wrote:

...

Quoted 12 lines
Quoted 11 lines

(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

Quoted 5 lines

Yes, I think that would work, if Rafael is prepared to make that assertion.

If so, please send along a few words describing where the Compulab code came from and some substantiation of your belief that it was appropriately licensed. (It probably had some license words at the top of the file..)

The compulab code comes from the kernel patch the produce for their cn-x255 board. (inside a zip file on the
http://www.compulab.co.il/x255/html/x255-developer.htm)

The original file (drivers/char/max6902.c) was GPL, which is of course an appropriate licence:

/*
* max6902.c
*
* Driver for MAX6902 RTC
*
* Copyright (C) 2004 Compulab Ltd.
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
*
*/

For reference, you can get the original file here:
http://raph.people.8d.com/misc/max6902.c

Regards,
Raphael Assenat

#7 lore raw
Quoted 22 lines · On Wed, 31 May 2006 08:43:34 -0400 Raphael Assenat <[email protected]> wrote:

The compulab code comes from the kernel patch the produce for their cn-x255 board. (inside a zip file on the
http://www.compulab.co.il/x255/html/x255-developer.htm)

The original file (drivers/char/max6902.c) was GPL, which is of course an appropriate licence:

/*
* max6902.c
*
* Driver for MAX6902 RTC
*
* Copyright (C) 2004 Compulab Ltd.
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
*
*/

Quoted 2 lines

For reference, you can get the original file here:
http://raph.people.8d.com/misc/max6902.c

Wonderful, thanks.

#8 lore raw

I just discovered I forgot to call kfree on the struct max6902 I allocate in max6902_probe. An updated version of the patch follows. If you prefer a patch which applies on top of the previous one, let me know.

drivers/rtc/Kconfig +10 -0
@@ -172,4 +172,14 @@
 	  This driver can also be built as a module. If so, the module
 	  will be called rtc-test.
 
+config RTC_DRV_MAX6902
+	tristate "Maxim 6902"
+	depends on RTC_CLASS && SPI 
+	help
+	  If you say yes here you will get support for the
+	  Maxim MAX6902 spi RTC chip.
+
+	  This driver can also be built as a module. If so, the module
+	  will be called rtc-max6902.
+
 endmenu
drivers/rtc/Makefile +1 -0
@@ -20,3 +20,4 @@
 obj-$(CONFIG_RTC_DRV_EP93XX)	+= rtc-ep93xx.o
 obj-$(CONFIG_RTC_DRV_SA1100)	+= rtc-sa1100.o
 obj-$(CONFIG_RTC_DRV_VR41XX)	+= rtc-vr41xx.o
+obj-$(CONFIG_RTC_DRV_MAX6902)	+= rtc-max6902.o
drivers/rtc/rtc-max6902.c +291 -0

291 lines not on this page · raw message