Skip to contentSkip to conversation

Add THERMAL control driver for Sunplus SP7021 SoC

PATCH Superseded Li-hao Kuo 2 participants 4 messages Jan 4, 2022 – Jan 11, 2022

Subsystems (2)

v3 of 11 Superseded Latest is v11 →

lore
Share & tools
lore

Li-hao Kuo

author
#0 lore raw

v3 cover Add THERMAL control driver for Sunplus SP7021 SoC

This is a patch series for THERMAL driver for Sunplus SP7021 SoC.

Sunplus SP7021 is an ARM Cortex A7 (4 cores) based SoC. It integrates many peripherals (ex: UART, I2C, SPI, SDIO, eMMC, USB, SD card and etc.) into a single chip. It is designed for industrial control.

Refer to:
https://sunplus-tibbo.atlassian.net/wiki/spaces/doc/overview
https://tibbo.com/store/plus1.html

Li-hao Kuo (2):
THERMAL: Add THERMAL driver for Sunplus SP7021
devicetree: bindings THERMAL Add bindings doc for Sunplus SP7021

 .../bindings/thermal/sunplus_thermal.yaml          |  49 +++++++
 MAINTAINERS                                        |   7 +
 drivers/thermal/Kconfig                            |  10 ++
 drivers/thermal/Makefile                           |   1 +
 drivers/thermal/sunplus_thermal.c                  | 161 +++++++++++++++++++++
 5 files changed, 228 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/thermal/sunplus_thermal.yaml
 create mode 100644 drivers/thermal/sunplus_thermal.c
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH v3 1/2 THERMAL: Add THERMAL driver for Sunplus SP7021

Add THERMAL driver for Sunplus SP7021.

---
Changes in v3:
- Modify Theraml driver

 MAINTAINERS                       |   6 ++
 drivers/thermal/Kconfig           |  10 +++
 drivers/thermal/Makefile          |   1 +
 drivers/thermal/sunplus_thermal.c | 161 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 178 insertions(+)
 create mode 100644 drivers/thermal/sunplus_thermal.c
MAINTAINERS +6 -0
index fb18ce7..4b02628 100644
@@ -18242,6 +18242,12 @@ L:	[email protected]
 S:	Maintained
 F:	drivers/net/ethernet/dlink/sundance.c
 
+SUNPLUS THERMAL DRIVER
+M:	Li-hao Kuo <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	drivers/thermal/sunplus_thermal.c
+
 SUPERH
 M:	Yoshinori Sato <[email protected]>
 M:	Rich Felker <[email protected]>
drivers/thermal/Kconfig +10 -0
index d7f44de..6643a81 100644
@@ -493,4 +493,14 @@ config KHADAS_MCU_FAN_THERMAL
 	  If you say yes here you get support for the FAN controlled
 	  by the Microcontroller found on the Khadas VIM boards.
 
+config SUNPLUS_THERMAL
+	tristate "Sunplus thermal drivers"
+	depends on SOC_SP7021
+	help
+	  This the Sunplus SP7021 thermal driver, which supports the primitive
+	  temperature sensor embedded in Sunplus SP7021 SoC.
+
+	  If you have a Sunplus SP7021 platform say Y here and enable this option
+	  to have support for thermal management
+
 endif
drivers/thermal/Makefile +1 -0
index 82fc3e6..23f8dce 100644
@@ -60,3 +60,4 @@ obj-$(CONFIG_UNIPHIER_THERMAL)	+= uniphier_thermal.o
 obj-$(CONFIG_AMLOGIC_THERMAL)     += amlogic_thermal.o
 obj-$(CONFIG_SPRD_THERMAL)	+= sprd_thermal.o
 obj-$(CONFIG_KHADAS_MCU_FAN_THERMAL)	+= khadas_mcu_fan.o
+obj-$(CONFIG_SUNPLUS_THERMAL)	+= sunplus_thermal.o
\ No newline at end of file
drivers/thermal/sunplus_thermal.c new file +161 -0

161 lines not on this page · raw message

Signature · 1 line
2.7.4
author
#2 lore raw

PATCH v3 2/2 devicetree: bindings THERMAL Add bindings doc for Sunplus SP7021

In reply to Li-hao Kuo

Add devicetree bindings THERMAL Add bindings doc for Sunplus SP7021

---
Changes in v3:
- Modify Theraml driver

 .../bindings/thermal/sunplus_thermal.yaml          | 49 ++++++++++++++++++++++
 MAINTAINERS                                        |  1 +
 2 files changed, 50 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/thermal/sunplus_thermal.yaml
