Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1241109 > unrolled thread

[PATCH v2 1/3] mfd: sec-core: Dump PMIC revision to find out the HW

Started byKrzysztof Kozlowski <k.kozlowski@samsung.com>
First post2015-10-07 02:50 +0200
Last post2015-10-13 11:10 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2 1/3] mfd: sec-core: Dump PMIC revision to find out the HW Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2015-10-07 02:50 +0200
    Re: [PATCH v2 1/3] mfd: sec-core: Dump PMIC revision to find out the  HW Lee Jones <lee.jones@linaro.org> - 2015-10-13 10:50 +0200
    Re: [PATCH v2 1/3] mfd: sec-core: Dump PMIC revision to find out the  HW Lee Jones <lee.jones@linaro.org> - 2015-10-13 11:10 +0200

#1241109 — [PATCH v2 1/3] mfd: sec-core: Dump PMIC revision to find out the HW

FromKrzysztof Kozlowski <k.kozlowski@samsung.com>
Date2015-10-07 02:50 +0200
Subject[PATCH v2 1/3] mfd: sec-core: Dump PMIC revision to find out the HW
Message-ID<qgL5D-5Lb-7@gated-at.bofh.it>
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1245473 — Re: [PATCH v2 1/3] mfd: sec-core: Dump PMIC revision to find out the HW

FromLee Jones <lee.jones@linaro.org>
Date2015-10-13 10:50 +0200
SubjectRe: [PATCH v2 1/3] mfd: sec-core: Dump PMIC revision to find out the HW
Message-ID<qj3rs-1kt-15@gated-at.bofh.it>
In reply to#1241109
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1245482 — Re: [PATCH v2 1/3] mfd: sec-core: Dump PMIC revision to find out the HW

FromLee Jones <lee.jones@linaro.org>
Date2015-10-13 11:10 +0200
SubjectRe: [PATCH v2 1/3] mfd: sec-core: Dump PMIC revision to find out the HW
Message-ID<qj3KO-1Wm-11@gated-at.bofh.it>
In reply to#1241109
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web