Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Pull watchdog changes from Wim Van Sebroeck:
 - addition of MOXA ART watchdog driver (moxart_wdt)
 - addition of CSR SiRFprimaII and SiRFatlasVI watchdog driver
   (sirfsoc_wdt)
 - addition of ralink watchdog driver (rt2880_wdt)
 - various fixes and cleanups (__user annotation, ioctl return codes,
   removal of redundant of_match_ptr, removal of unnecessary
   amba_set_drvdata(), use allocated buffer for usb_control_msg, ...)
 - removal of MODULE_ALIAS_MISCDEV statements
 - watchdog related DT bindings
 - first set of improvements on the w83627hf_wdt driver

* git://www.linux-watchdog.org/linux-watchdog: (26 commits)
  watchdog: w83627hf: Use helper functions to access superio registers
  watchdog: w83627hf: Enable watchdog device only if not already enabled
  watchdog: w83627hf: Enable watchdog only once
  watchdog: w83627hf: Convert to watchdog infrastructure
  watchdog: omap_wdt: raw read and write endian fix
  watchdog: sirf: don't depend on dummy value of CLOCK_TICK_RATE
  watchdog: pcwd_usb: overflow in usb_pcwd_send_command()
  watchdog: rt2880_wdt: fix return value check in rt288x_wdt_probe()
  watchdog: watchdog_core: Fix a trivial typo
  watchdog: dw: Enable OF support for DW watchdog timer
  watchdog: Get rid of MODULE_ALIAS_MISCDEV statements
  watchdog: ts72xx_wdt: Propagate return value from timeout_to_regval
  watchdog: pcwd_usb: Use allocated buffer for usb_control_msg
  watchdog: sp805_wdt: Remove unnecessary amba_set_drvdata()
  watchdog: sirf: add watchdog driver of CSR SiRFprimaII and SiRFatlasVI
  watchdog: Remove redundant of_match_ptr
  watchdog: ts72xx_wdt: cleanup return codes in ioctl
  documentation/devicetree: Move DT bindings from gpio to watchdog
  watchdog: add ralink watchdog driver
  watchdog: Add MOXA ART watchdog driver
  ...
  • Loading branch information
torvalds committed Nov 18, 2013
2 parents 13509c3 + ef0c1a6 commit 27b5c3f
Show file tree
Hide file tree
Showing 103 changed files with 905 additions and 407 deletions.
21 changes: 21 additions & 0 deletions Documentation/devicetree/bindings/watchdog/dw_wdt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Synopsys Designware Watchdog Timer

Required Properties:

- compatible : Should contain "snps,dw-wdt"
- reg : Base address and size of the watchdog timer registers.
- clocks : phandle + clock-specifier for the clock that drives the
watchdog timer.

Optional Properties:

- interrupts : The interrupt used for the watchdog timeout warning.

Example:

