linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4 V2] staging:iio: Add support for multiple buffers
@ 2012-05-30 19:36 Jonathan Cameron
  2012-05-30 19:36 ` [PATCH 1/4] " Jonathan Cameron
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Jonathan Cameron @ 2012-05-30 19:36 UTC (permalink / raw)
  To: linux-iio; +Cc: Jonathan Cameron

This is basically a rebase of the series from a few months back.
I held this one off as it's 'interesting and invasive'.

Basically this adds a level of indirection to the path between
the hardware and the software buffers.  This allows us to have
multiple buffers each with their own demuxer.  Clearly the
hardware has to be configured to provide all the channels
anyone is interested in, but then the flow looks something like.

Data ---> Demux1 ---> subset of data --> buffer1
 |
 -------> Demux2 ---> subset of data --> buffer2.

Note the demuxers should be very nearly transparent
if all the data is going on to the relevant buffer.

So you may ask ' Why?'  In short - it allows us to
do clean data flow to multiple consumers such as an
IIO buffer, input, hwmon etc for devices running in
an trigger driven mode.

I also have a few thoughts on basic in kernel filtering
dependent on new buffer implementations.

Anyhow. Whilst the patch is relatively large it mostly
boils down to code for tearing down all current buffers,
reconfiguring the device and then building them all back
up again.

The input driver shoes the sort of client we might have.
(It probably needs more work) I'd like to get the
first three patches in the linux-next asap so they
get lots of testing prior to the next merge window.

Hence if anyone has time to take a look that would be
great!

Jonathan

Jonathan Cameron (4):
  staging:iio: Add support for multiple buffers
  staging:iio:in kernel users: Add a data field for channel specific
    info.
  staging:iio: add a callback buffer for in kernel push interface
  staging:iio: Proof of concept input driver.

 drivers/iio/Kconfig                             |    6 +
 drivers/iio/Makefile                            |    1 +
 drivers/iio/buffer_cb.c                         |  115 ++++++++
 drivers/iio/industrialio-buffer.c               |  335 +++++++++++++++--------
 drivers/iio/industrialio-core.c                 |    1 +
 drivers/iio/inkern.c                            |    1 +
 drivers/staging/iio/Kconfig                     |   11 +
 drivers/staging/iio/Makefile                    |    1 +
 drivers/staging/iio/accel/adis16201_ring.c      |    4 +-
 drivers/staging/iio/accel/adis16203_ring.c      |    6 +-
 drivers/staging/iio/accel/adis16204_ring.c      |    3 +-
 drivers/staging/iio/accel/adis16209_ring.c      |    3 +-
 drivers/staging/iio/accel/adis16240_ring.c      |    4 +-
 drivers/staging/iio/accel/lis3l02dq_ring.c      |    3 +-
 drivers/staging/iio/adc/ad7192.c                |    3 +-
 drivers/staging/iio/adc/ad7298_ring.c           |    5 +-
 drivers/staging/iio/adc/ad7476_ring.c           |    2 +-
 drivers/staging/iio/adc/ad7606_ring.c           |    3 +-
 drivers/staging/iio/adc/ad7793.c                |    3 +-
 drivers/staging/iio/adc/ad7887_ring.c           |    2 +-
 drivers/staging/iio/adc/ad799x_ring.c           |    3 +-
 drivers/staging/iio/adc/max1363_ring.c          |    2 +-
 drivers/staging/iio/gyro/adis16260_ring.c       |    3 +-
 drivers/staging/iio/iio_input.c                 |  176 ++++++++++++
 drivers/staging/iio/iio_input.h                 |   23 ++
 drivers/staging/iio/iio_simple_dummy_buffer.c   |    5 +-
 drivers/staging/iio/impedance-analyzer/ad5933.c |    3 +-
 drivers/staging/iio/imu/adis16400_ring.c        |    2 +-
 drivers/staging/iio/meter/ade7758_ring.c        |    3 +-
 include/linux/iio/buffer.h                      |   24 +-
 include/linux/iio/consumer.h                    |   48 ++++
 include/linux/iio/iio.h                         |    2 +
 include/linux/iio/machine.h                     |    2 +
 33 files changed, 651 insertions(+), 157 deletions(-)
 create mode 100644 drivers/iio/buffer_cb.c
 create mode 100644 drivers/staging/iio/iio_input.c
 create mode 100644 drivers/staging/iio/iio_input.h

-- 
1.7.10.2

^ permalink raw reply	[flat|nested] 18+ messages in thread
* [PATCH 0/4 V3] staging:iio: Add support for multiple buffers
@ 2012-06-30 19:06 Jonathan Cameron
  2012-06-30 19:06 ` [PATCH 3/4] staging:iio: add a callback buffer for in kernel push interface Jonathan Cameron
  0 siblings, 1 reply; 18+ messages in thread
