All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFT v3 0/3] thermal: add support for r8a77995
@ 2018-04-03 12:43 Yoshihiro Kaneko
  2018-04-03 12:43 ` [PATCH/RFT v3 1/3] thermal: rcar_thermal: add r8a77995 support Yoshihiro Kaneko
                   ` (4 more replies)
  0 siblings, 5 replies; 20+ messages in thread
From: Yoshihiro Kaneko @ 2018-04-03 12:43 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Zhang Rui, Eduardo Valentin, Rob Herring, linux-pm, devicetree

This series adds thermal support for r8a77995.
R-Car D3 (r8a77995) have a thermal sensor module which is similar to Gen2.
Therefore this series adds r8a77995 support to rcar_thermal driver not
rcar_gen3_thermal driver.

This series is based on the next branch of Zhang Rui's linux tree.

v3 [Yoshihiro Kaneko]
* As suggested by Geert Uytterhoeven
rcar_thermal.c:
- make use_of_thermal in structure rcar_thermal_chip a single bit
- add feature bits to rcar_thermal_chip
- add the number of interrupts to rcar_thermal_chip
- remove rcar_thermal_type in rcar_thermal_cip
- make variable chip in rcar_thermal_probe() a const

rcar-thermal.txt:
* No change

r8a77995.dtsi:
* No change


v2 [Yoshihiro Kaneko]
* As suggested by Geert Uytterhoeven
rcar_thermal.c:
- remove rcar_of_data macro
- store a pointer to rcar_thermal_chip in rcar_thermal_priv
- remove unnecessary cast in rcar_thermal_dt_ids

rcar-thermal.txt:
- drop the fallback for D3
- update the paragraph about interrupts

r8a77995.dtsi:
- fix the base address and the register addresses
- drop the fallback

Yoshihiro Kaneko (3):
  thermal: rcar_thermal: add r8a77995 support
  dt-bindings: thermal: rcar-thermal: add R8A77995 support
  arm64: dts: renesas: r8a77995: add thermal device support

 .../devicetree/bindings/thermal/rcar-thermal.txt   |   7 +-
 arch/arm64/boot/dts/renesas/r8a77995.dtsi          |  30 ++++
 drivers/thermal/rcar_thermal.c                     | 154 ++++++++++++++++-----
 3 files changed, 157 insertions(+), 34 deletions(-)

-- 
1.9.1

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

* [PATCH/RFT v3 1/3] thermal: rcar_thermal: add r8a77995 support
  2018-04-03 12:43 [PATCH/RFT v3 0/3] thermal: add support for r8a77995 Yoshihiro Kaneko
