Re: [PATCH 3/3] stagging:iio:meter: Add ade7854_write_raw function

2018-04-21 Thread John Syne
Attached is a spreadsheet which should help explain the calibration process. ADE7878_calibration.xlsx Description: MS-Excel 2007 spreadsheet Here is the calibration guide: http://www.analog.com/media/en/technical-documentation/application-notes/AN-1076.pdf Regards, John > On Apr 21, 2

Re: [PATCH 3/3] stagging:iio:meter: Add ade7854_write_raw function

2018-04-21 Thread John Syne
> On Apr 21, 2018, at 10:26 AM, Jonathan Cameron wrote: > > On Sat, 21 Apr 2018 08:56:19 -0300 > Rodrigo Siqueira wrote: > >> This patch adds the ade7854_write_raw() function which is responsible >> for handling the write operation for registers: AIGAIN, BIGAIN, CIGAIN, >> NIGAIN, AVGAIN, BVG

Re: meter ABI: (was Re: [PATCH v2 1/3] staging:iio:meter: Replaces IIO_DEV_ATTR_CH_OFF by IIO_DEVICE_ATTR)

2018-03-25 Thread John Syne
> On Mar 25, 2018, at 9:54 AM, Jonathan Cameron wrote: > > On Sun, 25 Mar 2018 01:29:41 -0700 > John Syne wrote: > >> Hi Jonathan, > Hi John, > > Please wrap your normal emails (excepting tables) to 80 chars. Yeah, I’m trying to do that, but I use a Mac and App

Re: meter ABI: (was Re: [PATCH v2 1/3] staging:iio:meter: Replaces IIO_DEV_ATTR_CH_OFF by IIO_DEVICE_ATTR)

2018-03-25 Thread John Syne
> > On Mar 25, 2018, at 9:44 AM, Jonathan Cameron wrote: > > On Sat, 24 Mar 2018 16:06:17 -0700 > John Syne wrote: > > This thread is becoming unmanageable so I am cropping this down to just > the questions that remain open. > >>>> Probably eas

Re: meter ABI: (was Re: [PATCH v2 1/3] staging:iio:meter: Replaces IIO_DEV_ATTR_CH_OFF by IIO_DEVICE_ATTR)

2018-03-25 Thread John Syne
> On Mar 25, 2018, at 9:44 AM, Jonathan Cameron wrote: > > On Sat, 24 Mar 2018 16:06:17 -0700 > John Syne wrote: > > This thread is becoming unmanageable so I am cropping this down to just > the questions that remain open. > >>>> Probably easier

Re: meter ABI: (was Re: [PATCH v2 1/3] staging:iio:meter: Replaces IIO_DEV_ATTR_CH_OFF by IIO_DEVICE_ATTR)

2018-03-25 Thread John Syne
> On Mar 25, 2018, at 9:29 AM, Jonathan Cameron wrote: > > On Sat, 24 Mar 2018 15:45:21 -0700 > John Syne wrote: > >>> On Mar 24, 2018, at 8:02 AM, Jonathan Cameron wrote: >>> >>> On Mon, 19 Mar 2018 22:57:16 -0700 >>> John Syne wrote:

Re: meter ABI: (was Re: [PATCH v2 1/3] staging:iio:meter: Replaces IIO_DEV_ATTR_CH_OFF by IIO_DEVICE_ATTR)

2018-03-25 Thread John Syne
Hi Jonathan, I was speaking with Rodrigo and here is what I think must be done to move ADE7878 out of staging Here are the steps as I see them: 1) Define the IIO Attributes so they are consistent with the IIO ABI. This should be pretty simple given agreement on the naming convention. 2) Map t

Re: meter ABI: (was Re: [PATCH v2 1/3] staging:iio:meter: Replaces IIO_DEV_ATTR_CH_OFF by IIO_DEVICE_ATTR)

2018-03-25 Thread John Syne
> On Mar 24, 2018, at 8:18 AM, Jonathan Cameron wrote: > > On Mon, 19 Mar 2018 23:28:45 -0700 > John Syne wrote: > >> Hi Jonathan, >> >> I broke out the {Direction}_{Type}_{Index}_{Modifier}_{Info_Mask} into >> separate columns to make sure I un

