History log of /linux-master/drivers/regulator/scmi-regulator.c
Revision Date Author Comments
# 668f777d 26-Jan-2023 Cristian Marussi <cristian.marussi@arm.com>

regulator: scmi: Allow for zero voltage domains

SCMI Voltage protocol allows the platform to report no voltage domains
on discovery, while warning the user about such an odd configuration.
As a consequence this condition should not be treated as error by the SCMI
regulator driver either.

Allow SCMI regulator driver to probe successfully even when no voltage
domains are discovered.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20230126180511.766373-1-cristian.marussi@arm.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# a9e37a82 21-Jun-2022 Liang He <windhl@126.com>

regulator: scmi: Add missing of_node_get()

In scmi_regulator_probe(), of_find_node_by_name() will decrease
the refcount of its first argument and we need a of_node_get()
to keep reference balance.

Signed-off-by: Liang He <windhl@126.com>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20220622034816.4094043-1-windhl@126.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 68d6c847 16-May-2022 Miaoqian Lin <linmq006@gmail.com>

regulator: scmi: Fix refcount leak in scmi_regulator_probe

of_find_node_by_name() returns a node pointer with refcount
incremented, we should use of_node_put() on it when done.
Add missing of_node_put() to avoid refcount leak.

Fixes: 0fbeae70ee7c ("regulator: add SCMI driver")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220516074433.32433-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 36cb555f 21-May-2021 Axel Lin <axel.lin@ingics.com>

regulator: scmi: Fix off-by-one for linear regulators .n_voltages setting

For linear regulators, the .n_voltages is (max_uv - min_uv) / uv_step + 1.

Fixes: 0fbeae70ee7c ("regulator: add SCMI driver")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20210521073020.1944981-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 59046d15 15-Mar-2021 Cristian Marussi <cristian.marussi@arm.com>

regulator: scmi: Port driver to the new scmi_voltage_proto_ops interface

Port the scmi regulator driver to the new SCMI voltage interface based
on protocol handles and common devm_get_ops().

Link: https://lore.kernel.org/r/20210316124903.35011-30-cristian.marussi@arm.com
Cc: Mark Brown <broonie@kernel.org>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>


# 45ee8b79 25-Feb-2021 Yang Li <yang.lee@linux.alibaba.com>

regulator: add missing call to of_node_put()

In one of the error paths of the for_each_child_of_node() loop,
add missing call to of_node_put().

Fix the following coccicheck warning:
./drivers/regulator/scmi-regulator.c:343:1-23: WARNING: Function
"for_each_child_of_node" should have of_node_put() before return around
line 347.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/1614303575-27436-1-git-send-email-yang.lee@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 0fbeae70 23-Nov-2020 Cristian Marussi <cristian.marussi@arm.com>

regulator: add SCMI driver

Add a simple regulator based on SCMI Voltage Domain Protocol.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
----
v6 --> v7
- add proper blank lines between semantic blocks
- fix return value on error path of scmi_reg_is_enabled()
- use generic Failure message on err path of info_get()
- fix comment containing apostrophe

v3 --> v4
- using of_match_full_name core regulator flag
- avoid coccinelle falde complaints about pointer-sized allocations

v2 --> v3
- remove multiple linear mappings support
- removed duplicated voltage name printout
- added a few comments
- simplified return path in scmi_reg_set_voltage_sel()

v1 --> v2
- removed duplicate regulator naming
- removed redundant .get/set_voltage ops: only _sel variants implemented
- removed condexpr on fail path to increase readability

v0 --> v1
- fixed init_data constraint parsing
- fixes for v5.8 (linear_range.h)
- fixed commit message content and subject line format
- factored out SCMI core specific changes to distinct patch
- reworked Kconfig and Makefile to keep proper alphabetic order
- fixed SPDX comment style
- removed unneeded inline functions
- reworked conditionals for legibility
- fixed some return paths to properly report SCMI original errors codes
- added some more descriptive error messages when fw returns invalid ranges
- removed unneeded explicit devm_regulator_unregister from .remove()
Link: https://lore.kernel.org/r/20201123202336.46701-4-cristian.marussi@arm.com

Signed-off-by: Mark Brown <broonie@kernel.org>