Skip to contentSkip to conversation

dt-bindings: hwmon: add compatible for max1619

PATCH Applied Alan Tull 3 participants 15 messages Sep 11, 2017 – Oct 2, 2017

Subsystems (2)
lore
Share & tools
lore

Alan Tull

author
#0 lore raw

PATCH 1/2 dt-bindings: hwmon: add compatible for max1619

Add new device tree bindings document for max1619 device including a new compatible string.

Cc Jean Delvare <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Rob Herring <[email protected]>
Cc Mark Rutland <[email protected]>
---
 Documentation/devicetree/bindings/hwmon/max1619.txt | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/max1619.txt
Documentation/devicetree/bindings/hwmon/max1619.txt new file +12 -0
new file mode 100644
index 0000000..c70dbbe
@@ -0,0 +1,12 @@
+Bindings for MAX1619 Temperature Sensor
+
+Required properties:
+- compatible : "maxim,max1619"
+- reg        : I2C address, one of 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, 0x4c, or
+               0x4d, 0x4e
+
+Example:
+	temp@4c {
+		compatible = "maxim,max1619";
+		reg = <0x4c>;
+	};
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 2/2 hwmon: add dt binding for max1619

Add new device tree binding for max1619.

Cc Jean Delvare <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Rob Herring <[email protected]>
Cc Mark Rutland <[email protected]>
---
 drivers/hwmon/max1619.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/hwmon/max1619.c +10 -0
index a182789..76d9669 100644
@@ -303,10 +303,20 @@ static const struct i2c_device_id max1619_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, max1619_id);
 
+#ifdef CONFIG_OF
+static const struct of_device_id max1619_of_match[] = {
+	{ .compatible = "maxim,max1619", },
+	{},
+};
+
+MODULE_DEVICE_TABLE(of, max1619_of_match);
+#endif
+
 static struct i2c_driver max1619_driver = {
 	.class		= I2C_CLASS_HWMON,
 	.driver = {
 		.name	= "max1619",
+		.of_match_table = of_match_ptr(max1619_of_match),
 	},
 	.probe		= max1619_probe,
 	.id_table	= max1619_id,
Signature · 1 line
2.7.4
author
#2 lore raw

Re: [PATCH 2/2] hwmon: add dt binding for max1619

On Mon, Sep 11, 2017 at 2:16 PM, Alan Tull <[email protected]> wrote:

Add Oleksij Rempel <[email protected]>

Quoted 39 lines

Add new device tree binding for max1619.

Cc Jean Delvare <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Rob Herring <[email protected]>
Cc Mark Rutland <[email protected]>
---
 drivers/hwmon/max1619.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/hwmon/max1619.c +10 -1
index a182789..76d9669 100644
@@ -303,10 +303,20 @@ static const struct i2c_device_id max1619_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, max1619_id);
 
+#ifdef CONFIG_OF
+static const struct of_device_id max1619_of_match[] = {
+       { .compatible = "maxim,max1619", },
+       {},
+};
+
+MODULE_DEVICE_TABLE(of, max1619_of_match);
+#endif
+
 static struct i2c_driver max1619_driver = {
        .class          = I2C_CLASS_HWMON,
        .driver = {
                .name   = "max1619",
+               .of_match_table = of_match_ptr(max1619_of_match),
        },
        .probe          = max1619_probe,
        .id_table       = max1619_id,
--

2.7.4

author
#11 lore raw
In reply to Alan Tull

On Mon, Sep 11, 2017 at 2:16 PM, Alan Tull <[email protected]> wrote:

Add Oleksij Rempel

Quoted 34 lines

Add new device tree bindings document for max1619 device including a new compatible string.

Cc Jean Delvare <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Rob Herring <[email protected]>
Cc Mark Rutland <[email protected]>
---
 Documentation/devicetree/bindings/hwmon/max1619.txt | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/max1619.txt
Documentation/devicetree/bindings/hwmon/max1619.txt new file +12 -1
new file mode 100644
index 0000000..c70dbbe
@@ -0,0 +1,12 @@
+Bindings for MAX1619 Temperature Sensor
+
+Required properties:
+- compatible : "maxim,max1619"
+- reg        : I2C address, one of 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, 0x4c, or
+               0x4d, 0x4e
+
+Example:
+       temp@4c {
+               compatible = "maxim,max1619";
+               reg = <0x4c>;
+       };
--

2.7.4

maintainer
#3 lore raw

Re: [PATCH 2/2] hwmon: add dt binding for max1619

In reply to Alan Tull
Quoted 3 lines · Alan Tull

Add new device tree binding for max1619.

Technically that should already work, without explicit binding, or did the i2c core change lately ?

Guenter

Quoted 36 lines
Cc Jean Delvare <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Rob Herring <[email protected]>
Cc Mark Rutland <[email protected]>
---
 drivers/hwmon/max1619.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/hwmon/max1619.c +10 -0
index a182789..76d9669 100644
@@ -303,10 +303,20 @@ static const struct i2c_device_id max1619_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, max1619_id);
 
