blob: 42c957630e20a29c9cfe291c5bdddf4d05a37925 [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
Gopala Krishna Nuthakibcc1d012021-05-04 12:06:53 +0530172 std::vector<std::string> cpu_sensors_sdm845 =
173 {
174 "cpu0-silver-usr",
175 "cpu1-silver-usr",
176 "cpu2-silver-usr",
177 "cpu3-silver-usr",
178 "cpu0-gold-usr",
179 "cpu1-gold-usr",
180 "cpu2-gold-usr",
181 "cpu3-gold-usr",
182 };
183
184 std::vector<struct target_therm_cfg> sensor_cfg_sdm845 = {
185 {
186 TemperatureType::CPU,
187 cpu_sensors_sdm845,
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",
LuK133774db7b62023-08-14 10:56:45 +0200213 55000,
Gopala Krishna Nuthakibcc1d012021-05-04 12:06:53 +0530214 95000,
215 true,
216 },
217 {
218 TemperatureType::BCL_PERCENTAGE,
219 {"soc"},
220 "soc",
221 10,
222 2,
223 false,
224 },
225 };
226
Minghao Zhang2658fa62020-12-28 10:16:45 +0800227 std::vector<std::string> cpu_sensors_bengal =
228 {
229 "cpuss-2-usr",
230 "cpuss-2-usr",
231 "cpuss-2-usr",
232 "cpuss-2-usr",
233 "cpu-1-0-usr",
234 "cpu-1-1-usr",
235 "cpu-1-2-usr",
236 "cpu-1-3-usr",
237 };
238
239 std::vector<struct target_therm_cfg> sensor_cfg_bengal =
240 {
241 {
242 TemperatureType::CPU,
243 cpu_sensors_bengal,
244 "",
245 95000,
246 115000,
Minghao Zhang2658fa62020-12-28 10:16:45 +0800247 true,
248 },
249 {
250 TemperatureType::GPU,
251 { "gpu-usr" },
252 "GPU",
253 95000,
254 115000,
Minghao Zhang2658fa62020-12-28 10:16:45 +0800255 true,
256 },
257 {
258 TemperatureType::SKIN,
259 { "xo-therm-usr" },
260 "skin",
261 40000,
262 95000,
Minghao Zhang2658fa62020-12-28 10:16:45 +0800263 true,
264 },
265 {
266 TemperatureType::BCL_VOLTAGE,
267 { "pmi632-vbat-lvl0" },
268 "vbat",
269 3000,
270 2800,
Minghao Zhang2658fa62020-12-28 10:16:45 +0800271 false,
272 },
273 {
274 TemperatureType::BCL_CURRENT,
275 { "pmi632-ibat-lvl0" },
276 "ibat",
277 4000,
278 4200,
Minghao Zhang2658fa62020-12-28 10:16:45 +0800279 true,
280 },
281 {
282 TemperatureType::BCL_PERCENTAGE,
283 { "soc" },
284 "soc",
285 10,
286 2,
Minghao Zhang2658fa62020-12-28 10:16:45 +0800287 false,
288 },
289 };
Minghao Zhangae04ce32020-09-23 23:28:34 +0800290
gnuthakidd79a2b2023-11-15 12:03:02 +0530291 std::vector<std::string> cpu_sensors_talos =
292 {
293 "cpuss-2",
294 "cpuss-2",
295 "cpuss-1",
296 "cpuss-1",
297 "cpuss-0",
298 "cpuss-0",
299 "cpu-1-0",
300 "cpu-1-2",
301 };
302
303 std::vector<struct target_therm_cfg> sensor_cfg_talos_common =
304 {
305 {
306 TemperatureType::CPU,
307 cpu_sensors_talos,
308 "",
309 95000,
310 115000,
311 true,
312 },
313 {
314 TemperatureType::GPU,
315 { "gpu" },
316 "gpu",
317 95000,
318 115000,
319 true,
320 },
321 };
322
323 std::vector<struct target_therm_cfg> sensor_cfg_sa6155_common =
324 {
325 {
326 TemperatureType::CPU,
327 cpu_sensors_talos,
328 "",
329 105000,
330 118000,
331 true,
332 },
333 {
334 TemperatureType::GPU,
335 { "gpu" },
336 "gpu",
337 105000,
338 118000,
339 true,
340 },
341 };
342
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530343 std::vector<std::string> cpu_sensors_khaje =
344 {
Manaf Meethalavalappu Pallikunhi6d43d262023-01-06 19:51:33 +0530345 "cpuss-2",
346 "cpuss-2",
347 "cpuss-2",
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530348 "cpuss-2",
349 "cpu-1-0",
350 "cpu-1-1",
351 "cpu-1-2",
352 "cpu-1-3",
353 };
354
355 std::vector<struct target_therm_cfg> sensor_cfg_khaje =
356 {
357 {
358 TemperatureType::CPU,
359 cpu_sensors_khaje,
360 "",
361 95000,
362 115000,
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530363 true,
364 },
365 {
366 TemperatureType::GPU,
367 { "gpu" },
368 "GPU",
369 95000,
370 115000,
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530371 true,
372 },
373 {
374 TemperatureType::SKIN,
375 { "xo-therm" },
376 "skin",
377 40000,
378 95000,
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530379 true,
380 },
381 {
382 TemperatureType::BCL_VOLTAGE,
Manaf Meethalavalappu Pallikunhi6d43d262023-01-06 19:51:33 +0530383 { "vbat" },
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530384 "vbat",
385 3000,
386 2800,
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530387 false,
388 },
389 {
390 TemperatureType::BCL_CURRENT,
391 { "pm7250b-ibat-lvl0" },
392 "ibat",
393 5500,
394 6000,
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530395 true,
396 },
397 {
398 TemperatureType::BCL_PERCENTAGE,
Manaf Meethalavalappu Pallikunhi6d43d262023-01-06 19:51:33 +0530399 { "socd" },
400 "socd",
401 90,
402 99,
403 true,
Priyansh Jain3388cdf2022-08-17 14:05:26 +0530404 },
405 };
406
Minghao Zhangae04ce32020-09-23 23:28:34 +0800407 std::vector<std::string> cpu_sensors_trinket =
408 {
Nitesh Kumar7de2fcb2023-06-22 18:21:53 +0530409 "cpuss-0",
410 "cpuss-0",
411 "cpuss-0",
412 "cpuss-0",
413 "cpu-1-0",
414 "cpu-1-1",
415 "cpu-1-2",
416 "cpu-1-3",
Minghao Zhangae04ce32020-09-23 23:28:34 +0800417 };
418
419 std::vector<struct target_therm_cfg> sensor_cfg_trinket =
420 {
421 {
422 TemperatureType::CPU,
423 cpu_sensors_trinket,
424 "",
425 95000,
426 115000,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800427 true,
428 },
429 {
430 TemperatureType::GPU,
Nitesh Kumar7de2fcb2023-06-22 18:21:53 +0530431 { "gpu" },
Minghao Zhangae04ce32020-09-23 23:28:34 +0800432 "GPU",
433 95000,
434 115000,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800435 true,
436 },
437 {
438 TemperatureType::SKIN,
Nitesh Kumar7de2fcb2023-06-22 18:21:53 +0530439 { "xo-therm" },
Minghao Zhangae04ce32020-09-23 23:28:34 +0800440 "skin",
441 40000,
442 95000,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800443 true,
444 },
445 {
446 TemperatureType::BCL_VOLTAGE,
Nitesh Kumar7de2fcb2023-06-22 18:21:53 +0530447 { "vbat" },
Minghao Zhangae04ce32020-09-23 23:28:34 +0800448 "vbat",
449 3000,
450 2800,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800451 false,
452 },
453 {
454 TemperatureType::BCL_CURRENT,
455 { "pmi632-ibat-lvl0" },
456 "ibat",
457 4000,
458 4200,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800459 true,
460 },
461 {
462 TemperatureType::BCL_PERCENTAGE,
Nitesh Kumar7de2fcb2023-06-22 18:21:53 +0530463 { "socd" },
464 "socd",
465 90,
466 99,
467 true,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800468 },
469 };
470
Edwin Moquete9b72a562022-04-16 20:04:36 +0000471 std::vector<struct target_therm_cfg> sensor_cfg_sdm660 =
472 {
473 {
474 TemperatureType::CPU,
475 cpu_sensors_trinket,
476 "",
477 95000,
478 115000,
479 true,
480 },
481 {
482 TemperatureType::GPU,
483 { "gpu-usr" },
484 "GPU",
485 95000,
486 115000,
487 true,
488 },
489 {
490 TemperatureType::SKIN,
491 { "xo-therm-adc" },
492 "skin",
493 40000,
494 95000,
495 true,
496 },
497 {
498 TemperatureType::BCL_PERCENTAGE,
499 { "soc" },
500 "soc",
501 10,
502 2,
503 false,
504 },
505 };
506
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700507 std::vector<std::string> cpu_sensors_lito =
508 {
509 "cpu-0-0-usr",
510 "cpu-0-1-usr",
511 "cpu-0-2-usr",
512 "cpu-0-3-usr",
513 "cpu-0-4-usr",
514 "cpu-0-5-usr",
515 "cpu-1-0-usr",
516 "cpu-1-2-usr",
517 };
518
519 std::vector<struct target_therm_cfg> sensor_cfg_lito =
520 {
521 {
522 TemperatureType::CPU,
523 cpu_sensors_lito,
524 "",
525 95000,
526 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700527 true,
528 },
529 {
530 TemperatureType::GPU,
531 { "gpuss-0-usr" },
532 "GPU",
533 95000,
534 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700535 true,
536 },
537 {
538 TemperatureType::SKIN,
539 { "xo-therm-usr" },
540 "skin",
Michael Bestas5806fe52023-08-28 20:04:06 +0300541 55000,
Minghao Zhang50998c82020-09-11 17:17:13 +0800542 95000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700543 true,
544 },
545 {
546 TemperatureType::BCL_CURRENT,
547 { "pm7250b-ibat-lvl0" },
548 "ibat",
549 4500,
550 5000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700551 true,
552 },
553 {
554 TemperatureType::BCL_VOLTAGE,
555 { "pm7250b-vbat-lvl0" },
556 "vbat",
557 3200,
558 3000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700559 false,
560 },
561 {
562 TemperatureType::BCL_PERCENTAGE,
563 { "soc" },
564 "soc",
565 10,
566 2,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700567 false,
568 },
569 };
570
Minghao Zhangae04ce32020-09-23 23:28:34 +0800571 std::vector<struct target_therm_cfg> sensor_cfg_sdmmagpie =
572 {
573 {
574 TemperatureType::CPU,
575 cpu_sensors_lito,
576 "",
577 95000,
578 115000,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800579 true,
580 },
581 {
582 TemperatureType::GPU,
583 { "gpuss-0-usr" },
584 "GPU",
585 95000,
586 115000,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800587 true,
588 },
589 {
590 TemperatureType::SKIN,
591 { "xo-therm-adc" },
592 "skin",
593 40000,
594 95000,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800595 true,
596 },
597 {
598 TemperatureType::BCL_VOLTAGE,
599 { "pm6150-vbat-lvl0" },
600 "vbat",
601 3000,
602 2800,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800603 false,
604 },
605 {
606 TemperatureType::BCL_CURRENT,
607 { "pm6150-ibat-lvl0" },
608 "ibat",
609 5500,
610 6000,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800611 true,
612 },
613 {
614 TemperatureType::BCL_PERCENTAGE,
615 { "soc" },
616 "soc",
617 10,
618 2,
Minghao Zhangae04ce32020-09-23 23:28:34 +0800619 false,
620 },
621 };
622
Nitesh Kumar83759f12023-06-30 19:15:54 +0530623 std::vector<std::string> cpu_sensors_holi =
624 {
625 "cpu-0-0",
626 "cpu-0-1",
627 "cpu-0-2",
628 "cpu-0-3",
629 "cpu-0-4",
630 "cpu-0-5",
631 "cpu-1-0",
632 "cpu-1-2",
633 };
634
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530635 std::vector<struct target_therm_cfg> sensor_cfg_holi =
636 {
637 {
638 TemperatureType::CPU,
Nitesh Kumar83759f12023-06-30 19:15:54 +0530639 cpu_sensors_holi,
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530640 "",
641 95000,
642 115000,
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530643 true,
644 },
645 {
646 TemperatureType::GPU,
Nitesh Kumar83759f12023-06-30 19:15:54 +0530647 { "gpuss-0" },
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530648 "gpu0",
649 95000,
650 115000,
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530651 true,
652 },
653 {
654 TemperatureType::GPU,
Nitesh Kumar83759f12023-06-30 19:15:54 +0530655 { "gpuss-1" },
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530656 "gpu1",
657 95000,
658 115000,
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530659 true,
660 },
661 {
662 TemperatureType::SKIN,
Nitesh Kumar83759f12023-06-30 19:15:54 +0530663 { "quiet-therm" },
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530664 "skin",
665 40000,
666 95000,
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530667 true,
668 },
669 {
670 TemperatureType::BCL_CURRENT,
671 { "pm7250b-ibat-lvl0" },
672 "ibat",
673 5500,
674 6000,
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +0530675 true,
676 },
677 };
678
gnuthakidd79a2b2023-11-15 12:03:02 +0530679 std::vector<std::string> cpu_sensors_msmnile =
680 {
681 "cpu-0-0",
682 "cpu-0-1",
683 "cpu-0-2",
684 "cpu-0-3",
685 "cpu-1-0",
686 "cpu-1-1",
687 "cpu-1-2",
688 "cpu-1-3",
689 };
690
691 std::vector<struct target_therm_cfg> sensor_cfg_msmnile_common = {
692 {
693 TemperatureType::CPU,
694 cpu_sensors_msmnile,
695 "",
696 95000,
697 115000,
698 true,
699 },
700 {
701 TemperatureType::GPU,
702 { "gpuss-0" },
703 "gpu0",
704 95000,
705 115000,
706 true,
707 },
708 {
709 TemperatureType::GPU,
710 { "gpuss-1" },
711 "gpu1",
712 95000,
713 115000,
714 true,
715 },
716 };
717
718 std::vector<struct target_therm_cfg> sensor_cfg_sa8155_common = {
719 {
720 TemperatureType::CPU,
721 cpu_sensors_msmnile,
722 "",
723 105000,
724 118000,
725 true,
726 },
727 {
728 TemperatureType::GPU,
729 { "gpuss-0" },
730 "gpu0",
731 105000,
732 118000,
733 true,
734 },
735 {
736 TemperatureType::GPU,
737 { "gpuss-1" },
738 "gpu1",
739 105000,
740 118000,
741 true,
742 },
743 };
744
745 std::vector<struct target_therm_cfg> sensor_cfg_sa8195_common = {
746 {
747 TemperatureType::CPU,
748 cpu_sensors_msmnile,
749 "",
750 105000,
751 118000,
752 true,
753 },
754 {
755 TemperatureType::GPU,
756 { "gpuss-0" },
757 "gpu0",
758 105000,
759 118000,
760 true,
761 },
762 {
763 TemperatureType::GPU,
764 { "gpuss-1" },
765 "gpu1",
766 105000,
767 118000,
768 true,
769 },
770 {
771 TemperatureType::GPU,
772 { "gpuss-2" },
773 "gpu2",
774 105000,
775 118000,
776 true,
777 },
778 {
779 TemperatureType::GPU,
780 { "gpuss-3" },
781 "gpu3",
782 105000,
783 118000,
784 true,
785 },
786 };
787
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700788 std::vector<std::string> cpu_sensors_kona =
789 {
Priyansh Jain0c6fd5b2023-01-13 16:56:48 +0530790 "cpu-0-0",
791 "cpu-0-1",
792 "cpu-0-2",
793 "cpu-0-3",
794 "cpu-1-0",
795 "cpu-1-1",
796 "cpu-1-2",
797 "cpu-1-3",
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700798 };
799
800 std::vector<struct target_therm_cfg> kona_common = {
801 {
802 TemperatureType::CPU,
803 cpu_sensors_kona,
804 "",
805 95000,
806 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700807 true,
808 },
809 {
810 TemperatureType::GPU,
Priyansh Jain0c6fd5b2023-01-13 16:56:48 +0530811 { "gpuss-0" },
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700812 "GPU0",
813 95000,
814 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700815 true,
816 },
817 {
818 TemperatureType::GPU,
Priyansh Jain0c6fd5b2023-01-13 16:56:48 +0530819 { "gpuss-1" },
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700820 "GPU1",
821 95000,
822 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700823 true,
824 },
825 {
826 TemperatureType::SKIN,
Priyansh Jain0c6fd5b2023-01-13 16:56:48 +0530827 { "skin-msm-therm" },
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700828 "skin",
829 40000,
830 95000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700831 true,
832 }
833 };
834
835 std::vector<struct target_therm_cfg> kona_specific = {
836 {
837 TemperatureType::BCL_CURRENT,
838 { "pm8150b-ibat-lvl0" },
839 "ibat",
840 4500,
841 5000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700842 true,
843 },
844 {
845 TemperatureType::BCL_VOLTAGE,
Priyansh Jain0c6fd5b2023-01-13 16:56:48 +0530846 { "vbat" },
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700847 "vbat",
848 3200,
849 3000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700850 false,
851 },
852 {
853 TemperatureType::BCL_PERCENTAGE,
Priyansh Jain0c6fd5b2023-01-13 16:56:48 +0530854 { "socd" },
855 "socd",
856 90,
857 99,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700858 false,
859 },
860 {
861 TemperatureType::NPU,
Priyansh Jain0c6fd5b2023-01-13 16:56:48 +0530862 { "npu" },
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700863 "npu",
864 95000,
Ram Chandrasekarc49329d2020-08-25 14:28:02 -0700865 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700866 true,
867 },
868 };
869
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530870 std::vector<std::string> cpu_sensors_lahaina =
871 {
872 "cpu-0-0-usr",
873 "cpu-0-1-usr",
874 "cpu-0-2-usr",
875 "cpu-0-3-usr",
876 "cpu-1-0-usr",
877 "cpu-1-2-usr",
878 "cpu-1-4-usr",
879 "cpu-1-6-usr",
880 };
881
882 std::vector<struct target_therm_cfg> lahaina_common = {
883 {
884 TemperatureType::CPU,
885 cpu_sensors_lahaina,
886 "",
887 95000,
888 115000,
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530889 true,
890 },
891 {
892 TemperatureType::GPU,
893 { "gpuss-0-usr" },
894 "GPU0",
895 95000,
896 115000,
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530897 true,
898 },
899 {
900 TemperatureType::GPU,
901 { "gpuss-1-usr" },
902 "GPU1",
903 95000,
904 115000,
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530905 true,
906 },
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700907 {
908 TemperatureType::BCL_CURRENT,
909 { "pm8350b-ibat-lvl0" },
910 "ibat",
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530911 6000,
912 7500,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700913 true,
914 },
915 {
916 TemperatureType::NPU,
917 { "nspss-0-usr" },
918 "nsp0",
919 95000,
Ram Chandrasekarc49329d2020-08-25 14:28:02 -0700920 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700921 true,
922 },
923 {
924 TemperatureType::NPU,
925 { "nspss-1-usr" },
926 "nsp1",
927 95000,
Ram Chandrasekarc49329d2020-08-25 14:28:02 -0700928 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700929 true,
930 },
931 {
932 TemperatureType::NPU,
933 { "nspss-2-usr" },
934 "nsp2",
935 95000,
Ram Chandrasekarc49329d2020-08-25 14:28:02 -0700936 115000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -0700937 true,
938 },
939 };
940
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530941 std::vector<struct target_therm_cfg> lahaina_specific = {
942 {
943 TemperatureType::SKIN,
Minghao Zhang72737612020-10-29 10:32:44 +0800944 { "xo-therm-usr" },
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530945 "skin",
Minghao Zhang72737612020-10-29 10:32:44 +0800946 55000,
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530947 95000,
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530948 true,
949 },
950 };
951
952 std::vector<struct target_therm_cfg> shima_specific = {
953 {
954 TemperatureType::SKIN,
955 { "quiet-therm-usr" },
956 "skin",
957 40000,
958 95000,
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +0530959 true,
960 },
961 };
962
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +0530963 std::vector<struct target_therm_cfg> sensor_cfg_yupik = {
964 {
965 TemperatureType::CPU,
966 cpu_sensors_lahaina,
967 "",
968 95000,
969 115000,
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +0530970 true,
971 },
972 {
973 TemperatureType::GPU,
974 { "gpuss-0-usr" },
975 "GPU0",
976 95000,
977 115000,
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +0530978 true,
979 },
980 {
981 TemperatureType::GPU,
982 { "gpuss-1-usr" },
983 "GPU1",
984 95000,
985 115000,
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +0530986 true,
987 },
988 {
989 TemperatureType::NPU,
990 { "nspss-0-usr" },
991 "nsp0",
992 95000,
993 115000,
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +0530994 true,
995 },
996 {
997 TemperatureType::NPU,
998 { "nspss-1-usr" },
999 "nsp1",
1000 95000,
1001 115000,
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +05301002 true,
1003 },
1004 {
1005 TemperatureType::SKIN,
1006 { "quiet-therm-usr" },
1007 "skin",
1008 40000,
1009 95000,
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +05301010 true,
1011 },
1012 };
1013
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001014 std::vector<std::string> cpu_sensors_waipio =
1015 {
1016 "cpu-0-0",
1017 "cpu-0-1",
1018 "cpu-0-2",
1019 "cpu-0-3",
1020 "cpu-1-0",
1021 "cpu-1-2",
1022 "cpu-1-4",
1023 "cpu-1-6",
1024 };
1025
1026 std::vector<struct target_therm_cfg> waipio_common = {
1027 {
1028 TemperatureType::CPU,
1029 cpu_sensors_waipio,
1030 "",
1031 95000,
1032 115000,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001033 true,
1034 },
1035 {
1036 TemperatureType::GPU,
1037 { "gpuss-0" },
1038 "GPU0",
1039 95000,
1040 115000,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001041 true,
1042 },
1043 {
1044 TemperatureType::GPU,
1045 { "gpuss-1" },
1046 "GPU1",
1047 95000,
1048 115000,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001049 true,
1050 },
1051 {
1052 TemperatureType::NPU,
1053 { "nspss-0" },
1054 "nsp0",
1055 95000,
1056 115000,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001057 true,
1058 },
1059 {
1060 TemperatureType::NPU,
1061 { "nspss-1" },
1062 "nsp1",
1063 95000,
1064 115000,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001065 true,
1066 },
1067 {
1068 TemperatureType::NPU,
1069 { "nspss-2" },
1070 "nsp2",
1071 95000,
1072 115000,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001073 true,
1074 },
Priyansh Jaina26aeb42021-09-20 17:29:05 +05301075 };
1076
Priyansh Jaind670d792022-07-20 15:51:13 +05301077 std::vector<struct target_therm_cfg> diwali_common = {
1078 {
1079 TemperatureType::CPU,
1080 cpu_sensors_waipio,
1081 "",
1082 95000,
1083 115000,
1084 true,
1085 ThrottlingSeverity::LIGHT,
1086 },
1087 {
1088 TemperatureType::GPU,
1089 { "gpuss-0" },
1090 "GPU0",
1091 95000,
1092 115000,
1093 true,
1094 ThrottlingSeverity::LIGHT,
1095 },
1096 {
1097 TemperatureType::GPU,
1098 { "gpuss-1" },
1099 "GPU1",
1100 95000,
1101 115000,
1102 true,
1103 ThrottlingSeverity::LIGHT,
1104 },
1105 {
1106 TemperatureType::NPU,
1107 { "nspss-0" },
1108 "nsp0",
1109 95000,
1110 115000,
1111 true,
1112 ThrottlingSeverity::LIGHT,
1113 },
1114 {
1115 TemperatureType::NPU,
1116 { "nspss-1" },
1117 "nsp1",
1118 95000,
1119 115000,
1120 true,
1121 ThrottlingSeverity::LIGHT,
1122 },
1123 {
1124 TemperatureType::NPU,
1125 { "nspss-2" },
1126 "nsp2",
1127 95000,
1128 115000,
1129 true,
1130 ThrottlingSeverity::LIGHT,
1131 },
1132 };
1133
Priyansh Jaina26aeb42021-09-20 17:29:05 +05301134 std::vector<struct target_therm_cfg> waipio_specific = {
1135 {
1136 TemperatureType::BCL_CURRENT,
1137 { "pm8350b-ibat-lvl0" },
1138 "ibat",
1139 6000,
1140 7500,
Priyansh Jaina26aeb42021-09-20 17:29:05 +05301141 true,
1142 },
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001143 {
1144 TemperatureType::SKIN,
1145 { "xo-therm" },
1146 "skin",
1147 55000,
1148 95000,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001149 true,
1150 },
1151 };
1152
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301153 std::vector<std::string> cpu_sensors_kalama =
1154 {
1155 "cpu-0-0",
1156 "cpu-0-1",
1157 "cpu-0-2",
1158 "cpu-1-0",
1159 "cpu-1-2",
1160 "cpu-1-4",
1161 "cpu-1-6",
1162 "cpu-1-8",
1163 };
1164
1165 std::vector<struct target_therm_cfg> kalama_common = {
1166 {
1167 TemperatureType::CPU,
1168 cpu_sensors_kalama,
1169 "",
1170 95000,
1171 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301172 true,
1173 },
1174 {
1175 TemperatureType::GPU,
1176 { "gpuss-0" },
1177 "GPU0",
1178 95000,
1179 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301180 true,
1181 },
1182 {
1183 TemperatureType::GPU,
1184 { "gpuss-1" },
1185 "GPU1",
1186 95000,
1187 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301188 true,
1189 },
1190 {
1191 TemperatureType::GPU,
1192 { "gpuss-2" },
1193 "GPU2",
1194 95000,
1195 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301196 true,
1197 },
1198 {
1199 TemperatureType::GPU,
1200 { "gpuss-3" },
1201 "GPU3",
1202 95000,
1203 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301204 true,
1205 },
1206 {
1207 TemperatureType::GPU,
1208 { "gpuss-4" },
1209 "GPU4",
1210 95000,
1211 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301212 true,
1213 },
1214 {
1215 TemperatureType::GPU,
1216 { "gpuss-5" },
1217 "GPU5",
1218 95000,
1219 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301220 true,
1221 },
1222 {
1223 TemperatureType::GPU,
1224 { "gpuss-6" },
1225 "GPU6",
1226 95000,
1227 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301228 true,
1229 },
1230 {
1231 TemperatureType::GPU,
1232 { "gpuss-7" },
1233 "GPU7",
1234 95000,
1235 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301236 true,
1237 },
1238 {
1239 TemperatureType::NPU,
1240 { "nspss-0" },
1241 "nsp0",
Manaf Meethalavalappu Pallikunhi92b7bbf2022-06-30 01:29:08 +05301242 100000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301243 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301244 true,
1245 },
1246 {
1247 TemperatureType::NPU,
1248 { "nspss-1" },
1249 "nsp1",
Manaf Meethalavalappu Pallikunhi92b7bbf2022-06-30 01:29:08 +05301250 100000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301251 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301252 true,
1253 },
1254 {
1255 TemperatureType::NPU,
1256 { "nspss-2" },
1257 "nsp2",
Manaf Meethalavalappu Pallikunhi92b7bbf2022-06-30 01:29:08 +05301258 100000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301259 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301260 true,
1261 },
1262 {
1263 TemperatureType::NPU,
1264 { "nspss-3" },
1265 "nsp3",
Manaf Meethalavalappu Pallikunhi92b7bbf2022-06-30 01:29:08 +05301266 100000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301267 115000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301268 true,
1269 },
1270 };
1271
1272 std::vector<struct target_therm_cfg> kalama_specific = {
1273 {
1274 TemperatureType::BCL_CURRENT,
1275 { "pm8550b-ibat-lvl0" },
1276 "ibat",
1277 9000,
1278 10000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301279 true,
1280 },
1281 {
1282 TemperatureType::SKIN,
Rashid Zafar580cffb2022-08-15 14:51:54 -07001283 { "skin-msm-therm" },
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301284 "skin",
Rashid Zafar580cffb2022-08-15 14:51:54 -07001285 46500,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301286 95000,
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05301287 true,
1288 },
1289 };
1290
Priyansh Jaina72f3822023-05-30 14:44:09 +05301291 std::vector<std::string> cpu_sensors_crow =
1292 {
1293 "cpu-0-0",
1294 "cpu-0-1",
1295 "cpu-0-2",
1296 "cpu-0-3",
1297 "cpu-1-0",
1298 "cpu-1-2",
1299 "cpu-1-4",
1300 "cpu-1-6",
1301 };
1302
1303 std::vector<struct target_therm_cfg> crow_common = {
1304 {
1305 TemperatureType::CPU,
1306 cpu_sensors_crow,
1307 "",
1308 95000,
1309 115000,
1310 true,
1311 },
1312 {
1313 TemperatureType::GPU,
1314 { "gpuss-0" },
1315 "GPU0",
gnuthaki8b5e93d2023-08-24 16:23:14 +05301316 102000,
Priyansh Jaina72f3822023-05-30 14:44:09 +05301317 115000,
1318 true,
1319 },
1320 {
1321 TemperatureType::GPU,
1322 { "gpuss-1" },
1323 "GPU1",
gnuthaki8b5e93d2023-08-24 16:23:14 +05301324 102000,
Priyansh Jaina72f3822023-05-30 14:44:09 +05301325 115000,
1326 true,
1327 },
1328 {
1329 TemperatureType::NPU,
1330 { "nspss-0" },
1331 "nsp0",
1332 100000,
1333 115000,
1334 true,
1335 },
1336 {
1337 TemperatureType::NPU,
1338 { "nspss-1" },
1339 "nsp1",
1340 100000,
1341 115000,
1342 true,
1343 },
1344 {
1345 TemperatureType::NPU,
1346 { "nspss-2" },
1347 "nsp2",
1348 100000,
1349 115000,
1350 true,
1351 },
1352 };
1353
1354 std::vector<struct target_therm_cfg> crow_specific = {
1355 {
1356 TemperatureType::SKIN,
1357 { "sys-therm-3" },
1358 "skin",
1359 60000,
1360 95000,
1361 true,
1362 },
1363 };
1364
Priyansh Jaina26aeb42021-09-20 17:29:05 +05301365 std::vector<struct target_therm_cfg> diwali_specific = {
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001366 {
1367 TemperatureType::BCL_CURRENT,
Minghao Zhang510dcf12022-03-04 19:20:38 +08001368 { "pm7250b-ibat-lvl0" },
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001369 "ibat",
Minghao Zhang510dcf12022-03-04 19:20:38 +08001370 9000,
1371 9500,
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001372 true,
1373 },
Priyansh Jaina26aeb42021-09-20 17:29:05 +05301374 {
1375 TemperatureType::SKIN,
1376 { "quiet-therm" },
1377 "skin",
Priyansh Jain895ef382022-07-05 12:43:10 +05301378 46000,
Priyansh Jaina26aeb42021-09-20 17:29:05 +05301379 95000,
Priyansh Jaina26aeb42021-09-20 17:29:05 +05301380 true,
Priyansh Jaind670d792022-07-20 15:51:13 +05301381 ThrottlingSeverity::LIGHT,
Priyansh Jaina26aeb42021-09-20 17:29:05 +05301382 },
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07001383 };
1384
Priyansh Jain39782192022-03-09 10:10:43 +05301385 std::vector<std::string> cpu_sensors_neo =
1386 {
1387 "cpu-0-0",
1388 "cpu-0-1",
1389 "cpu-0-2",
1390 "cpu-0-3",
1391 };
1392
1393 std::vector<struct target_therm_cfg> neo_common = {
1394 {
1395 TemperatureType::CPU,
1396 cpu_sensors_neo,
1397 "",
1398 95000,
1399 115000,
1400 true,
1401 },
1402 {
1403 TemperatureType::GPU,
1404 { "gpuss-0" },
1405 "GPU0",
1406 95000,
1407 115000,
1408 true,
1409 },
1410 {
1411 TemperatureType::GPU,
1412 { "gpuss-1" },
1413 "GPU1",
1414 95000,
1415 115000,
1416 true,
1417 },
1418 {
1419 TemperatureType::NPU,
1420 { "nspss-0" },
1421 "nsp0",
1422 95000,
1423 115000,
1424 true,
1425 },
1426 {
1427 TemperatureType::NPU,
1428 { "nspss-1" },
1429 "nsp1",
1430 95000,
1431 115000,
1432 true,
1433 },
1434 {
1435 TemperatureType::NPU,
1436 { "nspss-2" },
1437 "nsp2",
1438 95000,
1439 115000,
1440 true,
1441 },
1442 };
1443
Priyansh Jainb48d2ec2022-03-21 16:25:29 +05301444 std::vector<std::string> cpu_sensors_parrot =
1445 {
1446 "cpu-0-0",
1447 "cpu-0-1",
1448 "cpu-0-2",
1449 "cpu-0-3",
1450 "cpu-1-0",
1451 "cpu-1-2",
1452 "cpu-1-4",
1453 "cpu-1-6",
1454 };
1455
1456 std::vector<struct target_therm_cfg> parrot_common = {
1457 {
1458 TemperatureType::CPU,
1459 cpu_sensors_parrot,
1460 "",
1461 95000,
1462 115000,
1463 true,
1464 },
1465 {
1466 TemperatureType::GPU,
1467 { "gpuss-0" },
1468 "GPU0",
1469 95000,
1470 115000,
1471 true,
1472 },
1473 {
1474 TemperatureType::GPU,
1475 { "gpuss-1" },
1476 "GPU1",
1477 95000,
1478 115000,
1479 true,
1480 },
1481 {
1482 TemperatureType::NPU,
1483 { "nspss-0" },
1484 "nsp0",
1485 95000,
1486 115000,
1487 true,
1488 },
1489 {
1490 TemperatureType::NPU,
1491 { "nspss-1" },
1492 "nsp1",
1493 95000,
1494 115000,
1495 true,
1496 },
1497 };
1498
1499 std::vector<struct target_therm_cfg> parrot_specific = {
1500 {
1501 TemperatureType::BCL_CURRENT,
1502 { "pm7250b-ibat-lvl0" },
1503 "ibat",
1504 6000,
1505 7500,
1506 true,
1507 },
1508 {
1509 TemperatureType::SKIN,
1510 { "xo-therm" },
1511 "skin",
1512 55000,
1513 95000,
1514 true,
1515 },
1516 };
1517
Priyansh Jaincd32b812023-10-31 16:04:32 +05301518 std::vector<std::string> cpu_sensors_lemansAU =
1519 {
1520 "cpu-0-0-0",
1521 "cpu-0-1-0",
1522 "cpu-0-2-0",
1523 "cpu-0-3-0",
1524 "cpu-1-0-0",
1525 "cpu-1-1-0",
1526 "cpu-1-2-0",
1527 "cpu-1-3-0",
1528 };
1529
1530 std::vector<struct target_therm_cfg> lemansAU_common = {
1531 {
1532 TemperatureType::CPU,
1533 cpu_sensors_lemansAU,
1534 "",
1535 105000,
1536 118000,
1537 true,
1538 },
1539 {
1540 TemperatureType::GPU,
1541 { "gpuss-0" },
1542 "GPU0",
1543 105000,
1544 118000,
1545 true,
1546 },
1547 {
1548 TemperatureType::GPU,
1549 { "gpuss-1" },
1550 "GPU1",
1551 105000,
1552 118000,
1553 true,
1554 },
1555 {
1556 TemperatureType::GPU,
1557 { "gpuss-2" },
1558 "GPU2",
1559 105000,
1560 118000,
1561 true,
1562 },
1563 {
1564 TemperatureType::NPU,
1565 { "nsp-0-0-0" },
1566 "nsp0",
1567 105000,
1568 118000,
1569 true,
1570 },
1571 {
1572 TemperatureType::NPU,
1573 { "nsp-1-0-0" },
1574 "nsp1",
1575 105000,
1576 118000,
1577 true,
1578 },
1579 };
1580
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07001581 struct target_therm_cfg bat_conf = {
1582 TemperatureType::BATTERY,
1583 { "battery" },
1584 "battery",
1585 80000,
1586 90000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07001587 true,
1588 };
1589
1590 std::vector<struct target_therm_cfg> bcl_conf = {
1591 {
1592 TemperatureType::BCL_VOLTAGE,
1593 { "vbat" },
1594 "vbat",
1595 3200,
1596 3000,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07001597 false,
1598 },
1599 {
1600 TemperatureType::BCL_PERCENTAGE,
1601 { "socd" },
1602 "socd",
1603 90,
1604 99,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07001605 true,
1606 },
1607 };
1608
Rashid Zafare9219f72022-11-01 15:48:37 -07001609 std::vector<std::string> cpu_sensors_pineapple = {
1610 "cpu-0-0-0",
1611 "cpu-0-1-0",
1612 "cpu-2-0-0",
1613 "cpu-2-1-0",
1614 "cpu-2-2-0",
1615 "cpu-1-0-0",
1616 "cpu-1-1-0",
1617 "cpu-1-2-0",
1618 };
1619
1620 std::vector<struct target_therm_cfg> pineapple_common = {
1621 {
1622 TemperatureType::CPU,
1623 cpu_sensors_pineapple,
1624 "",
1625 95000,
1626 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001627 true,
1628 },
1629 {
1630 TemperatureType::GPU,
1631 { "gpuss-0" },
1632 "GPU0",
1633 95000,
1634 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001635 true,
1636 },
1637 {
1638 TemperatureType::GPU,
1639 { "gpuss-1" },
1640 "GPU1",
1641 95000,
1642 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001643 true,
1644 },
1645 {
1646 TemperatureType::GPU,
1647 { "gpuss-2" },
1648 "GPU2",
1649 95000,
1650 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001651 true,
1652 },
1653 {
1654 TemperatureType::GPU,
1655 { "gpuss-3" },
1656 "GPU3",
1657 95000,
1658 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001659 true,
1660 },
1661 {
1662 TemperatureType::GPU,
1663 { "gpuss-4" },
1664 "GPU4",
1665 95000,
1666 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001667 true,
1668 },
1669 {
1670 TemperatureType::GPU,
1671 { "gpuss-5" },
1672 "GPU5",
1673 95000,
1674 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001675 true,
1676 },
1677 {
1678 TemperatureType::GPU,
1679 { "gpuss-6" },
1680 "GPU6",
1681 95000,
1682 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001683 true,
1684 },
1685 {
1686 TemperatureType::GPU,
1687 { "gpuss-7" },
1688 "GPU7",
1689 95000,
1690 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001691 true,
1692 },
1693 {
1694 TemperatureType::NPU,
1695 { "nsphvx-0" },
1696 "nsp0",
1697 100000,
1698 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001699 true,
1700 },
1701 {
1702 TemperatureType::NPU,
1703 { "nsphvx-1" },
1704 "nsp1",
1705 100000,
1706 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001707 true,
1708 },
1709 {
1710 TemperatureType::NPU,
1711 { "nsphmx-0" },
1712 "nsp2",
1713 100000,
1714 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001715 true,
1716 },
1717 {
1718 TemperatureType::NPU,
1719 { "nsphmx-1" },
1720 "nsp3",
1721 100000,
1722 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001723 true,
1724 },
1725 {
1726 TemperatureType::NPU,
1727 { "nsphmx-2" },
1728 "nsp4",
1729 100000,
1730 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001731 true,
1732 },
1733 {
1734 TemperatureType::NPU,
1735 { "nsphmx-3" },
1736 "nsp5",
1737 100000,
1738 115000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001739 true,
1740 },
1741 };
1742
1743 std::vector<struct target_therm_cfg> pineapple_specific = {
1744 {
1745 TemperatureType::BCL_CURRENT,
1746 { "pm8550b-ibat-lvl0" },
1747 "ibat",
1748 9000,
1749 10000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001750 true,
1751 },
1752 {
1753 TemperatureType::SKIN,
1754 { "skin-msm-therm" },
1755 "skin",
1756 46500,
1757 95000,
Rashid Zafare9219f72022-11-01 15:48:37 -07001758 true,
1759 },
1760 };
1761
Priyansh Jaindaa7d592023-09-25 15:55:19 +05301762std::vector<std::string> cpu_sensors_cliffs = {
1763 "cpu-0-0-0",
1764 "cpu-0-1-0",
1765 "cpu-0-2-0",
1766 "cpu-1-0-0",
1767 "cpu-1-1-0",
1768 "cpu-1-2-0",
1769 "cpu-1-3-0",
1770 "cpu-2-0-0",
1771 };
1772
1773 std::vector<struct target_therm_cfg> cliffs_common = {
1774 {
1775 TemperatureType::CPU,
1776 cpu_sensors_cliffs,
1777 "",
1778 95000,
1779 115000,
1780 true,
1781 },
1782 {
1783 TemperatureType::GPU,
1784 { "gpuss-0" },
1785 "GPU0",
1786 95000,
1787 115000,
1788 true,
1789 },
1790 {
1791 TemperatureType::GPU,
1792 { "gpuss-1" },
1793 "GPU1",
1794 95000,
1795 115000,
1796 true,
1797 },
1798 {
1799 TemperatureType::GPU,
1800 { "gpuss-2" },
1801 "GPU2",
1802 95000,
1803 115000,
1804 true,
1805 },
1806 {
1807 TemperatureType::GPU,
1808 { "gpuss-3" },
1809 "GPU3",
1810 95000,
1811 115000,
1812 true,
1813 },
1814 {
1815 TemperatureType::NPU,
1816 { "nsphvx-0" },
1817 "nsp0",
1818 100000,
1819 115000,
1820 true,
1821 },
1822 {
1823 TemperatureType::NPU,
1824 { "nsphvx-1" },
1825 "nsp1",
1826 100000,
1827 115000,
1828 true,
1829 },
1830 {
1831 TemperatureType::NPU,
1832 { "nsphmx-0" },
1833 "nsp2",
1834 100000,
1835 115000,
1836 true,
1837 },
1838 {
1839 TemperatureType::NPU,
1840 { "nsphmx-1" },
1841 "nsp3",
1842 100000,
1843 115000,
1844 true,
1845 },
1846 };
1847
1848 std::vector<struct target_therm_cfg> cliffs_specific = {
1849 {
1850 TemperatureType::SKIN,
1851 { "sys-therm-4" },
1852 "skin",
1853 60000,
1854 95000,
1855 true,
1856 },
1857 };
Nitesh Kumar30b30522023-11-21 13:23:59 +05301858
1859 std::vector<std::string> cpu_sensors_monaco = {
1860 "cpuss-0",
1861 "cpuss-0",
1862 "cpuss-0",
1863 "cpuss-0",
1864 "cpuss-1",
1865 "cpuss-1",
1866 "cpuss-1",
1867 "cpuss-1",
1868 };
1869
1870 std::vector<struct target_therm_cfg> sensor_cfg_monaco = {
1871 {
1872 TemperatureType::CPU,
1873 cpu_sensors_monaco,
1874 "",
1875 95000,
1876 115000,
1877 true,
1878 },
1879 {
1880 TemperatureType::GPU,
1881 { "gpu" },
1882 "gpu",
1883 95000,
1884 115000,
1885 true,
1886 },
1887 {
1888 TemperatureType::SKIN,
1889 { "pa-therm0" },
1890 "skin",
1891 40000,
1892 95000,
1893 true,
1894 },
1895 {
1896 TemperatureType::BCL_CURRENT,
1897 { "pm5100-ibat-lvl0" },
1898 "ibat",
1899 1100,
1900 1500,
1901 true,
1902 },
1903 };
1904
Nitesh Kumard667c792024-01-03 17:17:58 +05301905 std::vector<std::string> cpu_sensors_pitti =
1906 {
1907 "cpu-0-0",
1908 "cpu-0-1",
1909 "cpu-0-2",
1910 "cpu-0-3",
1911 "cpu-0-4",
1912 "cpu-0-5",
1913 "cpu-1-0",
1914 "cpu-2-0",
1915 };
1916
1917 std::vector<struct target_therm_cfg> sensor_cfg_pitti =
1918 {
1919 {
1920 TemperatureType::CPU,
1921 cpu_sensors_pitti,
1922 "",
1923 95000,
1924 115000,
1925 true,
1926 },
1927 {
1928 TemperatureType::GPU,
1929 { "gpuss" },
1930 "gpu",
1931 95000,
1932 115000,
1933 true,
1934 },
1935 };
1936
1937 std::vector<struct target_therm_cfg> pitti_specific = {
1938 {
Nitesh Kumard667c792024-01-03 17:17:58 +05301939 TemperatureType::SKIN,
1940 { "sys-therm-3" },
1941 "skin",
1942 40000,
1943 95000,
1944 true,
1945 },
1946 };
1947
Nitesh Kumara953a152024-03-07 16:35:01 +05301948 std::vector<std::string> cpu_sensors_niobe = {
Priyansh Jainafe95152024-01-24 08:27:39 +05301949 "cpu-0-0-0",
1950 "cpu-0-1-0",
1951 "cpu-1-0-0",
1952 "cpu-1-1-0",
1953 "cpu-1-2-0",
1954 "cpu-1-2-1",
1955 "cpu-1-3-0",
1956 "cpu-1-3-1",
1957 };
1958
1959 std::vector<struct target_therm_cfg> niobe_common = {
1960 {
1961 TemperatureType::CPU,
1962 cpu_sensors_niobe,
1963 "",
1964 95000,
1965 115000,
1966 true,
1967 },
1968 {
1969 TemperatureType::GPU,
1970 { "gpuss-0" },
1971 "GPU0",
1972 95000,
1973 115000,
1974 true,
1975 },
1976 {
1977 TemperatureType::GPU,
1978 { "gpuss-1" },
1979 "GPU1",
1980 95000,
1981 115000,
1982 true,
1983 },
1984 {
1985 TemperatureType::GPU,
1986 { "gpuss-2" },
1987 "GPU2",
1988 95000,
1989 115000,
1990 true,
1991 },
1992 {
1993 TemperatureType::GPU,
1994 { "gpuss-3" },
1995 "GPU3",
1996 95000,
1997 115000,
1998 true,
1999 },
2000 {
2001 TemperatureType::GPU,
2002 { "gpuss-4" },
2003 "GPU4",
2004 95000,
2005 115000,
2006 true,
2007 },
2008 {
2009 TemperatureType::GPU,
2010 { "gpuss-5" },
2011 "GPU5",
2012 95000,
2013 115000,
2014 true,
2015 },
2016 {
2017 TemperatureType::GPU,
2018 { "gpuss-6" },
2019 "GPU6",
2020 95000,
2021 115000,
2022 true,
2023 },
2024 {
2025 TemperatureType::GPU,
2026 { "gpuss-7" },
2027 "GPU7",
2028 95000,
2029 115000,
2030 true,
2031 },
2032 {
2033 TemperatureType::NPU,
2034 { "nsphvx-0" },
2035 "nsp0",
2036 95000,
2037 115000,
2038 true,
2039 },
2040 {
2041 TemperatureType::NPU,
2042 { "nsphvx-1" },
2043 "nsp1",
2044 95000,
2045 115000,
2046 true,
2047 },
2048 {
2049 TemperatureType::NPU,
2050 { "nsphmx-0" },
2051 "nsp2",
2052 95000,
2053 115000,
2054 true,
2055 },
2056 {
2057 TemperatureType::NPU,
2058 { "nsphmx-1" },
2059 "nsp3",
2060 95000,
2061 115000,
2062 true,
2063 },
2064 };
2065
2066 std::vector<struct target_therm_cfg> niobe_specific = {
2067 {
2068 TemperatureType::BCL_CURRENT,
2069 { "pm8550b-ibat-lvl0" },
2070 "ibat",
2071 7000,
2072 7500,
2073 true,
2074 },
2075 {
2076 TemperatureType::SKIN,
2077 { "sys-therm-0" },
2078 "skin",
2079 60000,
2080 95000,
2081 true,
2082 },
2083 };
2084
Nitesh Kumara953a152024-03-07 16:35:01 +05302085 std::vector<std::string> cpu_sensors_volcano = {
2086 "cpu-0-0-0",
2087 "cpu-0-1-0",
2088 "cpu-0-2-0",
2089 "cpu-1-0-0",
2090 "cpu-1-1-0",
2091 "cpu-1-2-0",
2092 "cpu-1-3-0",
2093 "cpu-1-3-1",
2094 };
2095
2096 std::vector<struct target_therm_cfg> volcano_common = {
2097 {
2098 TemperatureType::CPU,
2099 cpu_sensors_volcano,
2100 "",
2101 95000,
2102 115000,
2103 true,
2104 },
2105 {
2106 TemperatureType::GPU,
2107 { "gpuss-0" },
2108 "GPU0",
2109 95000,
2110 115000,
2111 true,
2112 },
2113 {
2114 TemperatureType::GPU,
2115 { "gpuss-1" },
2116 "GPU1",
2117 95000,
2118 115000,
2119 true,
2120 },
2121 {
2122 TemperatureType::NPU,
2123 { "nsphvx-0" },
2124 "nsp0",
2125 95000,
2126 115000,
2127 true,
2128 },
2129 {
2130 TemperatureType::NPU,
Nitesh Kumara953a152024-03-07 16:35:01 +05302131 { "nsphmx-0" },
2132 "nsp2",
2133 95000,
2134 115000,
2135 true,
2136 },
2137 {
2138 TemperatureType::NPU,
2139 { "nsphmx-1" },
2140 "nsp3",
2141 95000,
2142 115000,
2143 true,
2144 },
2145 };
2146
2147 std::vector<struct target_therm_cfg> volcano_specific = {
2148 {
2149 TemperatureType::SKIN,
2150 { "sys-therm-0" },
2151 "skin",
2152 60000,
2153 95000,
2154 true,
2155 },
2156 };
2157
Nitesh Kumar662a53b2024-05-09 22:36:40 +05302158 std::vector<std::string> cpu_sensors_anorak =
2159 {
2160 "cpu-0-0-0",
2161 "cpu-0-0-1",
2162 "cpu-0-1-0",
2163 "cpu-0-1-1",
2164 "cpu-1-0-0",
2165 "cpu-1-0-1",
2166 "cpu-1-1-0",
2167 "cpu-1-1-1",
2168 "cpu-1-2-0",
2169 "cpu-1-2-1",
2170 "cpu-1-3-0",
2171 "cpu-1-3-1",
2172 };
2173
2174 std::vector<struct target_therm_cfg> anorak_common = {
2175 {
2176 TemperatureType::CPU,
2177 cpu_sensors_anorak,
2178 "",
2179 95000,
2180 115000,
2181 true,
2182 },
2183 {
2184 TemperatureType::NPU,
2185 { "nspss-0" },
2186 "nsp0",
2187 95000,
2188 115000,
2189 true,
2190 },
2191 {
2192 TemperatureType::NPU,
2193 { "nspss-1" },
2194 "nsp1",
2195 95000,
2196 115000,
2197 true,
2198 },
2199 {
2200 TemperatureType::NPU,
2201 { "nspss-2" },
2202 "nsp2",
2203 95000,
2204 115000,
2205 true,
2206 },
2207 {
2208 TemperatureType::GPU,
2209 { "gpuss-0" },
2210 "GPU0",
2211 95000,
2212 115000,
2213 true,
2214 },
2215 {
2216 TemperatureType::GPU,
2217 { "gpuss-1" },
2218 "GPU1",
2219 95000,
2220 115000,
2221 true,
2222 },
2223 {
2224 TemperatureType::GPU,
2225 { "gpuss-2" },
2226 "GPU2",
2227 95000,
2228 115000,
2229 true,
2230 },
2231 {
2232 TemperatureType::GPU,
2233 { "gpuss-3" },
2234 "GPU3",
2235 95000,
2236 115000,
2237 true,
2238 },
2239 {
2240 TemperatureType::GPU,
2241 { "gpuss-4" },
2242 "GPU4",
2243 95000,
2244 115000,
2245 true,
2246 },
2247 {
2248 TemperatureType::GPU,
2249 { "gpuss-5" },
2250 "GPU5",
2251 95000,
2252 115000,
2253 true,
2254 },
2255 {
2256 TemperatureType::GPU,
2257 { "gpuss-6" },
2258 "GPU6",
2259 95000,
2260 115000,
2261 true,
2262 },
2263 {
2264 TemperatureType::GPU,
2265 { "gpuss-7" },
2266 "GPU7",
2267 95000,
2268 115000,
2269 true,
2270 },
2271 };
2272
2273 std::vector<struct target_therm_cfg> anorak_specific = {
2274 {
2275 TemperatureType::BCL_CURRENT,
2276 { "pm8550b-ibat-lvl0" },
2277 "ibat",
2278 9000,
2279 10000,
2280 true,
2281 },
2282 {
2283 TemperatureType::SKIN,
2284 { "sys-therm-0" },
2285 "skin",
2286 55000,
2287 95000,
2288 true,
2289 },
2290 };
2291
Priyansh Jainf06e0842022-10-10 10:34:27 +05302292 std::vector<std::string> cpu_sensors_ravelin =
2293 {
2294 "cpu-0-0",
2295 "cpu-0-1",
2296 "cpu-0-2",
2297 "cpu-0-3",
2298 "cpu-0-4",
2299 "cpu-0-5",
2300 "cpu-1-0",
2301 "cpu-1-2",
2302 };
2303
2304 std::vector<struct target_therm_cfg> ravelin_common = {
2305 {
2306 TemperatureType::CPU,
Minghao Zhangc6d2b272023-02-02 15:34:25 +08002307 cpu_sensors_ravelin,
Priyansh Jainf06e0842022-10-10 10:34:27 +05302308 "",
2309 95000,
2310 115000,
2311 true,
2312 },
2313 {
2314 TemperatureType::GPU,
2315 { "gpuss" },
2316 "GPU",
2317 95000,
2318 115000,
2319 true,
2320 },
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002321 {
2322 TemperatureType::SKIN,
2323 { "sys-therm-1" },
2324 "skin",
2325 55000,
2326 95000,
2327 true,
2328 },
Priyansh Jainf06e0842022-10-10 10:34:27 +05302329 };
2330
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002331 std::vector<struct target_therm_cfg> ravelin_specific_qrd = {
Priyansh Jainf06e0842022-10-10 10:34:27 +05302332 {
2333 TemperatureType::BCL_CURRENT,
Minghao Zhangc6d2b272023-02-02 15:34:25 +08002334 { "pmi632-ibat-lvl0" },
Priyansh Jainf06e0842022-10-10 10:34:27 +05302335 "ibat",
2336 6000,
2337 7500,
2338 true,
2339 },
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002340 };
2341
2342 std::vector<struct target_therm_cfg> ravelin_specific_idp = {
Priyansh Jainf06e0842022-10-10 10:34:27 +05302343 {
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002344 TemperatureType::BCL_CURRENT,
2345 { "pm7250b-ibat-lvl0" },
2346 "ibat",
2347 6000,
2348 7500,
Priyansh Jainf06e0842022-10-10 10:34:27 +05302349 true,
2350 },
2351 };
2352
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002353 const std::unordered_map<int, std::vector<struct target_therm_cfg>>
2354 msm_soc_map = {
Minghao Zhangf9d50a02021-04-12 18:29:50 +08002355 {353, sensor_cfg_439},
2356 {354, sensor_cfg_439},
2357 {363, sensor_cfg_439},
2358 {364, sensor_cfg_439},
2359 {416, sensor_cfg_439},
2360 {437, sensor_cfg_439},
Ankit Siddhapura786d6182023-08-02 10:18:49 +05302361 {349, sensor_cfg_sdm632},
Gopala Krishna Nuthakibcc1d012021-05-04 12:06:53 +05302362 {321, sensor_cfg_sdm845},
2363 {341, sensor_cfg_sdm845},
gnuthakidd79a2b2023-11-15 12:03:02 +05302364 {355, sensor_cfg_talos_common},
2365 {377, sensor_cfg_sa6155_common}, // auto
2366 {380, sensor_cfg_sa6155_common}, // auto
2367 {384, sensor_cfg_sa6155_common}, // auto
Minghao Zhang2658fa62020-12-28 10:16:45 +08002368 {417, sensor_cfg_bengal}, // bengal
2369 {420, sensor_cfg_bengal},
2370 {444, sensor_cfg_bengal},
2371 {445, sensor_cfg_bengal},
2372 {469, sensor_cfg_bengal},
2373 {470, sensor_cfg_bengal},
Priyansh Jain3388cdf2022-08-17 14:05:26 +05302374 {518, sensor_cfg_khaje}, //khaje
Manaf Meethalavalappu Pallikunhi003ee4a2022-12-02 15:58:00 +05302375 {561, sensor_cfg_khaje}, //khajeP
2376 {562, sensor_cfg_khaje}, //khajeQ
2377 {584, sensor_cfg_khaje}, //khajeXR
2378 {585, sensor_cfg_khaje}, //khajeG
2379 {586, sensor_cfg_khaje}, //khajeIOT
Minghao Zhangae04ce32020-09-23 23:28:34 +08002380 {394, sensor_cfg_trinket},
2381 {467, sensor_cfg_trinket},
2382 {468, sensor_cfg_trinket},
Edwin Moquete9b72a562022-04-16 20:04:36 +00002383 {317, sensor_cfg_sdm660},
Yumi Yukimura5e8ba832023-10-18 19:00:53 +08002384 {318, sensor_cfg_sdm660}, // sdm630
Edwin Moquete9b72a562022-04-16 20:04:36 +00002385 {345, sensor_cfg_sdm660}, // sdm636
Yumi Yukimura5e8ba832023-10-18 19:00:53 +08002386 {385, sensor_cfg_sdm660}, // sdm455
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002387 {400, sensor_cfg_lito}, // lito
2388 {440, sensor_cfg_lito},
2389 {407, sensor_cfg_lito}, // atoll
Minghao Zhangae04ce32020-09-23 23:28:34 +08002390 {365, sensor_cfg_sdmmagpie},
2391 {366, sensor_cfg_sdmmagpie},
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002392 {434, sensor_cfg_lito}, // lagoon
Minghao Zhang15c2bdc2021-01-14 14:51:25 +08002393 {435, sensor_cfg_lito},
2394 {459, sensor_cfg_lito},
Gopala Krishna Nuthakib99fef32020-09-09 14:26:32 +05302395 {476, sensor_cfg_lito}, // orchid
gnuthakidd79a2b2023-11-15 12:03:02 +05302396 {339, sensor_cfg_msmnile_common},
2397 {361, sensor_cfg_msmnile_common},
2398 {362, sensor_cfg_sa8155_common}, //auto
2399 {367, sensor_cfg_sa8155_common}, //auto
2400 {405, sensor_cfg_sa8195_common}, //auto
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002401 {356, kona_common}, // kona
Nitesh Kumara6747222023-06-20 13:11:31 +05302402 {481, kona_common}, //kona iot
2403 {548, kona_common}, //kona iot
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +05302404 {415, lahaina_common}, // lahaina
2405 {439, lahaina_common}, // lahainap
2406 {456, lahaina_common}, // lahaina-atp
Minghao Zhang31932a02021-03-08 10:58:11 +08002407 {501, lahaina_common},
2408 {502, lahaina_common},
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +05302409 {450, lahaina_common}, // shima
Manaf Meethalavalappu Pallikunhi8c2153e2020-09-04 00:46:47 +05302410 {454, sensor_cfg_holi}, // holi
Nitesh Kumar83759f12023-06-30 19:15:54 +05302411 {507, sensor_cfg_holi}, //blair
Nitesh Kumarf69dba32023-11-10 16:16:17 +05302412 {578, sensor_cfg_holi}, //conic
Gopala Krishna Nuthakie9208692021-01-18 15:51:39 +05302413 {475, sensor_cfg_yupik}, // yupik
Gopala Krishna Nuthaki15c1be22021-03-16 19:43:17 +05302414 {515, sensor_cfg_yupik}, // YUPIK-LTE
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07002415 {457, waipio_common}, //Waipio
2416 {482, waipio_common}, //Waipio
Gopala Krishna Nuthaki7ef40922022-01-11 18:41:45 +05302417 {552, waipio_common}, //Waipio-LTE
Priyansh Jaind670d792022-07-20 15:51:13 +05302418 {506, diwali_common}, //diwali
2419 {547, diwali_common}, //diwali
2420 {564, diwali_common}, //diwali-LTE
Priyansh Jain6af76952021-11-10 10:48:06 +05302421 {530, waipio_common}, // cape
2422 {531, waipio_common}, // cape
2423 {540, waipio_common}, // cape
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05302424 {519, kalama_common}, //Kalama
2425 {536, kalama_common}, //Kalamap
congying1d469b22022-09-05 18:17:39 +08002426 {600, kalama_common}, //Kalama_sg
2427 {601, kalama_common}, //Kalamap_sg
Bhasker Reddy Komatireddy4f9957a2023-01-10 14:52:42 +05302428 {603, kalama_common}, //Kalama_qcs
2429 {604, kalama_common}, //Kalama_qcm
Rashid Zafarc2584072023-01-11 12:15:32 -08002430 {557, pineapple_common}, //Pineapple
2431 {577, pineapple_common}, //Pineapplep
Priyansh Jaindaa7d592023-09-25 15:55:19 +05302432 {632, cliffs_common}, //cliffs
2433 {614, cliffs_common}, //cliffs7
Nitesh Kumar30b30522023-11-21 13:23:59 +05302434 {486, sensor_cfg_monaco}, // monaco
2435 {517, sensor_cfg_monaco}, // monaco
Nitesh Kumard667c792024-01-03 17:17:58 +05302436 {623, sensor_cfg_pitti}, // Kalpeni
Priyansh Jainafe95152024-01-24 08:27:39 +05302437 {629, niobe_common}, //Matrix
Priyansh Jainb38d8f32024-04-05 11:01:31 +05302438 {652, niobe_common}, // Matrix_4k
Nitesh Kumara953a152024-03-07 16:35:01 +05302439 {636, volcano_common}, //milos
2440 {640, volcano_common}, //milos6
Nitesh Kumaref6f1f32024-04-16 23:37:19 +05302441 {657, volcano_common}, //milos IOT with modem
2442 {658, volcano_common}, //milos IOT
Nitesh Kumar662a53b2024-05-09 22:36:40 +05302443 {549, anorak_common},
2444 {649, anorak_common}, // Halliday Pro
Priyansh Jain39782192022-03-09 10:10:43 +05302445 {525, neo_common},
2446 {554, neo_common},
Nitesh Kumar47e465c2023-01-11 06:14:16 +05302447 {537, parrot_common}, //Netrani mobile
2448 {583, parrot_common}, //Netrani mobile without modem
2449 {613, parrot_common}, //Netrani APQ
Priyansh Jain39391ad2023-07-31 09:56:19 +05302450 {631, parrot_common},
Priyansh Jainf06e0842022-10-10 10:34:27 +05302451 {568, ravelin_common}, //Clarence Mobile
2452 {581, ravelin_common}, //Clarence IOT
2453 {582, ravelin_common}, //Clarence IOT without modem
Minghao Zhang7423ed82023-01-16 15:29:30 +08002454 {591, waipio_common}, //ukee
Priyansh Jaina72f3822023-05-30 14:44:09 +05302455 {608, crow_common}, //crow
Nitesh Kumar52f0bdc2024-01-04 12:59:34 +05302456 {644, crow_common}, //crow 4G
Priyansh Jaincd32b812023-10-31 16:04:32 +05302457 {532, lemansAU_common}, //Lemans auto
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002458 };
2459
2460 const std::unordered_map<int, std::vector<struct target_therm_cfg>>
2461 msm_soc_specific = {
2462 {356, kona_specific}, // kona
Nitesh Kumara6747222023-06-20 13:11:31 +05302463 {481, kona_specific}, //kona iot
2464 {548, kona_specific}, //kona iot
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002465 {415, lahaina_specific}, // lahaina
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +05302466 {439, lahaina_specific}, // lahainap
2467 {456, lahaina_specific}, // lahaina-atp
Minghao Zhang31932a02021-03-08 10:58:11 +08002468 {501, lahaina_specific},
2469 {502, lahaina_specific},
Manaf Meethalavalappu Pallikunhi9dd647c2020-09-09 01:20:40 +05302470 {450, shima_specific}, // shima
Ram Chandrasekar8b04bc92021-04-06 13:24:53 -07002471 {457, waipio_specific}, //Waipio
2472 {482, waipio_specific}, //Waipio
Gopala Krishna Nuthaki7ef40922022-01-11 18:41:45 +05302473 {552, waipio_specific}, //Waipio-LTE
Priyansh Jaina26aeb42021-09-20 17:29:05 +05302474 {506, diwali_specific}, //diwali
Gopala Krishna Nuthakie7461532022-03-23 02:41:02 +05302475 {547, diwali_specific}, //diwali
2476 {564, diwali_specific}, //diwali-LTE
Priyansh Jain6af76952021-11-10 10:48:06 +05302477 {530, waipio_specific}, // cape
2478 {531, waipio_specific}, // cape
2479 {540, waipio_specific}, // cape
Manaf Meethalavalappu Pallikunhi88df48b2022-01-04 17:10:16 +05302480 {519, kalama_specific}, //Kalama
2481 {536, kalama_specific}, //Kalamap
congying1d469b22022-09-05 18:17:39 +08002482 {600, kalama_specific}, //Kalama_sg
2483 {601, kalama_specific}, //Kalamap_sg
Bhasker Reddy Komatireddy4f9957a2023-01-10 14:52:42 +05302484 {603, kalama_specific}, //Kalama_qcs
2485 {604, kalama_specific}, //Kalama_qcm
Rashid Zafare9219f72022-11-01 15:48:37 -07002486 {557, pineapple_specific}, //Pineapple
2487 {577, pineapple_specific}, //Pineapplep
Priyansh Jaindaa7d592023-09-25 15:55:19 +05302488 {632, cliffs_specific}, //cliffs
2489 {614, cliffs_specific}, //cliffs7
Nitesh Kumard667c792024-01-03 17:17:58 +05302490 {623, pitti_specific}, // Kalpeni
Priyansh Jainafe95152024-01-24 08:27:39 +05302491 {629, niobe_specific}, // Matrix
Priyansh Jainb38d8f32024-04-05 11:01:31 +05302492 {652, niobe_specific}, // Matrix_4k
Nitesh Kumara953a152024-03-07 16:35:01 +05302493 {636, volcano_specific}, //milos
2494 {640, volcano_specific}, //milos6
Nitesh Kumaref6f1f32024-04-16 23:37:19 +05302495 {657, volcano_specific}, //milos IOT with modem
2496 {658, volcano_specific}, //milos IOT
Nitesh Kumar662a53b2024-05-09 22:36:40 +05302497 {549, anorak_specific},
2498 {649, anorak_specific}, // Halliday Pro
Nitesh Kumar47e465c2023-01-11 06:14:16 +05302499 {537, parrot_specific}, //Netrani mobile
2500 {583, parrot_specific}, //Netrani mobile without modem
2501 {613, parrot_specific}, //Netrani APQ
Priyansh Jain39391ad2023-07-31 09:56:19 +05302502 {631, parrot_specific},
Minghao Zhang7423ed82023-01-16 15:29:30 +08002503 {591, waipio_specific}, //ukee
Priyansh Jaina72f3822023-05-30 14:44:09 +05302504 {608, crow_specific}, //crow
Nitesh Kumar52f0bdc2024-01-04 12:59:34 +05302505 {644, crow_specific}, //crow
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002506 };
2507
gnuthakidd79a2b2023-11-15 12:03:02 +05302508 const std::unordered_map<int, bool>
2509 battery_bcl_cfg_disable_map = {
2510 {377, true},
2511 {380, true},
2512 {384, true},
2513 {362, true},
2514 {367, true},
2515 {405, true},
2516 };
2517
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002518 const std::unordered_multimap<int, std::pair<std::string,
2519 std::vector<struct target_therm_cfg>>>
2520 msm_platform_specific = {
2521 {568, std::make_pair("QRD", ravelin_specific_qrd)},
2522 {568, std::make_pair("IDP", ravelin_specific_idp)},
2523 };
2524
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002525 std::vector<struct target_therm_cfg> add_target_config(
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002526 int socID, std::string hwPlatform,
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002527 std::vector<struct target_therm_cfg> conf)
2528 {
2529 std::vector<struct target_therm_cfg> targetConf;
2530
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002531 if (msm_soc_specific.find(socID) != msm_soc_specific.end()) {
2532 targetConf = (msm_soc_specific.find(socID))->second;
2533 conf.insert(conf.end(), targetConf.begin(),
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002534 targetConf.end());
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002535 }
2536
2537 auto range = msm_platform_specific.equal_range(socID);
2538 auto it = range.first;
2539 for (; it != range.second; ++it) {
2540 if (it->second.first != hwPlatform)
2541 continue;
2542
2543 targetConf = it->second.second;
2544 conf.insert(conf.end(), targetConf.begin(),
2545 targetConf.end());
2546 break;
2547 }
2548
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002549 return conf;
2550 }
2551
2552 ThermalConfig::ThermalConfig():cmnInst()
2553 {
2554 std::unordered_map<int, std::vector<struct target_therm_cfg>>::const_iterator it;
gnuthakidd79a2b2023-11-15 12:03:02 +05302555 std::unordered_map<int, bool>::const_iterator it_2;
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002556 std::vector<struct target_therm_cfg>::iterator it_vec;
2557 bool bcl_defined = false;
2558 std::string soc_val;
Ram Chandrasekar9e1b3262021-07-29 15:41:00 -07002559 int ct = 0;
2560 bool read_ok = false;
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002561
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002562 soc_id = 0;
Ram Chandrasekar9e1b3262021-07-29 15:41:00 -07002563 do {
2564 if (cmnInst.readFromFile(socIDPath, soc_val) <= 0) {
2565 LOG(ERROR) <<"soc ID fetch error";
2566 return;
2567 }
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002568
2569 if (cmnInst.readFromFile(hwPlatformPath, hw_platform) <= 0) {
2570 LOG(ERROR) <<"hw Platform fetch error";
2571 continue;
2572 }
2573
Ram Chandrasekar9e1b3262021-07-29 15:41:00 -07002574 try {
2575 soc_id = std::stoi(soc_val, nullptr, 0);
2576 read_ok = true;
2577 }
2578 catch (std::exception &err) {
2579 LOG(ERROR) <<"soc id stoi err:" << err.what()
2580 << " buf:" << soc_val;
2581 }
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002582 } while (ct++ && !read_ok && ct < RETRY_CT);
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002583 if (soc_id <= 0) {
2584 LOG(ERROR) << "Invalid soc ID: " << soc_id;
2585 return;
2586 }
2587 it = msm_soc_map.find(soc_id);
2588 if (it == msm_soc_map.end()) {
2589 LOG(ERROR) << "No config for soc ID: " << soc_id;
2590 return;
2591 }
Minghao Zhang0fc813b2023-06-06 14:46:06 +08002592 thermalConfig = add_target_config(soc_id, hw_platform, it->second);
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002593 for (it_vec = thermalConfig.begin();
2594 it_vec != thermalConfig.end(); it_vec++) {
2595 if (it_vec->type == TemperatureType::BCL_PERCENTAGE)
2596 bcl_defined = true;
2597 }
2598
gnuthakidd79a2b2023-11-15 12:03:02 +05302599 it_2 = battery_bcl_cfg_disable_map.find(soc_id);
2600 if (it_2 == battery_bcl_cfg_disable_map.end() || !it_2->second) {
2601 thermalConfig.push_back(bat_conf);
2602 if (!bcl_defined)
2603 thermalConfig.insert(thermalConfig.end(),
2604 bcl_conf.begin(), bcl_conf.end());
2605 }
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002606 LOG(DEBUG) << "Total sensors:" << thermalConfig.size();
2607 }
Bavyasritha Alahari0a344f42023-04-26 17:16:51 -07002608
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002609} // namespace thermal
2610} // namespace hardware
2611} // namespace android
Bavyasritha Alahari0a344f42023-04-26 17:16:51 -07002612} // namespace aidl
Ram Chandrasekardac8f7d2020-06-10 12:23:28 -07002613