Re: [PATCH v3 1/2] staging: iio: ad7606: Move out of staging

2018-12-01 Thread Jonathan Cameron
On Thu, 29 Nov 2018 18:56:39 +0200
Stefan Popa  wrote:

> Move ad7606 ADC driver out of staging and into the mainline.
> 
> Signed-off-by: Stefan Popa 

Hi Stefan,

This has fallen into the usual trap that if I take 'just one last look'
at something I always find just one more thing (well 2 here) to comment
on...

However, they are both very minor but nice to fix things that can be
done after moving out of staging as I don't want to delay that by
going to a v4.  Of course, if there are other review comments that
need fixing then please do tidy these up as well.

Thanks.  Good progress on moving stuff out of staging this cycle
so I'm very happy ;)

Jonathan

> ---
> Changes in v2:
>   - Simplified the Kconfig menu.
>   - Added SPDX-License-Identifier.
>   - Ordered the includes alphabetically.
>   - Used a threaded interrupt.
>   - Replaced ad7606_poll_bh_to_ring() with ad7606_trigger_handler().
>   - Used a trigger. 
>   - Replaced wait_event_interruptible() with 
> wait_for_completion_timeout().
>   - Replaced wake_up_interruptible() with complete().
>   - Used devm_iio_triggered_buffer_setup().
>   - Added buffer_ops.
>   - Used single line comments where needed.
>   - Removed the gap between docs and struct.
>   - Added ad7606_of_match[].
> Changes in v3:
>   - Added a comment which offers more information of the way the interrupt
> is triggered.
>   - Fixed the way a new conversion is triggered.
>   - endianness = IIO_CPU
>   - Removed unnecessary mutex locks.
>   - Removed the buffer_postdisable ops and replaced it with 
> buffer_predisable.
>   - Added a devm_add_action_or_reset() which deals with 
> regulator_disable().
>   - Misc style fixes.
>   
>  MAINTAINERS  |   7 +
>  drivers/iio/adc/Kconfig  |  28 ++
>  drivers/iio/adc/Makefile |   3 +
>  drivers/iio/adc/ad7606.c | 605 
> +++
>  drivers/iio/adc/ad7606.h | 106 ++
>  drivers/iio/adc/ad7606_par.c | 105 ++
>  drivers/iio/adc/ad7606_spi.c |  82 +
>  drivers/staging/iio/adc/Kconfig  |  34 --
>  drivers/staging/iio/adc/Makefile |   3 -
>  drivers/staging/iio/adc/ad7606.c | 565 
>  drivers/staging/iio/adc/ad7606.h | 106 --
>  drivers/staging/iio/adc/ad7606_par.c | 113 ---
>  drivers/staging/iio/adc/ad7606_spi.c |  79 -
>  13 files changed, 936 insertions(+), 900 deletions(-)
>  create mode 100644 drivers/iio/adc/ad7606.c
>  create mode 100644 drivers/iio/adc/ad7606.h
>  create mode 100644 drivers/iio/adc/ad7606_par.c
>  create mode 100644 drivers/iio/adc/ad7606_spi.c
>  delete mode 100644 drivers/staging/iio/adc/ad7606.c
>  delete mode 100644 drivers/staging/iio/adc/ad7606.h
>  delete mode 100644 drivers/staging/iio/adc/ad7606_par.c
>  delete mode 100644 drivers/staging/iio/adc/ad7606_spi.c
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index f642044..843545d 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -839,6 +839,13 @@ S:   Supported
>  F:   drivers/iio/dac/ad5758.c
>  F:   Documentation/devicetree/bindings/iio/dac/ad5758.txt
>  
> +ANALOG DEVICES INC AD7606 DRIVER
> +M:   Stefan Popa 
> +L:   linux-...@vger.kernel.org
> +W:   http://ez.analog.com/community/linux-device-drivers
> +S:   Supported
> +F:   drivers/iio/adc/ad7606.c
> +
>  ANALOG DEVICES INC AD9389B DRIVER
>  M:   Hans Verkuil 
>  L:   linux-me...@vger.kernel.org
> diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
> index a52fea8..c3f61c9 100644
> --- a/drivers/iio/adc/Kconfig
> +++ b/drivers/iio/adc/Kconfig
> @@ -58,6 +58,34 @@ config AD7476
> To compile this driver as a module, choose M here: the
> module will be called ad7476.
>  
> +config AD7606
> + tristate
> + depends on GPIOLIB || COMPILE_TEST
> + depends on HAS_IOMEM
> + select IIO_BUFFER
> + select IIO_TRIGGERED_BUFFER
> +
> +config AD7606_IFACE_PARALLEL
> + tristate "Analog Devices AD7606 ADC driver with parallel interface 
> support"
> + select AD7606
> + help
> +   Say yes here to build parallel interface support for Analog Devices:
> +   ad7605-4, ad7606, ad7606-6, ad7606-4 analog to digital converters 
> (ADC).
> +
> +   To compile this driver as a module, choose M here: the
> +   module will be called ad7606_parallel.
> +
> +config AD7606_IFACE_SPI
> + tristate "Analog Devices AD7606 ADC driver with spi interface support"
> + depends on SPI
> + select AD7606
> + help
> +   Say yes here to build spi interface support for Analog Devices:
> +   ad7605-4, ad7606, ad7606-6, ad7606-4 analog to digital converters 
> (ADC).
> +
> +   To compile this driver as a module, choose M here: the
> +   module will be called ad7606_spi.
> +
>  config AD7766
>   tristate "Analog Devices AD7766/AD7767 ADC driver"
>   depends on 

