All of lore.kernel.org
 help / color / mirror / Atom feed
From: Satya Priya <quic_c_skakit@quicinc.com>
To: Bjorn Andersson <bjorn.andersson@linaro.org>,
	Rob Herring <robh+dt@kernel.org>
Cc: Lee Jones <lee.jones@linaro.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, <linux-arm-msm@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<swboyd@chromium.org>, <quic_collinsd@quicinc.com>,
	<quic_subbaram@quicinc.com>, <quic_jprakash@quicinc.com>,
	Satya Priya <quic_c_skakit@quicinc.com>
Subject: [PATCH V10 6/9] mfd: pm8008: Add mfd_cell struct to register LDOs
Date: Thu, 14 Apr 2022 18:00:15 +0530	[thread overview]
Message-ID: <1649939418-19861-7-git-send-email-quic_c_skakit@quicinc.com> (raw)
In-Reply-To: <1649939418-19861-1-git-send-email-quic_c_skakit@quicinc.com>

Add mfd_cell struct to probe LDO regulators using
devm_mfd_add_devices() API.

Signed-off-by: Satya Priya <quic_c_skakit@quicinc.com>
---
Changes in V8:
 - Split the probe for infra and regulator devices
 - Add the reset-gpio toggling in the infra driver probe

Changes in V9:
 - Fixed nits.

Changes in V10:
 - Removed the extra probe added for regulators as is is not needed now.

 drivers/mfd/qcom-pm8008.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c
index ca5240d..ab4ba55 100644
--- a/drivers/mfd/qcom-pm8008.c
+++ b/drivers/mfd/qcom-pm8008.c
@@ -9,6 +9,7 @@
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
+#include <linux/mfd/core.h>
 #include <linux/mfd/qcom_pm8008.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
@@ -29,6 +30,10 @@
 #define INT_EN_CLR_OFFSET		0x16
 #define INT_LATCHED_STS_OFFSET		0x18
 
+static const struct mfd_cell pm8008_regulator_devs[] = {
+	MFD_CELL_NAME("qcom-pm8008-regulator"),
+};
+
 enum {
 	PM8008_MISC,
 	PM8008_TEMP_ALARM,
@@ -282,6 +287,14 @@ static int pm8008_probe(struct i2c_client *client)
 	}
 	gpiod_set_value(chip->reset_gpio, 1);
 
+	rc = devm_mfd_add_devices(&chip->clients[PM8008_REGULATORS_SID]->dev,
+			0, pm8008_regulator_devs, ARRAY_SIZE(pm8008_regulator_devs),
+			NULL, 0, NULL);
+	if (rc) {
+		dev_err(chip->dev, "Failed to add regulators: %d\n", rc);
+		return rc;
+	}
+
 	return devm_of_platform_populate(chip->dev);
 }
 
-- 
2.7.4


  parent reply	other threads:[~2022-04-14 12:31 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-14 12:30 [PATCH V10 0/9] Add Qualcomm Technologies, Inc. PM8008 regulator driver Satya Priya
2022-04-14 12:30 ` [PATCH V10 1/9] dt-bindings: mfd: pm8008: Add reset-gpios Satya Priya
2022-04-14 12:30 ` [PATCH V10 2/9] dt-bindings: regulator: pm8008: Add pm8008 regulator bindings Satya Priya
2022-04-19 17:57   ` Rob Herring
2022-04-14 12:30 ` [PATCH V10 3/9] dt-bindings: mfd: pm8008: Add regulators Satya Priya
2022-04-19 17:57   ` Rob Herring
2022-04-14 12:30 ` [PATCH V10 4/9] mfd: pm8008: Add reset-gpios Satya Priya
2022-04-15  0:10   ` Stephen Boyd
2022-04-18  5:04     ` Satya Priya Kakitapalli (Temp)
     [not found]       ` <a4cbdb4c-dbba-75ee-202a-6b429c0eb390@quicinc.com>
2022-04-27  6:03         ` Satya Priya Kakitapalli (Temp)
2022-04-27  6:30           ` Stephen Boyd
2022-04-27 13:48             ` Satya Priya Kakitapalli (Temp)
2022-04-14 12:30 ` [PATCH V10 5/9] mfd: pm8008: Use i2c_new_dummy_device() API Satya Priya
2022-04-15  0:21   ` Stephen Boyd
2022-04-18 15:08     ` Satya Priya Kakitapalli (Temp)
2022-04-18 19:23       ` Stephen Boyd
2022-04-19  6:04         ` Satya Priya Kakitapalli (Temp)
2022-04-14 12:30 ` Satya Priya [this message]
2022-04-15  0:23   ` [PATCH V10 6/9] mfd: pm8008: Add mfd_cell struct to register LDOs Stephen Boyd
2022-04-18 15:09     ` Satya Priya Kakitapalli (Temp)
2022-04-14 12:30 ` [PATCH V10 7/9] regulator: Add a regulator driver for the PM8008 PMIC Satya Priya
2022-04-15  0:25   ` Stephen Boyd
2022-04-19 14:55     ` Mark Brown
2022-04-19 15:45       ` Stephen Boyd
2022-04-19 16:44         ` Mark Brown
2022-04-14 12:30 ` [PATCH V10 8/9] arm64: dts: qcom: pm8008: Add base dts file Satya Priya
2022-04-15  0:27   ` Stephen Boyd
2022-04-14 12:30 ` [PATCH V10 9/9] arm64: dts: qcom: sc7280: Add pm8008 support for sc7280-idp Satya Priya

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=1649939418-19861-7-git-send-email-quic_c_skakit@quicinc.com \
    --to=quic_c_skakit@quicinc.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_collinsd@quicinc.com \
    --cc=quic_jprakash@quicinc.com \
    --cc=quic_subbaram@quicinc.com \
    --cc=robh+dt@kernel.org \
    --cc=swboyd@chromium.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 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.