Re: [PATCH v2 1/2] PM / OPP: Allow boost frequency to be looked up from device tree

2014-02-10 Thread Sudeep Holla
On 08/02/14 05:10, Thomas Abraham wrote:
 On Fri, Feb 7, 2014 at 9:31 PM, Sudeep Holla sudeep.ho...@arm.com wrote:
 On 07/02/14 15:19, Thomas Abraham wrote:
 From: Thomas Abraham thomas...@samsung.com

 Commit 6f19efc0 (cpufreq: Add boost frequency support in core) adds
 support for CPU boost mode. This patch adds support for finding available
 boost frequencies from device tree and marking them as usable in boost mode.

 Cc: Nishanth Menon n...@ti.com
 Cc: Lukasz Majewski l.majew...@samsung.com
 Signed-off-by: Thomas Abraham thomas...@samsung.com
 ---
  drivers/base/power/opp.c |   34 +-
  1 file changed, 33 insertions(+), 1 deletion(-)

 diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
 index fa41874..b636826 100644
 --- a/drivers/base/power/opp.c
 +++ b/drivers/base/power/opp.c
 @@ -628,7 +628,8 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
   struct device_opp *dev_opp;
   struct dev_pm_opp *opp;
   struct cpufreq_frequency_table *freq_table;
 - int i = 0;
 + int i = 0, j, len, ret;
 + u32 *boost_freqs = NULL;

   /* Pretend as if I am an updater */
   mutex_lock(dev_opp_list_lock);
 @@ -650,10 +651,35 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
   return -ENOMEM;
   }

 + if (of_find_property(dev-of_node, boost-frequency, len)) {
 + if (len == 0 || (len  (sizeof(u32) - 1)) != 0) {
 + dev_err(dev, %s: invalid boost frequency\n, 
 __func__);
 + ret = -EINVAL;
 + goto err_boost;
 + }
 +
 + boost_freqs = kzalloc(len, GFP_KERNEL);
 + if (!boost_freqs) {
 + dev_warn(dev, %s: no memory for boost freq table\n,
 + __func__);
 + ret = -ENOMEM;
 + goto err_boost;
 + }
 + of_property_read_u32_array(dev-of_node, boost-frequency,
 + boost_freqs, len / sizeof(u32));
 + }
 +
   list_for_each_entry(opp, dev_opp-opp_list, node) {
   if (opp-available) {
   freq_table[i].driver_data = i;
   freq_table[i].frequency = opp-rate / 1000;
 + for (j = 0; j  len / sizeof(u32)  boost_freqs; 
 j++) {
 + if (boost_freqs[j] == 
 freq_table[i].frequency) {
 + freq_table[i].driver_data =
 + CPUFREQ_BOOST_FREQ;
 + break;
 + }
 + }
   i++;
   }
   }
 IIRC you had mentioned that the boost-opp was not limited to be a cpufreq, 
 but
 this change seems to be cpufreq only.
 
 Yes, but as you have initiated the discussion on extending the OPP
 binding, this has been limited to cpufreq only. If the new OPP library
 has support for listing boost frequency, this can be migrated to the
 new OPP libaray.
 

Fair enough, just wanted to check as I couldn't get the info following the
thread. I might have missed it.

Regards,
Sudeep


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


Re: [PATCH v2 1/2] PM / OPP: Allow boost frequency to be looked up from device tree

