Commit 866b554c authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

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
parents 3bd83464 13c8cf33
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -57,8 +57,6 @@ patternProperties:
          specific binding.
        minItems: 1
        maxItems: 32
        items:
          maxItems: 1

      opp-microvolt:
        description: |
+1 −0
Original line number Diff line number Diff line
@@ -2065,6 +2065,7 @@ int _opp_add_v1(struct opp_table *opp_table, struct device *dev,
	/* populate the opp table */
	new_opp->rates[0] = data->freq;
	new_opp->level = data->level;
	new_opp->turbo = data->turbo;
	tol = u_volt * opp_table->voltage_tolerance_v1 / 100;
	new_opp->supplies[0].u_volt = u_volt;
	new_opp->supplies[0].u_volt_min = u_volt - tol;
+8 −6
Original line number Diff line number Diff line
@@ -37,10 +37,12 @@ static ssize_t bw_name_read(struct file *fp, char __user *userbuf,
			    size_t count, loff_t *ppos)
{
	struct icc_path *path = fp->private_data;
	const char *name = icc_get_name(path);
	char buf[64];
	int i;
	int i = 0;

	i = scnprintf(buf, sizeof(buf), "%.62s\n", icc_get_name(path));
	if (name)
		i = scnprintf(buf, sizeof(buf), "%.62s\n", name);

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

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

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

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

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

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

+0 −20
Original line number Diff line number Diff line
@@ -693,26 +693,6 @@ struct cpufreq_frequency_table {
				    * order */
};

#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP)
int dev_pm_opp_init_cpufreq_table(struct device *dev,
				  struct cpufreq_frequency_table **table);
void dev_pm_opp_free_cpufreq_table(struct device *dev,
				   struct cpufreq_frequency_table **table);
#else
static inline int dev_pm_opp_init_cpufreq_table(struct device *dev,
						struct cpufreq_frequency_table
						**table)
{
	return -EINVAL;
}

static inline void dev_pm_opp_free_cpufreq_table(struct device *dev,
						 struct cpufreq_frequency_table
						 **table)
{
}
#endif

/*
 * cpufreq_for_each_entry -	iterate over a cpufreq_frequency_table
 * @pos:	the cpufreq_frequency_table * to use as a loop cursor.
+18 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
#include <linux/notifier.h>

struct clk;
struct cpufreq_frequency_table;
struct regulator;
struct dev_pm_opp;
struct device;
@@ -87,12 +88,14 @@ struct dev_pm_opp_config {

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

#endif		/* CONFIG_PM_OPP */

#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP)
int dev_pm_opp_init_cpufreq_table(struct device *dev, struct cpufreq_frequency_table **table);
void dev_pm_opp_free_cpufreq_table(struct device *dev, struct cpufreq_frequency_table **table);
#else
static inline int dev_pm_opp_init_cpufreq_table(struct device *dev, struct cpufreq_frequency_table **table)
{
	return -EINVAL;
}

static inline void dev_pm_opp_free_cpufreq_table(struct device *dev, struct cpufreq_frequency_table **table)
{
}
#endif


#if defined(CONFIG_PM_OPP) && defined(CONFIG_OF)
int dev_pm_opp_of_add_table(struct device *dev);
int dev_pm_opp_of_add_table_indexed(struct device *dev, int index);