blob: 9494c4b254777342cbd6da39ece0c8ca76c9776a [file] [log] [blame]
Komal Shah7768a132006-09-29 01:59:18 -07001/*
Felipe Balbi28171422008-09-20 04:14:01 +03002 * omap_wdt.c
Komal Shah7768a132006-09-29 01:59:18 -07003 *
Felipe Balbi28171422008-09-20 04:14:01 +03004 * Watchdog driver for the TI OMAP 16xx & 24xx/34xx 32KHz (non-secure) watchdog
Komal Shah7768a132006-09-29 01:59:18 -07005 *
6 * Author: MontaVista Software, Inc.
7 * <gdavis@mvista.com> or <source@mvista.com>
8 *
9 * 2003 (c) MontaVista Software, Inc. This file is licensed under the
10 * terms of the GNU General Public License version 2. This program is
11 * licensed "as is" without any warranty of any kind, whether express
12 * or implied.
13 *
14 * History:
15 *
16 * 20030527: George G. Davis <gdavis@mvista.com>
17 * Initially based on linux-2.4.19-rmk7-pxa1/drivers/char/sa1100_wdt.c
18 * (c) Copyright 2000 Oleg Drokin <green@crimea.edu>
Alan Cox29fa0582008-10-27 15:17:56 +000019 * Based on SoftDog driver by Alan Cox <alan@lxorguk.ukuu.org.uk>
Komal Shah7768a132006-09-29 01:59:18 -070020 *
21 * Copyright (c) 2004 Texas Instruments.
22 * 1. Modified to support OMAP1610 32-KHz watchdog timer
23 * 2. Ported to 2.6 kernel
24 *
25 * Copyright (c) 2005 David Brownell
26 * Use the driver model and standard identifiers; handle bigger timeouts.
27 */
28
Joe Perches27c766a2012-02-15 15:06:19 -080029#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
30
Komal Shah7768a132006-09-29 01:59:18 -070031#include <linux/module.h>
Komal Shah7768a132006-09-29 01:59:18 -070032#include <linux/types.h>
33#include <linux/kernel.h>
Komal Shah7768a132006-09-29 01:59:18 -070034#include <linux/mm.h>
Komal Shah7768a132006-09-29 01:59:18 -070035#include <linux/watchdog.h>
36#include <linux/reboot.h>
Komal Shah7768a132006-09-29 01:59:18 -070037#include <linux/err.h>
38#include <linux/platform_device.h>
39#include <linux/moduleparam.h>
Wim Van Sebroeck089ab072008-07-15 11:46:11 +000040#include <linux/io.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090041#include <linux/slab.h>
Varadarajan, Charulatha7ec5ad02010-09-23 20:02:43 +053042#include <linux/pm_runtime.h>
Paul Walmsley129f5572012-10-29 20:49:44 -060043#include <linux/platform_data/omap-wd-timer.h>
Komal Shah7768a132006-09-29 01:59:18 -070044
45#include "omap_wdt.h"
46
Pali Rohár2dd7b242013-02-17 00:49:26 +010047static bool nowayout = WATCHDOG_NOWAYOUT;
48module_param(nowayout, bool, 0);
49MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started "
50 "(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
51
Komal Shah7768a132006-09-29 01:59:18 -070052static unsigned timer_margin;
53module_param(timer_margin, uint, 0);
54MODULE_PARM_DESC(timer_margin, "initial watchdog timeout (in seconds)");
55
Uwe Kleine-Königd2f78262015-04-27 11:23:00 +020056#define to_omap_wdt_dev(_wdog) container_of(_wdog, struct omap_wdt_dev, wdog)
57
Felipe Balbi28171422008-09-20 04:14:01 +030058struct omap_wdt_dev {
Uwe Kleine-Königd2f78262015-04-27 11:23:00 +020059 struct watchdog_device wdog;
Felipe Balbi28171422008-09-20 04:14:01 +030060 void __iomem *base; /* physical */
61 struct device *dev;
Aaro Koskinen67c0f552012-10-10 23:23:32 +030062 bool omap_wdt_users;
Aaro Koskinen67c0f552012-10-10 23:23:32 +030063 int wdt_trgr_pattern;
64 struct mutex lock; /* to avoid races with PM */
Felipe Balbi28171422008-09-20 04:14:01 +030065};
66
Aaro Koskinen67c0f552012-10-10 23:23:32 +030067static void omap_wdt_reload(struct omap_wdt_dev *wdev)
Komal Shah7768a132006-09-29 01:59:18 -070068{
Felipe Balbi28171422008-09-20 04:14:01 +030069 void __iomem *base = wdev->base;
Felipe Balbib3112182008-09-20 04:14:03 +030070
Komal Shah7768a132006-09-29 01:59:18 -070071 /* wait for posted write to complete */
Victor Kamensky4a7e94a2013-11-16 02:01:05 +020072 while ((readl_relaxed(base + OMAP_WATCHDOG_WPS)) & 0x08)
Komal Shah7768a132006-09-29 01:59:18 -070073 cpu_relax();
Felipe Balbib3112182008-09-20 04:14:03 +030074
Aaro Koskinen67c0f552012-10-10 23:23:32 +030075 wdev->wdt_trgr_pattern = ~wdev->wdt_trgr_pattern;
Victor Kamensky4a7e94a2013-11-16 02:01:05 +020076 writel_relaxed(wdev->wdt_trgr_pattern, (base + OMAP_WATCHDOG_TGR));
Felipe Balbib3112182008-09-20 04:14:03 +030077
Komal Shah7768a132006-09-29 01:59:18 -070078 /* wait for posted write to complete */
Victor Kamensky4a7e94a2013-11-16 02:01:05 +020079 while ((readl_relaxed(base + OMAP_WATCHDOG_WPS)) & 0x08)
Komal Shah7768a132006-09-29 01:59:18 -070080 cpu_relax();
81 /* reloaded WCRR from WLDR */
82}
83
Felipe Balbi28171422008-09-20 04:14:01 +030084static void omap_wdt_enable(struct omap_wdt_dev *wdev)
Komal Shah7768a132006-09-29 01:59:18 -070085{
Felipe Balbib3112182008-09-20 04:14:03 +030086 void __iomem *base = wdev->base;
87
Komal Shah7768a132006-09-29 01:59:18 -070088 /* Sequence to enable the watchdog */
Victor Kamensky4a7e94a2013-11-16 02:01:05 +020089 writel_relaxed(0xBBBB, base + OMAP_WATCHDOG_SPR);
90 while ((readl_relaxed(base + OMAP_WATCHDOG_WPS)) & 0x10)
Komal Shah7768a132006-09-29 01:59:18 -070091 cpu_relax();
Felipe Balbib3112182008-09-20 04:14:03 +030092
Victor Kamensky4a7e94a2013-11-16 02:01:05 +020093 writel_relaxed(0x4444, base + OMAP_WATCHDOG_SPR);
94 while ((readl_relaxed(base + OMAP_WATCHDOG_WPS)) & 0x10)
Komal Shah7768a132006-09-29 01:59:18 -070095 cpu_relax();
96}
97
Felipe Balbi28171422008-09-20 04:14:01 +030098static void omap_wdt_disable(struct omap_wdt_dev *wdev)
Komal Shah7768a132006-09-29 01:59:18 -070099{
Felipe Balbib3112182008-09-20 04:14:03 +0300100 void __iomem *base = wdev->base;
101
Komal Shah7768a132006-09-29 01:59:18 -0700102 /* sequence required to disable watchdog */
Victor Kamensky4a7e94a2013-11-16 02:01:05 +0200103 writel_relaxed(0xAAAA, base + OMAP_WATCHDOG_SPR); /* TIMER_MODE */
104 while (readl_relaxed(base + OMAP_WATCHDOG_WPS) & 0x10)
Komal Shah7768a132006-09-29 01:59:18 -0700105 cpu_relax();
Felipe Balbib3112182008-09-20 04:14:03 +0300106
Victor Kamensky4a7e94a2013-11-16 02:01:05 +0200107 writel_relaxed(0x5555, base + OMAP_WATCHDOG_SPR); /* TIMER_MODE */
108 while (readl_relaxed(base + OMAP_WATCHDOG_WPS) & 0x10)
Komal Shah7768a132006-09-29 01:59:18 -0700109 cpu_relax();
110}
111
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300112static void omap_wdt_set_timer(struct omap_wdt_dev *wdev,
113 unsigned int timeout)
Komal Shah7768a132006-09-29 01:59:18 -0700114{
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300115 u32 pre_margin = GET_WLDR_VAL(timeout);
Felipe Balbib3112182008-09-20 04:14:03 +0300116 void __iomem *base = wdev->base;
Komal Shah7768a132006-09-29 01:59:18 -0700117
118 /* just count up at 32 KHz */
Victor Kamensky4a7e94a2013-11-16 02:01:05 +0200119 while (readl_relaxed(base + OMAP_WATCHDOG_WPS) & 0x04)
Komal Shah7768a132006-09-29 01:59:18 -0700120 cpu_relax();
Felipe Balbib3112182008-09-20 04:14:03 +0300121
Victor Kamensky4a7e94a2013-11-16 02:01:05 +0200122 writel_relaxed(pre_margin, base + OMAP_WATCHDOG_LDR);
123 while (readl_relaxed(base + OMAP_WATCHDOG_WPS) & 0x04)
Komal Shah7768a132006-09-29 01:59:18 -0700124 cpu_relax();
125}
126
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300127static int omap_wdt_start(struct watchdog_device *wdog)
Komal Shah7768a132006-09-29 01:59:18 -0700128{
Uwe Kleine-Königd2f78262015-04-27 11:23:00 +0200129 struct omap_wdt_dev *wdev = to_omap_wdt_dev(wdog);
Felipe Balbib3112182008-09-20 04:14:03 +0300130 void __iomem *base = wdev->base;
131
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300132 mutex_lock(&wdev->lock);
133
134 wdev->omap_wdt_users = true;
Komal Shah7768a132006-09-29 01:59:18 -0700135
Varadarajan, Charulatha7ec5ad02010-09-23 20:02:43 +0530136 pm_runtime_get_sync(wdev->dev);
Komal Shah7768a132006-09-29 01:59:18 -0700137
138 /* initialize prescaler */
Victor Kamensky4a7e94a2013-11-16 02:01:05 +0200139 while (readl_relaxed(base + OMAP_WATCHDOG_WPS) & 0x01)
Komal Shah7768a132006-09-29 01:59:18 -0700140 cpu_relax();
Felipe Balbib3112182008-09-20 04:14:03 +0300141
Victor Kamensky4a7e94a2013-11-16 02:01:05 +0200142 writel_relaxed((1 << 5) | (PTV << 2), base + OMAP_WATCHDOG_CNTRL);
143 while (readl_relaxed(base + OMAP_WATCHDOG_WPS) & 0x01)
Komal Shah7768a132006-09-29 01:59:18 -0700144 cpu_relax();
145
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300146 omap_wdt_set_timer(wdev, wdog->timeout);
147 omap_wdt_reload(wdev); /* trigger loading of new timeout value */
Felipe Balbi28171422008-09-20 04:14:01 +0300148 omap_wdt_enable(wdev);
Felipe Balbib3112182008-09-20 04:14:03 +0300149
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300150 mutex_unlock(&wdev->lock);
Felipe Balbib3112182008-09-20 04:14:03 +0300151
Komal Shah7768a132006-09-29 01:59:18 -0700152 return 0;
153}
154
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300155static int omap_wdt_stop(struct watchdog_device *wdog)
Komal Shah7768a132006-09-29 01:59:18 -0700156{
Uwe Kleine-Königd2f78262015-04-27 11:23:00 +0200157 struct omap_wdt_dev *wdev = to_omap_wdt_dev(wdog);
Felipe Balbib3112182008-09-20 04:14:03 +0300158
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300159 mutex_lock(&wdev->lock);
160 omap_wdt_disable(wdev);
161 pm_runtime_put_sync(wdev->dev);
162 wdev->omap_wdt_users = false;
163 mutex_unlock(&wdev->lock);
164 return 0;
Komal Shah7768a132006-09-29 01:59:18 -0700165}
166
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300167static int omap_wdt_ping(struct watchdog_device *wdog)
Komal Shah7768a132006-09-29 01:59:18 -0700168{
Uwe Kleine-Königd2f78262015-04-27 11:23:00 +0200169 struct omap_wdt_dev *wdev = to_omap_wdt_dev(wdog);
Felipe Balbib3112182008-09-20 04:14:03 +0300170
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300171 mutex_lock(&wdev->lock);
172 omap_wdt_reload(wdev);
173 mutex_unlock(&wdev->lock);
Komal Shah7768a132006-09-29 01:59:18 -0700174
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300175 return 0;
Komal Shah7768a132006-09-29 01:59:18 -0700176}
177
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300178static int omap_wdt_set_timeout(struct watchdog_device *wdog,
179 unsigned int timeout)
180{
Uwe Kleine-Königd2f78262015-04-27 11:23:00 +0200181 struct omap_wdt_dev *wdev = to_omap_wdt_dev(wdog);
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300182
183 mutex_lock(&wdev->lock);
184 omap_wdt_disable(wdev);
185 omap_wdt_set_timer(wdev, timeout);
186 omap_wdt_enable(wdev);
187 omap_wdt_reload(wdev);
188 wdog->timeout = timeout;
189 mutex_unlock(&wdev->lock);
190
191 return 0;
192}
193
194static const struct watchdog_info omap_wdt_info = {
Tony Lindgrenfb1cbea2014-10-14 12:25:19 -0700195 .options = WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING,
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300196 .identity = "OMAP Watchdog",
197};
198
199static const struct watchdog_ops omap_wdt_ops = {
200 .owner = THIS_MODULE,
201 .start = omap_wdt_start,
202 .stop = omap_wdt_stop,
203 .ping = omap_wdt_ping,
204 .set_timeout = omap_wdt_set_timeout,
Komal Shah7768a132006-09-29 01:59:18 -0700205};
206
Bill Pemberton2d991a12012-11-19 13:21:41 -0500207static int omap_wdt_probe(struct platform_device *pdev)
Komal Shah7768a132006-09-29 01:59:18 -0700208{
Jingoo Hanbc8fdfb2013-07-30 19:58:51 +0900209 struct omap_wd_timer_platform_data *pdata = dev_get_platdata(&pdev->dev);
Jingoo Han6e272062014-02-11 21:44:12 +0900210 struct resource *res;
Felipe Balbi28171422008-09-20 04:14:01 +0300211 struct omap_wdt_dev *wdev;
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300212 u32 rs;
Felipe Balbib3112182008-09-20 04:14:03 +0300213 int ret;
Komal Shah7768a132006-09-29 01:59:18 -0700214
Aaro Koskinen4f4753d2012-10-10 23:23:33 +0300215 wdev = devm_kzalloc(&pdev->dev, sizeof(*wdev), GFP_KERNEL);
216 if (!wdev)
217 return -ENOMEM;
Felipe Balbib3112182008-09-20 04:14:03 +0300218
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300219 wdev->omap_wdt_users = false;
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300220 wdev->dev = &pdev->dev;
221 wdev->wdt_trgr_pattern = 0x1234;
222 mutex_init(&wdev->lock);
Komal Shah7768a132006-09-29 01:59:18 -0700223
Jingoo Han6e272062014-02-11 21:44:12 +0900224 /* reserve static register mappings */
225 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
226 wdev->base = devm_ioremap_resource(&pdev->dev, res);
227 if (IS_ERR(wdev->base))
228 return PTR_ERR(wdev->base);
Felipe Balbi9f69e3b2008-09-20 04:14:02 +0300229
Uwe Kleine-Königd2f78262015-04-27 11:23:00 +0200230 wdev->wdog.info = &omap_wdt_info;
231 wdev->wdog.ops = &omap_wdt_ops;
232 wdev->wdog.min_timeout = TIMER_MARGIN_MIN;
233 wdev->wdog.max_timeout = TIMER_MARGIN_MAX;
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300234
Uwe Kleine-Königd2f78262015-04-27 11:23:00 +0200235 if (watchdog_init_timeout(&wdev->wdog, timer_margin, &pdev->dev) < 0)
236 wdev->wdog.timeout = TIMER_MARGIN_DEFAULT;
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300237
Uwe Kleine-Königd2f78262015-04-27 11:23:00 +0200238 watchdog_set_nowayout(&wdev->wdog, nowayout);
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300239
Uwe Kleine-Königd2f78262015-04-27 11:23:00 +0200240 platform_set_drvdata(pdev, wdev);
Felipe Balbi28171422008-09-20 04:14:01 +0300241
Varadarajan, Charulatha7ec5ad02010-09-23 20:02:43 +0530242 pm_runtime_enable(wdev->dev);
243 pm_runtime_get_sync(wdev->dev);
Ulrik Bech Hald789cd472009-06-12 16:18:32 -0500244
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300245 if (pdata && pdata->read_reset_sources)
246 rs = pdata->read_reset_sources();
247 else
248 rs = 0;
Uwe Kleine-Königd2f78262015-04-27 11:23:00 +0200249 wdev->wdog.bootstatus = (rs & (1 << OMAP_MPU_WD_RST_SRC_ID_SHIFT)) ?
250 WDIOF_CARDRESET : 0;
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300251
Felipe Balbi28171422008-09-20 04:14:01 +0300252 omap_wdt_disable(wdev);
Komal Shah7768a132006-09-29 01:59:18 -0700253
Uwe Kleine-Königd2f78262015-04-27 11:23:00 +0200254 ret = watchdog_register_device(&wdev->wdog);
Aaro Koskinen1ba85382012-10-10 23:23:37 +0300255 if (ret) {
256 pm_runtime_disable(wdev->dev);
257 return ret;
258 }
Komal Shah7768a132006-09-29 01:59:18 -0700259
Felipe Balbi28171422008-09-20 04:14:01 +0300260 pr_info("OMAP Watchdog Timer Rev 0x%02x: initial timeout %d sec\n",
Victor Kamensky4a7e94a2013-11-16 02:01:05 +0200261 readl_relaxed(wdev->base + OMAP_WATCHDOG_REV) & 0xFF,
Uwe Kleine-Königd2f78262015-04-27 11:23:00 +0200262 wdev->wdog.timeout);
Komal Shah7768a132006-09-29 01:59:18 -0700263
Varadarajan, Charulatha7ec5ad02010-09-23 20:02:43 +0530264 pm_runtime_put_sync(wdev->dev);
Ulrik Bech Hald789cd472009-06-12 16:18:32 -0500265
Komal Shah7768a132006-09-29 01:59:18 -0700266 return 0;
Komal Shah7768a132006-09-29 01:59:18 -0700267}
268
269static void omap_wdt_shutdown(struct platform_device *pdev)
270{
Uwe Kleine-Königd2f78262015-04-27 11:23:00 +0200271 struct omap_wdt_dev *wdev = platform_get_drvdata(pdev);
Felipe Balbi28171422008-09-20 04:14:01 +0300272
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300273 mutex_lock(&wdev->lock);
Paul Walmsley0503add2011-03-10 22:40:05 -0700274 if (wdev->omap_wdt_users) {
Felipe Balbi28171422008-09-20 04:14:01 +0300275 omap_wdt_disable(wdev);
Paul Walmsley0503add2011-03-10 22:40:05 -0700276 pm_runtime_put_sync(wdev->dev);
277 }
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300278 mutex_unlock(&wdev->lock);
Komal Shah7768a132006-09-29 01:59:18 -0700279}
280
Bill Pemberton4b12b892012-11-19 13:26:24 -0500281static int omap_wdt_remove(struct platform_device *pdev)
Komal Shah7768a132006-09-29 01:59:18 -0700282{
Uwe Kleine-Königd2f78262015-04-27 11:23:00 +0200283 struct omap_wdt_dev *wdev = platform_get_drvdata(pdev);
Felipe Balbi28171422008-09-20 04:14:01 +0300284
Shubhrajyoti D12c583d2012-01-11 19:50:18 +0530285 pm_runtime_disable(wdev->dev);
Uwe Kleine-Königd2f78262015-04-27 11:23:00 +0200286 watchdog_unregister_device(&wdev->wdog);
Felipe Balbib3112182008-09-20 04:14:03 +0300287
Komal Shah7768a132006-09-29 01:59:18 -0700288 return 0;
289}
290
291#ifdef CONFIG_PM
292
293/* REVISIT ... not clear this is the best way to handle system suspend; and
294 * it's very inappropriate for selective device suspend (e.g. suspending this
295 * through sysfs rather than by stopping the watchdog daemon). Also, this
296 * may not play well enough with NOWAYOUT...
297 */
298
299static int omap_wdt_suspend(struct platform_device *pdev, pm_message_t state)
300{
Uwe Kleine-Königd2f78262015-04-27 11:23:00 +0200301 struct omap_wdt_dev *wdev = platform_get_drvdata(pdev);
Felipe Balbib3112182008-09-20 04:14:03 +0300302
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300303 mutex_lock(&wdev->lock);
Paul Walmsley0503add2011-03-10 22:40:05 -0700304 if (wdev->omap_wdt_users) {
Felipe Balbi28171422008-09-20 04:14:01 +0300305 omap_wdt_disable(wdev);
Paul Walmsley0503add2011-03-10 22:40:05 -0700306 pm_runtime_put_sync(wdev->dev);
307 }
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300308 mutex_unlock(&wdev->lock);
Felipe Balbib3112182008-09-20 04:14:03 +0300309
Komal Shah7768a132006-09-29 01:59:18 -0700310 return 0;
311}
312
313static int omap_wdt_resume(struct platform_device *pdev)
314{
Uwe Kleine-Königd2f78262015-04-27 11:23:00 +0200315 struct omap_wdt_dev *wdev = platform_get_drvdata(pdev);
Felipe Balbib3112182008-09-20 04:14:03 +0300316
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300317 mutex_lock(&wdev->lock);
Felipe Balbi28171422008-09-20 04:14:01 +0300318 if (wdev->omap_wdt_users) {
Paul Walmsley0503add2011-03-10 22:40:05 -0700319 pm_runtime_get_sync(wdev->dev);
Felipe Balbi28171422008-09-20 04:14:01 +0300320 omap_wdt_enable(wdev);
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300321 omap_wdt_reload(wdev);
Komal Shah7768a132006-09-29 01:59:18 -0700322 }
Aaro Koskinen67c0f552012-10-10 23:23:32 +0300323 mutex_unlock(&wdev->lock);
Felipe Balbib3112182008-09-20 04:14:03 +0300324
Komal Shah7768a132006-09-29 01:59:18 -0700325 return 0;
326}
327
328#else
329#define omap_wdt_suspend NULL
330#define omap_wdt_resume NULL
331#endif
332
Xiao Jiange6ca04e2012-06-01 12:44:16 +0800333static const struct of_device_id omap_wdt_of_match[] = {
334 { .compatible = "ti,omap3-wdt", },
335 {},
336};
337MODULE_DEVICE_TABLE(of, omap_wdt_of_match);
338
Komal Shah7768a132006-09-29 01:59:18 -0700339static struct platform_driver omap_wdt_driver = {
340 .probe = omap_wdt_probe,
Bill Pemberton82268712012-11-19 13:21:12 -0500341 .remove = omap_wdt_remove,
Komal Shah7768a132006-09-29 01:59:18 -0700342 .shutdown = omap_wdt_shutdown,
343 .suspend = omap_wdt_suspend,
344 .resume = omap_wdt_resume,
345 .driver = {
Komal Shah7768a132006-09-29 01:59:18 -0700346 .name = "omap_wdt",
Xiao Jiange6ca04e2012-06-01 12:44:16 +0800347 .of_match_table = omap_wdt_of_match,
Komal Shah7768a132006-09-29 01:59:18 -0700348 },
349};
350
Axel Linb8ec6112011-11-29 13:56:27 +0800351module_platform_driver(omap_wdt_driver);
Komal Shah7768a132006-09-29 01:59:18 -0700352
353MODULE_AUTHOR("George G. Davis");
354MODULE_LICENSE("GPL");
Kay Sieversf37d1932008-04-10 21:29:23 -0700355MODULE_ALIAS("platform:omap_wdt");