2014-02-09 Thread Lukasz Majewski
Hi Thomas, Sudeep

 On Fri, Feb 7, 2014 at 9:31 PM, Sudeep Holla sudeep.ho...@arm.com
 wrote:
  On 07/02/14 15:19, Thomas Abraham wrote:
  From: Thomas Abraham thomas...@samsung.com
 
  Commit 6f19efc0 (cpufreq: Add boost frequency support in core)
  adds support for CPU boost mode. This patch adds support for
  finding available boost frequencies from device tree and marking
  them as usable in boost mode.
 
  Cc: Nishanth Menon n...@ti.com
  Cc: Lukasz Majewski l.majew...@samsung.com
  Signed-off-by: Thomas Abraham thomas...@samsung.com
  ---
   drivers/base/power/opp.c |   34 +-
   1 file changed, 33 insertions(+), 1 deletion(-)
 
  diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
  index fa41874..b636826 100644
  --- a/drivers/base/power/opp.c
  +++ b/drivers/base/power/opp.c
  @@ -628,7 +628,8 @@ int dev_pm_opp_init_cpufreq_table(struct
  device *dev, struct device_opp *dev_opp;
struct dev_pm_opp *opp;
struct cpufreq_frequency_table *freq_table;
  - int i = 0;
  + int i = 0, j, len, ret;
  + u32 *boost_freqs = NULL;
 
/* Pretend as if I am an updater */
mutex_lock(dev_opp_list_lock);
  @@ -650,10 +651,35 @@ int dev_pm_opp_init_cpufreq_table(struct
  device *dev, return -ENOMEM;
}
 
  + if (of_find_property(dev-of_node, boost-frequency, len))
  {
  + if (len == 0 || (len  (sizeof(u32) - 1)) != 0) {
  + dev_err(dev, %s: invalid boost
  frequency\n, __func__);
  + ret = -EINVAL;
  + goto err_boost;
  + }
  +
  + boost_freqs = kzalloc(len, GFP_KERNEL);
  + if (!boost_freqs) {
  + dev_warn(dev, %s: no memory for boost freq
  table\n,
  + __func__);
  + ret = -ENOMEM;
  + goto err_boost;
  + }
  + of_property_read_u32_array(dev-of_node,
  boost-frequency,
  + boost_freqs, len / sizeof(u32));
  + }
  +
list_for_each_entry(opp, dev_opp-opp_list, node) {
if (opp-available) {
freq_table[i].driver_data = i;
freq_table[i].frequency = opp-rate / 1000;
  + for (j = 0; j  len / sizeof(u32) 
  boost_freqs; j++) {
  + if (boost_freqs[j] ==
  freq_table[i].frequency) {
  + freq_table[i].driver_data =
  +
  CPUFREQ_BOOST_FREQ;
  + break;
  + }
  + }
i++;
}
}
  IIRC you had mentioned that the boost-opp was not limited to be a
  cpufreq, but this change seems to be cpufreq only.
 
 Yes, but as you have initiated the discussion on extending the OPP
 binding, this has been limited to cpufreq only. If the new OPP library
 has support for listing boost frequency, this can be migrated to the
 new OPP libaray.

I agree here with Thomas. Since we are fixing regression here, we shall
use the existing OPP API. When agreement for the future OPPs format is
in place, we will port the boost OPPs to it.

 
 Thanks,
 Thomas.
 
 
  Regards,
  Sudeep
 
 
 ___
 linux-arm-kernel mailing list
 linux-arm-ker...@lists.infradead.org
 http://lists.infradead.org/mailman/listinfo/linux-arm-kernel



-- 
Best regards,

Lukasz Majewski

Samsung RD Institute Poland (SRPOL) | Linux Platform Group
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 1/2] PM / OPP: Allow boost frequency to be looked up from device tree

2014-02-07 Thread Thomas Abraham
From: Thomas Abraham thomas...@samsung.com

Commit 6f19efc0 (cpufreq: Add boost frequency support in core) adds
support for CPU boost mode. This patch adds support for finding available
boost frequencies from device tree and marking them as usable in boost mode.

Cc: Nishanth Menon n...@ti.com
Cc: Lukasz Majewski l.majew...@samsung.com
Signed-off-by: Thomas Abraham thomas...@samsung.com
---
 drivers/base/power/opp.c |   34 +-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index fa41874..b636826 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -628,7 +628,8 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
struct device_opp *dev_opp;
struct dev_pm_opp *opp;
struct cpufreq_frequency_table *freq_table;
-   int i = 0;
+   int i = 0, j, len, ret;
+   u32 *boost_freqs = NULL;
 
/* Pretend as if I am an updater */
mutex_lock(dev_opp_list_lock);
@@ -650,10 +651,35 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
return -ENOMEM;
}
 
