From: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
To: matti.vaittinen@fi.rohmeurope.com, mazziesaccount@gmail.com
Cc: lee.jones@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com,
lgirdwood@gmail.com, broonie@kernel.org,
gregkh@linuxfoundation.org, rafael@kernel.org,
mturquette@baylibre.com, sboyd@kernel.org,
linus.walleij@linaro.org, bgolaszewski@baylibre.com,
sre@kernel.org, a.zummo@towertech.it,
alexandre.belloni@bootlin.com, wim@linux-watchdog.org,
linux@roeck-us.net, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
linux-gpio@vger.kernel.org, linux-pm@vger.kernel.org,
linux-rtc@vger.kernel.org, linux-watchdog@vger.kernel.org,
mikko.mutanen@fi.rohmeurope.com,
heikki.haikola@fi.rohmeurope.com
Subject: [RFC PATCH v1 03/13] regulator: bd718x7 use chip specific and generic data structs
Date: Tue, 22 Jan 2019 11:43:28 +0200 [thread overview]
Message-ID: <3fb3eab3a8a2767404588d0a0a531273fddfc659.1548149337.git.matti.vaittinen@fi.rohmeurope.com> (raw)
In-Reply-To: <cover.1548149337.git.matti.vaittinen@fi.rohmeurope.com>
Header rohm-bd718x7.h was split to generic and component specific
parts. This changed the struct bd718x7. Adapt the regulator driver to
these changes.
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
---
drivers/regulator/bd718x7-regulator.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/regulator/bd718x7-regulator.c b/drivers/regulator/bd718x7-regulator.c
index b8dcdc21dc22..dc56ca06ace2 100644
--- a/drivers/regulator/bd718x7-regulator.c
+++ b/drivers/regulator/bd718x7-regulator.c
@@ -1018,11 +1018,11 @@ static int bd718xx_probe(struct platform_device *pdev)
struct bd718xx *mfd;
struct regulator_config config = { 0 };
struct bd718xx_pmic_inits pmic_regulators[] = {
- [BD718XX_TYPE_BD71837] = {
+ [ROHM_CHIP_TYPE_BD71837] = {
.r_datas = bd71837_regulators,
.r_amount = ARRAY_SIZE(bd71837_regulators),
},
- [BD718XX_TYPE_BD71847] = {
+ [ROHM_CHIP_TYPE_BD71847] = {
.r_datas = bd71847_regulators,
.r_amount = ARRAY_SIZE(bd71847_regulators),
},
@@ -1037,15 +1037,15 @@ static int bd718xx_probe(struct platform_device *pdev)
goto err;
}
- if (mfd->chip_type >= BD718XX_TYPE_AMOUNT ||
- !pmic_regulators[mfd->chip_type].r_datas) {
+ if (mfd->chip.chip_type >= ROHM_CHIP_TYPE_AMOUNT ||
+ !pmic_regulators[mfd->chip.chip_type].r_datas) {
dev_err(&pdev->dev, "Unsupported chip type\n");
err = -EINVAL;
goto err;
}
/* Register LOCK release */
- err = regmap_update_bits(mfd->regmap, BD718XX_REG_REGLOCK,
+ err = regmap_update_bits(mfd->chip.regmap, BD718XX_REG_REGLOCK,
(REGLOCK_PWRSEQ | REGLOCK_VREG), 0);
if (err) {
dev_err(&pdev->dev, "Failed to unlock PMIC (%d)\n", err);
@@ -1065,7 +1065,7 @@ static int bd718xx_probe(struct platform_device *pdev)
* for all reset types because OTP loading at READY will clear SEL
* bit allowing HW defaults for power rails to be used
*/
- err = regmap_update_bits(mfd->regmap, BD718XX_REG_TRANS_COND1,
+ err = regmap_update_bits(mfd->chip.regmap, BD718XX_REG_TRANS_COND1,
BD718XX_ON_REQ_POWEROFF_MASK |
BD718XX_SWRESET_POWEROFF_MASK |
BD718XX_WDOG_POWEROFF_MASK |
@@ -1078,17 +1078,17 @@ static int bd718xx_probe(struct platform_device *pdev)
dev_dbg(&pdev->dev, "Changed all resets from SVNS to READY\n");
}
- for (i = 0; i < pmic_regulators[mfd->chip_type].r_amount; i++) {
+ for (i = 0; i < pmic_regulators[mfd->chip.chip_type].r_amount; i++) {
const struct regulator_desc *desc;
struct regulator_dev *rdev;
const struct bd718xx_regulator_data *r;
- r = &pmic_regulators[mfd->chip_type].r_datas[i];
+ r = &pmic_regulators[mfd->chip.chip_type].r_datas[i];
desc = &r->desc;
config.dev = pdev->dev.parent;
- config.regmap = mfd->regmap;
+ config.regmap = mfd->chip.regmap;
rdev = devm_regulator_register(&pdev->dev, desc, &config);
if (IS_ERR(rdev)) {
@@ -1104,7 +1104,7 @@ static int bd718xx_probe(struct platform_device *pdev)
* can now switch the control from PMIC state machine to the
* register interface
*/
- err = regmap_update_bits(mfd->regmap, r->init.reg,
+ err = regmap_update_bits(mfd->chip.regmap, r->init.reg,
r->init.mask, r->init.val);
if (err) {
dev_err(&pdev->dev,
@@ -1113,7 +1113,7 @@ static int bd718xx_probe(struct platform_device *pdev)
goto err;
}
for (j = 0; j < r->additional_init_amnt; j++) {
- err = regmap_update_bits(mfd->regmap,
+ err = regmap_update_bits(mfd->chip.regmap,
r->additional_inits[j].reg,
r->additional_inits[j].mask,
r->additional_inits[j].val);
--
2.14.3
--
Matti Vaittinen
ROHM Semiconductors
~~~ "I don't think so," said Rene Descartes. Just then, he vanished ~~~
next prev parent reply other threads:[~2019-01-22 9:43 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-22 9:41 [RFC PATCH v1 00/13] support ROHM BD70528 PMIC Matti Vaittinen
2019-01-22 9:42 ` [RFC PATCH v1 01/13] regmap: regmap-irq: Add main status register support Matti Vaittinen
2019-01-23 15:55 ` Mark Brown
2019-01-22 9:42 ` [RFC PATCH v1 02/13] mfd: bd718x7.h split to ROHM common and bd718x7 specific parts Matti Vaittinen
2019-01-22 9:43 ` Matti Vaittinen [this message]
2019-01-23 15:51 ` [RFC PATCH v1 03/13] regulator: bd718x7 use chip specific and generic data structs Mark Brown
2019-01-24 7:16 ` Matti Vaittinen
2019-01-24 10:24 ` Mark Brown
2019-01-22 9:44 ` [RFC PATCH v1 04/13] clk: bd718x7: " Matti Vaittinen
2019-01-22 9:44 ` [RFC PATCH v1 05/13] mfd: bd70528: Support ROHM bd70528 PMIC - core Matti Vaittinen
2019-01-22 14:51 ` Guenter Roeck
2019-01-22 16:20 ` Matti Vaittinen
2019-01-22 9:45 ` [RFC PATCH v1 06/13] clk: bd718x7: Support ROHM BD70528 clk block Matti Vaittinen
2019-01-22 9:45 ` [RFC PATCH v1 07/13] devicetree: bindings: Document first ROHM BD70528 bindings Matti Vaittinen
2019-02-23 0:30 ` Rob Herring
2019-02-28 6:49 ` Matti Vaittinen
2019-02-28 15:37 ` Rob Herring
2019-01-22 9:46 ` [RFC PATCH v1 08/13] regulator: bd70528: Support ROHM BD70528 regulator block Matti Vaittinen
2019-01-22 9:46 ` [RFC PATCH v1 09/13] devicetree: bindings: ROHM bd70528 regulator bindings Matti Vaittinen
2019-01-22 9:47 ` [RFC PATCH v1 10/13] gpio: Initial support for ROHM bd70528 GPIO block Matti Vaittinen
2019-01-22 9:47 ` [RFC PATCH v1 11/13] rtc: bd70528: Initial support for ROHM bd70528 RTC Matti Vaittinen
2019-01-22 14:48 ` Guenter Roeck
2019-01-22 16:29 ` Matti Vaittinen
2019-01-22 9:48 ` [RFC PATCH v1 12/13] power: supply: Initial support for ROHM BD70528 PMIC charger block Matti Vaittinen
2019-01-22 9:48 ` [RFC PATCH v1 13/13] watchdog: bd70528: Initial support for ROHM BD70528 watchdog block Matti Vaittinen
2019-01-22 15:47 ` Guenter Roeck
2019-01-22 17:10 ` Matti Vaittinen
2019-01-22 17:40 ` Guenter Roeck
2019-01-22 18:03 ` Matti Vaittinen
2019-01-23 17:47 ` Sebastian Reichel
2019-01-24 10:44 ` Matti Vaittinen
2019-01-24 14:37 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3fb3eab3a8a2767404588d0a0a531273fddfc659.1548149337.git.matti.vaittinen@fi.rohmeurope.com \
--to=matti.vaittinen@fi.rohmeurope.com \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@bootlin.com \
--cc=bgolaszewski@baylibre.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.haikola@fi.rohmeurope.com \
--cc=lee.jones@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=mark.rutland@arm.com \
--cc=mazziesaccount@gmail.com \
--cc=mikko.mutanen@fi.rohmeurope.com \
--cc=mturquette@baylibre.com \
--cc=rafael@kernel.org \
--cc=robh+dt@kernel.org \
--cc=sboyd@kernel.org \
--cc=sre@kernel.org \
--cc=wim@linux-watchdog.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).