Skip to content

Commit 866b554

Browse files
committed
Merge tag 'opp-updates-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm into pm
Merge OPP (operating performance points) updates for 6.9 from Viresh Kumar: "- Fix couple of warnings related to W=1 builds. (Viresh Kumar). - Move Move dev_pm_opp_{init|free}_cpufreq_table() to pm_opp.h (Viresh Kumar). - Extend dev_pm_opp_data with turbo support (Sibi Sankar). - dt-bindings: drop maxItems from inner items (David Heidelberg)." * tag 'opp-updates-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: dt-bindings: opp: drop maxItems from inner items OPP: debugfs: Fix warning around icc_get_name() OPP: debugfs: Fix warning with W=1 builds cpufreq: Move dev_pm_opp_{init|free}_cpufreq_table() to pm_opp.h OPP: Extend dev_pm_opp_data with turbo support
2 parents 3bd8346 + 13c8cf3 commit 866b554

File tree

5 files changed

+27
-28
lines changed

5 files changed

+27
-28
lines changed

Documentation/devicetree/bindings/opp/opp-v2-base.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ patternProperties:
5757
specific binding.
5858
minItems: 1
5959
maxItems: 32
60-
items:
61-
maxItems: 1
6260

6361
opp-microvolt:
6462
description: |

drivers/opp/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2065,6 +2065,7 @@ int _opp_add_v1(struct opp_table *opp_table, struct device *dev,
20652065
/* populate the opp table */
20662066
new_opp->rates[0] = data->freq;
20672067
new_opp->level = data->level;
2068+
new_opp->turbo = data->turbo;
20682069
tol = u_volt * opp_table->voltage_tolerance_v1 / 100;
20692070
new_opp->supplies[0].u_volt = u_volt;
20702071
new_opp->supplies[0].u_volt_min = u_volt - tol;

drivers/opp/debugfs.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ static ssize_t bw_name_read(struct file *fp, char __user *userbuf,
3737
size_t count, loff_t *ppos)
3838
{
3939
struct icc_path *path = fp->private_data;
40+
const char *name = icc_get_name(path);
4041
char buf[64];
41-
int i;
42+
int i = 0;
4243

43-
i = scnprintf(buf, sizeof(buf), "%.62s\n", icc_get_name(path));
44+
if (name)
45+
i = scnprintf(buf, sizeof(buf), "%.62s\n", name);
4446

4547
return simple_read_from_buffer(userbuf, count, ppos, buf, i);
4648
}
@@ -56,11 +58,11 @@ static void opp_debug_create_bw(struct dev_pm_opp *opp,
5658
struct dentry *pdentry)
5759
{
5860
struct dentry *d;
59-
char name[20];
61+
char name[] = "icc-path-XXXXXXXXXXX"; /* Integers can take 11 chars max */
6062
int i;
6163

6264
for (i = 0; i < opp_table->path_count; i++) {
63-
snprintf(name, sizeof(name), "icc-path-%.1d", i);
65+
snprintf(name, sizeof(name), "icc-path-%d", i);
6466

6567
/* Create per-path directory */
6668
d = debugfs_create_dir(name, pdentry);
@@ -78,7 +80,7 @@ static void opp_debug_create_clks(struct dev_pm_opp *opp,
7880
struct opp_table *opp_table,
7981
struct dentry *pdentry)
8082
{
81-
char name[12];
83+
char name[] = "rate_hz_XXXXXXXXXXX"; /* Integers can take 11 chars max */
8284
int i;
8385

8486
if (opp_table->clk_count == 1) {
@@ -100,7 +102,7 @@ static void opp_debug_create_supplies(struct dev_pm_opp *opp,
100102
int i;
101103

102104
for (i = 0; i < opp_table->regulator_count; i++) {
103-
char name[15];
105+
char name[] = "supply-XXXXXXXXXXX"; /* Integers can take 11 chars max */
104106

105107
snprintf(name, sizeof(name), "supply-%d", i);
106108

include/linux/cpufreq.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -693,26 +693,6 @@ struct cpufreq_frequency_table {
693693
* order */
694694
};
695695

696-
#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP)
697-
int dev_pm_opp_init_cpufreq_table(struct device *dev,
698-
struct cpufreq_frequency_table **table);
699-
void dev_pm_opp_free_cpufreq_table(struct device *dev,
700-
struct cpufreq_frequency_table **table);
701-
#else
702-
static inline int dev_pm_opp_init_cpufreq_table(struct device *dev,
703-
struct cpufreq_frequency_table
704-
**table)
705-
{
706-
return -EINVAL;
707-
}
708-
709-
static inline void dev_pm_opp_free_cpufreq_table(struct device *dev,
710-
struct cpufreq_frequency_table
711-
**table)
712-
{
713-
}
714-
#endif
715-
716696
/*
717697
* cpufreq_for_each_entry - iterate over a cpufreq_frequency_table
718698
* @pos: the cpufreq_frequency_table * to use as a loop cursor.

include/linux/pm_opp.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/notifier.h>
1717

1818
struct clk;
19+
struct cpufreq_frequency_table;
1920
struct regulator;
2021
struct dev_pm_opp;
2122
struct device;
@@ -87,12 +88,14 @@ struct dev_pm_opp_config {
8788

8889
/**
8990
* struct dev_pm_opp_data - The data to use to initialize an OPP.
91+
* @turbo: Flag to indicate whether the OPP is to be marked turbo or not.
9092
* @level: The performance level for the OPP. Set level to OPP_LEVEL_UNSET if
9193
* level field isn't used.
9294
* @freq: The clock rate in Hz for the OPP.
9395
* @u_volt: The voltage in uV for the OPP.
9496
*/
9597
struct dev_pm_opp_data {
98+
bool turbo;
9699
unsigned int level;
97100
unsigned long freq;
98101
unsigned long u_volt;
@@ -444,6 +447,21 @@ static inline int dev_pm_opp_sync_regulators(struct device *dev)
444447

445448
#endif /* CONFIG_PM_OPP */
446449

450+
#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP)
451+
int dev_pm_opp_init_cpufreq_table(struct device *dev, struct cpufreq_frequency_table **table);
452+
void dev_pm_opp_free_cpufreq_table(struct device *dev, struct cpufreq_frequency_table **table);
453+
#else
454+
static inline int dev_pm_opp_init_cpufreq_table(struct device *dev, struct cpufreq_frequency_table **table)
455+
{
456+
return -EINVAL;
457+
}
458+
459+
static inline void dev_pm_opp_free_cpufreq_table(struct device *dev, struct cpufreq_frequency_table **table)
460+
{
461+
}
462+
#endif
463+
464+
447465
#if defined(CONFIG_PM_OPP) && defined(CONFIG_OF)
448466
int dev_pm_opp_of_add_table(struct device *dev);
449467
int dev_pm_opp_of_add_table_indexed(struct device *dev, int index);

0 commit comments

Comments
 (0)