Re: [PATCH-vs-togreg v2 1/2] iio: ina2xx-adc: update the CALIB. register when RShunt changes

2016-03-21 Thread Marc Titinger
On 20/03/2016 12:24, Jonathan Cameron wrote: On 14/03/16 10:20, Marc Titinger wrote: The user (or an init script) may setup RShunt via sysfs after the driver was initialized, for instance based on the EEPROM contents of a modular probe. The calibration register must be set accordingly

Re: [PATCH-vs-togreg v2 1/2] iio: ina2xx-adc: update the CALIB. register when RShunt changes

2016-03-21 Thread Marc Titinger
On 20/03/2016 12:24, Jonathan Cameron wrote: On 14/03/16 10:20, Marc Titinger wrote: The user (or an init script) may setup RShunt via sysfs after the driver was initialized, for instance based on the EEPROM contents of a modular probe. The calibration register must be set accordingly

[PATCH-vs-togreg v2 1/2] iio: ina2xx-adc: update the CALIB. register when RShunt changes

2016-03-14 Thread Marc Titinger
The user (or an init script) may setup RShunt via sysfs after the driver was initialized, for instance based on the EEPROM contents of a modular probe. The calibration register must be set accordingly. Signed-off-by: Marc Titinger <marc.titin...@baylibre.com> --- v2 of http://www.spini

[PATCH-vs-togreg v2 1/2] iio: ina2xx-adc: update the CALIB. register when RShunt changes

2016-03-14 Thread Marc Titinger
The user (or an init script) may setup RShunt via sysfs after the driver was initialized, for instance based on the EEPROM contents of a modular probe. The calibration register must be set accordingly. Signed-off-by: Marc Titinger --- v2 of http://www.spinics.net/lists/linux-iio/msg23402.html

Re: [PATCH-vs-togreg 1/2] iio: ina2xx-adc: update the CALIB. register when RShunt changes

2016-03-14 Thread Marc Titinger
On 12/03/2016 10:19, Jonathan Cameron wrote: On 11/03/16 14:52, Marc Titinger wrote: The user (or an init script) may setup RShunt via sysfs after the driver was initialized, for instance based on the EEPROM contents of a modular probe. The calibration register must be set accordingly

Re: [PATCH-vs-togreg 1/2] iio: ina2xx-adc: update the CALIB. register when RShunt changes

2016-03-14 Thread Marc Titinger
On 12/03/2016 10:19, Jonathan Cameron wrote: On 11/03/16 14:52, Marc Titinger wrote: The user (or an init script) may setup RShunt via sysfs after the driver was initialized, for instance based on the EEPROM contents of a modular probe. The calibration register must be set accordingly

Re: [PATCH-vs-togreg 1/2] iio: ina2xx-adc: update the CALIB. register when RShunt changes

2016-03-11 Thread Marc Titinger
On 11/03/2016 16:04, Andrew F. Davis wrote: ... @@ -599,6 +621,8 @@ static const struct iio_info ina2xx_info = { .debugfs_reg_access = ina2xx_debug_reg, }; + + ? Ok, will fix in v2, thanks ! M. /* Initialize the configuration and calibration registers. */ static int

Re: [PATCH-vs-togreg 1/2] iio: ina2xx-adc: update the CALIB. register when RShunt changes

2016-03-11 Thread Marc Titinger
On 11/03/2016 16:04, Andrew F. Davis wrote: ... @@ -599,6 +621,8 @@ static const struct iio_info ina2xx_info = { .debugfs_reg_access = ina2xx_debug_reg, }; + + ? Ok, will fix in v2, thanks ! M. /* Initialize the configuration and calibration registers. */ static int

[PATCH-vs-togreg 2/2] iio: ina2xx-adc: fix scale for VShunt

2016-03-11 Thread Marc Titinger
The scale would result in uV instead of expected mV. Mostly cosmetic, since the value of 'Power' was computed OK. Signed-off-by: Marc Titinger <marc.titin...@baylibre.com> --- drivers/iio/adc/ina2xx-adc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i

[PATCH-vs-togreg 2/2] iio: ina2xx-adc: fix scale for VShunt

2016-03-11 Thread Marc Titinger
The scale would result in uV instead of expected mV. Mostly cosmetic, since the value of 'Power' was computed OK. Signed-off-by: Marc Titinger --- drivers/iio/adc/ina2xx-adc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/ina2xx-adc.c b/drivers/iio/adc

[PATCH-vs-togreg 1/2] iio: ina2xx-adc: update the CALIB. register when RShunt changes

2016-03-11 Thread Marc Titinger
The user (or an init script) may setup RShunt via sysfs after the driver was initialized, for instance based on the EEPROM contents of a modular probe. The calibration register must be set accordingly. Signed-off-by: Marc Titinger <marc.titin...@baylibre.com> --- tested with BeagleBone

[PATCH-vs-togreg 1/2] iio: ina2xx-adc: update the CALIB. register when RShunt changes

2016-03-11 Thread Marc Titinger
The user (or an init script) may setup RShunt via sysfs after the driver was initialized, for instance based on the EEPROM contents of a modular probe. The calibration register must be set accordingly. Signed-off-by: Marc Titinger --- tested with BeagleBone-black and BayLibre-acme. --- drivers

Re: [PATCH] hwmon: ina2xx: Add per-sensor label

