linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] dt-bindings: hwmon: Add bindings for Winbond W83781D
@ 2021-07-29 23:05 Linus Walleij
  2021-07-29 23:05 ` [PATCH 2/2] hwmon: (w83781d) Match on device tree compatibles Linus Walleij
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Linus Walleij @ 2021-07-29 23:05 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck; +Cc: linux-hwmon, Linus Walleij, devicetree

This adds a device tree binding for the Winbond W83781D and its
sibling HW monitoring ICs. This is used in for example the Freecom
FSG-3 router/NAS.

Cc: devicetree@vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 .../bindings/hwmon/winbond,w83781d.yaml       | 41 +++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/winbond,w83781d.yaml

diff --git a/Documentation/devicetree/bindings/hwmon/winbond,w83781d.yaml b/Documentation/devicetree/bindings/hwmon/winbond,w83781d.yaml
new file mode 100644
index 000000000000..31ce77a4b087
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/winbond,w83781d.yaml
@@ -0,0 +1,41 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+
+$id: http://devicetree.org/schemas/hwmon/winbond,w83781d.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Winbond W83781 and compatible hardware monitor IC
+
+maintainers:
+  - Linus Walleij <linus.walleij@linaro.org>
+
+properties:
+  compatible:
+    enum:
+      - winbond,w83781d
+      - winbond,w83781g
+      - winbond,w83782d
+      - winbond,w83783s
+      - asus,as99127f
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        temperature-sensor@28 {
+            compatible = "winbond,w83781d";
+            reg = <0x28>;
+        };
+    };
-- 
2.31.1


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

* [PATCH 2/2] hwmon: (w83781d) Match on device tree compatibles
  2021-07-29 23:05 [PATCH 1/2] dt-bindings: hwmon: Add bindings for Winbond W83781D Linus Walleij
@ 2021-07-29 23:05 ` Linus Walleij
  2021-07-30 17:10   ` Guenter Roeck
  2021-08-03 19:40   ` Guenter Roeck
  2021-08-03 19:25 ` [PATCH 1/2] dt-bindings: hwmon: Add bindings for Winbond W83781D Rob Herring
  2021-08-03 19:39 ` Guenter Roeck
  2 siblings, 2 replies; 6+ messages in thread
From: Linus Walleij @ 2021-07-29 23:05 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck; +Cc: linux-hwmon, Linus Walleij

I2C devices should match on the proper compatible string.
This is already used in one device tree in the kernel (MIPS)
so let's add the matches.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/hwmon/w83781d.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
index e84aa5604e64..ce8e2c10e854 100644
--- a/drivers/hwmon/w83781d.c
+++ b/drivers/hwmon/w83781d.c
@@ -1571,10 +1571,21 @@ static const struct i2c_device_id w83781d_ids[] = {
 };
 MODULE_DEVICE_TABLE(i2c, w83781d_ids);
 
