Skip to contentSkip to conversation

watchdog: Convert iTCO_wdt driver to mfd model

PATCH Superseded Aaron Sierra 1 participant 1 message Feb 17, 2012 1 message not in the archive

Subsystems (3)

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 55504321-bd01-4e09-af8b-dc2ec76a75dd@zimbra

#1 lore raw

PATCH v3 3/3 watchdog: Convert iTCO_wdt driver to mfd model

This patch converts the iTCO_wdt driver to use the multi-function device driver model. It uses resources discovered by the lpc_ich driver, so that it no longer does its own PCI scanning.

The driver has also been modernized to use pr_info and the like.

---
 drivers/mfd/Kconfig                    |    3 +-
 drivers/mfd/lpc_ich.c                  |  193 ++++++++----
 drivers/watchdog/Kconfig               |    1 +
 drivers/watchdog/iTCO_vendor.h         |    6 +-
 drivers/watchdog/iTCO_vendor_support.c |   43 ++--
 drivers/watchdog/iTCO_wdt.c            |  557 +++++++-------------------------
 include/linux/mfd/lpc_ich.h            |    7 +
 7 files changed, 287 insertions(+), 523 deletions(-)
drivers/mfd/Kconfig +2 -1
index f581e59..428e0a2 100644
@@ -731,7 +731,8 @@ config LPC_ICH
 	help
 	  The LPC bridge function of the Intel ICH provides support for
 	  many functional units. This driver provides needed support for
-	  other drivers to control these functions, currently GPIO.
+	  other drivers to control these functions, currently GPIO and
+	  watchdog.
 
 config MFD_RDC321X
 	tristate "Support for RDC-R321x southbridge"
drivers/mfd/lpc_ich.c +134 -59

234 lines not on this page · raw message

drivers/watchdog/Kconfig +1 -0
index 877b107..c3a4d7f 100644
@@ -557,6 +557,7 @@ config INTEL_SCU_WATCHDOG
 config ITCO_WDT
 	tristate "Intel TCO Timer/Watchdog"
 	depends on (X86 || IA64) && PCI
+	select LPC_ICH
 	---help---
 	  Hardware driver for the intel TCO timer based watchdog devices.
 	  These drivers are included in the Intel 82801 I/O Controller
drivers/watchdog/iTCO_vendor.h +3 -3
index 9e27e64..3c57b45 100644
@@ -1,8 +1,8 @@
 /* iTCO Vendor Specific Support hooks */
 #ifdef CONFIG_ITCO_VENDOR_SUPPORT
-extern void iTCO_vendor_pre_start(unsigned long, unsigned int);
-extern void iTCO_vendor_pre_stop(unsigned long);
-extern void iTCO_vendor_pre_keepalive(unsigned long, unsigned int);
+extern void iTCO_vendor_pre_start(struct resource *, unsigned int);
+extern void iTCO_vendor_pre_stop(struct resource *);
+extern void iTCO_vendor_pre_keepalive(struct resource *, unsigned int);
 extern void iTCO_vendor_pre_set_heartbeat(unsigned int);
 extern int iTCO_vendor_check_noreboot_on(void);
 #else
drivers/watchdog/iTCO_vendor_support.c +19 -24

120 lines not on this page · raw message

drivers/watchdog/iTCO_wdt.c +121 -436

696 lines not on this page · raw message

include/linux/mfd/lpc_ich.h +7 -0
index 286c778..47d64e7 100644
@@ -20,12 +20,19 @@
 #ifndef LPC_ICH_H
 #define LPC_ICH_H
 
+/* Watchdog resources */
+#define ICH_RES_IO_TCO	0
+#define ICH_RES_IO_SMI	1
+#define ICH_RES_MEM_OFF	2
+#define ICH_RES_MEM_GCS	0
+
 /* GPIO resources */
 #define ICH_RES_GPIO	0
 #define ICH_RES_GPE0	1
 
 struct lpc_ich_info {
 	char name[32];
+	unsigned int iTCO_version;
 	unsigned int gpio_version;
 };
 
Signature · 1 line
1.7.0.4