Skip to contentSkip to conversation

: Add support for Dallas/Maxim DS1685/1687 RTC

PATCH In review Kumba 1 participant 1 message Feb 15, 2011

Subsystems (3)
lore
Share & tools
lore

Kumba

author
#0 lore raw

PATCH 2/2 : Add support for Dallas/Maxim DS1685/1687 RTC

Wire SGI O2 (IP32) to use the rtc-ds1685 driver as its RTC.

---
 arch/mips/sgi-ip32/ip32-platform.c |   25 ++++++++++-----
 arch/mips/sgi-ip32/ip32-reset.c    |   53 ---------------------------------
 drivers/rtc/Kconfig                |   17 +++++++++-
 include/linux/rtc/ds1685.h         |   58 +++++++++++++++++++++++++++++++++++--
 4 files changed, 88 insertions(+), 65 deletions(-)
arch/mips/sgi-ip32/ip32-platform.c +17 -8
diff -Naurp linux-2.6.37.rtc-ds1685/arch/mips/sgi-ip32/ip32-platform.c linux-2.6.37.rtc-ds1685.ip32/arch/mips/sgi-ip32/ip32-platform.c
@@ -90,21 +90,30 @@ static __init int sgio2btns_devinit(void
 
 device_initcall(sgio2btns_devinit);
 
-static struct resource sgio2_cmos_rsrc[] = {
+#define MACE_RTC_RES_START (MACE_BASE + offsetof(struct sgi_mace, isa.rtc))
+#define MACE_RTC_RES_END (MACE_RTC_RES_START + 32767)
+
+static struct resource ip32_rtc_resources[] = {
 	{
-		.start = 0x70,
-		.end   = 0x71,
-		.flags = IORESOURCE_IO
+		.start	= MACEISA_RTC_IRQ,
+		.end	= MACEISA_RTC_IRQ,
+		.flags	= IORESOURCE_IRQ
+	}, {
+		.start	= MACE_RTC_RES_START,
+		.end	= MACE_RTC_RES_END,
+		.flags	= IORESOURCE_MEM,
 	}
 };
 
-static __init int sgio2_cmos_devinit(void)
+
+
+static __init int sgio2_rtc_devinit(void)
 {
-	return IS_ERR(platform_device_register_simple("rtc_cmos", -1,
-						      sgio2_cmos_rsrc, 1));
+	return IS_ERR(platform_device_register_simple("rtc-ds1685", -1,
+		      ip32_rtc_resources, ARRAY_SIZE(ip32_rtc_resources)));
 }
 
-device_initcall(sgio2_cmos_devinit);
+device_initcall(sgio2_rtc_devinit);
 
 MODULE_AUTHOR("Ralf Baechle <[email protected]>");
 MODULE_LICENSE("GPL");
arch/mips/sgi-ip32/ip32-reset.c +1 -52

77 lines not on this page · raw message

drivers/rtc/Kconfig +15 -2
diff -Naurp linux-2.6.37.rtc-ds1685/drivers/rtc/Kconfig linux-2.6.37.rtc-ds1685.ip32/drivers/rtc/Kconfig
@@ -501,17 +501,30 @@ config RTC_DRV_DS1553
 
 config RTC_DRV_DS1685
 	tristate "Dallas/Maxim DS1685/DS1687"
-	depends on I2C
+	depends on (I2C || SGI_IP32)
 	help
 	  If you say yes here you get support for the Dallas/Maxim
 	  DS1685/DS1687 timekeeping chip.
 
 	  Systems that use this chip include EPPC-405-UC modules, by
-	  electronic system design GmbH.
+	  electronic system design GmbH, and the SGI O2 (IP32).
+
+	  This module also supports the DS17285/DS17287 timekeeping chips
+	  that are sometimes found in place of the DS1685/DS1687 in some
+	  SGI O2 systems.
 
 	  This driver can also be built as a module. If so, the module
 	  will be called rtc-ds1685.
 
+config RTC_DRV_DS17285
+	bool "Enable DS17285/DS17287 Differences"
+	depends on (SGI_IP32 && RTC_DRV_DS1685)
+	help
+	  If your SGI O2 has one of these RTC chips instead of the more
+	  common DS1687-5 chip, say Y here to enable the minor differences
+	  this particular chip has.  For more information, refer to the
+	  Dallas/Maxim datasheet for the DS17285/DS17287 chip.
+
 config RTC_DRV_DS1742
 	tristate "Maxim/Dallas DS1742/1743"
 	help
include/linux/rtc/ds1685.h +55 -3

104 lines not on this page · raw message