From: Jonathan Cameron @ 2012-06-30 19:06 UTC (permalink / raw)
  To: linux-iio; +Cc: Jonathan Cameron

Changes since V2.

Improved handling of error conditions in the buffer insertion and
removal code.  (suggested by Lars-Peter).  I want to take another
look at these, but didn't want to keep people from testing this
in the meantime.

Also a number of minor fixes that came up during testing.

Thanks,

Jonathan

Jonathan Cameron (4):
  staging:iio: Add support for multiple buffers
  staging:iio:in kernel users: Add a data field for channel specific
    info.
  staging:iio: add a callback buffer for in kernel push interface
  staging:iio: Proof of concept input driver.

 drivers/iio/Kconfig                             |   6 +
 drivers/iio/Makefile                            |   1 +
 drivers/iio/adc/at91_adc.c                      |   4 +-
 drivers/iio/buffer_cb.c                         | 115 +++++++
 drivers/iio/industrialio-buffer.c               | 378 ++++++++++++++++--------
 drivers/iio/industrialio-core.c                 |   1 +
 drivers/iio/inkern.c                            |   1 +
 drivers/staging/iio/Kconfig                     |  11 +
 drivers/staging/iio/Makefile                    |   1 +
 drivers/staging/iio/accel/adis16201_ring.c      |   4 +-
 drivers/staging/iio/accel/adis16203_ring.c      |   6 +-
 drivers/staging/iio/accel/adis16204_ring.c      |   3 +-
 drivers/staging/iio/accel/adis16209_ring.c      |   3 +-
 drivers/staging/iio/accel/adis16240_ring.c      |   4 +-
 drivers/staging/iio/accel/lis3l02dq_ring.c      |   3 +-
 drivers/staging/iio/adc/ad7192.c                |   3 +-
 drivers/staging/iio/adc/ad7298_ring.c           |   5 +-
 drivers/staging/iio/adc/ad7476_ring.c           |   2 +-
 drivers/staging/iio/adc/ad7606_ring.c           |   3 +-
 drivers/staging/iio/adc/ad7793.c                |   3 +-
 drivers/staging/iio/adc/ad7887_ring.c           |   2 +-
 drivers/staging/iio/adc/ad799x_ring.c           |   3 +-
 drivers/staging/iio/adc/max1363_ring.c          |   2 +-
 drivers/staging/iio/gyro/adis16260_ring.c       |   3 +-
 drivers/staging/iio/iio_input.c                 | 221 ++++++++++++++
 drivers/staging/iio/iio_input.h                 |  23 ++
 drivers/staging/iio/iio_simple_dummy_buffer.c   |   5 +-
 drivers/staging/iio/impedance-analyzer/ad5933.c |   3 +-
 drivers/staging/iio/imu/adis16400_ring.c        |   2 +-
 drivers/staging/iio/meter/ade7758_ring.c        |   3 +-
 include/linux/iio/buffer.h                      |  24 +-
 include/linux/iio/consumer.h                    |  48 +++
 include/linux/iio/iio.h                         |   2 +
 include/linux/iio/machine.h                     |   2 +
 34 files changed, 734 insertions(+), 166 deletions(-)
 create mode 100644 drivers/iio/buffer_cb.c
 create mode 100644 drivers/staging/iio/iio_input.c
 create mode 100644 drivers/staging/iio/iio_input.h

-- 
1.7.11.1


