hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/cpufreq/ppc_cbe_cpufreq.c
....@@ -1,23 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * cpufreq driver for the cell processor
34 *
45 * (C) Copyright IBM Deutschland Entwicklung GmbH 2005-2007
56 *
67 * Author: Christian Krafft <krafft@de.ibm.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation; either version 2, or (at your option)
11
- * any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program; if not, write to the Free Software
20
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
218 */
229
2310 #include <linux/cpufreq.h>
....@@ -123,6 +110,13 @@
123110 #endif
124111
125112 policy->freq_table = cbe_freqs;
113
+ cbe_cpufreq_pmi_policy_init(policy);
114
+ return 0;
115
+}
116
+
117
+static int cbe_cpufreq_cpu_exit(struct cpufreq_policy *policy)
118
+{
119
+ cbe_cpufreq_pmi_policy_exit(policy);
126120 return 0;
127121 }
128122
....@@ -142,6 +136,7 @@
142136 .verify = cpufreq_generic_frequency_table_verify,
143137 .target_index = cbe_cpufreq_target,
144138 .init = cbe_cpufreq_cpu_init,
139
+ .exit = cbe_cpufreq_cpu_exit,
145140 .name = "cbe-cpufreq",
146141 .flags = CPUFREQ_CONST_LOOPS,
147142 };
....@@ -152,15 +147,24 @@
152147
153148 static int __init cbe_cpufreq_init(void)
154149 {
150
+ int ret;
151
+
155152 if (!machine_is(cell))
156153 return -ENODEV;
157154
158
- return cpufreq_register_driver(&cbe_cpufreq_driver);
155
+ cbe_cpufreq_pmi_init();
156
+
157
+ ret = cpufreq_register_driver(&cbe_cpufreq_driver);
158
+ if (ret)
159
+ cbe_cpufreq_pmi_exit();
160
+
161
+ return ret;
159162 }
160163
161164 static void __exit cbe_cpufreq_exit(void)
162165 {
163166 cpufreq_unregister_driver(&cbe_cpufreq_driver);
167
+ cbe_cpufreq_pmi_exit();
164168 }
165169
166170 module_init(cbe_cpufreq_init);