mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 06:33:34 +00:00
hwmon: (pmbus/core) Notify regulator events
Notify regulator events in PMBus irq handler. Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> Link: https://lore.kernel.org/r/20230328150335.90238-3-Naresh.Solanki@9elements.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
f74f06f406
commit
7a0c7b9ff2
@ -3159,11 +3159,29 @@ static int pmbus_regulator_register(struct pmbus_data *data)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int pmbus_regulator_notify(struct pmbus_data *data, int page, int event)
|
||||||
|
{
|
||||||
|
int j;
|
||||||
|
|
||||||
|
for (j = 0; j < data->info->num_regulators; j++) {
|
||||||
|
if (page == rdev_get_id(data->rdevs[j])) {
|
||||||
|
regulator_notifier_call_chain(data->rdevs[j], event, NULL);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
static int pmbus_regulator_register(struct pmbus_data *data)
|
static int pmbus_regulator_register(struct pmbus_data *data)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int pmbus_regulator_notify(struct pmbus_data *data, int page, int event)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int pmbus_write_smbalert_mask(struct i2c_client *client, u8 page, u8 reg, u8 val)
|
static int pmbus_write_smbalert_mask(struct i2c_client *client, u8 page, u8 reg, u8 val)
|
||||||
@ -3178,9 +3196,13 @@ static irqreturn_t pmbus_fault_handler(int irq, void *pdata)
|
|||||||
|
|
||||||
int i, status, event;
|
int i, status, event;
|
||||||
mutex_lock(&data->update_lock);
|
mutex_lock(&data->update_lock);
|
||||||
for (i = 0; i < data->info->pages; i++)
|
for (i = 0; i < data->info->pages; i++) {
|
||||||
_pmbus_get_flags(data, i, &status, &event, true);
|
_pmbus_get_flags(data, i, &status, &event, true);
|
||||||
|
|
||||||
|
if (event)
|
||||||
|
pmbus_regulator_notify(data, i, event);
|
||||||
|
}
|
||||||
|
|
||||||
pmbus_clear_faults(client);
|
pmbus_clear_faults(client);
|
||||||
mutex_unlock(&data->update_lock);
|
mutex_unlock(&data->update_lock);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user