@ 2018-04-03 12:43 ` Yoshihiro Kaneko
  2018-05-09 18:11   ` Simon Horman
  2018-04-03 12:43 ` [PATCH/RFT v3 2/3] dt-bindings: thermal: rcar-thermal: add R8A77995 support Yoshihiro Kaneko
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 20+ messages in thread
From: Yoshihiro Kaneko @ 2018-04-03 12:43 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Zhang Rui, Eduardo Valentin, Rob Herring, linux-pm, devicetree

Add support for R-Car D3 (r8a77995) thermal sensor.

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
---
 drivers/thermal/rcar_thermal.c | 154 ++++++++++++++++++++++++++++++++---------
 1 file changed, 122 insertions(+), 32 deletions(-)

diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index 73e5fee..5ec47a9 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -58,10 +58,43 @@ struct rcar_thermal_common {
 	spinlock_t lock;
 };
 
+struct rcar_thermal_chip {
+	unsigned int use_of_thermal : 1;
+	unsigned int has_filonoff : 1;
+	unsigned int irq_per_ch : 1;
+	unsigned int needs_suspend_resume : 1;
+	unsigned int nirqs;
+};
+
+static const struct rcar_thermal_chip rcar_thermal = {
+	.use_of_thermal = 0,
+	.has_filonoff = 1,
+	.irq_per_ch = 0,
+	.needs_suspend_resume = 0,
+	.nirqs = 1,
+};
+
+static const struct rcar_thermal_chip rcar_gen2_thermal = {
+	.use_of_thermal = 1,
+	.has_filonoff = 1,
+	.irq_per_ch = 0,
+	.needs_suspend_resume = 0,
+	.nirqs = 1,
+};
+
+static const struct rcar_thermal_chip rcar_gen3_thermal = {
+	.use_of_thermal = 1,
+	.has_filonoff = 0,
+	.irq_per_ch = 1,
+	.needs_suspend_resume = 1,
+	.nirqs = 2,
+};
+
 struct rcar_thermal_priv {
 	void __iomem *base;
 	struct rcar_thermal_common *common;
 	struct thermal_zone_device *zone;
+	const struct rcar_thermal_chip *chip;
 	struct delayed_work work;
 	struct mutex lock;
 	struct list_head list;
@@ -77,13 +110,20 @@ struct rcar_thermal_priv {
 #define rcar_priv_to_dev(priv)		((priv)->common->dev)
 #define rcar_has_irq_support(priv)	((priv)->common->base)
 #define rcar_id_to_shift(priv)		((priv)->id * 8)
-#define rcar_of_data(dev)		((unsigned long)of_device_get_match_data(dev))
-#define rcar_use_of_thermal(dev)	(rcar_of_data(dev) == USE_OF_THERMAL)
 
-#define USE_OF_THERMAL	1
 static const struct of_device_id rcar_thermal_dt_ids[] = {
-	{ .compatible = "renesas,rcar-thermal", },
-	{ .compatible = "renesas,rcar-gen2-thermal", .data = (void *)USE_OF_THERMAL },
+	{
+		.compatible = "renesas,rcar-thermal",
+		.data = &rcar_thermal,
+	},
+	{
+		.compatible = "renesas,rcar-gen2-thermal",
+		 .data = &rcar_gen2_thermal,
+	},
+	{
+		.compatible = "renesas,thermal-r8a77995",
+		.data = &rcar_gen3_thermal,
+	},
 	{},
 };
 MODULE_DEVICE_TABLE(of, rcar_thermal_dt_ids);
@@ -190,7 +230,8 @@ static int rcar_thermal_update_temp(struct rcar_thermal_priv *priv)
 	 * enable IRQ
 	 */
 	if (rcar_has_irq_support(priv)) {
-		rcar_thermal_write(priv, FILONOFF, 0);
+		if (priv->chip->has_filonoff)
+			rcar_thermal_write(priv, FILONOFF, 0);
 
 		/* enable Rising/Falling edge interrupt */
 		rcar_thermal_write(priv, POSNEG,  0x1);
@@ -420,7 +461,7 @@ static int rcar_thermal_remove(struct platform_device *pdev)
 
 	rcar_thermal_for_each_priv(priv, common) {
 		rcar_thermal_irq_disable(priv);
-		if (rcar_use_of_thermal(dev))
+		if (priv->chip->use_of_thermal)
 			thermal_remove_hwmon_sysfs(priv->zone);
 		else
 			thermal_zone_device_unregister(priv->zone);
@@ -438,6 +479,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 	struct rcar_thermal_priv *priv;
 	struct device *dev = &pdev->dev;
 	struct resource *res, *irq;
+	const struct rcar_thermal_chip *chip = of_device_get_match_data(dev);
 	int mres = 0;
 	int i;
 	int ret = -ENODEV;
@@ -457,19 +499,35 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 	pm_runtime_enable(dev);
 	pm_runtime_get_sync(dev);
 
-	irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (irq) {
-		/*
-		 * platform has IRQ support.
-		 * Then, driver uses common registers
-		 * rcar_has_irq_support() will be enabled
-		 */
-		res = platform_get_resource(pdev, IORESOURCE_MEM, mres++);
-		common->base = devm_ioremap_resource(dev, res);
-		if (IS_ERR(common->base))
-			return PTR_ERR(common->base);
+	for (i = 0; i < chip->nirqs; i++) {
+		irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+		if (!irq)
+			continue;
+		if (!common->base) {
+			/*
+			 * platform has IRQ support.
+			 * Then, driver uses common registers
+			 * rcar_has_irq_support() will be enabled
+			 */
+			res = platform_get_resource(pdev, IORESOURCE_MEM,
+						    mres++);
+			common->base = devm_ioremap_resource(dev, res);
+			if (IS_ERR(common->base))
+				return PTR_ERR(common->base);
+
+			idle = 0; /* polling delay is not needed */
+		}
+
+		ret = devm_request_irq(dev, irq->start, rcar_thermal_irq,
+				       IRQF_SHARED, dev_name(dev), common);
+		if (ret) {
+			dev_err(dev, "irq request failed\n ");
+			goto error_unregister;
+		}
 
-		idle = 0; /* polling delay is not needed */
+		/* update ENR bits */
+		if (chip->irq_per_ch)
+			enr_bits |= 1 << i;
 	}
 
 	for (i = 0;; i++) {
@@ -491,6 +549,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 
 		priv->common = common;
 		priv->id = i;
+		priv->chip = chip;
 		mutex_init(&priv->lock);
 		INIT_LIST_HEAD(&priv->list);
 		INIT_DELAYED_WORK(&priv->work, rcar_thermal_work);
@@ -498,7 +557,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 		if (ret < 0)
 			goto error_unregister;
 
-		if (rcar_use_of_thermal(dev))
+		if (chip->use_of_thermal)
 			priv->zone = devm_thermal_zone_of_sensor_register(
 						dev, i, priv,
 						&rcar_thermal_zone_of_ops);
@@ -515,7 +574,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 			goto error_unregister;
 		}
 
-		if (rcar_use_of_thermal(dev)) {
+		if (chip->use_of_thermal) {
 			/*
 			 * thermal_zone doesn't enable hwmon as default,
 			 * but, enable it here to keep compatible
@@ -531,20 +590,12 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 		list_move_tail(&priv->list, &common->head);
 
 		/* update ENR bits */
-		enr_bits |= 3 << (i * 8);
+		if (!chip->irq_per_ch)
+			enr_bits |= 3 << (i * 8);
 	}
 
-	/* enable temperature comparation */
-	if (irq) {
-		ret = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0,
-				       dev_name(dev), common);
-		if (ret) {
-			dev_err(dev, "irq request failed\n ");
-			goto error_unregister;
-		}
-
+	if (enr_bits)
 		rcar_thermal_common_write(common, ENR, enr_bits);
-	}
 
 	dev_info(dev, "%d sensor probed\n", i);
 
@@ -556,9 +607,48 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 	return ret;
 }
 
+#ifdef CONFIG_PM_SLEEP
+static int rcar_thermal_suspend(struct device *dev)
+{
+	struct rcar_thermal_common *common = dev_get_drvdata(dev);
+	struct rcar_thermal_priv *priv = list_first_entry(&common->head,
+							  typeof(*priv), list);
+
+	if (priv->chip->needs_suspend_resume) {
+		rcar_thermal_common_write(common, ENR, 0);
+		rcar_thermal_irq_disable(priv);
+		rcar_thermal_bset(priv, THSCR, CPCTL, 0);
+	}
+
+	return 0;
+}
+
+static int rcar_thermal_resume(struct device *dev)
+{
+	struct rcar_thermal_common *common = dev_get_drvdata(dev);
+	struct rcar_thermal_priv *priv = list_first_entry(&common->head,
+							  typeof(*priv), list);
+	int ret;
+
+	if (priv->chip->needs_suspend_resume) {
+		ret = rcar_thermal_update_temp(priv);
+		if (ret < 0)
+			return ret;
+		rcar_thermal_irq_enable(priv);
+		rcar_thermal_common_write(common, ENR, 0x03);
+	}
+
+	return 0;
+}
+#endif
+
+static SIMPLE_DEV_PM_OPS(rcar_thermal_pm_ops, rcar_thermal_suspend,
+			 rcar_thermal_resume);
+
 static struct platform_driver rcar_thermal_driver = {
 	.driver	= {
 		.name	= "rcar_thermal",
+		.pm = &rcar_thermal_pm_ops,
 		.of_match_table = rcar_thermal_dt_ids,
 	},
 	.probe		= rcar_thermal_probe,
-- 
1.9.1

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

* [PATCH/RFT v3 2/3] dt-bindings: thermal: rcar-thermal: add R8A77995 support
  2018-04-03 12:43 [PATCH/RFT v3 0/3] thermal: add support for r8a77995 Yoshihiro Kaneko
  2018-04-03 12:43 ` [PATCH/RFT v3 1/3] thermal: rcar_thermal: add r8a77995 support Yoshihiro Kaneko
@ 2018-04-03 12:43 ` Yoshihiro Kaneko
  2018-04-09 21:21   ` Rob Herring
  2018-04-03 12:43 ` [PATCH/RFT v3 3/3] arm64: dts: renesas: r8a77995: add thermal device support Yoshihiro Kaneko
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 20+ messages in thread
From: Yoshihiro Kaneko @ 2018-04-03 12:43 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Zhang Rui, Eduardo Valentin, Rob Herring, linux-pm, devicetree

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 Documentation/devicetree/bindings/thermal/rcar-thermal.txt | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/thermal/rcar-thermal.txt b/Documentation/devicetree/bindings/thermal/rcar-thermal.txt
index 349e635..5ab5fcd 100644
--- a/Documentation/devicetree/bindings/thermal/rcar-thermal.txt
+++ b/Documentation/devicetree/bindings/thermal/rcar-thermal.txt
@@ -3,7 +3,8 @@
 Required properties:
 - compatible		: "renesas,thermal-<soctype>",
 			   "renesas,rcar-gen2-thermal" (with thermal-zone) or
-			   "renesas,rcar-thermal" (without thermal-zone) as fallback.
+			   "renesas,rcar-thermal" (without thermal-zone) as
+                           fallback except R-Car D3.
 			  Examples with soctypes are:
 			    - "renesas,thermal-r8a73a4" (R-Mobile APE6)
 			    - "renesas,thermal-r8a7743" (RZ/G1M)
@@ -12,13 +13,15 @@ Required properties:
 			    - "renesas,thermal-r8a7791" (R-Car M2-W)
 			    - "renesas,thermal-r8a7792" (R-Car V2H)
 			    - "renesas,thermal-r8a7793" (R-Car M2-N)
+			    - "renesas,thermal-r8a77995" (R-Car D3)
 - reg			: Address range of the thermal registers.
 			  The 1st reg will be recognized as common register
 			  if it has "interrupts".
 
 Option properties:
 
-- interrupts		: use interrupt
+- interrupts		: use interrupt.
+                          Should contain 3 interrupts for R-Car D3.
 
 Example (non interrupt support):
 
-- 
1.9.1

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

* [PATCH/RFT v3 3/3] arm64: dts: renesas: r8a77995: add thermal device support
  2018-04-03 12:43 [PATCH/RFT v3 0/3] thermal: add support for r8a77995 Yoshihiro Kaneko
  2018-04-03 12:43 ` [PATCH/RFT v3 1/3] thermal: rcar_thermal: add r8a77995 support Yoshihiro Kaneko
  2018-04-03 12:43 ` [PATCH/RFT v3 2/3] dt-bindings: thermal: rcar-thermal: add R8A77995 support Yoshihiro Kaneko
@ 2018-04-03 12:43 ` Yoshihiro Kaneko
  2018-04-11  8:12 ` [PATCH/RFT v3 0/3] thermal: add support for r8a77995 jacopo mondi
  2018-04-11  9:01 ` jacopo mondi
  4 siblings, 0 replies; 20+ messages in thread
