linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] staging:iio:dummy (example) driver.
@ 2011-10-14 15:34 Jonathan Cameron
  2011-10-14 15:34 ` [PATCH 1/3] staging:iio:Documentation Simple dummy driver to explain the basics Jonathan Cameron
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jonathan Cameron @ 2011-10-14 15:34 UTC (permalink / raw)
  To: greg; +Cc: linux-iio, Jonathan Cameron

Dependent on: staging:iio: two fixes (patch 1 only).

Hi Greg,

This driver is meant to mainly act as documentation although it is useful
in its own right for testing interfaces etc on devices with no hardware.

This version is slightly modified from last posting (fixed the freeing
of struct iio_dev as with all other drivers).

Some general positive feedback and seeing as it can't actually break
any real hardware seems sensible to get it in place asap.  Once merged
I'll clear out a few of the documentation files that it supercedes.

It's an odd category where only newbies are interested enough to read
the code and none of them are confident enough to sign off on it.
Oh well.

There may be a better way of faking the interupts than is done here, but
attempts to extract suggestions from Thomas Gleixner + wider world
failed.

Thanks,

Jonathan

Previous descriptions:

Hi All,

This has v2 of the dummy driver introduction to start with,
main changes are responses to Manuels review and a kernel doc
fixes (as I remembered the format wrong whilst writing the
original code - oops).

The second patch is somewhat evil in that it uses an additional
helper module purely to fake event 'interupts'.  This is the best
option I have come up with for how to write a 'standard' looking
driver that will work without hardware.  It's hacky, but I don't
really want to spend much time on it if it will simply work.

The code in the actual dummy driver is pretty simple and standard.
Note I have glossed over having a top half to the interrupt as
the evgen driver can't run one as currently stands.  We talked
a while ago about a workaround for that in the core, but nothing
is in place as yet.

The third patch puts basic example buffered support in place.
I haven't provided a trigger because that would require either
extending the nasty evgen module, or writing another.

Whilst it is decidely 'unusual' we do have a hardware free trigger
in the iio-trig-sysfs.  I'd not advise people look at that one
to get an idea of how a normal one works though.

So at the end of this, the weak point is the lack of an example
trigger, but those vary so much anyway I inclined to tell people
to look for a driver that happens to do roughly what their hardware
needs and copy that!

What do people think?

I propose to drop the 3 files I moaned about the other day from
the documentation directory in favour of a short description
of what this driver does but only once this is in place.

Thanks,

Jonathan

p.s. found a few bugs in the test prog, so I'll send a series
out cleaning those up soonish.


Jonathan Cameron (3):
  staging:iio:Documentation Simple dummy driver to explain the basics
  staging:iio:dummy Add event support + fake event generator
  staging:iio:dummy Add buffered reading support

 drivers/staging/iio/Kconfig                   |   27 ++
 drivers/staging/iio/Makefile                  |    7 +
 drivers/staging/iio/iio_dummy_evgen.c         |  217 ++++++++++
 drivers/staging/iio/iio_dummy_evgen.h         |    2 +
 drivers/staging/iio/iio_simple_dummy.c        |  545 +++++++++++++++++++++++++
 drivers/staging/iio/iio_simple_dummy.h        |  108 +++++
 drivers/staging/iio/iio_simple_dummy_buffer.c |  206 ++++++++++
 drivers/staging/iio/iio_simple_dummy_events.c |  190 +++++++++
 8 files changed, 1302 insertions(+), 0 deletions(-)
 create mode 100644 drivers/staging/iio/iio_dummy_evgen.c
 create mode 100644 drivers/staging/iio/iio_dummy_evgen.h
 create mode 100644 drivers/staging/iio/iio_simple_dummy.c
 create mode 100644 drivers/staging/iio/iio_simple_dummy.h
 create mode 100644 drivers/staging/iio/iio_simple_dummy_buffer.c
 create mode 100644 drivers/staging/iio/iio_simple_dummy_events.c

-- 
1.7.7


^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCH 0/3 V2] staging:iio:Documentation via dummy driver
@ 2011-09-20 15:58 Jonathan Cameron
  2011-09-20 15:58 ` [PATCH 2/3] staging:iio:dummy Add event support + fake event generator Jonathan Cameron
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Cameron @ 2011-09-20 15:58 UTC (permalink / raw)
  To: linux-iio
  Cc: manuel.stahl, jonathan.kunkee, michael.hennerich,
	Jonathan Cameron

