cpufreq_cdev 107 drivers/thermal/cpu_cooling.c static unsigned long get_level(struct cpufreq_cooling_device *cpufreq_cdev, cpufreq_cdev 110 drivers/thermal/cpu_cooling.c struct freq_table *freq_table = cpufreq_cdev->freq_table; cpufreq_cdev 113 drivers/thermal/cpu_cooling.c for (level = 1; level <= cpufreq_cdev->max_level; level++) cpufreq_cdev 133 drivers/thermal/cpu_cooling.c static int update_freq_table(struct cpufreq_cooling_device *cpufreq_cdev, cpufreq_cdev 136 drivers/thermal/cpu_cooling.c struct freq_table *freq_table = cpufreq_cdev->freq_table; cpufreq_cdev 139 drivers/thermal/cpu_cooling.c int num_opps = 0, cpu = cpufreq_cdev->policy->cpu, i; cpufreq_cdev 155 drivers/thermal/cpu_cooling.c if (num_opps != cpufreq_cdev->max_level + 1) { cpufreq_cdev 160 drivers/thermal/cpu_cooling.c for (i = 0; i <= cpufreq_cdev->max_level; i++) { cpufreq_cdev 194 drivers/thermal/cpu_cooling.c static u32 cpu_freq_to_power(struct cpufreq_cooling_device *cpufreq_cdev, cpufreq_cdev 198 drivers/thermal/cpu_cooling.c struct freq_table *freq_table = cpufreq_cdev->freq_table; cpufreq_cdev 200 drivers/thermal/cpu_cooling.c for (i = 1; i <= cpufreq_cdev->max_level; i++) cpufreq_cdev 207 drivers/thermal/cpu_cooling.c static u32 cpu_power_to_freq(struct cpufreq_cooling_device *cpufreq_cdev, cpufreq_cdev 211 drivers/thermal/cpu_cooling.c struct freq_table *freq_table = cpufreq_cdev->freq_table; cpufreq_cdev 213 drivers/thermal/cpu_cooling.c for (i = 1; i <= cpufreq_cdev->max_level; i++) cpufreq_cdev 229 drivers/thermal/cpu_cooling.c static u32 get_load(struct cpufreq_cooling_device *cpufreq_cdev, int cpu, cpufreq_cdev 234 drivers/thermal/cpu_cooling.c struct time_in_idle *idle_time = &cpufreq_cdev->idle_time[cpu_idx]; cpufreq_cdev 259 drivers/thermal/cpu_cooling.c static u32 get_dynamic_power(struct cpufreq_cooling_device *cpufreq_cdev, cpufreq_cdev 264 drivers/thermal/cpu_cooling.c raw_cpu_power = cpu_freq_to_power(cpufreq_cdev, freq); cpufreq_cdev 265 drivers/thermal/cpu_cooling.c return (raw_cpu_power * cpufreq_cdev->last_load) / 100; cpufreq_cdev 283 drivers/thermal/cpu_cooling.c struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata; cpufreq_cdev 285 drivers/thermal/cpu_cooling.c *state = cpufreq_cdev->max_level; cpufreq_cdev 302 drivers/thermal/cpu_cooling.c struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata; cpufreq_cdev 304 drivers/thermal/cpu_cooling.c *state = cpufreq_cdev->cpufreq_state; cpufreq_cdev 322 drivers/thermal/cpu_cooling.c struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata; cpufreq_cdev 325 drivers/thermal/cpu_cooling.c if (WARN_ON(state > cpufreq_cdev->max_level)) cpufreq_cdev 329 drivers/thermal/cpu_cooling.c if (cpufreq_cdev->cpufreq_state == state) cpufreq_cdev 332 drivers/thermal/cpu_cooling.c cpufreq_cdev->cpufreq_state = state; cpufreq_cdev 334 drivers/thermal/cpu_cooling.c return freq_qos_update_request(&cpufreq_cdev->qos_req, cpufreq_cdev 335 drivers/thermal/cpu_cooling.c cpufreq_cdev->freq_table[state].frequency); cpufreq_cdev 368 drivers/thermal/cpu_cooling.c struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata; cpufreq_cdev 369 drivers/thermal/cpu_cooling.c struct cpufreq_policy *policy = cpufreq_cdev->policy; cpufreq_cdev 384 drivers/thermal/cpu_cooling.c load = get_load(cpufreq_cdev, cpu, i); cpufreq_cdev 395 drivers/thermal/cpu_cooling.c cpufreq_cdev->last_load = total_load; cpufreq_cdev 397 drivers/thermal/cpu_cooling.c *power = get_dynamic_power(cpufreq_cdev, freq); cpufreq_cdev 429 drivers/thermal/cpu_cooling.c struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata; cpufreq_cdev 432 drivers/thermal/cpu_cooling.c if (WARN_ON(state > cpufreq_cdev->max_level)) cpufreq_cdev 435 drivers/thermal/cpu_cooling.c num_cpus = cpumask_weight(cpufreq_cdev->policy->cpus); cpufreq_cdev 437 drivers/thermal/cpu_cooling.c freq = cpufreq_cdev->freq_table[state].frequency; cpufreq_cdev 438 drivers/thermal/cpu_cooling.c *power = cpu_freq_to_power(cpufreq_cdev, freq) * num_cpus; cpufreq_cdev 469 drivers/thermal/cpu_cooling.c struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata; cpufreq_cdev 470 drivers/thermal/cpu_cooling.c struct cpufreq_policy *policy = cpufreq_cdev->policy; cpufreq_cdev 472 drivers/thermal/cpu_cooling.c last_load = cpufreq_cdev->last_load ?: 1; cpufreq_cdev 474 drivers/thermal/cpu_cooling.c target_freq = cpu_power_to_freq(cpufreq_cdev, normalised_power); cpufreq_cdev 476 drivers/thermal/cpu_cooling.c *state = get_level(cpufreq_cdev, target_freq); cpufreq_cdev 533 drivers/thermal/cpu_cooling.c struct cpufreq_cooling_device *cpufreq_cdev; cpufreq_cdev 559 drivers/thermal/cpu_cooling.c cpufreq_cdev = kzalloc(sizeof(*cpufreq_cdev), GFP_KERNEL); cpufreq_cdev 560 drivers/thermal/cpu_cooling.c if (!cpufreq_cdev) cpufreq_cdev 563 drivers/thermal/cpu_cooling.c cpufreq_cdev->policy = policy; cpufreq_cdev 565 drivers/thermal/cpu_cooling.c cpufreq_cdev->idle_time = kcalloc(num_cpus, cpufreq_cdev 566 drivers/thermal/cpu_cooling.c sizeof(*cpufreq_cdev->idle_time), cpufreq_cdev 568 drivers/thermal/cpu_cooling.c if (!cpufreq_cdev->idle_time) { cpufreq_cdev 574 drivers/thermal/cpu_cooling.c cpufreq_cdev->max_level = i - 1; cpufreq_cdev 576 drivers/thermal/cpu_cooling.c cpufreq_cdev->freq_table = kmalloc_array(i, cpufreq_cdev 577 drivers/thermal/cpu_cooling.c sizeof(*cpufreq_cdev->freq_table), cpufreq_cdev 579 drivers/thermal/cpu_cooling.c if (!cpufreq_cdev->freq_table) { cpufreq_cdev 589 drivers/thermal/cpu_cooling.c cpufreq_cdev->id = ret; cpufreq_cdev 592 drivers/thermal/cpu_cooling.c cpufreq_cdev->id); cpufreq_cdev 595 drivers/thermal/cpu_cooling.c for (i = 0, freq = -1; i <= cpufreq_cdev->max_level; i++) { cpufreq_cdev 597 drivers/thermal/cpu_cooling.c cpufreq_cdev->freq_table[i].frequency = freq; cpufreq_cdev 607 drivers/thermal/cpu_cooling.c ret = update_freq_table(cpufreq_cdev, capacitance); cpufreq_cdev 619 drivers/thermal/cpu_cooling.c &cpufreq_cdev->qos_req, FREQ_QOS_MAX, cpufreq_cdev 620 drivers/thermal/cpu_cooling.c cpufreq_cdev->freq_table[0].frequency); cpufreq_cdev 628 drivers/thermal/cpu_cooling.c cdev = thermal_of_cooling_device_register(np, dev_name, cpufreq_cdev, cpufreq_cdev 634 drivers/thermal/cpu_cooling.c list_add(&cpufreq_cdev->node, &cpufreq_cdev_list); cpufreq_cdev 640 drivers/thermal/cpu_cooling.c freq_qos_remove_request(&cpufreq_cdev->qos_req); cpufreq_cdev 642 drivers/thermal/cpu_cooling.c ida_simple_remove(&cpufreq_ida, cpufreq_cdev->id); cpufreq_cdev 644 drivers/thermal/cpu_cooling.c kfree(cpufreq_cdev->freq_table); cpufreq_cdev 646 drivers/thermal/cpu_cooling.c kfree(cpufreq_cdev->idle_time); cpufreq_cdev 648 drivers/thermal/cpu_cooling.c kfree(cpufreq_cdev); cpufreq_cdev 727 drivers/thermal/cpu_cooling.c struct cpufreq_cooling_device *cpufreq_cdev; cpufreq_cdev 732 drivers/thermal/cpu_cooling.c cpufreq_cdev = cdev->devdata; cpufreq_cdev 735 drivers/thermal/cpu_cooling.c list_del(&cpufreq_cdev->node); cpufreq_cdev 739 drivers/thermal/cpu_cooling.c freq_qos_remove_request(&cpufreq_cdev->qos_req); cpufreq_cdev 740 drivers/thermal/cpu_cooling.c ida_simple_remove(&cpufreq_ida, cpufreq_cdev->id); cpufreq_cdev 741 drivers/thermal/cpu_cooling.c kfree(cpufreq_cdev->idle_time); cpufreq_cdev 742 drivers/thermal/cpu_cooling.c kfree(cpufreq_cdev->freq_table); cpufreq_cdev 743 drivers/thermal/cpu_cooling.c kfree(cpufreq_cdev);