Re: [PATCH v3 1/2] staging: iio: ad7606: Move out of staging

2018-12-01 Thread Jonathan Cameron
On Thu, 29 Nov 2018 18:56:39 +0200
Stefan Popa  wrote:

> Move ad7606 ADC driver out of staging and into the mainline.
> 
> Signed-off-by: Stefan Popa 

Hi Stefan,

This has fallen into the usual trap that if I take 'just one last look'
at something I always find just one more thing (well 2 here) to comment
on...

However, they are both very minor but nice to fix things that can be
done after moving out of staging as I don't want to delay that by
going to a v4.  Of course, if there are other review comments that
need fixing then please do tidy these up as well.

Thanks.  Good progress on moving stuff out of staging this cycle
so I'm very happy ;)

Jonathan

> ---
> Changes in v2:
>   - Simplified the Kconfig menu.
>   - Added SPDX-License-Identifier.
>   - Ordered the includes alphabetically.
>   - Used a threaded interrupt.
>   - Replaced ad7606_poll_bh_to_ring() with ad7606_trigger_handler().
>   - Used a trigger. 
>   - Replaced wait_event_interruptible() with 
> wait_for_completion_timeout().
>   - Replaced wake_up_interruptible() with complete().
>   - Used devm_iio_triggered_buffer_setup().
>   - Added buffer_ops.
>   - Used single line comments where needed.
>   - Removed the gap between docs and struct.
>   - Added ad7606_of_match[].
> Changes in v3:
>   - Added a comment which offers more information of the way the interrupt
> is triggered.
>   - Fixed the way a new conversion is triggered.
>   - endianness = IIO_CPU
>   - Removed unnecessary mutex locks.
>   - Removed the buffer_postdisable ops and replaced it with 
> buffer_predisable.
>   - Added a devm_add_action_or_reset() which deals with 
> regulator_disable().
>   - Misc style fixes.
>   
>  MAINTAINERS  |   7 +
>  drivers/iio/adc/Kconfig  |  28 ++
>  drivers/iio/adc/Makefile |   3 +
>  drivers/iio/adc/ad7606.c | 605 
> +++
>  drivers/iio/adc/ad7606.h | 106 ++
>  drivers/iio/adc/ad7606_par.c | 105 ++
>  drivers/iio/adc/ad7606_spi.c |  82 +
>  drivers/staging/iio/adc/Kconfig  |  34 --
>  drivers/staging/iio/adc/Makefile |   3 -
>  drivers/staging/iio/adc/ad7606.c | 565 
>  drivers/staging/iio/adc/ad7606.h | 106 --
>  drivers/staging/iio/adc/ad7606_par.c | 113 ---
>  drivers/staging/iio/adc/ad7606_spi.c |  79 -
>  13 files changed, 936 insertions(+), 900 deletions(-)
>  create mode 100644 drivers/iio/adc/ad7606.c
>  create mode 100644 drivers/iio/adc/ad7606.h
>  create mode 100644 drivers/iio/adc/ad7606_par.c
>  create mode 100644 drivers/iio/adc/ad7606_spi.c
>  delete mode 100644 drivers/staging/iio/adc/ad7606.c
>  delete mode 100644 drivers/staging/iio/adc/ad7606.h
>  delete mode 100644 drivers/staging/iio/adc/ad7606_par.c
>  delete mode 100644 drivers/staging/iio/adc/ad7606_spi.c
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index f642044..843545d 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -839,6 +839,13 @@ S:   Supported
>  F:   drivers/iio/dac/ad5758.c
>  F:   Documentation/devicetree/bindings/iio/dac/ad5758.txt
>  
> +ANALOG DEVICES INC AD7606 DRIVER
> +M:   Stefan Popa 
> +L:   linux-...@vger.kernel.org
> +W:   http://ez.analog.com/community/linux-device-drivers
> +S:   Supported
> +F:   drivers/iio/adc/ad7606.c
> +
>  ANALOG DEVICES INC AD9389B DRIVER
>  M:   Hans Verkuil 
>  L:   linux-me...@vger.kernel.org
> diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
> index a52fea8..c3f61c9 100644
> --- a/drivers/iio/adc/Kconfig
> +++ b/drivers/iio/adc/Kconfig
> @@ -58,6 +58,34 @@ config AD7476
> To compile this driver as a module, choose M here: the
> module will be called ad7476.
>  
> +config AD7606
> + tristate
> + depends on GPIOLIB || COMPILE_TEST
> + depends on HAS_IOMEM
> + select IIO_BUFFER
> + select IIO_TRIGGERED_BUFFER
> +
> +config AD7606_IFACE_PARALLEL
> + tristate "Analog Devices AD7606 ADC driver with parallel interface 
> support"
> + select AD7606
> + help
> +   Say yes here to build parallel interface support for Analog Devices:
> +   ad7605-4, ad7606, ad7606-6, ad7606-4 analog to digital converters 
> (ADC).
> +
> +   To compile this driver as a module, choose M here: the
> +   module will be called ad7606_parallel.
> +
> +config AD7606_IFACE_SPI
> + tristate "Analog Devices AD7606 ADC driver with spi interface support"
> + depends on SPI
> + select AD7606
> + help
> +   Say yes here to build spi interface support for Analog Devices:
> +   ad7605-4, ad7606, ad7606-6, ad7606-4 analog to digital converters 
> (ADC).
> +
> +   To compile this driver as a module, choose M here: the
> +   module will be called ad7606_spi.
> +
>  config AD7766
>   tristate "Analog Devices AD7766/AD7767 ADC driver"
>   depends on 

