Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1730484 > unrolled thread

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

Started byAlan Tull <atull@kernel.org>
First post2017-09-11 21:20 +0200
Last post2017-09-18 23:20 +0200
Articles 11 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/2] dt-bindings: hwmon: add compatible for max1619 Alan Tull <atull@kernel.org> - 2017-09-11 21:20 +0200
    [PATCH 2/2] hwmon: add dt binding for max1619 Alan Tull <atull@kernel.org> - 2017-09-11 21:20 +0200
      Re: [PATCH 2/2] hwmon: add dt binding for max1619 Alan Tull <atull@kernel.org> - 2017-09-11 21:40 +0200
      Re: [PATCH 2/2] hwmon: add dt binding for max1619 Guenter Roeck <linux@roeck-us.net> - 2017-09-11 22:00 +0200
        Re: [PATCH 2/2] hwmon: add dt binding for max1619 Alan Tull <atull@kernel.org> - 2017-09-11 23:20 +0200
        Re: [PATCH 2/2] hwmon: add dt binding for max1619 Rob Herring <robh@kernel.org> - 2017-09-18 23:20 +0200
          Re: [PATCH 2/2] hwmon: add dt binding for max1619 Alan Tull <atull@kernel.org> - 2017-09-19 20:20 +0200
            Re: [PATCH 2/2] hwmon: add dt binding for max1619 Rob Herring <robh@kernel.org> - 2017-09-19 21:40 +0200
    Re: [PATCH 1/2] dt-bindings: hwmon: add compatible for max1619 Alan Tull <atull@kernel.org> - 2017-09-11 21:40 +0200
      Re: [PATCH 1/2] dt-bindings: hwmon: add compatible for max1619 Alan Tull <atull@kernel.org> - 2017-09-11 23:20 +0200
        Re: [PATCH 1/2] dt-bindings: hwmon: add compatible for max1619 Rob Herring <robh@kernel.org> - 2017-09-18 23:20 +0200

#1730484 — [PATCH 1/2] dt-bindings: hwmon: add compatible for max1619

FromAlan Tull <atull@kernel.org>
Date2017-09-11 21:20 +0200
Subject[PATCH 1/2] dt-bindings: hwmon: add compatible for max1619
Message-ID<uoCps-7wc-7@gated-at.bofh.it>
Add new device tree bindings document for max1619 device
including a new compatible string.

Signed-off-by: Alan Tull <atull@kernel.org>
Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
---
 Documentation/devicetree/bindings/hwmon/max1619.txt | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/max1619.txt

diff --git a/Documentation/devicetree/bindings/hwmon/max1619.txt b/Documentation/devicetree/bindings/hwmon/max1619.txt
new file mode 100644
index 0000000..c70dbbe
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/max1619.txt
@@ -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

[toc] | [next] | [standalone]


#1730485 — [PATCH 2/2] hwmon: add dt binding for max1619

FromAlan Tull <atull@kernel.org>
Date2017-09-11 21:20 +0200
Subject[PATCH 2/2] hwmon: add dt binding for max1619
Message-ID<uoCps-7wc-13@gated-at.bofh.it>
In reply to#1730484
Add new device tree binding for max1619.

Signed-off-by: Alan Tull <atull@kernel.org>
Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
---
 drivers/hwmon/max1619.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/hwmon/max1619.c b/drivers/hwmon/max1619.c
index a182789..76d9669 100644
--- a/drivers/hwmon/max1619.c
+++ b/drivers/hwmon/max1619.c
@@ -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

[toc] | [prev] | [next] | [standalone]


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

FromAlan Tull <atull@kernel.org>
Date2017-09-11 21:40 +0200
SubjectRe: [PATCH 2/2] hwmon: add dt binding for max1619
Message-ID<uoCIO-7F7-13@gated-at.bofh.it>
In reply to#1730485
On Mon, Sep 11, 2017 at 2:16 PM, Alan Tull <atull@kernel.org> wrote:

Add Oleksij Rempel <bug-track@fisher-privat.net>

> Add new device tree binding for max1619.
>
> Signed-off-by: Alan Tull <atull@kernel.org>
> Cc: Jean Delvare <jdelvare@suse.com>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> ---
>  drivers/hwmon/max1619.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/drivers/hwmon/max1619.c b/drivers/hwmon/max1619.c
> index a182789..76d9669 100644
> --- a/drivers/hwmon/max1619.c
> +++ b/drivers/hwmon/max1619.c
> @@ -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
>