From: Yoshihiro Kaneko @ 2018-04-03 12:43 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Zhang Rui, Eduardo Valentin, Rob Herring, linux-pm, devicetree

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm64/boot/dts/renesas/r8a77995.dtsi | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a77995.dtsi b/arch/arm64/boot/dts/renesas/r8a77995.dtsi
index cff42cd..9a52b41 100644
--- a/arch/arm64/boot/dts/renesas/r8a77995.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77995.dtsi
@@ -636,5 +636,35 @@
 			#phy-cells = <0>;
 			status = "disabled";
 		};
+
+		thermal: thermal@e6190000 {
+			compatible = "renesas,thermal-r8a77995";
+			reg = <0 0xe6190000 0 0x10>, <0 0xe6190100 0 0x38>;
+			interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 522>;
+			power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
+			resets = <&cpg 522>;
+			#thermal-sensor-cells = <0>;
+		};
+	};
+
+	thermal-zones {
+		cpu_thermal: cpu-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+			thermal-sensors = <&thermal>;
+
+			trips {
+				cpu-crit {
+					temperature = <120000>;
+					hysteresis = <2000>;
+					type = "critical";
+				};
+			};
+			cooling-maps {
+			};
+		};
 	};
 };
-- 
1.9.1

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

* Re: [PATCH/RFT v3 2/3] dt-bindings: thermal: rcar-thermal: add R8A77995 support
  2018-04-03 12:43 ` [PATCH/RFT v3 2/3] dt-bindings: thermal: rcar-thermal: add R8A77995 support Yoshihiro Kaneko
@ 2018-04-09 21:21   ` Rob Herring
  2018-05-09 18:09     ` Simon Horman
  0 siblings, 1 reply; 20+ messages in thread
From: Rob Herring @ 2018-04-09 21:21 UTC (permalink / raw)
  To: Yoshihiro Kaneko
  Cc: linux-renesas-soc, Zhang Rui, Eduardo Valentin, linux-pm, devicetree

On Tue, Apr 03, 2018 at 09:43:04PM +0900, Yoshihiro Kaneko wrote:
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
>  Documentation/devicetree/bindings/thermal/rcar-thermal.txt | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/thermal/rcar-thermal.txt b/Documentation/devicetree/bindings/thermal/rcar-thermal.txt
> index 349e635..5ab5fcd 100644
> --- a/Documentation/devicetree/bindings/thermal/rcar-thermal.txt
> +++ b/Documentation/devicetree/bindings/thermal/rcar-thermal.txt
> @@ -3,7 +3,8 @@
>  Required properties:
>  - compatible		: "renesas,thermal-<soctype>",
>  			   "renesas,rcar-gen2-thermal" (with thermal-zone) or
> -			   "renesas,rcar-thermal" (without thermal-zone) as fallback.
> +			   "renesas,rcar-thermal" (without thermal-zone) as
> +                           fallback except R-Car D3.
>  			  Examples with soctypes are:
>  			    - "renesas,thermal-r8a73a4" (R-Mobile APE6)
>  			    - "renesas,thermal-r8a7743" (RZ/G1M)
> @@ -12,13 +13,15 @@ Required properties:
>  			    - "renesas,thermal-r8a7791" (R-Car M2-W)
>  			    - "renesas,thermal-r8a7792" (R-Car V2H)
>  			    - "renesas,thermal-r8a7793" (R-Car M2-N)
> +			    - "renesas,thermal-r8a77995" (R-Car D3)
>  - reg			: Address range of the thermal registers.
>  			  The 1st reg will be recognized as common register
>  			  if it has "interrupts".
>  
>  Option properties:
>  
> -- interrupts		: use interrupt
> +- interrupts		: use interrupt.
> +                          Should contain 3 interrupts for R-Car D3.

And how many for other chips?

>  
>  Example (non interrupt support):
>  
> -- 
> 1.9.1
> 

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

* Re: [PATCH/RFT v3 0/3] thermal: add support for r8a77995
  2018-04-03 12:43 [PATCH/RFT v3 0/3] thermal: add support for r8a77995 Yoshihiro Kaneko
                   ` (2 preceding siblings ...)
  2018-04-03 12:43 ` [PATCH/RFT v3 3/3] arm64: dts: renesas: r8a77995: add thermal device support Yoshihiro Kaneko
@ 2018-04-11  8:12 ` jacopo mondi
  2018-04-11  8:35   ` jacopo mondi
                     ` (2 more replies)
  2018-04-11  9:01 ` jacopo mondi
  4 siblings, 3 replies; 20+ messages in thread
From: jacopo mondi @ 2018-04-11  8:12 UTC (permalink / raw)
  To: Yoshihiro Kaneko
  Cc: linux-renesas-soc, Zhang Rui, Eduardo Valentin, Rob Herring,
	linux-pm, devicetree

[-- Attachment #1: Type: text/plain, Size: 1845 bytes --]

Hello Kaneko-san

On Tue, Apr 03, 2018 at 09:43:02PM +0900, Yoshihiro Kaneko wrote:
> This series adds thermal support for r8a77995.
> R-Car D3 (r8a77995) have a thermal sensor module which is similar to Gen2.
> Therefore this series adds r8a77995 support to rcar_thermal driver not
> rcar_gen3_thermal driver.
>
> This series is based on the next branch of Zhang Rui's linux tree.

Seems like I cannot find Zhang's tree anywhere. My google-fu is surely
bad, but can you paste a link to the tree here below, please?

Thanks
   j

>
> v3 [Yoshihiro Kaneko]
> * As suggested by Geert Uytterhoeven
> rcar_thermal.c:
> - make use_of_thermal in structure rcar_thermal_chip a single bit
> - add feature bits to rcar_thermal_chip
> - add the number of interrupts to rcar_thermal_chip
> - remove rcar_thermal_type in rcar_thermal_cip
> - make variable chip in rcar_thermal_probe() a const
>
> rcar-thermal.txt:
> * No change
>
> r8a77995.dtsi:
> * No change
>
>
> v2 [Yoshihiro Kaneko]
> * As suggested by Geert Uytterhoeven
> rcar_thermal.c:
> - remove rcar_of_data macro
> - store a pointer to rcar_thermal_chip in rcar_thermal_priv
> - remove unnecessary cast in rcar_thermal_dt_ids
>
> rcar-thermal.txt:
> - drop the fallback for D3
> - update the paragraph about interrupts
>
> r8a77995.dtsi:
> - fix the base address and the register addresses
> - drop the fallback
>
> Yoshihiro Kaneko (3):
>   thermal: rcar_thermal: add r8a77995 support
>   dt-bindings: thermal: rcar-thermal: add R8A77995 support
>   arm64: dts: renesas: r8a77995: add thermal device support
>
>  .../devicetree/bindings/thermal/rcar-thermal.txt   |   7 +-
>  arch/arm64/boot/dts/renesas/r8a77995.dtsi          |  30 ++++
>  drivers/thermal/rcar_thermal.c                     | 154 ++++++++++++++++-----
>  3 files changed, 157 insertions(+), 34 deletions(-)
>
> --
> 1.9.1
>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH/RFT v3 0/3] thermal: add support for r8a77995
  2018-04-11  8:12 ` [PATCH/RFT v3 0/3] thermal: add support for r8a77995 jacopo mondi
@ 2018-04-11  8:35   ` jacopo mondi
  2018-04-11  8:35   ` Geert Uytterhoeven
  2018-04-11  8:35     ` Kuninori Morimoto
  2 siblings, 0 replies; 20+ messages in thread
From: jacopo mondi @ 2018-04-11  8:35 UTC (permalink / raw)
  To: Yoshihiro Kaneko
  Cc: linux-renesas-soc, Zhang Rui, Eduardo Valentin, Rob Herring,
	linux-pm, devicetree

[-- Attachment #1: Type: text/plain, Size: 2153 bytes --]

I am sorry

On Wed, Apr 11, 2018 at 10:12:58AM +0200, jacopo mondi wrote:
> Hello Kaneko-san
>
> On Tue, Apr 03, 2018 at 09:43:02PM +0900, Yoshihiro Kaneko wrote:
> > This series adds thermal support for r8a77995.
> > R-Car D3 (r8a77995) have a thermal sensor module which is similar to Gen2.
> > Therefore this series adds r8a77995 support to rcar_thermal driver not
> > rcar_gen3_thermal driver.
> >
> > This series is based on the next branch of Zhang Rui's linux tree.
>
> Seems like I cannot find Zhang's tree anywhere. My google-fu is surely
> bad, but can you paste a link to the tree here below, please?

It is clearly this one
https://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git/

Sorry for the noise :)
>
> Thanks
>    j
>
> >
> > v3 [Yoshihiro Kaneko]
> > * As suggested by Geert Uytterhoeven
> > rcar_thermal.c:
> > - make use_of_thermal in structure rcar_thermal_chip a single bit
> > - add feature bits to rcar_thermal_chip
> > - add the number of interrupts to rcar_thermal_chip
> > - remove rcar_thermal_type in rcar_thermal_cip
> > - make variable chip in rcar_thermal_probe() a const
> >
> > rcar-thermal.txt:
> > * No change
> >
> > r8a77995.dtsi:
> > * No change
> >
> >
> > v2 [Yoshihiro Kaneko]
> > * As suggested by Geert Uytterhoeven
> > rcar_thermal.c:
> > - remove rcar_of_data macro
> > - store a pointer to rcar_thermal_chip in rcar_thermal_priv
> > - remove unnecessary cast in rcar_thermal_dt_ids
> >
> > rcar-thermal.txt:
> > - drop the fallback for D3
> > - update the paragraph about interrupts
> >
> > r8a77995.dtsi:
> > - fix the base address and the register addresses
> > - drop the fallback
> >
> > Yoshihiro Kaneko (3):
> >   thermal: rcar_thermal: add r8a77995 support
> >   dt-bindings: thermal: rcar-thermal: add R8A77995 support
> >   arm64: dts: renesas: r8a77995: add thermal device support
> >
> >  .../devicetree/bindings/thermal/rcar-thermal.txt   |   7 +-
> >  arch/arm64/boot/dts/renesas/r8a77995.dtsi          |  30 ++++
> >  drivers/thermal/rcar_thermal.c                     | 154 ++++++++++++++++-----
> >  3 files changed, 157 insertions(+), 34 deletions(-)
> >
> > --
> > 1.9.1
> >



[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH/RFT v3 0/3] thermal: add support for r8a77995
  2018-04-11  8:12 ` [PATCH/RFT v3 0/3] thermal: add support for r8a77995 jacopo mondi
  2018-04-11  8:35   ` jacopo mondi
@ 2018-04-11  8:35   ` Geert Uytterhoeven
  2018-04-11  8:35     ` Kuninori Morimoto
  2 siblings, 0 replies; 20+ messages in thread
From: Geert Uytterhoeven @ 2018-04-11  8:35 UTC (permalink / raw)
  To: jacopo mondi
  Cc: Yoshihiro Kaneko, Linux-Renesas, Zhang Rui, Eduardo Valentin,
	Rob Herring, Linux PM list,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

Hi Jacopo,

On Wed, Apr 11, 2018 at 10:12 AM, jacopo mondi <jacopo@jmondi.org> wrote:
> On Tue, Apr 03, 2018 at 09:43:02PM +0900, Yoshihiro Kaneko wrote:
>> This series adds thermal support for r8a77995.
>> R-Car D3 (r8a77995) have a thermal sensor module which is similar to Gen2.
>> Therefore this series adds r8a77995 support to rcar_thermal driver not
>> rcar_gen3_thermal driver.
>>
>> This series is based on the next branch of Zhang Rui's linux tree.
>
> Seems like I cannot find Zhang's tree anywhere. My google-fu is surely
> bad, but can you paste a link to the tree here below, please?

That tree is included in renesas-drivers:

  - git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git#next

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH/RFT v3 0/3] thermal: add support for r8a77995
  2018-04-11  8:12 ` [PATCH/RFT v3 0/3] thermal: add support for r8a77995 jacopo mondi
@ 2018-04-11  8:35     ` Kuninori Morimoto
  2018-04-11  8:35   ` Geert Uytterhoeven
  2018-04-11  8:35     ` Kuninori Morimoto
  2 siblings, 0 replies; 20+ messages in thread
From: Kuninori Morimoto @ 2018-04-11  8:35 UTC (permalink / raw)
  To: jacopo mondi
  Cc: Yoshihiro Kaneko, linux-renesas-soc, Zhang Rui, Eduardo Valentin,
	Rob Herring, linux-pm, devicetree


Hi Jacopo

> > This series adds thermal support for r8a77995.
> > R-Car D3 (r8a77995) have a thermal sensor module which is similar to Gen2.
> > Therefore this series adds r8a77995 support to rcar_thermal driver not
> > rcar_gen3_thermal driver.
> >
> > This series is based on the next branch of Zhang Rui's linux tree.
> 
> Seems like I cannot find Zhang's tree anywhere. My google-fu is surely
> bad, but can you paste a link to the tree here below, please?

I don't know detail, but in general
you can find maintainer git repository from kernel.org

	https://www.kernel.org/

you can find "Cgit" link, and find Zhang's one ?
Maybe you want is this ?

	kernel/git/rzhang/linux.git	Thermal Management	rzhang

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH/RFT v3 0/3] thermal: add support for r8a77995
@ 2018-04-11  8:35     ` Kuninori Morimoto
  0 siblings, 0 replies; 20+ messages in thread
From: Kuninori Morimoto @ 2018-04-11  8:35 UTC (permalink / raw)
  To: jacopo mondi
  Cc: Yoshihiro Kaneko, linux-renesas-soc, Zhang Rui, Eduardo Valentin,
	Rob Herring, linux-pm, devicetree


Hi Jacopo

> > This series adds thermal support for r8a77995.
> > R-Car D3 (r8a77995) have a thermal sensor module which is similar to Gen2.
> > Therefore this series adds r8a77995 support to rcar_thermal driver not
> > rcar_gen3_thermal driver.
> >
> > This series is based on the next branch of Zhang Rui's linux tree.
> 
> Seems like I cannot find Zhang's tree anywhere. My google-fu is surely
> bad, but can you paste a link to the tree here below, please?

