[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1607686060-17448-5-git-send-email-yoshihiro.shimoda.uh@renesas.com>
Date: Fri, 11 Dec 2020 20:27:34 +0900
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
To: marek.vasut+renesas@...il.com, lee.jones@...aro.org,
matti.vaittinen@...rohmeurope.com, lgirdwood@...il.com,
broonie@...nel.org, linus.walleij@...aro.org,
bgolaszewski@...libre.com
Cc: khiem.nguyen.xt@...esas.com, linux-power@...rohmeurope.com,
linux-gpio@...r.kernel.org, linux-renesas-soc@...r.kernel.org,
linux-kernel@...r.kernel.org,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
Subject: [PATCH v2 04/10] regulator: bd9571mwv: Add BD9574MWF support
Add support for BD9574MWF which is silimar chip with BD9571MWV.
Note that BD9574MWF doesn't support AVS and VID.
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
---
drivers/regulator/bd9571mwv-regulator.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/regulator/bd9571mwv-regulator.c b/drivers/regulator/bd9571mwv-regulator.c
index 02120b0..041339b 100644
--- a/drivers/regulator/bd9571mwv-regulator.c
+++ b/drivers/regulator/bd9571mwv-regulator.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
/*
- * ROHM BD9571MWV-M regulator driver
+ * ROHM BD9571MWV-M and BD9574MWF-M regulator driver
*
* Copyright (C) 2017 Marek Vasut <marek.vasut+renesas@...il.com>
*
@@ -9,6 +9,7 @@
* NOTE: VD09 is missing
*/
+#include <linux/mfd/rohm-generic.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
@@ -277,6 +278,7 @@ static int bd9571mwv_regulator_probe(struct platform_device *pdev)
struct regulator_dev *rdev;
unsigned int val;
int i;
+ enum rohm_chip_type chip = platform_get_device_id(pdev)->driver_data;
bdreg = devm_kzalloc(&pdev->dev, sizeof(*bdreg), GFP_KERNEL);
if (!bdreg)
@@ -292,6 +294,9 @@ static int bd9571mwv_regulator_probe(struct platform_device *pdev)
config.regmap = bdreg->regmap;
for (i = 0; i < ARRAY_SIZE(regulators); i++) {
+ /* BD9574MWF supports DVFS only */
+ if (chip == ROHM_CHIP_TYPE_BD9574 && regulators[i].id != DVFS)
+ continue;
rdev = devm_regulator_register(&pdev->dev, ®ulators[i],
&config);
if (IS_ERR(rdev)) {
@@ -339,7 +344,8 @@ static int bd9571mwv_regulator_probe(struct platform_device *pdev)
}
static const struct platform_device_id bd9571mwv_regulator_id_table[] = {
- { "bd9571mwv-regulator", },
+ { "bd9571mwv-regulator", ROHM_CHIP_TYPE_BD9571 },
+ { "bd9574mwf-regulator", ROHM_CHIP_TYPE_BD9574 },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(platform, bd9571mwv_regulator_id_table);
--
2.7.4
Powered by blists - more mailing lists