All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] mfd: sec-core: Dump PMIC revision to find out the HW
@ 2015-10-02  8:25 Krzysztof Kozlowski
  2015-10-02  8:25 ` [PATCH 2/3] mfd: dt-bindings: Document pulled down WRSTBI pin on S2MPS1X Krzysztof Kozlowski
  2015-10-02  8:25 ` [PATCH 3/3] mfd: sec-core: Disable buck voltage reset on watchdog falling edge Krzysztof Kozlowski
  0 siblings, 2 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2015-10-02  8:25 UTC (permalink / raw)
  To: Sangbeom Kim, Krzysztof Kozlowski, Lee Jones, linux-kernel,
	linux-samsung-soc, devicetree
  Cc: Marek Szyprowski, Bartlomiej Zolnierkiewicz

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>
---
 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] 6+ messages in thread

end of thread, other threads:[~2015-10-05 23:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-02  8:25 [PATCH 1/3] mfd: sec-core: Dump PMIC revision to find out the HW Krzysztof Kozlowski
2015-10-02  8:25 ` [PATCH 2/3] mfd: dt-bindings: Document pulled down WRSTBI pin on S2MPS1X Krzysztof Kozlowski
2015-10-02  8:25 ` [PATCH 3/3] mfd: sec-core: Disable buck voltage reset on watchdog falling edge Krzysztof Kozlowski
     [not found]   ` <1443774351-28766-3-git-send-email-k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2015-10-05 13:35     ` Bartlomiej Zolnierkiewicz
2015-10-05 13:35       ` Bartlomiej Zolnierkiewicz
2015-10-05 23:49       ` Krzysztof Kozlowski

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.