Skip to content

Commit

Permalink
initial support for Snapdragon 8cx
Browse files Browse the repository at this point in the history
Probably also works for other Snapdragons.

Co-authored-by: Benny Baumann <[email protected]>
  • Loading branch information
treibholz and BenBE committed Jan 18, 2025
1 parent 4e6a781 commit b6a916e
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions linux/LibSensors.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,15 @@ static int tempDriverPriority(const sensors_chip_name* chip) {
{ "bigcore2_thermal", 0 },
/* Rockchip RK3566 */
{ "soc_thermal", 0 },
/* Snapdragon 8cx */
{ "cpu0_thermal", 0 },
{ "cpu1_thermal", 0 },
{ "cpu2_thermal", 0 },
{ "cpu3_thermal", 0 },
{ "cpu4_thermal", 0 },
{ "cpu5_thermal", 0 },
{ "cpu6_thermal", 0 },
{ "cpu7_thermal", 0 },
/* Low priority drivers */
{ "acpitz", 1 },
};
Expand Down Expand Up @@ -215,13 +224,20 @@ void LibSensors_getCPUTemperatures(CPUData* cpus, unsigned int existingCPUs, uns
if (r != 0)
continue;

/* Map temperature values to Rockchip cores
*
* littlecore -> cores 1..4
* bigcore0 -> cores 5,6
* bigcore1 -> cores 7,8
*/
if (existingCPUs == 8) {
/* Map temperature values to Snapdragon 8cx cores */
if (String_startsWith(chip->prefix, "cpu") && chip->prefix[3] >= '0' && chip->prefix[3] <= '7' && String_eq(chip->prefix + 4, "_thermal")) {
data[1 + chip->prefix[3] - '0'] = temp;
coreTempCount++;
continue;
}

/* Map temperature values to Rockchip cores
*
* littlecore -> cores 1..4
* bigcore0 -> cores 5,6
* bigcore1 -> cores 7,8
*/
if (String_eq(chip->prefix, "littlecore_thermal")) {
data[1] = temp;
data[2] = temp;
Expand Down

0 comments on commit b6a916e

Please sign in to comment.