Skip to content

Commit 5f90660

Browse files
Daniel LangeDaniel Lange
authored andcommitted
Merge branch 'support_snapdragon_8cx' of treibholz/htop
Closes #1590
2 parents 04e0a7c + b6a916e commit 5f90660

1 file changed

Lines changed: 22 additions & 6 deletions

File tree

linux/LibSensors.c

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,15 @@ static int tempDriverPriority(const sensors_chip_name* chip) {
149149
{ "bigcore2_thermal", 0 },
150150
/* Rockchip RK3566 */
151151
{ "soc_thermal", 0 },
152+
/* Snapdragon 8cx */
153+
{ "cpu0_thermal", 0 },
154+
{ "cpu1_thermal", 0 },
155+
{ "cpu2_thermal", 0 },
156+
{ "cpu3_thermal", 0 },
157+
{ "cpu4_thermal", 0 },
158+
{ "cpu5_thermal", 0 },
159+
{ "cpu6_thermal", 0 },
160+
{ "cpu7_thermal", 0 },
152161
/* Low priority drivers */
153162
{ "acpitz", 1 },
154163
};
@@ -252,13 +261,20 @@ void LibSensors_getCPUTemperatures(CPUData* cpus, unsigned int existingCPUs, uns
252261
if (r != 0)
253262
continue;
254263

255-
/* Map temperature values to Rockchip cores
256-
*
257-
* littlecore -> cores 1..4
258-
* bigcore0 -> cores 5,6
259-
* bigcore1 -> cores 7,8
260-
*/
261264
if (existingCPUs == 8) {
265+
/* Map temperature values to Snapdragon 8cx cores */
266+
if (String_startsWith(chip->prefix, "cpu") && chip->prefix[3] >= '0' && chip->prefix[3] <= '7' && String_eq(chip->prefix + 4, "_thermal")) {
267+
data[1 + chip->prefix[3] - '0'] = temp;
268+
coreTempCount++;
269+
continue;
270+
}
271+
272+
/* Map temperature values to Rockchip cores
273+
*
274+
* littlecore -> cores 1..4
275+
* bigcore0 -> cores 5,6
276+
* bigcore1 -> cores 7,8
277+
*/
262278
if (String_eq(chip->prefix, "littlecore_thermal")) {
263279
data[1] = temp;
264280
data[2] = temp;

0 commit comments

Comments
 (0)