mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@linux-mips.org>
To: Ralf Baechle <ralf@linux-mips.org>,
	Alessandro Zummo <a.zummo@towertech.it>
Cc: linux-mips@linux-mips.org, rtc-linux@googlegroups.com,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] DEC: Switch DECstation systems to rtc-cmos
Date: Sat, 19 Apr 2014 23:59:16 +0100 (BST)	[thread overview]
Message-ID: <alpine.LFD.2.11.1404192338050.11598@eddie.linux-mips.org> (raw)
In-Reply-To: <alpine.LFD.2.11.1404192224250.11598@eddie.linux-mips.org>

This adds an RTC platform device for DECstation systems so that they can 
use the rtc-cmos driver for their RTC device.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
---
Ralf,

 This part requires the other change or it won't build at all, so it can't 
be pushed to the LMO tree by itself.  I'm not sure which route, either RTC 
or LMO, will be the best for upstreaming this patch pair, but surely the 
rtc-cmos part will have to be reviewed first.

  Maciej

linux-dec-rtc.patch
Index: linux-20140404-3maxp/arch/mips/dec/Makefile
===================================================================
--- linux-20140404-3maxp.orig/arch/mips/dec/Makefile
+++ linux-20140404-3maxp/arch/mips/dec/Makefile
@@ -3,7 +3,7 @@
 #
 
 obj-y		:= ecc-berr.o int-handler.o ioasic-irq.o kn01-berr.o \
-		   kn02-irq.o kn02xa-berr.o reset.o setup.o time.o
+		   kn02-irq.o kn02xa-berr.o platform.o reset.o setup.o time.o
 
 obj-$(CONFIG_TC)		+= tc.o
 obj-$(CONFIG_CPU_HAS_WB)	+= wbflush.o
Index: linux-20140404-3maxp/arch/mips/dec/platform.c
===================================================================
--- /dev/null
+++ linux-20140404-3maxp/arch/mips/dec/platform.c
@@ -0,0 +1,44 @@
+/*
+ *	DEC platform devices.
+ *
+ *	Copyright (c) 2014  Maciej W. Rozycki
+ *
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License
+ *	as published by the Free Software Foundation; either version
+ *	2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/ioport.h>
+#include <linux/kernel.h>
+#include <linux/mc146818rtc.h>
+#include <linux/platform_device.h>
+
+static struct resource dec_rtc_resources[] = {
+	{
+		.name = "rtc",
+		.flags = IORESOURCE_MEM,
+	},
+};
+
+static struct cmos_rtc_board_info dec_rtc_info = {
+	.flags = CMOS_RTC_FLAGS_NOFREQ,
+	.address_space = 64,
+};
+
+static struct platform_device dec_rtc_device = {
+	.name = "rtc_cmos",
+	.id = PLATFORM_DEVID_NONE,
+	.dev.platform_data = &dec_rtc_info,
+	.resource = dec_rtc_resources,
+	.num_resources = ARRAY_SIZE(dec_rtc_resources),
+};
+
+static int __init dec_add_devices(void)
+{
+	dec_rtc_resources[0].start = RTC_PORT(0);
+	dec_rtc_resources[0].end = RTC_PORT(0) + dec_kn_slot_size - 1;
+	return platform_device_register(&dec_rtc_device);
+}
+
+device_initcall(dec_add_devices);

  reply	other threads:[~2014-04-19 22:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-19 22:58 [PATCH 1/2] RTC: rtc-cmos: drivers/char/rtc.c features for DECstation support Maciej W. Rozycki
2014-04-19 22:59 ` Maciej W. Rozycki [this message]
2014-05-06  9:54 ` [rtc-linux] " Alessandro Zummo
2014-05-06 22:05   ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.11.1404192338050.11598@eddie.linux-mips.org \
    --to=macro@linux-mips.org \
    --cc=a.zummo@towertech.it \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=rtc-linux@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®