All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] dt-bindings: hwmon: add compatible for max1619
@ 2017-09-11 19:16 Alan Tull
  2017-09-11 19:16 ` [PATCH 2/2] hwmon: add dt binding " Alan Tull
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Alan Tull @ 2017-09-11 19:16 UTC (permalink / raw)
  To: linux-hwmon, devicetree
  Cc: linux-kernel, Alan Tull, Jean Delvare, Guenter Roeck,
	Rob Herring, Mark Rutland

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

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

* [PATCH 2/2] hwmon: add dt binding for max1619
  2017-09-11 19:16 [PATCH 1/2] dt-bindings: hwmon: add compatible for max1619 Alan Tull
@ 2017-09-11 19:16 ` Alan Tull
  2017-09-11 19:32   ` Alan Tull
                     ` (2 more replies)
  2017-09-11 19:33 ` [PATCH 1/2] dt-bindings: hwmon: add compatible " Alan Tull
  2017-10-01 14:11 ` [1/2] " Guenter Roeck
  2 siblings, 3 replies; 18+ messages in thread
From: Alan Tull @ 2017-09-11 19:16 UTC (permalink / raw)
  To: linux-hwmon, devicetree
  Cc: linux-kernel, Alan Tull, Jean Delvare, Guenter Roeck,
	Rob Herring, Mark Rutland

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

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

* Re: [PATCH 2/2] hwmon: add dt binding for max1619
  2017-09-11 19:16 ` [PATCH 2/2] hwmon: add dt binding " Alan Tull
@ 2017-09-11 19:32   ` Alan Tull
  2017-09-11 19:58   ` Guenter Roeck
  2017-10-01 14:13     ` Guenter Roeck
  2 siblings, 0 replies; 18+ messages in thread
From: Alan Tull @ 2017-09-11 19:32 UTC (permalink / raw)
  To: linux-hwmon, devicetree
  Cc: linux-kernel, Alan Tull, Jean Delvare, Guenter Roeck,
	Rob Herring, Mark Rutland, Oleksij Rempel

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
>

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

* Re: [PATCH 1/2] dt-bindings: hwmon: add compatible for max1619
  2017-09-11 19:16 [PATCH 1/2] dt-bindings: hwmon: add compatible for max1619 Alan Tull
  2017-09-11 19:16 ` [PATCH 2/2] hwmon: add dt binding " Alan Tull
@ 2017-09-11 19:33 ` Alan Tull
  2017-09-11 21:18   ` Alan Tull
  2017-10-01 14:11 ` [1/2] " Guenter Roeck
  2 siblings, 1 reply; 18+ messages in thread
From: Alan Tull @ 2017-09-11 19:33 UTC (permalink / raw)
  To: linux-hwmon, devicetree
  Cc: linux-kernel, Alan Tull, Jean Delvare, Guenter Roeck,
	Rob Herring, Mark Rutland, Oleksij Rempel

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
>

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

* Re: [PATCH 2/2] hwmon: add dt binding for max1619
  2017-09-11 19:16 ` [PATCH 2/2] hwmon: add dt binding " Alan Tull
  2017-09-11 19:32   ` Alan Tull
@ 2017-09-11 19:58   ` Guenter Roeck
  2017-09-11 21:12     ` Alan Tull
  2017-09-18 21:11       ` Rob Herring
  2017-10-01 14:13     ` Guenter Roeck
  2 siblings, 2 replies; 18+ messages in thread
From: Guenter Roeck @ 2017-09-11 19:58 UTC (permalink / raw)
  To: Alan Tull
  Cc: linux-hwmon, devicetree, linux-kernel, Jean Delvare, Rob Herring,
	Mark Rutland

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
> 

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

* Re: [PATCH 2/2] hwmon: add dt binding for max1619
  2017-09-11 19:58   ` Guenter Roeck
@ 2017-09-11 21:12     ` Alan Tull
  2017-09-18 21:11       ` Rob Herring
  1 sibling, 0 replies; 18+ messages in thread
From: Alan Tull @ 2017-09-11 21:12 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: linux-hwmon, devicetree, linux-kernel, Jean Delvare, Rob Herring,
	Mark Rutland

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

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

* Re: [PATCH 1/2] dt-bindings: hwmon: add compatible for max1619
  2017-09-11 19:33 ` [PATCH 1/2] dt-bindings: hwmon: add compatible " Alan Tull
