staging:iio:meter: Checkpatch cleanup for meter
Subsystems (4)
Re: meter ABI: (was Re: [PATCH v2 1/3] staging:iio:meter: Replaces IIO_DEV_ATTR_CH_OFF by IIO_DEVICE_ATTR)
In reply to Jonathan CameronHi 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 the ADE7854 interrupt status to IIO events. This requires an interrupt processing section.
3) Add DeviceTree support.
4) Create DeviceTree overlay for the ADE7854.
5) Update ADE7854 probe to read in the DeviceTree register settings.
6) Add support for power modes (PM1, PM2).
7) Not sure if we will support measurement streaming on the ADE7854. The problem is ADE7854 is designed as an SPI master, which means it controls the SPI clock, so the driver must support SPI slave mode. However, the Linux Kernel does not currently support SPI slave mode. We have three choices to make this work and they are all a lot of work: 1) Add support for SPI Slave mode to the kernel, 2) Use hardware to convert SPI signals to I2S signals and with the use of a custom codec, use the ALSA framework to stream the samples (this is an approach I used, but I don’t like it), 3) Move the I2S driver out of the sound subsystem and use it together with DMA to stream samples directly into the ADE7854 driver (my preferred solutions). Perhaps Mark Brown has some ideas on how to make this work.
The ADE9000 will be much easier because it uses an SPI Slave interface.
I hope I have captured everything, but let me know if I have missed anything.
Regards,
John
Re: meter ABI: (was Re: [PATCH v2 1/3] staging:iio:meter: Replaces IIO_DEV_ATTR_CH_OFF by IIO_DEVICE_ATTR)
In reply to Jonathan CameronHi 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.=20=
2) Map the ADE7854 interrupt status to IIO events. This requires an = interrupt processing section.
3) Add DeviceTree support.
4) Create DeviceTree overlay for the ADE7854.
5) Update ADE7854 probe to read in the DeviceTree register settings.
6) Add support for power modes (PM1, PM2).
7) Not sure if we will support measurement streaming on the ADE7854. The = problem is ADE7854 is designed as an SPI master, which means it controls = the SPI clock, so the driver must support SPI slave mode. However, the = Linux Kernel does not currently support SPI slave mode. We have three = choices to make this work and they are all a lot of work: 1) Add support = for SPI Slave mode to the kernel, 2) Use hardware to convert SPI = signals to I2S signals and with the use of a custom codec, use the ALSA = framework to stream the samples (this is an approach I used, but I = don=E2=80=99t like it), 3) Move the I2S driver out of the sound = subsystem and use it together with DMA to stream samples directly into = the ADE7854 driver (my preferred solutions). Perhaps Mark Brown has some = ideas on how to make this work.=20
The ADE9000 will be much easier because it uses an SPI Slave interface.=20=
I hope I have captured everything, but let me know if I have missed = anything.
Regards,
John
Jonathan Cameron
maintainerRe: meter ABI: (was Re: [PATCH v2 1/3] staging:iio:meter: Replaces IIO_DEV_ATTR_CH_OFF by IIO_DEVICE_ATTR)
Quoted 1 line · On Sun, 25 Mar 2018 01:29:41 -0700 John Syne <[email protected]> wrote:
Hi Jonathan,
Hi John,
Please wrap your normal emails (excepting tables) to 80 chars.
Quoted 8 lines
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.
Please don't go just changing attribute names - the driver needs to use the standard approach of iio_chan_spec and create the vast majority of attributes automatically via that. There 'may' be a few corner cases wee don't want to make generic and they 'might' be exposed as attributes.
I suspect this change is the 'big' job. The core support necessary for RMS and MAV (computedtype or whatever we call it) will need adding as well. That is a separate patch set with support for some examples in the dummy driver.
Quoted 4 lines
2) Map the ADE7854 interrupt status to IIO events. This requires an interrupt processing section.
3) Add DeviceTree support.
4) Create DeviceTree overlay for the ADE7854.
More a case of bindings for now. If those are used via an overlay fine but given we don't have any boards with one one in mainline, this is an implementation detail for the user rather than part of moving this driver out of staging.
Quoted 2 lines
5) Update ADE7854 probe to read in the DeviceTree register settings.
6) Add support for power modes (PM1, PM2).
This isn't necessary for a move out of staging (nice to have though).
Quoted 5 lines
7) Not sure if we will support measurement streaming on the ADE7854. The problem is ADE7854 is designed as an SPI master, which means it controls the SPI clock, so the driver must support SPI slave mode. However, the Linux Kernel does not currently support SPI slave mode. We have three choices to make this work and they
Quoted 8 lines
are all a lot of work: 1) Add support for SPI Slave mode to the kernel, 2) Use hardware to convert SPI signals to I2S signals and with the use of a custom codec, use the ALSA framework to stream the samples (this is an approach I used, but I don’t like it), 3) Move the I2S driver out of the sound subsystem and use it together with DMA to stream samples directly into the ADE7854 driver (my preferred solutions). Perhaps Mark Brown has some ideas on how
to make this work.
I'll be honest, this is an end of line part and frankly more than a little crazy. I would go with simply not supporting the measurement streaming at all for this part. If you really need it we can then move onto the how part, but from what you have said I'm guessing you don't care except in an abstract 'it would be nice' sort of a way?
Quoted 5 lines
The ADE9000 will be much easier because it uses an SPI Slave interface.
I hope I have captured everything, but let me know if I have missed anything.
That will do for now ;) I'm sure there will be details that need tidying up once we have the above done, but that's true for any new driver (and this will be nearly a new driver before things are done).
Jonathan
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: meter ABI: (was Re: [PATCH v2 1/3] staging:iio:meter: Replaces IIO_DEV_ATTR_CH_OFF by IIO_DEVICE_ATTR)
Quoted 10 lines · Jonathan Cameron
Quoted 1 line · On Sun, 25 Mar 2018 01:29:41 -0700 John Syne <[email protected]> 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 Apple Mail doesn’t have a feature to wrap at 80 automatically so I have to do this manually.
Quoted 15 lines
Quoted 9 lines
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.
Please don't go just changing attribute names - the driver needs to use the standard approach of
iio_chan_specand create the vast majority of attributes automatically via that. There 'may' be a few corner cases wee don't want to make generic and they 'might' be exposed as attributes.
Quoted 4 lines
I suspect this change is the 'big' job. The core support necessary for RMS and MAV (computedtype or whatever we call it) will need adding as well. That is a separate patch set with support for some examples in the dummy driver.
Great that you mentioned this, because I though we only needed to modify the IIO_ATTR naming. I’ll take a look at iio_chan_spec and the examples in the dummy driver.
Quoted 9 lines
Quoted 5 lines
2) Map the ADE7854 interrupt status to IIO events. This requires an interrupt processing section.
3) Add DeviceTree support.
4) Create DeviceTree overlay for the ADE7854.More a case of bindings for now. If those are used via an overlay fine but given we don't have any boards with one one in mainline, this is an implementation detail for the user rather than part of moving this driver out of staging.
I was thinking more along the lines of documentation to show a developer what was needed to get the driver working.
Quoted 18 lines
Quoted 3 lines
5) Update ADE7854 probe to read in the DeviceTree register settings.
6) Add support for power modes (PM1, PM2).This isn't necessary for a move out of staging (nice to have though).
Quoted 5 lines
7) Not sure if we will support measurement streaming on the ADE7854. The problem is ADE7854 is designed as an SPI master, which means it controls the SPI clock, so the driver must support SPI slave mode. However, the Linux Kernel does not currently support SPI slave mode. We have three choices to make this work and they
Quoted 8 lines
are all a lot of work: 1) Add support for SPI Slave mode to the kernel, 2) Use hardware to convert SPI signals to I2S signals and with the use of a custom codec, use the ALSA framework to stream the samples (this is an approach I used, but I don’t like it), 3) Move the I2S driver out of the sound subsystem and use it together with DMA to stream samples directly into the ADE7854 driver (my preferred solutions). Perhaps Mark Brown has some ideas on how
to make this work.
Quoted 5 lines
I'll be honest, this is an end of line part and frankly more than a little crazy. I would go with simply not supporting the measurement streaming at all for this part. If you really need it we can then move onto the how part, but from what you have said I'm guessing you don't care except in an abstract 'it would be nice' sort of a way?
Yeah, I’m moving to the ADE9000 so I’ll drop this.
Quoted 10 lines
Quoted 6 lines
The ADE9000 will be much easier because it uses an SPI Slave interface.
I hope I have captured everything, but let me know if I have missed anything.
That will do for now ;) I'm sure there will be details that need tidying up once we have the above done, but that's true for any new driver (and this will be nearly a new driver before things are done).
Thank you again for all the detailed feedback.
Quoted 2 lines
Jonathan
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Jonathan Cameron
maintainerRe: meter ABI: (was Re: [PATCH v2 1/3] staging:iio:meter: Replaces IIO_DEV_ATTR_CH_OFF by IIO_DEVICE_ATTR)
Quoted 27 lines · On Sun, 25 Mar 2018 13:53:02 -0700 John Syne <[email protected]> wrote:
Quoted 9 lines · Jonathan Cameron
Quoted 1 line · On Sun, 25 Mar 2018 01:29:41 -0700 John Syne <[email protected]> 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 Apple Mail doesn’t have a feature to wrap at 80 automatically so I have to do this manually.
Quoted 15 lines
Quoted 9 lines
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.
Please don't go just changing attribute names - the driver needs to use the standard approach of
iio_chan_specand create the vast majority of attributes automatically via that. There 'may' be a few corner cases wee don't want to make generic and they 'might' be exposed as attributes.
Quoted 7 lines
Quoted 4 lines
I suspect this change is the 'big' job. The core support necessary for RMS and MAV (computedtype or whatever we call it) will need adding as well. That is a separate patch set with support for some examples in the dummy driver.
Great that you mentioned this, because I though we only needed to modify the
IIO_ATTRnaming. I’ll take a look atiio_chan_specand the examples in the dummy driver.
That is how it was originally done and this is an 'old' driver,
but the chan spec stuff does three things :
1) Saves on lots of boiler plate code.
2) Makes it sane to access the device from other driver (hwmon now does something similar btw).
3) Avoids a lot of ABI typos and careful review.
Quoted 11 lines
Quoted 9 lines
Quoted 5 lines
2) Map the ADE7854 interrupt status to IIO events. This requires an interrupt processing section.
3) Add DeviceTree support.
4) Create DeviceTree overlay for the ADE7854.More a case of bindings for now. If those are used via an overlay fine but given we don't have any boards with one one in mainline, this is an implementation detail for the user rather than part of moving this driver out of staging.
I was thinking more along the lines of documentation to show a developer what was needed to get the driver working.
Do it as an example in the device tree bindings doc.
Quoted 18 lines
Quoted 18 lines
Quoted 3 lines
5) Update ADE7854 probe to read in the DeviceTree register settings.
6) Add support for power modes (PM1, PM2).This isn't necessary for a move out of staging (nice to have though).
Quoted 13 lines
7) Not sure if we will support measurement streaming on the ADE7854. The problem is ADE7854 is designed as an SPI master, which means it controls the SPI clock, so the driver must support SPI slave mode. However, the Linux Kernel does not currently support SPI slave mode. We have three choices to make this work and they are all a lot of work: 1) Add support for SPI Slave mode to the kernel, 2) Use hardware to convert SPI signals to I2S signals and with the use of a custom codec, use the ALSA framework to stream the samples (this is an approach I used, but I don’t like it), 3) Move the I2S driver out of the sound subsystem and use it together with DMA to stream samples directly into the ADE7854 driver (my preferred solutions). Perhaps Mark Brown has some ideas on how to make this work.
Quoted 6 lines
Quoted 5 lines
I'll be honest, this is an end of line part and frankly more than a little crazy. I would go with simply not supporting the measurement streaming at all for this part. If you really need it we can then move onto the how part, but from what you have said I'm guessing you don't care except in an abstract 'it would be nice' sort of a way?
Yeah, I’m moving to the ADE9000 so I’ll drop this.
Agreed. We let someone else pick it up if they care.
Quoted 18 lines
Quoted 10 lines
Quoted 6 lines
The ADE9000 will be much easier because it uses an SPI Slave interface.
I hope I have captured everything, but let me know if I have missed anything.
That will do for now ;) I'm sure there will be details that need tidying up once we have the above done, but that's true for any new driver (and this will be nearly a new driver before things are done).
Thank you again for all the detailed feedback.
Quoted 2 lines
Jonathan
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v2 2/3 staging:iio:meter: Remove unused macro IIO_DEV_ATTR_CH_OFF
In reply to Rodrigo SiqueiraThis 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.
--- drivers/staging/iio/meter/meter.h | 3 --- 1 file changed, 3 deletions(-)
drivers/staging/iio/meter/meter.h +0 -3
@@ -348,9 +348,6 @@#define IIO_DEV_ATTR_VPERIOD (_mode, _show, _store, _addr) \ IIO_DEVICE_ATTR(vperiod, _mode, _show, _store, _addr) -#define IIO_DEV_ATTR_CH_OFF (_num, _mode, _show, _store, _addr) \ - IIO_DEVICE_ATTR(choff_##_num, _mode, _show, _store, _addr) -/* active energy register, AENERGY, is more than half full */ #define IIO_EVENT_ATTR_AENERGY_HALF_FULL (_evlist, _show, _store, _mask) \ IIO_EVENT_ATTR_SH(aenergy_half_full, _evlist, _show, _store, _mask)
Signature · 6 lines
2.16.2 _______________________________________________ devel mailing list [email protected] http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 2/3] staging:iio:meter: Remove unused macro IIO_DEV_ATTR_CH_OFF
Quoted 6 lines · On Tue, 6 Mar 2018 21:44:07 -0300 Rodrigo Siqueira…
This patch removes the macro
IIO_DEV_ATTR_CH_OFF. The macroIIO_DEV_ATTR_CH_OFFis not required, due to the replace of it by the direct use ofIIO_DEVICE_ATTRin filesstaging/iio/meter/ade7759.candstaging/iio/meter/ade7753.c.Signed-off-by Rodrigo Siqueira <[email protected]>
Doh! I should have read to the next patch.
Personally I wouldn't have split this in to, but it is a small thing so doesn't matter.
Applied to the togreg branch of iio.git (having reverted my tweak to the previous patch) and pushed out as testing.
Thanks,
Jonathan
Quoted 9 lines
--- drivers/staging/iio/meter/meter.h | 3 --- 1 file changed, 3 deletions(-)drivers/staging/iio/meter/meter.h +0
-0
drivers/staging/iio/meter/meter.h line 353
Quoted 9 lines
drivers/staging/iio/meter/meter.h +0
-3@@ -348,9 +348,6 @@#define IIO_DEV_ATTR_VPERIOD (_mode, _show, _store, _addr) \ IIO_DEVICE_ATTR(vperiod, _mode, _show, _store, _addr) -#define IIO_DEV_ATTR_CH_OFF (_num, _mode, _show, _store, _addr) \ - IIO_DEVICE_ATTR(choff_##_num, _mode, _show, _store, _addr) -/* active energy register, AENERGY, is more than half full */ #define IIO_EVENT_ATTR_AENERGY_HALF_FULL (_evlist, _show, _store, _mask) \ IIO_EVENT_ATTR_SH(aenergy_half_full, _evlist, _show, _store, _mask)
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
PATCH v2 3/3 staging:iio:meter: Aligns open parenthesis
In reply to Rodrigo SiqueiraThis patch fixes the checkpatch.pl checks:
staging/iio/meter/ade7854-spi.c:19: CHECK: Alignment should match open parenthesisstaging/iio/meter/ade7854-spi.c:44: CHECK: Alignment should match open parenthesisstaging/iio/meter/ade7854-spi.c:70: CHECK: Alignment should match open parenthesisstaging/iio/meter/ade7854-spi.c:97: CHECK: Alignment should match open parenthesisstaging/iio/meter/ade7854-spi.c:125: CHECK: Alignment should match open parenthesis
...
--- drivers/staging/iio/meter/ade7758_trigger.c | 6 ++--- drivers/staging/iio/meter/ade7854-spi.c | 40 ++++++++++++++--------------- 2 files changed, 23 insertions(+), 23 deletions(-)
drivers/staging/iio/meter/ade7758_trigger.c +3 -3
@@ -30,7 +30,7 @@ static irqreturn_t ade7758_data_rdy_trig_poll(int irq, void *private)* ade7758_data_rdy_trigger_set_state() set datardy interrupt state **/ static int ade7758_data_rdy_trigger_set_state (struct iio_trigger *trig, -bool state) +bool state) {struct iio_dev *indio_dev =iio_trigger_get_drvdata (trig);
@@ -63,8 +63,8 @@ int ade7758_probe_trigger(struct iio_dev *indio_dev)int ret; st->trig =iio_trigger_alloc ("%s-dev%d" , -spi_get_device_id (st->us)->name, - indio_dev->id); +spi_get_device_id (st->us)->name, + indio_dev->id);if (!st->trig) { ret = -ENOMEM ; goto error_ret;
drivers/staging/iio/meter/ade7854-spi.c +20 -20
@@ -16,8 +16,8 @@#include "ade7854.h" static int ade7854_spi_write_reg_8 (struct device *dev, -u16 reg_address, -u8 val) +u16 reg_address, +u8 val) {int ret;struct iio_dev *indio_dev =dev_to_iio_dev (dev);
@@ -41,8 +41,8 @@ static int ade7854_spi_write_reg_8(struct device *dev, }static int ade7854_spi_write_reg_16 (struct device *dev, -u16 reg_address, -u16 val) +u16 reg_address, +u16 val) {int ret;struct iio_dev *indio_dev =dev_to_iio_dev (dev);
@@ -67,8 +67,8 @@ static int ade7854_spi_write_reg_16(struct device *dev, }static int ade7854_spi_write_reg_24 (struct device *dev, -u16 reg_address, -u32 val) +u16 reg_address, +u32 val) {int ret;struct iio_dev *indio_dev =dev_to_iio_dev (dev);
@@ -94,8 +94,8 @@ static int ade7854_spi_write_reg_24(struct device *dev, }static int ade7854_spi_write_reg_32 (struct device *dev, -u16 reg_address, -u32 val) +u16 reg_address, +u32 val) {int ret;struct iio_dev *indio_dev =dev_to_iio_dev (dev);
@@ -122,8 +122,8 @@ static int ade7854_spi_write_reg_32(struct device *dev, }static int ade7854_spi_read_reg_8 (struct device *dev, -u16 reg_address, -u8 *val) +u16 reg_address, +u8 *val) {struct iio_dev *indio_dev =dev_to_iio_dev (dev);struct ade7854_state *st =iio_priv (indio_dev);
@@ -149,7 +149,7 @@ static int ade7854_spi_read_reg_8(struct device *dev, ret =spi_sync_transfer (st->spi, xfers,ARRAY_SIZE (xfers));if (ret) {dev_err (&st->spi->dev,"problem when reading 8 bit register 0x%02X" , - reg_address); + reg_address); goto error_ret; } *val = st->rx[0 ];
@@ -160,8 +160,8 @@ static int ade7854_spi_read_reg_8(struct device *dev, }static int ade7854_spi_read_reg_16 (struct device *dev, -u16 reg_address, -u16 *val) +u16 reg_address, +u16 *val) {struct iio_dev *indio_dev =dev_to_iio_dev (dev);struct ade7854_state *st =iio_priv (indio_dev);
@@ -186,7 +186,7 @@ static int ade7854_spi_read_reg_16(struct device *dev, ret =spi_sync_transfer (st->spi, xfers,ARRAY_SIZE (xfers));if (ret) {dev_err (&st->spi->dev,"problem when reading 16 bit register 0x%02X" , - reg_address); + reg_address); goto error_ret; } *val =be16_to_cpup ((const __be16 *)st->rx);
@@ -197,8 +197,8 @@ static int ade7854_spi_read_reg_16(struct device *dev, }static int ade7854_spi_read_reg_24 (struct device *dev, -u16 reg_address, -u32 *val) +u16 reg_address, +u32 *val) {struct iio_dev *indio_dev =dev_to_iio_dev (dev);struct ade7854_state *st =iio_priv (indio_dev);
@@ -224,7 +224,7 @@ static int ade7854_spi_read_reg_24(struct device *dev, ret =spi_sync_transfer (st->spi, xfers,ARRAY_SIZE (xfers));if (ret) {dev_err (&st->spi->dev,"problem when reading 24 bit register 0x%02X" , - reg_address); + reg_address); goto error_ret; } *val = (st->rx[0 ] <<16 ) | (st->rx[1 ] <<8 ) | st->rx[2 ];
@@ -235,8 +235,8 @@ static int ade7854_spi_read_reg_24(struct device *dev, }static int ade7854_spi_read_reg_32 (struct device *dev, -u16 reg_address, -u32 *val) +u16 reg_address, +u32 *val) {struct iio_dev *indio_dev =dev_to_iio_dev (dev);struct ade7854_state *st =iio_priv (indio_dev);
@@ -262,7 +262,7 @@ static int ade7854_spi_read_reg_32(struct device *dev, ret =spi_sync_transfer (st->spi, xfers,ARRAY_SIZE (xfers));if (ret) {dev_err (&st->spi->dev,"problem when reading 32 bit register 0x%02X" , - reg_address); + reg_address); goto error_ret; } *val =be32_to_cpup ((const __be32 *)st->rx);
Signature · 1 line
2.16.2
Jonathan Cameron
maintainerRe: [PATCH v2 3/3] staging:iio:meter: Aligns open parenthesis
Quoted 13 lines · On Tue, 6 Mar 2018 21:44:26 -0300 Rodrigo Siqueira…
This patch fixes the checkpatch.pl checks:
staging/iio/meter/ade7854-spi.c:19: CHECK: Alignment should match open parenthesisstaging/iio/meter/ade7854-spi.c:44: CHECK: Alignment should match open parenthesisstaging/iio/meter/ade7854-spi.c:70: CHECK: Alignment should match open parenthesisstaging/iio/meter/ade7854-spi.c:97: CHECK: Alignment should match open parenthesisstaging/iio/meter/ade7854-spi.c:125: CHECK: Alignment should match open parenthesis
Quoted 3 lines
...
Signed-off-by Rodrigo Siqueira <[email protected]>
Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it.
Thanks,
Jonathan
Quoted 157 lines
--- drivers/staging/iio/meter/ade7758_trigger.c | 6 ++--- drivers/staging/iio/meter/ade7854-spi.c | 40 ++++++++++++++--------------- 2 files changed, 23 insertions(+), 23 deletions(-)drivers/staging/iio/meter/ade7758_trigger.c +3
-3@@ -30,7 +30,7 @@ static irqreturn_t ade7758_data_rdy_trig_poll(int irq, void *private)* ade7758_data_rdy_trigger_set_state() set datardy interrupt state **/ static int ade7758_data_rdy_trigger_set_state (struct iio_trigger *trig, -bool state) +bool state) {struct iio_dev *indio_dev =iio_trigger_get_drvdata (trig);@@ -63,8 +63,8 @@ int ade7758_probe_trigger(struct iio_dev *indio_dev)int ret; st->trig =iio_trigger_alloc ("%s-dev%d" , -spi_get_device_id (st->us)->name, - indio_dev->id); +spi_get_device_id (st->us)->name, + indio_dev->id);if (!st->trig) { ret = -ENOMEM ; goto error_ret;drivers/staging/iio/meter/ade7854-spi.c +20
-20@@ -16,8 +16,8 @@#include "ade7854.h" static int ade7854_spi_write_reg_8 (struct device *dev, -u16 reg_address, -u8 val) +u16 reg_address, +u8 val) {int ret;struct iio_dev *indio_dev =dev_to_iio_dev (dev);@@ -41,8 +41,8 @@ static int ade7854_spi_write_reg_8(struct device *dev, }static int ade7854_spi_write_reg_16 (struct device *dev, -u16 reg_address, -u16 val) +u16 reg_address, +u16 val) {int ret;struct iio_dev *indio_dev =dev_to_iio_dev (dev);@@ -67,8 +67,8 @@ static int ade7854_spi_write_reg_16(struct device *dev, }static int ade7854_spi_write_reg_24 (struct device *dev, -u16 reg_address, -u32 val) +u16 reg_address, +u32 val) {int ret;struct iio_dev *indio_dev =dev_to_iio_dev (dev);@@ -94,8 +94,8 @@ static int ade7854_spi_write_reg_24(struct device *dev, }static int ade7854_spi_write_reg_32 (struct device *dev, -u16 reg_address, -u32 val) +u16 reg_address, +u32 val) {int ret;struct iio_dev *indio_dev =dev_to_iio_dev (dev);@@ -122,8 +122,8 @@ static int ade7854_spi_write_reg_32(struct device *dev, }static int ade7854_spi_read_reg_8 (struct device *dev, -u16 reg_address, -u8 *val) +u16 reg_address, +u8 *val) {struct iio_dev *indio_dev =dev_to_iio_dev (dev);struct ade7854_state *st =iio_priv (indio_dev);@@ -149,7 +149,7 @@ static int ade7854_spi_read_reg_8(struct device *dev, ret =spi_sync_transfer (st->spi, xfers,ARRAY_SIZE (xfers));if (ret) {dev_err (&st->spi->dev,"problem when reading 8 bit register 0x%02X" , - reg_address); + reg_address); goto error_ret; } *val = st->rx[0 ];@@ -160,8 +160,8 @@ static int ade7854_spi_read_reg_8(struct device *dev, }static int ade7854_spi_read_reg_16 (struct device *dev, -u16 reg_address, -u16 *val) +u16 reg_address, +u16 *val) {struct iio_dev *indio_dev =dev_to_iio_dev (dev);struct ade7854_state *st =iio_priv (indio_dev);@@ -186,7 +186,7 @@ static int ade7854_spi_read_reg_16(struct device *dev, ret =spi_sync_transfer (st->spi, xfers,ARRAY_SIZE (xfers));if (ret) {dev_err (&st->spi->dev,"problem when reading 16 bit register 0x%02X" , - reg_address); + reg_address); goto error_ret; } *val =be16_to_cpup ((const __be16 *)st->rx);@@ -197,8 +197,8 @@ static int ade7854_spi_read_reg_16(struct device *dev, }static int ade7854_spi_read_reg_24 (struct device *dev, -u16 reg_address, -u32 *val) +u16 reg_address, +u32 *val) {struct iio_dev *indio_dev =dev_to_iio_dev (dev);struct ade7854_state *st =iio_priv (indio_dev);@@ -224,7 +224,7 @@ static int ade7854_spi_read_reg_24(struct device *dev, ret =spi_sync_transfer (st->spi, xfers,ARRAY_SIZE (xfers));if (ret) {dev_err (&st->spi->dev,"problem when reading 24 bit register 0x%02X" , - reg_address); + reg_address); goto error_ret; } *val = (st->rx[0 ] <<16 ) | (st->rx[1 ] <<8 ) | st->rx[2 ];@@ -235,8 +235,8 @@ static int ade7854_spi_read_reg_24(struct device *dev, }static int ade7854_spi_read_reg_32 (struct device *dev, -u16 reg_address, -u32 *val) +u16 reg_address, +u32 *val) {struct iio_dev *indio_dev =dev_to_iio_dev (dev);struct ade7854_state *st =iio_priv (indio_dev);@@ -262,7 +262,7 @@ static int ade7854_spi_read_reg_32(struct device *dev, ret =spi_sync_transfer (st->spi, xfers,ARRAY_SIZE (xfers));if (ret) {dev_err (&st->spi->dev,"problem when reading 32 bit register 0x%02X" , - reg_address); + reg_address); goto error_ret; } *val =be32_to_cpup ((const __be32 *)st->rx);