[PATCH 0/4] Make max expected current configurable for ina2xx drivers

2017-09-28 Thread Maciej Purski
he board. It is useful in Odroid XU3. Therefore this patchset also sets max-expected-current in OdroidXU3 device tree to values from documentation. Best Regards, Maciej Purski Maciej Purski (4): iio: adc: ina2xx: Make max expected current configurable hwmon: (ina2xx) Make max e

[PATCH 1/4] iio: adc: ina2xx: Make max expected current configurable

2017-09-28 Thread Maciej Purski
sheet Current LSB should be calculated by dividing max expected current by 2^15, as values read from device registers are in this case 16-bit integers. Power LSB is calculated by multiplying Current LSB by a factor, which is defined in ina documentation. Signed-off-by: Maciej Purski --- drivers/ii

[PATCH 2/4] hwmon: (ina2xx) Make max expected current configurable

2017-09-28 Thread Maciej Purski
sheet Current LSB should be calculated by dividing max expected current by 2^15, as values read from device registers are in this case 16-bit integers. Power LSB is calculated by multiplying Current LSB by a factor, which is defined in ina documentation. Signed-off-by: Maciej Purski --- drivers/

[PATCH 4/4] ARM: dts: Add max-expected-current properties for ina231 in Odroid XU3

2017-09-28 Thread Maciej Purski
Set max-expected-current to values required by the documentation, in order to achieve desired precision. Signed-off-by: Maciej Purski --- arch/arm/boot/dts/exynos5422-odroidxu3.dts | 4 1 file changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts b/arch/arm

[PATCH 3/4] dt-bindings: hwmon: Add max-expected-current property to ina2xx

2017-09-28 Thread Maciej Purski
Add optional max expected current property which allows calibrating the ina sensor in order to achieve requested precision. Document the changes in Documentation/hwmon/ina2xx. Signed-off-by: Maciej Purski --- Documentation/devicetree/bindings/hwmon/ina2xx.txt | 4 +++- Documentation/hwmon

Re: [PATCH 1/4] iio: adc: ina2xx: Make max expected current configurable

2017-10-04 Thread Maciej Purski
On 10/01/2017 12:29 PM, Jonathan Cameron wrote: On Thu, 28 Sep 2017 14:50:12 +0200 Maciej Purski wrote: Max expected current is used for calculating calibration register value, Current LSB and Power LSB according to equations found in ina datasheet. Max expected current is now implicitly set

Re: [PATCH 3/4] dt-bindings: hwmon: Add max-expected-current property to ina2xx

2017-10-05 Thread Maciej Purski
On 10/01/2017 12:31 PM, Jonathan Cameron wrote: On Thu, 28 Sep 2017 14:50:14 +0200 Maciej Purski wrote: Add optional max expected current property which allows calibrating the ina sensor in order to achieve requested precision. Document the changes in Documentation/hwmon/ina2xx. This is

Re: [PATCH 1/4] iio: adc: ina2xx: Make max expected current configurable

2017-10-09 Thread Maciej Purski
On 10/08/2017 11:47 AM, Jonathan Cameron wrote: On Wed, 04 Oct 2017 09:11:31 +0200 Maciej Purski wrote: On 10/01/2017 12:29 PM, Jonathan Cameron wrote: On Thu, 28 Sep 2017 14:50:12 +0200 Maciej Purski wrote: Max expected current is used for calculating calibration register value

Re: [PATCH 1/4] iio: adc: ina2xx: Make max expected current configurable

2017-10-11 Thread Maciej Purski
On 10/09/2017 03:35 PM, Jonathan Cameron wrote: On Mon, 9 Oct 2017 10:08:42 +0200 Maciej Purski wrote: On 10/08/2017 11:47 AM, Jonathan Cameron wrote: On Wed, 04 Oct 2017 09:11:31 +0200 Maciej Purski wrote: On 10/01/2017 12:29 PM, Jonathan Cameron wrote: On Thu, 28 Sep 2017 14:50:12

[PATCH v2 0/4] Make max expected current configurable for ina2xx drivers

2017-10-12 Thread Maciej Purski
y the board. It is useful in Odroid XU3. Therefore this patchset also sets max-expected-current in OdroidXU3 device tree to values from documentation. Best Regards, Maciej Purski --- Changes in v2: - make scale attribute for current iio channel writable as instead of addin

[PATCH v2 1/4] iio: adc: ina2xx: Make max expected current configurable

