diff mbox series

[RFC,v1,03/13] regulator: bd718x7 use chip specific and generic data structs

Message ID 3fb3eab3a8a2767404588d0a0a531273fddfc659.1548149337.git.matti.vaittinen@fi.rohmeurope.com
State New
Headers show
Series support ROHM BD70528 PMIC | expand

Commit Message

Matti Vaittinen Jan. 22, 2019, 9:43 a.m. UTC
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(-)

Comments

Mark Brown Jan. 23, 2019, 3:51 p.m. UTC | #1
On Tue, Jan 22, 2019 at 11:43:28AM +0200, Matti Vaittinen wrote:
> Header rohm-bd718x7.h was split to generic and component specific
> parts. This changed the struct bd718x7. Adapt the regulator driver to
> these changes.

Acked-by: Mark Brown <broonie@kernel.org>

Does this need to be squashed into the earlier commit for bisection?
Matti Vaittinen Jan. 24, 2019, 7:16 a.m. UTC | #2
Hello Mark,

Thanks again for looking through my changes =)

On Wed, Jan 23, 2019 at 03:51:21PM +0000, Mark Brown wrote:
> On Tue, Jan 22, 2019 at 11:43:28AM +0200, Matti Vaittinen wrote:
> > Header rohm-bd718x7.h was split to generic and component specific
> > parts. This changed the struct bd718x7. Adapt the regulator driver to
> > these changes.
> 
> Acked-by: Mark Brown <broonie@kernel.org>
> 
> Does this need to be squashed into the earlier commit for bisection?

Yes. If we don't want to break the compilation between commits then
the patches 2, 3 and 4 should be squashed into one. I sent them as
separare changes for easier review. I can squash them and send them
squashed if they are Ok to Lee and Stephen. Please just let me know
whose tree I should use as the basis so I can do rebasing if needed.
(Or is there some better way to do changes like this?)

Br,
	Matti Vaittinen
Mark Brown Jan. 24, 2019, 10:24 a.m. UTC | #3
On Thu, Jan 24, 2019 at 09:16:35AM +0200, Matti Vaittinen wrote:

> Yes. If we don't want to break the compilation between commits then
> the patches 2, 3 and 4 should be squashed into one. I sent them as
> separare changes for easier review. I can squash them and send them
> squashed if they are Ok to Lee and Stephen. Please just let me know
> whose tree I should use as the basis so I can do rebasing if needed.
> (Or is there some better way to do changes like this?)

I'd guess Lee's but check with him and Stephen.
diff mbox series

Patch

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);