diff options
| author | Olof Johansson <olof@lixom.net> | 2012-12-12 16:09:22 -0800 | 
|---|---|---|
| committer | Olof Johansson <olof@lixom.net> | 2012-12-12 16:10:00 -0800 | 
| commit | 4a76411ea3f1da9032e031f8fff8894b97d141b2 (patch) | |
| tree | 59976175d70b6e08aacd4abf7090919d3b78fc29 /arch/arm/mach-omap2/wd_timer.c | |
| parent | 5c1af2a7011bf719807de360cb64c2f610269a38 (diff) | |
| parent | fb6842a7bc44bf719bfe85d5819a153d7c215510 (diff) | |
| download | olio-linux-3.10-4a76411ea3f1da9032e031f8fff8894b97d141b2.tar.xz olio-linux-3.10-4a76411ea3f1da9032e031f8fff8894b97d141b2.zip  | |
ARM: arm-soc: Merge branch 'next/clk' into next/pm
Merge together a couple of the smaller pm/clock branches into one.
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-omap2/wd_timer.c')
| -rw-r--r-- | arch/arm/mach-omap2/wd_timer.c | 40 | 
1 files changed, 36 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/wd_timer.c b/arch/arm/mach-omap2/wd_timer.c index b2f1c67043a..7c2b4ed38f0 100644 --- a/arch/arm/mach-omap2/wd_timer.c +++ b/arch/arm/mach-omap2/wd_timer.c @@ -1,6 +1,8 @@  /*   * OMAP2+ MPU WD_TIMER-specific code   * + * Copyright (C) 2012 Texas Instruments, Inc. + *   * 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; either version 2 of the License, or @@ -11,10 +13,14 @@  #include <linux/io.h>  #include <linux/err.h> -#include <plat/omap_hwmod.h> +#include <linux/platform_data/omap-wd-timer.h> +#include "omap_hwmod.h" +#include "omap_device.h"  #include "wd_timer.h"  #include "common.h" +#include "prm.h" +#include "soc.h"  /*   * In order to avoid any assumptions from bootloader regarding WDT @@ -26,9 +32,6 @@  #define OMAP_WDT_WPS		0x34  #define OMAP_WDT_SPR		0x48 -/* Maximum microseconds to wait for OMAP module to softreset */ -#define MAX_MODULE_SOFTRESET_WAIT	10000 -  int omap2_wd_timer_disable(struct omap_hwmod *oh)  {  	void __iomem *base; @@ -99,3 +102,32 @@ int omap2_wd_timer_reset(struct omap_hwmod *oh)  	return (c == MAX_MODULE_SOFTRESET_WAIT) ? -ETIMEDOUT :  		omap2_wd_timer_disable(oh);  } + +static int __init omap_init_wdt(void) +{ +	int id = -1; +	struct platform_device *pdev; +	struct omap_hwmod *oh; +	char *oh_name = "wd_timer2"; +	char *dev_name = "omap_wdt"; +	struct omap_wd_timer_platform_data pdata; + +	if (!cpu_class_is_omap2() || of_have_populated_dt()) +		return 0; + +	oh = omap_hwmod_lookup(oh_name); +	if (!oh) { +		pr_err("Could not look up wd_timer%d hwmod\n", id); +		return -EINVAL; +	} + +	pdata.read_reset_sources = prm_read_reset_sources; + +	pdev = omap_device_build(dev_name, id, oh, &pdata, +				 sizeof(struct omap_wd_timer_platform_data), +				 NULL, 0, 0); +	WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s.\n", +	     dev_name, oh->name); +	return 0; +} +subsys_initcall(omap_init_wdt);  |