Re: [PATCH 6/6 v2] OMAP2PLUS: WDT: Conversion to runtime PM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Charulatha V <charu@xxxxxx> writes:

> This patch converts the OMAP Watchdog timer driver to
> get adapted to HWMOD FW and to use the runtime PM APIs.
>
> Signed-off-by: Charulatha V <charu@xxxxxx>
> Signed-off-by: Basak, Partha <p-basak2@xxxxxx>

This series looks good.  One minor comment below...

> ---
>  arch/arm/plat-omap/devices.c |   52 ++++++++++++++++++++++++++++++-----------
>  drivers/watchdog/omap_wdt.c  |   43 ++++++----------------------------
>  2 files changed, 46 insertions(+), 49 deletions(-)
>
> diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
> index d1920be..efe2aff 100644
> --- a/arch/arm/plat-omap/devices.c
> +++ b/arch/arm/plat-omap/devices.c
> @@ -15,6 +15,7 @@
>  #include <linux/platform_device.h>
>  #include <linux/io.h>
>  #include <linux/slab.h>
> +#include <linux/err.h>
>  
>  #include <mach/hardware.h>
>  #include <asm/mach-types.h>
> @@ -28,6 +29,8 @@
>  #include <plat/menelaus.h>
>  #include <plat/mcbsp.h>
>  #include <plat/omap44xx.h>
> +#include <plat/omap_hwmod.h>
> +#include <plat/omap_device.h>
>  
>  /*-------------------------------------------------------------------------*/
>  
> @@ -238,6 +241,8 @@ static inline void omap_init_uwire(void) {}
>  
>  static struct resource wdt_resources[] = {
>  	{
> +		.start		= 0xfffeb000,
> +		.end		= 0xfffeb07F,
>  		.flags		= IORESOURCE_MEM,
>  	},
>  };

This struct should probably be renamed with an omap1_ prefix.

> @@ -249,24 +254,43 @@ static struct platform_device omap_wdt_device = {
>  	.resource	= wdt_resources,
>  };

ditto

and they should be moved down just above omap_init_wdt()

> -static void omap_init_wdt(void)
> +struct omap_device_pm_latency omap_wdt_latency[] = {
> +	[0] = {
> +		.deactivate_func = omap_device_idle_hwmods,
> +		.activate_func   = omap_device_enable_hwmods,
> +		.flags		 = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
> +	},
> +};
> +
> +static void omap2_init_wdt()
>  {
> -	if (cpu_is_omap16xx())
> -		wdt_resources[0].start = 0xfffeb000;
> -	else if (cpu_is_omap2420())
> -		wdt_resources[0].start = 0x48022000; /* WDT2 */
> -	else if (cpu_is_omap2430())
> -		wdt_resources[0].start = 0x49016000; /* WDT2 */
> -	else if (cpu_is_omap343x())
> -		wdt_resources[0].start = 0x48314000; /* WDT2 */
> -	else if (cpu_is_omap44xx())
> -		wdt_resources[0].start = 0x4a314000;
> -	else
> +	int id = -1;
> +	struct omap_device *od;
> +	struct omap_hwmod *oh;
> +	char *oh_name = "wd_timer2";
> +	char *name = "omap_wdt";
> +
> +	oh = omap_hwmod_lookup(oh_name);
> +	if (!oh) {
> +		pr_err("Could not look up %s\n", oh_name);
>  		return;
> +	}

Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux