devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 2/3] thermal: add support for the thermal sensor on Allwinner new SoCs
@ 2017-03-01 16:02 Icenowy Zheng
  2017-03-02 14:11 ` Maxime Ripard
  0 siblings, 1 reply; 11+ messages in thread
From: Icenowy Zheng @ 2017-03-01 16:02 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Zhang Rui, linux-pm, Rob Herring, linux-kernel, devicetree,
	Ondrej Jirman, Eduardo Valentin, linux-arm-kernel, Chen-Yu Tsai


2017年3月1日 23:56于 Maxime Ripard <maxime.ripard@free-electrons.com>写道:
>
> On Wed, Mar 01, 2017 at 06:20:51PM +0800, Icenowy Zheng wrote: 
> > 
> > 2017年3月1日 18:14于 Maxime Ripard <maxime.ripard@free-electrons.com>写道: 
> > > 
> > > On Tue, Feb 28, 2017 at 03:18:13PM +0800, Icenowy Zheng wrote: 
> > > > 
> > > > 2017年2月28日 14:44于 Maxime Ripard <maxime.ripard@free-electrons.com>写道: 
> > > > > 
> > > > > On Tue, Feb 28, 2017 at 03:40:53AM +0800, Icenowy Zheng wrote: 
> > > > > > From: Ondrej Jirman <megous@megous.com> 
> > > > > > 
> > > > > > Allwinner SoCs from H3 (including H5, A64, etc) have a new version of 
> > > > > > thermal sensor, and needs a new driver for it. 
> > > > > > 
> > > > > > Add such a driver. 
> > > > > > 
> > > > > > Currently only H3 is supported, but other SoCs are easily to be 
> > > > > > supported by adding new formula and set the sensor number. 
> > > > > > 
> > > > > > Signed-off-by: Ondřej Jirman <megous@megous.com> 
> > > > > > [Icenowy: extend to support further multiple-sensor SoCs, change commit 
> > > > > >  message] 
> > > > > > Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz> 
> > > > > 
> > > > > There's no need to create a new driver for that. This can be handled 
> > > > > by the GPADC driver we already have. 
> > > > 
> > > > sun8i-ths is not GPADC at all. 
> > > > 
> > > > The latest SoC I know that use GPADC as thermal sensor is A33. 
> > > 
> > > It's not called the same way, but it definitely is an evolution of the 
> > > same controller. There's no need for a new driver, only reworking what 
> > > is already there. 
> > 
> > I don't think so -- here's some evidence: 

But the H3 THS have many new IRQs, functions, different sampling rate set method and a quite different register layout.

Doing this in GPADC driver is possible but meaningless.

> > 
> > 1. The old GPADC do not have module clock. 
>
> The A33 could use a PLL. 

But it's a dedicated mod clk on new generation THS.

>
> > 2. The old GPADC do not have calibration stored in eFUSE. 
>
> The A33 had calibration data stored in the efuses. 

Yes... sorry for ignoring this.

>
> > 3. R40 SoC have both RTP (it should be the old GPADC) and 
> > new-generation THS. 
>
> And this is probably just to be compatible with the A20. 
>
> Maxime 
>
> -- 
> Maxime Ripard, Free Electrons 
> Embedded Linux and Kernel engineering 
> http://free-electrons.com 

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: [PATCH 2/3] thermal: add support for the thermal sensor on Allwinner new SoCs
@ 2017-03-01 10:20 Icenowy Zheng
  2017-03-01 15:56 ` Maxime Ripard
  0 siblings, 1 reply; 11+ messages in thread
From: Icenowy Zheng @ 2017-03-01 10:20 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Zhang Rui, Rob Herring, linux-pm, linux-kernel, devicetree,
	Eduardo Valentin, Ondrej Jirman, linux-arm-kernel, Chen-Yu Tsai


2017年3月1日 18:14于 Maxime Ripard <maxime.ripard@free-electrons.com>写道:
>
> On Tue, Feb 28, 2017 at 03:18:13PM +0800, Icenowy Zheng wrote: 
> > 
> > 2017年2月28日 14:44于 Maxime Ripard <maxime.ripard@free-electrons.com>写道: 
> > > 
> > > On Tue, Feb 28, 2017 at 03:40:53AM +0800, Icenowy Zheng wrote: 
> > > > From: Ondrej Jirman <megous@megous.com> 
> > > > 
> > > > Allwinner SoCs from H3 (including H5, A64, etc) have a new version of 
> > > > thermal sensor, and needs a new driver for it. 
> > > > 
> > > > Add such a driver. 
> > > > 
> > > > Currently only H3 is supported, but other SoCs are easily to be 
> > > > supported by adding new formula and set the sensor number. 
> > > > 
> > > > Signed-off-by: Ondřej Jirman <megous@megous.com> 
> > > > [Icenowy: extend to support further multiple-sensor SoCs, change commit 
> > > >  message] 
> > > > Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz> 
> > > 
> > > There's no need to create a new driver for that. This can be handled 
> > > by the GPADC driver we already have. 
> > 
> > sun8i-ths is not GPADC at all. 
> > 
> > The latest SoC I know that use GPADC as thermal sensor is A33. 
>
> It's not called the same way, but it definitely is an evolution of the 
> same controller. There's no need for a new driver, only reworking what 
> is already there. 

I don't think so -- here's some evidence:

1. The old GPADC do not have module clock.
2. The old GPADC do not have calibration stored in eFUSE.
3. R40 SoC have both RTP (it should be the old GPADC) and new-generation THS.

