linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [V2 PATCH 0/2] staging:iio: header reorganization
@ 2011-10-21 11:49 Jonathan Cameron
  2011-10-21 11:49 ` [PATCH 1/2] " Jonathan Cameron
  2011-10-21 11:49 ` [PATCH 2/2] staging:iio: Use userspace types for iio_event_data Jonathan Cameron
  0 siblings, 2 replies; 5+ 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] 5+ messages in thread
* Re: [PATCH] staging:iio: header reorganization
@ 2011-10-21 10:42 Lars-Peter Clausen
  2011-10-21 10:59 ` [PATCH 1/2] staging:iio: Add missing ioctl.h include to events.h Lars-Peter Clausen
  0 siblings, 1 reply; 5+ messages in thread
From: Lars-Peter Clausen @ 2011-10-21 10:42 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, Michael.Hennerich, device-drivers-devel

On 10/21/2011 11:09 AM, Jonathan Cameron wrote:
> Issue 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.

This seems to work nicely, thanks. There two minor issues left, but those
were also present before the restructuring, I'll send patches shortly.

Another issue is that you can only open the iio character device if your
device has buffer support, so without buffer support no event support
either. Michael said that has been some discussion on this before, do you
remember the conclusions of that discussion?

> [...]
> --- /dev/null
> +++ b/drivers/staging/iio/events.h
> @@ -0,0 +1,71 @@
> +/* The industrial I/O - event passing to userspace
> + *
> + * Copyright (c) 2008-2011 Jonathan Cameron
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 2 as published by
> + * the Free Software Foundation.
> + */
> +#include "types.h"

Any specific reason why you put this include above the include guard?

> +
> +#ifndef _IIO_EVENTS_H_
> +#define _IIO_EVENTS_H_
> +
> [...]
> diff --git a/drivers/staging/iio/iio.h b/drivers/staging/iio/iio.h
> index 429589f..339b609 100644
> --- a/drivers/staging/iio/iio.h
> +++ b/drivers/staging/iio/iio.h
> @@ -7,7 +7,7 @@
>   * under the terms of the GNU General Public License version 2 as published by
>   * the Free Software Foundation.
>   */
> -
> +#include "types.h"

Same here

>  #ifndef _INDUSTRIAL_IO_H_
>  #define _INDUSTRIAL_IO_H_
> [...]

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

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

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-21 11:49 [V2 PATCH 0/2] staging:iio: header reorganization Jonathan Cameron
2011-10-21 11:49 ` [PATCH 1/2] " Jonathan Cameron
2011-10-21 11:49 ` [PATCH 2/2] staging:iio: Use userspace types for iio_event_data Jonathan Cameron
  -- strict thread matches above, loose matches on Subject: below --
2011-10-21 10:42 [PATCH] staging:iio: header reorganization Lars-Peter Clausen
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

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