Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH v4 0/7] Add Renesas RZ/G3L TSU support
@ 2026-09-25  6:15 Biju Das
  2026-09-25  6:15 ` [PATCH v4 1/7] dt-bindings: thermal: r9a08g045-tsu: Document RZ/G3L TSU Biju Das
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Biju Das @ 2026-09-25  6:15 UTC (permalink / raw)
  To: Claudiu Beznea, Rafael J. Wysocki, Daniel Lezcano,
	Jonathan Cameron, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm
  Cc: Biju Das, Zhang Rui, Lukasz Luba, linux-pm, devicetree, linux-iio,
	linux-renesas-soc, Chris Paterson, Biju Das,
	Prabhakar Mahadev Lad

The Thermal sensor unit (a.k.a TSU) IP found on the RZ/G3L SoC is similar
to the RZ/G3S, but it has different calibration constants. Moreover, the
TSU is connected to A/D converter of TSU (a.k.a ADC1) on the RZ/G3L,
whereas it is connected to ADC0 on the RZ/G3S.

Compared to ADC0, there are no A/D conversion result registers(ADCR0 to
ADCR7) on the RZ/G3L, and the INTEN bits in the A/D converter interrupt
control register(a.k.a ADINT)  are also different.

This patch series aims to add support for TSU along with ADC1.

Merge strategy:
  * patch #1-#3 thermal subsystem
  * patch #4-#6 iio subsystem
  * patch #7 SoC subsystem

v3->v4:
 * Dropped clk patch as it is accepted.
 * Collected tag.
 * Updated commit description for patch#5.
 * Updated kernel doc comment for max_channels.
v2->v3:
 * Collected tags
 * Dropped required property '#io-channel-cells' from bindings.
 * Renamed num_channels to max_channels in struct rzg2l_adc_hw_params
v1->v2:
 * Merged TSU and ADC1 series together.
 * Moved the clk patch.

Biju Das (7):
  dt-bindings: thermal: r9a08g045-tsu: Document RZ/G3L TSU
  thermal/drivers/renesas/rzg3s: Convert calibration defaults to per-SoC
    match data
  thermal/drivers/renesas/rzg3s: Add RZ/G3L TSU support
  dt-bindings: iio: adc: renesas,rzg2l-adc: Document RZ/G3L ADC for TSU
  iio: adc: rzg2l_adc: Rename num_channels to max_channels
  iio: adc: rzg2l_adc: Add RZ/G3L ADC support for TSU
  arm64: dts: renesas: r9a08g046: Enable TSU

 .../bindings/iio/adc/renesas,rzg2l-adc.yaml   | 17 ++++-
 .../thermal/renesas,r9a08g045-tsu.yaml        |  4 +-
 arch/arm64/boot/dts/renesas/r9a08g046.dtsi    | 66 +++++++++++++++++++
 drivers/iio/adc/rzg2l_adc.c                   | 29 +++++---
 drivers/thermal/renesas/rzg3s_thermal.c       | 38 ++++++++---
 5 files changed, 133 insertions(+), 21 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v4 1/7] dt-bindings: thermal: r9a08g045-tsu: Document RZ/G3L TSU
  2026-09-25  6:15 [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Biju Das
@ 2026-09-25  6:15 ` Biju Das
  2026-09-25  8:37   ` Claudiu Beznea
  2026-09-25  6:16 ` [PATCH v4 2/7] thermal/drivers/renesas/rzg3s: Convert calibration defaults to per-SoC match data Biju Das
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 13+ messages in thread
From: Biju Das @ 2026-09-25  6:15 UTC (permalink / raw)
  To: Claudiu Beznea, Rafael J. Wysocki, Daniel Lezcano,
	Jonathan Cameron, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm
  Cc: Biju Das, Zhang Rui, Lukasz Luba, linux-pm, devicetree, linux-iio,
	linux-renesas-soc, Chris Paterson, Biju Das,
	Prabhakar Mahadev Lad, Jonathan Cameron

Add the renesas,r9a08g046-tsu compatible string for the RZ/G3L Thermal
Sensor Unit (a.k.a TSU), which is similar to the RZ/G3S TSU but uses
different calibration constants. TSU is connected to a dedicated ADC IP
(a.k.a ADC1) on RZ/G3L.

Acked-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v3->v4:
 * No change.
v2->v3:
 * Collected tags
v1->v2:
 * Updated commit description.
---
 .../devicetree/bindings/thermal/renesas,r9a08g045-tsu.yaml    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/thermal/renesas,r9a08g045-tsu.yaml b/Documentation/devicetree/bindings/thermal/renesas,r9a08g045-tsu.yaml
index 573e2b9d3752..20fc1a8000e3 100644
--- a/Documentation/devicetree/bindings/thermal/renesas,r9a08g045-tsu.yaml
+++ b/Documentation/devicetree/bindings/thermal/renesas,r9a08g045-tsu.yaml
@@ -17,7 +17,9 @@ $ref: thermal-sensor.yaml#
 
 properties:
   compatible:
