linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/3] mfd: sec-core: Dump PMIC revision to find out the HW
@ 2015-10-07  0:44 Krzysztof Kozlowski
  2015-10-07  0:44 ` [PATCH v2 2/3] mfd: dt-bindings: Document pulled down WRSTBI pin on S2MPS1X Krzysztof Kozlowski
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2015-10-07  0:44 UTC (permalink / raw)
  To: Sangbeom Kim, Krzysztof Kozlowski, Lee Jones, linux-kernel,
	linux-samsung-soc, devicetree
  Cc: Bartlomiej Zolnierkiewicz, Marek Szyprowski, Chanwoo Choi, Inki Dae

There are different revisions of the same chipset. For example S2MPS13 has
more than 2 revisions. They differ slightly in regulator constraints.
Print the revision number to easily find which PMIC is used on the board.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

---

Changs since v1:
None.
---
 drivers/mfd/sec-core.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index 2d1137a7a0ee..589e5efc2d7f 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -253,6 +253,15 @@ static const struct regmap_config s5m8767_regmap_config = {
 	.cache_type = REGCACHE_FLAT,
 };
 
+static void sec_pmic_dump_rev(struct sec_pmic_dev *sec_pmic)
+{
+	unsigned int val;
+
+	/* For each device type, the REG_ID is always the first register */
+	if (!regmap_read(sec_pmic->regmap_pmic, S2MPS11_REG_ID, &val))
+		dev_dbg(sec_pmic->dev, "Revision: 0x%x\n", val);
+}
+
 #ifdef CONFIG_OF
 /*
  * Only the common platform data elements for s5m8767 are parsed here from the
@@ -425,6 +434,7 @@ static int sec_pmic_probe(struct i2c_client *i2c,
 		goto err_mfd;
 
 	device_init_wakeup(sec_pmic->dev, sec_pmic->wakeup);
+	sec_pmic_dump_rev(sec_pmic);
 
 	return ret;
 
-- 
1.9.1


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

* [PATCH v2 2/3] mfd: dt-bindings: Document pulled down WRSTBI pin on S2MPS1X
  2015-10-07  0:44 [PATCH v2 1/3] mfd: sec-core: Dump PMIC revision to find out the HW Krzysztof Kozlowski
@ 2015-10-07  0:44 ` Krzysztof Kozlowski
  2015-10-13  9:04   ` Lee Jones
  2015-10-07  0:44 ` [PATCH v2 3/3] mfd: sec-core: Disable buck voltage reset on watchdog falling edge Krzysztof Kozlowski
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Krzysztof Kozlowski @ 2015-10-07  0:44 UTC (permalink / raw)
  To: Sangbeom Kim, Krzysztof Kozlowski, Lee Jones, linux-kernel,
	linux-samsung-soc, devicetree
  Cc: Bartlomiej Zolnierkiewicz, Marek Szyprowski, Chanwoo Choi, Inki Dae

Document a new Device Tree property 'samsung,s2mps11-wrstbi-ground'
indicating that WRSTBI pin of S2MPS13 PMIC is pulled down so
corresponding buck warm reset function should be disabled.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

---

Changs since v1:
None.
---
 Documentation/devicetree/bindings/mfd/s2mps11.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/s2mps11.txt b/Documentation/devicetree/bindings/mfd/s2mps11.txt
index 90eaef393325..890f0b0e1643 100644
--- a/Documentation/devicetree/bindings/mfd/s2mps11.txt
+++ b/Documentation/devicetree/bindings/mfd/s2mps11.txt
@@ -19,6 +19,9 @@ Optional properties:
   connected to the ground so the PMIC must manually set PWRHOLD bit in CTRL1
   register to turn off the power. Usually the ACOKB is pulled up to VBATT so
   when PWRHOLD pin goes low, the rising ACOKB will trigger power off.
