linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Userspace event handling and header files
@ 2011-10-21  7:21 Lars-Peter Clausen
  2011-10-21  8:02 ` Hennerich, Michael
  0 siblings, 1 reply; 17+ messages in thread
From: Lars-Peter Clausen @ 2011-10-21  7:21 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio@vger.kernel.org

Hi Jonathan,

I tried to write a small userspace iio event monitor in the style of evtest.
Right now we have four header files for iio: iio_core.h iio.h chrdev.h and
sysfs.h. To be able to receive and probably decode events in userspace we
need three of theses headers: chrdev.h for ioctls and the iio_event_data
struct, sysfs.h for the different iio_event enums and associated macros,
iio.h for the iio_chan_type and iio_modifier enums.

Since we probably don't want to export the sysfs.h and chrdev.h headers to
userspace I propose that we move everything which is needed for external API
into a common header for example iio.h and move all internal API, which is
only required to write a IIO driver for by the core itself, from the iio.h
header to a different header like iio_core.h.

What is your opinion on this?

- Lars

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [V2 PATCH 0/2] staging:iio: header reorganization
@ 2011-10-21 11:49 Jonathan Cameron
  2011-10-21 11:49 ` [PATCH 2/2] staging:iio: Use userspace types for iio_event_data Jonathan Cameron
  0 siblings, 1 reply; 17+ messages in thread
From: Jonathan Cameron @ 2011-10-21 11:49 UTC (permalink / raw)
  To: linux-iio; +Cc: lars, Jonathan Cameron

Since V1:

Merged Lars-Peter's patch adding ioctl.h as needed.
Added patch for event_data types as technically that's
just needed to keep userspace happy rather than causing
possible compile problems.

V1 message:

ssue brought up by Lars-Peter Clausen. This is a varient of what
he suggested.

io/iio.h for driver stuff (has to include types.h)
	Sub files for the bits drivers may or may not use
	iio/sysfs.h
	iio/buffer.h (contents of current buffer_generic.h)
	(obviously anything offering events will need events.h as well)
iio/types.h for the enums that matter to both
	iio_chan_type, iio_modifier
iio/events.h for the event code stuff
	IIO_EVENT_CODE and friends.  + everything in chrdev.h  So this
	is the stuff that userspace cares about.
	Also include iio_event_type, iio_event_direction

Thus iio drivers include iio.h + as required
events.h
sysfs.h
buffer.h

in kernel users (once that interface is merged) will need inkern.h
which will pull in types.h

Userspace will need just events.h (which pulls in types.h) to get
everything they need to know about.  Buffer userspace access doesn't
currently need any core defines. All information about the data
format is passed through sysfs.

Jonathan Cameron (1):
  staging:iio: header reorganization