+static const struct of_device_id w83781d_of_match[] = {
+	{ .compatible = "winbond,w83781d" },
+	{ .compatible = "winbond,w83781g" },
+	{ .compatible = "winbond,w83782d" },
+	{ .compatible = "winbond,w83783s" },
+	{ .compatible = "asus,as99127f" },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, w83781d_of_match);
+
 static struct i2c_driver w83781d_driver = {
 	.class		= I2C_CLASS_HWMON,
 	.driver = {
 		.name = "w83781d",
+		.of_match_table = w83781d_of_match,
 	},
 	.probe_new	= w83781d_probe,
 	.remove		= w83781d_remove,
-- 
2.31.1


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

* Re: [PATCH 2/2] hwmon: (w83781d) Match on device tree compatibles
  2021-07-29 23:05 ` [PATCH 2/2] hwmon: (w83781d) Match on device tree compatibles Linus Walleij
@ 2021-07-30 17:10   ` Guenter Roeck
  2021-08-03 19:40   ` Guenter Roeck
  1 sibling, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2021-07-30 17:10 UTC (permalink / raw)
  To: Linus Walleij, Jean Delvare; +Cc: linux-hwmon

On 7/29/21 4:05 PM, Linus Walleij wrote:
> I2C devices should match on the proper compatible string.
> This is already used in one device tree in the kernel (MIPS)
> so let's add the matches.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

For my reference:

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

Waiting for Rob's approval of the devicetree patch.

Thanks,
Guenter

> ---
>   drivers/hwmon/w83781d.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
> index e84aa5604e64..ce8e2c10e854 100644
> --- a/drivers/hwmon/w83781d.c
> +++ b/drivers/hwmon/w83781d.c
> @@ -1571,10 +1571,21 @@ static const struct i2c_device_id w83781d_ids[] = {
>   };
>   MODULE_DEVICE_TABLE(i2c, w83781d_ids);
>   
> +static const struct of_device_id w83781d_of_match[] = {
> +	{ .compatible = "winbond,w83781d" },
> +	{ .compatible = "winbond,w83781g" },
> +	{ .compatible = "winbond,w83782d" },
> +	{ .compatible = "winbond,w83783s" },
> +	{ .compatible = "asus,as99127f" },
> +	{ },
> +};
> +MODULE_DEVICE_TABLE(of, w83781d_of_match);
> +
>   static struct i2c_driver w83781d_driver = {
>   	.class		= I2C_CLASS_HWMON,
>   	.driver = {
>   		.name = "w83781d",
> +		.of_match_table = w83781d_of_match,
>   	},
>   	.probe_new	= w83781d_probe,
>   	.remove		= w83781d_remove,
> 


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

* Re: [PATCH 1/2] dt-bindings: hwmon: Add bindings for Winbond W83781D
  2021-07-29 23:05 [PATCH 1/2] dt-bindings: hwmon: Add bindings for Winbond W83781D Linus Walleij
  2021-07-29 23:05 ` [PATCH 2/2] hwmon: (w83781d) Match on device tree compatibles Linus Walleij
@ 2021-08-03 19:25 ` Rob Herring
  2021-08-03 19:39 ` Guenter Roeck
  2 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2021-08-03 19:25 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Guenter Roeck, linux-hwmon, Jean Delvare, devicetree

On Fri, 30 Jul 2021 01:05:42 +0200, Linus Walleij wrote:
> This adds a device tree binding for the Winbond W83781D and its
> sibling HW monitoring ICs. This is used in for example the Freecom
> FSG-3 router/NAS.
> 
> Cc: devicetree@vger.kernel.org
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  .../bindings/hwmon/winbond,w83781d.yaml       | 41 +++++++++++++++++++
>  1 file changed, 41 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/hwmon/winbond,w83781d.yaml
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH 1/2] dt-bindings: hwmon: Add bindings for Winbond W83781D
  2021-07-29 23:05 [PATCH 1/2] dt-bindings: hwmon: Add bindings for Winbond W83781D Linus Walleij
  2021-07-29 23:05 ` [PATCH 2/2] hwmon: (w83781d) Match on device tree compatibles Linus Walleij
  2021-08-03 19:25 ` [PATCH 1/2] dt-bindings: hwmon: Add bindings for Winbond W83781D Rob Herring
@ 2021-08-03 19:39 ` Guenter Roeck
  2 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2021-08-03 19:39 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Jean Delvare, linux-hwmon, devicetree

On Fri, Jul 30, 2021 at 01:05:42AM +0200, Linus Walleij wrote:
> This adds a device tree binding for the Winbond W83781D and its
> sibling HW monitoring ICs. This is used in for example the Freecom
> FSG-3 router/NAS.
> 
> Cc: devicetree@vger.kernel.org
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> Reviewed-by: Rob Herring <robh@kernel.org>

Applied.

Thanks,
Guenter

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

* Re: [PATCH 2/2] hwmon: (w83781d) Match on device tree compatibles
  2021-07-29 23:05 ` [PATCH 2/2] hwmon: (w83781d) Match on device tree compatibles Linus Walleij
  2021-07-30 17:10   ` Guenter Roeck
@ 2021-08-03 19:40   ` Guenter Roeck
  1 sibling, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2021-08-03 19:40 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Jean Delvare, linux-hwmon

On Fri, Jul 30, 2021 at 01:05:43AM +0200, Linus Walleij wrote:
> I2C devices should match on the proper compatible string.
> This is already used in one device tree in the kernel (MIPS)
> so let's add the matches.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>

Applied.

Thanks,
Guenter

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

end of thread, other threads:[~2021-08-03 19:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-29 23:05 [PATCH 1/2] dt-bindings: hwmon: Add bindings for Winbond W83781D Linus Walleij
2021-07-29 23:05 ` [PATCH 2/2] hwmon: (w83781d) Match on device tree compatibles Linus Walleij
2021-07-30 17:10   ` Guenter Roeck
2021-08-03 19:40   ` Guenter Roeck
2021-08-03 19:25 ` [PATCH 1/2] dt-bindings: hwmon: Add bindings for Winbond W83781D Rob Herring
2021-08-03 19:39 ` Guenter Roeck

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).