+- samsung,s2mps11-wrstbi-ground: Indicates that WRSTBI pin of PMIC is pulled
+  down. When the system is suspended it will always go down thus triggerring
+  unwanted buck warm reset (setting buck voltages to default values).
 
 Optional nodes:
 - clocks: s2mps11, s2mps13 and s5m8767 provide three(AP/CP/BT) buffered 32.768
-- 
1.9.1


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

* [PATCH v2 3/3] mfd: sec-core: Disable buck voltage reset on watchdog falling edge
  2015-10-07  0:44 [PATCH v2 1/3] mfd: sec-core: Dump PMIC revision to find out the HW Krzysztof Kozlowski
  2015-10-07  0:44 ` [PATCH v2 2/3] mfd: dt-bindings: Document pulled down WRSTBI pin on S2MPS1X Krzysztof Kozlowski
@ 2015-10-07  0:44 ` Krzysztof Kozlowski
  2015-10-13  9:03   ` Lee Jones
  2015-10-13  9:04   ` Lee Jones
  2015-10-13  8:47 ` [PATCH v2 1/3] mfd: sec-core: Dump PMIC revision to find out the HW Lee Jones
  2015-10-13  9:04 ` Lee Jones
  3 siblings, 2 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2015-10-07  0:44 UTC (permalink / raw)
  To: Sangbeom Kim, Krzysztof Kozlowski, Lee Jones, linux-kernel,
	linux-samsung-soc, devicetree
  Cc: Bartlomiej Zolnierkiewicz, Marek Szyprowski, Chanwoo Choi, Inki Dae

The WRSTBI bit (disabled by default but enabled by bootloader), when
set, is responsible for resetting voltages to default values of
certain bucks on falling edge of Warm Reset Input pin from AP.

However on some boards (with S2MPS13) the pin is pulled down so any
suspend will effectively trigger the reset of bucks supplying the power
to the little and big cores. In the same time when resuming, these bucks
must provide voltage greater or equal to voltage before suspend to match
the frequency chosen by cpufreq. If voltage (default value of voltage
after reset) is lower than one set by cpufreq before suspend, then
system will hang during resuming.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reported-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Tested-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

---

Changs since v1:
1. Add Bartlomiej's Reported-by and Tested-by.
---
 drivers/mfd/sec-core.c              | 26 ++++++++++++++++++++++++++
 include/linux/mfd/samsung/core.h    |  2 ++
 include/linux/mfd/samsung/s2mps13.h |  1 +
 3 files changed, 29 insertions(+)

diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index 589e5efc2d7f..2626fc0b5b8c 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -262,6 +262,29 @@ static void sec_pmic_dump_rev(struct sec_pmic_dev *sec_pmic)
 		dev_dbg(sec_pmic->dev, "Revision: 0x%x\n", val);
 }
 
+static void sec_pmic_configure(struct sec_pmic_dev *sec_pmic)
+{
+	int err;
+
+	if (sec_pmic->device_type != S2MPS13X)
+		return;
+
+	if (sec_pmic->pdata->disable_wrstbi) {
+		/*
+		 * If WRSTBI pin is pulled down this feature must be disabled
+		 * because each Suspend to RAM will trigger buck voltage reset
+		 * to default values.
+		 */
+		err = regmap_update_bits(sec_pmic->regmap_pmic,
+					 S2MPS13_REG_WRSTBI,
+					 S2MPS13_REG_WRSTBI_MASK, 0x0);
+		if (err)
+			dev_warn(sec_pmic->dev,
+				 "Cannot initialize WRSTBI config: %d\n",
+				 err);
+	}
+}
+
 #ifdef CONFIG_OF
 /*
  * Only the common platform data elements for s5m8767 are parsed here from the
@@ -289,6 +312,8 @@ static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata(
 
 	pd->manual_poweroff = of_property_read_bool(dev->of_node,
 						"samsung,s2mps11-acokb-ground");
+	pd->disable_wrstbi = of_property_read_bool(dev->of_node,
+						"samsung,s2mps11-wrstbi-ground");
 	return pd;
 }
 #else
@@ -434,6 +459,7 @@ static int sec_pmic_probe(struct i2c_client *i2c,
 		goto err_mfd;
 
 	device_init_wakeup(sec_pmic->dev, sec_pmic->wakeup);
+	sec_pmic_configure(sec_pmic);
 	sec_pmic_dump_rev(sec_pmic);
 
 	return ret;
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h
index aa78957e092f..a06098639399 100644
--- a/include/linux/mfd/samsung/core.h
+++ b/include/linux/mfd/samsung/core.h
@@ -134,6 +134,8 @@ struct sec_platform_data {
 	int				buck4_init;
 	/* Whether or not manually set PWRHOLD to low during shutdown. */
 	bool				manual_poweroff;
+	/* Disable the WRSTBI (buck voltage warm reset) when probing? */
+	bool				disable_wrstbi;
 };
 
 /**
diff --git a/include/linux/mfd/samsung/s2mps13.h b/include/linux/mfd/samsung/s2mps13.h
index b1fd675fa36f..239e977ba45d 100644
--- a/include/linux/mfd/samsung/s2mps13.h
+++ b/include/linux/mfd/samsung/s2mps13.h
@@ -184,5 +184,6 @@ enum s2mps13_regulators {
  * Let's assume that default value will be set.
  */
 #define S2MPS13_BUCK_RAMP_DELAY		12500
+#define S2MPS13_REG_WRSTBI_MASK		BIT(5)
 
 #endif /*  __LINUX_MFD_S2MPS13_H */
-- 
1.9.1


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

* Re: [PATCH v2 1/3] mfd: sec-core: Dump PMIC revision to find out the HW
  2015-10-07  0:44 [PATCH v2 1/3] mfd: sec-core: Dump PMIC revision to find out the HW Krzysztof Kozlowski
  2015-10-07  0:44 ` [PATCH v2 2/3] mfd: dt-bindings: Document pulled down WRSTBI pin on S2MPS1X Krzysztof Kozlowski
  2015-10-07  0:44 ` [PATCH v2 3/3] mfd: sec-core: Disable buck voltage reset on watchdog falling edge Krzysztof Kozlowski
@ 2015-10-13  8:47 ` Lee Jones
  2015-10-13  9:04 ` Lee Jones
  3 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2015-10-13  8:47 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Sangbeom Kim, linux-kernel, linux-samsung-soc, devicetree,
	Bartlomiej Zolnierkiewicz, Marek Szyprowski, Chanwoo Choi,
	Inki Dae

On Wed, 07 Oct 2015, Krzysztof Kozlowski wrote:

> There are different revisions of the same chipset. For example S2MPS13 has
> more than 2 revisions. They differ slightly in regulator constraints.
> Print the revision number to easily find which PMIC is used on the board.
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> 
> ---
> 
> Changs since v1:
> None.
> ---
>  drivers/mfd/sec-core.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)

For my own reference:
  Acked-by: Lee Jones <lee.jones@linaro.org>

> diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
> index 2d1137a7a0ee..589e5efc2d7f 100644
> --- a/drivers/mfd/sec-core.c
> +++ b/drivers/mfd/sec-core.c
> @@ -253,6 +253,15 @@ static const struct regmap_config s5m8767_regmap_config = {
>  	.cache_type = REGCACHE_FLAT,
>  };
>  
> +static void sec_pmic_dump_rev(struct sec_pmic_dev *sec_pmic)
> +{
> +	unsigned int val;
> +
> +	/* For each device type, the REG_ID is always the first register */
> +	if (!regmap_read(sec_pmic->regmap_pmic, S2MPS11_REG_ID, &val))
> +		dev_dbg(sec_pmic->dev, "Revision: 0x%x\n", val);
> +}
> +
>  #ifdef CONFIG_OF
>  /*
>   * Only the common platform data elements for s5m8767 are parsed here from the
> @@ -425,6 +434,7 @@ static int sec_pmic_probe(struct i2c_client *i2c,
>  		goto err_mfd;
>  
>  	device_init_wakeup(sec_pmic->dev, sec_pmic->wakeup);
> +	sec_pmic_dump_rev(sec_pmic);
>  
>  	return ret;
>  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH v2 3/3] mfd: sec-core: Disable buck voltage reset on watchdog falling edge
  2015-10-07  0:44 ` [PATCH v2 3/3] mfd: sec-core: Disable buck voltage reset on watchdog falling edge Krzysztof Kozlowski
@ 2015-10-13  9:03   ` Lee Jones
  2015-10-13  9:04   ` Lee Jones
  1 sibling, 0 replies; 8+ messages in thread
From: Lee Jones @ 2015-10-13  9:03 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Sangbeom Kim, linux-kernel, linux-samsung-soc, devicetree,
	Bartlomiej Zolnierkiewicz, Marek Szyprowski, Chanwoo Choi,
	Inki Dae

On Wed, 07 Oct 2015, Krzysztof Kozlowski wrote:

> The WRSTBI bit (disabled by default but enabled by bootloader), when
> set, is responsible for resetting voltages to default values of
> certain bucks on falling edge of Warm Reset Input pin from AP.
> 
> However on some boards (with S2MPS13) the pin is pulled down so any
> suspend will effectively trigger the reset of bucks supplying the power
> to the little and big cores. In the same time when resuming, these bucks
> must provide voltage greater or equal to voltage before suspend to match
> the frequency chosen by cpufreq. If voltage (default value of voltage
> after reset) is lower than one set by cpufreq before suspend, then
> system will hang during resuming.
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Reported-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Tested-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

These should be in chronological order.

I will do that for you this time when I apply the patch.

For my own reference:
  Acked-by: Lee Jones <lee.jones@linaro.org>

> ---
> 
> Changs since v1:
> 1. Add Bartlomiej's Reported-by and Tested-by.
> ---
>  drivers/mfd/sec-core.c              | 26 ++++++++++++++++++++++++++
>  include/linux/mfd/samsung/core.h    |  2 ++
>  include/linux/mfd/samsung/s2mps13.h |  1 +
>  3 files changed, 29 insertions(+)
> 
> diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
> index 589e5efc2d7f..2626fc0b5b8c 100644
> --- a/drivers/mfd/sec-core.c
> +++ b/drivers/mfd/sec-core.c
> @@ -262,6 +262,29 @@ static void sec_pmic_dump_rev(struct sec_pmic_dev *sec_pmic)
>  		dev_dbg(sec_pmic->dev, "Revision: 0x%x\n", val);
>  }
>  
> +static void sec_pmic_configure(struct sec_pmic_dev *sec_pmic)
> +{
> +	int err;
> +
> +	if (sec_pmic->device_type != S2MPS13X)
> +		return;
> +
> +	if (sec_pmic->pdata->disable_wrstbi) {
> +		/*
> +		 * If WRSTBI pin is pulled down this feature must be disabled
> +		 * because each Suspend to RAM will trigger buck voltage reset
> +		 * to default values.
> +		 */
> +		err = regmap_update_bits(sec_pmic->regmap_pmic,
> +					 S2MPS13_REG_WRSTBI,
> +					 S2MPS13_REG_WRSTBI_MASK, 0x0);
> +		if (err)
> +			dev_warn(sec_pmic->dev,
> +				 "Cannot initialize WRSTBI config: %d\n",
> +				 err);
> +	}
> +}
> +
>  #ifdef CONFIG_OF
>  /*
>   * Only the common platform data elements for s5m8767 are parsed here from the
> @@ -289,6 +312,8 @@ static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata(
>  
>  	pd->manual_poweroff = of_property_read_bool(dev->of_node,
>  						"samsung,s2mps11-acokb-ground");
> +	pd->disable_wrstbi = of_property_read_bool(dev->of_node,
> +						"samsung,s2mps11-wrstbi-ground");
>  	return pd;
>  }
>  #else
> @@ -434,6 +459,7 @@ static int sec_pmic_probe(struct i2c_client *i2c,
>  		goto err_mfd;
>  
>  	device_init_wakeup(sec_pmic->dev, sec_pmic->wakeup);
> +	sec_pmic_configure(sec_pmic);
>  	sec_pmic_dump_rev(sec_pmic);
>  
>  	return ret;
> diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h
> index aa78957e092f..a06098639399 100644
> --- a/include/linux/mfd/samsung/core.h
> +++ b/include/linux/mfd/samsung/core.h
> @@ -134,6 +134,8 @@ struct sec_platform_data {
>  	int				buck4_init;
>  	/* Whether or not manually set PWRHOLD to low during shutdown. */
>  	bool				manual_poweroff;
> +	/* Disable the WRSTBI (buck voltage warm reset) when probing? */
> +	bool				disable_wrstbi;
>  };
>  
>  /**
> diff --git a/include/linux/mfd/samsung/s2mps13.h b/include/linux/mfd/samsung/s2mps13.h
> index b1fd675fa36f..239e977ba45d 100644
> --- a/include/linux/mfd/samsung/s2mps13.h
> +++ b/include/linux/mfd/samsung/s2mps13.h
> @@ -184,5 +184,6 @@ enum s2mps13_regulators {
>   * Let's assume that default value will be set.
>   */
>  #define S2MPS13_BUCK_RAMP_DELAY		12500
> +#define S2MPS13_REG_WRSTBI_MASK		BIT(5)
>  
>  #endif /*  __LINUX_MFD_S2MPS13_H */

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH v2 1/3] mfd: sec-core: Dump PMIC revision to find out the HW
  2015-10-07  0:44 [PATCH v2 1/3] mfd: sec-core: Dump PMIC revision to find out the HW Krzysztof Kozlowski
                   ` (2 preceding siblings ...)
  2015-10-13  8:47 ` [PATCH v2 1/3] mfd: sec-core: Dump PMIC revision to find out the HW Lee Jones
