diff mbox series

[v5,2/6] soc: qcom: rpmhpd: Introduce function to retrieve power domain performance state count

Message ID 20200320014107.26087-3-thara.gopinath@linaro.org (mailing list archive)
State Changes Requested, archived
Headers show
Series Introduce Power domain based warming device driver | expand

Commit Message

Thara Gopinath March 20, 2020, 1:41 a.m. UTC
Populate .get_performace_state_count in genpd ops to retrieve the count of
performance states supported by a rpmh power domain.

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
---
 drivers/soc/qcom/rpmhpd.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Bjorn Andersson March 27, 2020, 10:15 p.m. UTC | #1
On Thu 19 Mar 18:41 PDT 2020, Thara Gopinath wrote:

> Populate .get_performace_state_count in genpd ops to retrieve the count of
> performance states supported by a rpmh power domain.
> 
> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
> Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
> ---
>  drivers/soc/qcom/rpmhpd.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/soc/qcom/rpmhpd.c b/drivers/soc/qcom/rpmhpd.c
> index 4d264d0672c4..7142409a3b77 100644
> --- a/drivers/soc/qcom/rpmhpd.c
> +++ b/drivers/soc/qcom/rpmhpd.c
> @@ -341,6 +341,13 @@ static unsigned int rpmhpd_get_performance_state(struct generic_pm_domain *genpd
>  	return dev_pm_opp_get_level(opp);
>  }
>  
> +static int rpmhpd_performance_states_count(struct generic_pm_domain *domain)
> +{
> +	struct rpmhpd *pd = domain_to_rpmhpd(domain);
> +
> +	return pd->level_count;
> +}
> +
>  static int rpmhpd_update_level_mapping(struct rpmhpd *rpmhpd)
>  {
>  	int i;
> @@ -429,6 +436,8 @@ static int rpmhpd_probe(struct platform_device *pdev)
>  		rpmhpds[i]->pd.power_on = rpmhpd_power_on;
>  		rpmhpds[i]->pd.set_performance_state = rpmhpd_set_performance_state;
>  		rpmhpds[i]->pd.opp_to_performance_state = rpmhpd_get_performance_state;
> +		rpmhpds[i]->pd.get_performance_state_count =
> +					rpmhpd_performance_states_count;

I would prefer if you ignore the 80-char limit here and leave the line
unwrapped.

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

>  		pm_genpd_init(&rpmhpds[i]->pd, NULL, true);
>  
>  		data->domains[i] = &rpmhpds[i]->pd;
> -- 
> 2.20.1
>
Thara Gopinath March 30, 2020, 2:41 p.m. UTC | #2
On 3/27/20 6:15 PM, Bjorn Andersson wrote:
> On Thu 19 Mar 18:41 PDT 2020, Thara Gopinath wrote:
> 
>> Populate .get_performace_state_count in genpd ops to retrieve the count of
>> performance states supported by a rpmh power domain.
>>
>> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
>> Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
>> ---
>>   drivers/soc/qcom/rpmhpd.c | 9 +++++++++
>>   1 file changed, 9 insertions(+)
>>
>> diff --git a/drivers/soc/qcom/rpmhpd.c b/drivers/soc/qcom/rpmhpd.c
>> index 4d264d0672c4..7142409a3b77 100644
>> --- a/drivers/soc/qcom/rpmhpd.c
>> +++ b/drivers/soc/qcom/rpmhpd.c
>> @@ -341,6 +341,13 @@ static unsigned int rpmhpd_get_performance_state(struct generic_pm_domain *genpd
>>   	return dev_pm_opp_get_level(opp);
>>   }
>>   
>> +static int rpmhpd_performance_states_count(struct generic_pm_domain *domain)
>> +{
>> +	struct rpmhpd *pd = domain_to_rpmhpd(domain);
>> +
>> +	return pd->level_count;
>> +}
>> +
>>   static int rpmhpd_update_level_mapping(struct rpmhpd *rpmhpd)
>>   {
>>   	int i;
>> @@ -429,6 +436,8 @@ static int rpmhpd_probe(struct platform_device *pdev)
>>   		rpmhpds[i]->pd.power_on = rpmhpd_power_on;
>>   		rpmhpds[i]->pd.set_performance_state = rpmhpd_set_performance_state;
>>   		rpmhpds[i]->pd.opp_to_performance_state = rpmhpd_get_performance_state;
>> +		rpmhpds[i]->pd.get_performance_state_count =
>> +					rpmhpd_performance_states_count;
> 
> I would prefer if you ignore the 80-char limit here and leave the line
> unwrapped.

Hi Bjorn,

Thanks for the reviews. I will fix this  in the next version.

> 
> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> 
> Regards,
> Bjorn
> 
>>   		pm_genpd_init(&rpmhpds[i]->pd, NULL, true);
>>   
>>   		data->domains[i] = &rpmhpds[i]->pd;
>> -- 
>> 2.20.1
>>
diff mbox series

Patch

diff --git a/drivers/soc/qcom/rpmhpd.c b/drivers/soc/qcom/rpmhpd.c
index 4d264d0672c4..7142409a3b77 100644
--- a/drivers/soc/qcom/rpmhpd.c
+++ b/drivers/soc/qcom/rpmhpd.c
@@ -341,6 +341,13 @@  static unsigned int rpmhpd_get_performance_state(struct generic_pm_domain *genpd
 	return dev_pm_opp_get_level(opp);
 }
 
+static int rpmhpd_performance_states_count(struct generic_pm_domain *domain)
+{
+	struct rpmhpd *pd = domain_to_rpmhpd(domain);
+
+	return pd->level_count;
+}
+
 static int rpmhpd_update_level_mapping(struct rpmhpd *rpmhpd)
 {
 	int i;
@@ -429,6 +436,8 @@  static int rpmhpd_probe(struct platform_device *pdev)
 		rpmhpds[i]->pd.power_on = rpmhpd_power_on;
 		rpmhpds[i]->pd.set_performance_state = rpmhpd_set_performance_state;
 		rpmhpds[i]->pd.opp_to_performance_state = rpmhpd_get_performance_state;
+		rpmhpds[i]->pd.get_performance_state_count =
+					rpmhpd_performance_states_count;
 		pm_genpd_init(&rpmhpds[i]->pd, NULL, true);
 
 		data->domains[i] = &rpmhpds[i]->pd;