2017-10-12 Thread Maciej Purski
max expected current configurable from device tree or platform_data. Allow changing current_lsb from sysfs. It is exposed in sysfs as scale attribute for IIO current channel. Update calibration register and power_lsb value on each scale change. Signed-off-by: Maciej Purski --- drivers/iio/adc

[PATCH v2 3/4] dt-bindings: hwmon: Add ti-max-expected-current-microamp property to ina2xx

2017-10-12 Thread Maciej Purski
Add optional max expected current property which allows calibrating the ina sensor in order to achieve requested measure scale. Document the changes in Documentation/hwmon/ina2xx. Signed-off-by: Maciej Purski --- Documentation/devicetree/bindings/hwmon/ina2xx.txt | 4 +++- Documentation/hwmon

[PATCH v2 2/4] hwmon: (ina2xx) Make max expected current configurable

2017-10-12 Thread Maciej Purski
max expected current configurable from device tree or platform_data. Allow changing it from sysfs as currX_max attribute. Update calibration register and power_lsb value on each currX_max change. Signed-off-by: Maciej Purski --- drivers/hwmon/ina2xx.c | 107

[PATCH v2 4/4] ARM: dts: Add ti-max-expected-current-microamp properties for ina231 in Odroid XU3

2017-10-12 Thread Maciej Purski
Set max expected current to values required by the documentation, in order to achieve desired precision. Signed-off-by: Maciej Purski --- arch/arm/boot/dts/exynos5422-odroidxu3.dts | 4 1 file changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts b/arch/arm

Re: [PATCH v2 3/4] dt-bindings: hwmon: Add ti-max-expected-current-microamp property to ina2xx

2017-10-12 Thread Maciej Purski
On 10/12/2017 02:39 PM, Krzysztof Kozlowski wrote: On Thu, Oct 12, 2017 at 2:36 PM, Maciej Purski wrote: Add optional max expected current property which allows calibrating the ina sensor in order to achieve requested measure scale. Document the changes in Documentation/hwmon/ina2xx. Signed

[PATCH v3 0/4] Make max expected current configurable for ina2xx drivers

2017-10-12 Thread Maciej Purski
y the board. It is useful in Odroid XU3. Therefore this patchset also sets max-expected-current in OdroidXU3 device tree to values from documentation. Best Regards, Maciej Purski --- Changes in v3: - fix units inconsistency Changes in v2: - make scale attribute for current iio chan

[PATCH v3 1/4] iio: adc: ina2xx: Make max expected current configurable

2017-10-12 Thread Maciej Purski
max expected current configurable from device tree or platform_data. Allow changing current_lsb from sysfs. It is exposed in sysfs as scale attribute for IIO current channel. Update calibration register and power_lsb value on each scale change. Signed-off-by: Maciej Purski --- drivers/iio/adc

[PATCH v3 3/4] dt-bindings: hwmon: Add ti-max-expected-current-milliamp property to ina2xx

2017-10-12 Thread Maciej Purski
Add optional max expected current property which allows calibrating the ina sensor in order to achieve requested measure scale. Document the changes in Documentation/hwmon/ina2xx. Signed-off-by: Maciej Purski --- Documentation/devicetree/bindings/hwmon/ina2xx.txt | 4 +++- Documentation/hwmon

[PATCH v3 4/4] ARM: dts: Add ti-max-expected-current-milliamp properties for ina231 in Odroid XU3

2017-10-12 Thread Maciej Purski
Set max expected current to values required by the documentation, in order to achieve desired precision. Signed-off-by: Maciej Purski --- arch/arm/boot/dts/exynos5422-odroidxu3.dts | 4 1 file changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts b/arch/arm

[PATCH v3 2/4] hwmon: (ina2xx) Make max expected current configurable

2017-10-12 Thread Maciej Purski
max expected current configurable from device tree or platform_data. Allow changing it from sysfs as currX_max attribute. Update calibration register and power_lsb value on each currX_max change. Signed-off-by: Maciej Purski --- drivers/hwmon/ina2xx.c | 107

Re: [PATCH v2 3/4] dt-bindings: hwmon: Add ti-max-expected-current-microamp property to ina2xx

2017-10-12 Thread Maciej Purski
On 10/12/2017 03:55 PM, Guenter Roeck wrote: On 10/12/2017 06:00 AM, Maciej Purski wrote: On 10/12/2017 02:39 PM, Krzysztof Kozlowski wrote: On Thu, Oct 12, 2017 at 2:36 PM, Maciej Purski wrote: Add optional max expected current property which allows calibrating the ina sensor in order