* 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 ` [2/2] " Guenter Roeck
2 siblings, 0 replies; 15+ messages in thread
From: Alan Tull @ 2017-09-11 19:32 UTC (permalink / raw)
To: linux-hwmon, devicetree@vger.kernel.org
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] 15+ 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 ` [2/2] " Guenter Roeck
2 siblings, 2 replies; 15+ 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] 15+ 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; 15+ messages in thread
From: Alan Tull @ 2017-09-11 21:12 UTC (permalink / raw)
To: Guenter Roeck
Cc: linux-hwmon, devicetree@vger.kernel.org, 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] 15+ 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
2017-09-19 18:11 ` Alan Tull
1 sibling, 1 reply; 15+ 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] 15+ 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
0 siblings, 1 reply; 15+ messages in thread
From: Alan Tull @ 2017-09-19 18:11 UTC (permalink / raw)
To: Rob Herring
Cc: Guenter Roeck, linux-hwmon, devicetree@vger.kernel.org,
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] 15+ 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; 15+ messages in thread
From: Rob Herring @ 2017-09-19 19:35 UTC (permalink / raw)
To: Alan Tull
Cc: Guenter Roeck, Linux HWMON List, devicetree@vger.kernel.org,
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] 15+ 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; 15+ messages in thread
From: Alan Tull @ 2017-09-28 18:12 UTC (permalink / raw)
To: Rob Herring
Cc: Guenter Roeck, Linux HWMON List, devicetree@vger.kernel.org,
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] 15+ messages in thread
* Re: [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
2017-10-02 14:30 ` Alan Tull
2 siblings, 1 reply; 15+ 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] 15+ messages in thread* Re: [2/2] hwmon: add dt binding for max1619
2017-10-01 14:13 ` [2/2] " Guenter Roeck
@ 2017-10-02 14:30 ` Alan Tull
0 siblings, 0 replies; 15+ messages in thread
From: Alan Tull @ 2017-10-02 14:30 UTC (permalink / raw)
To: Guenter Roeck
Cc: Linux HWMON List, devicetree@vger.kernel.org, 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] 15+ messages in thread