diff mbox

[RFC,3/4] PM / devfreq: exynos-bus: add support for suspend OPP

Message ID 1479909087-22659-4-git-send-email-tjakobi@math.uni-bielefeld.de (mailing list archive)
State RFC
Headers show

Commit Message

Tobias Jakobi Nov. 23, 2016, 1:51 p.m. UTC
TODO: write desc
Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
---
 drivers/devfreq/exynos-bus.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Chanwoo Choi Nov. 24, 2016, 1:38 a.m. UTC | #1
Hi Tobias,

On 2016년 11월 23일 22:51, Tobias Jakobi wrote:
> TODO: write desc
> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
> ---
>  drivers/devfreq/exynos-bus.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
> index 29866f7..8a91970 100644
> --- a/drivers/devfreq/exynos-bus.c
> +++ b/drivers/devfreq/exynos-bus.c
> @@ -335,6 +335,7 @@ static int exynos_bus_parse_of(struct device_node *np,
>  			      struct exynos_bus *bus)
>  {
>  	struct device *dev = bus->dev;
> +	struct dev_pm_opp *suspend_opp;
>  	unsigned long rate;
>  	int ret;
>  
> @@ -368,6 +369,13 @@ static int exynos_bus_parse_of(struct device_node *np,
>  		ret = PTR_ERR(bus->curr_opp);
>  		goto err_opp;
>  	}
> +
> +	suspend_opp = dev_pm_opp_get_suspend_opp(dev);
> +	if (suspend_opp) {
> +		bus->devfreq->suspend_freq = dev_pm_opp_get_freq(suspend_opp);
> +		printk("DEBUG: suspend opp found!\n");
> +	}

Looks good to me. But, you have to move this code
in the exynos_bus_parent_parse_of() because the passive devfreq
don't need to get the suspend_opp. The suspend_opp is necessary
only for parent devfreq device.

If parent devfreq device change the frequency/voltage,
the passive devfreq device will change the their frequency/voltage
according to parent devfreq.

> +
>  	rcu_read_unlock();
>  
>  	return 0;
>
Tobias Jakobi Nov. 24, 2016, 2:22 p.m. UTC | #2
Hello Chanwoo,

Chanwoo Choi wrote:
> Hi Tobias,
> 
> On 2016년 11월 23일 22:51, Tobias Jakobi wrote:
>> TODO: write desc
>> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
>> ---
>>  drivers/devfreq/exynos-bus.c | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
>> index 29866f7..8a91970 100644
>> --- a/drivers/devfreq/exynos-bus.c
>> +++ b/drivers/devfreq/exynos-bus.c
>> @@ -335,6 +335,7 @@ static int exynos_bus_parse_of(struct device_node *np,
>>  			      struct exynos_bus *bus)
>>  {
>>  	struct device *dev = bus->dev;
>> +	struct dev_pm_opp *suspend_opp;
>>  	unsigned long rate;
>>  	int ret;
>>  
>> @@ -368,6 +369,13 @@ static int exynos_bus_parse_of(struct device_node *np,
>>  		ret = PTR_ERR(bus->curr_opp);
>>  		goto err_opp;
>>  	}
>> +
>> +	suspend_opp = dev_pm_opp_get_suspend_opp(dev);
>> +	if (suspend_opp) {
>> +		bus->devfreq->suspend_freq = dev_pm_opp_get_freq(suspend_opp);
>> +		printk("DEBUG: suspend opp found!\n");
>> +	}
> 
> Looks good to me. But, you have to move this code
> in the exynos_bus_parent_parse_of() because the passive devfreq
> don't need to get the suspend_opp. The suspend_opp is necessary
> only for parent devfreq device.
right, that makes sense!

Thanks again for the review!

- Tobias


> If parent devfreq device change the frequency/voltage,
> the passive devfreq device will change the their frequency/voltage
> according to parent devfreq.
> 
>> +
>>  	rcu_read_unlock();
>>  
>>  	return 0;
>>
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
index 29866f7..8a91970 100644
--- a/drivers/devfreq/exynos-bus.c
+++ b/drivers/devfreq/exynos-bus.c
@@ -335,6 +335,7 @@  static int exynos_bus_parse_of(struct device_node *np,
 			      struct exynos_bus *bus)
 {
 	struct device *dev = bus->dev;
+	struct dev_pm_opp *suspend_opp;
 	unsigned long rate;
 	int ret;
 
@@ -368,6 +369,13 @@  static int exynos_bus_parse_of(struct device_node *np,
 		ret = PTR_ERR(bus->curr_opp);
 		goto err_opp;
 	}
+
+	suspend_opp = dev_pm_opp_get_suspend_opp(dev);
+	if (suspend_opp) {
+		bus->devfreq->suspend_freq = dev_pm_opp_get_freq(suspend_opp);
+		printk("DEBUG: suspend opp found!\n");
+	}
+
 	rcu_read_unlock();
 
 	return 0;