This patchset add support for H6 thermal sensor.
BWY, do a cleanup in thermal makfile.
Yangtao Li (3):
thermal: sun8i: add thermal driver for h6
dt-bindings: thermal: add binding document for h6 thermal controller
thermal: fix indentation in makefile
.../bindings/thermal/sun8i-thermal.yaml | 71 +++
MAINTAINERS | 7 +
drivers/thermal/Kconfig | 14 +
drivers/thermal/Makefile | 9 +-
drivers/thermal/sun8i_thermal.c | 437 ++++++++++++++++++
5 files changed, 534 insertions(+), 4 deletions(-)
create mode 100644 Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml
create mode 100644 drivers/thermal/sun8i_thermal.c
---
v3:
-Add a sun8i prefix to some function
-Remove disable callback and rename enable to init
-Remove clock enable, calibration from init callback
-Convert driver to interrupt based
-Convert doc to yaml file
---
2.17.0
This patch adds binding document for allwinner h6 thermal controller.
Signed-off-by: Yangtao Li <[email protected]>
---
.../bindings/thermal/sun8i-thermal.yaml | 71 +++++++++++++++++++
1 file changed, 71 insertions(+)
create mode 100644 Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml
diff --git a/Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml b/Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml
new file mode 100644
index 000000000000..54cf1277870e
--- /dev/null
+++ b/Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml
@@ -0,0 +1,71 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/thermal/sun8i-thermal.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Allwinner SUN8I Thermal Controller Device Tree Bindings
+
+maintainers:
+ - Yangtao Li <[email protected]>
+
+description: |-
+ This describes the device tree binding for the Allwinner thermal
+ controller which measures the on-SoC temperatures.
+
+properties:
+ compatible:
+ enum:
+ - allwinner,sun50i-h6-ths
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ resets:
+ maxItems: 1
+
+ clocks:
+ items:
+ - description: ths bus clock
+
+ clock-names:
+ items:
+ - const: bus
+
+ "#thermal-sensor-cells":
+ enum: [ 0, 1 ]
+
+ nvmem-cells:
+ items:
+ - description: ths calibrate data
+
+ nvmem-cell-names:
+ items:
+ - const: calib
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - reset
+ - clocks
+ - clock-names
+
+examples:
+ - |
+ ths: ths@5070400 {
+ compatible = "allwinner,sun50i-h6-ths";
+ reg = <0x05070400 0x100>;
+ clocks = <&ccu CLK_BUS_THS>;
+ clock-names = "bus";
+ resets = <&ccu RST_BUS_THS>;
+ interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
+ nvmem-cells = <&tsen_calib>;
+ nvmem-cell-names = "calib";
+ #thermal-sensor-cells = <1>;
+ };
+
+...
--
2.17.0
Hi,
Thanks for working on this!
On Sat, May 25, 2019 at 02:13:28PM -0400, Yangtao Li wrote:
> This patch adds binding document for allwinner h6 thermal controller.
>
> Signed-off-by: Yangtao Li <[email protected]>
> ---
> .../bindings/thermal/sun8i-thermal.yaml | 71 +++++++++++++++++++
>
> 1 file changed, 71 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml
>
> diff --git a/Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml b/Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml
> new file mode 100644
> index 000000000000..54cf1277870e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/thermal/sun8i-thermal.yaml
> @@ -0,0 +1,71 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/thermal/sun8i-thermal.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Allwinner SUN8I Thermal Controller Device Tree Bindings
> +
> +maintainers:
> + - Yangtao Li <[email protected]>
> +
> +description: |-
> + This describes the device tree binding for the Allwinner thermal
> + controller which measures the on-SoC temperatures.
> +
> +properties:
> + compatible:
> + enum:
> + - allwinner,sun50i-h6-ths
> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + maxItems: 1
> +
> + resets:
> + maxItems: 1
> +
> + clocks:
> + items:
> + - description: ths bus clock
> +
> + clock-names:
> + items:
> + - const: bus
You don't need the items here, you can just do:
clocks:
maxItems: 1
description:
Bus clock
clock-names:
const: bus
> + "#thermal-sensor-cells":
> + enum: [ 0, 1 ]
You should document when you would need one or the other.
My guess is that you did it that way to deal with the A33? If so, we
can just request the cell size to be 1 for now, and then expand it to
an enum later on when we'll support the A33.
> + nvmem-cells:
> + items:
> + - description: ths calibrate data
> +
> + nvmem-cell-names:
> + items:
> + - const: calib
Same remark than for the clocks
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> + - reset
> + - clocks
> + - clock-names
I guess you'd need #thermal-sensor-cells too?
Maxime
--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com