diff mbox series

[2/4] PM / devfreq: Export devfreq_get_freq_ragne symbol within devfreq

Message ID 20210617060546.26933-3-cw00.choi@samsung.com (mailing list archive)
State Accepted
Delegated to: Chanwoo Choi
Headers show
Series PM / devfreq: Add cpu based scaling support to passive governor | expand

Commit Message

Chanwoo Choi June 17, 2021, 6:05 a.m. UTC
In order to get frequency range within devfreq governors,
export devfreq_get_freq_ragne symbol within devfreq.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/devfreq/devfreq.c  | 17 +++++++++--------
 drivers/devfreq/governor.h |  2 ++
 2 files changed, 11 insertions(+), 8 deletions(-)

Comments

Matthias Kaehlcke June 22, 2021, 6:23 p.m. UTC | #1
On Thu, Jun 17, 2021 at 03:05:44PM +0900, Chanwoo Choi wrote:

> Subject: PM / devfreq: Export devfreq_get_freq_ragne symbol within devfreq

nit: s/ragne/range/

>
> In order to get frequency range within devfreq governors,
> export devfreq_get_freq_ragne symbol within devfreq.
> 
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>

Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Chanwoo Choi July 13, 2021, 7:36 p.m. UTC | #2
On 21. 6. 23. 오전 3:23, Matthias Kaehlcke wrote:
> On Thu, Jun 17, 2021 at 03:05:44PM +0900, Chanwoo Choi wrote:
> 
>> Subject: PM / devfreq: Export devfreq_get_freq_ragne symbol within devfreq
> 
> nit: s/ragne/range/
> 
>>
>> In order to get frequency range within devfreq governors,
>> export devfreq_get_freq_ragne symbol within devfreq.
>>
>> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> 
> Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
> 

Thanks for the review.
diff mbox series

Patch

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 28f3e0ba6cdd..a15545c42fc2 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -112,16 +112,16 @@  static unsigned long find_available_max_freq(struct devfreq *devfreq)
 }
 
 /**
- * get_freq_range() - Get the current freq range
+ * devfreq_get_freq_range() - Get the current freq range
  * @devfreq:	the devfreq instance
  * @min_freq:	the min frequency
  * @max_freq:	the max frequency
  *
  * This takes into consideration all constraints.
  */
-static void get_freq_range(struct devfreq *devfreq,
-			   unsigned long *min_freq,
-			   unsigned long *max_freq)
+void devfreq_get_freq_range(struct devfreq *devfreq,
+			    unsigned long *min_freq,
+			    unsigned long *max_freq)
 {
 	unsigned long *freq_table = devfreq->profile->freq_table;
 	s32 qos_min_freq, qos_max_freq;
@@ -158,6 +158,7 @@  static void get_freq_range(struct devfreq *devfreq,
 	if (*min_freq > *max_freq)
 		*min_freq = *max_freq;
 }
+EXPORT_SYMBOL(devfreq_get_freq_range);
 
 /**
  * devfreq_get_freq_level() - Lookup freq_table for the frequency
@@ -418,7 +419,7 @@  int devfreq_update_target(struct devfreq *devfreq, unsigned long freq)
 	err = devfreq->governor->get_target_freq(devfreq, &freq);
 	if (err)
 		return err;
-	get_freq_range(devfreq, &min_freq, &max_freq);
+	devfreq_get_freq_range(devfreq, &min_freq, &max_freq);
 
 	if (freq < min_freq) {
 		freq = min_freq;
@@ -1561,7 +1562,7 @@  static ssize_t min_freq_show(struct device *dev, struct device_attribute *attr,
 	unsigned long min_freq, max_freq;
 
 	mutex_lock(&df->lock);
-	get_freq_range(df, &min_freq, &max_freq);
+	devfreq_get_freq_range(df, &min_freq, &max_freq);
 	mutex_unlock(&df->lock);
 
 	return sprintf(buf, "%lu\n", min_freq);
@@ -1615,7 +1616,7 @@  static ssize_t max_freq_show(struct device *dev, struct device_attribute *attr,
 	unsigned long min_freq, max_freq;
 
 	mutex_lock(&df->lock);
-	get_freq_range(df, &min_freq, &max_freq);
+	devfreq_get_freq_range(df, &min_freq, &max_freq);
 	mutex_unlock(&df->lock);
 
 	return sprintf(buf, "%lu\n", max_freq);
@@ -1929,7 +1930,7 @@  static int devfreq_summary_show(struct seq_file *s, void *data)
 
 		mutex_lock(&devfreq->lock);
 		cur_freq = devfreq->previous_freq;
-		get_freq_range(devfreq, &min_freq, &max_freq);
+		devfreq_get_freq_range(devfreq, &min_freq, &max_freq);
 		timer = devfreq->profile->timer;
 
 		if (IS_SUPPORTED_ATTR(devfreq->governor->attrs, POLLING_INTERVAL))
diff --git a/drivers/devfreq/governor.h b/drivers/devfreq/governor.h
index 2d69a0ce6291..9a9495f94ac6 100644
--- a/drivers/devfreq/governor.h
+++ b/drivers/devfreq/governor.h
@@ -86,6 +86,8 @@  int devfreq_remove_governor(struct devfreq_governor *governor);
 
 int devfreq_update_status(struct devfreq *devfreq, unsigned long freq);
 int devfreq_update_target(struct devfreq *devfreq, unsigned long freq);
+void devfreq_get_freq_range(struct devfreq *devfreq, unsigned long *min_freq,
+			    unsigned long *max_freq);
 
 static inline int devfreq_update_stats(struct devfreq *df)
 {