All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: tps65910: wire up sleep control configuration
@ 2017-06-14 12:25 Michał Mirosław
  2017-06-14 14:42   ` Mark Brown
  2017-06-15 17:23 ` Applied "regulator: tps65910: wire up sleep control configuration" to the regulator tree Mark Brown
  0 siblings, 2 replies; 9+ messages in thread
From: Michał Mirosław @ 2017-06-14 12:25 UTC (permalink / raw)
  To: linux-kernel, devicetree, linux-omap
  Cc: Mark Brown, Tony Lindgren, Liam Girdwood, Keerthy, Rob Herring,
	Mark Rutland

This enables configuring the PMIC's sleep mode via device-tree.

A pointer indirection to sleep mode data is removed, as it simplifies
the implementation slightly.

References: 201cf052810d20814a77ca0e0045a2c1a3508a1f
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 Documentation/devicetree/bindings/mfd/tps65910.txt |  4 ++++
 drivers/mfd/tps65910.c                             | 22 +++++++++++++++-------
 include/linux/mfd/tps65910.h                       |  2 +-
 3 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/Documentation/devicetree/bindings/mfd/tps65910.txt b/Documentation/devicetree/bindings/mfd/tps65910.txt
index 38833e63a59f9..8af1202b381dc 100644
--- a/Documentation/devicetree/bindings/mfd/tps65910.txt
+++ b/Documentation/devicetree/bindings/mfd/tps65910.txt
@@ -61,6 +61,10 @@ Optional properties:
   There should be 9 entries here, one for each gpio.
 - ti,system-power-controller: Telling whether or not this pmic is controlling
   the system power.
+- ti,sleep-enable: Enable SLEEP state.
+- ti,sleep-keep-therm: Keep thermal monitoring on in sleep state.
+- ti,sleep-keep-ck32k: Keep the 32KHz clock output on in sleep state.
+- ti,sleep-keep-hsclk: Keep high speed internal clock on in sleep state.
 
 Regulator Optional properties:
 - ti,regulator-ext-sleep-control: enable external sleep
diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index 11cab1582f2f2..8263605f6d2fa 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -328,11 +328,7 @@ static int tps65910_sleepinit(struct tps65910 *tps65910,
 		goto err_sleep_init;
 	}
 