I don't know detail, but in general
you can find maintainer git repository from kernel.org

	https://www.kernel.org/

you can find "Cgit" link, and find Zhang's one ?
Maybe you want is this ?

	kernel/git/rzhang/linux.git	Thermal Management	rzhang

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH/RFT v3 0/3] thermal: add support for r8a77995
  2018-04-03 12:43 [PATCH/RFT v3 0/3] thermal: add support for r8a77995 Yoshihiro Kaneko
                   ` (3 preceding siblings ...)
  2018-04-11  8:12 ` [PATCH/RFT v3 0/3] thermal: add support for r8a77995 jacopo mondi
@ 2018-04-11  9:01 ` jacopo mondi
  2018-05-16 13:07   ` Ulrich Hecht
  4 siblings, 1 reply; 20+ messages in thread
From: jacopo mondi @ 2018-04-11  9:01 UTC (permalink / raw)
  To: Yoshihiro Kaneko
  Cc: linux-renesas-soc, Zhang Rui, Eduardo Valentin, Rob Herring,
	linux-pm, devicetree

[-- Attachment #1: Type: text/plain, Size: 2183 bytes --]

Hello Kaneko-san,

On Tue, Apr 03, 2018 at 09:43:02PM +0900, Yoshihiro Kaneko wrote:
> This series adds thermal support for r8a77995.
> R-Car D3 (r8a77995) have a thermal sensor module which is similar to Gen2.
> Therefore this series adds r8a77995 support to rcar_thermal driver not
> rcar_gen3_thermal driver.

I tested this on D3 Draak.

I generated load expecting the detected temperature to rise.

It took a while, and I only see a slight increase of the temperature
reported by the 'temp' attribute.

# cat /sys/class/thermal/thermal_zone0/temp
30000

# while :; do cat /dev/urandom > /dev/null; done
...(wait 2 minutes)

# cat /sys/class/thermal/thermal_zone0/temp
35000

(wait 30 seconds)

# cat /sys/class/thermal/thermal_zone0/temp
30000

Is this result ok for your testing?

Thanks
  j
>
> This series is based on the next branch of Zhang Rui's linux tree.
>
> v3 [Yoshihiro Kaneko]
> * As suggested by Geert Uytterhoeven
> rcar_thermal.c:
> - make use_of_thermal in structure rcar_thermal_chip a single bit
> - add feature bits to rcar_thermal_chip
> - add the number of interrupts to rcar_thermal_chip
> - remove rcar_thermal_type in rcar_thermal_cip
> - make variable chip in rcar_thermal_probe() a const
>
> rcar-thermal.txt:
> * No change
>
> r8a77995.dtsi:
> * No change
>
>
> v2 [Yoshihiro Kaneko]
> * As suggested by Geert Uytterhoeven
> rcar_thermal.c:
> - remove rcar_of_data macro
> - store a pointer to rcar_thermal_chip in rcar_thermal_priv
> - remove unnecessary cast in rcar_thermal_dt_ids
>
> rcar-thermal.txt:
> - drop the fallback for D3
> - update the paragraph about interrupts
>
> r8a77995.dtsi:
> - fix the base address and the register addresses
> - drop the fallback
>
> Yoshihiro Kaneko (3):
>   thermal: rcar_thermal: add r8a77995 support
>   dt-bindings: thermal: rcar-thermal: add R8A77995 support
>   arm64: dts: renesas: r8a77995: add thermal device support
>
>  .../devicetree/bindings/thermal/rcar-thermal.txt   |   7 +-
>  arch/arm64/boot/dts/renesas/r8a77995.dtsi          |  30 ++++
>  drivers/thermal/rcar_thermal.c                     | 154 ++++++++++++++++-----
>  3 files changed, 157 insertions(+), 34 deletions(-)
>
> --
> 1.9.1
>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH/RFT v3 2/3] dt-bindings: thermal: rcar-thermal: add R8A77995 support
  2018-04-09 21:21   ` Rob Herring
@ 2018-05-09 18:09     ` Simon Horman
  2018-05-13 20:55       ` Yoshihiro Kaneko
  0 siblings, 1 reply; 20+ messages in thread
From: Simon Horman @ 2018-05-09 18:09 UTC (permalink / raw)
  To: Rob Herring
  Cc: Yoshihiro Kaneko, linux-renesas-soc, Zhang Rui, Eduardo Valentin,
	linux-pm, devicetree

On Mon, Apr 09, 2018 at 04:21:29PM -0500, Rob Herring wrote:
> On Tue, Apr 03, 2018 at 09:43:04PM +0900, Yoshihiro Kaneko wrote:
> > Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
> > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > ---
> >  Documentation/devicetree/bindings/thermal/rcar-thermal.txt | 7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/thermal/rcar-thermal.txt b/Documentation/devicetree/bindings/thermal/rcar-thermal.txt
> > index 349e635..5ab5fcd 100644
> > --- a/Documentation/devicetree/bindings/thermal/rcar-thermal.txt
> > +++ b/Documentation/devicetree/bindings/thermal/rcar-thermal.txt
> > @@ -3,7 +3,8 @@
> >  Required properties:
> >  - compatible		: "renesas,thermal-<soctype>",
> >  			   "renesas,rcar-gen2-thermal" (with thermal-zone) or
> > -			   "renesas,rcar-thermal" (without thermal-zone) as fallback.
> > +			   "renesas,rcar-thermal" (without thermal-zone) as
> > +                           fallback except R-Car D3.
> >  			  Examples with soctypes are:
> >  			    - "renesas,thermal-r8a73a4" (R-Mobile APE6)
> >  			    - "renesas,thermal-r8a7743" (RZ/G1M)
> > @@ -12,13 +13,15 @@ Required properties:
> >  			    - "renesas,thermal-r8a7791" (R-Car M2-W)
> >  			    - "renesas,thermal-r8a7792" (R-Car V2H)
> >  			    - "renesas,thermal-r8a7793" (R-Car M2-N)
> > +			    - "renesas,thermal-r8a77995" (R-Car D3)
> >  - reg			: Address range of the thermal registers.
> >  			  The 1st reg will be recognized as common register
> >  			  if it has "interrupts".
> >  
> >  Option properties:
> >  
> > -- interrupts		: use interrupt
> > +- interrupts		: use interrupt.
> > +                          Should contain 3 interrupts for R-Car D3.
> 
> And how many for other chips?

How about this?

				If present should contain 3 interrupts for
				R-Car D3 or 1 interrupt otherwise.

> >  
> >  Example (non interrupt support):
> >  
> > -- 
> > 1.9.1
> > 
> 

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

* Re: [PATCH/RFT v3 1/3] thermal: rcar_thermal: add r8a77995 support
  2018-04-03 12:43 ` [PATCH/RFT v3 1/3] thermal: rcar_thermal: add r8a77995 support Yoshihiro Kaneko
@ 2018-05-09 18:11   ` Simon Horman
  2018-05-13 21:11     ` Yoshihiro Kaneko
  0 siblings, 1 reply; 20+ messages in thread
From: Simon Horman @ 2018-05-09 18:11 UTC (permalink / raw)
  To: Yoshihiro Kaneko
  Cc: linux-renesas-soc, Zhang Rui, Eduardo Valentin, Rob Herring,
	linux-pm, devicetree

