Loading drivers/regulator/qcom_pm8008-regulator.c +16 −4 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. */ /* Copyright (c) 2021, Qualcomm Innovation Center, Inc. All rights reserved. */ #define pr_fmt(fmt) "PM8008: %s: " fmt, __func__ Loading Loading @@ -113,6 +114,7 @@ struct pm8008_regulator { int step_rate; bool enable_ocp_broadcast; enum pmic_subtype pmic_subtype; struct work_struct notify_clients_work; }; static const struct regulator_data pm8008_reg_data[PM8008_MAX_LDO] = { Loading Loading @@ -601,14 +603,22 @@ static int pm8008_ldo_cb(struct notifier_block *nb, ulong event, void *data) goto error; } schedule_work(&pm8008_reg->notify_clients_work); error: return NOTIFY_OK; } static void notify_clients_work(struct work_struct *work) { struct pm8008_regulator *pm8008_reg = container_of(work, struct pm8008_regulator, notify_clients_work); /* Notify the consumers about the OCP event */ mutex_lock(&pm8008_reg->rdev->mutex); regulator_notifier_call_chain(pm8008_reg->rdev, REGULATOR_EVENT_OVER_CURRENT, NULL); mutex_unlock(&pm8008_reg->rdev->mutex); error: return NOTIFY_OK; } static int pm8008_regulator_register_init(struct pm8008_regulator *pm8008_reg, Loading Loading @@ -789,6 +799,8 @@ static int pm8008_register_ldo(struct pm8008_regulator *pm8008_reg, rc); return rc; } INIT_WORK(&pm8008_reg->notify_clients_work, notify_clients_work); } pr_debug("%s regulator registered\n", name); Loading Loading
drivers/regulator/qcom_pm8008-regulator.c +16 −4 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. */ /* Copyright (c) 2021, Qualcomm Innovation Center, Inc. All rights reserved. */ #define pr_fmt(fmt) "PM8008: %s: " fmt, __func__ Loading Loading @@ -113,6 +114,7 @@ struct pm8008_regulator { int step_rate; bool enable_ocp_broadcast; enum pmic_subtype pmic_subtype; struct work_struct notify_clients_work; }; static const struct regulator_data pm8008_reg_data[PM8008_MAX_LDO] = { Loading Loading @@ -601,14 +603,22 @@ static int pm8008_ldo_cb(struct notifier_block *nb, ulong event, void *data) goto error; } schedule_work(&pm8008_reg->notify_clients_work); error: return NOTIFY_OK; } static void notify_clients_work(struct work_struct *work) { struct pm8008_regulator *pm8008_reg = container_of(work, struct pm8008_regulator, notify_clients_work); /* Notify the consumers about the OCP event */ mutex_lock(&pm8008_reg->rdev->mutex); regulator_notifier_call_chain(pm8008_reg->rdev, REGULATOR_EVENT_OVER_CURRENT, NULL); mutex_unlock(&pm8008_reg->rdev->mutex); error: return NOTIFY_OK; } static int pm8008_regulator_register_init(struct pm8008_regulator *pm8008_reg, Loading Loading @@ -789,6 +799,8 @@ static int pm8008_register_ldo(struct pm8008_regulator *pm8008_reg, rc); return rc; } INIT_WORK(&pm8008_reg->notify_clients_work, notify_clients_work); } pr_debug("%s regulator registered\n", name); Loading