+#ifdef CONFIG_OF
+static const struct of_device_id max1619_of_match[] = {
+	{ .compatible = "maxim,max1619", },
+	{},
+};
+
+MODULE_DEVICE_TABLE(of, max1619_of_match);
+#endif
+
 static struct i2c_driver max1619_driver = {
 	.class		= I2C_CLASS_HWMON,
 	.driver = {
 		.name	= "max1619",
+		.of_match_table = of_match_ptr(max1619_of_match),
 	},
 	.probe		= max1619_probe,
 	.id_table	= max1619_id,
Signature · 1 line
2.7.4
author
#4 lore raw

Re: [PATCH 2/2] hwmon: add dt binding for max1619

Quoted 7 lines · Guenter Roeck
Quoted 3 lines · Alan Tull

Add new device tree binding for max1619.

Technically that should already work, without explicit binding, or did the i2c core change lately ?

OK I see that now. Yep, this change is not needed. Thanks!

Quoted 39 lines

Guenter

Quoted 36 lines
Cc Jean Delvare <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Rob Herring <[email protected]>
Cc Mark Rutland <[email protected]>
---
 drivers/hwmon/max1619.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/hwmon/max1619.c +10 -1
index a182789..76d9669 100644
@@ -303,10 +303,20 @@ static const struct i2c_device_id max1619_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, max1619_id);
 