[PATCH v3 1/2] staging: iio: ad7606: Move out of staging

2018-11-29 Thread Stefan Popa
Move ad7606 ADC driver out of staging and into the mainline.

Signed-off-by: Stefan Popa 
---
Changes in v2:
- Simplified the Kconfig menu.
- Added SPDX-License-Identifier.
- Ordered the includes alphabetically.
- Used a threaded interrupt.
- Replaced ad7606_poll_bh_to_ring() with ad7606_trigger_handler().
- Used a trigger. 
- Replaced wait_event_interruptible() with 
wait_for_completion_timeout().
- Replaced wake_up_interruptible() with complete().
- Used devm_iio_triggered_buffer_setup().
- Added buffer_ops.
- Used single line comments where needed.
- Removed the gap between docs and struct.
- Added ad7606_of_match[].
Changes in v3:
- Added a comment which offers more information of the way the interrupt
  is triggered.
- Fixed the way a new conversion is triggered.
- endianness = IIO_CPU
- Removed unnecessary mutex locks.
- Removed the buffer_postdisable ops and replaced it with 
buffer_predisable.
- Added a devm_add_action_or_reset() which deals with 
regulator_disable().
- Misc style fixes.

 MAINTAINERS  |   7 +
 drivers/iio/adc/Kconfig  |  28 ++
 drivers/iio/adc/Makefile |   3 +
 drivers/iio/adc/ad7606.c | 605 +++
 drivers/iio/adc/ad7606.h | 106 ++
 drivers/iio/adc/ad7606_par.c | 105 ++
 drivers/iio/adc/ad7606_spi.c |  82 +
 drivers/staging/iio/adc/Kconfig  |  34 --
 drivers/staging/iio/adc/Makefile |   3 -
 drivers/staging/iio/adc/ad7606.c | 565 
 drivers/staging/iio/adc/ad7606.h | 106 --
 drivers/staging/iio/adc/ad7606_par.c | 113 ---
 drivers/staging/iio/adc/ad7606_spi.c |  79 -
 13 files changed, 936 insertions(+), 900 deletions(-)
 create mode 100644 drivers/iio/adc/ad7606.c
 create mode 100644 drivers/iio/adc/ad7606.h
 create mode 100644 drivers/iio/adc/ad7606_par.c
 create mode 100644 drivers/iio/adc/ad7606_spi.c
 delete mode 100644 drivers/staging/iio/adc/ad7606.c
 delete mode 100644 drivers/staging/iio/adc/ad7606.h
 delete mode 100644 drivers/staging/iio/adc/ad7606_par.c
 delete mode 100644 drivers/staging/iio/adc/ad7606_spi.c