watchdog0: wd@ffd02000 {
compatible = "snps,dw-wdt";
reg = <0xffd02000 0x1000>;
interrupts = <0 171 4>;
clocks = <&per_base_clk>;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
MOXA ART Watchdog timer

Required properties:

- compatible : Must be "moxa,moxart-watchdog"
- reg : Should contain registers location and length
- clocks : Should contain phandle for the clock that drives the counter

Example:

watchdog: watchdog@98500000 {
compatible = "moxa,moxart-watchdog";
reg = <0x98500000 0x10>;
clocks = <&coreclk>;
};
19 changes: 19 additions & 0 deletions Documentation/devicetree/bindings/watchdog/rt2880-wdt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Ralink Watchdog Timers

Required properties:
- compatible: must be "ralink,rt2880-wdt"
- reg: physical base address of the controller and length of the register range

Optional properties:
- interrupt-parent: phandle to the INTC device node
- interrupts: Specify the INTC interrupt number

Example:

watchdog@120 {
compatible = "ralink,rt2880-wdt";
reg = <0x120 0x10>;

interrupt-parent = <&intc>;
interrupts = <1>;
};
14 changes: 14 additions & 0 deletions Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SiRFSoC Timer and Watchdog Timer(WDT) Controller

Required properties:
- compatible: "sirf,prima2-tick"
- reg: Address range of tick timer/WDT register set
- interrupts: interrupt number to the cpu

Example:

timer@b0020000 {
compatible = "sirf,prima2-tick";
reg = <0xb0020000 0x1000>;
interrupts = <0>;
};
1 change: 1 addition & 0 deletions arch/arm/configs/prima2_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ CONFIG_SPI=y
CONFIG_SPI_SIRF=y
CONFIG_SPI_SPIDEV=y
# CONFIG_HWMON is not set
CONFIG_WATCHDOG=y
CONFIG_USB_GADGET=y
CONFIG_USB_MASS_STORAGE=m
CONFIG_MMC=y
Expand Down
27 changes: 27 additions & 0 deletions drivers/watchdog/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,25 @@ config RETU_WATCHDOG
To compile this driver as a module, choose M here: the
module will be called retu_wdt.

config MOXART_WDT
tristate "MOXART watchdog"
depends on ARCH_MOXART
help
Say Y here to include Watchdog timer support for the watchdog
existing on the MOXA ART SoC series platforms.

To compile this driver as a module, choose M here: the
module will be called moxart_wdt.

config SIRFSOC_WATCHDOG
tristate "SiRFSOC watchdog"
depends on ARCH_SIRF
select WATCHDOG_CORE
default y
help
Support for CSR SiRFprimaII and SiRFatlasVI watchdog. When
the watchdog triggers the system will be reset.

# AVR32 Architecture

config AT32AP700X_WDT
Expand Down Expand Up @@ -866,6 +885,7 @@ config VIA_WDT
config W83627HF_WDT
tristate "W83627HF/W83627DHG Watchdog Timer"
depends on X86
select WATCHDOG_CORE
---help---
This is the driver for the hardware watchdog on the W83627HF chipset
as used in Advantech PC-9578 and Tyan S2721-533 motherboards
Expand Down Expand Up @@ -1125,6 +1145,13 @@ config LANTIQ_WDT
help
Hardware driver for the Lantiq SoC Watchdog Timer.

config RALINK_WDT
tristate "Ralink SoC watchdog"
select WATCHDOG_CORE
depends on RALINK
help
Hardware driver for the Ralink SoC Watchdog Timer.

# PARISC Architecture

# POWERPC Architecture
Expand Down
3 changes: 3 additions & 0 deletions drivers/watchdog/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ obj-$(CONFIG_IMX2_WDT) += imx2_wdt.o
obj-$(CONFIG_UX500_WATCHDOG) += ux500_wdt.o
obj-$(CONFIG_RETU_WATCHDOG) += retu_wdt.o
obj-$(CONFIG_BCM2835_WDT) += bcm2835_wdt.o
obj-$(CONFIG_MOXART_WDT) += moxart_wdt.o
obj-$(CONFIG_SIRFSOC_WATCHDOG) += sirfsoc_wdt.o

# AVR32 Architecture
obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o
Expand Down Expand Up @@ -134,6 +136,7 @@ obj-$(CONFIG_TXX9_WDT) += txx9wdt.o
obj-$(CONFIG_OCTEON_WDT) += octeon-wdt.o
octeon-wdt-y := octeon-wdt-main.o octeon-wdt-nmi.o
obj-$(CONFIG_LANTIQ_WDT) += lantiq_wdt.o
obj-$(CONFIG_RALINK_WDT) += rt2880_wdt.o

# PARISC Architecture

Expand Down
4 changes: 1 addition & 3 deletions drivers/watchdog/acquirewdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@
#include <linux/types.h> /* For standard types (like size_t) */
#include <linux/errno.h> /* For the -ENODEV/... values */
#include <linux/kernel.h> /* For printk/panic/... */
#include <linux/miscdevice.h> /* For MODULE_ALIAS_MISCDEV
(WATCHDOG_MINOR) */
#include <linux/miscdevice.h> /* For struct miscdevice */
#include <linux/watchdog.h> /* For the watchdog specific items */
#include <linux/fs.h> /* For file operations */
#include <linux/ioport.h> /* For io-port access */
Expand Down Expand Up @@ -337,4 +336,3 @@ module_exit(acq_exit);
MODULE_AUTHOR("David Woodhouse");
MODULE_DESCRIPTION("Acquire Inc. Single Board Computer Watchdog Timer driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
1 change: 0 additions & 1 deletion drivers/watchdog/advantechwdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,4 +345,3 @@ module_exit(advwdt_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Marek Michalkiewicz <marekm@linux.org.pl>");
MODULE_DESCRIPTION("Advantech Single Board Computer WDT driver");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
1 change: 0 additions & 1 deletion drivers/watchdog/alim1535_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,4 +452,3 @@ module_exit(watchdog_exit);
MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("ALi M1535 PMU Watchdog Timer driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
1 change: 0 additions & 1 deletion drivers/watchdog/alim7101_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,4 +425,3 @@ MODULE_DEVICE_TABLE(pci, alim7101_pci_tbl);
MODULE_AUTHOR("Steve Hill");
MODULE_DESCRIPTION("ALi M7101 PMU Computer Watchdog Timer driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
1 change: 0 additions & 1 deletion drivers/watchdog/ar7_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
MODULE_AUTHOR("Nicolas Thill <nico@openwrt.org>");
MODULE_DESCRIPTION(LONGNAME);
MODULE_LICENSE("GPL");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);

static int margin = 60;
module_param(margin, int, 0);
Expand Down
1 change: 0 additions & 1 deletion drivers/watchdog/at32ap700x_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,4 +434,3 @@ module_platform_driver_probe(at32_wdt_driver, at32_wdt_probe);
MODULE_AUTHOR("Hans-Christian Egtvedt <egtvedt@samfundet.no>");
MODULE_DESCRIPTION("Watchdog driver for Atmel AT32AP700X");
MODULE_LICENSE("GPL");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
3 changes: 1 addition & 2 deletions drivers/watchdog/at91rm9200_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ static struct platform_driver at91wdt_driver = {
.driver = {
.name = "at91_wdt",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(at91_wdt_dt_ids),
.of_match_table = at91_wdt_dt_ids,
},
};

Expand Down Expand Up @@ -297,5 +297,4 @@ module_exit(at91_wdt_exit);
MODULE_AUTHOR("Andrew Victor");
MODULE_DESCRIPTION("Watchdog driver for Atmel AT91RM9200");
MODULE_LICENSE("GPL");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
MODULE_ALIAS("platform:at91_wdt");
1 change: 0 additions & 1 deletion drivers/watchdog/ath79_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,4 +329,3 @@ MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org");
MODULE_AUTHOR("Imre Kaloz <kaloz@openwrt.org");
MODULE_LICENSE("GPL v2");
MODULE_ALIAS("platform:" DRIVER_NAME);
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
1 change: 0 additions & 1 deletion drivers/watchdog/bcm2835_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,3 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
MODULE_AUTHOR("Lubomir Rintel <lkundrak@v3.sk>");
MODULE_DESCRIPTION("Driver for Broadcom BCM2835 watchdog timer");
MODULE_LICENSE("GPL");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
1 change: 0 additions & 1 deletion drivers/watchdog/bcm63xx_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,5 +317,4 @@ MODULE_AUTHOR("Miguel Gaio <miguel.gaio@efixo.com>");
MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>");
MODULE_DESCRIPTION("Driver for the Broadcom BCM63xx SoC watchdog");
MODULE_LICENSE("GPL");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
MODULE_ALIAS("platform:bcm63xx-wdt");
1 change: 0 additions & 1 deletion drivers/watchdog/bfin_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,6 @@ module_exit(bfin_wdt_exit);
MODULE_AUTHOR("Michele d'Amico, Mike Frysinger <vapier@gentoo.org>");
MODULE_DESCRIPTION("Blackfin Watchdog Device Driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);

module_param(timeout, uint, 0);
MODULE_PARM_DESC(timeout,
Expand Down
1 change: 0 additions & 1 deletion drivers/watchdog/cpu5wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ MODULE_AUTHOR("Heiko Ronsdorf <hero@ihg.uni-duisburg.de>");
MODULE_DESCRIPTION("sma cpu5 watchdog driver");
MODULE_SUPPORTED_DEVICE("sma cpu5 watchdog");
MODULE_LICENSE("GPL");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);

module_param(port, int, 0);
MODULE_PARM_DESC(port, "base address of watchdog card, default is 0x91");
Expand Down
1 change: 0 additions & 1 deletion drivers/watchdog/davinci_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,5 +267,4 @@ MODULE_PARM_DESC(heartbeat,
__MODULE_STRING(DEFAULT_HEARTBEAT));

MODULE_LICENSE("GPL");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
MODULE_ALIAS("platform:watchdog");
36 changes: 20 additions & 16 deletions drivers/watchdog/dw_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/of.h>
#include <linux/pm.h>
#include <linux/platform_device.h>
#include <linux/spinlock.h>
Expand Down Expand Up @@ -203,12 +204,12 @@ static long dw_wdt_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)

switch (cmd) {
case WDIOC_GETSUPPORT:
return copy_to_user((struct watchdog_info *)arg, &dw_wdt_ident,
return copy_to_user((void __user *)arg, &dw_wdt_ident,
sizeof(dw_wdt_ident)) ? -EFAULT : 0;

case WDIOC_GETSTATUS:
case WDIOC_GETBOOTSTATUS:
return put_user(0, (int *)arg);
return put_user(0, (int __user *)arg);

case WDIOC_KEEPALIVE:
dw_wdt_set_next_heartbeat();
Expand Down Expand Up @@ -252,17 +253,17 @@ static int dw_wdt_release(struct inode *inode, struct file *filp)
return 0;
}

#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
static int dw_wdt_suspend(struct device *dev)
{
clk_disable(dw_wdt.clk);
clk_disable_unprepare(dw_wdt.clk);

return 0;
}

static int dw_wdt_resume(struct device *dev)
{
int err = clk_enable(dw_wdt.clk);
int err = clk_prepare_enable(dw_wdt.clk);

if (err)
return err;
Expand All @@ -271,12 +272,9 @@ static int dw_wdt_resume(struct device *dev)

return 0;
}
#endif /* CONFIG_PM_SLEEP */

static const struct dev_pm_ops dw_wdt_pm_ops = {
.suspend = dw_wdt_suspend,
.resume = dw_wdt_resume,
};
#endif /* CONFIG_PM */
static SIMPLE_DEV_PM_OPS(dw_wdt_pm_ops, dw_wdt_suspend, dw_wdt_resume);

static const struct file_operations wdt_fops = {
.owner = THIS_MODULE,
Expand Down Expand Up @@ -309,7 +307,7 @@ static int dw_wdt_drv_probe(struct platform_device *pdev)
if (IS_ERR(dw_wdt.clk))
return PTR_ERR(dw_wdt.clk);

ret = clk_enable(dw_wdt.clk);
ret = clk_prepare_enable(dw_wdt.clk);
if (ret)
return ret;

Expand All @@ -326,7 +324,7 @@ static int dw_wdt_drv_probe(struct platform_device *pdev)
return 0;

out_disable_clk:
clk_disable(dw_wdt.clk);
clk_disable_unprepare(dw_wdt.clk);

return ret;
}
Expand All @@ -335,20 +333,27 @@ static int dw_wdt_drv_remove(struct platform_device *pdev)
{
misc_deregister(&dw_wdt_miscdev);

clk_disable(dw_wdt.clk);
clk_disable_unprepare(dw_wdt.clk);

return 0;
}

#ifdef CONFIG_OF
static const struct of_device_id dw_wdt_of_match[] = {
{ .compatible = "snps,dw-wdt", },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, dw_wdt_of_match);
#endif

static struct platform_driver dw_wdt_driver = {
.probe = dw_wdt_drv_probe,
.remove = dw_wdt_drv_remove,
.driver = {
.name = "dw_wdt",
.owner = THIS_MODULE,
#ifdef CONFIG_PM
.of_match_table = of_match_ptr(dw_wdt_of_match),
.pm = &dw_wdt_pm_ops,
#endif /* CONFIG_PM */
},
};

Expand All @@ -357,4 +362,3 @@ module_platform_driver(dw_wdt_driver);
MODULE_AUTHOR("Jamie Iles");
MODULE_DESCRIPTION("Synopsys DesignWare Watchdog Driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
1 change: 0 additions & 1 deletion drivers/watchdog/ep93xx_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,3 @@ MODULE_AUTHOR("Ray Lehtiniemi <rayl@mail.com>,"
MODULE_DESCRIPTION("EP93xx Watchdog");
MODULE_LICENSE("GPL");
MODULE_VERSION(WDT_VERSION);
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
1 change: 0 additions & 1 deletion drivers/watchdog/eurotechwdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,4 +477,3 @@ module_exit(eurwdt_exit);
MODULE_AUTHOR("Rodolfo Giometti");
MODULE_DESCRIPTION("Driver for Eurotech CPU-1220/1410 on board watchdog");
MODULE_LICENSE("GPL");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
1 change: 0 additions & 1 deletion drivers/watchdog/gef_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,5 +331,4 @@ module_exit(gef_wdt_exit);
MODULE_AUTHOR("Martyn Welch <martyn.welch@ge.com>");
MODULE_DESCRIPTION("GE watchdog driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
MODULE_ALIAS("platform:gef_wdt");
1 change: 0 additions & 1 deletion drivers/watchdog/geodewdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,3 @@ module_exit(geodewdt_exit);
MODULE_AUTHOR("Advanced Micro Devices, Inc");
MODULE_DESCRIPTION("Geode GX/LX Watchdog Driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
1 change: 0 additions & 1 deletion drivers/watchdog/hpwdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,6 @@ MODULE_AUTHOR("Tom Mingarelli");
MODULE_DESCRIPTION("hp watchdog driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(HPWDT_VERSION);
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);

module_param(soft_margin, int, 0);
MODULE_PARM_DESC(soft_margin, "Watchdog timeout in seconds");
Expand Down
1 change: 0 additions & 1 deletion drivers/watchdog/i6300esb.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,4 +497,3 @@ module_pci_driver(esb_driver);
MODULE_AUTHOR("Ross Biro and David Härdeman");
MODULE_DESCRIPTION("Watchdog driver for Intel 6300ESB chipsets");
MODULE_LICENSE("GPL");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
Loading

0 comments on commit 27b5c3f

Please sign in to comment.