From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752758AbbJXCVq (ORCPT ); Fri, 23 Oct 2015 22:21:46 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:54064 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751118AbbJXCVp (ORCPT ); Fri, 23 Oct 2015 22:21:45 -0400 Subject: Re: [RFC] hwmon: ina2xx: port to using remap, improve bandwidth. To: Marc Titinger , jdelvare@suse.com References: <56263973.300@roeck-us.net> <1445616800-21329-1-git-send-email-mtitinger@baylibre.com> <562A65D3.8090306@roeck-us.net> <562A9A0A.5040503@baylibre.com> Cc: lm-sensors@lm-sensors.org, linux-kernel@vger.kernel.org, mturquette@baylibre.com, bcousson@baylibre.com From: Guenter Roeck Message-ID: <562AEB36.2090901@roeck-us.net> Date: Fri, 23 Oct 2015 19:21:42 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <562A9A0A.5040503@baylibre.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated_sender: linux@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: linux@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guenter Roeck Date: Sat, 24 Oct 2015 02:21:42 +0000 Subject: Re: [lm-sensors] [RFC] hwmon: ina2xx: port to using remap, improve bandwidth. Message-Id: <562AEB36.2090901@roeck-us.net> List-Id: References: <56263973.300@roeck-us.net> <1445616800-21329-1-git-send-email-mtitinger@baylibre.com> <562A65D3.8090306@roeck-us.net> <562A9A0A.5040503@baylibre.com> In-Reply-To: <562A9A0A.5040503@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Marc Titinger , jdelvare@suse.com Cc: lm-sensors@lm-sensors.org, linux-kernel@vger.kernel.org, mturquette@baylibre.com, bcousson@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