diff --git a/MAINTAINERS b/MAINTAINERS
index f642044..843545d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -839,6 +839,13 @@ S: Supported
 F: drivers/iio/dac/ad5758.c
 F: Documentation/devicetree/bindings/iio/dac/ad5758.txt
 
+ANALOG DEVICES INC AD7606 DRIVER
+M: Stefan Popa 
+L: linux-...@vger.kernel.org
+W: http://ez.analog.com/community/linux-device-drivers
+S: Supported
+F: drivers/iio/adc/ad7606.c
+
 ANALOG DEVICES INC AD9389B DRIVER
 M: Hans Verkuil 
 L: linux-me...@vger.kernel.org
diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
index a52fea8..c3f61c9 100644
--- a/drivers/iio/adc/Kconfig
+++ b/drivers/iio/adc/Kconfig
@@ -58,6 +58,34 @@ config AD7476
  To compile this driver as a module, choose M here: the
  module will be called ad7476.
 
+config AD7606
+   tristate
+   depends on GPIOLIB || COMPILE_TEST
+   depends on HAS_IOMEM
+   select IIO_BUFFER
+   select IIO_TRIGGERED_BUFFER
+
+config AD7606_IFACE_PARALLEL
+   tristate "Analog Devices AD7606 ADC driver with parallel interface 
support"
+   select AD7606
+   help
+ Say yes here to build parallel interface support for Analog Devices:
+ ad7605-4, ad7606, ad7606-6, ad7606-4 analog to digital converters 
(ADC).
+
+ To compile this driver as a module, choose M here: the
+ module will be called ad7606_parallel.
+
+config AD7606_IFACE_SPI
+   tristate "Analog Devices AD7606 ADC driver with spi interface support"
+   depends on SPI
+   select AD7606
+   help
+ Say yes here to build spi interface support for Analog Devices:
+ ad7605-4, ad7606, ad7606-6, ad7606-4 analog to digital converters 
(ADC).
+
+ To compile this driver as a module, choose M here: the
+ module will be called ad7606_spi.
+
 config AD7766
tristate "Analog Devices AD7766/AD7767 ADC driver"
depends on SPI_MASTER
diff --git a/drivers/iio/adc/Makefile b/drivers/iio/adc/Makefile
index a6e6a0b..b734f4f 100644
--- a/drivers/iio/adc/Makefile
+++ b/drivers/iio/adc/Makefile
@@ -8,6 +8,9 @@ obj-$(CONFIG_AD_SIGMA_DELTA) += ad_sigma_delta.o
 obj-$(CONFIG_AD7266) += ad7266.o
 obj-$(CONFIG_AD7291) += ad7291.o
 obj-$(CONFIG_AD7298) += ad7298.o
+obj-$(CONFIG_AD7606_IFACE_PARALLEL) += ad7606_par.o
+obj-$(CONFIG_AD7606_IFACE_SPI) += ad7606_spi.o
+obj-$(CONFIG_AD7606) += ad7606.o
 obj-$(CONFIG_AD7923) += ad7923.o
 obj-$(CONFIG_AD7476) += ad7476.o
 obj-$(CONFIG_AD7766) += ad7766.o
diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c
new file mode 100644
index 000..7eb06b3
--- /dev/null
+++ 

[PATCH v3 1/2] staging: iio: ad7606: Move out of staging

2018-11-29 Thread Stefan Popa
Move ad7606 ADC driver out of staging and into the mainline.

Signed-off-by: Stefan Popa 
---
Changes in v2:
- Simplified the Kconfig menu.
- Added SPDX-License-Identifier.
- Ordered the includes alphabetically.
- Used a threaded interrupt.
- Replaced ad7606_poll_bh_to_ring() with ad7606_trigger_handler().
- Used a trigger. 
- Replaced wait_event_interruptible() with 
wait_for_completion_timeout().
- Replaced wake_up_interruptible() with complete().
- Used devm_iio_triggered_buffer_setup().
- Added buffer_ops.
- Used single line comments where needed.
- Removed the gap between docs and struct.
- Added ad7606_of_match[].
Changes in v3:
- Added a comment which offers more information of the way the interrupt
  is triggered.
