Skip to content

Commit b6a916e

Browse files
treibholzBenBE
andcommitted
initial support for Snapdragon 8cx
Probably also works for other Snapdragons. Co-authored-by: Benny Baumann <BenBE@geshi.org>
1 parent 4e6a781 commit b6a916e

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
@@ -145,6 +145,15 @@ static int tempDriverPriority(const sensors_chip_name* chip) {
145145
{ "bigcore2_thermal", 0 },
146146
/* Rockchip RK3566 */
147147
{ "soc_thermal", 0 },
148+
/* Snapdragon 8cx */
149+
{ "cpu0_thermal", 0 },
150+
{ "cpu1_thermal", 0 },
151+
{ "cpu2_thermal", 0 },
152+
{ "cpu3_thermal", 0 },
153+
{ "cpu4_thermal", 0 },
154+
{ "cpu5_thermal", 0 },
155+
{ "cpu6_thermal", 0 },
156+
{ "cpu7_thermal", 0 },
148157
/* Low priority drivers */
149158
{ "acpitz", 1 },
150159
};
@@ -215,13 +224,20 @@ void LibSensors_getCPUTemperatures(CPUData* cpus, unsigned int existingCPUs, uns
215224
if (r != 0)
216225
continue;
217226

218-
/* Map temperature values to Rockchip cores
219-
*
220-
* littlecore -> cores 1..4
221-
* bigcore0 -> cores 5,6
222-
* bigcore1 -> cores 7,8
223-
*/
224227
if (existingCPUs == 8) {
228+
/* Map temperature values to Snapdragon 8cx cores */
229+
if (String_startsWith(chip->prefix, "cpu") && chip->prefix[3] >= '0' && chip->prefix[3] <= '7' && String_eq(chip->prefix + 4, "_thermal")) {
230+
data[1 + chip->prefix[3] - '0'] = temp;
231+
coreTempCount++;
232+
continue;
233+
}
234+
235+
/* Map temperature values to Rockchip cores
236+
*
237+
* littlecore -> cores 1..4
238+
* bigcore0 -> cores 5,6
239+
* bigcore1 -> cores 7,8
240+
*/
225241
if (String_eq(chip->prefix, "littlecore_thermal")) {
226242
data[1] = temp;
227243
data[2] = temp;

0 commit comments

Comments
 (0)