Skip to contentSkip to conversation

iio: Move iio dummy modules out of staging

RFC PATCH In review Roberta Dobrescu 3 participants 3 messages Feb 12, 2015 – Feb 16, 2015 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 iio: Move iio dummy modules out of staging

This patch moves iio dummy modules from drivers/staging/iio/ out of staging, to drivers/iio/dummy/.

It also adds Makefile and Kconfig files and removes the entries that will no longer be needed from drivers/staging/iio/Kconfig and drivers/staging/iio/Makefile.

The corresponding config options are removed from IIO Staging Drivers menu and added to a new IIO Dummy Modules menu.

---
 drivers/iio/Kconfig                           |   1 +
 drivers/iio/Makefile                          |   1 +
 drivers/iio/dummy/Kconfig                     |  33 ++
 drivers/iio/dummy/Makefile                    |  10 +
 drivers/iio/dummy/iio_dummy_evgen.c           | 239 ++++++++
 drivers/iio/dummy/iio_dummy_evgen.h           |  13 +
 drivers/iio/dummy/iio_simple_dummy.c          | 750 ++++++++++++++++++++++++++
 drivers/iio/dummy/iio_simple_dummy.h          | 129 +++++
 drivers/iio/dummy/iio_simple_dummy_buffer.c   | 192 +++++++
 drivers/iio/dummy/iio_simple_dummy_events.c   | 267 +++++++++
 drivers/staging/iio/Kconfig                   |  27 -
 drivers/staging/iio/Makefile                  |   8 -
 drivers/staging/iio/iio_dummy_evgen.c         | 239 --------
 drivers/staging/iio/iio_dummy_evgen.h         |  13 -
 drivers/staging/iio/iio_simple_dummy.c        | 750 --------------------------
 drivers/staging/iio/iio_simple_dummy.h        | 129 -----
 drivers/staging/iio/iio_simple_dummy_buffer.c | 192 -------
 drivers/staging/iio/iio_simple_dummy_events.c | 267 ---------
 18 files changed, 1635 insertions(+), 1625 deletions(-)
 create mode 100644 drivers/iio/dummy/Kconfig
 create mode 100644 drivers/iio/dummy/Makefile
 create mode 100644 drivers/iio/dummy/iio_dummy_evgen.c
 create mode 100644 drivers/iio/dummy/iio_dummy_evgen.h
 create mode 100644 drivers/iio/dummy/iio_simple_dummy.c
 create mode 100644 drivers/iio/dummy/iio_simple_dummy.h
 create mode 100644 drivers/iio/dummy/iio_simple_dummy_buffer.c
 create mode 100644 drivers/iio/dummy/iio_simple_dummy_events.c
 delete mode 100644 drivers/staging/iio/iio_dummy_evgen.c
 delete mode 100644 drivers/staging/iio/iio_dummy_evgen.h
 delete mode 100644 drivers/staging/iio/iio_simple_dummy.c
 delete mode 100644 drivers/staging/iio/iio_simple_dummy.h
 delete mode 100644 drivers/staging/iio/iio_simple_dummy_buffer.c
 delete mode 100644 drivers/staging/iio/iio_simple_dummy_events.c
drivers/iio/Kconfig +1 -0
index 4132935..0b83bfb 100644
@@ -63,6 +63,7 @@ source "drivers/iio/adc/Kconfig"
 source "drivers/iio/amplifiers/Kconfig"
 source "drivers/iio/common/Kconfig"
 source "drivers/iio/dac/Kconfig"
+source "drivers/iio/dummy/Kconfig"
 source "drivers/iio/frequency/Kconfig"
 source "drivers/iio/gyro/Kconfig"
 source "drivers/iio/humidity/Kconfig"
drivers/iio/Makefile +1 -0
index 698afc2..cd2655a 100644
@@ -16,6 +16,7 @@ obj-y += adc/
 obj-y += amplifiers/
 obj-y += common/
 obj-y += dac/
+obj-y += dummy/
 obj-y += gyro/
 obj-y += frequency/
 obj-y += humidity/