^ permalink raw reply	[flat|nested] 18+ messages in thread
* [PATCH 0/4 V5] staging:iio: Add support for multiple buffers (testing required!)
@ 2012-10-13  9:24 Jonathan Cameron
  2012-10-13  9:24 ` [PATCH 3/4] staging:iio: add a callback buffer for in kernel push interface Jonathan Cameron
  0 siblings, 1 reply; 18+ messages in thread
From: Jonathan Cameron @ 2012-10-13  9:24 UTC (permalink / raw)
  To: linux-iio; +Cc: Michael.Hennerich, lars, srinivas.pandruvada, Jonathan Cameron

In quick summary this is needed to do interrupt driven in kernel
clients as it adds the option to push to multiple 'buffer' interfaces.
Note that some of these may not actually do any buffering but rather
push directly into another subsytem (the example is input).

I would like to merge at least the first 3 patches early in this cycle.
What I need is some testing across a reasonable range of devices.  Review
is welcome of course as well!

The complexity in this set is entirely in the changes to industrialio-buffer.c
concerning how we go about adding and removing client buffers.  To do this
we need to work out which scan mask is appropriate given the requests of
all the given buffers (and whether we can satisfy it).  I've been testing
with the max1363 driver which probably has the most complex set of available
scan masks.  Thus when a new buffer is added or one is removed the whole
buffer set are torn down and built up again.  This may be undesirable for
some applications but should occur only rarely.

The example driver is for bridging to the input subsystem and still needs
some work, but that can occur later in this merge cycle whereas the changes
to the core really want to go in asap.

Changes since v3 

Rebased and added other drivers that have occured whilst this patch series
has been languishing in my local tree.

Changes since V2.

Improved handling of error conditions in the buffer insertion and
removal code.  (suggested by Lars-Peter).  I want to take another
look at these, but didn't want to keep people from testing this
in the meantime.

Also a number of minor fixes that came up during testing.

Thanks,

Jonathan

Jonathan Cameron (4):
  staging:iio: Add support for multiple buffers
  staging:iio:in kernel users: Add a data field for channel specific
    info.
  staging:iio: add a callback buffer for in kernel push interface
  staging:iio: Proof of concept input driver.

 drivers/iio/Kconfig                             |   6 +
 drivers/iio/Makefile                            |   1 +
 drivers/iio/accel/hid-sensor-accel-3d.c         |  15 +-
 drivers/iio/adc/ad7266.c                        |   3 +-
 drivers/iio/adc/ad7476.c                        |   2 +-
 drivers/iio/adc/ad_sigma_delta.c                |   2 +-
 drivers/iio/adc/at91_adc.c                      |   3 +-
 drivers/iio/buffer_cb.c                         | 113 +++++++
 drivers/iio/gyro/hid-sensor-gyro-3d.c           |  15 +-
 drivers/iio/industrialio-buffer.c               | 377 ++++++++++++++++--------
 drivers/iio/industrialio-core.c                 |   1 +
 drivers/iio/inkern.c                            |   1 +
 drivers/iio/light/adjd_s311.c                   |   3 +-
 drivers/iio/light/hid-sensor-als.c              |  15 +-
 drivers/iio/magnetometer/hid-sensor-magn-3d.c   |  15 +-
 drivers/staging/iio/Kconfig                     |  11 +
 drivers/staging/iio/Makefile                    |   1 +
 drivers/staging/iio/accel/adis16201_ring.c      |   2 +-
 drivers/staging/iio/accel/adis16203_ring.c      |   2 +-
 drivers/staging/iio/accel/adis16204_ring.c      |   2 +-
 drivers/staging/iio/accel/adis16209_ring.c      |   2 +-
 drivers/staging/iio/accel/adis16240_ring.c      |   2 +-
 drivers/staging/iio/accel/lis3l02dq_ring.c      |   2 +-
 drivers/staging/iio/adc/ad7298_ring.c           |   2 +-
 drivers/staging/iio/adc/ad7606_ring.c           |   2 +-
 drivers/staging/iio/adc/ad7887_ring.c           |   2 +-
 drivers/staging/iio/adc/ad799x_ring.c           |   2 +-
 drivers/staging/iio/adc/max1363_ring.c          |   2 +-
 drivers/staging/iio/gyro/adis16260_ring.c       |   2 +-
 drivers/staging/iio/iio_input.c                 | 225 ++++++++++++++
 drivers/staging/iio/iio_input.h                 |  23 ++
 drivers/staging/iio/iio_simple_dummy_buffer.c   |   5 +-
 drivers/staging/iio/impedance-analyzer/ad5933.c |   4 +-
 drivers/staging/iio/imu/adis16400_ring.c        |   5 +-
 drivers/staging/iio/meter/ade7758_ring.c        |   2 +-
 include/linux/iio/buffer.h                      |  24 +-
 include/linux/iio/consumer.h                    |  48 +++
 include/linux/iio/iio.h                         |   2 +
 include/linux/iio/machine.h                     |   2 +
 39 files changed, 740 insertions(+), 208 deletions(-)
 create mode 100644 drivers/iio/buffer_cb.c
 create mode 100644 drivers/staging/iio/iio_input.c
 create mode 100644 drivers/staging/iio/iio_input.h

-- 
1.7.12.2

^ permalink raw reply	[flat|nested] 18+ messages in thread
* [PATCH 0/4 V6] staging:iio: Add support for multiple buffers (testing required!)
@ 2012-10-31 10:30 Jonathan Cameron
  2012-10-31 10:30 ` [PATCH 3/4] staging:iio: add a callback buffer for in kernel push interface Jonathan Cameron
  0 siblings, 1 reply; 18+ messages in thread
