[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221205191917.2614603-5-Naresh.Solanki@9elements.com>
Date: Mon, 5 Dec 2022 20:19:16 +0100
From: Naresh Solanki <naresh.solanki@...ements.com>
To: devicetree@...r.kernel.org, Guenter Roeck <linux@...ck-us.net>,
Jean Delvare <jdelvare@...e.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-hwmon@...r.kernel.org,
Patrick Rudolph <patrick.rudolph@...ements.com>,
Naresh Solanki <Naresh.Solanki@...ements.com>
Subject: [PATCH v6 5/5] hwmon: (pmbus/core): Notify regulator events
Notify regulator events in PMBus irq handler.
Signed-off-by: Naresh Solanki <Naresh.Solanki@...ements.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
Powered by blists - more mailing lists