[toc] | [prev] | [next] | [standalone]


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

FromGuenter Roeck <linux@roeck-us.net>
Date2017-09-11 22:00 +0200
SubjectRe: [PATCH 2/2] hwmon: add dt binding for max1619
Message-ID<uoD2a-7Me-41@gated-at.bofh.it>
In reply to#1730485
On Mon, Sep 11, 2017 at 02:16:49PM -0500, Alan Tull wrote:
> Add new device tree binding for max1619.
> 
> Signed-off-by: Alan Tull <atull@kernel.org>

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

Guenter

> Cc: Jean Delvare <jdelvare@suse.com>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> ---
>  drivers/hwmon/max1619.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/hwmon/max1619.c b/drivers/hwmon/max1619.c
> index a182789..76d9669 100644
> --- a/drivers/hwmon/max1619.c
> +++ b/drivers/hwmon/max1619.c
> @@ -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
> 

[toc] | [prev] | [next] | [standalone]


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

FromAlan Tull <atull@kernel.org>
Date2017-09-11 23:20 +0200
SubjectRe: [PATCH 2/2] hwmon: add dt binding for max1619
Message-ID<uoEhB-hu-25@gated-at.bofh.it>
In reply to#1730510
On Mon, Sep 11, 2017 at 2:58 PM, Guenter Roeck <linux@roeck-us.net> wrote:
> On Mon, Sep 11, 2017 at 02:16:49PM -0500, Alan Tull wrote:
>> Add new device tree binding for max1619.
>>
>> Signed-off-by: Alan Tull <atull@kernel.org>
>
> 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!

>
> Guenter
>
>> Cc: Jean Delvare <jdelvare@suse.com>
>> Cc: Guenter Roeck <linux@roeck-us.net>
>> Cc: Rob Herring <robh+dt@kernel.org>
>> Cc: Mark Rutland <mark.rutland@arm.com>
>> ---
>>  drivers/hwmon/max1619.c | 10 ++++++++++
>>  1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/hwmon/max1619.c b/drivers/hwmon/max1619.c
>> index a182789..76d9669 100644
>> --- a/drivers/hwmon/max1619.c
>> +++ b/drivers/hwmon/max1619.c
>> @@ -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
>>

[toc] | [prev] | [next] | [standalone]


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

FromRob Herring <robh@kernel.org>
Date2017-09-18 23:20 +0200
SubjectRe: [PATCH 2/2] hwmon: add dt binding for max1619
Message-ID<urbCr-3rH-23@gated-at.bofh.it>
In reply to#1730510
On Mon, Sep 11, 2017 at 12:58:57PM -0700, Guenter Roeck wrote:
> On Mon, Sep 11, 2017 at 02:16:49PM -0500, Alan Tull wrote:
> > Add new device tree binding for max1619.
> > 
> > Signed-off-by: Alan Tull <atull@kernel.org>
> 
> 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

[toc] | [prev] | [next] | [standalone]


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

FromAlan Tull <atull@kernel.org>
Date2017-09-19 20:20 +0200
SubjectRe: [PATCH 2/2] hwmon: add dt binding for max1619
Message-ID<urvhL-nD-15@gated-at.bofh.it>
In reply to#1734488
On Mon, Sep 18, 2017 at 4:11 PM, Rob Herring <robh@kernel.org> wrote:
> On Mon, Sep 11, 2017 at 12:58:57PM -0700, Guenter Roeck wrote:
>> On Mon, Sep 11, 2017 at 02:16:49PM -0500, Alan Tull wrote:
>> > Add new device tree binding for max1619.
>> >
>> > Signed-off-by: Alan Tull <atull@kernel.org>
>>
>> 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

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

[toc] | [prev] | [next] | [standalone]


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

FromRob Herring <robh@kernel.org>
Date2017-09-19 21:40 +0200
SubjectRe: [PATCH 2/2] hwmon: add dt binding for max1619
Message-ID<urwxc-15w-15@gated-at.bofh.it>
In reply to#1735145
On Tue, Sep 19, 2017 at 1:11 PM, Alan Tull <atull@kernel.org> wrote:
> On Mon, Sep 18, 2017 at 4:11 PM, Rob Herring <robh@kernel.org> wrote:
>> On Mon, Sep 11, 2017 at 12:58:57PM -0700, Guenter Roeck wrote:
>>> On Mon, Sep 11, 2017 at 02:16:49PM -0500, Alan Tull wrote:
>>> > Add new device tree binding for max1619.
>>> >
>>> > Signed-off-by: Alan Tull <atull@kernel.org>
>>>
>>> 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.

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

