2021-06-24 16:23:01

by Esmil

[permalink] [raw]
Subject: [PATCH v2 0/2] hwmon: Add StarFive JH7100 temperature sensor

From: Emil Renner Berthing <[email protected]>

This adds a driver for the temperature sensor on the JH7100, a RISC-V
SoC by StarFive Technology Co. Ltd., and most likely also the upcoming
JH7110 version.

The SoC is used on the BeagleV Starlight board:
https://github.com/beagleboard/beaglev-starlight

Support for this SoC is not yet upstreamed, but is actively worked on,
so it should only be a matter of time before that happens.

v2:
* Fix checkpatch.pl --strict warnings
- Add myself to MAINTAINERS
- Fix multiline comments
- Use proper case and whitespace for #defines
- Add comment to sfctemp::lock mutex.
* Remaining comments by Guenter Roeck
- Add Documentation/hwmon/sfctemp.rst
- Use devm_add_action() and devm_hwmon_device_register_with_info()
instead of a driver .remove function.
- Don't do test conversion at probe time.
- #include <linux/io.h>
- Remove unused #defines
- Use int return variable in sfctemp_convert().
* Add Samin's Signed-off-by to patch 2/2

Emil Renner Berthing (2):
dt-bindings: hwmon: add starfive,jh7100-temp bindings
hwmon: (sfctemp) Add StarFive JH7100 temperature sensor

.../bindings/hwmon/starfive,jh7100-temp.yaml | 43 +++
Documentation/hwmon/index.rst | 1 +
Documentation/hwmon/sfctemp.rst | 32 ++
MAINTAINERS | 8 +
drivers/hwmon/Kconfig | 10 +
drivers/hwmon/Makefile | 1 +
drivers/hwmon/sfctemp.c | 288 ++++++++++++++++++
7 files changed, 383 insertions(+)
create mode 100644 Documentation/devicetree/bindings/hwmon/starfive,jh7100-temp.yaml
create mode 100644 Documentation/hwmon/sfctemp.rst
create mode 100644 drivers/hwmon/sfctemp.c

--
2.32.0


2021-06-24 16:23:07

by Esmil

[permalink] [raw]
Subject: [PATCH v2 1/2] dt-bindings: hwmon: add starfive,jh7100-temp bindings

From: Emil Renner Berthing <[email protected]>

Add bindings for the temperature sensor on the StarFive JH7100 SoC.

Signed-off-by: Emil Renner Berthing <[email protected]>
---
.../bindings/hwmon/starfive,jh7100-temp.yaml | 43 +++++++++++++++++++
1 file changed, 43 insertions(+)
create mode 100644 Documentation/devicetree/bindings/hwmon/starfive,jh7100-temp.yaml

diff --git a/Documentation/devicetree/bindings/hwmon/starfive,jh7100-temp.yaml b/Documentation/devicetree/bindings/hwmon/starfive,jh7100-temp.yaml
new file mode 100644
index 000000000000..5ca52c08d142
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/starfive,jh7100-temp.yaml
@@ -0,0 +1,43 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/hwmon/starfive,jh7100-temp.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: StarFive JH7100 Temperature Sensor
+
+maintainers:
+ - Emil Renner Berthing <[email protected]>
+
+description: |
+ StarFive Technology Co. JH7100 embedded temperature sensor
+
+properties:
+ compatible:
+ enum:
+ - starfive,jh7100-temp
+
+ reg:
+ maxItems: 1
+
+ '#thermal-sensor-cells':
+ const: 0
+
+ interrupts:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+ - interrupts
+
+additionalProperties: false
+
+examples:
+ - |
+ tmon: tmon@124a0000 {
+ compatible = "starfive,jh7100-temp";
+ reg = <0x124a0000 0x10000>;
+ #thermal-sensor-cells = <0>;
+ interrupts = <122>;
+ };
--
2.32.0

2021-07-14 19:33:49

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] dt-bindings: hwmon: add starfive,jh7100-temp bindings

On Thu, 24 Jun 2021 18:21:07 +0200, Emil Renner Berthing wrote:
> From: Emil Renner Berthing <[email protected]>
>
> Add bindings for the temperature sensor on the StarFive JH7100 SoC.
>
> Signed-off-by: Emil Renner Berthing <[email protected]>
> ---
> .../bindings/hwmon/starfive,jh7100-temp.yaml | 43 +++++++++++++++++++
> 1 file changed, 43 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/hwmon/starfive,jh7100-temp.yaml
>

Reviewed-by: Rob Herring <[email protected]>

2021-07-14 19:38:15

by Esmil

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] dt-bindings: hwmon: add starfive,jh7100-temp bindings

On Wed, 14 Jul 2021 at 21:32, Rob Herring <[email protected]> wrote:
> On Thu, 24 Jun 2021 18:21:07 +0200, Emil Renner Berthing wrote:
> > From: Emil Renner Berthing <[email protected]>
> >
> > Add bindings for the temperature sensor on the StarFive JH7100 SoC.
> >
> > Signed-off-by: Emil Renner Berthing <[email protected]>
> > ---
> > .../bindings/hwmon/starfive,jh7100-temp.yaml | 43 +++++++++++++++++++
> > 1 file changed, 43 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/hwmon/starfive,jh7100-temp.yaml
> >
>
> Reviewed-by: Rob Herring <[email protected]>

Thank you!