From: Krzysztof Kozlowski Date: Wed, 7 Oct 2015 00:44:39 +0000 (+0900) Subject: mfd: sec-core: Dump PMIC revision to find out the HW X-Git-Tag: firefly_0821_release~176^2~772^2~12 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c2c9f1fe4bf2d6597bbaaab7514d9c9092b5b2f6;p=firefly-linux-kernel-4.4.55.git mfd: sec-core: Dump PMIC revision to find out the HW 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 Signed-off-by: Lee Jones --- 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;