+#ifdef CONFIG_OF
+static const struct of_device_id max1619_of_match[] = {
+     { .compatible = "maxim,max1619", },
+     {},
+};
+
+MODULE_DEVICE_TABLE(of, max1619_of_match);
+#endif
+
 static struct i2c_driver max1619_driver = {
      .class          = I2C_CLASS_HWMON,
      .driver = {
              .name   = "max1619",
+             .of_match_table = of_match_ptr(max1619_of_match),
      },
      .probe          = max1619_probe,
      .id_table       = max1619_id,
--

2.7.4

author
#12 lore raw
In reply to Alan Tull

On Mon, Sep 11, 2017 at 2:33 PM, Alan Tull <[email protected]> wrote:

Forget this - Guenter has pointed out that this patch is not needed, as the i2c layer handles this without needing the compatible added.

Alan

Quoted 38 lines · Alan Tull

Add Oleksij Rempel

Quoted 34 lines

Add new device tree bindings document for max1619 device including a new compatible string.

Cc Jean Delvare <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Rob Herring <[email protected]>
Cc Mark Rutland <[email protected]>
---
 Documentation/devicetree/bindings/hwmon/max1619.txt | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/max1619.txt
Documentation/devicetree/bindings/hwmon/max1619.txt new file +12 -1
new file mode 100644
index 0000000..c70dbbe
@@ -0,0 +1,12 @@
+Bindings for MAX1619 Temperature Sensor
+
+Required properties:
+- compatible : "maxim,max1619"
+- reg        : I2C address, one of 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, 0x4c, or
+               0x4d, 0x4e
+
+Example:
+       temp@4c {
+               compatible = "maxim,max1619";
+               reg = <0x4c>;
+       };
--

2.7.4

maintainer
#5 lore raw

Re: [PATCH 2/2] hwmon: add dt binding for max1619

In reply to Guenter Roeck
Quoted 7 lines · Guenter Roeck
Quoted 3 lines · Alan Tull

Add new device tree binding for max1619.

Technically that should already work, without explicit binding, or did the i2c core change lately ?

There was some work in that direction IIRC.

We don't really want to rely on that behavior and should have DT match strings.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer Acked-by
#13 lore raw
In reply to Alan Tull
Quoted 4 lines · Alan Tull

On Mon, Sep 11, 2017 at 2:33 PM, Alan Tull <[email protected]> wrote:

Forget this - Guenter has pointed out that this patch is not needed, as the i2c layer handles this without needing the compatible added.

The binding is needed regardless.

This could be in trivial-devices.txt instead. Either way,

Rob

Quoted 41 lines

Alan

Quoted 38 lines · Alan Tull

Add Oleksij Rempel

Quoted 34 lines

Add new device tree bindings document for max1619 device including a new compatible string.

Cc Jean Delvare <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Rob Herring <[email protected]>
Cc Mark Rutland <[email protected]>
---
 Documentation/devicetree/bindings/hwmon/max1619.txt | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/max1619.txt
Documentation/devicetree/bindings/hwmon/max1619.txt new file +12 -1
new file mode 100644
index 0000000..c70dbbe
@@ -0,0 +1,12 @@
+Bindings for MAX1619 Temperature Sensor
+
+Required properties:
+- compatible : "maxim,max1619"
+- reg        : I2C address, one of 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, 0x4c, or
+               0x4d, 0x4e
+
+Example:
+       temp@4c {
+               compatible = "maxim,max1619";
+               reg = <0x4c>;
+       };
--

2.7.4

author
#6 lore raw

Re: [PATCH 2/2] hwmon: add dt binding for max1619

In reply to Rob Herring
Quoted 10 lines · Rob Herring
Quoted 7 lines · Guenter Roeck
Quoted 3 lines · Alan Tull

Add new device tree binding for max1619.

Technically that should already work, without explicit binding, or did the i2c core change lately ?

There was some work in that direction IIRC.

Yes, after Guenter replied I tried it without this patch and it worked. i2c drivers can have a 'detect' function that can check part id, etc. If detection succeeds, it will fill in the device name in i2c_board_info->type and the i2c-core will enumerate using that.

Alan

Quoted 5 lines

We don't really want to rely on that behavior and should have DT match strings.

Rob

maintainer
#7 lore raw

Re: [PATCH 2/2] hwmon: add dt binding for max1619

Quoted 10 lines · Alan Tull
Quoted 9 lines · Rob Herring
Quoted 7 lines · Guenter Roeck
Quoted 3 lines · Alan Tull

Add new device tree binding for max1619.

Technically that should already work, without explicit binding, or did the i2c core change lately ?

Quoted 6 lines
Quoted 1 line

There was some work in that direction IIRC.

Yes, after Guenter replied I tried it without this patch and it worked. i2c drivers can have a 'detect' function that can check part id, etc. If detection succeeds, it will fill in the device name in i2c_board_info->type and the i2c-core will enumerate using that.

Right, I expected it still worked, but am saying we don't want to rely on that behavior and introduce new places relying on it. Otherwise, the driver will match on say "rob,max1619" as well. The detect function is the really old way to probe devices IIRC. The function to look at is i2c_of_match_device. We want OF style match, not a match with i2c_of_match_device_sysfs which strips the vendor prefix from the compatible.

Rob

author
#8 lore raw

Re: [PATCH 2/2] hwmon: add dt binding for max1619

Quoted 18 lines · Rob Herring
Quoted 10 lines · Alan Tull
Quoted 9 lines · Rob Herring
Quoted 7 lines · Guenter Roeck
Quoted 3 lines · Alan Tull

Add new device tree binding for max1619.

Technically that should already work, without explicit binding, or did the i2c core change lately ?

Quoted 6 lines
Quoted 1 line

There was some work in that direction IIRC.

Yes, after Guenter replied I tried it without this patch and it worked. i2c drivers can have a 'detect' function that can check part id, etc. If detection succeeds, it will fill in the device name in i2c_board_info->type and the i2c-core will enumerate using that.

Quoted 7 lines

Right, I expected it still worked, but am saying we don't want to rely on that behavior and introduce new places relying on it. Otherwise, the driver will match on say "rob,max1619" as well. The detect function is the really old way to probe devices IIRC. The function to look at is i2c_of_match_device. We want OF style match, not a match with i2c_of_match_device_sysfs which strips the vendor prefix from the compatible.

OK, well my patch is out there if someone wants to take it.

Alan

Quoted 2 lines

Rob

maintainer Applied
#14 lore raw
In reply to Alan Tull
Quoted 9 lines · Alan Tull

Add new device tree bindings document for max1619 device including a new compatible string.

Cc Jean Delvare <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Rob Herring <[email protected]>
Cc Mark Rutland <[email protected]>

Applied to hwmon-next.

Thanks,
Guenter

Quoted 23 lines
---
 Documentation/devicetree/bindings/hwmon/max1619.txt | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/max1619.txt
Documentation/devicetree/bindings/hwmon/max1619.txt new file +12 -0
new file mode 100644
index 0000000..c70dbbe
@@ -0,0 +1,12 @@
+Bindings for MAX1619 Temperature Sensor
+
+Required properties:
+- compatible : "maxim,max1619"
+- reg        : I2C address, one of 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, 0x4c, or
+               0x4d, 0x4e
+
+Example:
+	temp@4c {
+		compatible = "maxim,max1619";
+		reg = <0x4c>;
+	};
maintainer Applied
#9 lore raw

Re: [2/2] hwmon: add dt binding for max1619

In reply to Alan Tull
Quoted 7 lines · Alan Tull

Add new device tree binding for max1619.

Cc Jean Delvare <jdelvare-IBi9RG/[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Rob Herring <[email protected]>
Cc Mark Rutland <[email protected]>

Applied to hwmon-next.

Thanks,
Guenter

Quoted 19 lines
---
 drivers/hwmon/max1619.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/hwmon/max1619.c +7 -0
index a182789..76d9669 100644
@@ -303,10 +303,20 @@ static const struct i2c_device_id max1619_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, max1619_id);
 
+#ifdef CONFIG_OF
+static const struct of_device_id max1619_of_match[] = {
+	{ .compatible = "maxim,max1619", },
+	{},
+};
+
+MODULE_DEVICE_TABLE(of, max1619_of_match);

drivers/hwmon/max1619.c static const struct i2c_device_id max1619_id[] = { · line 322

Quoted 10 lines
drivers/hwmon/max1619.c +3 -0
+#endif
+
 static struct i2c_driver max1619_driver = {
 	.class		= I2C_CLASS_HWMON,
 	.driver = {
 		.name	= "max1619",
+		.of_match_table = of_match_ptr(max1619_of_match),
 	},
 	.probe		= max1619_probe,
 	.id_table	= max1619_id,

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#10 lore raw

Re: [2/2] hwmon: add dt binding for max1619

Quoted 10 lines · Guenter Roeck
Quoted 7 lines · Alan Tull

Add new device tree binding for max1619.

Cc Jean Delvare <jdelvare-IBi9RG/[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Rob Herring <[email protected]>
Cc Mark Rutland <[email protected]>

Applied to hwmon-next.

Thanks!
Alan

Quoted 25 lines

Thanks,
Guenter

Quoted 21 lines
---
 drivers/hwmon/max1619.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/hwmon/max1619.c +9 -0
index a182789..76d9669 100644
@@ -303,10 +303,20 @@ static const struct i2c_device_id max1619_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, max1619_id);
 
+#ifdef CONFIG_OF
+static const struct of_device_id max1619_of_match[] = {
+     { .compatible = "maxim,max1619", },
+     {},
+};
+
+MODULE_DEVICE_TABLE(of, max1619_of_match);
+#endif
+
Quoted 8 lines

drivers/hwmon/max1619.c static const struct i2c_device_id max1619_id[] = { · line 322

Quoted 8 lines
drivers/hwmon/max1619.c +1 -0
 static struct i2c_driver max1619_driver = {
      .class          = I2C_CLASS_HWMON,
      .driver = {
              .name   = "max1619",
+             .of_match_table = of_match_ptr(max1619_of_match),
      },
      .probe          = max1619_probe,
      .id_table       = max1619_id,

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html