- Fixed the way a new conversion is triggered.
- endianness = IIO_CPU
- Removed unnecessary mutex locks.
- Removed the buffer_postdisable ops and replaced it with 
buffer_predisable.
- Added a devm_add_action_or_reset() which deals with 
regulator_disable().
- Misc style fixes.

 MAINTAINERS  |   7 +
 drivers/iio/adc/Kconfig  |  28 ++
 drivers/iio/adc/Makefile |   3 +
 drivers/iio/adc/ad7606.c | 605 +++
 drivers/iio/adc/ad7606.h | 106 ++
 drivers/iio/adc/ad7606_par.c | 105 ++
 drivers/iio/adc/ad7606_spi.c |  82 +
 drivers/staging/iio/adc/Kconfig  |  34 --
 drivers/staging/iio/adc/Makefile |   3 -
 drivers/staging/iio/adc/ad7606.c | 565 
 drivers/staging/iio/adc/ad7606.h | 106 --
 drivers/staging/iio/adc/ad7606_par.c | 113 ---
 drivers/staging/iio/adc/ad7606_spi.c |  79 -
 13 files changed, 936 insertions(+), 900 deletions(-)
 create mode 100644 drivers/iio/adc/ad7606.c
 create mode 100644 drivers/iio/adc/ad7606.h
 create mode 100644 drivers/iio/adc/ad7606_par.c
 create mode 100644 drivers/iio/adc/ad7606_spi.c
 delete mode 100644 drivers/staging/iio/adc/ad7606.c
 delete mode 100644 drivers/staging/iio/adc/ad7606.h
 delete mode 100644 drivers/staging/iio/adc/ad7606_par.c
 delete mode 100644 drivers/staging/iio/adc/ad7606_spi.c

diff --git a/MAINTAINERS b/MAINTAINERS
index f642044..843545d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -839,6 +839,13 @@ S: Supported
 F: drivers/iio/dac/ad5758.c
 F: Documentation/devicetree/bindings/iio/dac/ad5758.txt
 
+ANALOG DEVICES INC AD7606 DRIVER
+M: Stefan Popa 
+L: linux-...@vger.kernel.org
+W: http://ez.analog.com/community/linux-device-drivers
+S: Supported
+F: drivers/iio/adc/ad7606.c
+
 ANALOG DEVICES INC AD9389B DRIVER
 M: Hans Verkuil 
 L: linux-me...@vger.kernel.org
diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
index a52fea8..c3f61c9 100644
--- a/drivers/iio/adc/Kconfig
+++ b/drivers/iio/adc/Kconfig
@@ -58,6 +58,34 @@ config AD7476
  To compile this driver as a module, choose M here: the
  module will be called ad7476.
 
+config AD7606
+   tristate
+   depends on GPIOLIB || COMPILE_TEST
+   depends on HAS_IOMEM
+   select IIO_BUFFER
+   select IIO_TRIGGERED_BUFFER
+
+config AD7606_IFACE_PARALLEL
+   tristate "Analog Devices AD7606 ADC driver with parallel interface 
support"
+   select AD7606
+   help
+ Say yes here to build parallel interface support for Analog Devices:
+ ad7605-4, ad7606, ad7606-6, ad7606-4 analog to digital converters 
(ADC).
+
+ To compile this driver as a module, choose M here: the
+ module will be called ad7606_parallel.
+
+config AD7606_IFACE_SPI
+   tristate "Analog Devices AD7606 ADC driver with spi interface support"
+   depends on SPI
+   select AD7606
+   help
+ Say yes here to build spi interface support for Analog Devices:
+ ad7605-4, ad7606, ad7606-6, ad7606-4 analog to digital converters 
(ADC).
+
+ To compile this driver as a module, choose M here: the
+ module will be called ad7606_spi.
+
 config AD7766
tristate "Analog Devices AD7766/AD7767 ADC driver"
depends on SPI_MASTER
diff --git a/drivers/iio/adc/Makefile b/drivers/iio/adc/Makefile
index a6e6a0b..b734f4f 100644
--- a/drivers/iio/adc/Makefile
+++ b/drivers/iio/adc/Makefile
@@ -8,6 +8,9 @@ obj-$(CONFIG_AD_SIGMA_DELTA) += ad_sigma_delta.o
 obj-$(CONFIG_AD7266) += ad7266.o
 obj-$(CONFIG_AD7291) += ad7291.o
 obj-$(CONFIG_AD7298) += ad7298.o
+obj-$(CONFIG_AD7606_IFACE_PARALLEL) += ad7606_par.o
+obj-$(CONFIG_AD7606_IFACE_SPI) += ad7606_spi.o
+obj-$(CONFIG_AD7606) += ad7606.o
 obj-$(CONFIG_AD7923) += ad7923.o
 obj-$(CONFIG_AD7476) += ad7476.o
 obj-$(CONFIG_AD7766) += ad7766.o
diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c
new file mode 100644
index 000..7eb06b3
--- /dev/null
+++