From: Jonathan Cameron @ 2012-10-31 10:30 UTC (permalink / raw)
  To: linux-iio; +Cc: Jonathan Cameron

Same as V5 but with the changes from Lars-Peter's review to close some
memory leaks and catch up with some changes in the subsystem that had
passed this by.  It should also now be possible to disable the
timestamp! (oops).

Thanks to Lars for his work reviewing my patches and also for his
excellent work reviewing in general! Without him the whole subsystem
would be moving a lot slower.


Again, more testing would be good (thanks for those who already
have).

In quick summary this is needed to do interrupt driven in kernel
clients as it adds the option to push to multiple 'buffer' interfaces.
Note that some of these may not actually do any buffering but rather
push directly into another subsytem (the example is input).

I would like to merge at least the first 3 patches early in this cycle.
What I need is some testing across a reasonable range of devices.  Review
is welcome of course as well!

The complexity in this set is entirely in the changes to industrialio-buffer.c
concerning how we go about adding and removing client buffers.  To do this
we need to work out which scan mask is appropriate given the requests of
all the given buffers (and whether we can satisfy it).  I've been testing
with the max1363 driver which probably has the most complex set of available
scan masks.  Thus when a new buffer is added or one is removed the whole
buffer set are torn down and built up again.  This may be undesirable for
some applications but should occur only rarely.

The example driver is for bridging to the input subsystem and still needs
some work, but that can occur later in this merge cycle whereas the changes
to the core really want to go in asap.

Changes since v3 

Rebased and added other drivers that have occured whilst this patch series
has been languishing in my local tree.

Changes since V2.

Improved handling of error conditions in the buffer insertion and
removal code.  (suggested by Lars-Peter).  I want to take another
look at these, but didn't want to keep people from testing this
in the meantime.

Also a number of minor fixes that came up during testing.

Thanks,

Jonathan