On Tue, Apr 03, 2018 at 09:43:03PM +0900, Yoshihiro Kaneko wrote:
> Add support for R-Car D3 (r8a77995) thermal sensor.
> 
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
> ---
>  drivers/thermal/rcar_thermal.c | 154 ++++++++++++++++++++++++++++++++---------
>  1 file changed, 122 insertions(+), 32 deletions(-)
> 
> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index 73e5fee..5ec47a9 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -58,10 +58,43 @@ struct rcar_thermal_common {
>  	spinlock_t lock;
>  };
>  
> +struct rcar_thermal_chip {
> +	unsigned int use_of_thermal : 1;
> +	unsigned int has_filonoff : 1;
> +	unsigned int irq_per_ch : 1;
> +	unsigned int needs_suspend_resume : 1;
> +	unsigned int nirqs;
> +};
> +
> +static const struct rcar_thermal_chip rcar_thermal = {
> +	.use_of_thermal = 0,
> +	.has_filonoff = 1,
> +	.irq_per_ch = 0,
> +	.needs_suspend_resume = 0,
> +	.nirqs = 1,
> +};
> +
> +static const struct rcar_thermal_chip rcar_gen2_thermal = {
> +	.use_of_thermal = 1,
> +	.has_filonoff = 1,
> +	.irq_per_ch = 0,
> +	.needs_suspend_resume = 0,
> +	.nirqs = 1,
> +};
> +
> +static const struct rcar_thermal_chip rcar_gen3_thermal = {
> +	.use_of_thermal = 1,
> +	.has_filonoff = 0,
> +	.irq_per_ch = 1,
> +	.needs_suspend_resume = 1,
> +	.nirqs = 2,
> +};

The binding and dts patches in this series describe 3 interrupts
for R-Car D3. But the above specifies two. Am I missing something obvious?

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

* Re: [PATCH/RFT v3 2/3] dt-bindings: thermal: rcar-thermal: add R8A77995 support
  2018-05-09 18:09     ` Simon Horman
@ 2018-05-13 20:55       ` Yoshihiro Kaneko
  0 siblings, 0 replies; 20+ messages in thread
From: Yoshihiro Kaneko @ 2018-05-13 20:55 UTC (permalink / raw)
  To: Simon Horman
  Cc: Eduardo Valentin, Rob Herring, Zhang Rui, devicetree, linux-pm,
	linux-renesas-soc