Lars-Peter Clausen (1):
  staging:iio: Use userspace types for iio_event_data

 drivers/staging/iio/accel/adis16201_core.c      |    2 +-
 drivers/staging/iio/accel/adis16203_core.c      |    2 +-
 drivers/staging/iio/accel/adis16204_core.c      |    2 +-
 drivers/staging/iio/accel/adis16209_core.c      |    2 +-
 drivers/staging/iio/accel/adis16240_core.c      |    2 +-
 drivers/staging/iio/accel/lis3l02dq_core.c      |    3 +-
 drivers/staging/iio/accel/sca3000_core.c        |    3 +-
 drivers/staging/iio/accel/sca3000_ring.c        |    2 +-
 drivers/staging/iio/adc/ad7192.c                |    2 +-
 drivers/staging/iio/adc/ad7280a.c               |    1 +
 drivers/staging/iio/adc/ad7291.c                |    1 +
 drivers/staging/iio/adc/ad7298_core.c           |    2 +-
 drivers/staging/iio/adc/ad7298_ring.c           |    2 +-
 drivers/staging/iio/adc/ad7476_core.c           |    2 +-
 drivers/staging/iio/adc/ad7476_ring.c           |    2 +-
 drivers/staging/iio/adc/ad7606_core.c           |    2 +-
 drivers/staging/iio/adc/ad7606_ring.c           |    2 +-
 drivers/staging/iio/adc/ad7793.c                |    2 +-
 drivers/staging/iio/adc/ad7816.c                |    1 +
 drivers/staging/iio/adc/ad7887_core.c           |    2 +-
 drivers/staging/iio/adc/ad7887_ring.c           |    2 +-
 drivers/staging/iio/adc/ad799x_core.c           |    3 +-
 drivers/staging/iio/adc/ad799x_ring.c           |    2 +-
 drivers/staging/iio/adc/adt7310.c               |    2 +-
 drivers/staging/iio/adc/adt7410.c               |    1 +
 drivers/staging/iio/adc/max1363_core.c          |    3 +-
 drivers/staging/iio/adc/max1363_ring.c          |    2 +-
 drivers/staging/iio/addac/adt7316.c             |    1 +
 drivers/staging/iio/buffer.h                    |  227 ++++++++++++++++++++++
 drivers/staging/iio/buffer_generic.h            |  228 -----------------------
 drivers/staging/iio/cdc/ad7150.c                |    2 +-
 drivers/staging/iio/chrdev.h                    |   25 ---
 drivers/staging/iio/dac/ad5504.c                |    1 +
 drivers/staging/iio/events.h                    |   73 +++++++
 drivers/staging/iio/gyro/adis16260_core.c       |    2 +-
 drivers/staging/iio/iio.h                       |   39 +----
 drivers/staging/iio/iio_simple_dummy.c          |    3 +-
 drivers/staging/iio/iio_simple_dummy_events.c   |    1 +
 drivers/staging/iio/impedance-analyzer/ad5933.c |    2 +-
 drivers/staging/iio/imu/adis16400_core.c        |    2 +-
 drivers/staging/iio/industrialio-buffer.c       |    2 +-
 drivers/staging/iio/industrialio-core.c         |    2 +-
 drivers/staging/iio/kfifo_buf.h                 |    2 +-
 drivers/staging/iio/light/tsl2563.c             |    1 +
 drivers/staging/iio/meter/ade7758_core.c        |    2 +-
 drivers/staging/iio/ring_sw.h                   |    2 +-
 drivers/staging/iio/sysfs.h                     |   43 -----
 drivers/staging/iio/types.h                     |   49 +++++
 48 files changed, 396 insertions(+), 367 deletions(-)
 create mode 100644 drivers/staging/iio/buffer.h
 delete mode 100644 drivers/staging/iio/buffer_generic.h
 delete mode 100644 drivers/staging/iio/chrdev.h
 create mode 100644 drivers/staging/iio/events.h
 create mode 100644 drivers/staging/iio/types.h

-- 
1.7.7

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2011-10-21 11:49 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-21  7:21 Userspace event handling and header files Lars-Peter Clausen
2011-10-21  8:02 ` Hennerich, Michael
2011-10-21  8:58   ` Jonathan Cameron
2011-10-21  9:09     ` [PATCH] staging:iio: header reorganization Jonathan Cameron
2011-10-21  9:12       ` Jonathan Cameron
2011-10-21  9:28         ` Jonathan Cameron
2011-10-21 10:42       ` Lars-Peter Clausen
2011-10-21 10:59         ` Jonathan Cameron
2011-10-21 11:15           ` Jonathan Cameron
2011-10-21 10:59         ` [PATCH 1/2] staging:iio: Add missing ioctl.h include to events.h Lars-Peter Clausen
2011-10-21 10:59           ` [PATCH 2/2] staging:iio: Use userspace types for iio_event_data Lars-Peter Clausen
2011-10-21 11:39             ` Jonathan Cameron
2011-10-21 11:00           ` [PATCH 1/2] staging:iio: Add missing ioctl.h include to events.h Jonathan Cameron
2011-10-21  9:42     ` Userspace event handling and header files Lars-Peter Clausen
2011-10-21  9:44       ` Jonathan Cameron
2011-10-21  9:51         ` Jonathan Cameron
  -- strict thread matches above, loose matches on Subject: below --
2011-10-21 11:49 [V2 PATCH 0/2] staging:iio: header reorganization Jonathan Cameron
2011-10-21 11:49 ` [PATCH 2/2] staging:iio: Use userspace types for iio_event_data Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).