@ 2017-09-11 21:18   ` Alan Tull
  2017-09-18 21:12     ` Rob Herring
  0 siblings, 1 reply; 18+ messages in thread
From: Alan Tull @ 2017-09-11 21:18 UTC (permalink / raw)
  To: linux-hwmon, devicetree
  Cc: linux-kernel, Alan Tull, Jean Delvare, Guenter Roeck,
	Rob Herring, Mark Rutland, Oleksij Rempel

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

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

* Re: [PATCH 2/2] hwmon: add dt binding for max1619
@ 2017-09-18 21:11       ` Rob Herring
  0 siblings, 0 replies; 18+ messages in thread
From: Rob Herring @ 2017-09-18 21:11 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Alan Tull, linux-hwmon, devicetree, linux-kernel, Jean Delvare,
	Mark Rutland

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

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

* Re: [PATCH 2/2] hwmon: add dt binding for max1619
@ 2017-09-18 21:11       ` Rob Herring
  0 siblings, 0 replies; 18+ messages in thread
From: Rob Herring @ 2017-09-18 21:11 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Alan Tull, linux-hwmon-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Jean Delvare, Mark Rutland

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-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 1/2] dt-bindings: hwmon: add compatible for max1619
  2017-09-11 21:18   ` Alan Tull
@ 2017-09-18 21:12     ` Rob Herring
  0 siblings, 0 replies; 18+ messages in thread
From: Rob Herring @ 2017-09-18 21:12 UTC (permalink / raw)
  To: Alan Tull
  Cc: linux-hwmon, devicetree, linux-kernel, Jean Delvare,
	Guenter Roeck, Mark Rutland, Oleksij Rempel

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

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

* Re: [PATCH 2/2] hwmon: add dt binding for max1619
  2017-09-18 21:11       ` Rob Herring
  (?)
@ 2017-09-19 18:11       ` Alan Tull
  2017-09-19 19:35         ` Rob Herring
  -1 siblings, 1 reply; 18+ messages in thread
From: Alan Tull @ 2017-09-19 18:11 UTC (permalink / raw)
  To: Rob Herring
  Cc: Guenter Roeck, linux-hwmon, devicetree, linux-kernel,
	Jean Delvare, Mark Rutland

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

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

* Re: [PATCH 2/2] hwmon: add dt binding for max1619
  2017-09-19 18:11       ` Alan Tull
@ 2017-09-19 19:35         ` Rob Herring
  2017-09-28 18:12           ` Alan Tull
  0 siblings, 1 reply; 18+ messages in thread
From: Rob Herring @ 2017-09-19 19:35 UTC (permalink / raw)
  To: Alan Tull
  Cc: Guenter Roeck, Linux HWMON List, devicetree, linux-kernel,
	Jean Delvare, Mark Rutland

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

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

* Re: [PATCH 2/2] hwmon: add dt binding for max1619
  2017-09-19 19:35         ` Rob Herring
@ 2017-09-28 18:12           ` Alan Tull
  0 siblings, 0 replies; 18+ messages in thread
From: Alan Tull @ 2017-09-28 18:12 UTC (permalink / raw)
  To: Rob Herring
  Cc: Guenter Roeck, Linux HWMON List, devicetree, linux-kernel,
	Jean Delvare, Mark Rutland

On Tue, Sep 19, 2017 at 2:35 PM, Rob Herring <robh@kernel.org> wrote:
> 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.

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

Alan

>
> Rob

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

* Re: [1/2] dt-bindings: hwmon: add compatible for max1619
  2017-09-11 19:16 [PATCH 1/2] dt-bindings: hwmon: add compatible for max1619 Alan Tull
  2017-09-11 19:16 ` [PATCH 2/2] hwmon: add dt binding " Alan Tull
  2017-09-11 19:33 ` [PATCH 1/2] dt-bindings: hwmon: add compatible " Alan Tull
