Skip to content

Commit

Permalink
mfd: sec-core: Dump PMIC revision to find out the HW
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
  • Loading branch information
Krzysztof Kozlowski authored and Lee Jones committed Oct 30, 2015
1 parent 2e44e28 commit c2c9f1f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/mfd/sec-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit c2c9f1f

Please sign in to comment.