Hi All,

This has v2 of the dummy driver introduction to start with,
main changes are responses to Manuels review and a kernel doc
fixes (as I remembered the format wrong whilst writing the
original code - oops).

The second patch is somewhat evil in that it uses an additional
helper module purely to fake event 'interupts'.  This is the best
option I have come up with for how to write a 'standard' looking
driver that will work without hardware.  It's hacky, but I don't
really want to spend much time on it if it will simply work.

The code in the actual dummy driver is pretty simple and standard.
Note I have glossed over having a top half to the interrupt as
the evgen driver can't run one as currently stands.  We talked
a while ago about a workaround for that in the core, but nothing
is in place as yet.

The third patch puts basic example buffered support in place.
I haven't provided a trigger because that would require either
extending the nasty evgen module, or writing another.

Whilst it is decidely 'unusual' we do have a hardware free trigger
in the iio-trig-sysfs.  I'd not advise people look at that one
to get an idea of how a normal one works though.

So at the end of this, the weak point is the lack of an example
trigger, but those vary so much anyway I inclined to tell people
to look for a driver that happens to do roughly what their hardware
needs and copy that!

What do people think?

I propose to drop the 3 files I moaned about the other day from
the documentation directory in favour of a short description
of what this driver does but only once this is in place.

Thanks,

Jonathan

p.s. found a few bugs in the test prog, so I'll send a series
out cleaning those up soonish.

Jonathan Cameron (3):
  staging:iio:Documentation Simple dummy driver to explain the basics
  staging:iio:dummy Add event support + fake event generator
  staging:iio:dummy Add buffered reading support

 drivers/staging/iio/Kconfig                   |   27 ++
 drivers/staging/iio/Makefile                  |    7 +
 drivers/staging/iio/iio_core.h                |    6 +-
 drivers/staging/iio/iio_dummy_evgen.c         |  217 ++++++++++
 drivers/staging/iio/iio_dummy_evgen.h         |    2 +
 drivers/staging/iio/iio_simple_dummy.c        |  540 +++++++++++++++++++++++++
 drivers/staging/iio/iio_simple_dummy.h        |  108 +++++
 drivers/staging/iio/iio_simple_dummy_buffer.c |  206 ++++++++++
 drivers/staging/iio/iio_simple_dummy_events.c |  190 +++++++++
 9 files changed, 1300 insertions(+), 3 deletions(-)
 create mode 100644 drivers/staging/iio/iio_dummy_evgen.c
 create mode 100644 drivers/staging/iio/iio_dummy_evgen.h
 create mode 100644 drivers/staging/iio/iio_simple_dummy.c
 create mode 100644 drivers/staging/iio/iio_simple_dummy.h
 create mode 100644 drivers/staging/iio/iio_simple_dummy_buffer.c
 create mode 100644 drivers/staging/iio/iio_simple_dummy_events.c

-- 
1.7.3.4


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

end of thread, other threads:[~2011-10-14 15:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-14 15:34 [PATCH 0/3] staging:iio:dummy (example) driver Jonathan Cameron
2011-10-14 15:34 ` [PATCH 1/3] staging:iio:Documentation Simple dummy driver to explain the basics Jonathan Cameron
2011-10-14 15:34 ` [PATCH 2/3] staging:iio:dummy Add event support + fake event generator Jonathan Cameron
2011-10-14 15:34 ` [PATCH 3/3] staging:iio:dummy Add buffered reading support Jonathan Cameron
  -- strict thread matches above, loose matches on Subject: below --
2011-09-20 15:58 [PATCH 0/3 V2] staging:iio:Documentation via dummy driver Jonathan Cameron
2011-09-20 15:58 ` [PATCH 2/3] staging:iio:dummy Add event support + fake event generator Jonathan Cameron
2011-09-21  9:59   ` 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).