@ 2015-10-13  9:04 ` Lee Jones
  3 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2015-10-13  9:04 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Sangbeom Kim, linux-kernel, linux-samsung-soc, devicetree,
	Bartlomiej Zolnierkiewicz, Marek Szyprowski, Chanwoo Choi,
	Inki Dae

On Wed, 07 Oct 2015, Krzysztof Kozlowski wrote:

> There are different revisions of the same chipset. For example S2MPS13 has
> more than 2 revisions. They differ slightly in regulator constraints.
> Print the revision number to easily find which PMIC is used on the board.
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> 
> ---
> 
> Changs since v1:
> None.
> ---
>  drivers/mfd/sec-core.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)

Applied, thanks.

> diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
> index 2d1137a7a0ee..589e5efc2d7f 100644
> --- a/drivers/mfd/sec-core.c
> +++ b/drivers/mfd/sec-core.c
> @@ -253,6 +253,15 @@ static const struct regmap_config s5m8767_regmap_config = {
>  	.cache_type = REGCACHE_FLAT,
>  };
>  
> +static void sec_pmic_dump_rev(struct sec_pmic_dev *sec_pmic)
> +{
> +	unsigned int val;
> +
> +	/* For each device type, the REG_ID is always the first register */
> +	if (!regmap_read(sec_pmic->regmap_pmic, S2MPS11_REG_ID, &val))
> +		dev_dbg(sec_pmic->dev, "Revision: 0x%x\n", val);
> +}
> +
>  #ifdef CONFIG_OF
>  /*
>   * Only the common platform data elements for s5m8767 are parsed here from the
> @@ -425,6 +434,7 @@ static int sec_pmic_probe(struct i2c_client *i2c,
>  		goto err_mfd;
>  
>  	device_init_wakeup(sec_pmic->dev, sec_pmic->wakeup);
> +	sec_pmic_dump_rev(sec_pmic);
>  
>  	return ret;
>  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH v2 2/3] mfd: dt-bindings: Document pulled down WRSTBI pin on S2MPS1X
  2015-10-07  0:44 ` [PATCH v2 2/3] mfd: dt-bindings: Document pulled down WRSTBI pin on S2MPS1X Krzysztof Kozlowski