[-- Attachment #1: Type: text/plain, Size: 2595 bytes --]

Hi Simon-san,

2018年5月10日(木) 3:10 Simon Horman <horms@verge.net.au>:

> On Mon, Apr 09, 2018 at 04:21:29PM -0500, Rob Herring wrote:
> > On Tue, Apr 03, 2018 at 09:43:04PM +0900, Yoshihiro Kaneko wrote:
> > > Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
> > > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > > ---
> > >  Documentation/devicetree/bindings/thermal/rcar-thermal.txt | 7 +++++--
> > >  1 file changed, 5 insertions(+), 2 deletions(-)
> > >
> > > diff --git
> a/Documentation/devicetree/bindings/thermal/rcar-thermal.txt
> b/Documentation/devicetree/bindings/thermal/rcar-thermal.txt
> > > index 349e635..5ab5fcd 100644
> > > --- a/Documentation/devicetree/bindings/thermal/rcar-thermal.txt
> > > +++ b/Documentation/devicetree/bindings/thermal/rcar-thermal.txt
> > > @@ -3,7 +3,8 @@
> > >  Required properties:
> > >  - compatible               : "renesas,thermal-<soctype>",
> > >                        "renesas,rcar-gen2-thermal" (with thermal-zone)
> or
> > > -                      "renesas,rcar-thermal" (without thermal-zone)
> as fallback.
> > > +                      "renesas,rcar-thermal" (without thermal-zone) as
> > > +                           fallback except R-Car D3.
> > >                       Examples with soctypes are:
> > >                         - "renesas,thermal-r8a73a4" (R-Mobile APE6)
> > >                         - "renesas,thermal-r8a7743" (RZ/G1M)
> > > @@ -12,13 +13,15 @@ Required properties:
> > >                         - "renesas,thermal-r8a7791" (R-Car M2-W)
> > >                         - "renesas,thermal-r8a7792" (R-Car V2H)
> > >                         - "renesas,thermal-r8a7793" (R-Car M2-N)
> > > +                       - "renesas,thermal-r8a77995" (R-Car D3)
> > >  - reg                      : Address range of the thermal registers.
> > >                       The 1st reg will be recognized as common register
> > >                       if it has "interrupts".
> > >
> > >  Option properties:
> > >
> > > -- interrupts               : use interrupt
> > > +- interrupts               : use interrupt.
> > > +                          Should contain 3 interrupts for R-Car D3.
> >
> > And how many for other chips?
>
> How about this?
>
>                                 If present should contain 3 interrupts for
>                                 R-Car D3 or 1 interrupt otherwise.


Thanks!
I will update the patch with your suggestion.


>
> > >
> > >  Example (non interrupt support):
> > >
> > > --
> > > 1.9.1
> > >
> >
>

[-- Attachment #2: Type: text/html, Size: 3900 bytes --]

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

* Re: [PATCH/RFT v3 1/3] thermal: rcar_thermal: add r8a77995 support
  2018-05-09 18:11   ` Simon Horman
@ 2018-05-13 21:11     ` Yoshihiro Kaneko
  2018-05-15  7:26       ` Simon Horman
  0 siblings, 1 reply; 20+ messages in thread
From: Yoshihiro Kaneko @ 2018-05-13 21:11 UTC (permalink / raw)
  To: Simon Horman
  Cc: Eduardo Valentin, Rob Herring, Zhang Rui, devicetree, linux-pm,
	linux-renesas-soc

[-- Attachment #1: Type: text/plain, Size: 1943 bytes --]

Hi Simon-san,

2018年5月10日(木) 3:11 Simon Horman <horms@verge.net.au>:

> On Tue, Apr 03, 2018 at 09:43:03PM +0900, Yoshihiro Kaneko wrote:
> > Add support for R-Car D3 (r8a77995) thermal sensor.
> >
> > Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
> > ---
> >  drivers/thermal/rcar_thermal.c | 154
> ++++++++++++++++++++++++++++++++---------
> >  1 file changed, 122 insertions(+), 32 deletions(-)
> >
> > diff --git a/drivers/thermal/rcar_thermal.c
> b/drivers/thermal/rcar_thermal.c
> > index 73e5fee..5ec47a9 100644
> > --- a/drivers/thermal/rcar_thermal.c
> > +++ b/drivers/thermal/rcar_thermal.c
> > @@ -58,10 +58,43 @@ struct rcar_thermal_common {
> >       spinlock_t lock;
> >  };
> >
> > +struct rcar_thermal_chip {
> > +     unsigned int use_of_thermal : 1;
> > +     unsigned int has_filonoff : 1;
> > +     unsigned int irq_per_ch : 1;
> > +     unsigned int needs_suspend_resume : 1;
> > +     unsigned int nirqs;
> > +};
> > +
> > +static const struct rcar_thermal_chip rcar_thermal = {
> > +     .use_of_thermal = 0,
> > +     .has_filonoff = 1,
> > +     .irq_per_ch = 0,
> > +     .needs_suspend_resume = 0,
> > +     .nirqs = 1,
> > +};
> > +
> > +static const struct rcar_thermal_chip rcar_gen2_thermal = {
> > +     .use_of_thermal = 1,
> > +     .has_filonoff = 1,
> > +     .irq_per_ch = 0,
> > +     .needs_suspend_resume = 0,
> > +     .nirqs = 1,
> > +};
> > +
> > +static const struct rcar_thermal_chip rcar_gen3_thermal = {
> > +     .use_of_thermal = 1,
> > +     .has_filonoff = 0,
> > +     .irq_per_ch = 1,
> > +     .needs_suspend_resume = 1,
> > +     .nirqs = 2,
> > +};
>
> The binding and dts patches in this series describe 3 interrupts
> for R-Car D3. But the above specifies two. Am I missing something obvious?


R-Car D3 has 3 interrupts, but this driver uses only 2 interrupts to detect
a temperature change, rise or fall.

[-- Attachment #2: Type: text/html, Size: 2738 bytes --]

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

* Re: [PATCH/RFT v3 1/3] thermal: rcar_thermal: add r8a77995 support
  2018-05-13 21:11     ` Yoshihiro Kaneko
@ 2018-05-15  7:26       ` Simon Horman
  2018-05-15 16:03         ` Yoshihiro Kaneko
  0 siblings, 1 reply; 20+ messages in thread
From: Simon Horman @ 2018-05-15  7:26 UTC (permalink / raw)
  To: Yoshihiro Kaneko
  Cc: Eduardo Valentin, Rob Herring, Zhang Rui, devicetree, linux-pm,
	linux-renesas-soc

On Mon, May 14, 2018 at 06:11:59AM +0900, Yoshihiro Kaneko wrote:
> Hi Simon-san,
> 
> 2018年5月10日(木) 3:11 Simon Horman <horms@verge.net.au>:
> 
> > On Tue, Apr 03, 2018 at 09:43:03PM +0900, Yoshihiro Kaneko wrote:
> > > Add support for R-Car D3 (r8a77995) thermal sensor.
> > >
> > > Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
> > > ---
> > >  drivers/thermal/rcar_thermal.c | 154
> > ++++++++++++++++++++++++++++++++---------
> > >  1 file changed, 122 insertions(+), 32 deletions(-)
> > >
> > > diff --git a/drivers/thermal/rcar_thermal.c
> > b/drivers/thermal/rcar_thermal.c
> > > index 73e5fee..5ec47a9 100644
> > > --- a/drivers/thermal/rcar_thermal.c
> > > +++ b/drivers/thermal/rcar_thermal.c
> > > @@ -58,10 +58,43 @@ struct rcar_thermal_common {
> > >       spinlock_t lock;
> > >  };
> > >
> > > +struct rcar_thermal_chip {
> > > +     unsigned int use_of_thermal : 1;
> > > +     unsigned int has_filonoff : 1;
> > > +     unsigned int irq_per_ch : 1;
> > > +     unsigned int needs_suspend_resume : 1;
> > > +     unsigned int nirqs;
> > > +};
> > > +
> > > +static const struct rcar_thermal_chip rcar_thermal = {
> > > +     .use_of_thermal = 0,
> > > +     .has_filonoff = 1,
> > > +     .irq_per_ch = 0,
> > > +     .needs_suspend_resume = 0,
> > > +     .nirqs = 1,
> > > +};
> > > +
> > > +static const struct rcar_thermal_chip rcar_gen2_thermal = {
> > > +     .use_of_thermal = 1,
> > > +     .has_filonoff = 1,
> > > +     .irq_per_ch = 0,
> > > +     .needs_suspend_resume = 0,
> > > +     .nirqs = 1,
> > > +};
> > > +
> > > +static const struct rcar_thermal_chip rcar_gen3_thermal = {
> > > +     .use_of_thermal = 1,
> > > +     .has_filonoff = 0,
> > > +     .irq_per_ch = 1,
> > > +     .needs_suspend_resume = 1,
> > > +     .nirqs = 2,
> > > +};
> >
> > The binding and dts patches in this series describe 3 interrupts
> > for R-Car D3. But the above specifies two. Am I missing something obvious?
> 
> 
> R-Car D3 has 3 interrupts, but this driver uses only 2 interrupts to detect
> a temperature change, rise or fall.

Thanks, that makes perfect sense.

Perhaps a comment above ".nirqs = 2" would make it more obvious to the casual
observer?

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

* Re: [PATCH/RFT v3 1/3] thermal: rcar_thermal: add r8a77995 support
  2018-05-15  7:26       ` Simon Horman
@ 2018-05-15 16:03         ` Yoshihiro Kaneko
  0 siblings, 0 replies; 20+ messages in thread
From: Yoshihiro Kaneko @ 2018-05-15 16:03 UTC (permalink / raw)
  To: Simon Horman
  Cc: Eduardo Valentin, Rob Herring, Zhang Rui,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux PM list, Linux-Renesas

2018-05-15 16:26 GMT+09:00 Simon Horman <horms@verge.net.au>:
> On Mon, May 14, 2018 at 06:11:59AM +0900, Yoshihiro Kaneko wrote:
>> Hi Simon-san,
>>
>> 2018年5月10日(木) 3:11 Simon Horman <horms@verge.net.au>:
>>
>> > On Tue, Apr 03, 2018 at 09:43:03PM +0900, Yoshihiro Kaneko wrote:
>> > > Add support for R-Car D3 (r8a77995) thermal sensor.
>> > >
>> > > Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
>> > > ---
>> > >  drivers/thermal/rcar_thermal.c | 154
>> > ++++++++++++++++++++++++++++++++---------
>> > >  1 file changed, 122 insertions(+), 32 deletions(-)
>> > >
>> > > diff --git a/drivers/thermal/rcar_thermal.c
>> > b/drivers/thermal/rcar_thermal.c
>> > > index 73e5fee..5ec47a9 100644
>> > > --- a/drivers/thermal/rcar_thermal.c
>> > > +++ b/drivers/thermal/rcar_thermal.c
>> > > @@ -58,10 +58,43 @@ struct rcar_thermal_common {
>> > >       spinlock_t lock;
>> > >  };
>> > >
>> > > +struct rcar_thermal_chip {
>> > > +     unsigned int use_of_thermal : 1;
>> > > +     unsigned int has_filonoff : 1;
>> > > +     unsigned int irq_per_ch : 1;
>> > > +     unsigned int needs_suspend_resume : 1;
>> > > +     unsigned int nirqs;
>> > > +};
>> > > +
>> > > +static const struct rcar_thermal_chip rcar_thermal = {
>> > > +     .use_of_thermal = 0,
>> > > +     .has_filonoff = 1,
>> > > +     .irq_per_ch = 0,
>> > > +     .needs_suspend_resume = 0,
>> > > +     .nirqs = 1,
>> > > +};
>> > > +
>> > > +static const struct rcar_thermal_chip rcar_gen2_thermal = {
>> > > +     .use_of_thermal = 1,
>> > > +     .has_filonoff = 1,
>> > > +     .irq_per_ch = 0,
>> > > +     .needs_suspend_resume = 0,
>> > > +     .nirqs = 1,
>> > > +};
>> > > +
>> > > +static const struct rcar_thermal_chip rcar_gen3_thermal = {
>> > > +     .use_of_thermal = 1,
>> > > +     .has_filonoff = 0,
>> > > +     .irq_per_ch = 1,
>> > > +     .needs_suspend_resume = 1,
>> > > +     .nirqs = 2,
>> > > +};
>> >
>> > The binding and dts patches in this series describe 3 interrupts
>> > for R-Car D3. But the above specifies two. Am I missing something obvious?
>>
>>
>> R-Car D3 has 3 interrupts, but this driver uses only 2 interrupts to detect
>> a temperature change, rise or fall.
>
> Thanks, that makes perfect sense.
>
> Perhaps a comment above ".nirqs = 2" would make it more obvious to the casual
> observer?

I agree with you.
I will update this patch.

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

* Re: [PATCH/RFT v3 0/3] thermal: add support for r8a77995
  2018-04-11  9:01 ` jacopo mondi
@ 2018-05-16 13:07   ` Ulrich Hecht
  2018-05-16 19:08     ` Niklas Söderlund
  0 siblings, 1 reply; 20+ messages in thread
From: Ulrich Hecht @ 2018-05-16 13:07 UTC (permalink / raw)
  To: jacopo mondi
  Cc: Yoshihiro Kaneko, Linux-Renesas, Zhang Rui, Eduardo Valentin,
	Rob Herring, Linux PM list, devicetree

On Wed, Apr 11, 2018 at 11:01 AM, jacopo mondi <jacopo@jmondi.org> wrote:
> Hello Kaneko-san,
>
> On Tue, Apr 03, 2018 at 09:43:02PM +0900, Yoshihiro Kaneko wrote:
>> This series adds thermal support for r8a77995.
>> R-Car D3 (r8a77995) have a thermal sensor module which is similar to Gen2.
>> Therefore this series adds r8a77995 support to rcar_thermal driver not
>> rcar_gen3_thermal driver.
>
> I tested this on D3 Draak.
>
> I generated load expecting the detected temperature to rise.
>
> It took a while, and I only see a slight increase of the temperature
> reported by the 'temp' attribute.

Pointing a heat gun at the SoC, I managed to get the temperature up to
80000, and it went back to 40000 when I removed it. I'd say this
works.

Tested-By: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>

CU
Uli

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

* Re: [PATCH/RFT v3 0/3] thermal: add support for r8a77995
  2018-05-16 13:07   ` Ulrich Hecht
@ 2018-05-16 19:08     ` Niklas Söderlund
  2018-05-17  7:54       ` Simon Horman
  0 siblings, 1 reply; 20+ messages in thread
From: Niklas Söderlund @ 2018-05-16 19:08 UTC (permalink / raw)
  To: Ulrich Hecht
  Cc: jacopo mondi, Yoshihiro Kaneko, Linux-Renesas, Zhang Rui,
	Eduardo Valentin, Rob Herring, Linux PM list, devicetree

Hi Ulrich,

On 2018-05-16 15:07:01 +0200, Ulrich Hecht wrote:
> On Wed, Apr 11, 2018 at 11:01 AM, jacopo mondi <jacopo@jmondi.org> wrote:
> > Hello Kaneko-san,
> >
> > On Tue, Apr 03, 2018 at 09:43:02PM +0900, Yoshihiro Kaneko wrote:
> >> This series adds thermal support for r8a77995.
> >> R-Car D3 (r8a77995) have a thermal sensor module which is similar to Gen2.
> >> Therefore this series adds r8a77995 support to rcar_thermal driver not
> >> rcar_gen3_thermal driver.
> >
> > I tested this on D3 Draak.
> >
> > I generated load expecting the detected temperature to rise.
> >
> > It took a while, and I only see a slight increase of the temperature
> > reported by the 'temp' attribute.
> 
> Pointing a heat gun at the SoC, I managed to get the temperature up to
> 80000, and it went back to 40000 when I removed it. I'd say this
> works.

I like your style! I contemplated using a hairdryer when testing some 
Gen3 thermal work but decided against it. Good too see others are not as 
weak minded as my self :-)

> 
> Tested-By: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
> 
> CU
> Uli

-- 
Regards,
Niklas S�derlund

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

* Re: [PATCH/RFT v3 0/3] thermal: add support for r8a77995
  2018-05-16 19:08     ` Niklas Söderlund
@ 2018-05-17  7:54       ` Simon Horman
  0 siblings, 0 replies; 20+ messages in thread
From: Simon Horman @ 2018-05-17  7:54 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: Ulrich Hecht, jacopo mondi, Yoshihiro Kaneko, Linux-Renesas,
	Zhang Rui, Eduardo Valentin, Rob Herring, Linux PM list,
	devicetree

On Wed, May 16, 2018 at 09:08:06PM +0200, Niklas Söderlund wrote:
> Hi Ulrich,
> 
> On 2018-05-16 15:07:01 +0200, Ulrich Hecht wrote:
> > On Wed, Apr 11, 2018 at 11:01 AM, jacopo mondi <jacopo@jmondi.org> wrote:
> > > Hello Kaneko-san,
> > >
> > > On Tue, Apr 03, 2018 at 09:43:02PM +0900, Yoshihiro Kaneko wrote:
> > >> This series adds thermal support for r8a77995.
> > >> R-Car D3 (r8a77995) have a thermal sensor module which is similar to Gen2.
> > >> Therefore this series adds r8a77995 support to rcar_thermal driver not
> > >> rcar_gen3_thermal driver.
> > >
> > > I tested this on D3 Draak.
> > >
> > > I generated load expecting the detected temperature to rise.
> > >
> > > It took a while, and I only see a slight increase of the temperature
> > > reported by the 'temp' attribute.
> > 
> > Pointing a heat gun at the SoC, I managed to get the temperature up to
> > 80000, and it went back to 40000 when I removed it. I'd say this
> > works.
> 
> I like your style! I contemplated using a hairdryer when testing some 
> Gen3 thermal work but decided against it. Good too see others are not as 
> weak minded as my self :-)

