linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/4] mfd: twl4030power: Add a configuration to turn off oscillator during off-idle
Date: Wed, 23 Apr 2014 17:40:29 -0700	[thread overview]
Message-ID: <1398300030-7386-4-git-send-email-tony@atomide.com> (raw)
In-Reply-To: <1398300030-7386-1-git-send-email-tony@atomide.com>

Some oscillators can be turned off during off-idle saving few
a little bit power at the cost of the oscillator start up
latency.

If you board can do this, you can now enable it by using the
ti,twl4030-power-idle-osc-off compatible flag.

Cc: Peter De Schrijver <pdeschrijver@nvidia.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 .../devicetree/bindings/mfd/twl4030-power.txt         |  6 ++++++
 drivers/mfd/twl4030-power.c                           | 19 +++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/twl4030-power.txt b/Documentation/devicetree/bindings/mfd/twl4030-power.txt
index bbd6603..b9ee7b9 100644
--- a/Documentation/devicetree/bindings/mfd/twl4030-power.txt
+++ b/Documentation/devicetree/bindings/mfd/twl4030-power.txt
@@ -9,6 +9,7 @@ Required properties:
 	"ti,twl4030-power"
 	"ti,twl4030-power-reset"
 	"ti,twl4030-power-idle"
+	"ti,twl4030-power-idle-osc-off"
 
 The use of ti,twl4030-power-reset is recommended at least on
 3530 that needs a special configuration for warm reset to work.
@@ -16,6 +17,11 @@ The use of ti,twl4030-power-reset is recommended at least on
 When using ti,twl4030-power-idle, the TI recommended configuration
 for idle modes is loaded to the tlw4030 PMIC.
 
+When using ti,twl4030-power-idle-osc-off, the TI recommended
+configuration is used with the external oscillator being shut
+down during off-idle. Note that this does not work on all boards
+depending on how the external oscillator is wired.
+
 Optional properties:
 - ti,use_poweroff: With this flag, the chip will initiates an ACTIVE-to-OFF or
 		   SLEEP-to-OFF transition when the system poweroffs.
diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
index 89c6b1a..12e4abe 100644
--- a/drivers/mfd/twl4030-power.c
+++ b/drivers/mfd/twl4030-power.c
@@ -777,6 +777,21 @@ static struct twl4030_power_data omap3_idle = {
 	.resource_config	= omap3_idle_rconfig,
 };
 
+/* Disable 32 KiHz oscillator during idle */
+static struct twl4030_resconfig osc_off_rconfig[] = {
+	{ .resource = RES_CLKEN, .devgroup = DEV_GRP_P1 | DEV_GRP_P3,
+	  .type = 3, .type2 = 2, .remap_off = TWL_REMAP_OFF,
+	  .remap_sleep = TWL_REMAP_SLEEP, },
+	{ /* Terminator */ },
+};
+
+static struct twl4030_power_data osc_off_idle = {
+	.scripts		= omap3_idle_scripts,
+	.num			= ARRAY_SIZE(omap3_idle_scripts),
+	.resource_config	= omap3_idle_rconfig,
+	.board_config		= osc_off_rconfig,
+};
+
 static struct of_device_id twl4030_power_of_match[] = {
 	{
 		.compatible = "ti,twl4030-power-reset",
@@ -786,6 +801,10 @@ static struct of_device_id twl4030_power_of_match[] = {
 		.compatible = "ti,twl4030-power-idle",
 		.data = &omap3_idle,
 	},
+	{
+		.compatible = "ti,twl4030-power-idle-osc-off",
+		.data = &osc_off_idle,
+	},
 	{ },
 };
 MODULE_DEVICE_TABLE(of, twl4030_power_of_match);
-- 
1.8.1.1

  parent reply	other threads:[~2014-04-24  0:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-24  0:40 [PATCH 0/4] mfd: twl4030-power: Enable off-idle configuration when booted with device tree Tony Lindgren
2014-04-24  0:40 ` [PATCH 1/4] mfd: twl4030-power: Add recommended idle configuration Tony Lindgren
2014-04-28 11:41   ` Lee Jones
2014-04-28 15:33     ` Tony Lindgren
2014-04-28 15:42       ` Lee Jones
2014-04-24  0:40 ` [PATCH 2/4] mfd: twl4030-power: Add support for board specific configuration Tony Lindgren
2014-04-28 11:47   ` Lee Jones
2014-04-28 15:36     ` Tony Lindgren
2014-04-24  0:40 ` Tony Lindgren [this message]
2014-04-28 11:48   ` [PATCH 3/4] mfd: twl4030power: Add a configuration to turn off oscillator during off-idle Lee Jones
2014-04-24  0:40 ` [PATCH 4/4] ARM: dts: Enable twl4030 off-idle configuration for selected omaps Tony Lindgren
2014-04-24  0:49 ` [PATCH 1a/4] mfd: twl4030-power: Add generic reset configuration Tony Lindgren
2014-04-28 11:37   ` Lee Jones
2014-04-28 16:01     ` Tony Lindgren

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=1398300030-7386-4-git-send-email-tony@atomide.com \
    --to=tony@atomide.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).