Jonathan Cameron (4):
  staging:iio: Add support for multiple buffers
  staging:iio:in kernel users: Add a data field for channel specific
    info.
  staging:iio: add a callback buffer for in kernel push interface
  staging:iio: Proof of concept input driver.

 drivers/iio/Kconfig                             |   6 +
 drivers/iio/Makefile                            |   1 +
 drivers/iio/accel/hid-sensor-accel-3d.c         |  15 +-
 drivers/iio/adc/ad7266.c                        |   3 +-
 drivers/iio/adc/ad7476.c                        |   2 +-
 drivers/iio/adc/ad_sigma_delta.c                |   2 +-
 drivers/iio/adc/at91_adc.c                      |   3 +-
 drivers/iio/buffer_cb.c                         | 113 +++++++
 drivers/iio/gyro/hid-sensor-gyro-3d.c           |  15 +-
 drivers/iio/industrialio-buffer.c               | 380 ++++++++++++++++--------
 drivers/iio/industrialio-core.c                 |   1 +
 drivers/iio/inkern.c                            |   1 +
 drivers/iio/light/adjd_s311.c                   |   3 +-
 drivers/iio/light/hid-sensor-als.c              |  15 +-
 drivers/iio/magnetometer/hid-sensor-magn-3d.c   |  15 +-
 drivers/staging/iio/Kconfig                     |  11 +
 drivers/staging/iio/Makefile                    |   1 +
 drivers/staging/iio/accel/adis16201_ring.c      |   2 +-
 drivers/staging/iio/accel/adis16203_ring.c      |   2 +-
 drivers/staging/iio/accel/adis16204_ring.c      |   2 +-
 drivers/staging/iio/accel/adis16209_ring.c      |   2 +-
 drivers/staging/iio/accel/adis16240_ring.c      |   2 +-
 drivers/staging/iio/accel/lis3l02dq_ring.c      |   2 +-
 drivers/staging/iio/adc/ad7298_ring.c           |   2 +-
 drivers/staging/iio/adc/ad7606_ring.c           |   2 +-
 drivers/staging/iio/adc/ad7887_ring.c           |   2 +-
 drivers/staging/iio/adc/ad799x_ring.c           |   2 +-
 drivers/staging/iio/adc/max1363_ring.c          |   2 +-
 drivers/staging/iio/gyro/adis16260_ring.c       |   2 +-
 drivers/staging/iio/iio_input.c                 | 225 ++++++++++++++
 drivers/staging/iio/iio_input.h                 |  23 ++
 drivers/staging/iio/iio_simple_dummy_buffer.c   |   5 +-
 drivers/staging/iio/impedance-analyzer/ad5933.c |   4 +-
 drivers/staging/iio/imu/adis16400_ring.c        |   5 +-
 drivers/staging/iio/meter/ade7758_ring.c        |   2 +-
 include/linux/iio/buffer.h                      |  24 +-
 include/linux/iio/consumer.h                    |  48 +++
 include/linux/iio/iio.h                         |   2 +
 include/linux/iio/machine.h                     |   2 +
 39 files changed, 743 insertions(+), 208 deletions(-)
 create mode 100644 drivers/iio/buffer_cb.c
 create mode 100644 drivers/staging/iio/iio_input.c
 create mode 100644 drivers/staging/iio/iio_input.h

-- 
1.7.12.4

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

end of thread, other threads:[~2012-11-02 10:53 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-30 19:36 [PATCH 0/4 V2] staging:iio: Add support for multiple buffers Jonathan Cameron
2012-05-30 19:36 ` [PATCH 1/4] " Jonathan Cameron
2012-06-08 15:13   ` Lars-Peter Clausen
2012-06-09 12:17     ` Jonathan Cameron
2012-06-09 11:50       ` Lars-Peter Clausen
2012-06-09 17:56         ` Jonathan Cameron
2012-05-30 19:36 ` [PATCH 2/4] staging:iio:in kernel users: Add a data field for channel specific info Jonathan Cameron
2012-05-30 19:36 ` [PATCH 3/4] staging:iio: add a callback buffer for in kernel push interface Jonathan Cameron
2012-05-30 19:36 ` [PATCH 4/4] staging:iio: Proof of concept input driver Jonathan Cameron
2012-06-08 15:27   ` Lars-Peter Clausen
2012-06-09 17:56     ` Jonathan Cameron
  -- strict thread matches above, loose matches on Subject: below --
2012-06-30 19:06 [PATCH 0/4 V3] staging:iio: Add support for multiple buffers Jonathan Cameron
2012-06-30 19:06 ` [PATCH 3/4] staging:iio: add a callback buffer for in kernel push interface Jonathan Cameron
2012-10-13  9:24 [PATCH 0/4 V5] staging:iio: Add support for multiple buffers (testing required!) Jonathan Cameron
2012-10-13  9:24 ` [PATCH 3/4] staging:iio: add a callback buffer for in kernel push interface Jonathan Cameron
2012-10-17  8:50   ` Lars-Peter Clausen
2012-10-17  8:52     ` Jonathan Cameron
2012-10-31 10:30 [PATCH 0/4 V6] staging:iio: Add support for multiple buffers (testing required!) Jonathan Cameron
2012-10-31 10:30 ` [PATCH 3/4] staging:iio: add a callback buffer for in kernel push interface Jonathan Cameron
2012-10-31 14:10   ` Peter Meerwald
2012-11-02 10:53     ` 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).