+   if (of_find_property(dev-of_node, boost-frequency, len)) {
+   if (len == 0 || (len  (sizeof(u32) - 1)) != 0) {
+   dev_err(dev, %s: invalid boost frequency\n, __func__);
+   ret = -EINVAL;
+   goto err_boost;
+   }
+
+   boost_freqs = kzalloc(len, GFP_KERNEL);
+   if (!boost_freqs) {
+   dev_warn(dev, %s: no memory for boost freq table\n,
+   __func__);
+   ret = -ENOMEM;
+   goto err_boost;
+   }
+   of_property_read_u32_array(dev-of_node, boost-frequency,
+   boost_freqs, len / sizeof(u32));
+   }
+
list_for_each_entry(opp, dev_opp-opp_list, node) {
if (opp-available) {
freq_table[i].driver_data = i;
freq_table[i].frequency = opp-rate / 1000;
+   for (j = 0; j  len / sizeof(u32)  boost_freqs; j++) {
+   if (boost_freqs[j] == freq_table[i].frequency) {
+   freq_table[i].driver_data =
+   CPUFREQ_BOOST_FREQ;
+   break;
+   }
+   }
i++;
}
}
@@ -663,8 +689,14 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
freq_table[i].frequency = CPUFREQ_TABLE_END;
 
*table = freq_table[0];
+   kfree(boost_freqs);
 
return 0;
+
+err_boost:
+   kfree(freq_table);
+   mutex_unlock(dev_opp_list_lock);
+   return ret;
 }
 EXPORT_SYMBOL_GPL(dev_pm_opp_init_cpufreq_table);
 
-- 
1.7.10.4

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


Re: [PATCH v2 1/2] PM / OPP: Allow boost frequency to be looked up from device tree

2014-02-07 Thread Nishanth Menon
On Fri, Feb 7, 2014 at 9:19 AM, Thomas Abraham ta.oma...@gmail.com wrote:
 From: Thomas Abraham thomas...@samsung.com

 Commit 6f19efc0 (cpufreq: Add boost frequency support in core) adds
 support for CPU boost mode. This patch adds support for finding available
 boost frequencies from device tree and marking them as usable in boost mode.

 Cc: Nishanth Menon n...@ti.com
 Cc: Lukasz Majewski l.majew...@samsung.com
 Signed-off-by: Thomas Abraham thomas...@samsung.com
 ---
  drivers/base/power/opp.c |   34 +-
  1 file changed, 33 insertions(+), 1 deletion(-)

 diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
 index fa41874..b636826 100644
 --- a/drivers/base/power/opp.c
 +++ b/drivers/base/power/opp.c
 @@ -628,7 +628,8 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
 struct device_opp *dev_opp;
 struct dev_pm_opp *opp;
 struct cpufreq_frequency_table *freq_table;
 -   int i = 0;
 +   int i = 0, j, len, ret;
 +   u32 *boost_freqs = NULL;

 /* Pretend as if I am an updater */
 mutex_lock(dev_opp_list_lock);
 @@ -650,10 +651,35 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
 return -ENOMEM;
 }

 +   if (of_find_property(dev-of_node, boost-frequency, len)) {
 +   if (len == 0 || (len  (sizeof(u32) - 1)) != 0) {
 +   dev_err(dev, %s: invalid boost frequency\n, 
 __func__);
 +   ret = -EINVAL;
 +   goto err_boost;
 +   }
 +
 +   boost_freqs = kzalloc(len, GFP_KERNEL);
 +   if (!boost_freqs) {
 +   dev_warn(dev, %s: no memory for boost freq table\n,
 +   __func__);
 +   ret = -ENOMEM;
 +   goto err_boost;
 +   }
 +   of_property_read_u32_array(dev-of_node, boost-frequency,
 +   boost_freqs, len / sizeof(u32));
 +   }
 +
 list_for_each_entry(opp, dev_opp-opp_list, node) {
 if (opp-available) {
 freq_table[i].driver_data = i;
 freq_table[i].frequency = opp-rate / 1000;
 +   for (j = 0; j  len / sizeof(u32)  boost_freqs; 
 j++) {
 +   if (boost_freqs[j] == 
 freq_table[i].frequency) {
 +   freq_table[i].driver_data =
 +   CPUFREQ_BOOST_FREQ;
 +   break;
 +   }
 +   }

What if any one of the boost_freqs are not contained in the enabled frequencies?

 i++;
 }
 }
 @@ -663,8 +689,14 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
 freq_table[i].frequency = CPUFREQ_TABLE_END;

 *table = freq_table[0];
 +   kfree(boost_freqs);

 return 0;
 +
 +err_boost:
 +   kfree(freq_table);
 +   mutex_unlock(dev_opp_list_lock);
 +   return ret;
  }
  EXPORT_SYMBOL_GPL(dev_pm_opp_init_cpufreq_table);

 --
 1.7.10.4

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


