aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-31 23:43:52 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-31 23:43:52 -0400
commit2f63251ed0a803ddbe7bf2577b69d467aa872f68 (patch)
tree960ba4e27bb2cffdda0841ee701515c4bd75143a /arch/powerpc/sysdev
parentd6dd9e93c7531fa31370e27d053a3940d8d662fb (diff)
parent647e50f38345525d8261c295a0d0629dcea23a9b (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
* git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog: (28 commits) [WATCHDOG] Fix pcwd_init_module crash [WATCHDOG] ICH9 support for iTCO_wdt [WATCHDOG] 631xESB/632xESB support for iTCO_wdt - add all LPC bridges [WATCHDOG] 631xESB/632xESB support for iTCO_wdt [WATCHDOG] omap_wdt.c - default error for IOCTL is -ENOTTY [WATCHDOG] Return value of nonseekable_open [WATCHDOG] mv64x60_wdt: Rework the timeout register manipulation [WATCHDOG] mv64x60_wdt: disable watchdog timer when driver is probed [WATCHDOG] mv64x60_wdt: Support the WDIOF_MAGICCLOSE feature [WATCHDOG] mv64x60_wdt: Add a module parameter to change nowayout setting [WATCHDOG] mv64x60_wdt: Add WDIOC_SETOPTIONS ioctl support [WATCHDOG] mv64x60_wdt: Support for WDIOC_SETTIMEOUT ioctl [WATCHDOG] mv64x60_wdt: Fix WDIOC_GETTIMEOUT return value [WATCHDOG] mv64x60_wdt: Check return value of nonseekable_open [WATCHDOG] mv64x60_wdt: Add arch/powerpc platform support [WATCHDOG] mv64x60_wdt: Get register address from platform data [WATCHDOG] mv64x60_wdt: set up platform_device in platform code [WATCHDOG] ensure mouse and keyboard ignored in w83627hf_wdt [WATCHDOG] s3c2410_wdt: fixup after arch include moves [WATCHDOG] git-watchdog-typo ...
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r--arch/powerpc/sysdev/mv64x60_dev.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/arch/powerpc/sysdev/mv64x60_dev.c b/arch/powerpc/sysdev/mv64x60_dev.c
index b618fa60aef3..548a32082e4a 100644
--- a/arch/powerpc/sysdev/mv64x60_dev.c
+++ b/arch/powerpc/sysdev/mv64x60_dev.c
@@ -390,6 +390,61 @@ error:
390 return err; 390 return err;
391} 391}
392 392
393/*
394 * Create mv64x60_wdt platform devices
395 */
396static int __init mv64x60_wdt_device_setup(struct device_node *np, int id)
397{
398 struct resource r;
399 struct platform_device *pdev;
400 struct mv64x60_wdt_pdata pdata;
401 const unsigned int *prop;
402 int err;
403
404 err = of_address_to_resource(np, 0, &r);
405 if (err)
406 return err;
407
408 memset(&pdata, 0, sizeof(pdata));
409
410 prop = of_get_property(np, "timeout", NULL);
411 if (!prop)
412 return -ENODEV;
413 pdata.timeout = *prop;
414
415 np = of_get_parent(np);
416 if (!np)
417 return -ENODEV;
418
419 prop = of_get_property(np, "clock-frequency", NULL);
420 of_node_put(np);
421 if (!prop)
422 return -ENODEV;
423 pdata.bus_clk = *prop / 1000000; /* wdt driver wants freq in MHz */
424
425 pdev = platform_device_alloc(MV64x60_WDT_NAME, id);
426 if (!pdev)
427 return -ENOMEM;
428
429 err = platform_device_add_resources(pdev, &r, 1);
430 if (err)
431 goto error;
432
433 err = platform_device_add_data(pdev, &pdata, sizeof(pdata));
434 if (err)
435 goto error;
436
437 err = platform_device_add(pdev);
438 if (err)
439 goto error;
440
441 return 0;
442
443error:
444 platform_device_put(pdev);
445 return err;
446}
447
393static int __init mv64x60_device_setup(void) 448static int __init mv64x60_device_setup(void)
394{ 449{
395 struct device_node *np = NULL; 450 struct device_node *np = NULL;
@@ -414,6 +469,15 @@ static int __init mv64x60_device_setup(void)
414 if ((err = mv64x60_i2c_device_setup(np, id))) 469 if ((err = mv64x60_i2c_device_setup(np, id)))
415 goto error; 470 goto error;
416 471
472 /* support up to one watchdog timer */
473 np = of_find_compatible_node(np, NULL, "marvell,mv64x60-wdt");
474 if (np) {
475 if ((err = mv64x60_wdt_device_setup(np, id)))
476 goto error;
477 of_node_put(np);
478 }
479
480
417 return 0; 481 return 0;
418 482
419error: 483error: