Commit 9784d2fb authored by Lukasz Luba's avatar Lukasz Luba Committed by Daniel Lezcano

drivers/thermal/cpufreq_cooling: Update outdated comments

The code has moved and left some comments stale. Update them where
there is a need.
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarLukasz Luba <lukasz.luba@arm.com>
Link: https://lore.kernel.org/r/20220613124327.30766-4-lukasz.luba@arm.comSigned-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent 3f7ced7a
...@@ -206,7 +206,7 @@ static u32 get_dynamic_power(struct cpufreq_cooling_device *cpufreq_cdev, ...@@ -206,7 +206,7 @@ static u32 get_dynamic_power(struct cpufreq_cooling_device *cpufreq_cdev,
* complex code may be needed if experiments show that it's not * complex code may be needed if experiments show that it's not
* accurate enough. * accurate enough.
* *
* Return: 0 on success, -E* if getting the static power failed. * Return: 0 on success, this function doesn't fail.
*/ */
static int cpufreq_get_requested_power(struct thermal_cooling_device *cdev, static int cpufreq_get_requested_power(struct thermal_cooling_device *cdev,
u32 *power) u32 *power)
...@@ -249,9 +249,8 @@ static int cpufreq_get_requested_power(struct thermal_cooling_device *cdev, ...@@ -249,9 +249,8 @@ static int cpufreq_get_requested_power(struct thermal_cooling_device *cdev,
* milliwatts assuming 100% load. Store the calculated power in * milliwatts assuming 100% load. Store the calculated power in
* @power. * @power.
* *
* Return: 0 on success, -EINVAL if the cooling device state could not * Return: 0 on success, -EINVAL if the cooling device state is bigger
* be converted into a frequency or other -E* if there was an error * than maximum allowed.
* when calculating the static power.
*/ */
static int cpufreq_state2power(struct thermal_cooling_device *cdev, static int cpufreq_state2power(struct thermal_cooling_device *cdev,
unsigned long state, u32 *power) unsigned long state, u32 *power)
...@@ -281,15 +280,11 @@ static int cpufreq_state2power(struct thermal_cooling_device *cdev, ...@@ -281,15 +280,11 @@ static int cpufreq_state2power(struct thermal_cooling_device *cdev,
* Calculate a cooling device state for the cpus described by @cdev * Calculate a cooling device state for the cpus described by @cdev
* that would allow them to consume at most @power mW and store it in * that would allow them to consume at most @power mW and store it in
* @state. Note that this calculation depends on external factors * @state. Note that this calculation depends on external factors
* such as the cpu load or the current static power. Calling this * such as the CPUs load. Calling this function with the same power
* function with the same power as input can yield different cooling * as input can yield different cooling device states depending on those
* device states depending on those external factors. * external factors.
* *
* Return: 0 on success, -ENODEV if no cpus are online or -EINVAL if * Return: 0 on success, this function doesn't fail.
* the calculated frequency could not be converted to a valid state.
* The latter should not happen unless the frequencies available to
* cpufreq have changed since the initialization of the cpu cooling
* device.
*/ */
static int cpufreq_power2state(struct thermal_cooling_device *cdev, static int cpufreq_power2state(struct thermal_cooling_device *cdev,
u32 power, unsigned long *state) u32 power, unsigned long *state)
...@@ -401,7 +396,7 @@ static unsigned int get_state_freq(struct cpufreq_cooling_device *cpufreq_cdev, ...@@ -401,7 +396,7 @@ static unsigned int get_state_freq(struct cpufreq_cooling_device *cpufreq_cdev,
* Callback for the thermal cooling device to return the cpufreq * Callback for the thermal cooling device to return the cpufreq
* max cooling state. * max cooling state.
* *
* Return: 0 on success, an error code otherwise. * Return: 0 on success, this function doesn't fail.
*/ */
static int cpufreq_get_max_state(struct thermal_cooling_device *cdev, static int cpufreq_get_max_state(struct thermal_cooling_device *cdev,
unsigned long *state) unsigned long *state)
...@@ -420,7 +415,7 @@ static int cpufreq_get_max_state(struct thermal_cooling_device *cdev, ...@@ -420,7 +415,7 @@ static int cpufreq_get_max_state(struct thermal_cooling_device *cdev,
* Callback for the thermal cooling device to return the cpufreq * Callback for the thermal cooling device to return the cpufreq
* current cooling state. * current cooling state.
* *
* Return: 0 on success, an error code otherwise. * Return: 0 on success, this function doesn't fail.
*/ */
static int cpufreq_get_cur_state(struct thermal_cooling_device *cdev, static int cpufreq_get_cur_state(struct thermal_cooling_device *cdev,
unsigned long *state) unsigned long *state)
...@@ -479,7 +474,7 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, ...@@ -479,7 +474,7 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev,
* @em: Energy Model of the cpufreq policy * @em: Energy Model of the cpufreq policy
* *
* This interface function registers the cpufreq cooling device with the name * This interface function registers the cpufreq cooling device with the name
* "thermal-cpufreq-%x". This api can support multiple instances of cpufreq * "cpufreq-%s". This API can support multiple instances of cpufreq
* cooling devices. It also gives the opportunity to link the cooling device * cooling devices. It also gives the opportunity to link the cooling device
* with a device tree node, in order to bind it via the thermal DT code. * with a device tree node, in order to bind it via the thermal DT code.
* *
...@@ -590,8 +585,8 @@ __cpufreq_cooling_register(struct device_node *np, ...@@ -590,8 +585,8 @@ __cpufreq_cooling_register(struct device_node *np,
* @policy: cpufreq policy * @policy: cpufreq policy
* *
* This interface function registers the cpufreq cooling device with the name * This interface function registers the cpufreq cooling device with the name
* "thermal-cpufreq-%x". This api can support multiple instances of cpufreq * "cpufreq-%s". This API can support multiple instances of cpufreq cooling
* cooling devices. * devices.
* *
* Return: a valid struct thermal_cooling_device pointer on success, * Return: a valid struct thermal_cooling_device pointer on success,
* on failure, it returns a corresponding ERR_PTR(). * on failure, it returns a corresponding ERR_PTR().
...@@ -608,17 +603,14 @@ EXPORT_SYMBOL_GPL(cpufreq_cooling_register); ...@@ -608,17 +603,14 @@ EXPORT_SYMBOL_GPL(cpufreq_cooling_register);
* @policy: cpufreq policy * @policy: cpufreq policy
* *
* This interface function registers the cpufreq cooling device with the name * This interface function registers the cpufreq cooling device with the name
* "thermal-cpufreq-%x". This api can support multiple instances of cpufreq * "cpufreq-%s". This API can support multiple instances of cpufreq cooling
* cooling devices. Using this API, the cpufreq cooling device will be * devices. Using this API, the cpufreq cooling device will be linked to the
* linked to the device tree node provided. * device tree node provided.
* *
* Using this function, the cooling device will implement the power * Using this function, the cooling device will implement the power
* extensions by using a simple cpu power model. The cpus must have * extensions by using the Energy Model (if present). The cpus must have
* registered their OPPs using the OPP library. * registered their OPPs using the OPP library.
* *
* It also takes into account, if property present in policy CPU node, the
* static power consumed by the cpu.
*
* Return: a valid struct thermal_cooling_device pointer on success, * Return: a valid struct thermal_cooling_device pointer on success,
* and NULL on failure. * and NULL on failure.
*/ */
...@@ -654,7 +646,7 @@ EXPORT_SYMBOL_GPL(of_cpufreq_cooling_register); ...@@ -654,7 +646,7 @@ EXPORT_SYMBOL_GPL(of_cpufreq_cooling_register);
* cpufreq_cooling_unregister - function to remove cpufreq cooling device. * cpufreq_cooling_unregister - function to remove cpufreq cooling device.
* @cdev: thermal cooling device pointer. * @cdev: thermal cooling device pointer.
* *
* This interface function unregisters the "thermal-cpufreq-%x" cooling device. * This interface function unregisters the "cpufreq-%x" cooling device.
*/ */
void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment