linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Linux-sh list <linux-sh@vger.kernel.org>
Cc: Linux PM list <linux-pm@vger.kernel.org>,
	Paul Mundt <lethal@linux-sh.org>,
	Simon Horman <horms@verge.net.au>,
	Magnus Damm <magnus.damm@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Cao Minh Hiep <hiepcm@gmail.com>
Subject: [PATCH 4/6] PM / shmobile: Make TMU driver use pm_genpd_dev_always_on()
Date: Tue, 13 Mar 2012 00:26:27 +0000	[thread overview]
Message-ID: <201203130126.28000.rjw@sisk.pl> (raw)
In-Reply-To: <201203130123.16268.rjw@sisk.pl>

From: Rafael J. Wysocki <rjw@sisk.pl>

Make the TMU clocksource driver mark its device as "always on"
using pm_genpd_dev_always_on() to protect it from surprise power
removals and make sh7372_add_standard_devices() add TMU devices on
sh7372 to the A4R power domain so that their "always on" flags
are taken into account as appropriate.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 arch/arm/mach-shmobile/setup-sh7372.c |    2 ++
 drivers/clocksource/sh_tmu.c          |    4 ++++
 2 files changed, 6 insertions(+)

Index: linux/drivers/clocksource/sh_tmu.c
=================================--- linux.orig/drivers/clocksource/sh_tmu.c
+++ linux/drivers/clocksource/sh_tmu.c
@@ -32,6 +32,7 @@
 #include <linux/sh_timer.h>
 #include <linux/slab.h>
 #include <linux/module.h>
+#include <linux/pm_domain.h>
 
 struct sh_tmu_priv {
 	void __iomem *mapbase;
@@ -410,6 +411,9 @@ static int __devinit sh_tmu_probe(struct
 	struct sh_tmu_priv *p = platform_get_drvdata(pdev);
 	int ret;
 
+	if (!is_early_platform_device(pdev))
+		pm_genpd_dev_always_on(&pdev->dev, true);
+
 	if (p) {
 		dev_info(&pdev->dev, "kept as earlytimer\n");
 		return 0;
Index: linux/arch/arm/mach-shmobile/setup-sh7372.c
=================================--- linux.orig/arch/arm/mach-shmobile/setup-sh7372.c
+++ linux/arch/arm/mach-shmobile/setup-sh7372.c
@@ -1043,6 +1043,8 @@ void __init sh7372_add_standard_devices(
 	sh7372_add_device_to_domain(&sh7372_a4r, &veu2_device);
 	sh7372_add_device_to_domain(&sh7372_a4r, &veu3_device);
 	sh7372_add_device_to_domain(&sh7372_a4r, &jpu_device);
+	sh7372_add_device_to_domain(&sh7372_a4r, &tmu00_device);
+	sh7372_add_device_to_domain(&sh7372_a4r, &tmu01_device);
 }
 
 void __init sh7372_add_early_devices(void)


  parent reply	other threads:[~2012-03-13  0:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-13  0:23 [PATCH 0/6] PM / Domains: System suspend fixes and "always on" flag Rafael J. Wysocki
2012-03-13  0:24 ` [PATCH 1/6] PM / Domains: Fix handling of wakeup devices during system resume Rafael J. Wysocki
2012-03-13  0:24 ` [PATCH 2/6] PM / Domains: Fix hibernation restore of devices Rafael J. Wysocki
2012-03-13 21:32   ` [Replacement][PATCH 2/6] PM / Domains: Fix hibernation restore of devices, v2 Rafael J. Wysocki
2012-03-15  9:39     ` Simon Horman
2012-03-15 21:00       ` Rafael J. Wysocki
2012-03-16  0:03         ` Simon Horman
2012-03-13  0:25 ` [PATCH 3/6] PM / Domains: Introduce "always on" device flag Rafael J. Wysocki
2012-03-13 21:34   ` [Update][PATCH " Rafael J. Wysocki
2012-03-13  0:26 ` Rafael J. Wysocki [this message]
2012-03-13  0:27 ` [PATCH 5/6] PM / shmobile: Make CMT driver use pm_genpd_dev_always_on() Rafael J. Wysocki
2012-03-13  0:28 ` [PATCH 6/6] PM / shmobile: Make MTU2 " Rafael J. Wysocki
2012-03-13  1:27 ` [PATCH 0/6] PM / Domains: System suspend fixes and "always on" flag Simon Horman
2012-03-13  1:44 ` Paul Mundt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201203130126.28000.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=hiepcm@gmail.com \
    --cc=horms@verge.net.au \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).