Re: meter ABI: (was Re: [PATCH v2 1/3] staging:iio:meter: Replaces IIO_DEV_ATTR_CH_OFF by IIO_DEVICE_ATTR)

2018-03-25 Thread John Syne
Hi Jonathan, I have attached a CSV version of this table below. Hopefully that will make things easier for you. RegisterIIO Attribute Device Tree or Code Direction type Index ModifierInfo Mask AIGAIN in_current0_phaseA_scalein current 0

Re: meter ABI: (was Re: [PATCH v2 1/3] staging:iio:meter: Replaces IIO_DEV_ATTR_CH_OFF by IIO_DEVICE_ATTR)

2018-03-24 Thread John Syne
> On Mar 24, 2018, at 8:02 AM, Jonathan Cameron wrote: > > On Mon, 19 Mar 2018 22:57:16 -0700 > John Syne wrote: > >> Hi Jonathan, >> >> Thank you for all your hard work. Your feedback is really helpful. I’m >> surprised that no one from An

[PATCH v3 2/8] staging:iio:ade7854: Fix the wrong number of bits to read

2018-03-23 Thread John Syne
: John Syne Signed-off-by: Rodrigo Siqueira --- Changes in v3: - Clarify authorship - Add Fixes tag in the commit message drivers/staging/iio/meter/ade7854-i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/iio/meter/ade7854-i2c.c b/drivers/staging/iio/meter

[PATCH v3 1/8] staging:iio:ade7854: Fix error handling on read/write

2018-03-23 Thread John Syne
Fixes: correctly handle errors on the read and write operation for I2C The original code does not correctly handle the error related to I2C read and write. This patch fixes the error handling related to all read/write functions for I2C. Signed-off-by: John Syne Signed-off-by: Rodrigo Siqueira

Re: meter ABI: (was Re: [PATCH v2 1/3] staging:iio:meter: Replaces IIO_DEV_ATTR_CH_OFF by IIO_DEVICE_ATTR)

2018-03-19 Thread John Syne
18, at 5:23 AM, Jonathan Cameron wrote: > > On Sat, 17 Mar 2018 23:11:45 -0700 > John Syne wrote: > >> Hi Jonathan, > Hi John and All, > > I'd love to get some additional input on this from anyone interested. > There are a lot of weird and wonderful derived q

Re: meter ABI: (was Re: [PATCH v2 1/3] staging:iio:meter: Replaces IIO_DEV_ATTR_CH_OFF by IIO_DEVICE_ATTR)

2018-03-19 Thread John Syne
t, 17 Mar 2018 23:11:45 -0700 > John Syne wrote: > >> Hi Jonathan, > Hi John and All, > > I'd love to get some additional input on this from anyone interested. > There are a lot of weird and wonderful derived quantities in an energy > meter and it seems we need to

Re: [PATCH v2 1/3] staging:iio:meter: Replaces IIO_DEV_ATTR_CH_OFF by IIO_DEVICE_ATTR

2018-03-17 Thread John Syne
1 CONFIG2 register_CONFIG2R/W 8 8 U 0x00 Configuration register used during PSM1 mode. See Table 55. Regards, John > On Mar 17, 2018, at 1:30 PM, Jonathan Cameron wrote: > > On Wed, 14 Mar 2018 23:12:02 -0700 > John Syne wrote: > >> Hi Jonathan

Re: [PATCH v2 1/3] staging:iio:meter: Replaces IIO_DEV_ATTR_CH_OFF by IIO_DEVICE_ATTR

