All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Marc Titinger <mtitinger@baylibre.com>, jdelvare@suse.com
Cc: lm-sensors@lm-sensors.org, linux-kernel@vger.kernel.org,
	mturquette@baylibre.com, bcousson@baylibre.com
Subject: Re: [lm-sensors] [RFC] hwmon: ina2xx: port to using remap, improve bandwidth.
Date: Sat, 24 Oct 2015 02:21:42 +0000	[thread overview]
Message-ID: <562AEB36.2090901@roeck-us.net> (raw)
In-Reply-To: <562A9A0A.5040503@baylibre.com>

On 10/23/2015 01:35 PM, Marc Titinger wrote:
> Hi Guenter
>
> thanks for the review, answers bellow.
>
> Marc.
>

[ ... ]

>>> -    /*
>>> -     * Ina226 has a variable update_interval. For ina219 we
>>> -     * use a constant value.
>>> +    /* Check for shunt resistor value.

Another comment: Standard multi-line comments, please.

>>> +     * Give precedence to device tree over must-recompile.
>>>        */
>>> -    if (data->kind = ina226)
>>> -        ina226_set_update_interval(data);
>>> -    else
>>> -        data->update_interval = HZ / INA2XX_CONVERSION_RATE;
>>> +    if (of_property_read_u32(dev->of_node, "shunt-resistor", &val) < 0) {
>>> +        pdata = dev_get_platdata(dev);
>>> +        if (pdata)
>>> +            val = pdata->shunt_uohms;
>>> +        else
>>> +            val = INA2XX_RSHUNT_DEFAULT;
>>> +    }
>>
>> This changes priority from platform data first to devicetree configuration first.
>> As such, it is an unrelated change. If needed, split into a separate patch, and
> Yes I would do a separate patch normaly, agreed.
>
>> explain the reasoning, please.
> Changing the platform data requires changes in the kernel code, and hence recompilation. It seems a bit unexpected that setting a new value in the dtb will be ignored because there is a compiled-in platform data. Should'nt the dtb allow to override platform data ?

Normally you would not _have_ platform data in a system which is dtb enabled.
I don't really mind changing priorities (you are right, it makes sense to
check for devicetree data first), but as mentioned as separate patch, please.

Thanks,
Guenter


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

WARNING: multiple messages have this Message-ID (diff)
From: Guenter Roeck <linux@roeck-us.net>
To: Marc Titinger <mtitinger@baylibre.com>, jdelvare@suse.com
Cc: lm-sensors@lm-sensors.org, linux-kernel@vger.kernel.org,
	mturquette@baylibre.com, bcousson@baylibre.com
Subject: Re: [RFC] hwmon: ina2xx: port to using remap, improve bandwidth.
Date: Fri, 23 Oct 2015 19:21:42 -0700	[thread overview]
Message-ID: <562AEB36.2090901@roeck-us.net> (raw)
In-Reply-To: <562A9A0A.5040503@baylibre.com>

On 10/23/2015 01:35 PM, Marc Titinger wrote:
> Hi Guenter
>
> thanks for the review, answers bellow.
>
> Marc.
>

[ ... ]

>>> -    /*
>>> -     * Ina226 has a variable update_interval. For ina219 we
>>> -     * use a constant value.
>>> +    /* Check for shunt resistor value.

Another comment: Standard multi-line comments, please.

>>> +     * Give precedence to device tree over must-recompile.
>>>        */
>>> -    if (data->kind == ina226)
>>> -        ina226_set_update_interval(data);
>>> -    else
>>> -        data->update_interval = HZ / INA2XX_CONVERSION_RATE;
>>> +    if (of_property_read_u32(dev->of_node, "shunt-resistor", &val) < 0) {
>>> +        pdata = dev_get_platdata(dev);
>>> +        if (pdata)
>>> +            val = pdata->shunt_uohms;
>>> +        else
>>> +            val = INA2XX_RSHUNT_DEFAULT;
>>> +    }
>>
>> This changes priority from platform data first to devicetree configuration first.
>> As such, it is an unrelated change. If needed, split into a separate patch, and
> Yes I would do a separate patch normaly, agreed.
>
>> explain the reasoning, please.
> Changing the platform data requires changes in the kernel code, and hence recompilation. It seems a bit unexpected that setting a new value in the dtb will be ignored because there is a compiled-in platform data. Should'nt the dtb allow to override platform data ?

Normally you would not _have_ platform data in a system which is dtb enabled.
I don't really mind changing priorities (you are right, it makes sense to
check for devicetree data first), but as mentioned as separate patch, please.