Re: [PATCH v2 1/2] PM / OPP: Allow boost frequency to be looked up from device tree

2014-02-07 Thread Thomas Abraham
On Fri, Feb 7, 2014 at 8:59 PM, Nishanth Menon n...@ti.com wrote:
 On Fri, Feb 7, 2014 at 9:19 AM, Thomas Abraham ta.oma...@gmail.com wrote:
 From: Thomas Abraham thomas...@samsung.com

 Commit 6f19efc0 (cpufreq: Add boost frequency support in core) adds
 support for CPU boost mode. This patch adds support for finding available
 boost frequencies from device tree and marking them as usable in boost mode.

 Cc: Nishanth Menon n...@ti.com
 Cc: Lukasz Majewski l.majew...@samsung.com
 Signed-off-by: Thomas Abraham thomas...@samsung.com
 ---
  drivers/base/power/opp.c |   34 +-
  1 file changed, 33 insertions(+), 1 deletion(-)

 diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
 index fa41874..b636826 100644
 --- a/drivers/base/power/opp.c
 +++ b/drivers/base/power/opp.c
 @@ -628,7 +628,8 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
 struct device_opp *dev_opp;
 struct dev_pm_opp *opp;
 struct cpufreq_frequency_table *freq_table;
 -   int i = 0;
 +   int i = 0, j, len, ret;
 +   u32 *boost_freqs = NULL;

 /* Pretend as if I am an updater */
 mutex_lock(dev_opp_list_lock);
 @@ -650,10 +651,35 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
 return -ENOMEM;
 }

 +   if (of_find_property(dev-of_node, boost-frequency, len)) {
 +   if (len == 0 || (len  (sizeof(u32) - 1)) != 0) {
 +   dev_err(dev, %s: invalid boost frequency\n, 
 __func__);
 +   ret = -EINVAL;
 +   goto err_boost;
 +   }
 +
 +   boost_freqs = kzalloc(len, GFP_KERNEL);
 +   if (!boost_freqs) {
 +   dev_warn(dev, %s: no memory for boost freq table\n,
 +   __func__);
 +   ret = -ENOMEM;
 +   goto err_boost;
 +   }
 +   of_property_read_u32_array(dev-of_node, boost-frequency,
 +   boost_freqs, len / sizeof(u32));
 +   }
 +
 list_for_each_entry(opp, dev_opp-opp_list, node) {
 if (opp-available) {
 freq_table[i].driver_data = i;
 freq_table[i].frequency = opp-rate / 1000;
 +   for (j = 0; j  len / sizeof(u32)  boost_freqs; 
 j++) {
 +   if (boost_freqs[j] == 
 freq_table[i].frequency) {
 +   freq_table[i].driver_data =
 +   CPUFREQ_BOOST_FREQ;
 +   break;
 +   }
 +   }

 What if any one of the boost_freqs are not contained in the enabled 
 frequencies?

It is not used as a boost frequency because its corresponding voltage
is not known. If required a warning can be printed out for the same.

Thanks,
Thomas.


 i++;
 }
 }
 @@ -663,8 +689,14 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
 freq_table[i].frequency = CPUFREQ_TABLE_END;

 *table = freq_table[0];
 +   kfree(boost_freqs);

 return 0;
 +
 +err_boost:
 +   kfree(freq_table);
 +   mutex_unlock(dev_opp_list_lock);
 +   return ret;
  }
  EXPORT_SYMBOL_GPL(dev_pm_opp_init_cpufreq_table);

 --
 1.7.10.4

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


