linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/5 V5] IIO: in kernel pull interfaces.
@ 2012-01-29 11:46 Jonathan Cameron
  2012-01-29 11:46 ` [PATCH 1/5] staging:iio:core add in kernel interface mapping and getting IIO channels Jonathan Cameron
                   ` (5 more replies)
  0 siblings, 6 replies; 26+ messages in thread
From: Jonathan Cameron @ 2012-01-29 11:46 UTC (permalink / raw)
  To: linux-iio
  Cc: greg, guenter.roeck, khali, dmitry.torokhov, broonie, alan, arnd,
	linus.walleij, maxime.ripard, thomas.petazzoni, zdevai, w.sang,
	marek.vasut, Jonathan Cameron

Hi All,

Firstly this is an RFC rather than a final proposal because I know there is
an issue with the provider being removed before the consumer.  It will be easy
to make this less likely to happen, but I am not entirely sure how to avoid
any possible race (suggestion welcome).

Greg KH raised significant issues with how I originally proposed doing this
map registration (consumer - provider association).  Hence this version is
a lot more conventional (you may well notice that even the header naming is
lifted from the regulator framework).  The original proposal registered this
mapping completely independent of the iio drivers, thus requiring no in driver
changes.  This version requires passing the mapping through them.  There are
advantages to both approaches and we can always bolt the driver independent
version back in if there is sufficient justification for it at a later date.

Note that this series is against the full IIO tree in staging.

All comments welcome.

Jonathan

Jonathan Cameron (5):
  staging:iio:core add in kernel interface mapping and getting IIO
    channels.
  staging:iio: move iio data return types into types.h for use by
    inkern
  staging:iio::hwmon interface client driver.
  staging:iio:Documentation in kernel pull description.
  stargate2: example of map configuration for iio to hwmon example.

 arch/arm/mach-pxa/stargate2.c                  |   22 ++
 drivers/staging/iio/Documentation/inkernel.txt |   59 ++++++
 drivers/staging/iio/Kconfig                    |   16 ++-
 drivers/staging/iio/Makefile                   |    4 +-
 drivers/staging/iio/consumer.h                 |  103 ++++++++++
 drivers/staging/iio/driver.h                   |   34 +++
 drivers/staging/iio/iio.h                      |    6 -
 drivers/staging/iio/iio_core.h                 |    3 +
 drivers/staging/iio/iio_hwmon.c                |  226 +++++++++++++++++++++
 drivers/staging/iio/industrialio-core.c        |    2 +-
 drivers/staging/iio/inkern.c                   |  256 ++++++++++++++++++++++++
 drivers/staging/iio/machine.h                  |   30 +++
 drivers/staging/iio/types.h                    |    4 +
 13 files changed, 756 insertions(+), 9 deletions(-)
 create mode 100644 drivers/staging/iio/Documentation/inkernel.txt
 create mode 100644 drivers/staging/iio/consumer.h
 create mode 100644 drivers/staging/iio/driver.h
 create mode 100644 drivers/staging/iio/iio_hwmon.c
 create mode 100644 drivers/staging/iio/inkern.c
 create mode 100644 drivers/staging/iio/machine.h

-- 
1.7.8.4

