2022-04-16 01:08:07

by Satya Priya

[permalink] [raw]
Subject: [PATCH V10 0/9] Add Qualcomm Technologies, Inc. PM8008 regulator driver

Satya Priya (9):
dt-bindings: mfd: pm8008: Add reset-gpios
dt-bindings: regulator: pm8008: Add pm8008 regulator bindings
dt-bindings: mfd: pm8008: Add regulators
mfd: pm8008: Add reset-gpios
mfd: pm8008: Use i2c_new_dummy_device() API
mfd: pm8008: Add mfd_cell struct to register LDOs
regulator: Add a regulator driver for the PM8008 PMIC
arm64: dts: qcom: pm8008: Add base dts file
arm64: dts: qcom: sc7280: Add pm8008 support for sc7280-idp

.../devicetree/bindings/mfd/qcom,pm8008.yaml | 24 +++
.../bindings/regulator/qcom,pm8008-regulators.yaml | 40 ++++
arch/arm64/boot/dts/qcom/pm8008.dtsi | 42 +++++
arch/arm64/boot/dts/qcom/sc7280-idp.dtsi | 68 +++++++
drivers/mfd/qcom-pm8008.c | 76 +++++++-
drivers/regulator/Kconfig | 9 +
drivers/regulator/Makefile | 1 +
drivers/regulator/qcom-pm8008-regulator.c | 201 +++++++++++++++++++++
include/linux/mfd/qcom_pm8008.h | 13 ++
9 files changed, 464 insertions(+), 10 deletions(-)
create mode 100644 Documentation/devicetree/bindings/regulator/qcom,pm8008-regulators.yaml
create mode 100644 arch/arm64/boot/dts/qcom/pm8008.dtsi
create mode 100644 drivers/regulator/qcom-pm8008-regulator.c
create mode 100644 include/linux/mfd/qcom_pm8008.h

--
2.7.4


2022-04-16 02:23:22

by Satya Priya

[permalink] [raw]
Subject: [PATCH V10 6/9] mfd: pm8008: Add mfd_cell struct to register LDOs

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

Signed-off-by: Satya Priya <[email protected]>
---
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