Re: [PATCH v2 1/2] PM / OPP: Allow boost frequency to be looked up from device tree

2014-02-07 Thread Nishanth Menon
On 02/07/2014 09:38 AM, Thomas Abraham wrote:
[...]
 diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
 index fa41874..b636826 100644
 --- a/drivers/base/power/opp.c
 +++ b/drivers/base/power/opp.c
 @@ -628,7 +628,8 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
 struct device_opp *dev_opp;
 struct dev_pm_opp *opp;
 struct cpufreq_frequency_table *freq_table;
 -   int i = 0;
 +   int i = 0, j, len, ret;
 +   u32 *boost_freqs = NULL;

 /* Pretend as if I am an updater */
 mutex_lock(dev_opp_list_lock);
 @@ -650,10 +651,35 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
 return -ENOMEM;
 }

 +   if (of_find_property(dev-of_node, boost-frequency, len)) {
 +   if (len == 0 || (len  (sizeof(u32) - 1)) != 0) {
 +   dev_err(dev, %s: invalid boost frequency\n, 
 __func__);
 +   ret = -EINVAL;
 +   goto err_boost;
 +   }
 +
 +   boost_freqs = kzalloc(len, GFP_KERNEL);
 +   if (!boost_freqs) {
 +   dev_warn(dev, %s: no memory for boost freq 
 table\n,
 +   __func__);
 +   ret = -ENOMEM;
 +   goto err_boost;
 +   }
 +   of_property_read_u32_array(dev-of_node, boost-frequency,
 +   boost_freqs, len / sizeof(u32));
 +   }
 +
 list_for_each_entry(opp, dev_opp-opp_list, node) {
 if (opp-available) {
 freq_table[i].driver_data = i;
 freq_table[i].frequency = opp-rate / 1000;
 +   for (j = 0; j  len / sizeof(u32)  boost_freqs; 
 j++) {
 +   if (boost_freqs[j] == 
 freq_table[i].frequency) {
 +   freq_table[i].driver_data =
 +   CPUFREQ_BOOST_FREQ;
 +   break;
 +   }
 +   }

 What if any one of the boost_freqs are not contained in the enabled 
 frequencies?
 
 It is not used as a boost frequency because its corresponding voltage
 is not known. If required a warning can be printed out for the same.

yes - that would be good, as it helps debug if there are developer
errors in dts.


-- 
Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/2] PM / OPP: Allow boost frequency to be looked up from device tree

2014-02-07 Thread Sudeep Holla
On 07/02/14 15:19, Thomas Abraham wrote:
 From: Thomas Abraham thomas...@samsung.com
 
 Commit 6f19efc0 (cpufreq: Add boost frequency support in core) adds
 support for CPU boost mode. This patch adds support for finding available
 boost frequencies from device tree and marking them as usable in boost mode.
 
 Cc: Nishanth Menon n...@ti.com
 Cc: Lukasz Majewski l.majew...@samsung.com
 Signed-off-by: Thomas Abraham thomas...@samsung.com
 ---
  drivers/base/power/opp.c |   34 +-
  1 file changed, 33 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
 index fa41874..b636826 100644
 --- a/drivers/base/power/opp.c
 +++ b/drivers/base/power/opp.c
 @@ -628,7 +628,8 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
   struct device_opp *dev_opp;
   struct dev_pm_opp *opp;
   struct cpufreq_frequency_table *freq_table;
 - int i = 0;
 + int i = 0, j, len, ret;
 + u32 *boost_freqs = NULL;
  
   /* Pretend as if I am an updater */
   mutex_lock(dev_opp_list_lock);
 @@ -650,10 +651,35 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
   return -ENOMEM;
   }
  
 + if (of_find_property(dev-of_node, boost-frequency, len)) {
 + if (len == 0 || (len  (sizeof(u32) - 1)) != 0) {
 + dev_err(dev, %s: invalid boost frequency\n, __func__);
 + ret = -EINVAL;
 + goto err_boost;
 + }
 +
 + boost_freqs = kzalloc(len, GFP_KERNEL);
 + if (!boost_freqs) {
 + dev_warn(dev, %s: no memory for boost freq table\n,
 + __func__);
 + ret = -ENOMEM;
 + goto err_boost;
 + }
 + of_property_read_u32_array(dev-of_node, boost-frequency,
 + boost_freqs, len / sizeof(u32));
 + }
 +
   list_for_each_entry(opp, dev_opp-opp_list, node) {
   if (opp-available) {
   freq_table[i].driver_data = i;
   freq_table[i].frequency = opp-rate / 1000;
 + for (j = 0; j  len / sizeof(u32)  boost_freqs; j++) {
 + if (boost_freqs[j] == freq_table[i].frequency) {
 + freq_table[i].driver_data =
 + CPUFREQ_BOOST_FREQ;
 + break;
 + }
 + }
   i++;
   }
   }
