• Home
  • Raw
  • Download

Lines Matching +full:opp +full:- +full:table

2  * Generic OPP helper interface for CPU device
4 * Copyright (C) 2009-2014 Texas Instruments Incorporated.
23 #include "opp.h"
28 * dev_pm_opp_init_cpufreq_table() - create a cpufreq table for a device
30 * @table: Cpufreq table returned back to caller
32 * Generate a cpufreq table for a provided device- this assumes that the
33 * opp table is already initialized and ready for usage.
35 * This function allocates required memory for the cpufreq table. It is
37 * the table as required.
39 * Returns -EINVAL for bad pointers, -ENODEV if the device is not found, -ENOMEM
40 * if no memory available for the operation (table is not populated), returns 0
41 * if successful and table is populated.
44 * the table if any of the mentioned functions have been invoked in the interim.
47 struct cpufreq_frequency_table **table) in dev_pm_opp_init_cpufreq_table() argument
49 struct dev_pm_opp *opp; in dev_pm_opp_init_cpufreq_table() local
56 return max_opps ? max_opps : -ENODATA; in dev_pm_opp_init_cpufreq_table()
60 return -ENOMEM; in dev_pm_opp_init_cpufreq_table()
64 opp = dev_pm_opp_find_freq_ceil(dev, &rate); in dev_pm_opp_init_cpufreq_table()
65 if (IS_ERR(opp)) { in dev_pm_opp_init_cpufreq_table()
66 ret = PTR_ERR(opp); in dev_pm_opp_init_cpufreq_table()
72 /* Is Boost/turbo opp ? */ in dev_pm_opp_init_cpufreq_table()
73 if (dev_pm_opp_is_turbo(opp)) in dev_pm_opp_init_cpufreq_table()
76 dev_pm_opp_put(opp); in dev_pm_opp_init_cpufreq_table()
82 *table = &freq_table[0]; in dev_pm_opp_init_cpufreq_table()
93 * dev_pm_opp_free_cpufreq_table() - free the cpufreq table
95 * @table: table to free
97 * Free up the table allocated by dev_pm_opp_init_cpufreq_table
100 struct cpufreq_frequency_table **table) in dev_pm_opp_free_cpufreq_table() argument
102 if (!table) in dev_pm_opp_free_cpufreq_table()
105 kfree(*table); in dev_pm_opp_free_cpufreq_table()
106 *table = NULL; in dev_pm_opp_free_cpufreq_table()
134 * dev_pm_opp_cpumask_remove_table() - Removes OPP table for @cpumask
135 * @cpumask: cpumask for which OPP table needs to be removed
137 * This removes the OPP tables for CPUs present in the @cpumask.
148 * dev_pm_opp_set_sharing_cpus() - Mark OPP table as shared by few CPUs
150 * @cpumask: cpumask of the CPUs which share the OPP table with @cpu_dev
152 * This marks OPP table of the @cpu_dev as shared by the CPUs present in
155 * Returns -ENODEV if OPP table isn't already present.
170 if (cpu == cpu_dev->id) in dev_pm_opp_set_sharing_cpus()
182 dev_err(dev, "%s: failed to add opp-dev for cpu%d device\n", in dev_pm_opp_set_sharing_cpus()
187 /* Mark opp-table as multiple CPUs are sharing it now */ in dev_pm_opp_set_sharing_cpus()
188 opp_table->shared_opp = OPP_TABLE_ACCESS_SHARED; in dev_pm_opp_set_sharing_cpus()
198 * dev_pm_opp_get_sharing_cpus() - Get cpumask of CPUs sharing OPPs with @cpu_dev
204 * Returns -ENODEV if OPP table isn't already present and -EINVAL if the OPP
205 * table's status is access-unknown.
217 if (opp_table->shared_opp == OPP_TABLE_ACCESS_UNKNOWN) { in dev_pm_opp_get_sharing_cpus()
218 ret = -EINVAL; in dev_pm_opp_get_sharing_cpus()
224 if (opp_table->shared_opp == OPP_TABLE_ACCESS_SHARED) { in dev_pm_opp_get_sharing_cpus()
225 list_for_each_entry(opp_dev, &opp_table->dev_list, node) in dev_pm_opp_get_sharing_cpus()
226 cpumask_set_cpu(opp_dev->dev->id, cpumask); in dev_pm_opp_get_sharing_cpus()
228 cpumask_set_cpu(cpu_dev->id, cpumask); in dev_pm_opp_get_sharing_cpus()