Documentation/devicetree/bindings/thermal/sunplus_thermal.yaml new file +49 -0
new file mode 100644
index 0000000..e0290fa
@@ -0,0 +1,49 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+# Copyright (C) Sunplus Co., Ltd.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/thermal/sunplus_thermal.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Sunplus Thermal controller
+
+maintainers:
+  - Li-hao Kuo <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - sunplus,sp7021-thermal
+
+  reg:
+    maxItems: 1
+
+  reg-names:
+    items:
+      - const: reg
+      - const: moon4
+
+  nvmem-cells:
+    maxItems: 1
+
+  nvmem-cell-names:
+    const: therm_calib
+
+required:
+  - compatible
+  - reg
+  - reg-names
+  - nvmem-cells
+  - nvmem-cell-names
+
+additionalProperties: false
+
+examples:
+  - |
+    thermal@9c000280 {
+        compatible = "sunplus,sp7021-thermal";
+        reg = <0x9c000280 0x80>;
+        nvmem-cells = <&therm_calib>;
+        nvmem-cell-names = "therm_calib";
+    };
+...
MAINTAINERS +1 -0
index 4b02628..dd1b7bf 100644
@@ -18246,6 +18246,7 @@ SUNPLUS THERMAL DRIVER
 M:	Li-hao Kuo <[email protected]>
 L:	[email protected]
 S:	Maintained
+F:	Documentation/devicetree/bindings/thermal/sunplus_thermal.yaml
 F:	drivers/thermal/sunplus_thermal.c
 
 SUPERH
Signature · 1 line
2.7.4
maintainer
#3 lore raw

Re: [PATCH v3 2/2] devicetree: bindings THERMAL Add bindings doc for Sunplus SP7021

Quoted 1 line · Li-hao Kuo

Add devicetree bindings THERMAL Add bindings doc for Sunplus SP7021

Complete sentences please.

For the subject:

'dt-bindings: thermal: Add Sunplus SP7021 schema'

Quoted 31 lines

---
Changes in v3:
- Modify Theraml driver

 .../bindings/thermal/sunplus_thermal.yaml          | 49 ++++++++++++++++++++++
 MAINTAINERS                                        |  1 +
 2 files changed, 50 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/thermal/sunplus_thermal.yaml
Documentation/devicetree/bindings/thermal/sunplus_thermal.yaml new file +14 -0
new file mode 100644
index 0000000..e0290fa
@@ -0,0 +1,49 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+# Copyright (C) Sunplus Co., Ltd.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/thermal/sunplus_thermal.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Sunplus Thermal controller
+
+maintainers:
+  - Li-hao Kuo <[email protected]>
+
+properties:
+  compatible:

Documentation/devicetree/bindings/thermal/sunplus_thermal.yaml line 24

Quoted 10 lines
Documentation/devicetree/bindings/thermal/sunplus_thermal.yaml new file +10 -0
+    enum:
+      - sunplus,sp7021-thermal
+
+  reg:
+    maxItems: 1
+
+  reg-names:
+    items:
+      - const: reg
+      - const: moon4

Is it 1 entry or 2? reg and reg-names don't agree. If 1, drop 'reg-names'.

Documentation/devicetree/bindings/thermal/sunplus_thermal.yaml line 30

Quoted 6 lines
Documentation/devicetree/bindings/thermal/sunplus_thermal.yaml new file +6 -0
+
+  nvmem-cells:
+    maxItems: 1
+
+  nvmem-cell-names:
+    const: therm_calib

'therm_' is redundant.

Quoted 35 lines
Documentation/devicetree/bindings/thermal/sunplus_thermal.yaml new file +19 -0
+
+required:
+  - compatible
+  - reg
+  - reg-names
+  - nvmem-cells
+  - nvmem-cell-names
+
+additionalProperties: false
+
+examples:
+  - |
+    thermal@9c000280 {
+        compatible = "sunplus,sp7021-thermal";
+        reg = <0x9c000280 0x80>;
+        nvmem-cells = <&therm_calib>;
+        nvmem-cell-names = "therm_calib";
+    };
+...
MAINTAINERS +1 -0
index 4b02628..dd1b7bf 100644
@@ -18246,6 +18246,7 @@ SUNPLUS THERMAL DRIVER
 M:	Li-hao Kuo <[email protected]>
 L:	[email protected]
 S:	Maintained
+F:	Documentation/devicetree/bindings/thermal/sunplus_thermal.yaml
 F:	drivers/thermal/sunplus_thermal.c
 
 SUPERH
Signature · 1 line
2.7.4