-	/* Return if there is no sleep keepon data. */
-	if (!pmic_pdata->slp_keepon)
-		return 0;
-
-	if (pmic_pdata->slp_keepon->therm_keepon) {
+	if (pmic_pdata->slp_keepon.therm_keepon) {
 		ret = tps65910_reg_set_bits(tps65910,
 				TPS65910_SLEEP_KEEP_RES_ON,
 				SLEEP_KEEP_RES_ON_THERM_KEEPON_MASK);
@@ -342,7 +338,7 @@ static int tps65910_sleepinit(struct tps65910 *tps65910,
 		}
 	}
 
-	if (pmic_pdata->slp_keepon->clkout32k_keepon) {
+	if (pmic_pdata->slp_keepon.clkout32k_keepon) {
 		ret = tps65910_reg_set_bits(tps65910,
 				TPS65910_SLEEP_KEEP_RES_ON,
 				SLEEP_KEEP_RES_ON_CLKOUT32K_KEEPON_MASK);
@@ -352,7 +348,7 @@ static int tps65910_sleepinit(struct tps65910 *tps65910,
 		}
 	}
 
-	if (pmic_pdata->slp_keepon->i2chs_keepon) {
+	if (pmic_pdata->slp_keepon.i2chs_keepon) {
 		ret = tps65910_reg_set_bits(tps65910,
 				TPS65910_SLEEP_KEEP_RES_ON,
 				SLEEP_KEEP_RES_ON_I2CHS_KEEPON_MASK);
@@ -415,6 +411,18 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
 	prop = of_property_read_bool(np, "ti,en-ck32k-xtal");
 	board_info->en_ck32k_xtal = prop;
 
+	prop = of_property_read_bool(np, "ti,sleep-enable");
+	board_info->en_dev_slp = prop;
+
+	prop = of_property_read_bool(np, "ti,sleep-keep-therm");
+	board_info->slp_keepon.therm_keepon = prop;
+
+	prop = of_property_read_bool(np, "ti,sleep-keep-ck32k");
+	board_info->slp_keepon.clkout32k_keepon = prop;
+
+	prop = of_property_read_bool(np, "ti,sleep-keep-hsclk");
+	board_info->slp_keepon.i2chs_keepon = prop;
+
 	board_info->irq = client->irq;
 	board_info->irq_base = -1;
 	board_info->pm_off = of_property_read_bool(np,
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h
index ffb21e79204d6..deffdcd0236f9 100644
--- a/include/linux/mfd/tps65910.h
+++ b/include/linux/mfd/tps65910.h
@@ -879,7 +879,7 @@ struct tps65910_board {
 	bool en_ck32k_xtal;
 	bool en_dev_slp;
 	bool pm_off;
-	struct tps65910_sleep_keepon_data *slp_keepon;
+	struct tps65910_sleep_keepon_data slp_keepon;
 	bool en_gpio_sleep[TPS6591X_MAX_NUM_GPIO];
 	unsigned long regulator_ext_sleep_control[TPS65910_NUM_REGS];
 	struct regulator_init_data *tps65910_pmic_init_data[TPS65910_NUM_REGS];
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] regulator: tps65910: wire up sleep control configuration
@ 2017-06-14 14:42   ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2017-06-14 14:42 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: linux-kernel, devicetree, linux-omap, Tony Lindgren,
	Liam Girdwood, Keerthy, Rob Herring, Mark Rutland

[-- Attachment #1: Type: text/plain, Size: 174 bytes --]

On Wed, Jun 14, 2017 at 02:25:13PM +0200, Michał Mirosław wrote:

> References: 201cf052810d20814a77ca0e0045a2c1a3508a1f

I have no idea what you mean by this, sorry.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] regulator: tps65910: wire up sleep control configuration
@ 2017-06-14 14:42   ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2017-06-14 14:42 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Tony Lindgren, Liam Girdwood,
	Keerthy, Rob Herring, Mark Rutland

[-- Attachment #1: Type: text/plain, Size: 174 bytes --]

On Wed, Jun 14, 2017 at 02:25:13PM +0200, Michał Mirosław wrote:

> References: 201cf052810d20814a77ca0e0045a2c1a3508a1f

I have no idea what you mean by this, sorry.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] regulator: tps65910: wire up sleep control configuration
  2017-06-14 14:42   ` Mark Brown
  (?)
@ 2017-06-14 15:13   ` Michał Mirosław
  2017-06-14 17:15       ` Mark Brown
  -1 siblings, 1 reply; 9+ messages in thread
From: Michał Mirosław @ 2017-06-14 15:13 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-kernel, devicetree, linux-omap, Tony Lindgren,
	Liam Girdwood, Keerthy, Rob Herring, Mark Rutland

On Wed, Jun 14, 2017 at 03:42:08PM +0100, Mark Brown wrote:
> On Wed, Jun 14, 2017 at 02:25:13PM +0200, Michał Mirosław wrote:
> > References: 201cf052810d20814a77ca0e0045a2c1a3508a1f
> I have no idea what you mean by this, sorry.

This is a commit id which introduced the feature:

commit 201cf052810d20814a77ca0e0045a2c1a3508a1f
Author: Laxman Dewangan <ldewangan@nvidia.com>
Date:   Wed Apr 18 12:13:51 2012 +0200

    mfd: Add support for tps65910 device sleep

    Adding support for device sleep through the external input control
    signal "SLEEP".
    Changing the SLEEP signal state can switch the device into SLEEP and
    ACTIVE state.
    Also adding sleep configuration for different resources so that they
    should be keep on during sleep state of device.

    Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
    Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

Best Regards,
Michał Mirosław

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] regulator: tps65910: wire up sleep control configuration
@ 2017-06-14 17:15       ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2017-06-14 17:15 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: linux-kernel, devicetree, linux-omap, Tony Lindgren,
	Liam Girdwood, Keerthy, Rob Herring, Mark Rutland

[-- Attachment #1: Type: text/plain, Size: 880 bytes --]

On Wed, Jun 14, 2017 at 05:13:29PM +0200, Michał Mirosław wrote:
> On Wed, Jun 14, 2017 at 03:42:08PM +0100, Mark Brown wrote:
> > On Wed, Jun 14, 2017 at 02:25:13PM +0200, Michał Mirosław wrote:
> > > References: 201cf052810d20814a77ca0e0045a2c1a3508a1f

> > I have no idea what you mean by this, sorry.

> This is a commit id which introduced the feature:

Please include human readable descriptions of things like commits and
issues being discussed in e-mail in your mails, this makes them much
easier for humans to read especially when they have no internet access.
I do frequently catch up on my mail on flights or while otherwise
travelling so this is even more pressing for me than just being about
making things a bit easier to read.

I also still don't entirely know what you're trying to tell me with
this...  as far as I can tell it's just noise?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] regulator: tps65910: wire up sleep control configuration
@ 2017-06-14 17:15       ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2017-06-14 17:15 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Tony Lindgren, Liam Girdwood,
	Keerthy, Rob Herring, Mark Rutland

[-- Attachment #1: Type: text/plain, Size: 880 bytes --]

On Wed, Jun 14, 2017 at 05:13:29PM +0200, Michał Mirosław wrote:
> On Wed, Jun 14, 2017 at 03:42:08PM +0100, Mark Brown wrote:
> > On Wed, Jun 14, 2017 at 02:25:13PM +0200, Michał Mirosław wrote:
> > > References: 201cf052810d20814a77ca0e0045a2c1a3508a1f

> > I have no idea what you mean by this, sorry.

> This is a commit id which introduced the feature:

Please include human readable descriptions of things like commits and
issues being discussed in e-mail in your mails, this makes them much
easier for humans to read especially when they have no internet access.
I do frequently catch up on my mail on flights or while otherwise
travelling so this is even more pressing for me than just being about
making things a bit easier to read.

I also still don't entirely know what you're trying to tell me with
this...  as far as I can tell it's just noise?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] regulator: tps65910: wire up sleep control configuration
@ 2017-06-14 18:54         ` Michał Mirosław
  0 siblings, 0 replies; 9+ messages in thread
From: Michał Mirosław @ 2017-06-14 18:54 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-kernel, devicetree, linux-omap, Tony Lindgren,
	Liam Girdwood, Keerthy, Rob Herring, Mark Rutland

On Wed, Jun 14, 2017 at 06:15:18PM +0100, Mark Brown wrote:
> On Wed, Jun 14, 2017 at 05:13:29PM +0200, Michał Mirosław wrote:
> > On Wed, Jun 14, 2017 at 03:42:08PM +0100, Mark Brown wrote:
> > > On Wed, Jun 14, 2017 at 02:25:13PM +0200, Michał Mirosław wrote:
> > > > References: 201cf052810d20814a77ca0e0045a2c1a3508a1f
> 
> > > I have no idea what you mean by this, sorry.
> 
> > This is a commit id which introduced the feature:
> 
> Please include human readable descriptions of things like commits and
> issues being discussed in e-mail in your mails, this makes them much
> easier for humans to read especially when they have no internet access.
> I do frequently catch up on my mail on flights or while otherwise
> travelling so this is even more pressing for me than just being about
> making things a bit easier to read.
> 
> I also still don't entirely know what you're trying to tell me with
> this...  as far as I can tell it's just noise?

As the patch only modifies device-tree binding, I included reference
to a patch that implements the feature. I guess this is not of much
use to you if you don't have access to the git tree while reviewing.

Since this is rather easy to find in git history, I will just remove the
References line.

Best Regards,
Michał Mirosław

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] regulator: tps65910: wire up sleep control configuration
@ 2017-06-14 18:54         ` Michał Mirosław
  0 siblings, 0 replies; 9+ messages in thread
From: Michał Mirosław @ 2017-06-14 18:54 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Tony Lindgren, Liam Girdwood,
	Keerthy, Rob Herring, Mark Rutland

On Wed, Jun 14, 2017 at 06:15:18PM +0100, Mark Brown wrote:
> On Wed, Jun 14, 2017 at 05:13:29PM +0200, Michał Mirosław wrote:
> > On Wed, Jun 14, 2017 at 03:42:08PM +0100, Mark Brown wrote:
> > > On Wed, Jun 14, 2017 at 02:25:13PM +0200, Michał Mirosław wrote:
> > > > References: 201cf052810d20814a77ca0e0045a2c1a3508a1f
> 
> > > I have no idea what you mean by this, sorry.
> 
> > This is a commit id which introduced the feature:
> 
> Please include human readable descriptions of things like commits and
> issues being discussed in e-mail in your mails, this makes them much
> easier for humans to read especially when they have no internet access.
> I do frequently catch up on my mail on flights or while otherwise
> travelling so this is even more pressing for me than just being about
> making things a bit easier to read.
> 
> I also still don't entirely know what you're trying to tell me with
> this...  as far as I can tell it's just noise?

As the patch only modifies device-tree binding, I included reference
to a patch that implements the feature. I guess this is not of much
use to you if you don't have access to the git tree while reviewing.

Since this is rather easy to find in git history, I will just remove the
References line.

Best Regards,
Michał Mirosław
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Applied "regulator: tps65910: wire up sleep control configuration" to the regulator tree
  2017-06-14 12:25 [PATCH] regulator: tps65910: wire up sleep control configuration Michał Mirosław
  2017-06-14 14:42   ` Mark Brown
@ 2017-06-15 17:23 ` Mark Brown
  1 sibling, 0 replies; 9+ messages in thread
From: Mark Brown @ 2017-06-15 17:23 UTC (permalink / raw)
  Cc: Mark Brown, linux-kernel, devicetree, linux-omap

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 5188 bytes --]

The patch

   regulator: tps65910: wire up sleep control configuration

has been applied to the regulator tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From a9bc67de0c5713a8675bfe33bfe9cb36c7934589 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= <mirq-linux@rere.qmqm.pl>
Date: Wed, 14 Jun 2017 21:04:14 +0200
Subject: [PATCH] regulator: tps65910: wire up sleep control configuration
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This enables configuring the PMIC's sleep mode via device-tree.

A pointer indirection to sleep mode data is removed, as it simplifies
the implementation slightly. In current kernel tree, platform data
structure is not used outside MFD cell drivers.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 Documentation/devicetree/bindings/mfd/tps65910.txt |  4 ++++
 drivers/mfd/tps65910.c                             | 22 +++++++++++++++-------
 include/linux/mfd/tps65910.h                       |  2 +-
 3 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/Documentation/devicetree/bindings/mfd/tps65910.txt b/Documentation/devicetree/bindings/mfd/tps65910.txt
index 38833e63a59f..8af1202b381d 100644
--- a/Documentation/devicetree/bindings/mfd/tps65910.txt
+++ b/Documentation/devicetree/bindings/mfd/tps65910.txt
@@ -61,6 +61,10 @@ Optional properties:
   There should be 9 entries here, one for each gpio.
 - ti,system-power-controller: Telling whether or not this pmic is controlling
   the system power.
+- ti,sleep-enable: Enable SLEEP state.
+- ti,sleep-keep-therm: Keep thermal monitoring on in sleep state.
+- ti,sleep-keep-ck32k: Keep the 32KHz clock output on in sleep state.
+- ti,sleep-keep-hsclk: Keep high speed internal clock on in sleep state.
 
 Regulator Optional properties:
 - ti,regulator-ext-sleep-control: enable external sleep
diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index 11cab1582f2f..8263605f6d2f 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -328,11 +328,7 @@ static int tps65910_sleepinit(struct tps65910 *tps65910,
 		goto err_sleep_init;
 	}
 
-	/* Return if there is no sleep keepon data. */
-	if (!pmic_pdata->slp_keepon)
-		return 0;
-
-	if (pmic_pdata->slp_keepon->therm_keepon) {
+	if (pmic_pdata->slp_keepon.therm_keepon) {
 		ret = tps65910_reg_set_bits(tps65910,
 				TPS65910_SLEEP_KEEP_RES_ON,
 				SLEEP_KEEP_RES_ON_THERM_KEEPON_MASK);
@@ -342,7 +338,7 @@ static int tps65910_sleepinit(struct tps65910 *tps65910,
 		}
 	}
 
-	if (pmic_pdata->slp_keepon->clkout32k_keepon) {
+	if (pmic_pdata->slp_keepon.clkout32k_keepon) {
 		ret = tps65910_reg_set_bits(tps65910,
 				TPS65910_SLEEP_KEEP_RES_ON,
 				SLEEP_KEEP_RES_ON_CLKOUT32K_KEEPON_MASK);
@@ -352,7 +348,7 @@ static int tps65910_sleepinit(struct tps65910 *tps65910,
 		}
 	}
 
-	if (pmic_pdata->slp_keepon->i2chs_keepon) {
+	if (pmic_pdata->slp_keepon.i2chs_keepon) {
 		ret = tps65910_reg_set_bits(tps65910,
 				TPS65910_SLEEP_KEEP_RES_ON,
 				SLEEP_KEEP_RES_ON_I2CHS_KEEPON_MASK);
@@ -415,6 +411,18 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
 	prop = of_property_read_bool(np, "ti,en-ck32k-xtal");
 	board_info->en_ck32k_xtal = prop;
 
+	prop = of_property_read_bool(np, "ti,sleep-enable");
+	board_info->en_dev_slp = prop;
+
+	prop = of_property_read_bool(np, "ti,sleep-keep-therm");
+	board_info->slp_keepon.therm_keepon = prop;
+
+	prop = of_property_read_bool(np, "ti,sleep-keep-ck32k");
+	board_info->slp_keepon.clkout32k_keepon = prop;
+
+	prop = of_property_read_bool(np, "ti,sleep-keep-hsclk");
+	board_info->slp_keepon.i2chs_keepon = prop;
+
 	board_info->irq = client->irq;
 	board_info->irq_base = -1;
 	board_info->pm_off = of_property_read_bool(np,
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h
index ffb21e79204d..deffdcd0236f 100644
--- a/include/linux/mfd/tps65910.h
+++ b/include/linux/mfd/tps65910.h
@@ -879,7 +879,7 @@ struct tps65910_board {
 	bool en_ck32k_xtal;
 	bool en_dev_slp;
 	bool pm_off;
-	struct tps65910_sleep_keepon_data *slp_keepon;
+	struct tps65910_sleep_keepon_data slp_keepon;
 	bool en_gpio_sleep[TPS6591X_MAX_NUM_GPIO];
 	unsigned long regulator_ext_sleep_control[TPS65910_NUM_REGS];
 	struct regulator_init_data *tps65910_pmic_init_data[TPS65910_NUM_REGS];
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-06-15 17:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-14 12:25 [PATCH] regulator: tps65910: wire up sleep control configuration Michał Mirosław
2017-06-14 14:42 ` Mark Brown
2017-06-14 14:42   ` Mark Brown
2017-06-14 15:13   ` Michał Mirosław
2017-06-14 17:15     ` Mark Brown
2017-06-14 17:15       ` Mark Brown
2017-06-14 18:54       ` Michał Mirosław
2017-06-14 18:54         ` Michał Mirosław
2017-06-15 17:23 ` Applied "regulator: tps65910: wire up sleep control configuration" to the regulator tree Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.