@ 2015-10-13  9:04   ` Lee Jones
  0 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2015-10-13  9:04 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Sangbeom Kim, linux-kernel, linux-samsung-soc, devicetree,
	Bartlomiej Zolnierkiewicz, Marek Szyprowski, Chanwoo Choi,
	Inki Dae

On Wed, 07 Oct 2015, Krzysztof Kozlowski wrote:

> Document a new Device Tree property 'samsung,s2mps11-wrstbi-ground'
> indicating that WRSTBI pin of S2MPS13 PMIC is pulled down so
> corresponding buck warm reset function should be disabled.
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> 
> ---
> 
> Changs since v1:
> None.
> ---
>  Documentation/devicetree/bindings/mfd/s2mps11.txt | 3 +++
>  1 file changed, 3 insertions(+)

Applied, thanks.

> diff --git a/Documentation/devicetree/bindings/mfd/s2mps11.txt b/Documentation/devicetree/bindings/mfd/s2mps11.txt
> index 90eaef393325..890f0b0e1643 100644
> --- a/Documentation/devicetree/bindings/mfd/s2mps11.txt
> +++ b/Documentation/devicetree/bindings/mfd/s2mps11.txt
> @@ -19,6 +19,9 @@ Optional properties:
>    connected to the ground so the PMIC must manually set PWRHOLD bit in CTRL1
>    register to turn off the power. Usually the ACOKB is pulled up to VBATT so
>    when PWRHOLD pin goes low, the rising ACOKB will trigger power off.
> +- samsung,s2mps11-wrstbi-ground: Indicates that WRSTBI pin of PMIC is pulled
> +  down. When the system is suspended it will always go down thus triggerring
> +  unwanted buck warm reset (setting buck voltages to default values).
>  
>  Optional nodes:
>  - clocks: s2mps11, s2mps13 and s5m8767 provide three(AP/CP/BT) buffered 32.768

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH v2 3/3] mfd: sec-core: Disable buck voltage reset on watchdog falling edge
  2015-10-07  0:44 ` [PATCH v2 3/3] mfd: sec-core: Disable buck voltage reset on watchdog falling edge Krzysztof Kozlowski
  2015-10-13  9:03   ` Lee Jones
@ 2015-10-13  9:04   ` Lee Jones
  1 sibling, 0 replies; 8+ messages in thread
From: Lee Jones @ 2015-10-13  9:04 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Sangbeom Kim, linux-kernel, linux-samsung-soc, devicetree,
	Bartlomiej Zolnierkiewicz, Marek Szyprowski, Chanwoo Choi,
	Inki Dae

On Wed, 07 Oct 2015, Krzysztof Kozlowski wrote:

> The WRSTBI bit (disabled by default but enabled by bootloader), when
> set, is responsible for resetting voltages to default values of
> certain bucks on falling edge of Warm Reset Input pin from AP.
> 
> However on some boards (with S2MPS13) the pin is pulled down so any
> suspend will effectively trigger the reset of bucks supplying the power
> to the little and big cores. In the same time when resuming, these bucks
> must provide voltage greater or equal to voltage before suspend to match
> the frequency chosen by cpufreq. If voltage (default value of voltage
> after reset) is lower than one set by cpufreq before suspend, then
> system will hang during resuming.
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Reported-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Tested-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

Applied, thanks.

