@@ -18,6 +18,7 @@
#include <linux/cpufreq.h>
#include <plat/common.h>
+#include <plat/voltage.h>
/**
* struct omap_opp_def - OMAP OPP Definition
@@ -86,6 +87,9 @@ int opp_disable(struct omap_opp *opp);
void opp_init_cpufreq_table(struct device *dev,
struct cpufreq_frequency_table **table);
+
+struct device **opp_init_voltage_params(struct voltagedomain *voltdm,
+ int *dev_count);
#else
static inline unsigned long opp_get_voltage(const struct omap_opp *opp)
{
@@ -149,5 +153,10 @@ void opp_init_cpufreq_table(struct omap_opp *opps,
{
}
+static inline struct device **opp_init_voltage_params(
+ struct voltagedomain *voltdm, int *dev_count)
+{
+}
+
#endif /* CONFIG_PM */
#endif /* __ASM_ARM_OMAP_OPP_H */
@@ -502,3 +502,31 @@ void opp_init_cpufreq_table(struct device *dev,
*table = &freq_table[0];
}
+
+struct device **opp_init_voltage_params(struct voltagedomain *voltdm,
+ int *dev_count)
+{
+ struct device_opp *dev_opp;
+ struct device **dev_list;
+ int count = 0, i = 0;
+
+ list_for_each_entry(dev_opp, &dev_opp_list, node) {
+ if (!dev_opp->oh->vdd_name)
+ continue;
+
+ if (!strcmp(dev_opp->oh->vdd_name, voltdm->name)) {
+ dev_opp->oh->voltdm = voltdm;
+ count++;
+ }
+ }
+
+ dev_list = kzalloc(sizeof(struct device *) * count, GFP_KERNEL);
+
+ list_for_each_entry(dev_opp, &dev_opp_list, node) {
+ if (dev_opp->oh->voltdm == voltdm)
+ dev_list[i++] = dev_opp->dev;
+ }
+
+ *dev_count = count;
+ return dev_list;
+}