diff mbox series

[2/4] soc: qcom: rpmpd: Add corner power-domains states

Message ID 20220805074935.1158098-3-jun.nie@linaro.org
State New
Headers show
Series Support dynamic voltage frequency scaling inside clock controller | expand

Commit Message

Jun Nie Aug. 5, 2022, 7:49 a.m. UTC
Some SoCs use corner instead of level in rpm regulator, such as
MSM8916 and MSM8939. Add these power-domains states value so that
devices can vote them.

Note that there is a shift with 1 when converting the value from
regulator usage in Qualcomm Linux 3.18 to power domain usage here.
Because corner is not well hacked in regulator framework in 3.18.
For example, RPM_REGULATOR_CORNER_RETENTION is 2 in 3.18 while
RPM_SMD_CORNER_RETENTION is 1.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
---
 include/dt-bindings/power/qcom-rpmpd.h | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Bjorn Andersson Sept. 26, 2022, 4:29 p.m. UTC | #1
On Fri, Aug 05, 2022 at 03:49:33PM +0800, Jun Nie wrote:
> Some SoCs use corner instead of level in rpm regulator, such as
> MSM8916 and MSM8939. Add these power-domains states value so that
> devices can vote them.
> 
> Note that there is a shift with 1 when converting the value from
> regulator usage in Qualcomm Linux 3.18 to power domain usage here.
> Because corner is not well hacked in regulator framework in 3.18.
> For example, RPM_REGULATOR_CORNER_RETENTION is 2 in 3.18 while
> RPM_SMD_CORNER_RETENTION is 1.
> 

How about we just stick with the numbers in the rpmpd node in DT, as
that would be the only place these constants are used and all the actual
users can use the label associated there?

Regards,
Bjorn

> Signed-off-by: Jun Nie <jun.nie@linaro.org>
> ---
>  include/dt-bindings/power/qcom-rpmpd.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/include/dt-bindings/power/qcom-rpmpd.h b/include/dt-bindings/power/qcom-rpmpd.h
> index 6cce5b7aa940..f778dbbf083d 100644
> --- a/include/dt-bindings/power/qcom-rpmpd.h
> +++ b/include/dt-bindings/power/qcom-rpmpd.h
> @@ -297,4 +297,12 @@
>  #define RPM_SMD_LEVEL_TURBO_HIGH      448
>  #define RPM_SMD_LEVEL_BINNING         512
>  
> +/* RPM SMD Power Domain performance levels in regulator corner method */
> +#define RPM_SMD_CORNER_RETENTION	1
> +#define RPM_SMD_CORNER_SVS_KRAIT	2
> +#define RPM_SMD_CORNER_SVS_SOC		3
> +#define RPM_SMD_CORNER_NORMAL		4
> +#define RPM_SMD_CORNER_TURBO		5
> +#define RPM_SMD_CORNER_SUPER_TURBO	6
> +
>  #endif
> -- 
> 2.25.1
>
Jun Nie Oct. 24, 2022, 4:27 a.m. UTC | #2
Bjorn Andersson <andersson@kernel.org> 于2022年9月27日周二 00:29写道:
>
> On Fri, Aug 05, 2022 at 03:49:33PM +0800, Jun Nie wrote:
> > Some SoCs use corner instead of level in rpm regulator, such as
> > MSM8916 and MSM8939. Add these power-domains states value so that
> > devices can vote them.
> >
> > Note that there is a shift with 1 when converting the value from
> > regulator usage in Qualcomm Linux 3.18 to power domain usage here.
> > Because corner is not well hacked in regulator framework in 3.18.
> > For example, RPM_REGULATOR_CORNER_RETENTION is 2 in 3.18 while
> > RPM_SMD_CORNER_RETENTION is 1.
> >
>
> How about we just stick with the numbers in the rpmpd node in DT, as
> that would be the only place these constants are used and all the actual
> users can use the label associated there?
>
> Regards,
> Bjorn

The clock driver change in this patch set, the consumer of the
regulator, is dropped. So there
is no more consumers that need the name. So this whole patch set can
be abandoned now.

Regards,
Jun
>
> > Signed-off-by: Jun Nie <jun.nie@linaro.org>
> > ---
> >  include/dt-bindings/power/qcom-rpmpd.h | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/include/dt-bindings/power/qcom-rpmpd.h b/include/dt-bindings/power/qcom-rpmpd.h
> > index 6cce5b7aa940..f778dbbf083d 100644
> > --- a/include/dt-bindings/power/qcom-rpmpd.h
> > +++ b/include/dt-bindings/power/qcom-rpmpd.h
> > @@ -297,4 +297,12 @@
> >  #define RPM_SMD_LEVEL_TURBO_HIGH      448
> >  #define RPM_SMD_LEVEL_BINNING         512
> >
> > +/* RPM SMD Power Domain performance levels in regulator corner method */
> > +#define RPM_SMD_CORNER_RETENTION     1
> > +#define RPM_SMD_CORNER_SVS_KRAIT     2
> > +#define RPM_SMD_CORNER_SVS_SOC               3
> > +#define RPM_SMD_CORNER_NORMAL                4
> > +#define RPM_SMD_CORNER_TURBO         5
> > +#define RPM_SMD_CORNER_SUPER_TURBO   6
> > +
> >  #endif
> > --
> > 2.25.1
> >
diff mbox series

Patch

diff --git a/include/dt-bindings/power/qcom-rpmpd.h b/include/dt-bindings/power/qcom-rpmpd.h
index 6cce5b7aa940..f778dbbf083d 100644
--- a/include/dt-bindings/power/qcom-rpmpd.h
+++ b/include/dt-bindings/power/qcom-rpmpd.h
@@ -297,4 +297,12 @@ 
 #define RPM_SMD_LEVEL_TURBO_HIGH      448
 #define RPM_SMD_LEVEL_BINNING         512
 
+/* RPM SMD Power Domain performance levels in regulator corner method */
+#define RPM_SMD_CORNER_RETENTION	1
+#define RPM_SMD_CORNER_SVS_KRAIT	2
+#define RPM_SMD_CORNER_SVS_SOC		3
+#define RPM_SMD_CORNER_NORMAL		4
+#define RPM_SMD_CORNER_TURBO		5
+#define RPM_SMD_CORNER_SUPER_TURBO	6
+
 #endif