2018-03-14 Thread John Syne
Hi Jonathan, I have been looking at the IIO ABI docs and if I understand correctly, the idea is to use consistent naming conventions? So for example, looking at the ADE7854 datasheet, the naming matching the ADE7854 registers would be as follows: {direction}_{type}_{index}_{modifier}_{info_mask

Re: [PATCH] drivers: mfd: ti_am335x_tscadc: increase ADC ref clock to 24MHz

2016-11-10 Thread John Syne
> On Nov 9, 2016, at 9:07 PM, Vignesh R wrote: > > Hi, > > On Thursday 10 November 2016 05:23 AM, John Syne wrote: >> OK, then back to my original question. Given that these DT properties are >> supported in the driver >> > > Below properties are sup

Re: [PATCH] drivers: mfd: ti_am335x_tscadc: increase ADC ref clock to 24MHz

2016-11-09 Thread John Syne
> On Oct 31, 2016, at 4:39 AM, Vignesh R wrote: > > > > On Friday 28 October 2016 02:47 AM, John Syne wrote: > >>>>>>>>>>> >>>>>>>>>>> --- >>>>>>>>>>> include/linux/mfd/

Re: [PATCH] drivers: mfd: ti_am335x_tscadc: increase ADC ref clock to 24MHz

2016-10-27 Thread John Syne
> > On Oct 26, 2016, at 1:48 AM, Lee Jones wrote: > > On Tue, 25 Oct 2016, John Syne wrote: >>> On Oct 24, 2016, at 11:38 PM, Lee Jones wrote: >>> On Mon, 24 Oct 2016, John Syne wrote: >>>>> On Oct 24, 2016, at 11:01 PM, John Syne wrote: >&

Re: [PATCH] drivers: mfd: ti_am335x_tscadc: increase ADC ref clock to 24MHz

2016-10-25 Thread John Syne
> On Oct 24, 2016, at 11:38 PM, Lee Jones wrote: > > On Mon, 24 Oct 2016, John Syne wrote: >>> On Oct 24, 2016, at 11:01 PM, John Syne wrote: >>>> On Oct 24, 2016, at 10:52 PM, Mugunthan V N wrote: >>>> >>>> On Tuesday 25 October 2016 02:

Re: [PATCH] drivers: mfd: ti_am335x_tscadc: increase ADC ref clock to 24MHz

2016-10-25 Thread John Syne
> On Oct 24, 2016, at 11:37 PM, Vignesh R wrote: > > > > On Tuesday 25 October 2016 11:46 AM, John Syne wrote: >> >>> On Oct 24, 2016, at 11:01 PM, John Syne wrote: >>> >>>> >>>> On Oct 24, 2016, at 10:52 PM, Mugunthan V N

Re: [PATCH] drivers: mfd: ti_am335x_tscadc: increase ADC ref clock to 24MHz

2016-10-24 Thread John Syne
> On Oct 24, 2016, at 11:01 PM, John Syne wrote: > >> >> On Oct 24, 2016, at 10:52 PM, Mugunthan V N wrote: >> >> On Tuesday 25 October 2016 02:28 AM, John Syne wrote: >>>>> On Oct 23, 2016, at 11:02 PM, Mugunthan V N wrote: >>>>&g

Re: [PATCH] drivers: mfd: ti_am335x_tscadc: increase ADC ref clock to 24MHz

2016-10-24 Thread John Syne
> On Oct 24, 2016, at 10:52 PM, Mugunthan V N wrote: > > On Tuesday 25 October 2016 02:28 AM, John Syne wrote: >>>> On Oct 23, 2016, at 11:02 PM, Mugunthan V N wrote: >>>> >>>> Increase ADC reference clock from 3MHz to 24MHz so that the >>>

Re: [PATCH] drivers: mfd: ti_am335x_tscadc: increase ADC ref clock to 24MHz

2016-10-24 Thread John Syne
> On Oct 23, 2016, at 11:02 PM, Mugunthan V N wrote: > > Increase ADC reference clock from 3MHz to 24MHz so that the > sampling rates goes up from 100K samples per second to 800K > samples per second on AM335x and AM437x SoC. > > Also increase opendelay for touchscreen configuration to > equali

Re: [PATCH 0/4] Add DMA support for ti_am335x_adc driver

2016-09-29 Thread John Syne
I applied your patches to the following kernel: github.com/RobertCNelson/bb-kernel.git branch am33x-v4.8 Changing #define REG_DMAENABLE_CLEAR 0x038 to #define REG_DMAENABLE_CLEAR 0x03C Also applying the following DTS changes: target = <&tscadc>; __overl