^ permalink raw reply	[flat|nested] 26+ messages in thread
* [PATCH 0/5 V4] IIO in kernel interfaces (pull)
@ 2011-11-07 15:44 Jonathan Cameron
  2011-11-07 15:44 ` [PATCH 5/5] stargate2: example of map configuration for iio to hwmon example Jonathan Cameron
  0 siblings, 1 reply; 26+ messages in thread
From: Jonathan Cameron @ 2011-11-07 15:44 UTC (permalink / raw)
  To: linux-iio, linux-kernel
  Cc: guenter.roeck, khali, dmitry.torokhov, broonie, gregkh, alan,
	arnd, linus.walleij, lars, maxime.ripard, lm-sensors,
	thomas.petazzoni, zdevai, Jonathan Cameron

Dear All,

Changes since V3 are all in processing of raw values to give sensible
hwmon outputs in response to Guenter's comments.

Also rebased on the new version of the IIO core.

Note this is just the association infrastructure and the pull interfaces.
Thus we can handle drivers polling for values.  Doing push interfaces
(interrupt triggered more or less) requires a lot more of the IIO
intrastructure to be in place and so will have to wait a little while.
This is available for the staging tree but will will require the second
large part of IIO to move out of staging (triggered and buffered capture)
plus needs a little more work and a lot more testing.  As the cover letter
for the push interface epxlains there are some complexities of the
interaction of push and pull interfaces on the same physical device.  These
are independent of the external interfaces so shouldn't block this support
merging.

The final patch is not intended for merging, but rather acts as an
example of the board configuration needed.


Since V2:

Fixes as per Guenter's comments on the iio_hwmon driver.
Only one that differred slightly from Guenters suggestion
is the value calculation where I reordered things to reduce
the chance of overflow as well as casting to longs.
Thanks Guenter!

Since V1:
Uses the bus's list of devices instead of having a local one.
     (thanks to Lars-Peter).

Added are interfaces for getting all channels mapped to a particular
device.

Hwmon driver is now vaguely complete - hence cc'd hwmon. If people
are happy I'd expect this to ultimately end up in drivers/hmwon.
Right now it is acting as a test driver for these interfaces.

Thanks and all comments welcome. I've added hwmon to the cc list 
this time round.

V1 message:

There are obviously some rough corners in here that will need cleaning up.
For now I've just put this out there to see if anyone radically disagrees
on the direction.  It sits on top the recent rfc to move first bit of IIO
out of staging with a few buglets fixed.  Best bet if anyone wants to
test is to pull from:

https://github.com/jic23/linux-iio/tree/outofstaging

which now also includes these patches.

Intereresting patches are 3 and 4.  5 gives a trivial example of
a driver using this (hwmon driver that only takes first matching channel
and sticks it out as in1_input - breaks all sorts elements of the hwmon
interface spec.)

For now I've gone with Mark Brown's suggestion of a datasheet_name for
finding the channels on the device.  Patch 2 hacks this name into the
max1363 driver.  I'll probably put a version matching on channel number and
type in at a later date.

Here we just have a pull interface.  Push is considerably harder to do
and needs quite a lot more of the IIO infrastructure to be in place
(triggers / buffers etc). Events obviously require IIO event handling
to be there. Hence all of that will have to wait until those elements
have in of themselves been posted for review.

It is pretty clear to me that hwmon interface for starters needs the
ability to say - 'give me all mappings that correspond to me'.

This is what I intend to add next followed by some utility functions
to make it easy to match the hwmon interface.

At that point I'll propose the hwmon driver goes into drivers/hwmon
(subject to the underlying iio stuff merging).

Fun fun fun.  Thanks to Linus an Mark for their input on this.
Hope this is roughly what you guys were looking for.

Also on my list to do is to check this very thoroughly for any
possible race conditions around the removal of the underlying
device.

Jonathan

Jonathan Cameron (5):
  IIO: core: add datasheet_name to chan_spec
  IIO:ADC:max1363 add datasheet_name entries.
  IIO:CORE add in kernel interface mapping and getting IIO channels.
  IIO:hwmon interface client driver.
  stargate2: example of map configuration for iio to hwmon example.

 arch/arm/mach-pxa/stargate2.c  |   23 ++++
 drivers/Makefile               |    2 +-
 drivers/iio/Kconfig            |    8 ++
 drivers/iio/Makefile           |    2 +
 drivers/iio/adc/max1363_core.c |    2 +
 drivers/iio/iio.c              |  264 +++++++++++++++++++++++++++++++++++++++-
 drivers/iio/iio_hwmon.c        |  227 ++++++++++++++++++++++++++++++++++
 drivers/iio/inkern.c           |   20 +++
 include/linux/iio/iio.h        |    7 +-
 include/linux/iio/inkern.h     |   95 ++++++++++++++
 10 files changed, 643 insertions(+), 7 deletions(-)
 create mode 100644 drivers/iio/iio_hwmon.c
 create mode 100644 drivers/iio/inkern.c
 create mode 100644 include/linux/iio/inkern.h

-- 
1.7.7.2

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

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

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-29 11:46 [RFC PATCH 0/5 V5] IIO: in kernel pull interfaces Jonathan Cameron
2012-01-29 11:46 ` [PATCH 1/5] staging:iio:core add in kernel interface mapping and getting IIO channels Jonathan Cameron
2012-01-30 20:22   ` Mark Brown
2012-01-30 20:28     ` Jonathan Cameron
2012-02-01 19:58       ` Linus Walleij
2012-02-06 21:30         ` Jonathan Cameron
2012-02-09 18:10   ` Greg KH
2012-02-09 18:34     ` Jonathan Cameron
2012-02-09 18:57       ` Greg KH
2012-02-09 19:15         ` Mark Brown
2012-02-09 19:17           ` Greg KH
2012-02-09 19:20             ` Mark Brown
2012-02-09 21:20               ` Jonathan Cameron
2012-02-10  1:03                 ` Linus Walleij
2012-01-29 11:46 ` [PATCH 2/5] staging:iio: move iio data return types into types.h for use by inkern Jonathan Cameron
2012-01-29 11:46 ` [PATCH 3/5] staging:iio::hwmon interface client driver Jonathan Cameron
2012-01-29 11:46 ` [PATCH 4/5] staging:iio:Documentation in kernel pull description Jonathan Cameron
2012-01-29 11:46 ` [PATCH 5/5] stargate2: example of map configuration for iio to hwmon example Jonathan Cameron
2012-01-30 19:33   ` Mark Brown
2012-01-30 20:26     ` Jonathan Cameron
2012-01-30 21:22       ` Mark Brown
2012-01-30 21:48         ` Jonathan Cameron
2012-01-31  8:39         ` Linus Walleij
2012-01-31 11:09           ` Mark Brown
2012-01-30 19:28 ` [RFC PATCH 0/5 V5] IIO: in kernel pull interfaces Linus Walleij
  -- strict thread matches above, loose matches on Subject: below --
2011-11-07 15:44 [PATCH 0/5 V4] IIO in kernel interfaces (pull) Jonathan Cameron
2011-11-07 15:44 ` [PATCH 5/5] stargate2: example of map configuration for iio to hwmon example 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).