Skip to contentSkip to conversation

IP22/28: Switch over to RTC class driver

PATCH Superseded Thomas Bogendoerfer 1 participant 1 message Aug 9, 2008 MIPS

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Thomas Bogendoerfer

author maintainer
#0 lore raw

PATCH v2 1/1 IP22/28: Switch over to RTC class driver

This patchset removes some dead code and creates a platform device for the RTC class driver.

---

Changes in v2:

- corrected rtc resource end

 arch/mips/sgi-ip22/ip22-platform.c  |   15 ++++++++
 arch/mips/sgi-ip22/ip22-setup.c     |    1 -
 arch/mips/sgi-ip22/ip22-time.c      |   64 -----------------------------------
 include/asm-mips/mach-ip22/ds1286.h |   18 ----------
 include/asm-mips/mach-ip28/ds1286.h |    4 --
 include/linux/ds1286.h              |    2 -
 6 files changed, 15 insertions(+), 89 deletions(-)
arch/mips/sgi-ip22/ip22-platform.c +15 -0
index 6014123..9bbb90b 100644
@@ -192,3 +192,18 @@ static int __init sgi_button_devinit(void)
 }
 
 device_initcall(sgi_button_devinit);
+
+static int __init sgi_ds1286_devinit(void)
+{
+	struct resource res;
+
+	memset(&res, 0, sizeof(res));
+	res.start = HPC3_CHIP0_BASE + offsetof(struct hpc3_regs, rtcregs);
+	res.end = res.start + sizeof(hpc3c0->rtcregs) - 1;
+	res.flags = IORESOURCE_MEM;
+
+	return IS_ERR(platform_device_register_simple("rtc-ds1286", -1,
+						      &res, 1));
+}
+
+device_initcall(sgi_ds1286_devinit);
arch/mips/sgi-ip22/ip22-setup.c +0 -1
index 896a1ef..b9a9313 100644
@@ -4,7 +4,6 @@
  * Copyright (C) 1996 David S. Miller ([email protected])
  * Copyright (C) 1997, 1998 Ralf Baechle ([email protected])
  */
-#include <linux/ds1286.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/kdev_t.h>
arch/mips/sgi-ip22/ip22-time.c +0 -64

76 lines not on this page · raw message

include/asm-mips/mach-ip22/ds1286.h deleted +0 -18
deleted file mode 100644
index f19f1ea..0000000
@@ -1,18 +0,0 @@
-/*
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 1998, 2001, 03 by Ralf Baechle
- *
- * RTC routines for PC style attached Dallas chip.
- */
-#ifndef __ASM_MACH_IP22_DS1286_H
-#define __ASM_MACH_IP22_DS1286_H
-
-#include <asm/sgi/hpc3.h>
-
-#define rtc_read(reg)		(hpc3c0->rtcregs[(reg)] & 0xff)
-#define rtc_write(data, reg)	do { hpc3c0->rtcregs[(reg)] = (data); } while(0)
-
-#endif /* __ASM_MACH_IP22_DS1286_H */
include/asm-mips/mach-ip28/ds1286.h deleted +0 -4
deleted file mode 100644
index 471bb9a..0000000
@@ -1,4 +0,0 @@
-#ifndef __ASM_MACH_IP28_DS1286_H
-#define __ASM_MACH_IP28_DS1286_H
-#include <asm/mach-ip22/ds1286.h>
-#endif /* __ASM_MACH_IP28_DS1286_H */
include/linux/ds1286.h +0 -2
index d898986..45ea0aa 100644
@@ -8,8 +8,6 @@
 #ifndef __LINUX_DS1286_H
 #define __LINUX_DS1286_H
 
-#include <asm/ds1286.h>
-
 /**********************************************************************
  * register summary
  **********************************************************************/