-    const: renesas,r9a08g045-tsu
+    enum:
+      - renesas,r9a08g045-tsu
+      - renesas,r9a08g046-tsu
 
   reg:
     maxItems: 1
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v4 2/7] thermal/drivers/renesas/rzg3s: Convert calibration defaults to per-SoC match data
  2026-09-25  6:15 [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Biju Das
  2026-09-25  6:15 ` [PATCH v4 1/7] dt-bindings: thermal: r9a08g045-tsu: Document RZ/G3L TSU Biju Das
@ 2026-09-25  6:16 ` Biju Das
  2026-09-25  8:37   ` Claudiu Beznea
  2026-09-25  6:16 ` [PATCH v4 3/7] thermal/drivers/renesas/rzg3s: Add RZ/G3L TSU support Biju Das
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 13+ messages in thread
From: Biju Das @ 2026-09-25  6:16 UTC (permalink / raw)
  To: Claudiu Beznea, Rafael J. Wysocki, Daniel Lezcano,
	Jonathan Cameron, Geert Uytterhoeven, Magnus Damm
  Cc: Biju Das, Zhang Rui, Lukasz Luba, linux-pm, linux-iio,
	linux-renesas-soc, Chris Paterson, Biju Das,
	Prabhakar Mahadev Lad, Jonathan Cameron

Move the default (software) calibration values SW_CALIB0_VAL and
SW_CALIB1_VAL, used when FUSE values are missing, into a new
struct rzg3s_thermal_info retrieved via of_device_get_match_data().

This allows different SoCs sharing this driver to provide their own
default calibration constants, which is needed as RZ/G3L uses
different values than RZ/G3S.

No functional change intended for RZ/G3S.

Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v3->v4:
 * No Change.
v2->v3:
 * Collected tag
v1->v2:
 * No Change.
---
 drivers/thermal/renesas/rzg3s_thermal.c | 32 ++++++++++++++++++-------
 1 file changed, 23 insertions(+), 9 deletions(-)

diff --git a/drivers/thermal/renesas/rzg3s_thermal.c b/drivers/thermal/renesas/rzg3s_thermal.c
index 7ced8f76a0ec..146b73a1b751 100644
--- a/drivers/thermal/renesas/rzg3s_thermal.c
+++ b/drivers/thermal/renesas/rzg3s_thermal.c
@@ -12,6 +12,7 @@
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
+#include <linux/property.h>
 #include <linux/reset.h>
 #include <linux/thermal.h>
 #include <linux/units.h>
@@ -27,10 +28,6 @@
 
 #define TSU_READ_STEPS		8
 
-/* Default calibration values, if FUSE values are missing. */
-#define SW_CALIB0_VAL		1297
-#define SW_CALIB1_VAL		751
-
 #define MCELSIUS(temp)		((temp) * MILLIDEGREE_PER_DEGREE)
 
 /**
@@ -55,6 +52,16 @@ struct rzg3s_thermal_priv {
 	u16 calib1;
 };
 
+/**
+ * struct rzg3s_thermal_info - RZ/G3S thermal information
+ * @calib0: calibration value if FUSE value is missing
+ * @calib1: calibration value if FUSE value is missing
+ */
+struct rzg3s_thermal_info {
+	u16 calib0;
+	u16 calib1;
+};
+
 static int rzg3s_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
 {
 	struct rzg3s_thermal_priv *priv = thermal_zone_device_priv(tz);
@@ -149,7 +156,8 @@ static const struct thermal_zone_device_ops rzg3s_tz_of_ops = {
 	.change_mode = rzg3s_thermal_change_mode,
 };
 
-static int rzg3s_thermal_read_calib(struct rzg3s_thermal_priv *priv)
+static int rzg3s_thermal_read_calib(struct rzg3s_thermal_priv *priv,
+				    const struct rzg3s_thermal_info *info)
 {
 	struct device *dev = priv->dev;
 	u32 val;
@@ -163,13 +171,13 @@ static int rzg3s_thermal_read_calib(struct rzg3s_thermal_priv *priv)
 	if (val & OTPTSUTRIM_EN_MASK)
 		priv->calib0 = FIELD_GET(OTPTSUTRIM_MASK, val);
 	else
-		priv->calib0 = SW_CALIB0_VAL;
+		priv->calib0 = info->calib0;
 
 	val = readl(priv->base + OTPTSUTRIM_REG(1));
 	if (val & OTPTSUTRIM_EN_MASK)
 		priv->calib1 = FIELD_GET(OTPTSUTRIM_MASK, val);
 	else
-		priv->calib1 = SW_CALIB1_VAL;
+		priv->calib1 = info->calib1;
 
 	pm_runtime_put_autosuspend(dev);
 
@@ -178,6 +186,7 @@ static int rzg3s_thermal_read_calib(struct rzg3s_thermal_priv *priv)
 
 static int rzg3s_thermal_probe(struct platform_device *pdev)
 {
+	const struct rzg3s_thermal_info *info = device_get_match_data(&pdev->dev);
 	struct rzg3s_thermal_priv *priv;
 	struct device *dev = &pdev->dev;
 	int ret;
@@ -208,7 +217,7 @@ static int rzg3s_thermal_probe(struct platform_device *pdev)
 	if (ret)
 		return dev_err_probe(dev, ret, "Failed to enable runtime PM!\n");
 
-	ret = rzg3s_thermal_read_calib(priv);
+	ret = rzg3s_thermal_read_calib(priv, info);
 	if (ret)
 		return dev_err_probe(dev, ret, "Failed to read calibration data!\n");
 
@@ -251,8 +260,13 @@ static const struct dev_pm_ops rzg3s_thermal_pm_ops = {
 	SYSTEM_SLEEP_PM_OPS(rzg3s_thermal_suspend, rzg3s_thermal_resume)
 };
 
+static const struct rzg3s_thermal_info rzg3s_info = {
+	.calib0 = 1297,
+	.calib1 = 751,
+};
+
 static const struct of_device_id rzg3s_thermal_dt_ids[] = {
-	{ .compatible = "renesas,r9a08g045-tsu" },
+	{ .compatible = "renesas,r9a08g045-tsu", .data = &rzg3s_info },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, rzg3s_thermal_dt_ids);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v4 3/7] thermal/drivers/renesas/rzg3s: Add RZ/G3L TSU support
  2026-09-25  6:15 [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Biju Das
  2026-09-25  6:15 ` [PATCH v4 1/7] dt-bindings: thermal: r9a08g045-tsu: Document RZ/G3L TSU Biju Das
  2026-09-25  6:16 ` [PATCH v4 2/7] thermal/drivers/renesas/rzg3s: Convert calibration defaults to per-SoC match data Biju Das
@ 2026-09-25  6:16 ` Biju Das
  2026-09-25  8:37   ` Claudiu Beznea
  2026-09-25  6:16 ` [PATCH v4 4/7] dt-bindings: iio: adc: renesas,rzg2l-adc: Document RZ/G3L ADC for TSU Biju Das
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 13+ messages in thread
From: Biju Das @ 2026-09-25  6:16 UTC (permalink / raw)
  To: Claudiu Beznea, Rafael J. Wysocki, Daniel Lezcano,
	Jonathan Cameron, Geert Uytterhoeven, Magnus Damm
  Cc: Biju Das, Zhang Rui, Lukasz Luba, linux-pm, linux-iio,
	linux-renesas-soc, Chris Paterson, Biju Das,
	Prabhakar Mahadev Lad

Add the renesas,r9a08g046-tsu compatible string and its default
(software) calibration constants for RZ/G3L, used when FUSE
calibration values are missing.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v3->v4:
 * No change.
v2->v3:
 * No change.
v1->v2:
 * No change.
---
 drivers/thermal/renesas/rzg3s_thermal.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/thermal/renesas/rzg3s_thermal.c b/drivers/thermal/renesas/rzg3s_thermal.c
index 146b73a1b751..a8716da7fcd2 100644
--- a/drivers/thermal/renesas/rzg3s_thermal.c
+++ b/drivers/thermal/renesas/rzg3s_thermal.c
@@ -265,8 +265,14 @@ static const struct rzg3s_thermal_info rzg3s_info = {
 	.calib1 = 751,
 };
 
+static const struct rzg3s_thermal_info rzg3l_info = {
+	.calib0 = 1322,
+	.calib1 = 772,
+};
+
 static const struct of_device_id rzg3s_thermal_dt_ids[] = {
 	{ .compatible = "renesas,r9a08g045-tsu", .data = &rzg3s_info },
+	{ .compatible = "renesas,r9a08g046-tsu", .data = &rzg3l_info },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, rzg3s_thermal_dt_ids);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v4 4/7] dt-bindings: iio: adc: renesas,rzg2l-adc: Document RZ/G3L ADC for TSU
  2026-09-25  6:15 [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Biju Das
                   ` (2 preceding siblings ...)
  2026-09-25  6:16 ` [PATCH v4 3/7] thermal/drivers/renesas/rzg3s: Add RZ/G3L TSU support Biju Das
@ 2026-09-25  6:16 ` Biju Das
  2026-09-25  6:16 ` [PATCH v4 5/7] iio: adc: rzg2l_adc: Rename num_channels to max_channels Biju Das
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Biju Das @ 2026-09-25  6:16 UTC (permalink / raw)
  To: Lad Prabhakar, Jonathan Cameron, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Rafael J. Wysocki, Daniel Lezcano,
	Geert Uytterhoeven, Magnus Damm
  Cc: Biju Das, David Lechner, Nuno Sá, Andy Shevchenko,
	Claudiu Beznea, linux-pm, linux-iio, linux-renesas-soc,
	devicetree, Chris Paterson, Biju Das

Add the renesas,r9a08g046-adc1 compatible string for the ADC1
instance on RZ/G3L, which is dedicated to the on-chip TSU (thermal
sensor unit). Unlike the other ADC instances, this one only exposes
a single channel (channel@8), so restrict the allowed channel nodes
accordingly.

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v3->v4:
 * Kept Rb tag from Rob[1]
[1] https://lore.kernel.org/all/TY3PR01MB11346568D44110BCA1CDD146D86802@TY3PR01MB11346.jpnprd01.prod.outlook.com/
v2->v3:
 * Dropped required property '#io-channel-cells'.
v1->v2:
 * No Change.
---
 .../bindings/iio/adc/renesas,rzg2l-adc.yaml     | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml b/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
index 40341d541726..f08f5439d127 100644
--- a/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
@@ -25,7 +25,9 @@ properties:
               - renesas,r9a07g054-adc   # RZ/V2L
           - const: renesas,rzg2l-adc
       - items:
-          - const: renesas,r9a08g045-adc  # RZ/G3S
+          - enum:
+              - renesas,r9a08g045-adc   # RZ/G3S
+              - renesas,r9a08g046-adc1  # RZ/G3L ADC for TSU
 
   reg:
     maxItems: 1
@@ -121,6 +123,19 @@ allOf:
             reg:
               maximum: 7
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: renesas,r9a08g046-adc1
+    then:
+      patternProperties:
+        "^channel@[0-7]$": false
+        "^channel@[8]$":
+          properties:
+            reg:
+              const: 8
+
 additionalProperties: false
 
 examples:
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v4 5/7] iio: adc: rzg2l_adc: Rename num_channels to max_channels
  2026-09-25  6:15 [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Biju Das
                   ` (3 preceding siblings ...)
  2026-09-25  6:16 ` [PATCH v4 4/7] dt-bindings: iio: adc: renesas,rzg2l-adc: Document RZ/G3L ADC for TSU Biju Das
@ 2026-09-25  6:16 ` Biju Das
  2026-09-25  6:16 ` [PATCH v4 6/7] iio: adc: rzg2l_adc: Add RZ/G3L ADC support for TSU Biju Das
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Biju Das @ 2026-09-25  6:16 UTC (permalink / raw)
  To: Lad Prabhakar, Jonathan Cameron, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Rafael J. Wysocki, Daniel Lezcano,
	Geert Uytterhoeven, Magnus Damm
  Cc: Biju Das, David Lechner, Nuno Sá, Andy Shevchenko,
	Claudiu Beznea, linux-iio, linux-renesas-soc, linux-pm,
	devicetree, Chris Paterson, Biju Das

Rename the num_channels member of struct rzg2l_adc_hw_params to
max_channels, as it represents the maximum number of channels
supported by the ADC hardware rather than a count of channels
currently in use.

No functional change intended.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v3->v4:
 * Updated commit description.
 * Updated kernel doc comment for max_channels.
v3:
 * New patch.
---
 drivers/iio/adc/rzg2l_adc.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/iio/adc/rzg2l_adc.c b/drivers/iio/adc/rzg2l_adc.c
index 408fbf8c29cc..19b8f1a546a2 100644
--- a/drivers/iio/adc/rzg2l_adc.c
+++ b/drivers/iio/adc/rzg2l_adc.c
@@ -62,7 +62,7 @@
  * @adsmp_mask: ADC sampling period mask (see ADM3 register)
  * @adint_inten_mask: conversion end interrupt mask (see ADINT register)
  * @default_adcmp: default ADC cmp (see ADM3 register)
- * @num_channels: number of supported channels
+ * @max_channels: maximum number of channels
  * @adivc: specifies if ADVIC register is available
  */
 struct rzg2l_adc_hw_params {
@@ -70,7 +70,7 @@ struct rzg2l_adc_hw_params {
 	u16 adsmp_mask;
 	u16 adint_inten_mask;
 	u8 default_adcmp;
-	u8 num_channels;
+	u8 max_channels;
 	bool adivc;
 };
 
@@ -196,7 +196,7 @@ static int rzg2l_adc_conversion_setup(struct rzg2l_adc *adc, u8 ch)
 
 	/* Select analog input channel subjected to conversion. */
 	reg = rzg2l_adc_readl(adc, RZG2L_ADM(2));
-	reg &= ~GENMASK(hw_params->num_channels - 1, 0);
+	reg &= ~GENMASK(hw_params->max_channels - 1, 0);
 	reg |= BIT(ch);
 	rzg2l_adc_writel(adc, RZG2L_ADM(2), reg);
 
@@ -307,11 +307,11 @@ static irqreturn_t rzg2l_adc_isr(int irq, void *dev_id)
 		return IRQ_HANDLED;
 	}
 
-	intst = reg & GENMASK(hw_params->num_channels - 1, 0);
+	intst = reg & GENMASK(hw_params->max_channels - 1, 0);
 	if (!intst)
 		return IRQ_NONE;
 
-	for_each_set_bit(ch, &intst, hw_params->num_channels)
+	for_each_set_bit(ch, &intst, hw_params->max_channels)
 		adc->last_val[ch] = rzg2l_adc_readl(adc, RZG2L_ADCR(ch)) & RZG2L_ADCR_AD_MASK;
 
 	/* clear the channel interrupt */
@@ -341,12 +341,12 @@ static int rzg2l_adc_parse_properties(struct platform_device *pdev, struct rzg2l
 
 	num_channels = devm_iio_adc_device_alloc_chaninfo_se(&pdev->dev,
 						&rzg2l_adc_chan_template,
-						hw_params->num_channels - 1,
+						hw_params->max_channels - 1,
 						&chan_array);
 	if (num_channels < 0)
 		return num_channels;
 
-	if (num_channels > hw_params->num_channels)
+	if (num_channels > hw_params->max_channels)
 		return dev_err_probe(&pdev->dev, -EINVAL,
 				     "num of channel children out of range\n");
 
@@ -429,7 +429,7 @@ static int rzg2l_adc_probe(struct platform_device *pdev)
 	adc = iio_priv(indio_dev);
 
 	adc->hw_params = device_get_match_data(dev);
-	if (!adc->hw_params || adc->hw_params->num_channels > RZG2L_ADC_MAX_CHANNELS)
+	if (!adc->hw_params || adc->hw_params->max_channels > RZG2L_ADC_MAX_CHANNELS)
 		return -EINVAL;
 
 	ret = rzg2l_adc_parse_properties(pdev, adc);
@@ -484,7 +484,7 @@ static int rzg2l_adc_probe(struct platform_device *pdev)
 }
 
 static const struct rzg2l_adc_hw_params rzg2l_hw_params = {
-	.num_channels = 8,
+	.max_channels = 8,
 	.default_adcmp = 0xe,
 	.default_adsmp = { 0x578 },
 	.adsmp_mask = GENMASK(15, 0),
@@ -493,7 +493,7 @@ static const struct rzg2l_adc_hw_params rzg2l_hw_params = {
 };
 
 static const struct rzg2l_adc_hw_params rzg3s_hw_params = {
-	.num_channels = 9,
+	.max_channels = 9,
 	.default_adcmp = 0x1d,
 	.default_adsmp = { 0x7f, 0xff },
 	.adsmp_mask = GENMASK(7, 0),
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v4 6/7] iio: adc: rzg2l_adc: Add RZ/G3L ADC support for TSU
  2026-09-25  6:15 [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Biju Das
                   ` (4 preceding siblings ...)
  2026-09-25  6:16 ` [PATCH v4 5/7] iio: adc: rzg2l_adc: Rename num_channels to max_channels Biju Das
@ 2026-09-25  6:16 ` Biju Das
  2026-09-25  6:16 ` [PATCH v4 7/7] arm64: dts: renesas: r9a08g046: Enable TSU Biju Das
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Biju Das @ 2026-09-25  6:16 UTC (permalink / raw)
  To: Lad Prabhakar, Jonathan Cameron, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Rafael J. Wysocki, Daniel Lezcano,
	Geert Uytterhoeven, Magnus Damm
  Cc: Biju Das, David Lechner, Nuno Sá, Andy Shevchenko,
	Claudiu Beznea, linux-iio, linux-renesas-soc, linux-pm,
	devicetree, Chris Paterson, Biju Das

Add renesas,r9a08g046-adc1 compatible string and its hardware
parameters for the ADC1 IP on RZ/G3L, which is dedicated to
the on-chip TSU (thermal sensor unit).

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v3->v4:
 * No Change.
v2->v3:
 * No Change.
v1->v2:
 * No Change.
---
 drivers/iio/adc/rzg2l_adc.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/iio/adc/rzg2l_adc.c b/drivers/iio/adc/rzg2l_adc.c
index 19b8f1a546a2..3b95f47445a8 100644
--- a/drivers/iio/adc/rzg2l_adc.c
+++ b/drivers/iio/adc/rzg2l_adc.c
@@ -500,8 +500,17 @@ static const struct rzg2l_adc_hw_params rzg3s_hw_params = {
 	.adint_inten_mask = GENMASK(11, 0),
 };
 
+static const struct rzg2l_adc_hw_params rzg3l_adc1_hw_params = {
+	.max_channels = 9,
+	.default_adcmp = 0x1d,
+	.default_adsmp = { 0x7f, 0xff },
+	.adsmp_mask = GENMASK(7, 0),
+	.adint_inten_mask = BIT(8),
+};
+
 static const struct of_device_id rzg2l_adc_match[] = {
 	{ .compatible = "renesas,r9a08g045-adc", .data = &rzg3s_hw_params },
+	{ .compatible = "renesas,r9a08g046-adc1", .data = &rzg3l_adc1_hw_params },
 	{ .compatible = "renesas,rzg2l-adc", .data = &rzg2l_hw_params },
 	{ }
 };
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v4 7/7] arm64: dts: renesas: r9a08g046: Enable TSU
  2026-09-25  6:15 [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Biju Das
                   ` (5 preceding siblings ...)
  2026-09-25  6:16 ` [PATCH v4 6/7] iio: adc: rzg2l_adc: Add RZ/G3L ADC support for TSU Biju Das
@ 2026-09-25  6:16 ` Biju Das
  2026-09-27 18:22 ` [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Jonathan Cameron
  2026-09-27 21:02 ` Daniel Lezcano
  8 siblings, 0 replies; 13+ messages in thread
From: Biju Das @ 2026-09-25  6:16 UTC (permalink / raw)
  To: Geert Uytterhoeven, Magnus Damm, Rafael J. Wysocki,
	Daniel Lezcano, Jonathan Cameron, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: Biju Das, linux-renesas-soc, devicetree, linux-iio, linux-pm,
	Chris Paterson, Biju Das, Prabhakar Mahadev Lad

Add #cooling-cells to the CPU nodes, and describe the ADC1 (used
exclusively by the TSU) and TSU nodes along with a CPU thermal zone
using passive and critical trip points, with CPU frequency cooling
maps for thermal mitigation.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v3->v4:
 * No Change.
v2->v3:
 * No Change.
v1->v2:
 * No Change.
---
 arch/arm64/boot/dts/renesas/r9a08g046.dtsi | 66 ++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r9a08g046.dtsi b/arch/arm64/boot/dts/renesas/r9a08g046.dtsi
index f33d5d7468ff..35046c7dac54 100644
--- a/arch/arm64/boot/dts/renesas/r9a08g046.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a08g046.dtsi
@@ -179,6 +179,7 @@ cpu0: cpu@0 {
 			next-level-cache = <&L3_CA55>;
 			enable-method = "psci";
 			clocks = <&cpg CPG_CORE R9A08G046_CLK_IC0>;
+			#cooling-cells = <2>;
 			operating-points-v2 = <&cluster0_opp>;
 		};
 
@@ -189,6 +190,7 @@ cpu1: cpu@100 {
 			next-level-cache = <&L3_CA55>;
 			enable-method = "psci";
 			clocks = <&cpg CPG_CORE R9A08G046_CLK_IC1>;
+			#cooling-cells = <2>;
 			operating-points-v2 = <&cluster0_opp>;
 		};
 
@@ -199,6 +201,7 @@ cpu2: cpu@200 {
 			next-level-cache = <&L3_CA55>;
 			enable-method = "psci";
 			clocks = <&cpg CPG_CORE R9A08G046_CLK_IC2>;
+			#cooling-cells = <2>;
 			operating-points-v2 = <&cluster0_opp>;
 		};
 
@@ -209,6 +212,7 @@ cpu3: cpu@300 {
 			next-level-cache = <&L3_CA55>;
 			enable-method = "psci";
 			clocks = <&cpg CPG_CORE R9A08G046_CLK_IC3>;
+			#cooling-cells = <2>;
 			operating-points-v2 = <&cluster0_opp>;
 		};
 
@@ -374,6 +378,37 @@ scif5: serial@1004e000 {
 			status = "disabled";
 		};
 
+		adc1: adc@108c0000 {
+			compatible = "renesas,r9a08g046-adc1";
+			reg = <0 0x108c0000 0 0x10000>;
+			interrupts = <GIC_SPI 378 IRQ_TYPE_EDGE_RISING>;
+			clocks = <&cpg CPG_MOD R9A08G046_ADC1_ADCLK>,
+				 <&cpg CPG_MOD R9A08G046_ADC1_PCLK>;
+			clock-names = "adclk", "pclk";
+			resets = <&cpg R9A08G046_ADC1_PRESETN>,
+				 <&cpg R9A08G046_ADC1_ADRST_N>;
+			reset-names = "presetn", "adrst-n";
+			power-domains = <&cpg>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			#io-channel-cells = <1>;
+
+			channel@8 {
+				reg = <8>;
+			};
+		};
+
+		tsu: thermal@108d0000 {
+			compatible = "renesas,r9a08g046-tsu";
+			reg = <0 0x108d0000 0 0x10000>;
+			clocks = <&cpg CPG_MOD R9A08G046_TSU_PCLK>;
+			resets = <&cpg R9A08G046_TSU_PRESETN>;
+			power-domains = <&cpg>;
+			#thermal-sensor-cells = <0>;
+			io-channels = <&adc1 0>;
+			io-channel-names = "tsu";
+		};
+
 		i2c0: i2c@100ae000 {
 			compatible = "renesas,riic-r9a08g046", "renesas,riic-r9a09g057";
 			reg = <0 0x100ae000 0 0x400>;
@@ -1382,6 +1417,37 @@ stmmac_axi_setup: stmmac-axi-config {
 		snps,blen = <16 8 4 0 0 0 0>;
 	};
 
+	thermal-zones {
+		cpu-thermal {
+			polling-delay = <1000>;
+			polling-delay-passive = <250>;
+			thermal-sensors = <&tsu>;
+
+			cooling-maps {
+				map0 {
+					trip = <&target>;
+					cooling-device = <&cpu0 0 3>, <&cpu1 0 3>,
+							 <&cpu2 0 3>, <&cpu3 0 3>;
+					contribution = <1024>;
+				};
+			};
+
+			trips {
+				sensor_crit: sensor-crit {
+					temperature = <120000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+
+				target: trip-point {
+					temperature = <95000>;
+					hysteresis = <1000>;
+					type = "passive";
+				};
+			};
+		};
+	};
+
 	timer {
 		compatible = "arm,armv8-timer";
 		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v4 3/7] thermal/drivers/renesas/rzg3s: Add RZ/G3L TSU support
  2026-09-25  6:16 ` [PATCH v4 3/7] thermal/drivers/renesas/rzg3s: Add RZ/G3L TSU support Biju Das
@ 2026-09-25  8:37   ` Claudiu Beznea
  0 siblings, 0 replies; 13+ messages in thread
From: Claudiu Beznea @ 2026-09-25  8:37 UTC (permalink / raw)
  To: Biju Das, Claudiu Beznea, Rafael J. Wysocki, Daniel Lezcano,
	Jonathan Cameron, Geert Uytterhoeven, Magnus Damm
  Cc: Zhang Rui, Lukasz Luba, linux-pm, linux-iio, linux-renesas-soc,
	Chris Paterson, Biju Das, Prabhakar Mahadev Lad



On 9/25/26 09:16, Biju Das wrote:
> Add the renesas,r9a08g046-tsu compatible string and its default
> (software) calibration constants for RZ/G3L, used when FUSE
> calibration values are missing.
> 
> Signed-off-by: Biju Das<biju.das.jz@bp.renesas.com>

Reviewed-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v4 2/7] thermal/drivers/renesas/rzg3s: Convert calibration defaults to per-SoC match data
  2026-09-25  6:16 ` [PATCH v4 2/7] thermal/drivers/renesas/rzg3s: Convert calibration defaults to per-SoC match data Biju Das
@ 2026-09-25  8:37   ` Claudiu Beznea
  0 siblings, 0 replies; 13+ messages in thread
From: Claudiu Beznea @ 2026-09-25  8:37 UTC (permalink / raw)
  To: Biju Das, Claudiu Beznea, Rafael J. Wysocki, Daniel Lezcano,
	Jonathan Cameron, Geert Uytterhoeven, Magnus Damm
  Cc: Zhang Rui, Lukasz Luba, linux-pm, linux-iio, linux-renesas-soc,
	Chris Paterson, Biju Das, Prabhakar Mahadev Lad, Jonathan Cameron



On 9/25/26 09:16, Biju Das wrote:
> Move the default (software) calibration values SW_CALIB0_VAL and
> SW_CALIB1_VAL, used when FUSE values are missing, into a new
> struct rzg3s_thermal_info retrieved via of_device_get_match_data().
> 
> This allows different SoCs sharing this driver to provide their own
> default calibration constants, which is needed as RZ/G3L uses
> different values than RZ/G3S.
> 
> No functional change intended for RZ/G3S.
> 
> Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v4 1/7] dt-bindings: thermal: r9a08g045-tsu: Document RZ/G3L TSU
  2026-09-25  6:15 ` [PATCH v4 1/7] dt-bindings: thermal: r9a08g045-tsu: Document RZ/G3L TSU Biju Das
@ 2026-09-25  8:37   ` Claudiu Beznea
  0 siblings, 0 replies; 13+ messages in thread
From: Claudiu Beznea @ 2026-09-25  8:37 UTC (permalink / raw)
  To: Biju Das, Claudiu Beznea, Rafael J. Wysocki, Daniel Lezcano,
	Jonathan Cameron, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm
  Cc: Zhang Rui, Lukasz Luba, linux-pm, devicetree, linux-iio,
	linux-renesas-soc, Chris Paterson, Biju Das,
	Prabhakar Mahadev Lad, Jonathan Cameron



On 9/25/26 09:15, Biju Das wrote:
> Add the renesas,r9a08g046-tsu compatible string for the RZ/G3L Thermal
> Sensor Unit (a.k.a TSU), which is similar to the RZ/G3S TSU but uses
> different calibration constants. TSU is connected to a dedicated ADC IP
> (a.k.a ADC1) on RZ/G3L.
> 
> Acked-by: Rob Herring (Arm) <robh@kernel.org>
> Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v4 0/7] Add Renesas RZ/G3L TSU support
  2026-09-25  6:15 [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Biju Das
                   ` (6 preceding siblings ...)
  2026-09-25  6:16 ` [PATCH v4 7/7] arm64: dts: renesas: r9a08g046: Enable TSU Biju Das
@ 2026-09-27 18:22 ` Jonathan Cameron
  2026-09-27 21:02 ` Daniel Lezcano
  8 siblings, 0 replies; 13+ messages in thread
From: Jonathan Cameron @ 2026-09-27 18:22 UTC (permalink / raw)
  To: Biju Das
  Cc: Claudiu Beznea, Rafael J. Wysocki, Daniel Lezcano, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
	Magnus Damm, Zhang Rui, Lukasz Luba, linux-pm, devicetree,
	linux-iio, linux-renesas-soc, Chris Paterson, Biju Das,
	Prabhakar Mahadev Lad

On Fri, 25 Sep 2026 07:15:58 +0100
Biju Das <biju.das.jz@bp.renesas.com> wrote:

> The Thermal sensor unit (a.k.a TSU) IP found on the RZ/G3L SoC is similar
> to the RZ/G3S, but it has different calibration constants. Moreover, the
> TSU is connected to A/D converter of TSU (a.k.a ADC1) on the RZ/G3L,
> whereas it is connected to ADC0 on the RZ/G3S.
> 
> Compared to ADC0, there are no A/D conversion result registers(ADCR0 to
> ADCR7) on the RZ/G3L, and the INTEN bits in the A/D converter interrupt
> control register(a.k.a ADINT)  are also different.
> 
> This patch series aims to add support for TSU along with ADC1.
> 
> Merge strategy:
>   * patch #1-#3 thermal subsystem
>   * patch #4-#6 iio subsystem
Applied these to the testing branch of iio.git.  That will show
up in linux-next once 0-day has taken a first look at it.

Thanks,

Jonathan

>   * patch #7 SoC subsystem
> 
> v3->v4:
>  * Dropped clk patch as it is accepted.
>  * Collected tag.
>  * Updated commit description for patch#5.
>  * Updated kernel doc comment for max_channels.
> v2->v3:
>  * Collected tags
>  * Dropped required property '#io-channel-cells' from bindings.
>  * Renamed num_channels to max_channels in struct rzg2l_adc_hw_params
> v1->v2:
>  * Merged TSU and ADC1 series together.
>  * Moved the clk patch.
> 
> Biju Das (7):
>   dt-bindings: thermal: r9a08g045-tsu: Document RZ/G3L TSU
>   thermal/drivers/renesas/rzg3s: Convert calibration defaults to per-SoC
>     match data
>   thermal/drivers/renesas/rzg3s: Add RZ/G3L TSU support
>   dt-bindings: iio: adc: renesas,rzg2l-adc: Document RZ/G3L ADC for TSU
>   iio: adc: rzg2l_adc: Rename num_channels to max_channels
>   iio: adc: rzg2l_adc: Add RZ/G3L ADC support for TSU
>   arm64: dts: renesas: r9a08g046: Enable TSU
> 
>  .../bindings/iio/adc/renesas,rzg2l-adc.yaml   | 17 ++++-
>  .../thermal/renesas,r9a08g045-tsu.yaml        |  4 +-
>  arch/arm64/boot/dts/renesas/r9a08g046.dtsi    | 66 +++++++++++++++++++
>  drivers/iio/adc/rzg2l_adc.c                   | 29 +++++---
>  drivers/thermal/renesas/rzg3s_thermal.c       | 38 ++++++++---
>  5 files changed, 133 insertions(+), 21 deletions(-)
> 


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v4 0/7] Add Renesas RZ/G3L TSU support
  2026-09-25  6:15 [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Biju Das
                   ` (7 preceding siblings ...)
  2026-09-27 18:22 ` [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Jonathan Cameron
@ 2026-09-27 21:02 ` Daniel Lezcano
  8 siblings, 0 replies; 13+ messages in thread
From: Daniel Lezcano @ 2026-09-27 21:02 UTC (permalink / raw)
  To: Biju Das, Claudiu Beznea, Rafael J. Wysocki, Daniel Lezcano,
	Jonathan Cameron, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm
  Cc: Zhang Rui, Lukasz Luba, linux-pm, devicetree, linux-iio,
	linux-renesas-soc, Chris Paterson, Biju Das,
	Prabhakar Mahadev Lad

On 9/25/26 08:15, Biju Das wrote:
> The Thermal sensor unit (a.k.a TSU) IP found on the RZ/G3L SoC is similar
> to the RZ/G3S, but it has different calibration constants. Moreover, the
> TSU is connected to A/D converter of TSU (a.k.a ADC1) on the RZ/G3L,
> whereas it is connected to ADC0 on the RZ/G3S.
> 
> Compared to ADC0, there are no A/D conversion result registers(ADCR0 to
> ADCR7) on the RZ/G3L, and the INTEN bits in the A/D converter interrupt
> control register(a.k.a ADINT)  are also different.
> 
> This patch series aims to add support for TSU along with ADC1.
> 
> Merge strategy:
>    * patch #1-#3 thermal subsystem

Applied, thanks


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-09-27 21:02 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-25  6:15 [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Biju Das
2026-09-25  6:15 ` [PATCH v4 1/7] dt-bindings: thermal: r9a08g045-tsu: Document RZ/G3L TSU Biju Das
2026-09-25  8:37   ` Claudiu Beznea
2026-09-25  6:16 ` [PATCH v4 2/7] thermal/drivers/renesas/rzg3s: Convert calibration defaults to per-SoC match data Biju Das
2026-09-25  8:37   ` Claudiu Beznea
2026-09-25  6:16 ` [PATCH v4 3/7] thermal/drivers/renesas/rzg3s: Add RZ/G3L TSU support Biju Das
2026-09-25  8:37   ` Claudiu Beznea
2026-09-25  6:16 ` [PATCH v4 4/7] dt-bindings: iio: adc: renesas,rzg2l-adc: Document RZ/G3L ADC for TSU Biju Das
2026-09-25  6:16 ` [PATCH v4 5/7] iio: adc: rzg2l_adc: Rename num_channels to max_channels Biju Das
2026-09-25  6:16 ` [PATCH v4 6/7] iio: adc: rzg2l_adc: Add RZ/G3L ADC support for TSU Biju Das
2026-09-25  6:16 ` [PATCH v4 7/7] arm64: dts: renesas: r9a08g046: Enable TSU Biju Das
2026-09-27 18:22 ` [PATCH v4 0/7] Add Renesas RZ/G3L TSU support Jonathan Cameron
2026-09-27 21:02 ` Daniel Lezcano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox