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 --- 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-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 ina

[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/drive

[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, I haven't looked h

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
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
www.spinics.net/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|

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: 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

[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 v3 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors

2015-12-07 Thread Marc Titinger
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
.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). This will

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
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
ere 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 iteratio

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

2015-11-25 Thread Marc Titinger
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
and remote 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/in

[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

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 5/9] iio: Documentation: Add IIO configfs documentation

2015-11-18 Thread Marc Titinger
age 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/i

[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 when

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

2015-11-18 Thread Marc Titinger
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 patc

[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 Documentation/ABI/testing/configf

[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 hist

[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 suppo

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 for

[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

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

[RFC v2 2/2] iio: ina2xx: add SOFTWARE buffer mode using an iio kfifo.

2015-11-12 Thread Marc Titinger
140 0430 0d5b 002e 010c 95d2 51e5 0013 Signed-off-by: Marc Titinger --- drivers/iio/adc/Kconfig | 1 + drivers/iio/adc/ina2xx-iio.c | 119 ++- 2 files changed, 118 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/Kconfig b/drivers

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

2015-11-12 Thread Marc Titinger
: http://www.ti.com/lit/gpn/ina226 Signed-off-by: Marc Titinger --- v2 of series https://lkml.org/lkml/2015/11/10/370 : - squash patches adding SAMPL_FREQ and debugfs interface - add regmap is_volatile and is_writeable callbacks - fix Kconfig deps and alphabetical sorting

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

2015-11-12 Thread Marc Titinger
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 capture tick, and do an active wait (udelay). This will produce a stream of up to fours

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

2015-11-12 Thread Marc Titinger
On 11/11/2015 13:09, Daniel Baluta wrote: Signed-off-by: Marc Titinger --- drivers/iio/adc/Kconfig | 9 + drivers/iio/adc/Makefile | 1 + drivers/iio/adc/ina2xx-iio.c | 404 +++ One more thing. In IIO we do not prefer generic names

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

2015-11-12 Thread Marc Titinger
On 11/11/2015 11:14, Daniel Baluta wrote: On Tue, Nov 10, 2015 at 6:07 PM, Marc Titinger wrote: Basic support or direct IO raw read, with averaging attribute. Values are RAW, INT_PLUS_MICRO (Volt/Ampere/Watt). Hi Daniel, thanks for the review, comments bellow, Marc. IIO context has 1

[RFC 3/4] iio: ina2xx: add debugfs reg access

2015-11-10 Thread Marc Titinger
iio:device0: ina226 ... 3 device-specific attributes found: attr 0: in_calibscale value: 1 attr 1: in_mean_raw value: 4 attr 2: in_sampling_frequency value: 455 Signed-off-by: Marc Titinger --- drivers/iio/adc/ina2xx-iio.c | 12

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

2015-11-10 Thread Marc Titinger
attributes found: attr 0: raw value: 0.268000 2 device-specific attributes found: attr 0: in_calibscale value: 1 attr 1: in_mean_raw value: 4 Signed-off-by: Marc Titinger --- drivers/iio/adc/Kconfig | 9 + drivers/iio/adc/Makefile

[RFC 0/4] IIO: add support for INA2xx power monitor

2015-11-10 Thread Marc Titinger
? Many thanks, Marc Titinger (4): iio: ina2xx: add direct IO support for TI INA2xx Power Monitors iio: ina2xx: add SAMP_FREQ attribute. iio: ina2xx: add debugfs reg access iio: ina2xx: add SOFTWARE buffer mode using an iio kfifo. drivers/iio/adc/Kconfig | 11 + drivers/iio/adc/Mak

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

2015-11-10 Thread Marc Titinger
140 0430 0d5b 002e 010c 95d2 51e5 0013 Signed-off-by: Marc Titinger --- Ina2xx does not support auto-increment, hence the capture threads sticks with single register reads instead of regmap_bulk_read. The proper scales must be applied to those raw register values, I'm in favor of

[RFC 2/4] iio: ina2xx: add SAMP_FREQ attribute.

2015-11-10 Thread Marc Titinger
Signed-off-by: Marc Titinger --- drivers/iio/adc/ina2xx-iio.c | 51 ++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/ina2xx-iio.c b/drivers/iio/adc/ina2xx-iio.c index 257d8d5..92169e1 100644 --- a/drivers/iio/adc/ina2xx

Re: [PATCH v2 1/2] hwmon: ina2xx: convert driver to using regmap

2015-10-28 Thread Marc Titinger
On 28/10/2015 03:47, Guenter Roeck wrote: On Tue, Oct 27, 2015 at 10:51:07AM +0100, Marc Titinger wrote: Any sysfs "show" read access from the client app will result in reading all registers (8 with ina226). Depending on the host this can limit the best achievable read rate. This

[RFC v3 1/7] PM / Domains: prepare for devices that might register a power state

2015-10-27 Thread Marc Titinger
From: Marc Titinger Devices may register an intermediate retention state into the domain upon attaching. Currently generic domain would register an array of states upon init. This patch prepares for later insertion (sort per depth, remove). Signed-off-by: Marc Titinger Signed-off-by: Lina Iyer

[RFC v3 2/7] PM / Domains: support idle-states as genpd multiple-state.

2015-10-27 Thread Marc Titinger
From: Marc Titinger This patch allows cluster-level idle-states to being soaked in as generic domain power states, in order for the domain governor to chose the most efficient power state compatible with the device constraints. Similarly, devices can register power-states into the cluster domain

[RFC v3 0/7] Managing cluser-level idle-states with generic power domains

2015-10-27 Thread Marc Titinger
led cpu-idle-states in each PD node. this is a list of idle-states that will be mapped as domain states. - quit referring to c-states, but refer to idle-states instead. Jon Medhurst (1): arm64: dts: Add idle-states for Juno Marc Titinger (6): PM / Domains: prepare for devices that might r

[RFC v3 3/7] arm64: dts: Add idle-states for Juno

2015-10-27 Thread Marc Titinger
From: Jon Medhurst Signed-off-by: Jon Medhurst --- arch/arm64/boot/dts/arm/juno.dts | 29 + 1 file changed, 29 insertions(+) diff --git a/arch/arm64/boot/dts/arm/juno.dts b/arch/arm64/boot/dts/arm/juno.dts index 53442b5..b3fcee8 100644 --- a/arch/arm64/boot/dts/arm/

[RFC v3 5/7] drivers: cpu-pd: allow calling of_cpu_pd_init from platform code.

2015-10-27 Thread Marc Titinger
From: Marc Titinger re-instate a two step init, first register the CPU-power domains, then attach the CPUs, because CPU ordering does not match cluster/PD boundaries. Signed-off-by: Marc Titinger --- drivers/base/power/cpu-pd.c | 29 - include/linux/cpu-pd.h

[RFC v3 7/7] arm64: Juno: declare idle-state cluster-sleep-0 as genpd state

2015-10-27 Thread Marc Titinger
From: Marc Titinger Using Juno to exercise the code that prepares for OS-initiated idle-state handling, using genpd platform callbacks. In opposition to platform- initiated mode as currently with pcsi/ATF. Signed-off-by: Marc Titinger --- arch/arm64/boot/dts/arm/juno.dts | 2 ++ 1 file

[RFC v3 4/7] arm64: Juno: declare generic power domains for both clusters.

2015-10-27 Thread Marc Titinger
From: Marc Titinger Signed-off-by: Marc Titinger --- arch/arm64/boot/dts/arm/juno.dts | 19 +++ 1 file changed, 19 insertions(+) diff --git a/arch/arm64/boot/dts/arm/juno.dts b/arch/arm64/boot/dts/arm/juno.dts index b3fcee8..0a72c07 100644 --- a/arch/arm64/boot/dts/arm

[RFC v3 6/7] arm64: PM /Domains: Initialize CPU-domains from DT.

2015-10-27 Thread Marc Titinger
From: Marc Titinger Signed-off-by: Marc Titinger --- arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/cpu_domain.c | 19 +++ 2 files changed, 20 insertions(+) create mode 100644 arch/arm64/kernel/cpu_domain.c diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel

[PATCH v2 1/2] hwmon: ina2xx: convert driver to using regmap

2015-10-27 Thread Marc Titinger
-ACME) and ina226. Signed-off-by: Marc Titinger --- v2: - rename 'rv' to 'regval' for clarity - fix missed smbus_xxx api change to regmap - rename ina2xx_do_update to ina2xx_read_reg - fix indentation

[PATCH v2 2/2] hwmon: ina2xx: give precedence to DT over checking for platform data.

2015-10-27 Thread Marc Titinger
when checking for the value of the shunt resistor. Signed-off-by: Marc Titinger --- v2: - do part type init earlier to regroup rshunt value checking and assignement. drivers/hwmon/ina2xx.c | 25 - 1 file changed, 12 insertions(+), 13 deletions

[PATCH 1/2] hwmon: ina2xx: convert driver to using regmap

2015-10-26 Thread Marc Titinger
-ACME) and ina226. Signed-off-by: Marc Titinger --- drivers/hwmon/ina2xx.c | 187 ++--- 1 file changed, 69 insertions(+), 118 deletions(-) diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c index 4d28150..3edd163 100644 --- a/drivers/hwmon/ina2

[PATCH 0/2] hwmon: ina2xx: convert driver to using regmap

2015-10-26 Thread Marc Titinger
ither driver version. As expected, the measurement is better resolved with single reads. "github dot com"/mtitinger/ACME/blob/master/docs/measurements/bulk-700pts.png "github dot com"/mtitinger/ACME/blob/master/docs/measurements/regmap-700pts.png Many thanks. Marc Titinger

[PATCH 2/2] hwmon: ina2xx: give precedence to DT over checking for platform data.

2015-10-26 Thread Marc Titinger
when checking for the value of the shunt resistor. Signed-off-by: Marc Titinger --- drivers/hwmon/ina2xx.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c index 3edd163..1946433 100644 --- a/drivers

Re: [RFC] hwmon: ina2xx: port to using remap, improve bandwidth.

2015-10-23 Thread Marc Titinger
Hi Guenter thanks for the review, answers bellow. Marc. Le 23/10/2015 18:52, Guenter Roeck a écrit : On 10/23/2015 09:13 AM, Marc Titinger wrote: With the current implementation, the driver will prevent a readout at a pace faster than the default conversion time (2ms) times the averaging

[RFC] hwmon: ina2xx: port to using remap, improve bandwidth.

2015-10-23 Thread Marc Titinger
(1/(4*800us) = 312 Hz. Signed-off-by: Marc Titinger --- drivers/hwmon/ina2xx.c | 359 ++--- 1 file changed, 159 insertions(+), 200 deletions(-) diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c index 4d28150..e7c1aaa 100644 --- a/drive

Re: [PATCH v2] hwmon: ina2xx: allow for actual measurement bandwidth above 160 Hz

2015-10-21 Thread Marc Titinger
On 20/10/2015 19:00, Guenter Roeck wrote: On 10/20/2015 06:46 AM, Marc Titinger wrote: On 20/10/2015 15:30, Guenter Roeck wrote: On 10/20/2015 06:17 AM, Marc Titinger wrote: On 20/10/2015 14:54, Guenter Roeck wrote: On 10/20/2015 01:20 AM, Marc Titinger wrote: With the current

Re: [PATCH v2] hwmon: ina2xx: allow for actual measurement bandwidth above 160 Hz

2015-10-20 Thread Marc Titinger
On 20/10/2015 15:30, Guenter Roeck wrote: On 10/20/2015 06:17 AM, Marc Titinger wrote: On 20/10/2015 14:54, Guenter Roeck wrote: On 10/20/2015 01:20 AM, Marc Titinger wrote: With the current implementation, the driver will prevent a readout at a pace faster than the default conversion time

Re: [PATCH v2] hwmon: ina2xx: allow for actual measurement bandwidth above 160 Hz

2015-10-20 Thread Marc Titinger
On 20/10/2015 14:54, Guenter Roeck wrote: On 10/20/2015 01:20 AM, Marc Titinger wrote: With the current implementation, the driver will prevent a readout at a pace faster than the default conversion time (2ms) times the averaging setting, min AVG being 1:1. Any sysfs "show" read a

Re: [RFC v2 0/6] Managing cluser-level c-states with generic power domains

2015-10-20 Thread Marc Titinger
Cheers, Marc. Thanks, Lina On Tue, Oct 06 2015 at 08:27 -0600, Marc Titinger wrote: v2: - rebase on Lina Iyer's latest series - remove unnecessary dependency on perf-state patches from Axel Haslam --- Summary 1) DESCRIPTION 2) DEPENDENCIES 3) URL

[PATCH v2] hwmon: ina2xx: allow for actual measurement bandwidth above 160 Hz

2015-10-20 Thread Marc Titinger
o summarize, the patch provides a max bandwidth improvement with hwmon client apps from ~160 Hz to ~320 Hz, and better in single-channel polling mode. Signed-off-by: Marc Titinger --- v2: remove local macro for BIT_MASK, use the bitops.h o

Re: [RFC] hwmon: ina2xx: allow for actual measurement bandwidth above 160 Hz

2015-10-20 Thread Marc Titinger
On 20/10/2015 03:32, Guenter Roeck wrote: On 10/19/2015 09:21 AM, Marc Titinger wrote: With the current implementation, the driver will prevent a readout at a pace faster than the default conversion time (2ms) times the averaging setting, min AVG being 1:1. Any sysfs "show" read a

[RFC] hwmon: ina2xx: allow for actual measurement bandwidth above 160 Hz

2015-10-19 Thread Marc Titinger
o summarize, the patch provides a max bandwidth improvement with hwmon client apps from ~160 Hz to ~320 Hz, and better in single-channel polling mode. Signed-off-by: Marc Titinger --- drivers/hwmon/ina2xx.c | 90 +++--- 1 file changed, 71 insertions(

Re: [RFC v2 2/6] PM / Domains: prepare for devices that might register a power state

2015-10-13 Thread Marc Titinger
On 09/10/2015 20:22, Lina Iyer wrote: On Fri, Oct 09 2015 at 03:39 -0600, Marc Titinger wrote: On 08/10/2015 18:11, Lina Iyer wrote: Hi Marc, Thanks for rebasing on top of my latest series. On Tue, Oct 06 2015 at 08:27 -0600, Marc Titinger wrote: Devices may register an intermediate

Re: [RFC v2 3/6] PM / Domains: introduce power-states consistent with c-states.

2015-10-09 Thread Marc Titinger
On 08/10/2015 18:27, Lina Iyer wrote: On Tue, Oct 06 2015 at 08:27 -0600, Marc Titinger wrote: This patch allows cluster-level C-states to being soaked in as generic domain power states, in order for the domain governor to chose the most efficient power state compatible with the device

Re: [RFC v2 2/6] PM / Domains: prepare for devices that might register a power state

2015-10-09 Thread Marc Titinger
On 08/10/2015 18:11, Lina Iyer wrote: Hi Marc, Thanks for rebasing on top of my latest series. On Tue, Oct 06 2015 at 08:27 -0600, Marc Titinger wrote: Devices may register an intermediate retention state into the domain upon I may agree with the usability of dynamic adding a state to the

[RFC v2 2/6] PM / Domains: prepare for devices that might register a power state

2015-10-06 Thread Marc Titinger
Devices may register an intermediate retention state into the domain upon attaching. Currently generic domain would register an array of states upon init. This patch prepares for later insertion (sort per depth, remove). Signed-off-by: Marc Titinger --- drivers/base/power/domain.c | 189

[RFC v2 4/6] PM / Domains: succeed & warn when attaching non-irqsafe devices to an irq-safe domain.

2015-10-06 Thread Marc Titinger
From: Marc Titinger This patch checks for irq-safe compatibility in suspend/resume instead of failing the attach operation early on. Non-cpu devices attaching to an irq-safe power domain will have to call pm_runtime_irq_safe from their probe function. Signed-off-by: Marc Titinger --- drivers

[RFC v2 1/6] arm64: Juno: declare generic power domains for both clusters.

2015-10-06 Thread Marc Titinger
Signed-off-by: Marc Titinger --- arch/arm64/boot/dts/arm/juno.dts | 19 +++ 1 file changed, 19 insertions(+) diff --git a/arch/arm64/boot/dts/arm/juno.dts b/arch/arm64/boot/dts/arm/juno.dts index 342bb99..499f035 100644 --- a/arch/arm64/boot/dts/arm/juno.dts +++ b/arch/arm64

[RFC v2 5/6] arm: cpuidle: let genpd handle the cluster power transition with 'power-states'

2015-10-06 Thread Marc Titinger
From: Marc Titinger Cpuidle now handles c-states and power-states differently. c-states do not decrement the reference count for the CPUs in the cluster, while power-states i.e. cluster level states like 'CLUSTER_SLEEP_0' in the case of juno, will. The 'D1' fake d

[RFC v2 0/6] Managing cluser-level c-states with generic power domains

2015-10-06 Thread Marc Titinger
suspended /devices/system/cpu/cpu5 suspended a57_pd d1-retention /devices/system/cpu/cpu1suspended /devices/system/cpu/cpu2suspended /devices/platform/D1 --

[RFC v2 6/6] PM / Domains: add debugfs 'states' and 'timings' seq files

2015-10-06 Thread Marc Titinger
From: Marc Titinger This purpose of these debug seq-files is to help investigate generic power domain state transitions, based on device constraints. requires the "multiple states" patches from Axel Haslam. also rename 'summary' from 'pm_genpd_summary&#x

[RFC v2 3/6] PM / Domains: introduce power-states consistent with c-states.

2015-10-06 Thread Marc Titinger
m/cpu/cpu5suspended /devices/platform/D1suspended a57_pd cluster-sleep-0 /devices/system/cpu/cpu1suspended /devices/system/cpu/cpu2suspended Signed-off-by: Mar

Re: [RFC 1/7] arm64: pm/domains: try mutualize CPU domains init between arm/arm64

2015-10-06 Thread Marc Titinger
On 06/10/2015 04:27, Lina Iyer wrote: On Fri, Sep 25 2015 at 07:04 -0600, Marc Titinger wrote: From: Marc Titinger fake path to start testing, eventually move this out of /arch/. incidently enable PM_GENERIC_DOMAINS for VExpress. In fact, this could be moved out of ARM. My last series moved

[RFC 3/7] PM / Domains: prepare for devices that might register a power state

2015-09-25 Thread Marc Titinger
From: Marc Titinger Devices may register an intermediate retention state into the domain upon attaching. Currently generic domain would register an array of states upon init. This patch prepares for later insertion (sort per depth, remove). Signed-off-by: Marc Titinger --- drivers/base/power

[RFC 7/7] PM / Domains: add debugfs 'states' and 'timings' seq files

2015-09-25 Thread Marc Titinger
From: Marc Titinger This purpose of these debug seq-files is to help investigate generic power domain state transitions, based on device constraints. requires the "multiple states" patches from Axel Haslam. also rename 'summary' from 'pm_genpd_summary&#x

[RFC 1/7] arm64: pm/domains: try mutualize CPU domains init between arm/arm64

2015-09-25 Thread Marc Titinger
From: Marc Titinger fake path to start testing, eventually move this out of /arch/. incidently enable PM_GENERIC_DOMAINS for VExpress. Signed-off-by: Marc Titinger --- arch/arm/common/domains.c | 4 ++-- arch/arm64/Kconfig | 1 + arch/arm64/include/asm/arm-pd.h | 1 + arch

[RFC 0/7] Managing cluser-level c-states with generic power domains

2015-09-25 Thread Marc Titinger
suspended /devices/system/cpu/cpu4suspended /devices/system/cpu/cpu5 suspended a57_pd d1-retention /devices/system/cpu/cpu1suspended /devices/system/cpu/cpu2

[RFC 4/7] PM / Domains: introduce power-states consistent with c-states.

2015-09-25 Thread Marc Titinger
From: Marc Titinger This patch allows cluster-level C-states to being soaked in as generic domain power states, in order for the domain governor to chose the most efficient power state compatible with the device constraints. Similarly, devices can register power-states into the cluster domain

  1   2   >