drivers/iio/dummy/Kconfig new file +33 -0
new file mode 100644
index 0000000..2521390
@@ -0,0 +1,33 @@
+#
+# Industrial I/O subsystem configuration
+#
+menu "IIO Dummy Modules"
+
+config IIO_DUMMY_EVGEN
+       tristate
+
+config IIO_SIMPLE_DUMMY
+       tristate "An example driver with no hardware requirements"
+       help
+	 Driver intended mainly as documentation for how to write
+	 a driver. May also be useful for testing userspace code
+	 without hardware.
+
+if IIO_SIMPLE_DUMMY
+
+config IIO_SIMPLE_DUMMY_EVENTS
+       boolean "Event generation support"
+       select IIO_DUMMY_EVGEN
+       help
+         Add some dummy events to the simple dummy driver.
+
+config IIO_SIMPLE_DUMMY_BUFFER
+	boolean "Buffered capture support"
+	select IIO_BUFFER
+	select IIO_KFIFO_BUF
+	help
+	  Add buffered data capture to the simple dummy driver.
+
+endif # IIO_SIMPLE_DUMMY
+
+endmenu
drivers/iio/dummy/Makefile new file +10 -0
new file mode 100644
index 0000000..94890db
@@ -0,0 +1,10 @@
+#
+# Makefile for the industrial I/O dummy modules.
+#
+
+obj-$(CONFIG_IIO_SIMPLE_DUMMY) += iio_dummy.o
+iio_dummy-y := iio_simple_dummy.o
+iio_dummy-$(CONFIG_IIO_SIMPLE_DUMMY_EVENTS) += iio_simple_dummy_events.o
+iio_dummy-$(CONFIG_IIO_SIMPLE_DUMMY_BUFFER) += iio_simple_dummy_buffer.o
+
+obj-$(CONFIG_IIO_DUMMY_EVGEN) += iio_dummy_evgen.o
drivers/iio/dummy/iio_dummy_evgen.c new file +239 -0

239 lines not on this page · raw message

drivers/iio/dummy/iio_dummy_evgen.h new file +13 -0
new file mode 100644
index 0000000..2ac293a
@@ -0,0 +1,13 @@
+#ifndef _IIO_DUMMY_EVGEN_H_
+#define _IIO_DUMMY_EVGEN_H_
+
+struct iio_dummy_regs {
+	u32 reg_id;
+	u32 reg_data;
+};
+
+struct iio_dummy_regs *iio_dummy_evgen_get_regs(int irq);
+int iio_dummy_evgen_get_irq(void);
+int iio_dummy_evgen_release_irq(int irq);
+
+#endif /* _IIO_DUMMY_EVGEN_H_ */
drivers/iio/dummy/iio_simple_dummy.c new file +750 -0

750 lines not on this page · raw message

drivers/iio/dummy/iio_simple_dummy.h new file +129 -0

129 lines not on this page · raw message

drivers/iio/dummy/iio_simple_dummy_buffer.c new file +192 -0

192 lines not on this page · raw message

drivers/iio/dummy/iio_simple_dummy_events.c new file +267 -0

267 lines not on this page · raw message

drivers/staging/iio/Kconfig +0 -27
index fa38be0..0e044cb 100644
@@ -17,31 +17,4 @@ source "drivers/staging/iio/meter/Kconfig"
 source "drivers/staging/iio/resolver/Kconfig"
 source "drivers/staging/iio/trigger/Kconfig"
 
-config IIO_DUMMY_EVGEN
-       tristate
-
-config IIO_SIMPLE_DUMMY
-       tristate "An example driver with no hardware requirements"
-       help
-	 Driver intended mainly as documentation for how to write
-	 a driver. May also be useful for testing userspace code
-	 without hardware.
-
-if IIO_SIMPLE_DUMMY
-
-config IIO_SIMPLE_DUMMY_EVENTS
-       boolean "Event generation support"
-       select IIO_DUMMY_EVGEN
-       help
-         Add some dummy events to the simple dummy driver.
-
-config IIO_SIMPLE_DUMMY_BUFFER
-	boolean "Buffered capture support"
-	select IIO_BUFFER
-	select IIO_KFIFO_BUF
-	help
-	  Add buffered data capture to the simple dummy driver.
-
-endif # IIO_SIMPLE_DUMMY
-
 endmenu
