blob: e07ae9c542c3fabda0a974a3d7fe9c30850aa0d3 [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 Zhangf9d50a02021-04-12 18:29:50 +080056 std::vector<std::string> cpu_sensors_439 =
57 {
58 "apc1-cpu0-usr",
59 "apc1-cpu1-usr",
60 "apc1-cpu2-usr",
61 "apc1-cpu3-usr",
62 "cpuss0-usr",
63 "cpuss0-usr",
64 "cpuss0-usr",
65 "cpuss0-usr",
66 };
67
Ankit Siddhapura786d6182023-08-02 10:18:49 +053068 std::vector<struct target_therm_cfg> sensor_cfg_sdm632 =
69 {
70 {
71 TemperatureType::CPU,
72 cpu_sensors_439,
73 "",
74 95000,
75 115000,
76 true,
77 },
78 {
79 TemperatureType::GPU,
80 { "gpu0-usr" },
81 "GPU",
82 95000,
83 115000,
84 true,
85 },
86 {
87 TemperatureType::SKIN,
88 { "xo-therm-adc" },
89 "skin",
90 40000,
91 95000,
92 true,
93 },
94 {
95 TemperatureType::BCL_VOLTAGE,
96 { "pmi-vbat-lvl0" },
97 "vbat",
98 3200,
99 3000,
100 false,
101 },
102 {
103 TemperatureType::BCL_CURRENT,
104 { "pmi-ibat-lvl0" },
105 "ibat",
106 4200,
107 4400,
108 true,
109 },
110 {
111 TemperatureType::BCL_PERCENTAGE,
112 { "soc" },
113 "soc",
114 10,
115 2,
116 false,
117 },
118 };
119
Minghao Zhangf9d50a02021-04-12 18:29:50 +0800120 std::vector<struct target_therm_cfg> sensor_cfg_439 =
121 {
122 {
123 TemperatureType::CPU,
124 cpu_sensors_439,
125 "",
126 95000,
127 115000,
128 true,
129 },
130 {
131 TemperatureType::GPU,
132 { "gpu-usr" },
133 "GPU",
134 95000,
135 115000,
136 true,
137 },
138 {
139 TemperatureType::SKIN,
140 { "quiet-therm-adc" },
141 "skin",
142 40000,
143 95000,
144 true,
145 },
146 {
147 TemperatureType::BCL_VOLTAGE,
148 { "vbat_adc" },
149 "vbat",
150 3200,
151 3000,
152 false,
153 },
154 {
155 TemperatureType::BCL_CURRENT,
156 { "ibat-high" },
157 "ibat",
158 4200,
159 4400,
160 true,
161 },
162 {
163 TemperatureType::BCL_PERCENTAGE,
164 { "soc" },
165 "soc",
166 10,
167 2,
168 false,
169 },
170 };
171
Dakkshesh4b1f3262023-09-17 20:38:55 +0530172 std::vector<std::string> cpu_sensors_sdm710 =
173 {
174 "cpu0-silver-usr",
175 "cpu1-silver-usr",
176 "cpu2-silver-usr",
177 "cpu3-silver-usr",
178 "cpu4-silver-usr",
179 "cpu5-silver-usr",
180 "cpu0-gold-usr",
181 "cpu1-gold-usr",
182 };
183
184 std::vector<struct target_therm_cfg> sensor_cfg_sdm710 = {
185 {
186 TemperatureType::CPU,
187 cpu_sensors_sdm710,
188 "",
189 95000,
190 115000,
191 true,
192 },
193 {
194 TemperatureType::GPU,
195 {"gpu0-usr"},
196 "gpu0",
197 95000,
198 115000,
199 true,
200 },
201 {
202 TemperatureType::GPU,
203 {"gpu1-usr"},
204 "gpu1",
205 95000,
206 115000,
207 true,
208 },
209 {
210 TemperatureType::SKIN,
211 {"xo-therm-adc"},
212 "skin",
213 55000,
214 95000,
215 true,
216 },
217 {
218 TemperatureType::BCL_PERCENTAGE,
219 {"soc"},
220 "soc",
221 10,
222 2,
223 false,
224 },
225 };
226
Gopala Krishna Nuthakibcc1d012021-05-04 12:06:53 +0530227 std::vector<std::string> cpu_sensors_sdm845 =
228 {
229 "cpu0-silver-usr",
230 "cpu1-silver-usr",
231 "cpu2-silver-usr",
232 "cpu3-silver-usr",
233 "cpu0-gold-usr",
234 "cpu1-gold-usr",
235 "cpu2-gold-usr",
236 "cpu3-gold-usr",
237 };
238
239 std::vector<struct target_therm_cfg> sensor_cfg_sdm845 = {
240 {
241 TemperatureType::CPU,
242 cpu_sensors_sdm845,
243 "",
244 95000,
245 115000,
246 true,
247 },
248 {
249 TemperatureType::GPU,
250 {"gpu0-usr"},
251 "gpu0",
252 95000,
253 115000,
254 true,
255 },
256 {
257 TemperatureType::GPU,
258 {"gpu1-usr"},
259 "gpu1",
260 95000,
261 115000,
262 true,
263 },
264 {
265 TemperatureType::SKIN,
266 {"xo-therm-adc"},
267 "skin",
LuK133774db7b62023-08-14 10:56:45 +0200268 55000,
Gopala Krishna Nuthakibcc1d012021-05-04 12:06:53 +0530269 95000,
270 true,
271 },
272 {
273 TemperatureType::BCL_PERCENTAGE,
274 {"soc"},
275 "soc",
276 10,
277 2,
278 false,
279 },
280 };
281
Minghao Zhang2658fa62020-12-28 10:16:45 +0800282 std::vector<std::string> cpu_sensors_bengal =
283 {
Nitesh Kumar6f5f9962024-02-13 14:51:34 +0530284 "cpuss-0",
285 "cpuss-1",
286 "cpuss-2",
287 "cpuss-2",
288 "cpu-1-0",
289 "cpu-1-1",
290 "cpu-1-2",
291 "cpu-1-3",
Minghao Zhang2658fa62020-12-28 10:16:45 +0800292 };
293
294 std::vector<struct target_therm_cfg> sensor_cfg_bengal =
295 {
296 {
297 TemperatureType::CPU,
298 cpu_sensors_bengal,
299 "",
300 95000,
301 115000,
Minghao Zhang2658fa62020-12-28 10:16:45 +0800302 true,
303 },
304 {
305 TemperatureType::GPU,
Nitesh Kumar6f5f9962024-02-13 14:51:34 +0530306 { "gpu" },
Minghao Zhang2658fa62020-12-28 10:16:45 +0800307 "GPU",
308 95000,
309 115000,
Minghao Zhang2658fa62020-12-28 10:16:45 +0800310 true,
311 },
312 {
313 TemperatureType::SKIN,
Nitesh Kumar6f5f9962024-02-13 14:51:34 +0530314 { "xo-therm" },
Minghao Zhang2658fa62020-12-28 10:16:45 +0800315 "skin",
316 40000,
317 95000,
Minghao Zhang2658fa62020-12-28 10:16:45 +0800318 true,
319 },
320 {
Minghao Zhang2658fa62020-12-28 10:16:45 +0800321 TemperatureType::BCL_CURRENT,
322 { "pmi632-ibat-lvl0" },
323 "ibat",
324 4000,
325 4200,
Minghao Zhang2658fa62020-12-28 10:16:45 +0800326 true,
327 },
328 {
329 TemperatureType::BCL_PERCENTAGE,
Nitesh Kumar6f5f9962024-02-13 14:51:34 +0530330 { "socd" },
331 "socd",
332 90,
333 99,
Minghao Zhang2658fa62020-12-28 10:16:45 +0800334 false,
335 },
336 };
Minghao Zhangae04ce32020-09-23 23:28:34 +0800337
gnuthakidd79a2b2023-11-15 12:03:02 +0530338 std::vector<std::string> cpu_sensors_talos =
339 {
340 "cpuss-2",
341 "cpuss-2",
342 "cpuss-1",
343 "cpuss-1",
344 "cpuss-0",
345 "cpuss-0",
346 "cpu-1-0",
347 "cpu-1-2",
348 };
349
350 std::vector<struct target_therm_cfg> sensor_cfg_talos_common =
351 {
352 {
353 TemperatureType::CPU,
354 cpu_sensors_talos,
355 "",
356 95000,
357 115000,
358 true,
359 },
360 {
361 TemperatureType::GPU,
362 { "gpu" },
363 "gpu",
364 95000,
365 115000,
366 true,
367 },
368 };
369
370 std::vector<struct target_therm_cfg> sensor_cfg_sa6155_common =
371 {
372 {
373 TemperatureType::CPU,
374 cpu_sensors_talos,
375 "",
376 105000,
377 118000,
378 true,
379 },
380 {
381 TemperatureType::GPU,
382 { "gpu" },
383 "gpu",
384 105000,
385 118000,
386 true,
387 },
388 };
389
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530390 std::vector<std::string> cpu_sensors_khaje =
391 {
Manaf Meethalavalappu Pallikunhi6d43d262023-01-06 19:51:33 +0530392 "cpuss-2",
393 "cpuss-2",
394 "cpuss-2",
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530395 "cpuss-2",
396 "cpu-1-0",
397 "cpu-1-1",
398 "cpu-1-2",
399 "cpu-1-3",
400 };
401
402 std::vector<struct target_therm_cfg> sensor_cfg_khaje =
403 {
404 {
405 TemperatureType::CPU,
406 cpu_sensors_khaje,
407 "",
408 95000,
409 115000,
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530410 true,
411 },
412 {
413 TemperatureType::GPU,
414 { "gpu" },
415 "GPU",
416 95000,
417 115000,
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530418 true,
419 },
420 {
421 TemperatureType::SKIN,
422 { "xo-therm" },
423 "skin",
424 40000,
425 95000,
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530426 true,
427 },
428 {
429 TemperatureType::BCL_VOLTAGE,
Manaf Meethalavalappu Pallikunhi6d43d262023-01-06 19:51:33 +0530430 { "vbat" },
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530431 "vbat",
432 3000,
433 2800,
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530434 false,
435 },
436 {
437 TemperatureType::BCL_CURRENT,
438 { "pm7250b-ibat-lvl0" },
439 "ibat",
440 5500,
441 6000,
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530442 true,
443 },
444 {
445 TemperatureType::BCL_PERCENTAGE,
Manaf Meethalavalappu Pallikunhi6d43d262023-01-06 19:51:33 +0530446 { "socd" },
447 "socd",
448 90,
449 99,
450 true,
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530451 },
452 };
453
Minghao Zhangae04ce32020-09-23 23:28:34 +0800454 std::vector<std::string> cpu_sensors_trinket =
455 {
Nitesh Kumar7de2fcb2023-06-22 18:21:53 +0530456 "cpuss-0",
457 "cpuss-0",
458 "cpuss-0",
459 "cpuss-0",
460 "cpu-1-0",
461 "cpu-1-1",
462 "cpu-1-2",
463 "cpu-1-3",
Minghao Zhangae04ce32020-09-23 23:28:34 +0800464 };
465
466 std::vector<struct target_therm_cfg> sensor_cfg_trinket =
467 {
468 {
469 TemperatureType::CPU,
470 cpu_sensors_trinket,
471 "",
472 95000,
473 115000,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800474 true,
475 },
476 {
477 TemperatureType::GPU,
Nitesh Kumar7de2fcb2023-06-22 18:21:53 +0530478 { "gpu" },
Minghao Zhangae04ce32020-09-23 23:28:34 +0800479 "GPU",
480 95000,
481 115000,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800482 true,
483 },
484 {
485 TemperatureType::SKIN,
Nitesh Kumar7de2fcb2023-06-22 18:21:53 +0530486 { "xo-therm" },
Minghao Zhangae04ce32020-09-23 23:28:34 +0800487 "skin",
488 40000,
489 95000,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800490 true,
491 },
492 {
493 TemperatureType::BCL_VOLTAGE,
Nitesh Kumar7de2fcb2023-06-22 18:21:53 +0530494 { "vbat" },
Minghao Zhangae04ce32020-09-23 23:28:34 +0800495 "vbat",
496 3000,
497 2800,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800498 false,
499 },
500 {
501 TemperatureType::BCL_CURRENT,
502 { "pmi632-ibat-lvl0" },
503 "ibat",
504 4000,
505 4200,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800506 true,
507 },
508 {
509 TemperatureType::BCL_PERCENTAGE,
Nitesh Kumar7de2fcb2023-06-22 18:21:53 +0530510 { "socd" },
511 "socd",
512 90,
513 99,
514 true,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800515 },
516 };
517
Edwin Moquete9b72a562022-04-16 20:04:36 +0000518 std::vector<struct target_therm_cfg> sensor_cfg_sdm660 =
519 {
520 {
521 TemperatureType::CPU,
522 cpu_sensors_trinket,
523 "",
524 95000,
525 115000,
526 true,
527 },
528 {
529 TemperatureType::GPU,
530 { "gpu-usr" },
531 "GPU",
532 95000,
533 115000,
534 true,
535 },
536 {
537 TemperatureType::SKIN,
538 { "xo-therm-adc" },
539 "skin",
540 40000,
541 95000,
542 true,
543 },
544 {
545 TemperatureType::BCL_PERCENTAGE,
546 { "soc" },
547 "soc",
548 10,
549 2,
550 false,
551 },
552 };
553
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700554 std::vector<std::string> cpu_sensors_lito =
555 {
556 "cpu-0-0-usr",
557 "cpu-0-1-usr",
558 "cpu-0-2-usr",
559 "cpu-0-3-usr",
560 "cpu-0-4-usr",
561 "cpu-0-5-usr",
562 "cpu-1-0-usr",
563 "cpu-1-2-usr",
564 };
565
566 std::vector<struct target_therm_cfg> sensor_cfg_lito =
567 {
568 {
569 TemperatureType::CPU,
570 cpu_sensors_lito,
571 "",
572 95000,
573 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700574 true,
575 },
576 {
577 TemperatureType::GPU,
578 { "gpuss-0-usr" },
579 "GPU",
580 95000,
581 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700582 true,
583 },
584 {
585 TemperatureType::SKIN,
586 { "xo-therm-usr" },
587 "skin",
Michael Bestas5806fe52023-08-28 20:04:06 +0300588 55000,
Minghao Zhang50998c82020-09-11 17:17:13 +0800589 95000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700590 true,
591 },
592 {
593 TemperatureType::BCL_CURRENT,
594 { "pm7250b-ibat-lvl0" },
595 "ibat",
596 4500,
597 5000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700598 true,
599 },
600 {
601 TemperatureType::BCL_VOLTAGE,
602 { "pm7250b-vbat-lvl0" },
603 "vbat",
604 3200,
605 3000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700606 false,
607 },
608 {
609 TemperatureType::BCL_PERCENTAGE,
610 { "soc" },
611 "soc",
612 10,
613 2,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700614 false,
615 },
616 };
617
Minghao Zhangae04ce32020-09-23 23:28:34 +0800618 std::vector<struct target_therm_cfg> sensor_cfg_sdmmagpie =
619 {
620 {
621 TemperatureType::CPU,
622 cpu_sensors_lito,
623 "",
624 95000,
625 115000,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800626 true,
627 },
628 {
629 TemperatureType::GPU,
630 { "gpuss-0-usr" },
631 "GPU",
632 95000,
633 115000,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800634 true,
635 },
636 {
637 TemperatureType::SKIN,
638 { "xo-therm-adc" },
639 "skin",
640 40000,
641 95000,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800642 true,
643 },
644 {
645 TemperatureType::BCL_VOLTAGE,
646 { "pm6150-vbat-lvl0" },
647 "vbat",
648 3000,
649 2800,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800650 false,
651 },
652 {
653 TemperatureType::BCL_CURRENT,
654 { "pm6150-ibat-lvl0" },
655 "ibat",
656 5500,
657 6000,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800658 true,
659 },
660 {
661 TemperatureType::BCL_PERCENTAGE,
662 { "soc" },
663 "soc",
664 10,
665 2,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800666 false,
667 },
668 };
669
Nitesh Kumar83759f12023-06-30 19:15:54 +0530670 std::vector<std::string> cpu_sensors_holi =
671 {
672 "cpu-0-0",
673 "cpu-0-1",
674 "cpu-0-2",
675 "cpu-0-3",
676 "cpu-0-4",
677 "cpu-0-5",
678 "cpu-1-0",
679 "cpu-1-2",
680 };
681
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530682 std::vector<struct target_therm_cfg> sensor_cfg_holi =
683 {
684 {
685 TemperatureType::CPU,
Nitesh Kumar83759f12023-06-30 19:15:54 +0530686 cpu_sensors_holi,
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530687 "",
688 95000,
689 115000,
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530690 true,
691 },
692 {
693 TemperatureType::GPU,
Nitesh Kumar83759f12023-06-30 19:15:54 +0530694 { "gpuss-0" },
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530695 "gpu0",
696 95000,
697 115000,
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530698 true,
699 },
700 {
701 TemperatureType::GPU,
Nitesh Kumar83759f12023-06-30 19:15:54 +0530702 { "gpuss-1" },
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530703 "gpu1",
704 95000,
705 115000,
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530706 true,
707 },
708 {
709 TemperatureType::SKIN,
Nitesh Kumar83759f12023-06-30 19:15:54 +0530710 { "quiet-therm" },
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530711 "skin",
712 40000,
713 95000,
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530714 true,
715 },
716 {
717 TemperatureType::BCL_CURRENT,
718 { "pm7250b-ibat-lvl0" },
719 "ibat",
720 5500,
721 6000,
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530722 true,
723 },
724 };
725
gnuthakidd79a2b2023-11-15 12:03:02 +0530726 std::vector<std::string> cpu_sensors_msmnile =
727 {
728 "cpu-0-0",
729 "cpu-0-1",
730 "cpu-0-2",
731 "cpu-0-3",
732 "cpu-1-0",
733 "cpu-1-1",
734 "cpu-1-2",
735 "cpu-1-3",
736 };
737
738 std::vector<struct target_therm_cfg> sensor_cfg_msmnile_common = {
739 {
740 TemperatureType::CPU,
741 cpu_sensors_msmnile,
742 "",
743 95000,
744 115000,
745 true,
746 },
747 {
748 TemperatureType::GPU,
749 { "gpuss-0" },
750 "gpu0",
751 95000,
752 115000,
753 true,
754 },
755 {
756 TemperatureType::GPU,
757 { "gpuss-1" },
758 "gpu1",
759 95000,
760 115000,
761 true,
762 },
763 };
764
765 std::vector<struct target_therm_cfg> sensor_cfg_sa8155_common = {
766 {
767 TemperatureType::CPU,
768 cpu_sensors_msmnile,
769 "",
770 105000,
771 118000,
772 true,
773 },
774 {
775 TemperatureType::GPU,
776 { "gpuss-0" },
777 "gpu0",
778 105000,
779 118000,
780 true,
781 },
782 {
783 TemperatureType::GPU,
784 { "gpuss-1" },
785 "gpu1",
786 105000,
787 118000,
788 true,
789 },
790 };
791
792 std::vector<struct target_therm_cfg> sensor_cfg_sa8195_common = {
793 {
794 TemperatureType::CPU,
795 cpu_sensors_msmnile,
796 "",
797 105000,
798 118000,
799 true,
800 },
801 {
802 TemperatureType::GPU,
803 { "gpuss-0" },
804 "gpu0",
805 105000,
806 118000,
807 true,
808 },
809 {
810 TemperatureType::GPU,
811 { "gpuss-1" },
812 "gpu1",
813 105000,
814 118000,
815 true,
816 },
817 {
818 TemperatureType::GPU,
819 { "gpuss-2" },
820 "gpu2",
821 105000,
822 118000,
823 true,
824 },
825 {
826 TemperatureType::GPU,
827 { "gpuss-3" },
828 "gpu3",
829 105000,
830 118000,
831 true,
832 },
833 };
834
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700835 std::vector<std::string> cpu_sensors_kona =
836 {
Priyansh Jain0c6fd5b2023-01-13 16:56:48 +0530837 "cpu-0-0",
838 "cpu-0-1",
839 "cpu-0-2",
840 "cpu-0-3",
841 "cpu-1-0",
842 "cpu-1-1",
843 "cpu-1-2",
844 "cpu-1-3",
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700845 };
846
847 std::vector<struct target_therm_cfg> kona_common = {
848 {
849 TemperatureType::CPU,
850 cpu_sensors_kona,
851 "",
852 95000,
853 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700854 true,
855 },
856 {
857 TemperatureType::GPU,
Priyansh Jain0c6fd5b2023-01-13 16:56:48 +0530858 { "gpuss-0" },
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700859 "GPU0",
860 95000,
861 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700862 true,
863 },
864 {
865 TemperatureType::GPU,
Priyansh Jain0c6fd5b2023-01-13 16:56:48 +0530866 { "gpuss-1" },
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700867 "GPU1",
868 95000,
869 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700870 true,
871 },
872 {
873 TemperatureType::SKIN,
Priyansh Jain0c6fd5b2023-01-13 16:56:48 +0530874 { "skin-msm-therm" },
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700875 "skin",
876 40000,
877 95000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700878 true,
879 }
880 };
881
882 std::vector<struct target_therm_cfg> kona_specific = {
883 {
884 TemperatureType::BCL_CURRENT,
885 { "pm8150b-ibat-lvl0" },
886 "ibat",
887 4500,
888 5000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700889 true,
890 },
891 {
892 TemperatureType::BCL_VOLTAGE,
Priyansh Jain0c6fd5b2023-01-13 16:56:48 +0530893 { "vbat" },
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700894 "vbat",
895 3200,
896 3000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700897 false,
898 },
899 {
900 TemperatureType::BCL_PERCENTAGE,
Priyansh Jain0c6fd5b2023-01-13 16:56:48 +0530901 { "socd" },
902 "socd",
903 90,
904 99,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700905 false,
906 },
907 {
908 TemperatureType::NPU,
Priyansh Jain0c6fd5b2023-01-13 16:56:48 +0530909 { "npu" },
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700910 "npu",
911 95000,
Ram Chandrasekarc49329d2020-08-25 14:28:02 -0700912 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700913 true,
914 },
915 };
916
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530917 std::vector<std::string> cpu_sensors_lahaina =
918 {
919 "cpu-0-0-usr",
920 "cpu-0-1-usr",
921 "cpu-0-2-usr",
922 "cpu-0-3-usr",
923 "cpu-1-0-usr",
924 "cpu-1-2-usr",
925 "cpu-1-4-usr",
926 "cpu-1-6-usr",
927 };
928
929 std::vector<struct target_therm_cfg> lahaina_common = {
930 {
931 TemperatureType::CPU,
932 cpu_sensors_lahaina,
933 "",
934 95000,
935 115000,
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530936 true,
937 },
938 {
939 TemperatureType::GPU,
940 { "gpuss-0-usr" },
941 "GPU0",
942 95000,
943 115000,
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530944 true,
945 },
946 {
947 TemperatureType::GPU,
948 { "gpuss-1-usr" },
949 "GPU1",
950 95000,
951 115000,
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530952 true,
953 },
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700954 {
955 TemperatureType::BCL_CURRENT,
956 { "pm8350b-ibat-lvl0" },
957 "ibat",
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530958 6000,
959 7500,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700960 true,
961 },
962 {
963 TemperatureType::NPU,
964 { "nspss-0-usr" },
965 "nsp0",
966 95000,
Ram Chandrasekarc49329d2020-08-25 14:28:02 -0700967 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700968 true,
969 },
970 {
971 TemperatureType::NPU,
972 { "nspss-1-usr" },
973 "nsp1",
974 95000,
Ram Chandrasekarc49329d2020-08-25 14:28:02 -0700975 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700976 true,
977 },
978 {
979 TemperatureType::NPU,
980 { "nspss-2-usr" },
981 "nsp2",
982 95000,
Ram Chandrasekarc49329d2020-08-25 14:28:02 -0700983 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700984 true,
985 },
986 };
987
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530988 std::vector<struct target_therm_cfg> lahaina_specific = {
989 {
990 TemperatureType::SKIN,
Minghao Zhang72737612020-10-29 10:32:44 +0800991 { "xo-therm-usr" },
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530992 "skin",
Minghao Zhang72737612020-10-29 10:32:44 +0800993 55000,
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530994 95000,
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530995 true,
996 },
997 };
998
999 std::vector<struct target_therm_cfg> shima_specific = {
1000 {
1001 TemperatureType::SKIN,
1002 { "quiet-therm-usr" },
1003 "skin",
1004 40000,
1005 95000,
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +05301006 true,
1007 },
1008 };
1009
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +05301010 std::vector<struct target_therm_cfg> sensor_cfg_yupik = {
1011 {
1012 TemperatureType::CPU,
1013 cpu_sensors_lahaina,
1014 "",
1015 95000,
1016 115000,
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +05301017 true,
1018 },
1019 {
1020 TemperatureType::GPU,
1021 { "gpuss-0-usr" },
1022 "GPU0",
1023 95000,
1024 115000,
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +05301025 true,
1026 },
1027 {
1028 TemperatureType::GPU,
1029 { "gpuss-1-usr" },
1030 "GPU1",
1031 95000,
1032 115000,
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +05301033 true,
1034 },
1035 {
1036 TemperatureType::NPU,
1037 { "nspss-0-usr" },
1038 "nsp0",
1039 95000,
1040 115000,
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +05301041 true,
1042 },
1043 {
1044 TemperatureType::NPU,
1045 { "nspss-1-usr" },
1046 "nsp1",
1047 95000,
1048 115000,
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +05301049 true,
1050 },
1051 {
1052 TemperatureType::SKIN,
1053 { "quiet-therm-usr" },
1054 "skin",
Michael Bestas6c985392024-08-16 05:15:16 +03001055 55000,
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +05301056 95000,
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +05301057 true,
1058 },
1059 };
1060
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001061 std::vector<std::string> cpu_sensors_waipio =
1062 {
1063 "cpu-0-0",
1064 "cpu-0-1",
1065 "cpu-0-2",
1066 "cpu-0-3",
1067 "cpu-1-0",
1068 "cpu-1-2",
1069 "cpu-1-4",
1070 "cpu-1-6",
1071 };
1072
1073 std::vector<struct target_therm_cfg> waipio_common = {
1074 {
1075 TemperatureType::CPU,
1076 cpu_sensors_waipio,
1077 "",
1078 95000,
1079 115000,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001080 true,
1081 },
1082 {
1083 TemperatureType::GPU,
1084 { "gpuss-0" },
1085 "GPU0",
1086 95000,
1087 115000,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001088 true,
1089 },
1090 {
1091 TemperatureType::GPU,
1092 { "gpuss-1" },
1093 "GPU1",
1094 95000,
1095 115000,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001096 true,
1097 },
1098 {
1099 TemperatureType::NPU,
1100 { "nspss-0" },
1101 "nsp0",
1102 95000,
1103 115000,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001104 true,
1105 },
1106 {
1107 TemperatureType::NPU,
1108 { "nspss-1" },
1109 "nsp1",
1110 95000,
1111 115000,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001112 true,
1113 },
1114 {
1115 TemperatureType::NPU,
1116 { "nspss-2" },
1117 "nsp2",
1118 95000,
1119 115000,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001120 true,
1121 },
Priyansh Jaina26aeb42021-09-20 17:29:05 +05301122 };
1123
Priyansh Jaind670d792022-07-20 15:51:13 +05301124 std::vector<struct target_therm_cfg> diwali_common = {
1125 {
1126 TemperatureType::CPU,
1127 cpu_sensors_waipio,
1128 "",
1129 95000,
1130 115000,
1131 true,
1132 ThrottlingSeverity::LIGHT,
1133 },
1134 {
1135 TemperatureType::GPU,
1136 { "gpuss-0" },
1137 "GPU0",
1138 95000,
1139 115000,
1140 true,
1141 ThrottlingSeverity::LIGHT,
1142 },
1143 {
1144 TemperatureType::GPU,
1145 { "gpuss-1" },
1146 "GPU1",
1147 95000,
1148 115000,
1149 true,
1150 ThrottlingSeverity::LIGHT,
1151 },
1152 {
1153 TemperatureType::NPU,
1154 { "nspss-0" },
1155 "nsp0",
1156 95000,
1157 115000,
1158 true,
1159 ThrottlingSeverity::LIGHT,
1160 },
1161 {
1162 TemperatureType::NPU,
1163 { "nspss-1" },
1164 "nsp1",
1165 95000,
1166 115000,
1167 true,
1168 ThrottlingSeverity::LIGHT,
1169 },
1170 {
1171 TemperatureType::NPU,
1172 { "nspss-2" },
1173 "nsp2",
1174 95000,
1175 115000,
1176 true,
1177 ThrottlingSeverity::LIGHT,
1178 },
1179 };
1180
Priyansh Jaina26aeb42021-09-20 17:29:05 +05301181 std::vector<struct target_therm_cfg> waipio_specific = {
1182 {
1183 TemperatureType::BCL_CURRENT,
1184 { "pm8350b-ibat-lvl0" },
1185 "ibat",
1186 6000,
1187 7500,
Priyansh Jaina26aeb42021-09-20 17:29:05 +05301188 true,
1189 },
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001190 {
1191 TemperatureType::SKIN,
1192 { "xo-therm" },
1193 "skin",
1194 55000,
1195 95000,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001196 true,
1197 },
1198 };
1199
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301200 std::vector<std::string> cpu_sensors_kalama =
1201 {
1202 "cpu-0-0",
1203 "cpu-0-1",
1204 "cpu-0-2",
1205 "cpu-1-0",
1206 "cpu-1-2",
1207 "cpu-1-4",
1208 "cpu-1-6",
1209 "cpu-1-8",
1210 };
1211
1212 std::vector<struct target_therm_cfg> kalama_common = {
1213 {
1214 TemperatureType::CPU,
1215 cpu_sensors_kalama,
1216 "",
1217 95000,
1218 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301219 true,
1220 },
1221 {
1222 TemperatureType::GPU,
1223 { "gpuss-0" },
1224 "GPU0",
1225 95000,
1226 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301227 true,
1228 },
1229 {
1230 TemperatureType::GPU,
1231 { "gpuss-1" },
1232 "GPU1",
1233 95000,
1234 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301235 true,
1236 },
1237 {
1238 TemperatureType::GPU,
1239 { "gpuss-2" },
1240 "GPU2",
1241 95000,
1242 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301243 true,
1244 },
1245 {
1246 TemperatureType::GPU,
1247 { "gpuss-3" },
1248 "GPU3",
1249 95000,
1250 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301251 true,
1252 },
1253 {
1254 TemperatureType::GPU,
1255 { "gpuss-4" },
1256 "GPU4",
1257 95000,
1258 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301259 true,
1260 },
1261 {
1262 TemperatureType::GPU,
1263 { "gpuss-5" },
1264 "GPU5",
1265 95000,
1266 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301267 true,
1268 },
1269 {
1270 TemperatureType::GPU,
1271 { "gpuss-6" },
1272 "GPU6",
1273 95000,
1274 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301275 true,
1276 },
1277 {
1278 TemperatureType::GPU,
1279 { "gpuss-7" },
1280 "GPU7",
1281 95000,
1282 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301283 true,
1284 },
1285 {
1286 TemperatureType::NPU,
1287 { "nspss-0" },
1288 "nsp0",
Manaf Meethalavalappu Pallikunhi92b7bbf2022-06-30 01:29:08 +05301289 100000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301290 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301291 true,
1292 },
1293 {
1294 TemperatureType::NPU,
1295 { "nspss-1" },
1296 "nsp1",
Manaf Meethalavalappu Pallikunhi92b7bbf2022-06-30 01:29:08 +05301297 100000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301298 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301299 true,
1300 },
1301 {
1302 TemperatureType::NPU,
1303 { "nspss-2" },
1304 "nsp2",
Manaf Meethalavalappu Pallikunhi92b7bbf2022-06-30 01:29:08 +05301305 100000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301306 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301307 true,
1308 },
1309 {
1310 TemperatureType::NPU,
1311 { "nspss-3" },
1312 "nsp3",
Manaf Meethalavalappu Pallikunhi92b7bbf2022-06-30 01:29:08 +05301313 100000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301314 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301315 true,
1316 },
1317 };
1318
1319 std::vector<struct target_therm_cfg> kalama_specific = {
1320 {
1321 TemperatureType::BCL_CURRENT,
1322 { "pm8550b-ibat-lvl0" },
1323 "ibat",
1324 9000,
1325 10000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301326 true,
1327 },
1328 {
1329 TemperatureType::SKIN,
Rashid Zafar580cffb2022-08-15 14:51:54 -07001330 { "skin-msm-therm" },
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301331 "skin",
Rashid Zafar580cffb2022-08-15 14:51:54 -07001332 46500,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301333 95000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301334 true,
1335 },
1336 };
1337
Priyansh Jaina72f3822023-05-30 14:44:09 +05301338 std::vector<std::string> cpu_sensors_crow =
1339 {
1340 "cpu-0-0",
1341 "cpu-0-1",
1342 "cpu-0-2",
1343 "cpu-0-3",
1344 "cpu-1-0",
1345 "cpu-1-2",
1346 "cpu-1-4",
1347 "cpu-1-6",
1348 };
1349
1350 std::vector<struct target_therm_cfg> crow_common = {
1351 {
1352 TemperatureType::CPU,
1353 cpu_sensors_crow,
1354 "",
1355 95000,
1356 115000,
1357 true,
1358 },
1359 {
1360 TemperatureType::GPU,
1361 { "gpuss-0" },
1362 "GPU0",
gnuthaki8b5e93d2023-08-24 16:23:14 +05301363 102000,
Priyansh Jaina72f3822023-05-30 14:44:09 +05301364 115000,
1365 true,
1366 },
1367 {
1368 TemperatureType::GPU,
1369 { "gpuss-1" },
1370 "GPU1",
gnuthaki8b5e93d2023-08-24 16:23:14 +05301371 102000,
Priyansh Jaina72f3822023-05-30 14:44:09 +05301372 115000,
1373 true,
1374 },
1375 {
1376 TemperatureType::NPU,
1377 { "nspss-0" },
1378 "nsp0",
1379 100000,
1380 115000,
1381 true,
1382 },
1383 {
1384 TemperatureType::NPU,
1385 { "nspss-1" },
1386 "nsp1",
1387 100000,
1388 115000,
1389 true,
1390 },
1391 {
1392 TemperatureType::NPU,
1393 { "nspss-2" },
1394 "nsp2",
1395 100000,
1396 115000,
1397 true,
1398 },
1399 };
1400
1401 std::vector<struct target_therm_cfg> crow_specific = {
1402 {
1403 TemperatureType::SKIN,
1404 { "sys-therm-3" },
1405 "skin",
1406 60000,
1407 95000,
1408 true,
1409 },
1410 };
1411
Priyansh Jaina26aeb42021-09-20 17:29:05 +05301412 std::vector<struct target_therm_cfg> diwali_specific = {
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001413 {
1414 TemperatureType::BCL_CURRENT,
Minghao Zhang510dcf12022-03-04 19:20:38 +08001415 { "pm7250b-ibat-lvl0" },
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001416 "ibat",
Minghao Zhang510dcf12022-03-04 19:20:38 +08001417 9000,
1418 9500,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001419 true,
1420 },
Priyansh Jaina26aeb42021-09-20 17:29:05 +05301421 {
1422 TemperatureType::SKIN,
1423 { "quiet-therm" },
1424 "skin",
Priyansh Jain895ef382022-07-05 12:43:10 +05301425 46000,
Priyansh Jaina26aeb42021-09-20 17:29:05 +05301426 95000,
Priyansh Jaina26aeb42021-09-20 17:29:05 +05301427 true,
Priyansh Jaind670d792022-07-20 15:51:13 +05301428 ThrottlingSeverity::LIGHT,
Priyansh Jaina26aeb42021-09-20 17:29:05 +05301429 },
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001430 };
1431
Priyansh Jain39782192022-03-09 10:10:43 +05301432 std::vector<std::string> cpu_sensors_neo =
1433 {
1434 "cpu-0-0",
1435 "cpu-0-1",
1436 "cpu-0-2",
1437 "cpu-0-3",
1438 };
1439
1440 std::vector<struct target_therm_cfg> neo_common = {
1441 {
1442 TemperatureType::CPU,
1443 cpu_sensors_neo,
1444 "",
1445 95000,
1446 115000,
1447 true,
1448 },
1449 {
1450 TemperatureType::GPU,
1451 { "gpuss-0" },
1452 "GPU0",
1453 95000,
1454 115000,
1455 true,
1456 },
1457 {
1458 TemperatureType::GPU,
1459 { "gpuss-1" },
1460 "GPU1",
1461 95000,
1462 115000,
1463 true,
1464 },
1465 {
1466 TemperatureType::NPU,
1467 { "nspss-0" },
1468 "nsp0",
1469 95000,
1470 115000,
1471 true,
1472 },
1473 {
1474 TemperatureType::NPU,
1475 { "nspss-1" },
1476 "nsp1",
1477 95000,
1478 115000,
1479 true,
1480 },
1481 {
1482 TemperatureType::NPU,
1483 { "nspss-2" },
1484 "nsp2",
1485 95000,
1486 115000,
1487 true,
1488 },
Michael Bestase1d00342025-07-06 08:54:44 +03001489 // Google specific changes for aurora vxp product.
1490 {
1491 TemperatureType::SKIN,
1492 { "disp-lea-right" },
1493 "SKIN-DISP-LEA",
1494 65000,
1495 85000,
1496 true,
1497 },
1498 {
1499 TemperatureType::SKIN,
1500 { "disp-lea-left" },
1501 "SKIN-DISP-LEA",
1502 65000,
1503 85000,
1504 true,
1505 },
Priyansh Jain39782192022-03-09 10:10:43 +05301506 };
1507
Priyansh Jainb48d2ec2022-03-21 16:25:29 +05301508 std::vector<std::string> cpu_sensors_parrot =
1509 {
1510 "cpu-0-0",
1511 "cpu-0-1",
1512 "cpu-0-2",
1513 "cpu-0-3",
1514 "cpu-1-0",
1515 "cpu-1-2",
1516 "cpu-1-4",
1517 "cpu-1-6",
1518 };
1519
1520 std::vector<struct target_therm_cfg> parrot_common = {
1521 {
1522 TemperatureType::CPU,
1523 cpu_sensors_parrot,
1524 "",
1525 95000,
1526 115000,
1527 true,
1528 },
1529 {
1530 TemperatureType::GPU,
1531 { "gpuss-0" },
1532 "GPU0",
1533 95000,
1534 115000,
1535 true,
1536 },
1537 {
1538 TemperatureType::GPU,
1539 { "gpuss-1" },
1540 "GPU1",
1541 95000,
1542 115000,
1543 true,
1544 },
1545 {
1546 TemperatureType::NPU,
1547 { "nspss-0" },
1548 "nsp0",
1549 95000,
1550 115000,
1551 true,
1552 },
1553 {
1554 TemperatureType::NPU,
1555 { "nspss-1" },
1556 "nsp1",
1557 95000,
1558 115000,
1559 true,
1560 },
1561 };
1562
1563 std::vector<struct target_therm_cfg> parrot_specific = {
1564 {
1565 TemperatureType::BCL_CURRENT,
1566 { "pm7250b-ibat-lvl0" },
1567 "ibat",
1568 6000,
1569 7500,
1570 true,
1571 },
1572 {
1573 TemperatureType::SKIN,
1574 { "xo-therm" },
1575 "skin",
1576 55000,
1577 95000,
1578 true,
1579 },
1580 };
1581
Priyansh Jaincd32b812023-10-31 16:04:32 +05301582 std::vector<std::string> cpu_sensors_lemansAU =
1583 {
1584 "cpu-0-0-0",
1585 "cpu-0-1-0",
1586 "cpu-0-2-0",
1587 "cpu-0-3-0",
1588 "cpu-1-0-0",
1589 "cpu-1-1-0",
1590 "cpu-1-2-0",
1591 "cpu-1-3-0",
1592 };
1593
1594 std::vector<struct target_therm_cfg> lemansAU_common = {
1595 {
1596 TemperatureType::CPU,
1597 cpu_sensors_lemansAU,
1598 "",
1599 105000,
1600 118000,
1601 true,
1602 },
1603 {
1604 TemperatureType::GPU,
1605 { "gpuss-0" },
1606 "GPU0",
1607 105000,
1608 118000,
1609 true,
1610 },
1611 {
1612 TemperatureType::GPU,
1613 { "gpuss-1" },
1614 "GPU1",
1615 105000,
1616 118000,
1617 true,
1618 },
1619 {
1620 TemperatureType::GPU,
1621 { "gpuss-2" },
1622 "GPU2",
1623 105000,
1624 118000,
1625 true,
1626 },
1627 {
1628 TemperatureType::NPU,
1629 { "nsp-0-0-0" },
1630 "nsp0",
1631 105000,
1632 118000,
1633 true,
1634 },
1635 {
1636 TemperatureType::NPU,
1637 { "nsp-1-0-0" },
1638 "nsp1",
1639 105000,
1640 118000,
1641 true,
1642 },
1643 };
1644
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07001645 struct target_therm_cfg bat_conf = {
1646 TemperatureType::BATTERY,
1647 { "battery" },
1648 "battery",
1649 80000,
1650 90000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07001651 true,
1652 };
1653
1654 std::vector<struct target_therm_cfg> bcl_conf = {
1655 {
1656 TemperatureType::BCL_VOLTAGE,
1657 { "vbat" },
1658 "vbat",
1659 3200,
1660 3000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07001661 false,
1662 },
1663 {
1664 TemperatureType::BCL_PERCENTAGE,
1665 { "socd" },
1666 "socd",
1667 90,
1668 99,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07001669 true,
1670 },
1671 };
1672
Rashid Zafare9219f72022-11-01 15:48:37 -07001673 std::vector<std::string> cpu_sensors_pineapple = {
1674 "cpu-0-0-0",
1675 "cpu-0-1-0",
1676 "cpu-2-0-0",
1677 "cpu-2-1-0",
1678 "cpu-2-2-0",
1679 "cpu-1-0-0",
1680 "cpu-1-1-0",
1681 "cpu-1-2-0",
1682 };
1683
1684 std::vector<struct target_therm_cfg> pineapple_common = {
1685 {
1686 TemperatureType::CPU,
1687 cpu_sensors_pineapple,
1688 "",
1689 95000,
1690 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001691 true,
1692 },
1693 {
1694 TemperatureType::GPU,
1695 { "gpuss-0" },
1696 "GPU0",
1697 95000,
1698 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001699 true,
1700 },
1701 {
1702 TemperatureType::GPU,
1703 { "gpuss-1" },
1704 "GPU1",
1705 95000,
1706 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001707 true,
1708 },
1709 {
1710 TemperatureType::GPU,
1711 { "gpuss-2" },
1712 "GPU2",
1713 95000,
1714 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001715 true,
1716 },
1717 {
1718 TemperatureType::GPU,
1719 { "gpuss-3" },
1720 "GPU3",
1721 95000,
1722 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001723 true,
1724 },
1725 {
1726 TemperatureType::GPU,
1727 { "gpuss-4" },
1728 "GPU4",
1729 95000,
1730 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001731 true,
1732 },
1733 {
1734 TemperatureType::GPU,
1735 { "gpuss-5" },
1736 "GPU5",
1737 95000,
1738 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001739 true,
1740 },
1741 {
1742 TemperatureType::GPU,
1743 { "gpuss-6" },
1744 "GPU6",
1745 95000,
1746 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001747 true,
1748 },
1749 {
1750 TemperatureType::GPU,
1751 { "gpuss-7" },
1752 "GPU7",
1753 95000,
1754 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001755 true,
1756 },
1757 {
1758 TemperatureType::NPU,
1759 { "nsphvx-0" },
1760 "nsp0",
1761 100000,
1762 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001763 true,
1764 },
1765 {
1766 TemperatureType::NPU,
1767 { "nsphvx-1" },
1768 "nsp1",
1769 100000,
1770 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001771 true,
1772 },
1773 {
1774 TemperatureType::NPU,
1775 { "nsphmx-0" },
1776 "nsp2",
1777 100000,
1778 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001779 true,
1780 },
1781 {
1782 TemperatureType::NPU,
1783 { "nsphmx-1" },
1784 "nsp3",
1785 100000,
1786 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001787 true,
1788 },
1789 {
1790 TemperatureType::NPU,
1791 { "nsphmx-2" },
1792 "nsp4",
1793 100000,
1794 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001795 true,
1796 },
1797 {
1798 TemperatureType::NPU,
1799 { "nsphmx-3" },
1800 "nsp5",
1801 100000,
1802 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001803 true,
1804 },
1805 };
1806
1807 std::vector<struct target_therm_cfg> pineapple_specific = {
1808 {
1809 TemperatureType::BCL_CURRENT,
1810 { "pm8550b-ibat-lvl0" },
1811 "ibat",
1812 9000,
1813 10000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001814 true,
1815 },
1816 {
1817 TemperatureType::SKIN,
1818 { "skin-msm-therm" },
1819 "skin",
1820 46500,
1821 95000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001822 true,
1823 },
1824 };
1825
Priyansh Jaindaa7d592023-09-25 15:55:19 +05301826std::vector<std::string> cpu_sensors_cliffs = {
1827 "cpu-0-0-0",
1828 "cpu-0-1-0",
1829 "cpu-0-2-0",
1830 "cpu-1-0-0",
1831 "cpu-1-1-0",
1832 "cpu-1-2-0",
1833 "cpu-1-3-0",
1834 "cpu-2-0-0",
1835 };
1836
1837 std::vector<struct target_therm_cfg> cliffs_common = {
1838 {
1839 TemperatureType::CPU,
1840 cpu_sensors_cliffs,
1841 "",
1842 95000,
1843 115000,
1844 true,
1845 },
1846 {
1847 TemperatureType::GPU,
1848 { "gpuss-0" },
1849 "GPU0",
1850 95000,
1851 115000,
1852 true,
1853 },
1854 {
1855 TemperatureType::GPU,
1856 { "gpuss-1" },
1857 "GPU1",
1858 95000,
1859 115000,
1860 true,
1861 },
1862 {
1863 TemperatureType::GPU,
1864 { "gpuss-2" },
1865 "GPU2",
1866 95000,
1867 115000,
1868 true,
1869 },
1870 {
1871 TemperatureType::GPU,
1872 { "gpuss-3" },
1873 "GPU3",
1874 95000,
1875 115000,
1876 true,
1877 },
1878 {
1879 TemperatureType::NPU,
1880 { "nsphvx-0" },
1881 "nsp0",
1882 100000,
1883 115000,
1884 true,
1885 },
1886 {
1887 TemperatureType::NPU,
1888 { "nsphvx-1" },
1889 "nsp1",
1890 100000,
1891 115000,
1892 true,
1893 },
1894 {
1895 TemperatureType::NPU,
1896 { "nsphmx-0" },
1897 "nsp2",
1898 100000,
1899 115000,
1900 true,
1901 },
1902 {
1903 TemperatureType::NPU,
1904 { "nsphmx-1" },
1905 "nsp3",
1906 100000,
1907 115000,
1908 true,
1909 },
1910 };
1911
1912 std::vector<struct target_therm_cfg> cliffs_specific = {
1913 {
1914 TemperatureType::SKIN,
1915 { "sys-therm-4" },
1916 "skin",
1917 60000,
1918 95000,
1919 true,
1920 },
1921 };
Nitesh Kumar30b30522023-11-21 13:23:59 +05301922
1923 std::vector<std::string> cpu_sensors_monaco = {
1924 "cpuss-0",
1925 "cpuss-0",
1926 "cpuss-0",
1927 "cpuss-0",
1928 "cpuss-1",
1929 "cpuss-1",
1930 "cpuss-1",
1931 "cpuss-1",
1932 };
1933
1934 std::vector<struct target_therm_cfg> sensor_cfg_monaco = {
1935 {
1936 TemperatureType::CPU,
1937 cpu_sensors_monaco,
1938 "",
Manaf Meethalavalappu Pallikunhi93888512025-02-13 21:40:06 +05301939 85000,
Nitesh Kumar30b30522023-11-21 13:23:59 +05301940 115000,
1941 true,
1942 },
1943 {
1944 TemperatureType::GPU,
1945 { "gpu" },
1946 "gpu",
Manaf Meethalavalappu Pallikunhi93888512025-02-13 21:40:06 +05301947 85000,
Nitesh Kumar30b30522023-11-21 13:23:59 +05301948 115000,
1949 true,
1950 },
1951 {
1952 TemperatureType::SKIN,
1953 { "pa-therm0" },
1954 "skin",
1955 40000,
1956 95000,
1957 true,
1958 },
1959 {
1960 TemperatureType::BCL_CURRENT,
1961 { "pm5100-ibat-lvl0" },
1962 "ibat",
1963 1100,
1964 1500,
1965 true,
1966 },
1967 };
1968
Nitesh Kumard667c792024-01-03 17:17:58 +05301969 std::vector<std::string> cpu_sensors_pitti =
1970 {
1971 "cpu-0-0",
1972 "cpu-0-1",
1973 "cpu-0-2",
1974 "cpu-0-3",
1975 "cpu-0-4",
1976 "cpu-0-5",
1977 "cpu-1-0",
1978 "cpu-2-0",
1979 };
1980
1981 std::vector<struct target_therm_cfg> sensor_cfg_pitti =
1982 {
1983 {
1984 TemperatureType::CPU,
1985 cpu_sensors_pitti,
1986 "",
1987 95000,
1988 115000,
1989 true,
1990 },
1991 {
1992 TemperatureType::GPU,
1993 { "gpuss" },
1994 "gpu",
1995 95000,
1996 115000,
1997 true,
1998 },
1999 };
2000
2001 std::vector<struct target_therm_cfg> pitti_specific = {
2002 {
Nitesh Kumard667c792024-01-03 17:17:58 +05302003 TemperatureType::SKIN,
2004 { "sys-therm-3" },
2005 "skin",
2006 40000,
2007 95000,
2008 true,
2009 },
2010 };
2011
Nitesh Kumara953a152024-03-07 16:35:01 +05302012 std::vector<std::string> cpu_sensors_niobe = {
Priyansh Jainafe95152024-01-24 08:27:39 +05302013 "cpu-0-0-0",
2014 "cpu-0-1-0",
2015 "cpu-1-0-0",
2016 "cpu-1-1-0",
2017 "cpu-1-2-0",
2018 "cpu-1-2-1",
2019 "cpu-1-3-0",
2020 "cpu-1-3-1",
2021 };
2022
2023 std::vector<struct target_therm_cfg> niobe_common = {
2024 {
2025 TemperatureType::CPU,
2026 cpu_sensors_niobe,
2027 "",
2028 95000,
2029 115000,
2030 true,
2031 },
2032 {
2033 TemperatureType::GPU,
2034 { "gpuss-0" },
2035 "GPU0",
2036 95000,
2037 115000,
2038 true,
2039 },
2040 {
2041 TemperatureType::GPU,
2042 { "gpuss-1" },
2043 "GPU1",
2044 95000,
2045 115000,
2046 true,
2047 },
2048 {
2049 TemperatureType::GPU,
2050 { "gpuss-2" },
2051 "GPU2",
2052 95000,
2053 115000,
2054 true,
2055 },
2056 {
2057 TemperatureType::GPU,
2058 { "gpuss-3" },
2059 "GPU3",
2060 95000,
2061 115000,
2062 true,
2063 },
2064 {
2065 TemperatureType::GPU,
2066 { "gpuss-4" },
2067 "GPU4",
2068 95000,
2069 115000,
2070 true,
2071 },
2072 {
2073 TemperatureType::GPU,
2074 { "gpuss-5" },
2075 "GPU5",
2076 95000,
2077 115000,
2078 true,
2079 },
2080 {
2081 TemperatureType::GPU,
2082 { "gpuss-6" },
2083 "GPU6",
2084 95000,
2085 115000,
2086 true,
2087 },
2088 {
2089 TemperatureType::GPU,
2090 { "gpuss-7" },
2091 "GPU7",
2092 95000,
2093 115000,
2094 true,
2095 },
2096 {
2097 TemperatureType::NPU,
2098 { "nsphvx-0" },
2099 "nsp0",
2100 95000,
2101 115000,
2102 true,
2103 },
2104 {
2105 TemperatureType::NPU,
2106 { "nsphvx-1" },
2107 "nsp1",
2108 95000,
2109 115000,
2110 true,
2111 },
2112 {
2113 TemperatureType::NPU,
2114 { "nsphmx-0" },
2115 "nsp2",
2116 95000,
2117 115000,
2118 true,
2119 },
2120 {
2121 TemperatureType::NPU,
2122 { "nsphmx-1" },
2123 "nsp3",
2124 95000,
2125 115000,
2126 true,
2127 },
2128 };
2129
2130 std::vector<struct target_therm_cfg> niobe_specific = {
2131 {
2132 TemperatureType::BCL_CURRENT,
2133 { "pm8550b-ibat-lvl0" },
2134 "ibat",
2135 7000,
2136 7500,
2137 true,
2138 },
2139 {
2140 TemperatureType::SKIN,
2141 { "sys-therm-0" },
2142 "skin",
2143 60000,
2144 95000,
2145 true,
2146 },
2147 };
2148
Priyansh Jain4c6cfdb2025-03-19 11:39:18 +05302149 std::vector<std::string> cpu_sensors_seraph = {
2150 "cpu-0-0",
2151 "cpu-0-1",
2152 "cpu-1-0",
2153 "cpu-1-1",
2154 "cpu-0-0",
2155 "cpu-0-1",
2156 "cpu-1-0",
2157 "cpu-1-1",
2158 };
2159
2160 std::vector<struct target_therm_cfg> seraph_common = {
2161 {
2162 TemperatureType::CPU,
2163 cpu_sensors_seraph,
2164 "",
2165 95000,
2166 115000,
2167 true,
2168 },
2169 {
2170 TemperatureType::GPU,
2171 { "gpu-0" },
2172 "GPU0",
2173 95000,
2174 115000,
2175 true,
2176 },
2177 {
2178 TemperatureType::GPU,
2179 { "gpu-1" },
2180 "GPU1",
2181 95000,
2182 115000,
2183 true,
2184 },
2185 {
2186 TemperatureType::NPU,
2187 { "nspvxu-0" },
2188 "nsp0",
2189 95000,
2190 115000,
2191 true,
2192 },
2193 {
2194 TemperatureType::NPU,
2195 { "nspvxu-1" },
2196 "nsp1",
2197 95000,
2198 115000,
2199 true,
2200 },
2201 {
2202 TemperatureType::NPU,
2203 { "nspmxu" },
2204 "nsp2",
2205 95000,
2206 115000,
2207 true,
2208 },
2209 };
2210
2211 std::vector<struct target_therm_cfg> seraph_specific = {
2212 {
2213 TemperatureType::SKIN,
Priyansh Jainbb1e7dd2025-05-10 11:09:33 +05302214 { "sys-therm-1" },
Priyansh Jain4c6cfdb2025-03-19 11:39:18 +05302215 "skin",
2216 60000,
2217 95000,
2218 true,
2219 },
2220 };
2221
Nitesh Kumara953a152024-03-07 16:35:01 +05302222 std::vector<std::string> cpu_sensors_volcano = {
2223 "cpu-0-0-0",
2224 "cpu-0-1-0",
2225 "cpu-0-2-0",
2226 "cpu-1-0-0",
2227 "cpu-1-1-0",
2228 "cpu-1-2-0",
2229 "cpu-1-3-0",
2230 "cpu-1-3-1",
2231 };
2232
2233 std::vector<struct target_therm_cfg> volcano_common = {
2234 {
2235 TemperatureType::CPU,
2236 cpu_sensors_volcano,
2237 "",
2238 95000,
2239 115000,
2240 true,
2241 },
2242 {
2243 TemperatureType::GPU,
2244 { "gpuss-0" },
2245 "GPU0",
2246 95000,
2247 115000,
2248 true,
2249 },
2250 {
2251 TemperatureType::GPU,
2252 { "gpuss-1" },
2253 "GPU1",
2254 95000,
2255 115000,
2256 true,
2257 },
2258 {
2259 TemperatureType::NPU,
2260 { "nsphvx-0" },
2261 "nsp0",
2262 95000,
2263 115000,
2264 true,
2265 },
2266 {
2267 TemperatureType::NPU,
Nitesh Kumara953a152024-03-07 16:35:01 +05302268 { "nsphmx-0" },
2269 "nsp2",
2270 95000,
2271 115000,
2272 true,
2273 },
2274 {
2275 TemperatureType::NPU,
2276 { "nsphmx-1" },
2277 "nsp3",
2278 95000,
2279 115000,
2280 true,
2281 },
2282 };
2283
Manaf Meethalavalappu Pallikunhi4d2b7142024-08-22 01:18:41 +05302284 std::vector<struct target_therm_cfg> volcano_profile1 = {
2285 {
2286 TemperatureType::CPU,
2287 cpu_sensors_volcano,
2288 "",
2289 105000,
2290 118000,
2291 true,
2292 },
2293 {
2294 TemperatureType::GPU,
2295 { "gpuss-0" },
2296 "GPU0",
2297 105000,
2298 118000,
2299 true,
2300 },
2301 {
2302 TemperatureType::GPU,
2303 { "gpuss-1" },
2304 "GPU1",
2305 105000,
2306 118000,
2307 true,
2308 },
2309 {
2310 TemperatureType::NPU,
2311 { "nsphvx-0" },
2312 "nsp0",
2313 105000,
2314 118000,
2315 true,
2316 },
2317 {
2318 TemperatureType::NPU,
2319 { "nsphmx-0" },
2320 "nsp2",
2321 105000,
2322 118000,
2323 true,
2324 },
2325 {
2326 TemperatureType::NPU,
2327 { "nsphmx-1" },
2328 "nsp3",
2329 105000,
2330 118000,
2331 true,
2332 },
2333 };
2334
Nitesh Kumara953a152024-03-07 16:35:01 +05302335 std::vector<struct target_therm_cfg> volcano_specific = {
2336 {
2337 TemperatureType::SKIN,
2338 { "sys-therm-0" },
2339 "skin",
2340 60000,
2341 95000,
2342 true,
2343 },
2344 };
2345
Nitesh Kumar662a53b2024-05-09 22:36:40 +05302346 std::vector<std::string> cpu_sensors_anorak =
2347 {
2348 "cpu-0-0-0",
2349 "cpu-0-0-1",
2350 "cpu-0-1-0",
2351 "cpu-0-1-1",
2352 "cpu-1-0-0",
2353 "cpu-1-0-1",
2354 "cpu-1-1-0",
2355 "cpu-1-1-1",
2356 "cpu-1-2-0",
2357 "cpu-1-2-1",
2358 "cpu-1-3-0",
2359 "cpu-1-3-1",
2360 };
2361
2362 std::vector<struct target_therm_cfg> anorak_common = {
2363 {
2364 TemperatureType::CPU,
2365 cpu_sensors_anorak,
2366 "",
2367 95000,
2368 115000,
2369 true,
2370 },
2371 {
2372 TemperatureType::NPU,
2373 { "nspss-0" },
2374 "nsp0",
2375 95000,
2376 115000,
2377 true,
2378 },
2379 {
2380 TemperatureType::NPU,
2381 { "nspss-1" },
2382 "nsp1",
2383 95000,
2384 115000,
2385 true,
2386 },
2387 {
2388 TemperatureType::NPU,
2389 { "nspss-2" },
2390 "nsp2",
2391 95000,
2392 115000,
2393 true,
2394 },
2395 {
2396 TemperatureType::GPU,
2397 { "gpuss-0" },
2398 "GPU0",
2399 95000,
2400 115000,
2401 true,
2402 },
2403 {
2404 TemperatureType::GPU,
2405 { "gpuss-1" },
2406 "GPU1",
2407 95000,
2408 115000,
2409 true,
2410 },
2411 {
2412 TemperatureType::GPU,
2413 { "gpuss-2" },
2414 "GPU2",
2415 95000,
2416 115000,
2417 true,
2418 },
2419 {
2420 TemperatureType::GPU,
2421 { "gpuss-3" },
2422 "GPU3",
2423 95000,
2424 115000,
2425 true,
2426 },
2427 {
2428 TemperatureType::GPU,
2429 { "gpuss-4" },
2430 "GPU4",
2431 95000,
2432 115000,
2433 true,
2434 },
2435 {
2436 TemperatureType::GPU,
2437 { "gpuss-5" },
2438 "GPU5",
2439 95000,
2440 115000,
2441 true,
2442 },
2443 {
2444 TemperatureType::GPU,
2445 { "gpuss-6" },
2446 "GPU6",
2447 95000,
2448 115000,
2449 true,
2450 },
2451 {
2452 TemperatureType::GPU,
2453 { "gpuss-7" },
2454 "GPU7",
2455 95000,
2456 115000,
2457 true,
2458 },
2459 };
2460
2461 std::vector<struct target_therm_cfg> anorak_specific = {
2462 {
2463 TemperatureType::BCL_CURRENT,
2464 { "pm8550b-ibat-lvl0" },
2465 "ibat",
2466 9000,
2467 10000,
2468 true,
2469 },
2470 {
2471 TemperatureType::SKIN,
2472 { "sys-therm-0" },
2473 "skin",
2474 55000,
2475 95000,
2476 true,
2477 },
2478 };
2479
Priyansh Jainf06e0842022-10-10 10:34:27 +05302480 std::vector<std::string> cpu_sensors_ravelin =
2481 {
2482 "cpu-0-0",
2483 "cpu-0-1",
2484 "cpu-0-2",
2485 "cpu-0-3",
2486 "cpu-0-4",
2487 "cpu-0-5",
2488 "cpu-1-0",
2489 "cpu-1-2",
2490 };
2491
2492 std::vector<struct target_therm_cfg> ravelin_common = {
2493 {
2494 TemperatureType::CPU,
Minghao Zhangc6d2b272023-02-02 15:34:25 +08002495 cpu_sensors_ravelin,
Priyansh Jainf06e0842022-10-10 10:34:27 +05302496 "",
2497 95000,
2498 115000,
2499 true,
2500 },
2501 {
2502 TemperatureType::GPU,
2503 { "gpuss" },
2504 "GPU",
2505 95000,
2506 115000,
2507 true,
2508 },
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002509 {
2510 TemperatureType::SKIN,
2511 { "sys-therm-1" },
2512 "skin",
2513 55000,
2514 95000,
2515 true,
2516 },
Priyansh Jainf06e0842022-10-10 10:34:27 +05302517 };
2518
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002519 std::vector<struct target_therm_cfg> ravelin_specific_qrd = {
Priyansh Jainf06e0842022-10-10 10:34:27 +05302520 {
2521 TemperatureType::BCL_CURRENT,
Minghao Zhangc6d2b272023-02-02 15:34:25 +08002522 { "pmi632-ibat-lvl0" },
Priyansh Jainf06e0842022-10-10 10:34:27 +05302523 "ibat",
2524 6000,
2525 7500,
2526 true,
2527 },
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002528 };
2529
2530 std::vector<struct target_therm_cfg> ravelin_specific_idp = {
Priyansh Jainf06e0842022-10-10 10:34:27 +05302531 {
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002532 TemperatureType::BCL_CURRENT,
2533 { "pm7250b-ibat-lvl0" },
2534 "ibat",
2535 6000,
2536 7500,
Priyansh Jainf06e0842022-10-10 10:34:27 +05302537 true,
2538 },
2539 };
2540
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002541 const std::unordered_map<int, std::vector<struct target_therm_cfg>>
2542 msm_soc_map = {
Minghao Zhangf9d50a02021-04-12 18:29:50 +08002543 {353, sensor_cfg_439},
2544 {354, sensor_cfg_439},
2545 {363, sensor_cfg_439},
2546 {364, sensor_cfg_439},
2547 {416, sensor_cfg_439},
2548 {437, sensor_cfg_439},
Ankit Siddhapura786d6182023-08-02 10:18:49 +05302549 {349, sensor_cfg_sdm632},
Dakkshesh4b1f3262023-09-17 20:38:55 +05302550 {336, sensor_cfg_sdm710}, // SDM670
2551 {360, sensor_cfg_sdm710}, // SDM710
2552 {393, sensor_cfg_sdm710}, // SDM712
Gopala Krishna Nuthakibcc1d012021-05-04 12:06:53 +05302553 {321, sensor_cfg_sdm845},
2554 {341, sensor_cfg_sdm845},
gnuthakidd79a2b2023-11-15 12:03:02 +05302555 {355, sensor_cfg_talos_common},
2556 {377, sensor_cfg_sa6155_common}, // auto
2557 {380, sensor_cfg_sa6155_common}, // auto
2558 {384, sensor_cfg_sa6155_common}, // auto
Minghao Zhang2658fa62020-12-28 10:16:45 +08002559 {417, sensor_cfg_bengal}, // bengal
2560 {420, sensor_cfg_bengal},
2561 {444, sensor_cfg_bengal},
2562 {445, sensor_cfg_bengal},
2563 {469, sensor_cfg_bengal},
2564 {470, sensor_cfg_bengal},
Priyansh Jain3388cdf2022-08-17 14:05:26 +05302565 {518, sensor_cfg_khaje}, //khaje
Manaf Meethalavalappu Pallikunhi003ee4a2022-12-02 15:58:00 +05302566 {561, sensor_cfg_khaje}, //khajeP
2567 {562, sensor_cfg_khaje}, //khajeQ
2568 {584, sensor_cfg_khaje}, //khajeXR
2569 {585, sensor_cfg_khaje}, //khajeG
2570 {586, sensor_cfg_khaje}, //khajeIOT
Minghao Zhangae04ce32020-09-23 23:28:34 +08002571 {394, sensor_cfg_trinket},
2572 {467, sensor_cfg_trinket},
2573 {468, sensor_cfg_trinket},
Edwin Moquete9b72a562022-04-16 20:04:36 +00002574 {317, sensor_cfg_sdm660},
Yumi Yukimura5e8ba832023-10-18 19:00:53 +08002575 {318, sensor_cfg_sdm660}, // sdm630
Edwin Moquete9b72a562022-04-16 20:04:36 +00002576 {345, sensor_cfg_sdm660}, // sdm636
Yumi Yukimura5e8ba832023-10-18 19:00:53 +08002577 {385, sensor_cfg_sdm660}, // sdm455
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002578 {400, sensor_cfg_lito}, // lito
2579 {440, sensor_cfg_lito},
2580 {407, sensor_cfg_lito}, // atoll
Minghao Zhangae04ce32020-09-23 23:28:34 +08002581 {365, sensor_cfg_sdmmagpie},
2582 {366, sensor_cfg_sdmmagpie},
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002583 {434, sensor_cfg_lito}, // lagoon
Minghao Zhang15c2bdc2021-01-14 14:51:25 +08002584 {435, sensor_cfg_lito},
2585 {459, sensor_cfg_lito},
Gopala Krishna Nuthakib99fef32020-09-09 14:26:32 +05302586 {476, sensor_cfg_lito}, // orchid
gnuthakidd79a2b2023-11-15 12:03:02 +05302587 {339, sensor_cfg_msmnile_common},
2588 {361, sensor_cfg_msmnile_common},
2589 {362, sensor_cfg_sa8155_common}, //auto
2590 {367, sensor_cfg_sa8155_common}, //auto
2591 {405, sensor_cfg_sa8195_common}, //auto
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002592 {356, kona_common}, // kona
Nitesh Kumara6747222023-06-20 13:11:31 +05302593 {481, kona_common}, //kona iot
2594 {548, kona_common}, //kona iot
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +05302595 {415, lahaina_common}, // lahaina
2596 {439, lahaina_common}, // lahainap
2597 {456, lahaina_common}, // lahaina-atp
Minghao Zhang31932a02021-03-08 10:58:11 +08002598 {501, lahaina_common},
2599 {502, lahaina_common},
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +05302600 {450, lahaina_common}, // shima
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +05302601 {454, sensor_cfg_holi}, // holi
Nitesh Kumar83759f12023-06-30 19:15:54 +05302602 {507, sensor_cfg_holi}, //blair
Nitesh Kumarf69dba32023-11-10 16:16:17 +05302603 {578, sensor_cfg_holi}, //conic
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +05302604 {475, sensor_cfg_yupik}, // yupik
Gopala Krishna Nuthaki15c1be22021-03-16 19:43:17 +05302605 {515, sensor_cfg_yupik}, // YUPIK-LTE
Gopala Krishna Nuthaki5b3a53d2023-03-24 09:40:54 +05302606 {576, sensor_cfg_yupik}, // yupik qcm5430 modem
2607 {575, sensor_cfg_yupik}, // yupik qcm5430
2608 {567, sensor_cfg_yupik}, // yupik
2609 {563, sensor_cfg_yupik}, // yupik
2610 {553, sensor_cfg_yupik}, // yupik
2611 {546, sensor_cfg_yupik}, // yupik
2612 {499, sensor_cfg_yupik}, // yupik
2613 {498, sensor_cfg_yupik}, // yupik-iot
2614 {497, sensor_cfg_yupik}, // yupik-iot mdm
2615 {488, sensor_cfg_yupik}, // yupik
2616 {487, sensor_cfg_yupik}, // yupik
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07002617 {457, waipio_common}, //Waipio
2618 {482, waipio_common}, //Waipio
Gopala Krishna Nuthaki7ef40922022-01-11 18:41:45 +05302619 {552, waipio_common}, //Waipio-LTE
Priyansh Jaind670d792022-07-20 15:51:13 +05302620 {506, diwali_common}, //diwali
2621 {547, diwali_common}, //diwali
2622 {564, diwali_common}, //diwali-LTE
Priyansh Jain6af76952021-11-10 10:48:06 +05302623 {530, waipio_common}, // cape
2624 {531, waipio_common}, // cape
2625 {540, waipio_common}, // cape
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05302626 {519, kalama_common}, //Kalama
2627 {536, kalama_common}, //Kalamap
congying1d469b22022-09-05 18:17:39 +08002628 {600, kalama_common}, //Kalama_sg
2629 {601, kalama_common}, //Kalamap_sg
Bhasker Reddy Komatireddy4f9957a2023-01-10 14:52:42 +05302630 {603, kalama_common}, //Kalama_qcs
2631 {604, kalama_common}, //Kalama_qcm
Rashid Zafarc2584072023-01-11 12:15:32 -08002632 {557, pineapple_common}, //Pineapple
2633 {577, pineapple_common}, //Pineapplep
Nitesh Kumar3ed33422024-10-04 06:38:05 +05302634 {682, pineapple_common}, //Pineapple gaming
Nitesh Kumar83282902024-11-11 11:12:55 +05302635 {696, pineapple_common}, //Pineapple compute
Bhasker Reddy Komatireddye8b681f2024-02-07 11:20:15 +05302636 {645, pineapple_common}, //Pineapple
2637 {646, pineapple_common}, //Pineapple
2638 {702, pineapple_common}, //Pineapple
Priyansh Jaindaa7d592023-09-25 15:55:19 +05302639 {632, cliffs_common}, //cliffs
2640 {614, cliffs_common}, //cliffs7
Nitesh Kumar30b30522023-11-21 13:23:59 +05302641 {486, sensor_cfg_monaco}, // monaco
2642 {517, sensor_cfg_monaco}, // monaco
Nitesh Kumard667c792024-01-03 17:17:58 +05302643 {623, sensor_cfg_pitti}, // Kalpeni
Priyansh Jainafe95152024-01-24 08:27:39 +05302644 {629, niobe_common}, //Matrix
Priyansh Jainb38d8f32024-04-05 11:01:31 +05302645 {652, niobe_common}, // Matrix_4k
Nitesh Kumara953a152024-03-07 16:35:01 +05302646 {636, volcano_common}, //milos
2647 {640, volcano_common}, //milos6
Manaf Meethalavalappu Pallikunhi4d2b7142024-08-22 01:18:41 +05302648 {657, volcano_specific}, //milos IOT with modem
2649 {658, volcano_specific}, //milos IOT
Nitesh Kumar662a53b2024-05-09 22:36:40 +05302650 {549, anorak_common},
2651 {649, anorak_common}, // Halliday Pro
Priyansh Jain4c6cfdb2025-03-19 11:39:18 +05302652 {672, seraph_common}, //Balsam-SAR1250P
2653 {673, seraph_common}, //Balsam-SAR2230P
Priyansh Jain39782192022-03-09 10:10:43 +05302654 {525, neo_common},
2655 {554, neo_common},
Nitesh Kumar47e465c2023-01-11 06:14:16 +05302656 {537, parrot_common}, //Netrani mobile
2657 {583, parrot_common}, //Netrani mobile without modem
2658 {613, parrot_common}, //Netrani APQ
Priyansh Jain39391ad2023-07-31 09:56:19 +05302659 {631, parrot_common},
Priyansh Jainf06e0842022-10-10 10:34:27 +05302660 {568, ravelin_common}, //Clarence Mobile
2661 {581, ravelin_common}, //Clarence IOT
2662 {582, ravelin_common}, //Clarence IOT without modem
Minghao Zhang7423ed82023-01-16 15:29:30 +08002663 {591, waipio_common}, //ukee
Priyansh Jaina72f3822023-05-30 14:44:09 +05302664 {608, crow_common}, //crow
Nitesh Kumar52f0bdc2024-01-04 12:59:34 +05302665 {644, crow_common}, //crow 4G
Priyansh Jaincd32b812023-10-31 16:04:32 +05302666 {532, lemansAU_common}, //Lemans auto
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002667 };
2668
2669 const std::unordered_map<int, std::vector<struct target_therm_cfg>>
2670 msm_soc_specific = {
2671 {356, kona_specific}, // kona
Nitesh Kumara6747222023-06-20 13:11:31 +05302672 {481, kona_specific}, //kona iot
2673 {548, kona_specific}, //kona iot
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002674 {415, lahaina_specific}, // lahaina
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +05302675 {439, lahaina_specific}, // lahainap
2676 {456, lahaina_specific}, // lahaina-atp
Minghao Zhang31932a02021-03-08 10:58:11 +08002677 {501, lahaina_specific},
2678 {502, lahaina_specific},
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +05302679 {450, shima_specific}, // shima
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07002680 {457, waipio_specific}, //Waipio
2681 {482, waipio_specific}, //Waipio
Gopala Krishna Nuthaki7ef40922022-01-11 18:41:45 +05302682 {552, waipio_specific}, //Waipio-LTE
Priyansh Jaina26aeb42021-09-20 17:29:05 +05302683 {506, diwali_specific}, //diwali
Gopala Krishna Nuthakie7461532022-03-23 02:41:02 +05302684 {547, diwali_specific}, //diwali
2685 {564, diwali_specific}, //diwali-LTE
Priyansh Jain6af76952021-11-10 10:48:06 +05302686 {530, waipio_specific}, // cape
2687 {531, waipio_specific}, // cape
2688 {540, waipio_specific}, // cape
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05302689 {519, kalama_specific}, //Kalama
2690 {536, kalama_specific}, //Kalamap
congying1d469b22022-09-05 18:17:39 +08002691 {600, kalama_specific}, //Kalama_sg
2692 {601, kalama_specific}, //Kalamap_sg
Bhasker Reddy Komatireddy4f9957a2023-01-10 14:52:42 +05302693 {603, kalama_specific}, //Kalama_qcs
2694 {604, kalama_specific}, //Kalama_qcm
Rashid Zafare9219f72022-11-01 15:48:37 -07002695 {557, pineapple_specific}, //Pineapple
2696 {577, pineapple_specific}, //Pineapplep
Nitesh Kumar3ed33422024-10-04 06:38:05 +05302697 {682, pineapple_specific}, //Pineapple gaming
Nitesh Kumar83282902024-11-11 11:12:55 +05302698 {696, pineapple_specific}, //Pineapple compute
Bhasker Reddy Komatireddye8b681f2024-02-07 11:20:15 +05302699 {645, pineapple_specific}, //Pineapple
2700 {646, pineapple_specific}, //Pineapple
2701 {702, pineapple_specific}, //Pineapple
Priyansh Jaindaa7d592023-09-25 15:55:19 +05302702 {632, cliffs_specific}, //cliffs
2703 {614, cliffs_specific}, //cliffs7
Nitesh Kumard667c792024-01-03 17:17:58 +05302704 {623, pitti_specific}, // Kalpeni
Priyansh Jainafe95152024-01-24 08:27:39 +05302705 {629, niobe_specific}, // Matrix
Priyansh Jainb38d8f32024-04-05 11:01:31 +05302706 {652, niobe_specific}, // Matrix_4k
Nitesh Kumara953a152024-03-07 16:35:01 +05302707 {636, volcano_specific}, //milos
2708 {640, volcano_specific}, //milos6
Nitesh Kumar662a53b2024-05-09 22:36:40 +05302709 {549, anorak_specific},
2710 {649, anorak_specific}, // Halliday Pro
Priyansh Jain4c6cfdb2025-03-19 11:39:18 +05302711 {672, seraph_specific}, //Balsam-SAR1250P
2712 {673, seraph_specific}, //Balsam-SAR2230P
Nitesh Kumar47e465c2023-01-11 06:14:16 +05302713 {537, parrot_specific}, //Netrani mobile
2714 {583, parrot_specific}, //Netrani mobile without modem
2715 {613, parrot_specific}, //Netrani APQ
Priyansh Jain39391ad2023-07-31 09:56:19 +05302716 {631, parrot_specific},
Minghao Zhang7423ed82023-01-16 15:29:30 +08002717 {591, waipio_specific}, //ukee
Priyansh Jaina72f3822023-05-30 14:44:09 +05302718 {608, crow_specific}, //crow
Nitesh Kumar52f0bdc2024-01-04 12:59:34 +05302719 {644, crow_specific}, //crow
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002720 };
2721
gnuthakidd79a2b2023-11-15 12:03:02 +05302722 const std::unordered_map<int, bool>
2723 battery_bcl_cfg_disable_map = {
2724 {377, true},
2725 {380, true},
2726 {384, true},
2727 {362, true},
2728 {367, true},
2729 {405, true},
2730 };
2731
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002732 const std::unordered_multimap<int, std::pair<std::string,
2733 std::vector<struct target_therm_cfg>>>
2734 msm_platform_specific = {
2735 {568, std::make_pair("QRD", ravelin_specific_qrd)},
2736 {568, std::make_pair("IDP", ravelin_specific_idp)},
2737 };
2738
Manaf Meethalavalappu Pallikunhi4d2b7142024-08-22 01:18:41 +05302739 const std::unordered_multimap<int, std::pair<int, std::vector<struct target_therm_cfg>>>
2740 msm_limit_profile_specific = {
2741 {657, std::make_pair(0, volcano_common)},
2742 {657, std::make_pair(1, volcano_profile1)},
2743 {658, std::make_pair(0, volcano_common)},
2744 {658, std::make_pair(1, volcano_profile1)},
2745 };
2746
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002747 std::vector<struct target_therm_cfg> add_target_config(
Michael Bestasab51cf42025-01-17 01:23:36 +02002748 int socID, int lp, std::string hwPlatform,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002749 std::vector<struct target_therm_cfg> conf)
2750 {
2751 std::vector<struct target_therm_cfg> targetConf;
2752
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002753 if (msm_soc_specific.find(socID) != msm_soc_specific.end()) {
2754 targetConf = (msm_soc_specific.find(socID))->second;
2755 conf.insert(conf.end(), targetConf.begin(),
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002756 targetConf.end());
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002757 }
2758
Manaf Meethalavalappu Pallikunhi4d2b7142024-08-22 01:18:41 +05302759 auto range = msm_limit_profile_specific.equal_range(socID);
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002760 auto it = range.first;
Manaf Meethalavalappu Pallikunhi4d2b7142024-08-22 01:18:41 +05302761 if (range.first != msm_limit_profile_specific.end()) {
2762 for (; it != range.second; ++it) {
2763 if (it->second.first != lp)
2764 continue;
2765 targetConf = it->second.second;
Michael Bestasab51cf42025-01-17 01:23:36 +02002766 conf.insert(conf.end(), targetConf.begin(),
2767 targetConf.end());
Manaf Meethalavalappu Pallikunhi4d2b7142024-08-22 01:18:41 +05302768 break;
2769 }
2770 }
2771
Michael Bestasab51cf42025-01-17 01:23:36 +02002772 auto hw_range = msm_platform_specific.equal_range(socID);
2773 auto hw_it = hw_range.first;
2774 for (; hw_it != hw_range.second; ++hw_it) {
2775 if (hw_it->second.first != hwPlatform)
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002776 continue;
2777
Michael Bestasab51cf42025-01-17 01:23:36 +02002778 targetConf = hw_it->second.second;
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002779 conf.insert(conf.end(), targetConf.begin(),
2780 targetConf.end());
2781 break;
2782 }
2783
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002784 return conf;
2785 }
2786
2787 ThermalConfig::ThermalConfig():cmnInst()
2788 {
2789 std::unordered_map<int, std::vector<struct target_therm_cfg>>::const_iterator it;
gnuthakidd79a2b2023-11-15 12:03:02 +05302790 std::unordered_map<int, bool>::const_iterator it_2;
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002791 std::vector<struct target_therm_cfg>::iterator it_vec;
2792 bool bcl_defined = false;
2793 std::string soc_val;
Ram Chandrasekar9e1b3262021-07-29 15:41:00 -07002794 int ct = 0;
2795 bool read_ok = false;
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002796
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002797 soc_id = 0;
Ram Chandrasekar9e1b3262021-07-29 15:41:00 -07002798 do {
2799 if (cmnInst.readFromFile(socIDPath, soc_val) <= 0) {
2800 LOG(ERROR) <<"soc ID fetch error";
2801 return;
2802 }
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002803
2804 if (cmnInst.readFromFile(hwPlatformPath, hw_platform) <= 0) {
2805 LOG(ERROR) <<"hw Platform fetch error";
2806 continue;
2807 }
2808
Ram Chandrasekar9e1b3262021-07-29 15:41:00 -07002809 try {
2810 soc_id = std::stoi(soc_val, nullptr, 0);
2811 read_ok = true;
2812 }
2813 catch (std::exception &err) {
2814 LOG(ERROR) <<"soc id stoi err:" << err.what()
2815 << " buf:" << soc_val;
2816 }
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002817 } while (ct++ && !read_ok && ct < RETRY_CT);
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002818 if (soc_id <= 0) {
2819 LOG(ERROR) << "Invalid soc ID: " << soc_id;
2820 return;
2821 }
Manaf Meethalavalappu Pallikunhi4d2b7142024-08-22 01:18:41 +05302822
2823 auto range = msm_limit_profile_specific.equal_range(soc_id);
2824 if (range.first != msm_limit_profile_specific.end()) {
2825 limitp = cmnInst.findLimitProfile();
2826 if (limitp < 0) {
2827 LOG(DEBUG) << "Invalid limit profile, defaulting to 0.";
2828 limitp = 0;
2829 }
2830 }
2831
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002832 it = msm_soc_map.find(soc_id);
2833 if (it == msm_soc_map.end()) {
2834 LOG(ERROR) << "No config for soc ID: " << soc_id;
2835 return;
2836 }
Michael Bestasab51cf42025-01-17 01:23:36 +02002837 thermalConfig = add_target_config(soc_id, limitp, hw_platform, it->second);
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002838 for (it_vec = thermalConfig.begin();
2839 it_vec != thermalConfig.end(); it_vec++) {
2840 if (it_vec->type == TemperatureType::BCL_PERCENTAGE)
2841 bcl_defined = true;
2842 }
2843
gnuthakidd79a2b2023-11-15 12:03:02 +05302844 it_2 = battery_bcl_cfg_disable_map.find(soc_id);
2845 if (it_2 == battery_bcl_cfg_disable_map.end() || !it_2->second) {
2846 thermalConfig.push_back(bat_conf);
2847 if (!bcl_defined)
2848 thermalConfig.insert(thermalConfig.end(),
2849 bcl_conf.begin(), bcl_conf.end());
2850 }
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002851 LOG(DEBUG) << "Total sensors:" << thermalConfig.size();
2852 }
Bavyasritha Alahari0a344f42023-04-26 17:16:51 -07002853
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002854} // namespace thermal
2855} // namespace hardware
2856} // namespace android
Bavyasritha Alahari0a344f42023-04-26 17:16:51 -07002857} // namespace aidl
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002858