om.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/kernel-usp/20181123235159.hh43xnvvwsil4on2%40smtp.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
--
Rodrigo Siqueira
https://siqueira.tech
https://twitter.com/siqueirajordao
Hi Jonathan,
Thanks for all the feedbacks and sorry for some basic mistakes, I will
work on the second version based on all your comments.
Best Regards
Rodrigo Siqueira
On 04/21, Jonathan Cameron wrote:
> On Sat, 21 Apr 2018 08:54:45 -0300
> Rodrigo Siqueira <rodrigosiqueiram...@
-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
---
drivers/staging/iio/meter/ade7854.c | 60 -
1 file changed, 25 insertions(+), 35 deletions(-)
diff --git a/drivers/staging/iio/meter/ade7854.c
b/drivers/staging/iio/meter/ade7854.c
index 242ecde75900..df19c8b4b5d7
disables the old approach for reading data.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
---
drivers/staging/iio/meter/ade7854.c | 41 -
1 file changed, 34 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/iio/meter/ade7854.c
b/d
This patch adds iio_chan_spec struct. Additionally, the channel adds the
support for handling AIGAIN, BIGAIN, CIGAIN, NIGAIN, AVGAIN, BVGAIN, and
CVGAIN.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
---
drivers/staging/iio/meter/ade7854.c | 42 ++
the write_raw function and remove the attributes used
for handling the seven registers. This patchset has the contribution of
John Syne, which was responsible for mapping the correct ABI name per
element in the ADE7854; additionally, John provided codes that helped to
shape these patches.
Rodrigo
the areas that calling the old interface by the new one.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
---
Changes in v3:
- Update commit message
drivers/staging/iio/meter/ade7854-i2c.c | 33 +--
drivers/staging/iio/meter/ade7854-spi.
the things simple and working this patch maintain
legacy interface.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
---
Changes in v3:
- Remove the use of defines that not improve the readability
- Replace variable name "bytes" for "bits"
- Updat
Rework read SPI function to reduce the code duplication and centralizes
all the task in a single function.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
---
Changes in v3:
- Remove the use of defines that not improve the readability
- Replace variable name "bytes
This patch removes code duplications related to the write_reg_*
functions and centralizes them in a single function. Also, it eliminates
the legacy functions and replaces them by a unique signature that is
used by SPI and I2C.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.
The write operation using SPI has a many code duplications (similar to
I2C) and four different interfaces per data size. This patch introduces
a single function that centralizes the main task related to SPI.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
---
Changes
, this patch does not
remove any code signature for keeping the meter module work and make
easier to review this patch.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
---
Changes in v3:
- Remove the use of defines that not improve the readability
- Replace variable name
to authorship.
- Adds 'fixes' tag on the first two patches message.
- Removes unnecessary defines.
- Updates commit messages to better describe changes.
John Syne (2):
staging:iio:ade7854: Fix error handling on read/write
staging:iio:ade7854: Fix the wrong number of bits to read
Rodrigo
On 03/18, Jonathan Cameron wrote:
> On Fri, 16 Mar 2018 19:48:33 -0300
> Rodrigo Siqueira <rodrigosiqueiram...@gmail.com> wrote:
>
> > The original code does not correctly handle the error related to I2C
> > read and write. This patch fixes the error handling re
Hi,
On 03/17, Jonathan Cameron wrote:
> On Tue, 13 Mar 2018 13:05:28 -0300
> Rodrigo Siqueira <rodrigosiqueiram...@gmail.com> wrote:
>
> > The ad2s1210 does not contain any channel for the fclkin and fexcit. As
> > a result, it uses IIO_DEVICE_ATTR to expose this infor
the areas that calling the old interface by the new one. During
the update for use a single function, some errors handlings were updated
based on the John Syne patches.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
Signed-off-by: John Syne <john3...@gmail.com>
---
drivers
for 32 bits as pointed by John Syne patches.
It is possible to remove all the old interface to use the new one,
however, for keeping the things simple and working this patch maintain
legacy interface.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
Signed-off-by: John Syne
Rework read SPI function to reduce the code duplication and centralizes
all the task in a single function.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
---
drivers/staging/iio/meter/ade7854-spi.c | 140 +---
1 file changed, 37 insertions(+
This patch removes code duplications related to the write_reg_*
functions and centralizes them in a single function. Also, it eliminates
the legacy functions and replaces them by a unique signature that is
used by SPI and I2C.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.
The write operation using SPI has a many code duplications (similar to
I2C) and four different interfaces per data size. This patch introduces
a single function that centralizes the main task related to SPI.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
---
drivers/stagi
The function ade7854_i2c_read_reg_32() have to invoke the
i2c_master_recv() for read 32 bits values, however, the counter is set
to 3 which means 24 bits. This patch fixes the wrong size of 24 bits, to
32 bits. Finally, this patch is based on John Syne patches.
Signed-off-by: Rodrigo Siqueira
, this patch does not
remove any code signature for keeping the meter module work and make
easier to review this patch.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
---
drivers/staging/iio/meter/ade7854-i2c.c | 96 -
drivers/staging/iio/meter/a
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. This patch is an adaptation of the John
Syne patches.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
Sign
at the beginning of the patchset. First, fixes bugs
related to wrong verification in read/write I2C operations. Second,
adjust the incorrect amount of data read.
- Removes unnecessary code in read/write functions for SPI and I2C
during the rework.
Rodrigo Siqueira (8):
staging:iio:ade7854
On 03/16, Dan Carpenter wrote:
> Generally, it's better to fix the bug in the existing code, and then
> do the cleanup later. That way the fixes can be backported to stable
> kernels more easily.
Hummm... the backport argue make a lot of sense for me. I will generate
a v2 with the bug fixes in
On 03/16, Dan Carpenter wrote:
> You're right that there is a bug but this is not the right fix.
>
> The ade7854_i2c_write_reg_32() function returns 6 on success which makes
> no sense. It should be zero or negative error codes. All the write_reg
> functions in
On 03/15, Dan Carpenter wrote:
> On Wed, Mar 14, 2018 at 03:12:18PM -0300, Rodrigo Siqueira wrote:
> > There is some improper error handling for IRQ and device register. This
> > patch adds a proper verification. The IRQ correction was extracted from
> > John Syne patches
Hi,
I will fixes all of these things here and in the other patches and send a
v2.
Thanks for the review.
On 03/15, Dan Carpenter wrote:
> On Wed, Mar 14, 2018 at 03:10:18PM -0300, Rodrigo Siqueira wrote:
> > The write operation using I2C has many code duplications and four
>
There is some improper error handling for IRQ and device register. This
patch adds a proper verification. The IRQ correction was extracted from
John Syne patches.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
Signed-off-by: John Syne <john3...@gmail.com>
---
dri
the areas that calling the old interface by the new one. During
the update for use a single function, some errors handlings were updated
based on the John Syne patches.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
Signed-off-by: John Syne <john3...@gmail.com>
---
drivers
Rework read SPI function to reduce the code duplication and centralizes
all the task in a single function.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
---
drivers/staging/iio/meter/ade7854-spi.c | 132 ++--
1 file changed, 41 insertions(
This patch removes code duplications related to the write_reg_*
functions and centralizes them in a single function. Also, it eliminates
the legacy functions and replaces them by a unique signature that is
used by SPI and I2C.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.
for 32 bits as pointed by John Syne patches.
It is possible to remove all the old interface to use the new one,
however, for keeping the things simple and working this patch maintain
legacy interface.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
Signed-off-by: John Syne
The write operation using SPI has a many code duplications (similar to
I2C) and four different interfaces per data size. This patch introduces
a single function that centralizes the main task related to SPI.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
---
drivers/stagi
, this patch does not
remove any code signature for keeping the meter module work and make
easier to review this patch.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
---
drivers/staging/iio/meter/ade7854-i2c.c | 89 +++--
drivers/staging/iio/meter/a
and interest to help to update the code
[1]. As a result, this patchset represents the first work effort to
update the meter module in the staging.
1 - https://marc.info/?l=linux-iio=152046885922153=2
Rodrigo Siqueira (7):
staging:iio:ade7854: Rework I2C write function
staging:iio:ade7854: Rework
The write interface of AD2S1210 utilizes IIO_DEVICE_ATTR, which violate
the official IIO ABI. This patch, add the write_raw function responsible
for handling the fclkin and fexcit channel; also it removes the use of
IIO_DEVICE_ATTR for fclkin and fexcit.
Signed-off-by: Rodrigo Siqueira
Read data from fclkin and fexcit does not utilize the ad2s1210_read_raw
function. This patch, append the required handler in the
ad2s1210_read_raw to return the correct value. Also, this patch removes
the legacy code related to the read function
Signed-off-by: Rodrigo Siqueira <rodrigosiquei
label.
Rodrigo Siqueira (3):
staging:iio:ad2s1210: Add channel for fclkin and fexcit
staging:iio:ad2s1210: Add frequency handler in read_raw
staging:iio:ad2s1210: Add write_raw to handle frequency
drivers/staging/iio/resolver/ad2s1210.c | 191 +++-
1 file changed
On 03/13, Dan Carpenter wrote:
> On Tue, Mar 13, 2018 at 10:06:29AM -0300, Rodrigo Siqueira wrote:
> > On 03/13, Dan Carpenter wrote:
> >
> > > Ah... I see why you did the ERROR_MESSAGE define, to get around the 80
> > > character limit. Don't do that. Just
On 03/13, Dan Carpenter wrote:
> On Mon, Mar 12, 2018 at 03:21:52PM -0300, Rodrigo Siqueira wrote:
> > The write interface of AD2S1210 utilizes IIO_DEVICE_ATTR, which violate
> > the official IIO ABI. This patch, add the write_raw function responsible
> > for handling the fclk
The write interface of AD2S1210 utilizes IIO_DEVICE_ATTR, which violate
the official IIO ABI. This patch, add the write_raw function responsible
for handling the fclkin and fexcit channel; also it removes the use of
IIO_DEVICE_ATTR for fclkin and fexcit.
Signed-off-by: Rodrigo Siqueira
, this patchset uses parts of the
original code for handling frequency configuration as an attempt to
avoid problems.
Rodrigo Siqueira (3):
staging:iio:ad2s1210: Add channel for fclkin and fexcit
staging:iio:ad2s1210: Add frequency handler in read_raw
staging:iio:ad2s1210: Add write_raw
Read data from fclkin and fexcit does not utilize the ad2s1210_read_raw
function. This patch, append the required handler in the
ad2s1210_read_raw to return the correct value. Also, this patch removes
the legacy code related to the read function
Signed-off-by: Rodrigo Siqueira <rodrigosiquei
The ad2s1210 does not contain any channel for the fclkin and fexcit. As
a result, it uses IIO_DEVICE_ATTR to expose this information. This patch
adds one channel for fclkin and another for fexcit. It also adds an enum
to easily address the correct channel.
Signed-off-by: Rodrigo Siqueira
On 03/10, Jonathan Cameron wrote:
> On Fri, 9 Mar 2018 20:46:40 -0300
> Rodrigo Siqueira <rodrigosiqueiram...@gmail.com> wrote:
>
> > The original code of AD2S1210 does not have documentation for structs
> > and register configurations; this difficult the code compreh
.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
---
drivers/staging/iio/resolver/ad2s1210.c | 32
drivers/staging/iio/resolver/ad2s1210.h | 9 -
2 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/iio/re
The variable old_data is a bool type, which only receives the value
'true' in the function ad2s1210_config_write and ad2s1210_config_read.
There is no other use for this variable. This patch removes old_data
from the ad2s1210_state and from all the function that use it.
Signed-off-by: Rodrigo
This patch removes some #define directives not used in the code.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
---
drivers/staging/iio/resolver/ad2s1210.c | 10 --
1 file changed, 10 deletions(-)
diff --git a/drivers/staging/iio/resolver/ad2s1210.c
b/drivers/s
This patchset removes some unused #define directive and variables.
Additionally, it fixes two checkpatch problems. Finally, the last patch adds
struct documentation and comments to some part of the code. All of the changes
have the intention to improve the readability of new updates.
Rodrigo
This patch fixes the checkpatch.pl check:
iio/resolver/ad2s1210.c:202: CHECK: Lines should not end with a '['
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
---
drivers/staging/iio/resolver/ad2s1210.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff
On 03/07, Jonathan Cameron wrote:
> On Tue, 6 Mar 2018 21:43:47 -0300
> Rodrigo Siqueira <rodrigosiqueiram...@gmail.com> wrote:
>
> > The macro IIO_DEV_ATTR_CH_OFF is a wrapper for IIO_DEVICE_ATTR, with a
> > tiny change in the name definition. This e
staging/iio/meter/ade7854-spi.c:97: CHECK: Alignment should match open
parenthesis
staging/iio/meter/ade7854-spi.c:125: CHECK: Alignment should match open
parenthesis
...
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
---
drivers/staging/iio/meter/ade7758_trigger.c | 6 ++---
d
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
---
drivers/staging/iio/meter/ade7753.c | 18 ++
drivers/staging/iio/meter/ade7759.c | 18 ++
2 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/drivers/staging/iio/meter/ade775
This patch removes the macro IIO_DEV_ATTR_CH_OFF. The macro
IIO_DEV_ATTR_CH_OFF is not required, due to the replace of it by the
direct use of IIO_DEVICE_ATTR in files staging/iio/meter/ade7759.c and
staging/iio/meter/ade7753.c.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.
parenthesis in Patch 3.
After apply this patch series, meter going to be checkpatch
Rodrigo Siqueira (3):
staging:iio:meter: Replaces IIO_DEV_ATTR_CH_OFF by IIO_DEVICE_ATTR
staging:iio:meter: Remove unused macro IIO_DEV_ATTR_CH_OFF
staging:iio:meter: Aligns open parenthesis
drivers/staging
Hi
On 03/06, Dan Carpenter wrote:
> On Tue, Mar 06, 2018 at 09:26:07AM -0300, Rodrigo Siqueira wrote:
> > @@ -63,7 +63,7 @@ int ade7758_probe_trigger(struct iio_dev *indio_dev)
> > int ret;
> >
> > st->trig
staging/iio/meter/ade7854-spi.c:97: CHECK: Alignment should match open
parenthesis
staging/iio/meter/ade7854-spi.c:125: CHECK: Alignment should match open
parenthesis
...
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
---
drivers/staging/iio/meter/ade7758_trigger.c | 4 +--
d
This patch removes the macro IIO_DEV_ATTR_CH_OFF. The macro
IIO_DEV_ATTR_CH_OFF is not required, due to the replace of it by the
direct use of IIO_DEVICE_ATTR in files staging/iio/meter/ade7759.c and
staging/iio/meter/ade7753.c.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
---
drivers/staging/iio/meter/ade7753.c | 18 ++
drivers/staging/iio/meter/ade7759.c | 18 ++
2 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/drivers/staging/iio/meter/ade775
going to be checkpatch
Rodrigo Siqueira (3):
staging:iio:meter: Replaces IIO_DEV_ATTR_CH_OFF by IIO_DEVICE_ATTR
staging:iio:meter: Remove unused macro IIO_DEV_ATTR_CH_OFF
staging:iio:meter: Aligns open parenthesis
drivers/staging/iio/meter/ade7753.c | 18 +++--
drivers
On 02/24, Jonathan Cameron wrote:
> On Wed, 21 Feb 2018 16:54:35 -0300
> Rodrigo Siqueira <rodrigosiqueiram...@gmail.com> wrote:
>
> > This patch fixes the checkpatch.pl warning:
> >
> > drivers/staging/iio/meter/ade7854.h:157: WARNING: function definition
>
On 02/24, Jonathan Cameron wrote:
> On Wed, 21 Feb 2018 16:54:35 -0300
> Rodrigo Siqueira <rodrigosiqueiram...@gmail.com> wrote:
>
> > This patch fixes the checkpatch.pl warning:
> >
> > drivers/staging/iio/meter/ade7854.h:157: WARNING: function definition
>
, It also renames all
arguments in function definitions.
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
---
Changes in v2:
- Make the commit message clearer.
- Use the same arguments name across signatures and definitions.
Changes in v3:
- Fix name in the email header.
d
On 02/20, Dan Carpenter wrote:
> > On Mon, Feb 19, 2018 at 01:28:32PM -0300, rodrigosiqueira wrote:
> ^^^
> This looks good, but you need to fix your from email header.
Thanks for the review, and the feedback related to the email header.
I
Hi Jonathan,
> On Fri, 16 Feb 2018 11:16:58 -0200
> Rodrigo Siqueira <rodrigosiqueiram...@gmail.com> wrote:
>
> > Hi Daniel
> >
> > > Hi Rodrigo,
> > >
> > > I think this is a nice finding. One comment inline:
> > >
Hi Daniel
> Hi Rodrigo,
>
> I think this is a nice finding. One comment inline:
>
> On Vi, 2018-02-16 at 10:50 -0200, rodrigosiqueira wrote:
> > This patch fixes the checkpatch.pl warning:
> >
> > drivers/staging/iio/meter/ade7854.h:157: WARNING: function definition
> > argument 'struct device
67 matches
Mail list logo