2016-03-07 Thread Marc Titinger
On 03/03/2016 22:02, Anatol Pomozov wrote: From: Anatol Pomazau Some systems have a lot of power sensors and having an way to label sensor makes easier to use sensor information. Add dts property 'label' that is readable via device sysfs file 'label'. Hi Anatol and all,

Re: [PATCH] hwmon: ina2xx: Add per-sensor label

2016-03-07 Thread Marc Titinger
On 03/03/2016 22:02, Anatol Pomozov wrote: From: Anatol Pomazau Some systems have a lot of power sensors and having an way to label sensor makes easier to use sensor information. Add dts property 'label' that is readable via device sysfs file 'label'. Hi Anatol and all, I haven't looked

Re: [PATCH 2/2] iio: ina2xx: Remove trace_printk debug statments

2016-02-15 Thread Marc Titinger
On 14/02/2016 21:02, Andrew F. Davis wrote: On 02/13/2016 07:21 AM, Jonathan Cameron wrote: On 12/02/16 18:34, Andrew F. Davis wrote: These are generally for devlopment use only, remove these from performance-critical code, convert to dev_dbg elswhere. Signed-off-by: Andrew F. Davis

Re: [PATCH 2/2] iio: ina2xx: Remove trace_printk debug statments

2016-02-15 Thread Marc Titinger
On 14/02/2016 21:02, Andrew F. Davis wrote: On 02/13/2016 07:21 AM, Jonathan Cameron wrote: On 12/02/16 18:34, Andrew F. Davis wrote: These are generally for devlopment use only, remove these from performance-critical code, convert to dev_dbg elswhere. Signed-off-by: Andrew F. Davis Hm...

[PATCH v4 2/2] iio: ina2xx: add ABI documentation entry sysfs-bus-iio-ina2xx-adc

2015-12-18 Thread Marc Titinger
Documentation for attributes: * in_allow_async_readout * in_shunt_resistor Signed-off-by: Marc Titinger --- Documentation/ABI/testing/sysfs-bus-iio-ina2xx-adc | 24 ++ 1 file changed, 24 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-ina2xx-adc

[PATCH v4 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors

2015-12-18 Thread Marc Titinger
, on BeagleBoneBlack. Datasheet: http://www.ti.com/lit/gpn/ina226 Signed-off-by: Marc Titinger --- drivers/iio/adc/Kconfig | 10 + drivers/iio/adc/Makefile | 1 + drivers/iio/adc/ina2xx-adc.c | 745 +++ 3 files changed, 756 insertions(+) create mode 100644

[PATCH v4 0/2] IIO version of INA2xx

2015-12-18 Thread Marc Titinger
/lists/linux-iio/msg22100.html Marc Titinger (2): iio: ina2xx: add support for TI INA2xx Power Monitors iio: ina2xx: add ABI documentation entry sysfs-bus-iio-ina2xx-adc Documentation/ABI/testing/sysfs-bus-iio-ina2xx-adc | 24 + drivers/iio/adc/Kconfig| 10 + drivers

[PATCH v4 0/2] IIO version of INA2xx

2015-12-18 Thread Marc Titinger
/lists/linux-iio/msg22100.html Marc Titinger (2): iio: ina2xx: add support for TI INA2xx Power Monitors iio: ina2xx: add ABI documentation entry sysfs-bus-iio-ina2xx-adc Documentation/ABI/testing/sysfs-bus-iio-ina2xx-adc | 24 + drivers/iio/adc/Kconfig| 10 + drivers

[PATCH v4 2/2] iio: ina2xx: add ABI documentation entry sysfs-bus-iio-ina2xx-adc

2015-12-18 Thread Marc Titinger
Documentation for attributes: * in_allow_async_readout * in_shunt_resistor Signed-off-by: Marc Titinger <mtitin...@baylibre.com> --- Documentation/ABI/testing/sysfs-bus-iio-ina2xx-adc | 24 ++ 1 file changed, 24 insertions(+) create mode 100644 Documentation/ABI/t

[PATCH v4 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors

2015-12-18 Thread Marc Titinger
, on BeagleBoneBlack. Datasheet: http://www.ti.com/lit/gpn/ina226 Signed-off-by: Marc Titinger <mtitin...@baylibre.com> --- drivers/iio/adc/Kconfig | 10 + drivers/iio/adc/Makefile | 1 + drivers/iio/adc/ina2xx-adc.c | 745 +++ 3 files changed, 756 inse

Re: [PATCH v3 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors

2015-12-16 Thread Marc Titinger
On 16/12/2015 18:45, Andrew F. Davis wrote: On 12/07/2015 03:09 AM, Marc Titinger wrote: +#define INA2XX_CHAN(_type, _index, _address) { \ +.type = (_type), \ +.address = (_address), \ +.indexed = 1, \ +.channel = (_index), \ +.info_mask_separate = BIT(IIO_CHAN_INFO_RAW

Re: [PATCH v3 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors

2015-12-16 Thread Marc Titinger
On 16/12/2015 18:45, Andrew F. Davis wrote: On 12/07/2015 03:09 AM, Marc Titinger wrote: +#define INA2XX_CHAN(_type, _index, _address) { \ +.type = (_type), \ +.address = (_address), \ +.indexed = 1, \ +.channel = (_index), \ +.info_mask_separate = BIT(IIO_CHAN_INFO_RAW

[PATCH] iio: ina2xx: fix channel order in software buffer

2015-12-15 Thread Marc Titinger
POWER and CURRENT were swapped out in the buffer: was current2 and power3, correct order is power2 and current3. Signed-off-by: Marc Titinger --- Hi Jon, we just found this while testing with the buffered mode. My apologies for missing this bug ealier. Cheers, Marc. --- drivers/iio/adc

[PATCH] iio: ina2xx: fix channel order in software buffer

2015-12-15 Thread Marc Titinger
POWER and CURRENT were swapped out in the buffer: was current2 and power3, correct order is power2 and current3. Signed-off-by: Marc Titinger <mtitin...@baylibre.com> --- Hi Jon, we just found this while testing with the buffered mode. My apologies for missing this bug ealier. Cheers

[PATCH] iio: ina2xx: add ABI documentation entry sysfs-bus-iio-ina2xx-adc

2015-12-14 Thread Marc Titinger
Documentation for attributes: * in_allow_async_readout * in_shunt_resistor Signed-off-by: Marc Titinger --- Documentation/ABI/testing/sysfs-bus-iio-ina2xx-adc | 24 ++ 1 file changed, 24 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-ina2xx-adc

Re: [PATCH 3/3] iio: ina2xx: add support for CHAN_INFO_SCALE

2015-12-14 Thread Marc Titinger
On 12/12/2015 18:14, Jonathan Cameron wrote: On 11/12/15 16:49, Marc Titinger wrote: Provide client apps with the scales to apply to the register values read from the software buffer. Follow the ABI documentation so that values are in milli-unit after scales are applied. Umm. The below looks

Re: [PATCH 3/3] iio: ina2xx: add support for CHAN_INFO_SCALE

2015-12-14 Thread Marc Titinger
On 12/12/2015 18:14, Jonathan Cameron wrote: On 11/12/15 16:49, Marc Titinger wrote: Provide client apps with the scales to apply to the register values read from the software buffer. Follow the ABI documentation so that values are in milli-unit after scales are applied. Umm. The below looks

[PATCH] iio: ina2xx: add ABI documentation entry sysfs-bus-iio-ina2xx-adc

2015-12-14 Thread Marc Titinger
Documentation for attributes: * in_allow_async_readout * in_shunt_resistor Signed-off-by: Marc Titinger <mtitin...@baylibre.com> --- Documentation/ABI/testing/sysfs-bus-iio-ina2xx-adc | 24 ++ 1 file changed, 24 insertions(+) create mode 100644 Documentation/ABI/t

[PATCH 1/3] iio: ina2xx: re-instate a sysfs show/store for the shunt resistor value

2015-12-11 Thread Marc Titinger
Different probe modules use different resistor values. The front-end application may read a probe ID (from eeprom) and set the shunt value accordingly. Signed-off-by: Marc Titinger --- drivers/iio/adc/ina2xx-adc.c | 52 +++- 1 file changed, 46 insertions

[PATCH 2/3] iio: ina2xx: give the capture kthread a more useful name string.

2015-12-11 Thread Marc Titinger
1 root S 1236 0% 6% dd if /dev/iio:device1 of /dev/null 148 1 root S 1236 0% 4% dd if /dev/iio:device2 of /dev/null 149 137 root R 1244 0% 3% top -d 1 142 1 root S 1236 0% 2% dd if /dev/iio:device0 of /dev/null Signed-off-by: Marc

[PATCH 3/3] iio: ina2xx: add support for CHAN_INFO_SCALE

2015-12-11 Thread Marc Titinger
Provide client apps with the scales to apply to the register values read from the software buffer. Follow the ABI documentation so that values are in milli-unit after scales are applied. Signed-off-by: Marc Titinger --- drivers/iio/adc/ina2xx-adc.c | 85

[PATCH 3/3] iio: ina2xx: add support for CHAN_INFO_SCALE

2015-12-11 Thread Marc Titinger
Provide client apps with the scales to apply to the register values read from the software buffer. Follow the ABI documentation so that values are in milli-unit after scales are applied. Signed-off-by: Marc Titinger <mtitin...@baylibre.com> --- drivers/iio/adc/ina2xx-adc.

[PATCH 1/3] iio: ina2xx: re-instate a sysfs show/store for the shunt resistor value

2015-12-11 Thread Marc Titinger
Different probe modules use different resistor values. The front-end application may read a probe ID (from eeprom) and set the shunt value accordingly. Signed-off-by: Marc Titinger <mtitin...@baylibre.com> --- drivers/iio/adc/ina2xx-adc.c | 52 +++-

[PATCH 2/3] iio: ina2xx: give the capture kthread a more useful name string.

2015-12-11 Thread Marc Titinger
1 root S 1236 0% 6% dd if /dev/iio:device1 of /dev/null 148 1 root S 1236 0% 4% dd if /dev/iio:device2 of /dev/null 149 137 root R 1244 0% 3% top -d 1 142 1 root S 1236 0% 2% dd if /dev/iio:device0 of /dev/null Signed-off-by: Marc

[PATCH v3 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors

2015-12-07 Thread Marc Titinger
, on BeagleBoneBlack. Datasheet: http://www.ti.com/lit/gpn/ina226 Signed-off-by: Marc Titinger --- drivers/iio/adc/Kconfig | 10 + drivers/iio/adc/Makefile | 1 + drivers/iio/adc/ina2xx-adc.c | 670 +++ 3 files changed, 681 insertions(+) create mode 100644

[PATCH v3 2/2] iio: ina2xx: provide a sysfs parameter to allow async readout of the ADCs

2015-12-07 Thread Marc Titinger
-specific attributes found: attr 0: in_oversampling_ratio value: 4 attr 1: in_allow_async_readout value: 0 attr 2: integration_time_available value: 140 204 332 588 1100 2116... attr 3: in_sampling_frequency value: 114 Signed-off-by: Marc Titinger --- drivers/iio/adc/ina2xx-adc.c | 54

[PATCH v3 0/2] IIO version of INA2xx

2015-12-07 Thread Marc Titinger
with .max_register = INA2XX_MAX_REGISTERS previous references: * following RFC started in https://lkml.org/lkml/2015/11/10/370 * and feed back from https://lkml.org/lkml/2015/11/18/395 * Version 2: https://lkml.org/lkml/2015/11/30/245 Marc Titinger (2): iio: ina2xx: add support for TI INA2xx Power

[PATCH v3 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors

2015-12-07 Thread Marc Titinger
, on BeagleBoneBlack. Datasheet: http://www.ti.com/lit/gpn/ina226 Signed-off-by: Marc Titinger <mtitin...@baylibre.com> --- drivers/iio/adc/Kconfig | 10 + drivers/iio/adc/Makefile | 1 + drivers/iio/adc/ina2xx-adc.c | 670 +++ 3 files changed, 681 inse

[PATCH v3 2/2] iio: ina2xx: provide a sysfs parameter to allow async readout of the ADCs

2015-12-07 Thread Marc Titinger
-specific attributes found: attr 0: in_oversampling_ratio value: 4 attr 1: in_allow_async_readout value: 0 attr 2: integration_time_available value: 140 204 332 588 1100 2116... attr 3: in_sampling_frequency value: 114 Signed-off-by: Marc Titinger <mtitin...@baylibre.com> --- drive

[PATCH v3 0/2] IIO version of INA2xx

2015-12-07 Thread Marc Titinger
with .max_register = INA2XX_MAX_REGISTERS previous references: * following RFC started in https://lkml.org/lkml/2015/11/10/370 * and feed back from https://lkml.org/lkml/2015/11/18/395 * Version 2: https://lkml.org/lkml/2015/11/30/245 Marc Titinger (2): iio: ina2xx: add support for TI INA2xx Power

Re: [PATCH v2 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors

2015-12-02 Thread Marc Titinger
On 02/12/2015 17:44, Guenter Roeck wrote: On 12/02/2015 08:20 AM, Marc Titinger wrote: On 02/12/2015 17:04, Guenter Roeck wrote: On 12/02/2015 02:20 AM, Marc Titinger wrote: On 02/12/2015 03:14, Guenter Roeck wrote: On Mon, Nov 30, 2015 at 12:49:14PM +0100, Marc Titinger wrote: in SOFTWARE

Re: [PATCH v2 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors

2015-12-02 Thread Marc Titinger
On 02/12/2015 17:04, Guenter Roeck wrote: On 12/02/2015 02:20 AM, Marc Titinger wrote: On 02/12/2015 03:14, Guenter Roeck wrote: On Mon, Nov 30, 2015 at 12:49:14PM +0100, Marc Titinger wrote: in SOFTWARE buffer mode, a kthread will capture the active scan_elements into a kfifo, then compute

Re: [PATCH v2 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors

2015-12-02 Thread Marc Titinger
On 02/12/2015 03:14, Guenter Roeck wrote: On Mon, Nov 30, 2015 at 12:49:14PM +0100, Marc Titinger wrote: in SOFTWARE buffer mode, a kthread will capture the active scan_elements into a kfifo, then compute the remaining time until the next capture tick and do an active wait (udelay

Re: [PATCH v2 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors

2015-12-02 Thread Marc Titinger
On 02/12/2015 17:04, Guenter Roeck wrote: On 12/02/2015 02:20 AM, Marc Titinger wrote: On 02/12/2015 03:14, Guenter Roeck wrote: On Mon, Nov 30, 2015 at 12:49:14PM +0100, Marc Titinger wrote: in SOFTWARE buffer mode, a kthread will capture the active scan_elements into a kfifo, then compute

Re: [PATCH v2 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors

2015-12-02 Thread Marc Titinger
On 02/12/2015 17:44, Guenter Roeck wrote: On 12/02/2015 08:20 AM, Marc Titinger wrote: On 02/12/2015 17:04, Guenter Roeck wrote: On 12/02/2015 02:20 AM, Marc Titinger wrote: On 02/12/2015 03:14, Guenter Roeck wrote: On Mon, Nov 30, 2015 at 12:49:14PM +0100, Marc Titinger wrote: in SOFTWARE

Re: [PATCH v2 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors

2015-12-02 Thread Marc Titinger
On 02/12/2015 03:14, Guenter Roeck wrote: On Mon, Nov 30, 2015 at 12:49:14PM +0100, Marc Titinger wrote: in SOFTWARE buffer mode, a kthread will capture the active scan_elements into a kfifo, then compute the remaining time until the next capture tick and do an active wait (udelay

Re: [PATCH 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors

2015-12-01 Thread Marc Titinger
On 29/11/2015 18:38, Guenter Roeck wrote: On 11/29/2015 08:31 AM, Jonathan Cameron wrote: On 25/11/15 11:28, Marc Titinger wrote: in SOFTWARE buffer mode, a kthread will capture the active scan_elements into a kfifo, then compute the remaining time until the next capture tick and do an active

Re: [PATCH 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors

2015-12-01 Thread Marc Titinger
On 29/11/2015 18:38, Guenter Roeck wrote: On 11/29/2015 08:31 AM, Jonathan Cameron wrote: On 25/11/15 11:28, Marc Titinger wrote: in SOFTWARE buffer mode, a kthread will capture the active scan_elements into a kfifo, then compute the remaining time until the next capture tick and do an active

[PATCH v2 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors

2015-11-30 Thread Marc Titinger
, on BeagleBoneBlack. Datasheet: http://www.ti.com/lit/gpn/ina226 Signed-off-by: Marc Titinger --- drivers/iio/adc/Kconfig | 9 + drivers/iio/adc/Makefile | 1 + drivers/iio/adc/ina2xx-iio.c | 678 +++ 3 files changed, 688 insertions(+) create mode 100644

[PATCH v2 2/2] iio: ina2xx: provide a sysfs parameter to allow async readout of the ADCs

2015-11-30 Thread Marc Titinger
-specific attributes found: attr 0: in_oversampling_ratio value: 4 attr 1: in_allow_async_readout value: 0 attr 2: integration_time_available value: 140 204 332 588 1100 2116 4156 8244 attr 3: in_sampling_frequency value: 114 Signed-off-by: Marc Titinger --- drivers/iio/adc/ina2xx-iio.c

[PATCH v2 0/2] IIO version of INA2xx

2015-11-30 Thread Marc Titinger
where in uS instead of s) * move static variable into device data to allow for multiple instances previous references: following RFC started in https://lkml.org/lkml/2015/11/10/370 and feed back from https://lkml.org/lkml/2015/11/18/395 Marc Titinger (2): iio: ina2xx: add support for TI INA2xx

[PATCH v2 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors

2015-11-30 Thread Marc Titinger
, on BeagleBoneBlack. Datasheet: http://www.ti.com/lit/gpn/ina226 Signed-off-by: Marc Titinger <mtitin...@baylibre.com> --- drivers/iio/adc/Kconfig | 9 + drivers/iio/adc/Makefile | 1 + drivers/iio/adc/ina2xx-iio.c | 678 +++ 3 files changed, 688 inse

[PATCH v2 2/2] iio: ina2xx: provide a sysfs parameter to allow async readout of the ADCs

2015-11-30 Thread Marc Titinger
-specific attributes found: attr 0: in_oversampling_ratio value: 4 attr 1: in_allow_async_readout value: 0 attr 2: integration_time_available value: 140 204 332 588 1100 2116 4156 8244 attr 3: in_sampling_frequency value: 114 Signed-off-by: Marc Titinger <mtitin...@baylibre.

[PATCH v2 0/2] IIO version of INA2xx

2015-11-30 Thread Marc Titinger
where in uS instead of s) * move static variable into device data to allow for multiple instances previous references: following RFC started in https://lkml.org/lkml/2015/11/10/370 and feed back from https://lkml.org/lkml/2015/11/18/395 Marc Titinger (2): iio: ina2xx: add support for TI INA2xx

Re: [PATCH 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors

2015-11-26 Thread Marc Titinger
On 25/11/2015 13:20, Peter Meerwald-Stadler wrote: in SOFTWARE buffer mode, a kthread will capture the active scan_elements into a kfifo, then compute the remaining time until the next capture tick and do an active wait (udelay). minor comments below Thanks Peter! All fixed in next

Re: [PATCH 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors

2015-11-26 Thread Marc Titinger
On 25/11/2015 13:20, Peter Meerwald-Stadler wrote: in SOFTWARE buffer mode, a kthread will capture the active scan_elements into a kfifo, then compute the remaining time until the next capture tick and do an active wait (udelay). minor comments below Thanks Peter! All fixed in next

[PATCH 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors

2015-11-25 Thread Marc Titinger
, on BeagleBoneBlack. Datasheet: http://www.ti.com/lit/gpn/ina226 Signed-off-by: Marc Titinger --- drivers/iio/adc/Kconfig | 10 + drivers/iio/adc/Makefile | 1 + drivers/iio/adc/ina2xx-iio.c | 684 +++ 3 files changed, 695 insertions(+) create mode 100644

[PATCH 0/2] IIO version of INA2xx (followup of related RFC)

2015-11-25 Thread Marc Titinger
capabilities with libiio seems beneficial. Marc Titinger (1): iio: ina2xx: add support for TI INA2xx Power Monitors iio: ina2xx: provide a sysfs parameter to allow async readout of the ADCs drivers/iio/adc/Kconfig | 10 + drivers/iio/adc/Makefile | 1 + drivers/iio/adc/ina2xx-iio.c

[PATCH 2/2] iio: ina2xx: provide a sysfs parameter to allow async readout of the ADCs

2015-11-25 Thread Marc Titinger
-specific attributes found: attr 0: in_oversampling_ratio value: 4 attr 1: in_allow_async_readout value: 0 attr 2: integration_time_available value: 140 204 332 588 1100 2116 4156 8244 attr 3: in_sampling_frequency value: 114 Signed-off-by: Marc Titinger --- drivers/iio/adc/ina2xx-iio.c

[PATCH 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors

2015-11-25 Thread Marc Titinger
, on BeagleBoneBlack. Datasheet: http://www.ti.com/lit/gpn/ina226 Signed-off-by: Marc Titinger <mtitin...@baylibre.com> --- drivers/iio/adc/Kconfig | 10 + drivers/iio/adc/Makefile | 1 + drivers/iio/adc/ina2xx-iio.c | 684 +++ 3 files changed, 695 inse

[PATCH 0/2] IIO version of INA2xx (followup of related RFC)

2015-11-25 Thread Marc Titinger
capabilities with libiio seems beneficial. Marc Titinger (1): iio: ina2xx: add support for TI INA2xx Power Monitors iio: ina2xx: provide a sysfs parameter to allow async readout of the ADCs drivers/iio/adc/Kconfig | 10 + drivers/iio/adc/Makefile | 1 + drivers/iio/adc/ina2xx-iio.c

[PATCH 2/2] iio: ina2xx: provide a sysfs parameter to allow async readout of the ADCs

2015-11-25 Thread Marc Titinger
-specific attributes found: attr 0: in_oversampling_ratio value: 4 attr 1: in_allow_async_readout value: 0 attr 2: integration_time_available value: 140 204 332 588 1100 2116 4156 8244 attr 3: in_sampling_frequency value: 114 Signed-off-by: Marc Titinger <mtitin...@baylibre.

Re: [RFC 6/9] iio: ina2xx: add direct IO support for TI INA2xx Power Monitors

2015-11-23 Thread Marc Titinger
On 21/11/2015 19:13, Jonathan Cameron wrote: On 18/11/15 14:38, Marc Titinger wrote: Basic support or direct IO raw read, with averaging attribute. Values are RAW, INT_PLUS_MICRO (Volt/Ampere/Watt). Output of iio_info: iio:device0: ina226 4 channels found: power3

Re: [RFC 6/9] iio: ina2xx: add direct IO support for TI INA2xx Power Monitors

2015-11-23 Thread Marc Titinger
On 21/11/2015 19:13, Jonathan Cameron wrote: On 18/11/15 14:38, Marc Titinger wrote: Basic support or direct IO raw read, with averaging attribute. Values are RAW, INT_PLUS_MICRO (Volt/Ampere/Watt). Output of iio_info: iio:device0: ina226 4 channels found: power3

Re: [RFC 8/9] iio: buffer: allow for last-second trigger spawning from device driver

2015-11-19 Thread Marc Titinger
On 18/11/2015 19:55, Jonathan Cameron wrote: On 18/11/15 14:38, Marc Titinger wrote: The hrtimer sw-trigger allow for polling mode on devices w/o hard irq trigger source, but setting the frequency from userland for both the hrtimer trigger device and the adc is error prone. Make adc drivers

Re: [RFC 8/9] iio: buffer: allow for last-second trigger spawning from device driver

2015-11-19 Thread Marc Titinger
On 18/11/2015 19:55, Jonathan Cameron wrote: On 18/11/15 14:38, Marc Titinger wrote: The hrtimer sw-trigger allow for polling mode on devices w/o hard irq trigger source, but setting the frequency from userland for both the hrtimer trigger device and the adc is error prone. Make adc drivers

Re: [RFC 5/9] iio: Documentation: Add IIO configfs documentation

2015-11-18 Thread Marc Titinger
is the brief line only. The patch is as-is from Daniel's series. Cheers, M. On 18 November 2015 at 15:38, Marc Titinger wrote: From: Daniel Baluta Signed-off-by: Daniel Baluta Acked-by: Crt Mori --- Documentation/ABI/testing/configfs-iio | 21 Documentation/iio/iio_configfs.txt

[RFC 3/9] iio: core: Introduce IIO software triggers

2015-11-18 Thread Marc Titinger
From: Daniel Baluta A software trigger associates an IIO device trigger with a software interrupt source (e.g: timer, sysfs). This patch adds the generic infrastructure for handling software triggers. Software interrupts sources are kept in a iio_trigger_types_list and registered separately

[RFC 8/9] iio: buffer: allow for last-second trigger spawning from device driver

2015-11-18 Thread Marc Titinger
, and the sampling frequency is known. enable_trigger is called from verify_update, before the classical setup_ops are called in buffers_enable. This gives a chance to complete the setup of indio_dev->trig. Signed-off-by: Marc Titinger --- drivers/iio/industrialio-buffer.c | 5 + include/linux/iio/ii

[RFC 0/9] spawn hrtimer trigger from client driver upon enabling buffer

2015-11-18 Thread Marc Titinger
hrtimer based trigger iio: Documentation: Add IIO configfs documentation Marc Titinger (4): iio: ina2xx: add direct IO support for TI INA2xx Power Monitors iio: ina2xx: add triggered buffer iio: buffer: allow for last-second trigger spawning from device driver iio: (RFC) illustrate creation

[RFC 2/9] iio: core: Introduce IIO configfs support

2015-11-18 Thread Marc Titinger
From: Daniel Baluta This patch creates the IIO configfs root group. The group will appear under /iio/, usually /config/iio. We introduce configfs support in IIO in order to be able to easily create IIO objects from userspace. The first supported IIO objects are triggers introduced with next

[RFC 7/9] iio: ina2xx: add triggered buffer

2015-11-18 Thread Marc Titinger
Signed-off-by: Marc Titinger --- drivers/iio/adc/Kconfig | 3 ++ drivers/iio/adc/ina2xx-iio.c | 74 2 files changed, 77 insertions(+) diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig index ebbfff9..929cfb0 100644 --- a/drivers/iio

[RFC 5/9] iio: Documentation: Add IIO configfs documentation

2015-11-18 Thread Marc Titinger
From: Daniel Baluta Signed-off-by: Daniel Baluta Acked-by: Crt Mori --- Documentation/ABI/testing/configfs-iio | 21 Documentation/iio/iio_configfs.txt | 93 ++ 2 files changed, 114 insertions(+) create mode 100644

[RFC 9/9] iio: (RFC) illustrate creation/destruction of hrtimer trigger upon buffer enable

2015-11-18 Thread Marc Titinger
This also raises the question of how to programmatically set the period of the hrtimer from the owner driver, I had to locally copy iio_hrtimer_info Maybe this should go to linux/iio/hrtimer_trigger.h ? Signed-off-by: Marc Titinger --- drivers/iio/adc/ina2xx-iio.c | 74

[RFC 6/9] iio: ina2xx: add direct IO support for TI INA2xx Power Monitors

2015-11-18 Thread Marc Titinger
: in_sampling_frequency value: 1506 Tested with ina226, on BeagleBoneBlack. Datasheet: http://www.ti.com/lit/gpn/ina226 Signed-off-by: Marc Titinger --- drivers/iio/adc/Kconfig | 9 + drivers/iio/adc/Makefile | 1 + drivers/iio/adc/ina2xx-iio.c | 515

[RFC 4/9] iio: trigger: Introduce IIO hrtimer based trigger

2015-11-18 Thread Marc Titinger
From: Daniel Baluta This patch registers a new IIO software trigger interrupt source based on high resolution timers. Notice that if configfs is enabled we create sampling_frequency attribute allowing users to change hrtimer period (1/sampling_frequency). The IIO hrtimer trigger has a long

[RFC 1/9] configfs: Allow dynamic group creation

2015-11-18 Thread Marc Titinger
From: Daniel Baluta We don't want to hardcode default groups at subsystem creation time. We export: * configfs_register_group * configfs_unregister_group to allow drivers to programatically create/destroy groups later, after module init time. This is needed for IIO configfs

Re: [RFC 5/9] iio: Documentation: Add IIO configfs documentation

2015-11-18 Thread Marc Titinger
is the brief line only. The patch is as-is from Daniel's series. Cheers, M. On 18 November 2015 at 15:38, Marc Titinger <mtitin...@baylibre.com> wrote: From: Daniel Baluta <daniel.bal...@intel.com> Signed-off-by: Daniel Baluta <daniel.bal...@intel.com> Acked-by: Crt Mori

[RFC 7/9] iio: ina2xx: add triggered buffer

2015-11-18 Thread Marc Titinger
Signed-off-by: Marc Titinger <mtitin...@baylibre.com> --- drivers/iio/adc/Kconfig | 3 ++ drivers/iio/adc/ina2xx-iio.c | 74 2 files changed, 77 insertions(+) diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig index ebbfff9..9

[RFC 0/9] spawn hrtimer trigger from client driver upon enabling buffer

2015-11-18 Thread Marc Titinger
hrtimer based trigger iio: Documentation: Add IIO configfs documentation Marc Titinger (4): iio: ina2xx: add direct IO support for TI INA2xx Power Monitors iio: ina2xx: add triggered buffer iio: buffer: allow for last-second trigger spawning from device driver iio: (RFC) illustrate creation

[RFC 2/9] iio: core: Introduce IIO configfs support

2015-11-18 Thread Marc Titinger
From: Daniel Baluta This patch creates the IIO configfs root group. The group will appear under /iio/, usually /config/iio. We introduce configfs support in IIO in order to be able to easily create IIO objects from userspace. The first supported IIO objects are triggers

[RFC 8/9] iio: buffer: allow for last-second trigger spawning from device driver

2015-11-18 Thread Marc Titinger
, and the sampling frequency is known. enable_trigger is called from verify_update, before the classical setup_ops are called in buffers_enable. This gives a chance to complete the setup of indio_dev->trig. Signed-off-by: Marc Titinger <mtitin...@baylibre.com> --- drivers/iio/industrialio-buf

[RFC 4/9] iio: trigger: Introduce IIO hrtimer based trigger

2015-11-18 Thread Marc Titinger
From: Daniel Baluta This patch registers a new IIO software trigger interrupt source based on high resolution timers. Notice that if configfs is enabled we create sampling_frequency attribute allowing users to change hrtimer period (1/sampling_frequency). The IIO

[RFC 1/9] configfs: Allow dynamic group creation

2015-11-18 Thread Marc Titinger
From: Daniel Baluta We don't want to hardcode default groups at subsystem creation time. We export: * configfs_register_group * configfs_unregister_group to allow drivers to programatically create/destroy groups later, after module init time. This is

[RFC 6/9] iio: ina2xx: add direct IO support for TI INA2xx Power Monitors

2015-11-18 Thread Marc Titinger
: in_sampling_frequency value: 1506 Tested with ina226, on BeagleBoneBlack. Datasheet: http://www.ti.com/lit/gpn/ina226 Signed-off-by: Marc Titinger <mtitin...@baylibre.com> --- drivers/iio/adc/Kconfig | 9 + drivers/iio/adc/Makefile | 1 + drivers/iio/adc/ina2xx-iio.c

[RFC 5/9] iio: Documentation: Add IIO configfs documentation

2015-11-18 Thread Marc Titinger
From: Daniel Baluta Signed-off-by: Daniel Baluta Acked-by: Crt Mori --- Documentation/ABI/testing/configfs-iio | 21 Documentation/iio/iio_configfs.txt | 93 ++ 2 files changed,

[RFC 9/9] iio: (RFC) illustrate creation/destruction of hrtimer trigger upon buffer enable

2015-11-18 Thread Marc Titinger
This also raises the question of how to programmatically set the period of the hrtimer from the owner driver, I had to locally copy iio_hrtimer_info Maybe this should go to linux/iio/hrtimer_trigger.h ? Signed-off-by: Marc Titinger <mtitin...@baylibre.com> --- drivers/iio/adc/ina2xx-iio.

[RFC 3/9] iio: core: Introduce IIO software triggers

2015-11-18 Thread Marc Titinger
From: Daniel Baluta A software trigger associates an IIO device trigger with a software interrupt source (e.g: timer, sysfs). This patch adds the generic infrastructure for handling software triggers. Software interrupts sources are kept in a iio_trigger_types_list and

Re: [RFC 1/2] ABI: iio: support AVERAGING_RATIO setting

2015-11-17 Thread Marc Titinger
On 17/11/2015 14:39, ji...@jic23.retrosnub.co.uk wrote: On 17.11.2015 10:44, Marc Titinger wrote: Some ADC devices allow averaging/downsampling. The minimal parameter set for this will be the number of taps used for computing a mean value. In some cases the ratio will hold discrete values

[RFC 1/2] ABI: iio: support AVERAGING_RATIO setting

2015-11-17 Thread Marc Titinger
ging_rationame in_calibscale power in_current2_raw sampling_frequency_available in_power3_raw subsystem in_sampling_frequency uevent # cat averaging_ratio_available 1, 4, 16, 64, 128, 256, 512, 1024 Signed-off-by: Mar

[RFC 2/2] iio: ina2xx: convert AVERGING ratio setting from generic sysfs attr to ABI

2015-11-17 Thread Marc Titinger
using the proposed ABI addition for IIO_CHAN_INFO_AVERAGING_RATIO, convert the sysfs attribute for averaging ratio to using in_averaging_ratio as a directory-bound channel info. Signed-off-by: Marc Titinger --- drivers/iio/adc/ina2xx-iio.c | 47 ++-- 1

[RFC 0/2] ABI: IIO: proposal for AVERAGING_RATIO support

2015-11-17 Thread Marc Titinger
This is an attempt to document/define simple downsampling/averaging features for some ADC devices. As discussed in https://lkml.org/lkml/2015/11/16/566 As an illustration, Patch 2 is an instance of implementation using ina226. Marc Titinger (2): ABI: iio: support AVERAGING_RATIO setting iio

[RFC 1/2] ABI: iio: support AVERAGING_RATIO setting

2015-11-17 Thread Marc Titinger
ging_rationame in_calibscale power in_current2_raw sampling_frequency_available in_power3_raw subsystem in_sampling_frequency uevent # cat averaging_ratio_available 1, 4, 16, 64, 128, 256, 512, 1024 Signed-off-by: Marc Titing

[RFC 0/2] ABI: IIO: proposal for AVERAGING_RATIO support

2015-11-17 Thread Marc Titinger
This is an attempt to document/define simple downsampling/averaging features for some ADC devices. As discussed in https://lkml.org/lkml/2015/11/16/566 As an illustration, Patch 2 is an instance of implementation using ina226. Marc Titinger (2): ABI: iio: support AVERAGING_RATIO setting iio

[RFC 2/2] iio: ina2xx: convert AVERGING ratio setting from generic sysfs attr to ABI

2015-11-17 Thread Marc Titinger
using the proposed ABI addition for IIO_CHAN_INFO_AVERAGING_RATIO, convert the sysfs attribute for averaging ratio to using in_averaging_ratio as a directory-bound channel info. Signed-off-by: Marc Titinger <mtitin...@baylibre.com> --- drivers/iio/adc/ina2xx-iio.

Re: [RFC 1/2] ABI: iio: support AVERAGING_RATIO setting

2015-11-17 Thread Marc Titinger
On 17/11/2015 14:39, ji...@jic23.retrosnub.co.uk wrote: On 17.11.2015 10:44, Marc Titinger wrote: Some ADC devices allow averaging/downsampling. The minimal parameter set for this will be the number of taps used for computing a mean value. In some cases the ratio will hold discrete values

Re: [RFC 4/4] iio: ina2xx: add SOFTWARE buffer mode using an iio kfifo.

2015-11-16 Thread Marc Titinger
On 14/11/2015 19:44, Jonathan Cameron wrote: On 12/11/15 10:18, Marc Titinger wrote: On 10/11/2015 19:23, Lars-Peter Clausen wrote: On 11/10/2015 05:07 PM, Marc Titinger wrote: Capture the active scan_elements into a kfifo. The capture thread will compute the remaining time until the next

Re: [RFC v2 1/2] iio: ina2xx: add direct IO support for TI INA2xx Power Monitors

2015-11-16 Thread Marc Titinger
On 14/11/2015 19:59, Jonathan Cameron wrote: On 12/11/15 12:57, Marc Titinger wrote: Basic support or direct IO raw read, with averaging attribute. Values are RAW, INT_PLUS_MICRO (Volt/Ampere/Watt). Output of iio_info: iio:device0: ina226 4 channels found: power3

  1   2   3   >