blob: 80d5e88c552c7188d9fdd00a381fef9e41174681 [file] [log] [blame]
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07001/*
Priyansh Jain6af76952021-11-10 10:48:06 +05302 * Copyright (c) 2020,2021 The Linux Foundation. All rights reserved.
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07003 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above
10 * copyright notice, this list of conditions and the following
11 * disclaimer in the documentation and/or other materials provided
12 * with the distribution.
13 * * Neither the name of The Linux Foundation nor the names of its
14 * contributors may be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 *
17 *
18 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
19 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
22 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
25 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
27 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
28 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Priyansh Jain75b5f1d2022-09-12 12:55:37 +053029 *
30 * Changes from Qualcomm Innovation Center are provided under the following license:
31 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
32 * SPDX-License-Identifier: BSD-3-Clause-Clear
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -070033 */
34
Bavyasritha Alahari0a344f42023-04-26 17:16:51 -070035 /* Changes from Qualcomm Innovation Center are provided under the following license:
36
Priyansh Jain895ef382022-07-05 12:43:10 +053037Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
Bavyasritha Alahari0a344f42023-04-26 17:16:51 -070038SPDX-License-Identifier: BSD-3-Clause-Clear */
39
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -070040#include <unordered_map>
41#include <android-base/logging.h>
Bavyasritha Alahari0a344f42023-04-26 17:16:51 -070042#include <aidl/android/hardware/thermal/BnThermal.h>
Minghao Zhang0fc813b2023-06-06 14:46:06 +080043#include <utility>
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -070044
45#include "thermalData.h"
46#include "thermalConfig.h"
47
Bavyasritha Alahari0a344f42023-04-26 17:16:51 -070048namespace aidl {
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -070049namespace android {
50namespace hardware {
51namespace thermal {
Bavyasritha Alahari0a344f42023-04-26 17:16:51 -070052
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -070053 constexpr std::string_view socIDPath("/sys/devices/soc0/soc_id");
Minghao Zhang0fc813b2023-06-06 14:46:06 +080054 constexpr std::string_view hwPlatformPath("/sys/devices/soc0/hw_platform");
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -070055
Minghao Zhang2658fa62020-12-28 10:16:45 +080056 std::vector<std::string> cpu_sensors_bengal =
57 {
58 "cpuss-2-usr",
59 "cpuss-2-usr",
60 "cpuss-2-usr",
61 "cpuss-2-usr",
62 "cpu-1-0-usr",
63 "cpu-1-1-usr",
64 "cpu-1-2-usr",
65 "cpu-1-3-usr",
66 };
67
68 std::vector<struct target_therm_cfg> sensor_cfg_bengal =
69 {
70 {
71 TemperatureType::CPU,
72 cpu_sensors_bengal,
73 "",
74 95000,
75 115000,
Minghao Zhang2658fa62020-12-28 10:16:45 +080076 true,
77 },
78 {
79 TemperatureType::GPU,
80 { "gpu-usr" },
81 "GPU",
82 95000,
83 115000,
Minghao Zhang2658fa62020-12-28 10:16:45 +080084 true,
85 },
86 {
87 TemperatureType::SKIN,
88 { "xo-therm-usr" },
89 "skin",
90 40000,
91 95000,
Minghao Zhang2658fa62020-12-28 10:16:45 +080092 true,
93 },
94 {
95 TemperatureType::BCL_VOLTAGE,
96 { "pmi632-vbat-lvl0" },
97 "vbat",
98 3000,
99 2800,
Minghao Zhang2658fa62020-12-28 10:16:45 +0800100 false,
101 },
102 {
103 TemperatureType::BCL_CURRENT,
104 { "pmi632-ibat-lvl0" },
105 "ibat",
106 4000,
107 4200,
Minghao Zhang2658fa62020-12-28 10:16:45 +0800108 true,
109 },
110 {
111 TemperatureType::BCL_PERCENTAGE,
112 { "soc" },
113 "soc",
114 10,
115 2,
Minghao Zhang2658fa62020-12-28 10:16:45 +0800116 false,
117 },
118 };
Minghao Zhangae04ce32020-09-23 23:28:34 +0800119
gnuthakidd79a2b2023-11-15 12:03:02 +0530120 std::vector<std::string> cpu_sensors_talos =
121 {
122 "cpuss-2",
123 "cpuss-2",
124 "cpuss-1",
125 "cpuss-1",
126 "cpuss-0",
127 "cpuss-0",
128 "cpu-1-0",
129 "cpu-1-2",
130 };
131
132 std::vector<struct target_therm_cfg> sensor_cfg_talos_common =
133 {
134 {
135 TemperatureType::CPU,
136 cpu_sensors_talos,
137 "",
138 95000,
139 115000,
140 true,
141 },
142 {
143 TemperatureType::GPU,
144 { "gpu" },
145 "gpu",
146 95000,
147 115000,
148 true,
149 },
150 };
151
152 std::vector<struct target_therm_cfg> sensor_cfg_sa6155_common =
153 {
154 {
155 TemperatureType::CPU,
156 cpu_sensors_talos,
157 "",
158 105000,
159 118000,
160 true,
161 },
162 {
163 TemperatureType::GPU,
164 { "gpu" },
165 "gpu",
166 105000,
167 118000,
168 true,
169 },
170 };
171
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530172 std::vector<std::string> cpu_sensors_khaje =
173 {
Manaf Meethalavalappu Pallikunhi6d43d262023-01-06 19:51:33 +0530174 "cpuss-2",
175 "cpuss-2",
176 "cpuss-2",
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530177 "cpuss-2",
178 "cpu-1-0",
179 "cpu-1-1",
180 "cpu-1-2",
181 "cpu-1-3",
182 };
183
184 std::vector<struct target_therm_cfg> sensor_cfg_khaje =
185 {
186 {
187 TemperatureType::CPU,
188 cpu_sensors_khaje,
189 "",
190 95000,
191 115000,
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530192 true,
193 },
194 {
195 TemperatureType::GPU,
196 { "gpu" },
197 "GPU",
198 95000,
199 115000,
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530200 true,
201 },
202 {
203 TemperatureType::SKIN,
204 { "xo-therm" },
205 "skin",
206 40000,
207 95000,
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530208 true,
209 },
210 {
211 TemperatureType::BCL_VOLTAGE,
Manaf Meethalavalappu Pallikunhi6d43d262023-01-06 19:51:33 +0530212 { "vbat" },
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530213 "vbat",
214 3000,
215 2800,
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530216 false,
217 },
218 {
219 TemperatureType::BCL_CURRENT,
220 { "pm7250b-ibat-lvl0" },
221 "ibat",
222 5500,
223 6000,
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530224 true,
225 },
226 {
227 TemperatureType::BCL_PERCENTAGE,
Manaf Meethalavalappu Pallikunhi6d43d262023-01-06 19:51:33 +0530228 { "socd" },
229 "socd",
230 90,
231 99,
232 true,
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530233 },
234 };
235
Minghao Zhangae04ce32020-09-23 23:28:34 +0800236 std::vector<std::string> cpu_sensors_trinket =
237 {
238 "cpuss-0-usr",
239 "cpuss-0-usr",
240 "cpuss-0-usr",
241 "cpuss-0-usr",
242 "cpu-1-0-usr",
243 "cpu-1-1-usr",
244 "cpu-1-2-usr",
245 "cpu-1-3-usr",
246 };
247
248 std::vector<struct target_therm_cfg> sensor_cfg_trinket =
249 {
250 {
251 TemperatureType::CPU,
252 cpu_sensors_trinket,
253 "",
254 95000,
255 115000,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800256 true,
257 },
258 {
259 TemperatureType::GPU,
260 { "gpu-usr" },
261 "GPU",
262 95000,
263 115000,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800264 true,
265 },
266 {
267 TemperatureType::SKIN,
268 { "xo-therm-adc" },
269 "skin",
270 40000,
271 95000,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800272 true,
273 },
274 {
275 TemperatureType::BCL_VOLTAGE,
276 { "pmi632-vbat-lvl0" },
277 "vbat",
278 3000,
279 2800,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800280 false,
281 },
282 {
283 TemperatureType::BCL_CURRENT,
284 { "pmi632-ibat-lvl0" },
285 "ibat",
286 4000,
287 4200,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800288 true,
289 },
290 {
291 TemperatureType::BCL_PERCENTAGE,
292 { "soc" },
293 "soc",
294 10,
295 2,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800296 false,
297 },
298 };
299
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700300 std::vector<std::string> cpu_sensors_lito =
301 {
302 "cpu-0-0-usr",
303 "cpu-0-1-usr",
304 "cpu-0-2-usr",
305 "cpu-0-3-usr",
306 "cpu-0-4-usr",
307 "cpu-0-5-usr",
308 "cpu-1-0-usr",
309 "cpu-1-2-usr",
310 };
311
312 std::vector<struct target_therm_cfg> sensor_cfg_lito =
313 {
314 {
315 TemperatureType::CPU,
316 cpu_sensors_lito,
317 "",
318 95000,
319 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700320 true,
321 },
322 {
323 TemperatureType::GPU,
324 { "gpuss-0-usr" },
325 "GPU",
326 95000,
327 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700328 true,
329 },
330 {
331 TemperatureType::SKIN,
332 { "xo-therm-usr" },
333 "skin",
334 40000,
Minghao Zhang50998c82020-09-11 17:17:13 +0800335 95000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700336 true,
337 },
338 {
339 TemperatureType::BCL_CURRENT,
340 { "pm7250b-ibat-lvl0" },
341 "ibat",
342 4500,
343 5000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700344 true,
345 },
346 {
347 TemperatureType::BCL_VOLTAGE,
348 { "pm7250b-vbat-lvl0" },
349 "vbat",
350 3200,
351 3000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700352 false,
353 },
354 {
355 TemperatureType::BCL_PERCENTAGE,
356 { "soc" },
357 "soc",
358 10,
359 2,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700360 false,
361 },
362 };
363
Minghao Zhangae04ce32020-09-23 23:28:34 +0800364 std::vector<struct target_therm_cfg> sensor_cfg_sdmmagpie =
365 {
366 {
367 TemperatureType::CPU,
368 cpu_sensors_lito,
369 "",
370 95000,
371 115000,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800372 true,
373 },
374 {
375 TemperatureType::GPU,
376 { "gpuss-0-usr" },
377 "GPU",
378 95000,
379 115000,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800380 true,
381 },
382 {
383 TemperatureType::SKIN,
384 { "xo-therm-adc" },
385 "skin",
386 40000,
387 95000,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800388 true,
389 },
390 {
391 TemperatureType::BCL_VOLTAGE,
392 { "pm6150-vbat-lvl0" },
393 "vbat",
394 3000,
395 2800,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800396 false,
397 },
398 {
399 TemperatureType::BCL_CURRENT,
400 { "pm6150-ibat-lvl0" },
401 "ibat",
402 5500,
403 6000,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800404 true,
405 },
406 {
407 TemperatureType::BCL_PERCENTAGE,
408 { "soc" },
409 "soc",
410 10,
411 2,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800412 false,
413 },
414 };
415
Nitesh Kumar83759f12023-06-30 19:15:54 +0530416 std::vector<std::string> cpu_sensors_holi =
417 {
418 "cpu-0-0",
419 "cpu-0-1",
420 "cpu-0-2",
421 "cpu-0-3",
422 "cpu-0-4",
423 "cpu-0-5",
424 "cpu-1-0",
425 "cpu-1-2",
426 };
427
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530428 std::vector<struct target_therm_cfg> sensor_cfg_holi =
429 {
430 {
431 TemperatureType::CPU,
Nitesh Kumar83759f12023-06-30 19:15:54 +0530432 cpu_sensors_holi,
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530433 "",
434 95000,
435 115000,
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530436 true,
437 },
438 {
439 TemperatureType::GPU,
Nitesh Kumar83759f12023-06-30 19:15:54 +0530440 { "gpuss-0" },
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530441 "gpu0",
442 95000,
443 115000,
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530444 true,
445 },
446 {
447 TemperatureType::GPU,
Nitesh Kumar83759f12023-06-30 19:15:54 +0530448 { "gpuss-1" },
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530449 "gpu1",
450 95000,
451 115000,
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530452 true,
453 },
454 {
455 TemperatureType::SKIN,
Nitesh Kumar83759f12023-06-30 19:15:54 +0530456 { "quiet-therm" },
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530457 "skin",
458 40000,
459 95000,
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530460 true,
461 },
462 {
463 TemperatureType::BCL_CURRENT,
464 { "pm7250b-ibat-lvl0" },
465 "ibat",
466 5500,
467 6000,
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530468 true,
469 },
470 };
471
gnuthakidd79a2b2023-11-15 12:03:02 +0530472 std::vector<std::string> cpu_sensors_msmnile =
473 {
474 "cpu-0-0",
475 "cpu-0-1",
476 "cpu-0-2",
477 "cpu-0-3",
478 "cpu-1-0",
479 "cpu-1-1",
480 "cpu-1-2",
481 "cpu-1-3",
482 };
483
484 std::vector<struct target_therm_cfg> sensor_cfg_msmnile_common = {
485 {
486 TemperatureType::CPU,
487 cpu_sensors_msmnile,
488 "",
489 95000,
490 115000,
491 true,
492 },
493 {
494 TemperatureType::GPU,
495 { "gpuss-0" },
496 "gpu0",
497 95000,
498 115000,
499 true,
500 },
501 {
502 TemperatureType::GPU,
503 { "gpuss-1" },
504 "gpu1",
505 95000,
506 115000,
507 true,
508 },
509 };
510
511 std::vector<struct target_therm_cfg> sensor_cfg_sa8155_common = {
512 {
513 TemperatureType::CPU,
514 cpu_sensors_msmnile,
515 "",
516 105000,
517 118000,
518 true,
519 },
520 {
521 TemperatureType::GPU,
522 { "gpuss-0" },
523 "gpu0",
524 105000,
525 118000,
526 true,
527 },
528 {
529 TemperatureType::GPU,
530 { "gpuss-1" },
531 "gpu1",
532 105000,
533 118000,
534 true,
535 },
536 };
537
538 std::vector<struct target_therm_cfg> sensor_cfg_sa8195_common = {
539 {
540 TemperatureType::CPU,
541 cpu_sensors_msmnile,
542 "",
543 105000,
544 118000,
545 true,
546 },
547 {
548 TemperatureType::GPU,
549 { "gpuss-0" },
550 "gpu0",
551 105000,
552 118000,
553 true,
554 },
555 {
556 TemperatureType::GPU,
557 { "gpuss-1" },
558 "gpu1",
559 105000,
560 118000,
561 true,
562 },
563 {
564 TemperatureType::GPU,
565 { "gpuss-2" },
566 "gpu2",
567 105000,
568 118000,
569 true,
570 },
571 {
572 TemperatureType::GPU,
573 { "gpuss-3" },
574 "gpu3",
575 105000,
576 118000,
577 true,
578 },
579 };
580
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700581 std::vector<std::string> cpu_sensors_kona =
582 {
Priyansh Jain0c6fd5b2023-01-13 16:56:48 +0530583 "cpu-0-0",
584 "cpu-0-1",
585 "cpu-0-2",
586 "cpu-0-3",
587 "cpu-1-0",
588 "cpu-1-1",
589 "cpu-1-2",
590 "cpu-1-3",
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700591 };
592
593 std::vector<struct target_therm_cfg> kona_common = {
594 {
595 TemperatureType::CPU,
596 cpu_sensors_kona,
597 "",
598 95000,
599 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700600 true,
601 },
602 {
603 TemperatureType::GPU,
Priyansh Jain0c6fd5b2023-01-13 16:56:48 +0530604 { "gpuss-0" },
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700605 "GPU0",
606 95000,
607 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700608 true,
609 },
610 {
611 TemperatureType::GPU,
Priyansh Jain0c6fd5b2023-01-13 16:56:48 +0530612 { "gpuss-1" },
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700613 "GPU1",
614 95000,
615 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700616 true,
617 },
618 {
619 TemperatureType::SKIN,
Priyansh Jain0c6fd5b2023-01-13 16:56:48 +0530620 { "skin-msm-therm" },
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700621 "skin",
622 40000,
623 95000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700624 true,
625 }
626 };
627
628 std::vector<struct target_therm_cfg> kona_specific = {
629 {
630 TemperatureType::BCL_CURRENT,
631 { "pm8150b-ibat-lvl0" },
632 "ibat",
633 4500,
634 5000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700635 true,
636 },
637 {
638 TemperatureType::BCL_VOLTAGE,
Priyansh Jain0c6fd5b2023-01-13 16:56:48 +0530639 { "vbat" },
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700640 "vbat",
641 3200,
642 3000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700643 false,
644 },
645 {
646 TemperatureType::BCL_PERCENTAGE,
Priyansh Jain0c6fd5b2023-01-13 16:56:48 +0530647 { "socd" },
648 "socd",
649 90,
650 99,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700651 false,
652 },
653 {
654 TemperatureType::NPU,
Priyansh Jain0c6fd5b2023-01-13 16:56:48 +0530655 { "npu" },
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700656 "npu",
657 95000,
Ram Chandrasekarc49329d2020-08-25 14:28:02 -0700658 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700659 true,
660 },
661 };
662
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530663 std::vector<std::string> cpu_sensors_lahaina =
664 {
665 "cpu-0-0-usr",
666 "cpu-0-1-usr",
667 "cpu-0-2-usr",
668 "cpu-0-3-usr",
669 "cpu-1-0-usr",
670 "cpu-1-2-usr",
671 "cpu-1-4-usr",
672 "cpu-1-6-usr",
673 };
674
675 std::vector<struct target_therm_cfg> lahaina_common = {
676 {
677 TemperatureType::CPU,
678 cpu_sensors_lahaina,
679 "",
680 95000,
681 115000,
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530682 true,
683 },
684 {
685 TemperatureType::GPU,
686 { "gpuss-0-usr" },
687 "GPU0",
688 95000,
689 115000,
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530690 true,
691 },
692 {
693 TemperatureType::GPU,
694 { "gpuss-1-usr" },
695 "GPU1",
696 95000,
697 115000,
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530698 true,
699 },
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700700 {
701 TemperatureType::BCL_CURRENT,
702 { "pm8350b-ibat-lvl0" },
703 "ibat",
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530704 6000,
705 7500,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700706 true,
707 },
708 {
709 TemperatureType::NPU,
710 { "nspss-0-usr" },
711 "nsp0",
712 95000,
Ram Chandrasekarc49329d2020-08-25 14:28:02 -0700713 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700714 true,
715 },
716 {
717 TemperatureType::NPU,
718 { "nspss-1-usr" },
719 "nsp1",
720 95000,
Ram Chandrasekarc49329d2020-08-25 14:28:02 -0700721 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700722 true,
723 },
724 {
725 TemperatureType::NPU,
726 { "nspss-2-usr" },
727 "nsp2",
728 95000,
Ram Chandrasekarc49329d2020-08-25 14:28:02 -0700729 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700730 true,
731 },
732 };
733
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530734 std::vector<struct target_therm_cfg> lahaina_specific = {
735 {
736 TemperatureType::SKIN,
Minghao Zhang72737612020-10-29 10:32:44 +0800737 { "xo-therm-usr" },
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530738 "skin",
Minghao Zhang72737612020-10-29 10:32:44 +0800739 55000,
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530740 95000,
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530741 true,
742 },
743 };
744
745 std::vector<struct target_therm_cfg> shima_specific = {
746 {
747 TemperatureType::SKIN,
748 { "quiet-therm-usr" },
749 "skin",
750 40000,
751 95000,
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530752 true,
753 },
754 };
755
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +0530756 std::vector<struct target_therm_cfg> sensor_cfg_yupik = {
757 {
758 TemperatureType::CPU,
759 cpu_sensors_lahaina,
760 "",
761 95000,
762 115000,
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +0530763 true,
764 },
765 {
766 TemperatureType::GPU,
767 { "gpuss-0-usr" },
768 "GPU0",
769 95000,
770 115000,
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +0530771 true,
772 },
773 {
774 TemperatureType::GPU,
775 { "gpuss-1-usr" },
776 "GPU1",
777 95000,
778 115000,
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +0530779 true,
780 },
781 {
782 TemperatureType::NPU,
783 { "nspss-0-usr" },
784 "nsp0",
785 95000,
786 115000,
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +0530787 true,
788 },
789 {
790 TemperatureType::NPU,
791 { "nspss-1-usr" },
792 "nsp1",
793 95000,
794 115000,
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +0530795 true,
796 },
797 {
798 TemperatureType::SKIN,
799 { "quiet-therm-usr" },
800 "skin",
801 40000,
802 95000,
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +0530803 true,
804 },
805 };
806
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -0700807 std::vector<std::string> cpu_sensors_waipio =
808 {
809 "cpu-0-0",
810 "cpu-0-1",
811 "cpu-0-2",
812 "cpu-0-3",
813 "cpu-1-0",
814 "cpu-1-2",
815 "cpu-1-4",
816 "cpu-1-6",
817 };
818
819 std::vector<struct target_therm_cfg> waipio_common = {
820 {
821 TemperatureType::CPU,
822 cpu_sensors_waipio,
823 "",
824 95000,
825 115000,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -0700826 true,
827 },
828 {
829 TemperatureType::GPU,
830 { "gpuss-0" },
831 "GPU0",
832 95000,
833 115000,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -0700834 true,
835 },
836 {
837 TemperatureType::GPU,
838 { "gpuss-1" },
839 "GPU1",
840 95000,
841 115000,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -0700842 true,
843 },
844 {
845 TemperatureType::NPU,
846 { "nspss-0" },
847 "nsp0",
848 95000,
849 115000,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -0700850 true,
851 },
852 {
853 TemperatureType::NPU,
854 { "nspss-1" },
855 "nsp1",
856 95000,
857 115000,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -0700858 true,
859 },
860 {
861 TemperatureType::NPU,
862 { "nspss-2" },
863 "nsp2",
864 95000,
865 115000,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -0700866 true,
867 },
Priyansh Jaina26aeb42021-09-20 17:29:05 +0530868 };
869
Priyansh Jaind670d792022-07-20 15:51:13 +0530870 std::vector<struct target_therm_cfg> diwali_common = {
871 {
872 TemperatureType::CPU,
873 cpu_sensors_waipio,
874 "",
875 95000,
876 115000,
877 true,
878 ThrottlingSeverity::LIGHT,
879 },
880 {
881 TemperatureType::GPU,
882 { "gpuss-0" },
883 "GPU0",
884 95000,
885 115000,
886 true,
887 ThrottlingSeverity::LIGHT,
888 },
889 {
890 TemperatureType::GPU,
891 { "gpuss-1" },
892 "GPU1",
893 95000,
894 115000,
895 true,
896 ThrottlingSeverity::LIGHT,
897 },
898 {
899 TemperatureType::NPU,
900 { "nspss-0" },
901 "nsp0",
902 95000,
903 115000,
904 true,
905 ThrottlingSeverity::LIGHT,
906 },
907 {
908 TemperatureType::NPU,
909 { "nspss-1" },
910 "nsp1",
911 95000,
912 115000,
913 true,
914 ThrottlingSeverity::LIGHT,
915 },
916 {
917 TemperatureType::NPU,
918 { "nspss-2" },
919 "nsp2",
920 95000,
921 115000,
922 true,
923 ThrottlingSeverity::LIGHT,
924 },
925 };
926
Priyansh Jaina26aeb42021-09-20 17:29:05 +0530927 std::vector<struct target_therm_cfg> waipio_specific = {
928 {
929 TemperatureType::BCL_CURRENT,
930 { "pm8350b-ibat-lvl0" },
931 "ibat",
932 6000,
933 7500,
Priyansh Jaina26aeb42021-09-20 17:29:05 +0530934 true,
935 },
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -0700936 {
937 TemperatureType::SKIN,
938 { "xo-therm" },
939 "skin",
940 55000,
941 95000,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -0700942 true,
943 },
944 };
945
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +0530946 std::vector<std::string> cpu_sensors_kalama =
947 {
948 "cpu-0-0",
949 "cpu-0-1",
950 "cpu-0-2",
951 "cpu-1-0",
952 "cpu-1-2",
953 "cpu-1-4",
954 "cpu-1-6",
955 "cpu-1-8",
956 };
957
958 std::vector<struct target_therm_cfg> kalama_common = {
959 {
960 TemperatureType::CPU,
961 cpu_sensors_kalama,
962 "",
963 95000,
964 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +0530965 true,
966 },
967 {
968 TemperatureType::GPU,
969 { "gpuss-0" },
970 "GPU0",
971 95000,
972 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +0530973 true,
974 },
975 {
976 TemperatureType::GPU,
977 { "gpuss-1" },
978 "GPU1",
979 95000,
980 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +0530981 true,
982 },
983 {
984 TemperatureType::GPU,
985 { "gpuss-2" },
986 "GPU2",
987 95000,
988 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +0530989 true,
990 },
991 {
992 TemperatureType::GPU,
993 { "gpuss-3" },
994 "GPU3",
995 95000,
996 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +0530997 true,
998 },
999 {
1000 TemperatureType::GPU,
1001 { "gpuss-4" },
1002 "GPU4",
1003 95000,
1004 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301005 true,
1006 },
1007 {
1008 TemperatureType::GPU,
1009 { "gpuss-5" },
1010 "GPU5",
1011 95000,
1012 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301013 true,
1014 },
1015 {
1016 TemperatureType::GPU,
1017 { "gpuss-6" },
1018 "GPU6",
1019 95000,
1020 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301021 true,
1022 },
1023 {
1024 TemperatureType::GPU,
1025 { "gpuss-7" },
1026 "GPU7",
1027 95000,
1028 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301029 true,
1030 },
1031 {
1032 TemperatureType::NPU,
1033 { "nspss-0" },
1034 "nsp0",
Manaf Meethalavalappu Pallikunhi92b7bbf2022-06-30 01:29:08 +05301035 100000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301036 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301037 true,
1038 },
1039 {
1040 TemperatureType::NPU,
1041 { "nspss-1" },
1042 "nsp1",
Manaf Meethalavalappu Pallikunhi92b7bbf2022-06-30 01:29:08 +05301043 100000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301044 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301045 true,
1046 },
1047 {
1048 TemperatureType::NPU,
1049 { "nspss-2" },
1050 "nsp2",
Manaf Meethalavalappu Pallikunhi92b7bbf2022-06-30 01:29:08 +05301051 100000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301052 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301053 true,
1054 },
1055 {
1056 TemperatureType::NPU,
1057 { "nspss-3" },
1058 "nsp3",
Manaf Meethalavalappu Pallikunhi92b7bbf2022-06-30 01:29:08 +05301059 100000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301060 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301061 true,
1062 },
1063 };
1064
1065 std::vector<struct target_therm_cfg> kalama_specific = {
1066 {
1067 TemperatureType::BCL_CURRENT,
1068 { "pm8550b-ibat-lvl0" },
1069 "ibat",
1070 9000,
1071 10000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301072 true,
1073 },
1074 {
1075 TemperatureType::SKIN,
Rashid Zafar580cffb2022-08-15 14:51:54 -07001076 { "skin-msm-therm" },
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301077 "skin",
Rashid Zafar580cffb2022-08-15 14:51:54 -07001078 46500,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301079 95000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301080 true,
1081 },
1082 };
1083
Priyansh Jaina72f3822023-05-30 14:44:09 +05301084 std::vector<std::string> cpu_sensors_crow =
1085 {
1086 "cpu-0-0",
1087 "cpu-0-1",
1088 "cpu-0-2",
1089 "cpu-0-3",
1090 "cpu-1-0",
1091 "cpu-1-2",
1092 "cpu-1-4",
1093 "cpu-1-6",
1094 };
1095
1096 std::vector<struct target_therm_cfg> crow_common = {
1097 {
1098 TemperatureType::CPU,
1099 cpu_sensors_crow,
1100 "",
1101 95000,
1102 115000,
1103 true,
1104 },
1105 {
1106 TemperatureType::GPU,
1107 { "gpuss-0" },
1108 "GPU0",
1109 95000,
1110 115000,
1111 true,
1112 },
1113 {
1114 TemperatureType::GPU,
1115 { "gpuss-1" },
1116 "GPU1",
1117 95000,
1118 115000,
1119 true,
1120 },
1121 {
1122 TemperatureType::NPU,
1123 { "nspss-0" },
1124 "nsp0",
1125 100000,
1126 115000,
1127 true,
1128 },
1129 {
1130 TemperatureType::NPU,
1131 { "nspss-1" },
1132 "nsp1",
1133 100000,
1134 115000,
1135 true,
1136 },
1137 {
1138 TemperatureType::NPU,
1139 { "nspss-2" },
1140 "nsp2",
1141 100000,
1142 115000,
1143 true,
1144 },
1145 };
1146
1147 std::vector<struct target_therm_cfg> crow_specific = {
1148 {
1149 TemperatureType::SKIN,
1150 { "sys-therm-3" },
1151 "skin",
1152 60000,
1153 95000,
1154 true,
1155 },
1156 };
1157
Priyansh Jaina26aeb42021-09-20 17:29:05 +05301158 std::vector<struct target_therm_cfg> diwali_specific = {
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001159 {
1160 TemperatureType::BCL_CURRENT,
Minghao Zhang510dcf12022-03-04 19:20:38 +08001161 { "pm7250b-ibat-lvl0" },
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001162 "ibat",
Minghao Zhang510dcf12022-03-04 19:20:38 +08001163 9000,
1164 9500,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001165 true,
1166 },
Priyansh Jaina26aeb42021-09-20 17:29:05 +05301167 {
1168 TemperatureType::SKIN,
1169 { "quiet-therm" },
1170 "skin",
Priyansh Jain895ef382022-07-05 12:43:10 +05301171 46000,
Priyansh Jaina26aeb42021-09-20 17:29:05 +05301172 95000,
Priyansh Jaina26aeb42021-09-20 17:29:05 +05301173 true,
Priyansh Jaind670d792022-07-20 15:51:13 +05301174 ThrottlingSeverity::LIGHT,
Priyansh Jaina26aeb42021-09-20 17:29:05 +05301175 },
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001176 };
1177
Priyansh Jain39782192022-03-09 10:10:43 +05301178 std::vector<std::string> cpu_sensors_neo =
1179 {
1180 "cpu-0-0",
1181 "cpu-0-1",
1182 "cpu-0-2",
1183 "cpu-0-3",
1184 };
1185
1186 std::vector<struct target_therm_cfg> neo_common = {
1187 {
1188 TemperatureType::CPU,
1189 cpu_sensors_neo,
1190 "",
1191 95000,
1192 115000,
1193 true,
1194 },
1195 {
1196 TemperatureType::GPU,
1197 { "gpuss-0" },
1198 "GPU0",
1199 95000,
1200 115000,
1201 true,
1202 },
1203 {
1204 TemperatureType::GPU,
1205 { "gpuss-1" },
1206 "GPU1",
1207 95000,
1208 115000,
1209 true,
1210 },
1211 {
1212 TemperatureType::NPU,
1213 { "nspss-0" },
1214 "nsp0",
1215 95000,
1216 115000,
1217 true,
1218 },
1219 {
1220 TemperatureType::NPU,
1221 { "nspss-1" },
1222 "nsp1",
1223 95000,
1224 115000,
1225 true,
1226 },
1227 {
1228 TemperatureType::NPU,
1229 { "nspss-2" },
1230 "nsp2",
1231 95000,
1232 115000,
1233 true,
1234 },
1235 };
1236
Priyansh Jainb48d2ec2022-03-21 16:25:29 +05301237 std::vector<std::string> cpu_sensors_parrot =
1238 {
1239 "cpu-0-0",
1240 "cpu-0-1",
1241 "cpu-0-2",
1242 "cpu-0-3",
1243 "cpu-1-0",
1244 "cpu-1-2",
1245 "cpu-1-4",
1246 "cpu-1-6",
1247 };
1248
1249 std::vector<struct target_therm_cfg> parrot_common = {
1250 {
1251 TemperatureType::CPU,
1252 cpu_sensors_parrot,
1253 "",
1254 95000,
1255 115000,
1256 true,
1257 },
1258 {
1259 TemperatureType::GPU,
1260 { "gpuss-0" },
1261 "GPU0",
1262 95000,
1263 115000,
1264 true,
1265 },
1266 {
1267 TemperatureType::GPU,
1268 { "gpuss-1" },
1269 "GPU1",
1270 95000,
1271 115000,
1272 true,
1273 },
1274 {
1275 TemperatureType::NPU,
1276 { "nspss-0" },
1277 "nsp0",
1278 95000,
1279 115000,
1280 true,
1281 },
1282 {
1283 TemperatureType::NPU,
1284 { "nspss-1" },
1285 "nsp1",
1286 95000,
1287 115000,
1288 true,
1289 },
1290 };
1291
1292 std::vector<struct target_therm_cfg> parrot_specific = {
1293 {
1294 TemperatureType::BCL_CURRENT,
1295 { "pm7250b-ibat-lvl0" },
1296 "ibat",
1297 6000,
1298 7500,
1299 true,
1300 },
1301 {
1302 TemperatureType::SKIN,
1303 { "xo-therm" },
1304 "skin",
1305 55000,
1306 95000,
1307 true,
1308 },
1309 };
1310
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07001311 struct target_therm_cfg bat_conf = {
1312 TemperatureType::BATTERY,
1313 { "battery" },
1314 "battery",
1315 80000,
1316 90000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07001317 true,
1318 };
1319
1320 std::vector<struct target_therm_cfg> bcl_conf = {
1321 {
1322 TemperatureType::BCL_VOLTAGE,
1323 { "vbat" },
1324 "vbat",
1325 3200,
1326 3000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07001327 false,
1328 },
1329 {
1330 TemperatureType::BCL_PERCENTAGE,
1331 { "socd" },
1332 "socd",
1333 90,
1334 99,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07001335 true,
1336 },
1337 };
1338
Rashid Zafare9219f72022-11-01 15:48:37 -07001339 std::vector<std::string> cpu_sensors_pineapple = {
1340 "cpu-0-0-0",
1341 "cpu-0-1-0",
1342 "cpu-2-0-0",
1343 "cpu-2-1-0",
1344 "cpu-2-2-0",
1345 "cpu-1-0-0",
1346 "cpu-1-1-0",
1347 "cpu-1-2-0",
1348 };
1349
1350 std::vector<struct target_therm_cfg> pineapple_common = {
1351 {
1352 TemperatureType::CPU,
1353 cpu_sensors_pineapple,
1354 "",
1355 95000,
1356 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001357 true,
1358 },
1359 {
1360 TemperatureType::GPU,
1361 { "gpuss-0" },
1362 "GPU0",
1363 95000,
1364 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001365 true,
1366 },
1367 {
1368 TemperatureType::GPU,
1369 { "gpuss-1" },
1370 "GPU1",
1371 95000,
1372 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001373 true,
1374 },
1375 {
1376 TemperatureType::GPU,
1377 { "gpuss-2" },
1378 "GPU2",
1379 95000,
1380 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001381 true,
1382 },
1383 {
1384 TemperatureType::GPU,
1385 { "gpuss-3" },
1386 "GPU3",
1387 95000,
1388 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001389 true,
1390 },
1391 {
1392 TemperatureType::GPU,
1393 { "gpuss-4" },
1394 "GPU4",
1395 95000,
1396 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001397 true,
1398 },
1399 {
1400 TemperatureType::GPU,
1401 { "gpuss-5" },
1402 "GPU5",
1403 95000,
1404 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001405 true,
1406 },
1407 {
1408 TemperatureType::GPU,
1409 { "gpuss-6" },
1410 "GPU6",
1411 95000,
1412 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001413 true,
1414 },
1415 {
1416 TemperatureType::GPU,
1417 { "gpuss-7" },
1418 "GPU7",
1419 95000,
1420 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001421 true,
1422 },
1423 {
1424 TemperatureType::NPU,
1425 { "nsphvx-0" },
1426 "nsp0",
1427 100000,
1428 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001429 true,
1430 },
1431 {
1432 TemperatureType::NPU,
1433 { "nsphvx-1" },
1434 "nsp1",
1435 100000,
1436 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001437 true,
1438 },
1439 {
1440 TemperatureType::NPU,
1441 { "nsphmx-0" },
1442 "nsp2",
1443 100000,
1444 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001445 true,
1446 },
1447 {
1448 TemperatureType::NPU,
1449 { "nsphmx-1" },
1450 "nsp3",
1451 100000,
1452 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001453 true,
1454 },
1455 {
1456 TemperatureType::NPU,
1457 { "nsphmx-2" },
1458 "nsp4",
1459 100000,
1460 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001461 true,
1462 },
1463 {
1464 TemperatureType::NPU,
1465 { "nsphmx-3" },
1466 "nsp5",
1467 100000,
1468 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001469 true,
1470 },
1471 };
1472
1473 std::vector<struct target_therm_cfg> pineapple_specific = {
1474 {
1475 TemperatureType::BCL_CURRENT,
1476 { "pm8550b-ibat-lvl0" },
1477 "ibat",
1478 9000,
1479 10000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001480 true,
1481 },
1482 {
1483 TemperatureType::SKIN,
1484 { "skin-msm-therm" },
1485 "skin",
1486 46500,
1487 95000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001488 true,
1489 },
1490 };
1491
Priyansh Jaindaa7d592023-09-25 15:55:19 +05301492std::vector<std::string> cpu_sensors_cliffs = {
1493 "cpu-0-0-0",
1494 "cpu-0-1-0",
1495 "cpu-0-2-0",
1496 "cpu-1-0-0",
1497 "cpu-1-1-0",
1498 "cpu-1-2-0",
1499 "cpu-1-3-0",
1500 "cpu-2-0-0",
1501 };
1502
1503 std::vector<struct target_therm_cfg> cliffs_common = {
1504 {
1505 TemperatureType::CPU,
1506 cpu_sensors_cliffs,
1507 "",
1508 95000,
1509 115000,
1510 true,
1511 },
1512 {
1513 TemperatureType::GPU,
1514 { "gpuss-0" },
1515 "GPU0",
1516 95000,
1517 115000,
1518 true,
1519 },
1520 {
1521 TemperatureType::GPU,
1522 { "gpuss-1" },
1523 "GPU1",
1524 95000,
1525 115000,
1526 true,
1527 },
1528 {
1529 TemperatureType::GPU,
1530 { "gpuss-2" },
1531 "GPU2",
1532 95000,
1533 115000,
1534 true,
1535 },
1536 {
1537 TemperatureType::GPU,
1538 { "gpuss-3" },
1539 "GPU3",
1540 95000,
1541 115000,
1542 true,
1543 },
1544 {
1545 TemperatureType::NPU,
1546 { "nsphvx-0" },
1547 "nsp0",
1548 100000,
1549 115000,
1550 true,
1551 },
1552 {
1553 TemperatureType::NPU,
1554 { "nsphvx-1" },
1555 "nsp1",
1556 100000,
1557 115000,
1558 true,
1559 },
1560 {
1561 TemperatureType::NPU,
1562 { "nsphmx-0" },
1563 "nsp2",
1564 100000,
1565 115000,
1566 true,
1567 },
1568 {
1569 TemperatureType::NPU,
1570 { "nsphmx-1" },
1571 "nsp3",
1572 100000,
1573 115000,
1574 true,
1575 },
1576 };
1577
1578 std::vector<struct target_therm_cfg> cliffs_specific = {
1579 {
1580 TemperatureType::SKIN,
1581 { "sys-therm-4" },
1582 "skin",
1583 60000,
1584 95000,
1585 true,
1586 },
1587 };
Nitesh Kumar30b30522023-11-21 13:23:59 +05301588
1589 std::vector<std::string> cpu_sensors_monaco = {
1590 "cpuss-0",
1591 "cpuss-0",
1592 "cpuss-0",
1593 "cpuss-0",
1594 "cpuss-1",
1595 "cpuss-1",
1596 "cpuss-1",
1597 "cpuss-1",
1598 };
1599
1600 std::vector<struct target_therm_cfg> sensor_cfg_monaco = {
1601 {
1602 TemperatureType::CPU,
1603 cpu_sensors_monaco,
1604 "",
1605 95000,
1606 115000,
1607 true,
1608 },
1609 {
1610 TemperatureType::GPU,
1611 { "gpu" },
1612 "gpu",
1613 95000,
1614 115000,
1615 true,
1616 },
1617 {
1618 TemperatureType::SKIN,
1619 { "pa-therm0" },
1620 "skin",
1621 40000,
1622 95000,
1623 true,
1624 },
1625 {
1626 TemperatureType::BCL_CURRENT,
1627 { "pm5100-ibat-lvl0" },
1628 "ibat",
1629 1100,
1630 1500,
1631 true,
1632 },
1633 };
1634
Nitesh Kumard667c792024-01-03 17:17:58 +05301635 std::vector<std::string> cpu_sensors_pitti =
1636 {
1637 "cpu-0-0",
1638 "cpu-0-1",
1639 "cpu-0-2",
1640 "cpu-0-3",
1641 "cpu-0-4",
1642 "cpu-0-5",
1643 "cpu-1-0",
1644 "cpu-2-0",
1645 };
1646
1647 std::vector<struct target_therm_cfg> sensor_cfg_pitti =
1648 {
1649 {
1650 TemperatureType::CPU,
1651 cpu_sensors_pitti,
1652 "",
1653 95000,
1654 115000,
1655 true,
1656 },
1657 {
1658 TemperatureType::GPU,
1659 { "gpuss" },
1660 "gpu",
1661 95000,
1662 115000,
1663 true,
1664 },
1665 };
1666
1667 std::vector<struct target_therm_cfg> pitti_specific = {
1668 {
Nitesh Kumard667c792024-01-03 17:17:58 +05301669 TemperatureType::SKIN,
1670 { "sys-therm-3" },
1671 "skin",
1672 40000,
1673 95000,
1674 true,
1675 },
1676 };
1677
Nitesh Kumara953a152024-03-07 16:35:01 +05301678 std::vector<std::string> cpu_sensors_niobe = {
Priyansh Jainafe95152024-01-24 08:27:39 +05301679 "cpu-0-0-0",
1680 "cpu-0-1-0",
1681 "cpu-1-0-0",
1682 "cpu-1-1-0",
1683 "cpu-1-2-0",
1684 "cpu-1-2-1",
1685 "cpu-1-3-0",
1686 "cpu-1-3-1",
1687 };
1688
1689 std::vector<struct target_therm_cfg> niobe_common = {
1690 {
1691 TemperatureType::CPU,
1692 cpu_sensors_niobe,
1693 "",
1694 95000,
1695 115000,
1696 true,
1697 },
1698 {
1699 TemperatureType::GPU,
1700 { "gpuss-0" },
1701 "GPU0",
1702 95000,
1703 115000,
1704 true,
1705 },
1706 {
1707 TemperatureType::GPU,
1708 { "gpuss-1" },
1709 "GPU1",
1710 95000,
1711 115000,
1712 true,
1713 },
1714 {
1715 TemperatureType::GPU,
1716 { "gpuss-2" },
1717 "GPU2",
1718 95000,
1719 115000,
1720 true,
1721 },
1722 {
1723 TemperatureType::GPU,
1724 { "gpuss-3" },
1725 "GPU3",
1726 95000,
1727 115000,
1728 true,
1729 },
1730 {
1731 TemperatureType::GPU,
1732 { "gpuss-4" },
1733 "GPU4",
1734 95000,
1735 115000,
1736 true,
1737 },
1738 {
1739 TemperatureType::GPU,
1740 { "gpuss-5" },
1741 "GPU5",
1742 95000,
1743 115000,
1744 true,
1745 },
1746 {
1747 TemperatureType::GPU,
1748 { "gpuss-6" },
1749 "GPU6",
1750 95000,
1751 115000,
1752 true,
1753 },
1754 {
1755 TemperatureType::GPU,
1756 { "gpuss-7" },
1757 "GPU7",
1758 95000,
1759 115000,
1760 true,
1761 },
1762 {
1763 TemperatureType::NPU,
1764 { "nsphvx-0" },
1765 "nsp0",
1766 95000,
1767 115000,
1768 true,
1769 },
1770 {
1771 TemperatureType::NPU,
1772 { "nsphvx-1" },
1773 "nsp1",
1774 95000,
1775 115000,
1776 true,
1777 },
1778 {
1779 TemperatureType::NPU,
1780 { "nsphmx-0" },
1781 "nsp2",
1782 95000,
1783 115000,
1784 true,
1785 },
1786 {
1787 TemperatureType::NPU,
1788 { "nsphmx-1" },
1789 "nsp3",
1790 95000,
1791 115000,
1792 true,
1793 },
1794 };
1795
1796 std::vector<struct target_therm_cfg> niobe_specific = {
1797 {
1798 TemperatureType::BCL_CURRENT,
1799 { "pm8550b-ibat-lvl0" },
1800 "ibat",
1801 7000,
1802 7500,
1803 true,
1804 },
1805 {
1806 TemperatureType::SKIN,
1807 { "sys-therm-0" },
1808 "skin",
1809 60000,
1810 95000,
1811 true,
1812 },
1813 };
1814
Nitesh Kumara953a152024-03-07 16:35:01 +05301815 std::vector<std::string> cpu_sensors_volcano = {
1816 "cpu-0-0-0",
1817 "cpu-0-1-0",
1818 "cpu-0-2-0",
1819 "cpu-1-0-0",
1820 "cpu-1-1-0",
1821 "cpu-1-2-0",
1822 "cpu-1-3-0",
1823 "cpu-1-3-1",
1824 };
1825
1826 std::vector<struct target_therm_cfg> volcano_common = {
1827 {
1828 TemperatureType::CPU,
1829 cpu_sensors_volcano,
1830 "",
1831 95000,
1832 115000,
1833 true,
1834 },
1835 {
1836 TemperatureType::GPU,
1837 { "gpuss-0" },
1838 "GPU0",
1839 95000,
1840 115000,
1841 true,
1842 },
1843 {
1844 TemperatureType::GPU,
1845 { "gpuss-1" },
1846 "GPU1",
1847 95000,
1848 115000,
1849 true,
1850 },
1851 {
1852 TemperatureType::NPU,
1853 { "nsphvx-0" },
1854 "nsp0",
1855 95000,
1856 115000,
1857 true,
1858 },
1859 {
1860 TemperatureType::NPU,
Nitesh Kumara953a152024-03-07 16:35:01 +05301861 { "nsphmx-0" },
1862 "nsp2",
1863 95000,
1864 115000,
1865 true,
1866 },
1867 {
1868 TemperatureType::NPU,
1869 { "nsphmx-1" },
1870 "nsp3",
1871 95000,
1872 115000,
1873 true,
1874 },
1875 };
1876
1877 std::vector<struct target_therm_cfg> volcano_specific = {
1878 {
1879 TemperatureType::SKIN,
1880 { "sys-therm-0" },
1881 "skin",
1882 60000,
1883 95000,
1884 true,
1885 },
1886 };
1887
Nitesh Kumar662a53b2024-05-09 22:36:40 +05301888 std::vector<std::string> cpu_sensors_anorak =
1889 {
1890 "cpu-0-0-0",
1891 "cpu-0-0-1",
1892 "cpu-0-1-0",
1893 "cpu-0-1-1",
1894 "cpu-1-0-0",
1895 "cpu-1-0-1",
1896 "cpu-1-1-0",
1897 "cpu-1-1-1",
1898 "cpu-1-2-0",
1899 "cpu-1-2-1",
1900 "cpu-1-3-0",
1901 "cpu-1-3-1",
1902 };
1903
1904 std::vector<struct target_therm_cfg> anorak_common = {
1905 {
1906 TemperatureType::CPU,
1907 cpu_sensors_anorak,
1908 "",
1909 95000,
1910 115000,
1911 true,
1912 },
1913 {
1914 TemperatureType::NPU,
1915 { "nspss-0" },
1916 "nsp0",
1917 95000,
1918 115000,
1919 true,
1920 },
1921 {
1922 TemperatureType::NPU,
1923 { "nspss-1" },
1924 "nsp1",
1925 95000,
1926 115000,
1927 true,
1928 },
1929 {
1930 TemperatureType::NPU,
1931 { "nspss-2" },
1932 "nsp2",
1933 95000,
1934 115000,
1935 true,
1936 },
1937 {
1938 TemperatureType::GPU,
1939 { "gpuss-0" },
1940 "GPU0",
1941 95000,
1942 115000,
1943 true,
1944 },
1945 {
1946 TemperatureType::GPU,
1947 { "gpuss-1" },
1948 "GPU1",
1949 95000,
1950 115000,
1951 true,
1952 },
1953 {
1954 TemperatureType::GPU,
1955 { "gpuss-2" },
1956 "GPU2",
1957 95000,
1958 115000,
1959 true,
1960 },
1961 {
1962 TemperatureType::GPU,
1963 { "gpuss-3" },
1964 "GPU3",
1965 95000,
1966 115000,
1967 true,
1968 },
1969 {
1970 TemperatureType::GPU,
1971 { "gpuss-4" },
1972 "GPU4",
1973 95000,
1974 115000,
1975 true,
1976 },
1977 {
1978 TemperatureType::GPU,
1979 { "gpuss-5" },
1980 "GPU5",
1981 95000,
1982 115000,
1983 true,
1984 },
1985 {
1986 TemperatureType::GPU,
1987 { "gpuss-6" },
1988 "GPU6",
1989 95000,
1990 115000,
1991 true,
1992 },
1993 {
1994 TemperatureType::GPU,
1995 { "gpuss-7" },
1996 "GPU7",
1997 95000,
1998 115000,
1999 true,
2000 },
2001 };
2002
2003 std::vector<struct target_therm_cfg> anorak_specific = {
2004 {
2005 TemperatureType::BCL_CURRENT,
2006 { "pm8550b-ibat-lvl0" },
2007 "ibat",
2008 9000,
2009 10000,
2010 true,
2011 },
2012 {
2013 TemperatureType::SKIN,
2014 { "sys-therm-0" },
2015 "skin",
2016 55000,
2017 95000,
2018 true,
2019 },
2020 };
2021
Priyansh Jainf06e0842022-10-10 10:34:27 +05302022 std::vector<std::string> cpu_sensors_ravelin =
2023 {
2024 "cpu-0-0",
2025 "cpu-0-1",
2026 "cpu-0-2",
2027 "cpu-0-3",
2028 "cpu-0-4",
2029 "cpu-0-5",
2030 "cpu-1-0",
2031 "cpu-1-2",
2032 };
2033
2034 std::vector<struct target_therm_cfg> ravelin_common = {
2035 {
2036 TemperatureType::CPU,
Minghao Zhangc6d2b272023-02-02 15:34:25 +08002037 cpu_sensors_ravelin,
Priyansh Jainf06e0842022-10-10 10:34:27 +05302038 "",
2039 95000,
2040 115000,
2041 true,
2042 },
2043 {
2044 TemperatureType::GPU,
2045 { "gpuss" },
2046 "GPU",
2047 95000,
2048 115000,
2049 true,
2050 },
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002051 {
2052 TemperatureType::SKIN,
2053 { "sys-therm-1" },
2054 "skin",
2055 55000,
2056 95000,
2057 true,
2058 },
Priyansh Jainf06e0842022-10-10 10:34:27 +05302059 };
2060
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002061 std::vector<struct target_therm_cfg> ravelin_specific_qrd = {
Priyansh Jainf06e0842022-10-10 10:34:27 +05302062 {
2063 TemperatureType::BCL_CURRENT,
Minghao Zhangc6d2b272023-02-02 15:34:25 +08002064 { "pmi632-ibat-lvl0" },
Priyansh Jainf06e0842022-10-10 10:34:27 +05302065 "ibat",
2066 6000,
2067 7500,
2068 true,
2069 },
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002070 };
2071
2072 std::vector<struct target_therm_cfg> ravelin_specific_idp = {
Priyansh Jainf06e0842022-10-10 10:34:27 +05302073 {
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002074 TemperatureType::BCL_CURRENT,
2075 { "pm7250b-ibat-lvl0" },
2076 "ibat",
2077 6000,
2078 7500,
Priyansh Jainf06e0842022-10-10 10:34:27 +05302079 true,
2080 },
2081 };
2082
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002083 const std::unordered_map<int, std::vector<struct target_therm_cfg>>
2084 msm_soc_map = {
gnuthakidd79a2b2023-11-15 12:03:02 +05302085 {355, sensor_cfg_talos_common},
2086 {377, sensor_cfg_sa6155_common}, // auto
2087 {380, sensor_cfg_sa6155_common}, // auto
2088 {384, sensor_cfg_sa6155_common}, // auto
Minghao Zhang2658fa62020-12-28 10:16:45 +08002089 {417, sensor_cfg_bengal}, // bengal
2090 {420, sensor_cfg_bengal},
2091 {444, sensor_cfg_bengal},
2092 {445, sensor_cfg_bengal},
2093 {469, sensor_cfg_bengal},
2094 {470, sensor_cfg_bengal},
Priyansh Jain3388cdf2022-08-17 14:05:26 +05302095 {518, sensor_cfg_khaje}, //khaje
Manaf Meethalavalappu Pallikunhi003ee4a2022-12-02 15:58:00 +05302096 {561, sensor_cfg_khaje}, //khajeP
2097 {562, sensor_cfg_khaje}, //khajeQ
2098 {584, sensor_cfg_khaje}, //khajeXR
2099 {585, sensor_cfg_khaje}, //khajeG
2100 {586, sensor_cfg_khaje}, //khajeIOT
Minghao Zhangae04ce32020-09-23 23:28:34 +08002101 {394, sensor_cfg_trinket},
2102 {467, sensor_cfg_trinket},
2103 {468, sensor_cfg_trinket},
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002104 {400, sensor_cfg_lito}, // lito
2105 {440, sensor_cfg_lito},
2106 {407, sensor_cfg_lito}, // atoll
Minghao Zhangae04ce32020-09-23 23:28:34 +08002107 {365, sensor_cfg_sdmmagpie},
2108 {366, sensor_cfg_sdmmagpie},
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002109 {434, sensor_cfg_lito}, // lagoon
Minghao Zhang15c2bdc2021-01-14 14:51:25 +08002110 {435, sensor_cfg_lito},
2111 {459, sensor_cfg_lito},
Gopala Krishna Nuthakib99fef32020-09-09 14:26:32 +05302112 {476, sensor_cfg_lito}, // orchid
gnuthakidd79a2b2023-11-15 12:03:02 +05302113 {339, sensor_cfg_msmnile_common},
2114 {361, sensor_cfg_msmnile_common},
2115 {362, sensor_cfg_sa8155_common}, //auto
2116 {367, sensor_cfg_sa8155_common}, //auto
2117 {405, sensor_cfg_sa8195_common}, //auto
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002118 {356, kona_common}, // kona
Nitesh Kumara6747222023-06-20 13:11:31 +05302119 {481, kona_common}, //kona iot
2120 {548, kona_common}, //kona iot
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +05302121 {415, lahaina_common}, // lahaina
2122 {439, lahaina_common}, // lahainap
2123 {456, lahaina_common}, // lahaina-atp
Minghao Zhang31932a02021-03-08 10:58:11 +08002124 {501, lahaina_common},
2125 {502, lahaina_common},
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +05302126 {450, lahaina_common}, // shima
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +05302127 {454, sensor_cfg_holi}, // holi
Nitesh Kumar83759f12023-06-30 19:15:54 +05302128 {507, sensor_cfg_holi}, //blair
Nitesh Kumarf69dba32023-11-10 16:16:17 +05302129 {578, sensor_cfg_holi}, //conic
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +05302130 {475, sensor_cfg_yupik}, // yupik
Gopala Krishna Nuthaki15c1be22021-03-16 19:43:17 +05302131 {515, sensor_cfg_yupik}, // YUPIK-LTE
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07002132 {457, waipio_common}, //Waipio
2133 {482, waipio_common}, //Waipio
Gopala Krishna Nuthaki7ef40922022-01-11 18:41:45 +05302134 {552, waipio_common}, //Waipio-LTE
Priyansh Jaind670d792022-07-20 15:51:13 +05302135 {506, diwali_common}, //diwali
2136 {547, diwali_common}, //diwali
2137 {564, diwali_common}, //diwali-LTE
Priyansh Jain6af76952021-11-10 10:48:06 +05302138 {530, waipio_common}, // cape
2139 {531, waipio_common}, // cape
2140 {540, waipio_common}, // cape
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05302141 {519, kalama_common}, //Kalama
2142 {536, kalama_common}, //Kalamap
congying1d469b22022-09-05 18:17:39 +08002143 {600, kalama_common}, //Kalama_sg
2144 {601, kalama_common}, //Kalamap_sg
Bhasker Reddy Komatireddy4f9957a2023-01-10 14:52:42 +05302145 {603, kalama_common}, //Kalama_qcs
2146 {604, kalama_common}, //Kalama_qcm
Rashid Zafarc2584072023-01-11 12:15:32 -08002147 {557, pineapple_common}, //Pineapple
2148 {577, pineapple_common}, //Pineapplep
Priyansh Jaindaa7d592023-09-25 15:55:19 +05302149 {632, cliffs_common}, //cliffs
2150 {614, cliffs_common}, //cliffs7
Nitesh Kumar30b30522023-11-21 13:23:59 +05302151 {486, sensor_cfg_monaco}, // monaco
2152 {517, sensor_cfg_monaco}, // monaco
Nitesh Kumard667c792024-01-03 17:17:58 +05302153 {623, sensor_cfg_pitti}, // Kalpeni
Priyansh Jainafe95152024-01-24 08:27:39 +05302154 {629, niobe_common}, //Matrix
Priyansh Jainb38d8f32024-04-05 11:01:31 +05302155 {652, niobe_common}, // Matrix_4k
Nitesh Kumara953a152024-03-07 16:35:01 +05302156 {636, volcano_common}, //milos
2157 {640, volcano_common}, //milos6
Nitesh Kumaref6f1f32024-04-16 23:37:19 +05302158 {657, volcano_common}, //milos IOT with modem
2159 {658, volcano_common}, //milos IOT
Nitesh Kumar662a53b2024-05-09 22:36:40 +05302160 {549, anorak_common},
2161 {649, anorak_common}, // Halliday Pro
Priyansh Jain39782192022-03-09 10:10:43 +05302162 {525, neo_common},
2163 {554, neo_common},
Nitesh Kumar47e465c2023-01-11 06:14:16 +05302164 {537, parrot_common}, //Netrani mobile
2165 {583, parrot_common}, //Netrani mobile without modem
2166 {613, parrot_common}, //Netrani APQ
Priyansh Jainf06e0842022-10-10 10:34:27 +05302167 {568, ravelin_common}, //Clarence Mobile
2168 {581, ravelin_common}, //Clarence IOT
2169 {582, ravelin_common}, //Clarence IOT without modem
Minghao Zhang7423ed82023-01-16 15:29:30 +08002170 {591, waipio_common}, //ukee
Priyansh Jaina72f3822023-05-30 14:44:09 +05302171 {608, crow_common}, //crow
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002172 };
2173
2174 const std::unordered_map<int, std::vector<struct target_therm_cfg>>
2175 msm_soc_specific = {
2176 {356, kona_specific}, // kona
Nitesh Kumara6747222023-06-20 13:11:31 +05302177 {481, kona_specific}, //kona iot
2178 {548, kona_specific}, //kona iot
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002179 {415, lahaina_specific}, // lahaina
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +05302180 {439, lahaina_specific}, // lahainap
2181 {456, lahaina_specific}, // lahaina-atp
Minghao Zhang31932a02021-03-08 10:58:11 +08002182 {501, lahaina_specific},
2183 {502, lahaina_specific},
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +05302184 {450, shima_specific}, // shima
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07002185 {457, waipio_specific}, //Waipio
2186 {482, waipio_specific}, //Waipio
Gopala Krishna Nuthaki7ef40922022-01-11 18:41:45 +05302187 {552, waipio_specific}, //Waipio-LTE
Priyansh Jaina26aeb42021-09-20 17:29:05 +05302188 {506, diwali_specific}, //diwali
Gopala Krishna Nuthakie7461532022-03-23 02:41:02 +05302189 {547, diwali_specific}, //diwali
2190 {564, diwali_specific}, //diwali-LTE
Priyansh Jain6af76952021-11-10 10:48:06 +05302191 {530, waipio_specific}, // cape
2192 {531, waipio_specific}, // cape
2193 {540, waipio_specific}, // cape
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05302194 {519, kalama_specific}, //Kalama
2195 {536, kalama_specific}, //Kalamap
congying1d469b22022-09-05 18:17:39 +08002196 {600, kalama_specific}, //Kalama_sg
2197 {601, kalama_specific}, //Kalamap_sg
Bhasker Reddy Komatireddy4f9957a2023-01-10 14:52:42 +05302198 {603, kalama_specific}, //Kalama_qcs
2199 {604, kalama_specific}, //Kalama_qcm
Rashid Zafare9219f72022-11-01 15:48:37 -07002200 {557, pineapple_specific}, //Pineapple
2201 {577, pineapple_specific}, //Pineapplep
Priyansh Jaindaa7d592023-09-25 15:55:19 +05302202 {632, cliffs_specific}, //cliffs
2203 {614, cliffs_specific}, //cliffs7
Nitesh Kumard667c792024-01-03 17:17:58 +05302204 {623, pitti_specific}, // Kalpeni
Priyansh Jainafe95152024-01-24 08:27:39 +05302205 {629, niobe_specific}, // Matrix
Priyansh Jainb38d8f32024-04-05 11:01:31 +05302206 {652, niobe_specific}, // Matrix_4k
Nitesh Kumara953a152024-03-07 16:35:01 +05302207 {636, volcano_specific}, //milos
2208 {640, volcano_specific}, //milos6
Nitesh Kumaref6f1f32024-04-16 23:37:19 +05302209 {657, volcano_specific}, //milos IOT with modem
2210 {658, volcano_specific}, //milos IOT
Nitesh Kumar662a53b2024-05-09 22:36:40 +05302211 {549, anorak_specific},
2212 {649, anorak_specific}, // Halliday Pro
Nitesh Kumar47e465c2023-01-11 06:14:16 +05302213 {537, parrot_specific}, //Netrani mobile
2214 {583, parrot_specific}, //Netrani mobile without modem
2215 {613, parrot_specific}, //Netrani APQ
Minghao Zhang7423ed82023-01-16 15:29:30 +08002216 {591, waipio_specific}, //ukee
Priyansh Jaina72f3822023-05-30 14:44:09 +05302217 {608, crow_specific}, //crow
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002218 };
2219
gnuthakidd79a2b2023-11-15 12:03:02 +05302220 const std::unordered_map<int, bool>
2221 battery_bcl_cfg_disable_map = {
2222 {377, true},
2223 {380, true},
2224 {384, true},
2225 {362, true},
2226 {367, true},
2227 {405, true},
2228 };
2229
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002230 const std::unordered_multimap<int, std::pair<std::string,
2231 std::vector<struct target_therm_cfg>>>
2232 msm_platform_specific = {
2233 {568, std::make_pair("QRD", ravelin_specific_qrd)},
2234 {568, std::make_pair("IDP", ravelin_specific_idp)},
2235 };
2236
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002237 std::vector<struct target_therm_cfg> add_target_config(
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002238 int socID, std::string hwPlatform,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002239 std::vector<struct target_therm_cfg> conf)
2240 {
2241 std::vector<struct target_therm_cfg> targetConf;
2242
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002243 if (msm_soc_specific.find(socID) != msm_soc_specific.end()) {
2244 targetConf = (msm_soc_specific.find(socID))->second;
2245 conf.insert(conf.end(), targetConf.begin(),
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002246 targetConf.end());
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002247 }
2248
2249 auto range = msm_platform_specific.equal_range(socID);
2250 auto it = range.first;
2251 for (; it != range.second; ++it) {
2252 if (it->second.first != hwPlatform)
2253 continue;
2254
2255 targetConf = it->second.second;
2256 conf.insert(conf.end(), targetConf.begin(),
2257 targetConf.end());
2258 break;
2259 }
2260
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002261 return conf;
2262 }
2263
2264 ThermalConfig::ThermalConfig():cmnInst()
2265 {
2266 std::unordered_map<int, std::vector<struct target_therm_cfg>>::const_iterator it;
gnuthakidd79a2b2023-11-15 12:03:02 +05302267 std::unordered_map<int, bool>::const_iterator it_2;
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002268 std::vector<struct target_therm_cfg>::iterator it_vec;
2269 bool bcl_defined = false;
2270 std::string soc_val;
Ram Chandrasekar9e1b3262021-07-29 15:41:00 -07002271 int ct = 0;
2272 bool read_ok = false;
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002273
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002274 soc_id = 0;
Ram Chandrasekar9e1b3262021-07-29 15:41:00 -07002275 do {
2276 if (cmnInst.readFromFile(socIDPath, soc_val) <= 0) {
2277 LOG(ERROR) <<"soc ID fetch error";
2278 return;
2279 }
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002280
2281 if (cmnInst.readFromFile(hwPlatformPath, hw_platform) <= 0) {
2282 LOG(ERROR) <<"hw Platform fetch error";
2283 continue;
2284 }
2285
Ram Chandrasekar9e1b3262021-07-29 15:41:00 -07002286 try {
2287 soc_id = std::stoi(soc_val, nullptr, 0);
2288 read_ok = true;
2289 }
2290 catch (std::exception &err) {
2291 LOG(ERROR) <<"soc id stoi err:" << err.what()
2292 << " buf:" << soc_val;
2293 }
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002294 } while (ct++ && !read_ok && ct < RETRY_CT);
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002295 if (soc_id <= 0) {
2296 LOG(ERROR) << "Invalid soc ID: " << soc_id;
2297 return;
2298 }
2299 it = msm_soc_map.find(soc_id);
2300 if (it == msm_soc_map.end()) {
2301 LOG(ERROR) << "No config for soc ID: " << soc_id;
2302 return;
2303 }
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002304 thermalConfig = add_target_config(soc_id, hw_platform, it->second);
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002305 for (it_vec = thermalConfig.begin();
2306 it_vec != thermalConfig.end(); it_vec++) {
2307 if (it_vec->type == TemperatureType::BCL_PERCENTAGE)
2308 bcl_defined = true;
2309 }
2310
gnuthakidd79a2b2023-11-15 12:03:02 +05302311 it_2 = battery_bcl_cfg_disable_map.find(soc_id);
2312 if (it_2 == battery_bcl_cfg_disable_map.end() || !it_2->second) {
2313 thermalConfig.push_back(bat_conf);
2314 if (!bcl_defined)
2315 thermalConfig.insert(thermalConfig.end(),
2316 bcl_conf.begin(), bcl_conf.end());
2317 }
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002318 LOG(DEBUG) << "Total sensors:" << thermalConfig.size();
2319 }
Bavyasritha Alahari0a344f42023-04-26 17:16:51 -07002320
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002321} // namespace thermal
2322} // namespace hardware
2323} // namespace android
Bavyasritha Alahari0a344f42023-04-26 17:16:51 -07002324} // namespace aidl
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002325