I think that we may need some new tags to differentiate between
weak and awesome tests.

> > Tested-By: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
> > 
> > CU
> > Uli
> 
> -- 
> Regards,
> Niklas Söderlund
> 

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

end of thread, other threads:[~2018-05-17  7:54 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-03 12:43 [PATCH/RFT v3 0/3] thermal: add support for r8a77995 Yoshihiro Kaneko
2018-04-03 12:43 ` [PATCH/RFT v3 1/3] thermal: rcar_thermal: add r8a77995 support Yoshihiro Kaneko
2018-05-09 18:11   ` Simon Horman
2018-05-13 21:11     ` Yoshihiro Kaneko
2018-05-15  7:26       ` Simon Horman
2018-05-15 16:03         ` Yoshihiro Kaneko
2018-04-03 12:43 ` [PATCH/RFT v3 2/3] dt-bindings: thermal: rcar-thermal: add R8A77995 support Yoshihiro Kaneko
2018-04-09 21:21   ` Rob Herring
2018-05-09 18:09     ` Simon Horman
2018-05-13 20:55       ` Yoshihiro Kaneko
2018-04-03 12:43 ` [PATCH/RFT v3 3/3] arm64: dts: renesas: r8a77995: add thermal device support Yoshihiro Kaneko
2018-04-11  8:12 ` [PATCH/RFT v3 0/3] thermal: add support for r8a77995 jacopo mondi
2018-04-11  8:35   ` jacopo mondi
2018-04-11  8:35   ` Geert Uytterhoeven
2018-04-11  8:35   ` Kuninori Morimoto
2018-04-11  8:35     ` Kuninori Morimoto
2018-04-11  9:01 ` jacopo mondi
2018-05-16 13:07   ` Ulrich Hecht
2018-05-16 19:08     ` Niklas Söderlund
2018-05-17  7:54       ` Simon Horman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.