All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
To: marek.vasut+renesas@gmail.com, lee.jones@linaro.org,
	matti.vaittinen@fi.rohmeurope.com, lgirdwood@gmail.com,
	broonie@kernel.org, linus.walleij@linaro.org,
	bgolaszewski@baylibre.com
Cc: khiem.nguyen.xt@renesas.com, linux-power@fi.rohmeurope.com,
	linux-gpio@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Subject: [PATCH v8 05/12] regulator: bd9571mwv: Add BD9574MWF support
Date: Fri, 25 Dec 2020 18:33:20 +0900	[thread overview]
Message-ID: <1608888807-3117-6-git-send-email-yoshihiro.shimoda.uh@renesas.com> (raw)
In-Reply-To: <1608888807-3117-1-git-send-email-yoshihiro.shimoda.uh@renesas.com>

Add support for BD9574MWF which is similar chip with BD9571MWV.
Note that we don't support voltage rails VD{09,18,25,33} by this
driver on BD9574. The VD09 voltage could be read from PMIC but that
is not supported by this commit.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.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 42b6a70..7b0cd08 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@gmail.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, &regulators[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


  parent reply	other threads:[~2020-12-25  9:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-25  9:33 [PATCH v8 00/12] treewide: bd9571mwv: Add support for BD9574MWF Yoshihiro Shimoda
2020-12-25  9:33 ` [PATCH v8 01/12] mfd: bd9571mwv: Use devm_mfd_add_devices() Yoshihiro Shimoda
2020-12-25  9:33 ` [PATCH v8 02/12] dt-bindings: mfd: bd9571mwv: Document BD9574MWF Yoshihiro Shimoda
2020-12-25  9:33 ` [PATCH v8 03/12] mfd: rohm-generic: Add BD9571 and BD9574 Yoshihiro Shimoda
2020-12-25  9:33 ` [PATCH v8 04/12] regulator: bd9571mwv: rid of using struct bd9571mwv Yoshihiro Shimoda
2021-01-05 17:57   ` Mark Brown
2020-12-25  9:33 ` Yoshihiro Shimoda [this message]
2021-01-05 17:58   ` [PATCH v8 05/12] regulator: bd9571mwv: Add BD9574MWF support Mark Brown
2020-12-25  9:33 ` [PATCH v8 06/12] gpio: bd9571mwv: Use the SPDX license identifier Yoshihiro Shimoda
2021-01-03 15:35   ` Bartosz Golaszewski
2020-12-25  9:33 ` [PATCH v8 07/12] gpio: bd9571mwv: rid of using struct bd9571mwv Yoshihiro Shimoda
2021-01-03 15:36   ` Bartosz Golaszewski
2020-12-25  9:33 ` [PATCH v8 08/12] gpio: bd9571mwv: Add BD9574MWF support Yoshihiro Shimoda
2021-01-03 15:35   ` Bartosz Golaszewski
2020-12-25  9:33 ` [PATCH v8 09/12] mfd: bd9571mwv: Use the SPDX license identifier Yoshihiro Shimoda
2020-12-25  9:33 ` [PATCH v8 10/12] mfd: bd9571mwv: Use devm_regmap_add_irq_chip() Yoshihiro Shimoda
2020-12-25  9:33 ` [PATCH v8 11/12] mfd: bd9571mwv: Make the driver more generic Yoshihiro Shimoda
2020-12-25  9:33 ` [PATCH v8 12/12] mfd: bd9571mwv: Add support for BD9574MWF Yoshihiro Shimoda

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=1608888807-3117-6-git-send-email-yoshihiro.shimoda.uh@renesas.com \
    --to=yoshihiro.shimoda.uh@renesas.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=broonie@kernel.org \
    --cc=khiem.nguyen.xt@renesas.com \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-power@fi.rohmeurope.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=marek.vasut+renesas@gmail.com \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.