From: Naresh Solanki <naresh.solanki@9elements.com>
To: devicetree@vger.kernel.org, Guenter Roeck <linux@roeck-us.net>,
Jean Delvare <jdelvare@suse.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org,
Patrick Rudolph <patrick.rudolph@9elements.com>,
Naresh Solanki <Naresh.Solanki@9elements.com>
Subject: [PATCH v6 5/5] hwmon: (pmbus/core): Notify regulator events
Date: Mon, 5 Dec 2022 20:19:16 +0100 [thread overview]
Message-ID: <20221205191917.2614603-5-Naresh.Solanki@9elements.com> (raw)
In-Reply-To: <20221205191917.2614603-1-Naresh.Solanki@9elements.com>
Notify regulator events in PMBus irq handler.
Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com>
---
drivers/hwmon/pmbus/pmbus_core.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index 22176f266891..c8fae2a9502d 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -3154,7 +3154,7 @@ static irqreturn_t pmbus_fault_handler(int irq, void *pdata)
{
struct pmbus_data *data = pdata;
struct i2c_client *client = to_i2c_client(data->dev);
- int i, status, ret, event;
+ int i, j, status, ret, event;
for (i = 0; i < data->info->pages; i++) {
@@ -3163,6 +3163,15 @@ static irqreturn_t pmbus_fault_handler(int irq, void *pdata)
if (ret)
return ret;
+ if (event) {
+ for (j = 0; j < data->info->num_regulators; j++) {
+ if (i == rdev_get_id(data->rdevs[i])) {
+ regulator_notifier_call_chain(data->rdevs[i], event, NULL);
+ ret = IRQ_HANDLED;
+ }
+ }
+ }
+
mutex_lock(&data->update_lock);
status = pmbus_read_status_word(client, i);
if (status < 0) {
--
2.37.3
prev parent reply other threads:[~2022-12-05 19:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-05 19:19 [PATCH v6 1/5] hwmon: (pmbus/core): Add interrupt support Naresh Solanki
2022-12-05 19:19 ` [PATCH v6 2/5] hwmon: (pmbus/core): Notify hwmon events Naresh Solanki
2022-12-05 19:19 ` [PATCH v6 3/5] hwmon: (pmbus/core): Add rdev in pmbus_data struct Naresh Solanki
2022-12-05 19:19 ` [PATCH v6 4/5] hwmon: (pmbus/core): Add regulator event support Naresh Solanki
2022-12-05 19:19 ` Naresh Solanki [this message]
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=20221205191917.2614603-5-Naresh.Solanki@9elements.com \
--to=naresh.solanki@9elements.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jdelvare@suse.com \
--cc=lgirdwood@gmail.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=patrick.rudolph@9elements.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®