IIRC you had mentioned that the boost-opp was not limited to be a cpufreq, but
this change seems to be cpufreq only.

Regards,
Sudeep

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


Re: [PATCH v2 1/2] PM / OPP: Allow boost frequency to be looked up from device tree

2014-02-07 Thread Thomas Abraham
On Fri, Feb 7, 2014 at 9:31 PM, Sudeep Holla sudeep.ho...@arm.com wrote:
 On 07/02/14 15:19, Thomas Abraham wrote:
 From: Thomas Abraham thomas...@samsung.com

 Commit 6f19efc0 (cpufreq: Add boost frequency support in core) adds
 support for CPU boost mode. This patch adds support for finding available
 boost frequencies from device tree and marking them as usable in boost mode.

 Cc: Nishanth Menon n...@ti.com
 Cc: Lukasz Majewski l.majew...@samsung.com
 Signed-off-by: Thomas Abraham thomas...@samsung.com
 ---
  drivers/base/power/opp.c |   34 +-
  1 file changed, 33 insertions(+), 1 deletion(-)

 diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
 index fa41874..b636826 100644
 --- a/drivers/base/power/opp.c
 +++ b/drivers/base/power/opp.c
 @@ -628,7 +628,8 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
   struct device_opp *dev_opp;
   struct dev_pm_opp *opp;
   struct cpufreq_frequency_table *freq_table;
 - int i = 0;
 + int i = 0, j, len, ret;
 + u32 *boost_freqs = NULL;

   /* Pretend as if I am an updater */
   mutex_lock(dev_opp_list_lock);
 @@ -650,10 +651,35 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
   return -ENOMEM;
   }

 + if (of_find_property(dev-of_node, boost-frequency, len)) {
 + if (len == 0 || (len  (sizeof(u32) - 1)) != 0) {
 + dev_err(dev, %s: invalid boost frequency\n, 
 __func__);
 + ret = -EINVAL;
 + goto err_boost;
 + }
 +
 + boost_freqs = kzalloc(len, GFP_KERNEL);
 + if (!boost_freqs) {
 + dev_warn(dev, %s: no memory for boost freq table\n,
 + __func__);
 + ret = -ENOMEM;
 + goto err_boost;
 + }
 + of_property_read_u32_array(dev-of_node, boost-frequency,
 + boost_freqs, len / sizeof(u32));
 + }
 +
   list_for_each_entry(opp, dev_opp-opp_list, node) {
   if (opp-available) {
   freq_table[i].driver_data = i;
   freq_table[i].frequency = opp-rate / 1000;
 + for (j = 0; j  len / sizeof(u32)  boost_freqs; j++) 
 {
 + if (boost_freqs[j] == freq_table[i].frequency) 
 {
 + freq_table[i].driver_data =
 + CPUFREQ_BOOST_FREQ;
 + break;
 + }
 + }
   i++;
   }
   }
 IIRC you had mentioned that the boost-opp was not limited to be a cpufreq, but
 this change seems to be cpufreq only.

Yes, but as you have initiated the discussion on extending the OPP
binding, this has been limited to cpufreq only. If the new OPP library
has support for listing boost frequency, this can be migrated to the
new OPP libaray.

Thanks,
Thomas.


 Regards,
 Sudeep

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