>
> Maxime 
>
> -- 
> Maxime Ripard, Free Electrons 
> Embedded Linux and Kernel engineering 
> http://free-electrons.com 

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: [PATCH 2/3] thermal: add support for the thermal sensor on Allwinner new SoCs
@ 2017-02-28  7:18 Icenowy Zheng
  2017-03-01 10:14 ` Maxime Ripard
  0 siblings, 1 reply; 11+ messages in thread
From: Icenowy Zheng @ 2017-02-28  7:18 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Zhang Rui, linux-pm, Rob Herring, linux-kernel, devicetree,
	Ondrej Jirman, Eduardo Valentin, linux-arm-kernel, Chen-Yu Tsai


2017年2月28日 14:44于 Maxime Ripard <maxime.ripard@free-electrons.com>写道:
>
> On Tue, Feb 28, 2017 at 03:40:53AM +0800, Icenowy Zheng wrote: 
> > From: Ondrej Jirman <megous@megous.com> 
> > 
> > Allwinner SoCs from H3 (including H5, A64, etc) have a new version of 
> > thermal sensor, and needs a new driver for it. 
> > 
> > Add such a driver. 
> > 
> > Currently only H3 is supported, but other SoCs are easily to be 
> > supported by adding new formula and set the sensor number. 
> > 
> > Signed-off-by: Ondřej Jirman <megous@megous.com> 
> > [Icenowy: extend to support further multiple-sensor SoCs, change commit 
> >  message] 
> > Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz> 
>
> There's no need to create a new driver for that. This can be handled 
> by the GPADC driver we already have. 

sun8i-ths is not GPADC at all.

The latest SoC I know that use GPADC as thermal sensor is A33.

>
> Maxime 
>
> -- 
> Maxime Ripard, Free Electrons 
> Embedded Linux and Kernel engineering 
> http://free-electrons.com 

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [PATCH 1/3] dt-bindings: document the thermal sensor of Allwinner H3 SoC
@ 2017-02-27 19:40 Icenowy Zheng
  2017-02-27 19:40 ` [PATCH 2/3] thermal: add support for the thermal sensor on Allwinner new SoCs Icenowy Zheng
  0 siblings, 1 reply; 11+ messages in thread
From: Icenowy Zheng @ 2017-02-27 19:40 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, Rob Herring, Maxime Ripard,
	Chen-Yu Tsai, Ondrej Jirman
  Cc: devicetree, Icenowy Zheng, linux-kernel, linux-arm-kernel,
	linux-pm

From: Ondrej Jirman <megous@megous.com>

This patch adds the binding documentation for the thermal sensor
found in Allwinner H3 SoC.

Signed-off-by: Ondřej Jirman <megous@megous.com>
[Icenowy: some adjustments to documentation and the commit message]
Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
---
 .../devicetree/bindings/thermal/sun8i-ths.txt      | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/thermal/sun8i-ths.txt

diff --git a/Documentation/devicetree/bindings/thermal/sun8i-ths.txt b/Documentation/devicetree/bindings/thermal/sun8i-ths.txt
new file mode 100644
index 000000000000..eec094c459b8
--- /dev/null
+++ b/Documentation/devicetree/bindings/thermal/sun8i-ths.txt
@@ -0,0 +1,35 @@
+* Thermal sensor for new Allwinner SoCs
+
+Required properties:
+- compatible : Should be one of the following:
+ - "allwinner,sun8i-h3-ths"
+- reg : Address range of the thermal sensor registers
+- resets : Must contain phandles to reset controls matching the entries
+  of the names
+- reset-names : Must include the name "ahb"
+- clocks : Must contain phandles to clock controls matching the entries
+  of the names
+- clock-names : Must contain "ahb" for the bus gate and "ths" for the THS
+  clock
+- #thermal-sensor-cells : Should be 1. See ./thermal.txt for a description.
+
+Optional properties:
+- nvmem-cells: A phandle to the calibration data provided by a nvmem device. If
+               unspecified default values shall be used. Refer to
+               Documentation/devicetree/bindings/nvmem/nvmem.txt to know how to
+               specify nvmem cells.
+- nvmem-cell-names: Should be "cal"
+
+Example:
+ths: ths@01c25000 {
+	compatible = "allwinner,sun8i-h3-ths";
+	reg = <0x01c25000 0x400>;
+	interrupts = <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>;
+	resets = <&ccu RST_BUS_THS>;
+	reset-names = "ahb";
+	clocks = <&ccu CLK_BUS_THS>, <&ccu CLK_THS>;
+	clock-names = "ahb", "ths";
+	nvmem-cells = <&ths_cal>;
+	nvmem-cell-names = "cal";
+	#thermal-sensor-cells = <1>;
+};
-- 
2.11.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2017-03-09 15:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-01 16:02 [PATCH 2/3] thermal: add support for the thermal sensor on Allwinner new SoCs Icenowy Zheng
2017-03-02 14:11 ` Maxime Ripard
2017-03-09  0:36   ` Icenowy Zheng
2017-03-09 14:27     ` Maxime Ripard
2017-03-09 15:31       ` Icenowy Zheng
  -- strict thread matches above, loose matches on Subject: below --
2017-03-01 10:20 Icenowy Zheng
2017-03-01 15:56 ` Maxime Ripard
2017-02-28  7:18 Icenowy Zheng
2017-03-01 10:14 ` Maxime Ripard
2017-02-27 19:40 [PATCH 1/3] dt-bindings: document the thermal sensor of Allwinner H3 SoC Icenowy Zheng
2017-02-27 19:40 ` [PATCH 2/3] thermal: add support for the thermal sensor on Allwinner new SoCs Icenowy Zheng
     [not found]   ` <20170227194054.51951-2-icenowy-ymACFijhrKM@public.gmane.org>
2017-02-28  6:44     ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).