Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,16 @@ properties:
description:
The SoC's thermal sensors, which the ACPM firmware reads on the
kernel's behalf. Cells are the sensor index (0 big, 1 mid, 2 little
CPU cluster, 3 GPU, 4 ISP, 5 TPU).
CPU cluster, 3 GPU, 4 ISP, 5 TPU, and on zumapro 6 AUR).
type: object
$ref: /schemas/thermal/thermal-sensor.yaml#
unevaluatedProperties: false

properties:
compatible:
const: google,gs101-acpm-tmu
enum:
- google,gs101-acpm-tmu
- google,zumapro-acpm-tmu

"#thermal-sensor-cells":
const: 1
Expand Down
5 changes: 3 additions & 2 deletions drivers/thermal/samsung/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ config EXYNOS_THERMAL
data from the supported SoCs.

config GS101_ACPM_THERMAL
tristate "Google gs101 thermal sensors through ACPM"
tristate "Google gs101 and Tensor G4 thermal sensors through ACPM"
depends on THERMAL_OF
depends on EXYNOS_ACPM_PROTOCOL
help
Expand All @@ -22,4 +22,5 @@ config GS101_ACPM_THERMAL
TMU channel. The driver only reads; the firmware's own hardware
trips stay as the bootloader left them.

Say Y or M here on Google gs101 (Pixel 6) devices.
Say Y or M here on Google gs101 (Pixel 6) and Tensor G4
(zumapro, Pixel 9a) devices.
19 changes: 15 additions & 4 deletions drivers/thermal/samsung/gs101_acpm_tmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@
#include <linux/platform_device.h>
#include <linux/thermal.h>

/* The sensors: BIG, MID, LITTLE, G3D, ISP, TPU */
#define GS101_ACPM_TMU_SENSORS 6
/*
* The sensors: BIG, MID, LITTLE, G3D, ISP, TPU, and on zumapro also AUR,
* in the firmware's order.
*/
#define GS101_ACPM_TMU_MAX_SENSORS 7

struct gs101_tmu_data {
unsigned int acpm_chan; /* ACPM channel of the TMU service */
unsigned int nr_sensors;
};

struct gs101_tmu;
Expand All @@ -33,7 +37,7 @@ struct gs101_tmu_sensor {
struct gs101_tmu {
struct acpm_handle *handle;
unsigned int acpm_chan;
struct gs101_tmu_sensor sensors[GS101_ACPM_TMU_SENSORS];
struct gs101_tmu_sensor sensors[GS101_ACPM_TMU_MAX_SENSORS];
};

static int gs101_tmu_get_temp(struct thermal_zone_device *tz, int *temp)
Expand Down Expand Up @@ -81,7 +85,7 @@ static int gs101_tmu_probe(struct platform_device *pdev)
if (ret)
return dev_err_probe(dev, ret, "ACPM TMU init failed\n");

for (i = 0; i < GS101_ACPM_TMU_SENSORS; i++) {
for (i = 0; i < data->nr_sensors; i++) {
tmu->sensors[i].tmu = tmu;
tmu->sensors[i].id = i;

Expand All @@ -103,10 +107,17 @@ static int gs101_tmu_probe(struct platform_device *pdev)

static const struct gs101_tmu_data gs101_tmu_data = {
.acpm_chan = 9,
.nr_sensors = 6,
};

static const struct gs101_tmu_data zumapro_tmu_data = {
.acpm_chan = 9,
.nr_sensors = 7,
};

static const struct of_device_id gs101_tmu_of_match[] = {
{ .compatible = "google,gs101-acpm-tmu", .data = &gs101_tmu_data },
{ .compatible = "google,zumapro-acpm-tmu", .data = &zumapro_tmu_data },
{ }
};
MODULE_DEVICE_TABLE(of, gs101_tmu_of_match);
Expand Down