linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Cohen <david.a.cohen@linux.intel.com>
To: wim@iguana.be, tglx@linutronix.de, mingo@redhat.com,
	hpa@zytor.com, x86@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org,
	gnomes@lxorguk.ukuu.org.uk, david.a.cohen@linux.intel.com
Subject: [PATCH v2 2/2] x86: intel-mid: add watchdog platform code for Merrifield
Date: Fri, 11 Apr 2014 13:50:07 -0700	[thread overview]
Message-ID: <1397249407-5417-3-git-send-email-david.a.cohen@linux.intel.com> (raw)
In-Reply-To: <1397249407-5417-1-git-send-email-david.a.cohen@linux.intel.com>

This patch adds platform code for Intel Merrifield.
Since the watchdog is not part of SFI table, we have no other option but
to manually register watchdog's platform device (argh!).

Change-Id: I920968649847577a0aa1ae0b26f2a3551f77d576
Signed-off-by: David Cohen <david.a.cohen@linux.intel.com>
---
 arch/x86/platform/intel-mid/device_libs/Makefile   |  1 +
 .../platform/intel-mid/device_libs/platform_wdt.c  | 43 ++++++++++++++++++++++
 2 files changed, 44 insertions(+)
 create mode 100644 arch/x86/platform/intel-mid/device_libs/platform_wdt.c

diff --git a/arch/x86/platform/intel-mid/device_libs/Makefile b/arch/x86/platform/intel-mid/device_libs/Makefile
index 097e7a7940d8..af9307f2cc28 100644
--- a/arch/x86/platform/intel-mid/device_libs/Makefile
+++ b/arch/x86/platform/intel-mid/device_libs/Makefile
@@ -20,3 +20,4 @@ obj-$(subst m,y,$(CONFIG_DRM_MEDFIELD)) += platform_tc35876x.o
 obj-$(subst m,y,$(CONFIG_SERIAL_MRST_MAX3110)) += platform_max3111.o
 # MISC Devices
 obj-$(subst m,y,$(CONFIG_KEYBOARD_GPIO)) += platform_gpio_keys.o
+obj-$(subst m,y,$(CONFIG_INTEL_MID_WATCHDOG)) += platform_wdt.o
diff --git a/arch/x86/platform/intel-mid/device_libs/platform_wdt.c b/arch/x86/platform/intel-mid/device_libs/platform_wdt.c
new file mode 100644
index 000000000000..be4fc66fbe1b
--- /dev/null
+++ b/arch/x86/platform/intel-mid/device_libs/platform_wdt.c
@@ -0,0 +1,43 @@
+/*
+ * platform_wdt.c: Watchdog platform library file
+ *
+ * (C) Copyright 2014 Intel Corporation
+ * Author: David Cohen <david.a.cohen@linux.intel.com>
+ *
+ * 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; version 2
+ * of the License.
+ */
+
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <asm/intel-mid.h>
+
+#define EXT_TIMER0_MSI 15
+
+static const struct resource tangier_wdt_res[] = {
+	{
+		.start = EXT_TIMER0_MSI,
+		.flags = IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device mid_wdt_dev = {
+	.name = "intel_mid_wdt",
+	.id = -1,
+};
+
+static int __init register_mid_wdt(void)
+{
+	if (intel_mid_identify_cpu() == INTEL_MID_CPU_CHIP_TANGIER) {
+		platform_device_add_resources(&mid_wdt_dev,
+					      tangier_wdt_res,
+					      ARRAY_SIZE(tangier_wdt_res));
+		return platform_device_register(&mid_wdt_dev);
+	}
+
+	return -ENODEV;
+}
+
+rootfs_initcall(register_mid_wdt);
-- 
1.9.1


  parent reply	other threads:[~2014-04-11 20:50 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-08 20:59 [PATCH 0/2] Initial implementation of Intel MID watchdog driver David Cohen
2014-04-08 20:59 ` [PATCH 1/2] watchdog: add Intel MID watchdog driver support David Cohen
2014-04-08 23:56   ` Randy Dunlap
2014-04-09 17:48     ` David Cohen
2014-04-10 13:51       ` Guenter Roeck
2014-04-10 18:24         ` David Cohen
2014-04-09  0:17   ` Guenter Roeck
2014-04-09 12:41     ` One Thousand Gnomes
2014-04-08 20:59 ` [PATCH 2/2] x86: intel-mid: add watchdog platform code for Merrifield David Cohen
2014-04-09 12:42   ` One Thousand Gnomes
2014-04-09 13:49     ` Alexander Stein
2014-04-09 13:58       ` One Thousand Gnomes
2014-04-09 14:03         ` Alexander Stein
2014-04-09 15:18           ` Guenter Roeck
2014-04-09 16:10             ` Alexander Stein
2014-04-09 17:15               ` Guenter Roeck
2014-04-10 11:08               ` One Thousand Gnomes
2014-04-09 18:00     ` David Cohen
2014-04-10 19:15   ` Guenter Roeck
2014-04-10 19:30     ` David Cohen
2014-04-10 20:35       ` Guenter Roeck
2014-04-10 21:23         ` David Cohen
2014-04-10 22:51           ` Guenter Roeck
2014-04-11 20:50 ` [PATCH v2 0/2] Initial implementation of Intel MID watchdog driver David Cohen
2014-04-11 20:50   ` [PATCH v2 1/2] watchdog: add Intel MID watchdog driver support David Cohen
2014-04-11 20:50   ` David Cohen [this message]
2014-04-15 18:41   ` [PATCH v3 0/2] Initial implementation of Intel MID watchdog driver David Cohen
2014-04-15 18:41     ` [PATCH v3 1/2] watchdog: add Intel MID watchdog driver support David Cohen
2014-04-15 19:01       ` Guenter Roeck
2014-04-15 19:24         ` David Cohen
2014-04-15 18:41     ` [PATCH v3 2/2] x86: intel-mid: add watchdog platform code for Merrifield David Cohen
2014-04-15 19:09       ` Guenter Roeck
2014-04-15 19:30         ` David Cohen
2014-04-15 20:06     ` [PATCH v4 0/2] Initial implementation of Intel MID watchdog driver David Cohen
2014-04-15 20:06       ` [PATCH v4 1/2] watchdog: add Intel MID watchdog driver support David Cohen
2014-04-16  0:13         ` Guenter Roeck
2014-04-15 20:06       ` [PATCH v4 2/2] x86: intel-mid: add watchdog platform code for Merrifield David Cohen
2014-04-15 20:09         ` David Cohen
2014-04-15 21:13           ` Guenter Roeck
2014-04-15 21:17             ` David Cohen
2014-04-15 21:35               ` Guenter Roeck
2014-04-15 21:39                 ` David Cohen
2014-04-15 22:20         ` [PATCH v4.1 " David Cohen
2014-04-16  0:16           ` Guenter Roeck

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=1397249407-5417-3-git-send-email-david.a.cohen@linux.intel.com \
    --to=david.a.cohen@linux.intel.com \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=wim@iguana.be \
    --cc=x86@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).