[toc] | [prev] | [next] | [standalone]


#1730493

FromAlan Tull <atull@kernel.org>
Date2017-09-11 21:40 +0200
Message-ID<uoCIP-7F7-39@gated-at.bofh.it>
In reply to#1730484
On Mon, Sep 11, 2017 at 2:16 PM, Alan Tull <atull@kernel.org> wrote:

Add Oleksij Rempel

> Add new device tree bindings document for max1619 device
> including a new compatible string.
>
> Signed-off-by: Alan Tull <atull@kernel.org>
> Cc: Jean Delvare <jdelvare@suse.com>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> ---
>  Documentation/devicetree/bindings/hwmon/max1619.txt | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/hwmon/max1619.txt
>
> diff --git a/Documentation/devicetree/bindings/hwmon/max1619.txt b/Documentation/devicetree/bindings/hwmon/max1619.txt
> new file mode 100644
> index 0000000..c70dbbe
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/hwmon/max1619.txt
> @@ -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
>

[toc] | [prev] | [next] | [standalone]


#1730554

FromAlan Tull <atull@kernel.org>
Date2017-09-11 23:20 +0200
Message-ID<uoEhB-hu-21@gated-at.bofh.it>
In reply to#1730493
On Mon, Sep 11, 2017 at 2:33 PM, Alan Tull <atull@kernel.org> 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

> On Mon, Sep 11, 2017 at 2:16 PM, Alan Tull <atull@kernel.org> wrote:
>
> Add Oleksij Rempel
>
>> Add new device tree bindings document for max1619 device
>> including a new compatible string.
>>
>> Signed-off-by: Alan Tull <atull@kernel.org>
>> Cc: Jean Delvare <jdelvare@suse.com>
>> Cc: Guenter Roeck <linux@roeck-us.net>
>> Cc: Rob Herring <robh+dt@kernel.org>
>> Cc: Mark Rutland <mark.rutland@arm.com>
>> ---
>>  Documentation/devicetree/bindings/hwmon/max1619.txt | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/hwmon/max1619.txt
>>
>> diff --git a/Documentation/devicetree/bindings/hwmon/max1619.txt b/Documentation/devicetree/bindings/hwmon/max1619.txt
>> new file mode 100644
>> index 0000000..c70dbbe
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/hwmon/max1619.txt
>> @@ -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
>>

[toc] | [prev] | [next] | [standalone]


#1734487

FromRob Herring <robh@kernel.org>
Date2017-09-18 23:20 +0200
Message-ID<urbCq-3rH-3@gated-at.bofh.it>
In reply to#1730554
On Mon, Sep 11, 2017 at 04:18:22PM -0500, Alan Tull wrote:
> On Mon, Sep 11, 2017 at 2:33 PM, Alan Tull <atull@kernel.org> 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,

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

Rob

> 
> Alan
> 
> > On Mon, Sep 11, 2017 at 2:16 PM, Alan Tull <atull@kernel.org> wrote:
> >
> > Add Oleksij Rempel
> >
> >> Add new device tree bindings document for max1619 device
> >> including a new compatible string.
> >>
> >> Signed-off-by: Alan Tull <atull@kernel.org>
> >> Cc: Jean Delvare <jdelvare@suse.com>
> >> Cc: Guenter Roeck <linux@roeck-us.net>
> >> Cc: Rob Herring <robh+dt@kernel.org>
> >> Cc: Mark Rutland <mark.rutland@arm.com>
> >> ---
> >>  Documentation/devicetree/bindings/hwmon/max1619.txt | 12 ++++++++++++
> >>  1 file changed, 12 insertions(+)
> >>  create mode 100644 Documentation/devicetree/bindings/hwmon/max1619.txt
> >>
> >> diff --git a/Documentation/devicetree/bindings/hwmon/max1619.txt b/Documentation/devicetree/bindings/hwmon/max1619.txt
> >> new file mode 100644
> >> index 0000000..c70dbbe
> >> --- /dev/null
> >> +++ b/Documentation/devicetree/bindings/hwmon/max1619.txt
> >> @@ -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
> >>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web