From: Saravanan Sekar <saravanan@linumiz.com>
To: sravanhome@gmail.com, lgirdwood@gmail.com, broonie@kernel.org,
robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
conor+dt@kernel.org, linux@roeck-us.net, jdelvare@suse.com
Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
linux-hwmon@vger.kernel.org,
Saravanan Sekar <saravanan@linumiz.com>
Subject: [PATCH v4 3/4] hwmon: (pmbus/core) Add helper macro to define single pmbus regulator
Date: Wed, 11 Oct 2023 22:17:53 +0530 [thread overview]
Message-ID: <20231011164754.449399-4-saravanan@linumiz.com> (raw)
In-Reply-To: <20231011164754.449399-1-saravanan@linumiz.com>
The bindings for single instance regulator should be named with no instance
(e.g., buck not buck0). Introduce a new helper macro to define the single pmbus
regulator.
Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
---
drivers/hwmon/pmbus/pmbus.h | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/hwmon/pmbus/pmbus.h b/drivers/hwmon/pmbus/pmbus.h
index b0832a4c690d..f4df3d6a41df 100644
--- a/drivers/hwmon/pmbus/pmbus.h
+++ b/drivers/hwmon/pmbus/pmbus.h
@@ -480,6 +480,21 @@ extern const struct regulator_ops pmbus_regulator_ops;
#define PMBUS_REGULATOR(_name, _id) PMBUS_REGULATOR_STEP(_name, _id, 0, 0, 0)
+#define PMBUS_REGULATOR_STEP_ONE(_name, _voltages, _step, _min_uV) \
+ { \
+ .name = (_name), \
+ .of_match = of_match_ptr(_name), \
+ .regulators_node = of_match_ptr("regulators"), \
+ .ops = &pmbus_regulator_ops, \
+ .type = REGULATOR_VOLTAGE, \
+ .owner = THIS_MODULE, \
+ .n_voltages = _voltages, \
+ .uV_step = _step, \
+ .min_uV = _min_uV, \
+ }
+
+#define PMBUS_REGULATOR_ONE(_name) PMBUS_REGULATOR_STEP_ONE(_name, 0, 0, 0)
+
/* Function declarations */
void pmbus_clear_cache(struct i2c_client *client);
--
2.34.1
next prev parent reply other threads:[~2023-10-11 16:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-11 16:47 [PATCH v4 0/4] Add support for mpq2286 PMIC IC Saravanan Sekar
2023-10-11 16:47 ` [PATCH v4 1/4] hwmon: (pmbus/mpq7932) Get page count based on chip info Saravanan Sekar
2023-10-26 0:49 ` Guenter Roeck
2023-10-11 16:47 ` [PATCH v4 2/4] regulator: dt-bindings: Add mps,mpq2286 power-management IC Saravanan Sekar
2023-10-11 18:22 ` Mark Brown
2023-10-11 18:23 ` Krzysztof Kozlowski
2023-10-26 0:50 ` Guenter Roeck
2023-10-11 16:47 ` Saravanan Sekar [this message]
2023-10-26 0:51 ` [PATCH v4 3/4] hwmon: (pmbus/core) Add helper macro to define single pmbus regulator Guenter Roeck
2023-10-11 16:47 ` [PATCH v4 4/4] hwmon: (pmbus/mpq2286) Add a support for mpq2286 Power Management IC Saravanan Sekar
2023-10-26 0:52 ` Guenter Roeck
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=20231011164754.449399-4-saravanan@linumiz.com \
--to=saravanan@linumiz.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jdelvare@suse.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=robh+dt@kernel.org \
--cc=sravanhome@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®