drivers/staging/iio/Makefile +0 -8
index d871061..9b02106 100644
@@ -1,14 +1,6 @@
 #
 # Makefile for the industrial I/O core.
 #
-
-obj-$(CONFIG_IIO_SIMPLE_DUMMY) += iio_dummy.o
-iio_dummy-y := iio_simple_dummy.o
-iio_dummy-$(CONFIG_IIO_SIMPLE_DUMMY_EVENTS) += iio_simple_dummy_events.o
-iio_dummy-$(CONFIG_IIO_SIMPLE_DUMMY_BUFFER) += iio_simple_dummy_buffer.o
-
-obj-$(CONFIG_IIO_DUMMY_EVGEN) += iio_dummy_evgen.o
-
 obj-y += accel/
 obj-y += adc/
 obj-y += addac/
drivers/staging/iio/iio_dummy_evgen.c deleted +0 -239

239 lines not on this page · raw message

drivers/staging/iio/iio_dummy_evgen.h deleted +0 -13
deleted file mode 100644
index 2ac293a..0000000
@@ -1,13 +0,0 @@
-#ifndef _IIO_DUMMY_EVGEN_H_
-#define _IIO_DUMMY_EVGEN_H_
-
-struct iio_dummy_regs {
-	u32 reg_id;
-	u32 reg_data;
-};
-
-struct iio_dummy_regs *iio_dummy_evgen_get_regs(int irq);
-int iio_dummy_evgen_get_irq(void);
-int iio_dummy_evgen_release_irq(int irq);
-
-#endif /* _IIO_DUMMY_EVGEN_H_ */
drivers/staging/iio/iio_simple_dummy.c deleted +0 -750

750 lines not on this page · raw message

drivers/staging/iio/iio_simple_dummy.h deleted +0 -129

129 lines not on this page · raw message

drivers/staging/iio/iio_simple_dummy_buffer.c deleted +0 -192

177 lines not on this page · raw message

drivers/staging/iio/iio_simple_dummy_events.c deleted +0 -267

267 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.9.1

Part of the diff is not shown here. View the raw message.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

=0A=
________________________________________=0A=
From: Jonathan Cameron [[email protected]]=0A=
Sent: Saturday, February 14, 2015 1:46 PM=0A=
To: Roberta Dobrescu; [email protected]=0A=
Cc: Baluta, Daniel; Purdila, Octavian; [email protected]; [email protected]; pm= [email protected]=0A=
Subject: Re: [RFC PATCH] iio: Move iio dummy modules out of staging=0A= =0A=
On 12/02/15 19:04, Roberta Dobrescu wrote:=0A=

Quoted 4 lines

This patch moves iio dummy modules from drivers/staging/iio/ out of=0A= staging, to drivers/iio/dummy/.=0A=
=0A=
It also adds Makefile and Kconfig files and removes the entries that will=

=0A=

Quoted 1 line

no longer be needed from drivers/staging/iio/Kconfig and drivers/staging/=

iio/Makefile.=0A=

Quoted 2 lines

=0A=
The corresponding config options are removed from IIO Staging Drivers men=

u and=0A=

Quoted 3 lines

added to a new IIO Dummy Modules menu.=0A=
=0A=