Thanks,
Guenter


  reply	other threads:[~2015-10-24  2:21 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-19 16:21 [lm-sensors] [RFC] hwmon: ina2xx: allow for actual measurement bandwidth above 160 Hz Marc Titinger
2015-10-19 16:21 ` Marc Titinger
2015-10-20  1:32 ` [lm-sensors] " Guenter Roeck
2015-10-20  1:32   ` Guenter Roeck
2015-10-20  7:58   ` [lm-sensors] " Marc Titinger
2015-10-20  7:58     ` Marc Titinger
2015-10-20  8:20   ` [lm-sensors] [PATCH v2] " Marc Titinger
2015-10-20  8:20     ` Marc Titinger
2015-10-20 12:54     ` [lm-sensors] " Guenter Roeck
2015-10-20 12:54       ` Guenter Roeck
2015-10-20 13:17       ` [lm-sensors] " Marc Titinger
2015-10-20 13:17         ` Marc Titinger
2015-10-20 13:30         ` [lm-sensors] " Guenter Roeck
2015-10-20 13:30           ` Guenter Roeck
2015-10-20 13:46           ` [lm-sensors] " Marc Titinger
2015-10-20 13:46             ` Marc Titinger
2015-10-20 17:00             ` [lm-sensors] " Guenter Roeck
2015-10-20 17:00               ` Guenter Roeck
2015-10-21  7:46               ` [lm-sensors] " Marc Titinger
2015-10-21  7:46                 ` Marc Titinger
2015-10-20 13:52           ` [lm-sensors] " Michael Turquette
2015-10-20 13:52             ` Michael Turquette
2015-10-23 16:13       ` [lm-sensors] [RFC] hwmon: ina2xx: port to using remap, improve bandwidth Marc Titinger
2015-10-23 16:13         ` Marc Titinger
2015-10-23 16:49         ` [lm-sensors] " kbuild test robot
2015-10-23 16:49           ` kbuild test robot
2015-10-23 16:52         ` [lm-sensors] " Guenter Roeck
2015-10-23 16:52           ` Guenter Roeck
2015-10-23 20:35           ` [lm-sensors] " Marc Titinger
2015-10-23 20:35             ` Marc Titinger
2015-10-24  2:21             ` Guenter Roeck [this message]
2015-10-24  2:21               ` Guenter Roeck
2015-10-24 12:45             ` [lm-sensors] " Guenter Roeck
2015-10-24 12:45               ` Guenter Roeck
2015-10-26 16:24               ` [lm-sensors] [PATCH 0/2] hwmon: ina2xx: convert driver to using regmap Marc Titinger
2015-10-26 16:24                 ` Marc Titinger
2015-10-26 16:24                 ` [lm-sensors] [PATCH 1/2] " Marc Titinger
2015-10-26 16:24                   ` Marc Titinger
2015-10-27  1:02                   ` [lm-sensors] " Guenter Roeck
2015-10-27  1:02                     ` Guenter Roeck
2015-10-27  1:12                   ` [lm-sensors] " Guenter Roeck
2015-10-27  1:12                     ` Guenter Roeck
2015-10-27  9:51                     ` [lm-sensors] [PATCH v2 " Marc Titinger
2015-10-27  9:51                       ` Marc Titinger
2015-10-27  9:51                       ` [lm-sensors] [PATCH v2 2/2] hwmon: ina2xx: give precedence to DT over checking for platform data Marc Titinger
2015-10-27  9:51                         ` Marc Titinger
2015-10-28  2:47                       ` [lm-sensors] [PATCH v2 1/2] hwmon: ina2xx: convert driver to using regmap Guenter Roeck
2015-10-28  2:47                         ` Guenter Roeck
2015-10-28  9:23                         ` [lm-sensors] " Marc Titinger
2015-10-28  9:23                           ` Marc Titinger
2015-10-26 16:24                 ` [lm-sensors] [PATCH 2/2] hwmon: ina2xx: give precedence to DT over checking for platform data Marc Titinger
2015-10-26 16:24                   ` Marc Titinger
2015-10-27  1:10                   ` [lm-sensors] " Guenter Roeck
2015-10-27  1:10                     ` Guenter Roeck
2015-10-23 16:55         ` [lm-sensors] [RFC] hwmon: ina2xx: port to using remap, improve bandwidth kbuild test robot
2015-10-23 16:55           ` kbuild test robot
2015-10-23 20:10         ` [lm-sensors] " kbuild test robot
2015-10-23 20:10           ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=562AEB36.2090901@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=bcousson@baylibre.com \
    --cc=jdelvare@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=mtitinger@baylibre.com \
    --cc=mturquette@baylibre.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.