@ 2017-10-01 14:11 ` Guenter Roeck
  2 siblings, 0 replies; 18+ messages in thread
From: Guenter Roeck @ 2017-10-01 14:11 UTC (permalink / raw)
  To: Alan Tull
  Cc: linux-hwmon, devicetree, linux-kernel, Jean Delvare, Rob Herring,
	Mark Rutland

On Mon, Sep 11, 2017 at 02:16:48PM -0500, Alan Tull wrote:
> 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>
> Acked-by: Rob Herring <robh@kernel.org>

Applied to hwmon-next.

Thanks,
Guenter

> ---
>  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>;
> +	};

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

* Re: [2/2] hwmon: add dt binding for max1619
@ 2017-10-01 14:13     ` Guenter Roeck
  0 siblings, 0 replies; 18+ messages in thread
From: Guenter Roeck @ 2017-10-01 14:13 UTC (permalink / raw)
  To: Alan Tull
  Cc: linux-hwmon, devicetree, linux-kernel, Jean Delvare, Rob Herring,
	Mark Rutland

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

Applied to hwmon-next.

Thanks,
Guenter

> ---
>  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,

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

* Re: [2/2] hwmon: add dt binding for max1619
@ 2017-10-01 14:13     ` Guenter Roeck
  0 siblings, 0 replies; 18+ messages in thread
From: Guenter Roeck @ 2017-10-01 14:13 UTC (permalink / raw)
  To: Alan Tull
  Cc: linux-hwmon-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Jean Delvare, Rob Herring,
	Mark Rutland

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-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Cc: Jean Delvare <jdelvare-IBi9RG/b67k@public.gmane.org>
> Cc: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
> Cc: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Cc: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>

Applied to hwmon-next.

Thanks,
Guenter

> ---
>  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,
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [2/2] hwmon: add dt binding for max1619
@ 2017-10-02 14:30       ` Alan Tull
  0 siblings, 0 replies; 18+ messages in thread
From: Alan Tull @ 2017-10-02 14:30 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Linux HWMON List, devicetree, linux-kernel, Jean Delvare,
	Rob Herring, Mark Rutland

On Sun, Oct 1, 2017 at 9:13 AM, 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>
>> 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>
>
> Applied to hwmon-next.

Thanks!
Alan

>
> Thanks,
> Guenter
>
>> ---
>>  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,

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

* Re: [2/2] hwmon: add dt binding for max1619
@ 2017-10-02 14:30       ` Alan Tull
  0 siblings, 0 replies; 18+ messages in thread
From: Alan Tull @ 2017-10-02 14:30 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Linux HWMON List, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel, Jean Delvare, Rob Herring, Mark Rutland

On Sun, Oct 1, 2017 at 9:13 AM, Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org> 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-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
>> Cc: Jean Delvare <jdelvare-IBi9RG/b67k@public.gmane.org>
>> Cc: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
>> Cc: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
>> Cc: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
>
> Applied to hwmon-next.

Thanks!
Alan

>
> Thanks,
> Guenter
>
>> ---
>>  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,
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2017-10-02 14:30 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-11 19:16 [PATCH 1/2] dt-bindings: hwmon: add compatible for max1619 Alan Tull
2017-09-11 19:16 ` [PATCH 2/2] hwmon: add dt binding " Alan Tull
2017-09-11 19:32   ` Alan Tull
2017-09-11 19:58   ` Guenter Roeck
2017-09-11 21:12     ` Alan Tull
2017-09-18 21:11     ` Rob Herring
2017-09-18 21:11       ` Rob Herring
2017-09-19 18:11       ` Alan Tull
2017-09-19 19:35         ` Rob Herring
2017-09-28 18:12           ` Alan Tull
2017-10-01 14:13   ` [2/2] " Guenter Roeck
2017-10-01 14:13     ` Guenter Roeck
2017-10-02 14:30     ` Alan Tull
2017-10-02 14:30       ` Alan Tull
2017-09-11 19:33 ` [PATCH 1/2] dt-bindings: hwmon: add compatible " Alan Tull
2017-09-11 21:18   ` Alan Tull
2017-09-18 21:12     ` Rob Herring
2017-10-01 14:11 ` [1/2] " Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.