While I can see the advantage in moving this, the issue here was that=0A= there wase still one large change that would ideally be made to this driver= =0A=
prior to moving it out of staging.=0A=
=0A=
The way that evgen generates interrupts greatly restricts their use and=0A= is far from clean. Something more similar to that done in the sysfs=0A= trigger would be better. So change from handle_nested_irq (which will only= =0A=
ever call the threaded part) to an irq_work_queue.=0A=
=0A=
There is also the outstanding issue on how these devices should be created.= =0A=
What we have now, with a module parameter controlling how many instances=0A= are created, kind of works, but is rather uggly!=0A=
=0A=
There is a fun question on whether we can break the ABI on creation of=0A= a 'fake' device or not?=0A=
=0A=
Maybe it is time to move this out and just take the view that it's=0A= more esoteric (e.g. not IIO ABI) elements may well change to make it=0A= cleaner and more flexible.=0A=
=0A=
The creation of these fake devices strikes me as a job for configfs=0A= rather than module parameters and sysfs magic, but that's a bigger=0A= change.. We need that stuff anyway to deal with the abuse of sysfs=0A= to create 'devices' we have in the sysfs-trigger and the proposed=0A= high frequency timer trigger.=0A=
-----=0A=
=0A=
Hi Jonathan=0A=
=0A=
We are working on some IIO cleanups as a part of OPW program [1], [2].=0A= Our main priority now is to move ISL29018 out of staging.=0A= =0A=
What do you think about having an IIO dummy project for the=0A= next round of OPW.=0A=
=0A=
Besides the changes that you already mentioned we could also add=0A= support for more devices. This could be a nice 3 months project for an inte= rn.=0A=
=0A=
I wonder why your reply didn't reach linux-iio list ?=0A=
=0A=
thanks,=0A=
Daniel.=0A=
=0A=
[1] http://kernelnewbies.org/OPWIntro?action=3Drecall&rev=3D138=0A=
[2] https://iiobits.wordpress.com/=0A=
[3] http://marc.info/?l=3Dlinux-iio&m=3D142376792210058&w=3D2=0A=
=0A=
=0A=
=0A=
=0A=
=0A=
=0A=

#3 lore raw
Quoted 59 lines · Daniel

________________________________________
From: Jonathan Cameron [[email protected]]
Sent: Saturday, February 14, 2015 1:46 PM
To: Roberta Dobrescu; [email protected]
Cc: Baluta, Daniel; Purdila, Octavian; [email protected]; [email protected]; [email protected]
Subject: Re: [RFC PATCH] iio: Move iio dummy modules out of staging

Quoted 4 lines · Roberta Dobrescu

This patch moves iio dummy modules from drivers/staging/iio/ out of staging, to drivers/iio/dummy/.

It also adds Makefile and Kconfig files and removes the entries that

will

Quoted 1 line

no longer be needed from drivers/staging/iio/Kconfig and

drivers/staging/iio/Makefile.

Quoted 2 lines

The corresponding config options are removed from IIO Staging Drivers

menu and

Quoted 3 lines

added to a new IIO Dummy Modules menu.

While I can see the advantage in moving this, the issue here was that there wase still one large change that would ideally be made to this driver
prior to moving it out of staging.

The way that evgen generates interrupts greatly restricts their use and is far from clean. Something more similar to that done in the sysfs trigger would be better. So change from handle_nested_irq (which will only
ever call the threaded part) to an irq_work_queue.

There is also the outstanding issue on how these devices should be created.
What we have now, with a module parameter controlling how many instances
are created, kind of works, but is rather uggly!

There is a fun question on whether we can break the ABI on creation of a 'fake' device or not?

Maybe it is time to move this out and just take the view that it's more esoteric (e.g. not IIO ABI) elements may well change to make it cleaner and more flexible.

The creation of these fake devices strikes me as a job for configfs rather than module parameters and sysfs magic, but that's a bigger change.. We need that stuff anyway to deal with the abuse of sysfs to create 'devices' we have in the sysfs-trigger and the proposed high frequency timer trigger.
-----

Hi Jonathan

We are working on some IIO cleanups as a part of OPW program [1], [2]. Our main priority now is to move ISL29018 out of staging.

Quoted 6 lines

What do you think about having an IIO dummy project for the next round of OPW.

Besides the changes that you already mentioned we could also add support for more devices. This could be a nice 3 months project for an intern.

Cool. Thoroughly in favour. Perhaps looking at accompanying docs as an extension would be good..

Just seen your description. Looks good and we can expand on it as needed later. Will be interesting to see how it works out!

Quoted 19 lines

I wonder why your reply didn't reach linux-iio list ?

thanks,
Daniel.

[1] http://kernelnewbies.org/OPWIntro?action=recall&rev=138
[2] https://iiobits.wordpress.com/
[3] http://marc.info/?l=linux-iio&m=142376792210058&w=2

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

Signature · 1 line
Sent from my Android device with K-9 Mail. Please excuse my brevity.