Commit graph

10 commits

Author SHA1 Message Date
Patrick Delaunay
156ed9724f feat(st-regulator): support regulator_set_voltage for fixed regulator
Always support the regulator_set_voltage operation for the same voltage.
This patch prepares the DDR power configuration when the power supplies
are fixed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Maxime Méré <maxime.mere@foss.st.com>
Change-Id: Idf032b03c6f0c95f997dec3ed8a0d38c54a3de15
2024-09-06 15:42:10 +02:00
Pascal Paillet
6897ae8d0f feat(st-regulator): add enable ramp-delay
Permit to override enable ramp-delay value from
the device tree in BL2.

Change-Id: Id8e803b368055a50fbd14d4527917c449b958ad9
Signed-off-by: Pascal Paillet <p.paillet@st.com>
Signed-off-by: Maxime Méré <maxime.mere@foss.st.com>
2024-09-06 15:41:48 +02:00
Pascal Paillet
cff2b1145d refactor(st): rename PLAT_NB_FIXED_REGS
Rename PLAT_NB_FIXED_REGS to PLAT_NB_FIXED_REGUS.
This avoids confusion with regulators and registers.

Signed-off-by: Pascal Paillet <p.paillet@st.com>
Change-Id: Idb2de7204fe978ffcdd729e6cbe453e85fd089b5
2023-09-08 10:56:49 +02:00
Yann Gautier
9a00daf9dd fix(st-regulator): use Boolean type for tests
This corrects MISRA C2012-14.4
The controlling expression of an if statement and the controlling
expression of an iteration-statement shall have essentially Boolean type.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Iacc58349cc3ab558fb4ffe0605a623e84e21e035
2022-12-07 14:18:31 +01:00
Yann Gautier
91af163cbb fix(st-regulator): enclose macro parameters in parentheses
This corrects MISRA C2012-20.7:
Expressions resulting from the expansion of macro parameters shall be
enclosed in parentheses.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I9989a5aaacf17f6f7a65381c8d41f21a35f6ddd9
2022-12-07 14:18:31 +01:00
Yann Gautier
6a3ffb5391 fix(st-regulator): rework for_each_*rdev macros
This corrects MISRA C2012-18.4:
The +, -, += and -= operators should not be applied to an expression
of pointer type.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Ie1a196b875eae2eff9242cf83abfc1a79bdee6f3
2022-12-07 14:18:31 +01:00
Yann Gautier
68083e7ad5 fix(st-regulator): explicitly check operators precedence
This corrects the MISRA violation C2012-12.1:
The precedence of operators within expressions should be made explicit.
This is done either by adding parentheses, or by creating dedicated
variables.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: If8312442222ba848ac1f5e38df1bed0a367646a7
2022-12-07 14:18:30 +01:00
Pascal Paillet
9b4ca70d97 feat(st-regulator): add support for regulator-always-on
Add support for regulator-always-on at BL2 level as it was supported
before using the regulator framework.

Signed-off-by: Pascal Paillet <p.paillet@st.com>
Change-Id: Idb2f4ddc2fdd4e0d31fb33da87c84618aa2e5135
2022-01-28 14:18:12 +01:00
Pascal Paillet
5d6a2646f7 feat(st-drivers): introduce fixed regulator driver
Fixed regulator is mainly used when no pmic is available

Change-Id: Ib6a998684bcb055ba95a093bee563372d9051474
Signed-off-by: Pascal Paillet <p.paillet@st.com>
2021-12-22 14:04:32 +01:00
Pascal Paillet
d5b4a2c4e7 feat(regulator): add a regulator framework
Add a regulator framework to:
- provide an interface to consumers and drivers,
- connect consumers with drivers,
- handle most of devicetree-parsing,
- handle always-on and boot-on regulators,
- handle min/max voltages,

Change-Id: I23c939fdef2c71a416c44c9de332f70db0d2aa53
Signed-off-by: Pascal Paillet <p.paillet@st.com>
2021-12-22 14:04:32 +01:00