> ---
> 
> Changs since v1:
> 1. Add Bartlomiej's Reported-by and Tested-by.
> ---
>  drivers/mfd/sec-core.c              | 26 ++++++++++++++++++++++++++
>  include/linux/mfd/samsung/core.h    |  2 ++
>  include/linux/mfd/samsung/s2mps13.h |  1 +
>  3 files changed, 29 insertions(+)
> 
> diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
> index 589e5efc2d7f..2626fc0b5b8c 100644
> --- a/drivers/mfd/sec-core.c
> +++ b/drivers/mfd/sec-core.c
> @@ -262,6 +262,29 @@ static void sec_pmic_dump_rev(struct sec_pmic_dev *sec_pmic)
>  		dev_dbg(sec_pmic->dev, "Revision: 0x%x\n", val);
>  }
>  
> +static void sec_pmic_configure(struct sec_pmic_dev *sec_pmic)
> +{
> +	int err;
> +
> +	if (sec_pmic->device_type != S2MPS13X)
> +		return;
> +
> +	if (sec_pmic->pdata->disable_wrstbi) {
> +		/*
> +		 * If WRSTBI pin is pulled down this feature must be disabled
> +		 * because each Suspend to RAM will trigger buck voltage reset
> +		 * to default values.
> +		 */
> +		err = regmap_update_bits(sec_pmic->regmap_pmic,
> +					 S2MPS13_REG_WRSTBI,
> +					 S2MPS13_REG_WRSTBI_MASK, 0x0);
> +		if (err)
> +			dev_warn(sec_pmic->dev,
> +				 "Cannot initialize WRSTBI config: %d\n",
> +				 err);
> +	}
> +}
> +
>  #ifdef CONFIG_OF
>  /*
>   * Only the common platform data elements for s5m8767 are parsed here from the
> @@ -289,6 +312,8 @@ static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata(
>  
>  	pd->manual_poweroff = of_property_read_bool(dev->of_node,
>  						"samsung,s2mps11-acokb-ground");
> +	pd->disable_wrstbi = of_property_read_bool(dev->of_node,
> +						"samsung,s2mps11-wrstbi-ground");
>  	return pd;
>  }
>  #else
> @@ -434,6 +459,7 @@ static int sec_pmic_probe(struct i2c_client *i2c,
>  		goto err_mfd;
>  
>  	device_init_wakeup(sec_pmic->dev, sec_pmic->wakeup);
> +	sec_pmic_configure(sec_pmic);
>  	sec_pmic_dump_rev(sec_pmic);
>  
>  	return ret;
> diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h
> index aa78957e092f..a06098639399 100644
> --- a/include/linux/mfd/samsung/core.h
> +++ b/include/linux/mfd/samsung/core.h
> @@ -134,6 +134,8 @@ struct sec_platform_data {
>  	int				buck4_init;
>  	/* Whether or not manually set PWRHOLD to low during shutdown. */
>  	bool				manual_poweroff;
> +	/* Disable the WRSTBI (buck voltage warm reset) when probing? */
> +	bool				disable_wrstbi;
>  };
>  
>  /**
> diff --git a/include/linux/mfd/samsung/s2mps13.h b/include/linux/mfd/samsung/s2mps13.h
> index b1fd675fa36f..239e977ba45d 100644
> --- a/include/linux/mfd/samsung/s2mps13.h
> +++ b/include/linux/mfd/samsung/s2mps13.h
> @@ -184,5 +184,6 @@ enum s2mps13_regulators {
>   * Let's assume that default value will be set.
>   */
>  #define S2MPS13_BUCK_RAMP_DELAY		12500
> +#define S2MPS13_REG_WRSTBI_MASK		BIT(5)
>  
>  #endif /*  __LINUX_MFD_S2MPS13_H */

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2015-10-13  9:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-07  0:44 [PATCH v2 1/3] mfd: sec-core: Dump PMIC revision to find out the HW Krzysztof Kozlowski
2015-10-07  0:44 ` [PATCH v2 2/3] mfd: dt-bindings: Document pulled down WRSTBI pin on S2MPS1X Krzysztof Kozlowski
2015-10-13  9:04   ` Lee Jones
2015-10-07  0:44 ` [PATCH v2 3/3] mfd: sec-core: Disable buck voltage reset on watchdog falling edge Krzysztof Kozlowski
2015-10-13  9:03   ` Lee Jones
2015-10-13  9:04   ` Lee Jones
2015-10-13  8:47 ` [PATCH v2 1/3] mfd: sec-core: Dump PMIC revision to find out the HW Lee Jones
2015-10-13  9:04 ` Lee Jones

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).