kbuild.h forces include of autoconf.h on the
commandline using -include - so we do not need to
include the file explicit.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Here I've kept the selection of IIO_SW_RING separate from
IIO_TRIGGER as it will go away fairly shortly when the ring buffer
type becomes configurable on a per device basis, whereas the
IIO_TRIGGER select will remain. Whether to retain the option to
remove the support for ring buffers entirely is one for after that
support is in place.
Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Minimal changes to driver. Just adds the device to the id
table and adjusts the Kconfig elements appropriately.
Adding further similar chips from TAOS is complicated by their
different conversion functions (and hence left for now).
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Amit Kucheria <amit.kucheria@verdurent.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Add driver support for the tsl2563 TAOS ambient light sensor. After looking at
discussions on LKML, the driver was modified from a 'hwmon' driver to an 'iio'
driver. The sysfs interfaces have been tested on an RX51 (N900) to see if it
responds to changing light conditions.
The only real reason for submitting this to staging is that it is dependent on
the IIO subsystem.
Signed-off-by: Amit Kucheria <amit.kucheria@verdurent.com>
Cc: Jonathan Cameron <jic23@cam.ac.uk>
Cc: linux-omap@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
max1363 uses both the iio hardware ring buffer and software
ring buffer interfaces, but its Makefile and Kconfig do not
reflect that usage, so its build breaks. Add a new Kconfig
symbol to reflect that usage and change max1363.h & Makefile
to use the new Kconfig symbol.
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Both the max1363 and lis3l02dq modules rely on IIO trigger support in
their ring buffer implementations, which is presently a separate config
option. In the case of IIO_RING_BUFFER=y and IIO_TRIGGER=n, we end up
with the following:
ERROR: "iio_trigger_attach_poll_func" [drivers/staging/iio/adc/max1363.ko] undefined!
ERROR: "iio_trigger_dettach_poll_func" [drivers/staging/iio/adc/max1363.ko] undefined!
ERROR: "iio_trigger_unregister" [drivers/staging/iio/accel/lis3l02dq.ko] undefined!
ERROR: "iio_trigger_notify_done" [drivers/staging/iio/accel/lis3l02dq.ko] undefined!
ERROR: "iio_trigger_read_name" [drivers/staging/iio/accel/lis3l02dq.ko] undefined!
ERROR: "iio_trigger_poll" [drivers/staging/iio/accel/lis3l02dq.ko] undefined!
ERROR: "iio_trigger_attach_poll_func" [drivers/staging/iio/accel/lis3l02dq.ko] undefined!
ERROR: "iio_trigger_register" [drivers/staging/iio/accel/lis3l02dq.ko] undefined!
ERROR: "iio_free_trigger" [drivers/staging/iio/accel/lis3l02dq.ko] undefined!
ERROR: "iio_trigger_dettach_poll_func" [drivers/staging/iio/accel/lis3l02dq.ko] undefined!
ERROR: "iio_allocate_trigger" [drivers/staging/iio/accel/lis3l02dq.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2
This adds an IIO_TRIGGER select for these two drivers conditional on
IIO ring buffer support. Caught with an SH randconfig in -next.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Fix iio header files kernel-doc notation errors, spelling, typos,
indentation, grammar, etc.
It would also be good if these function names were spelled
correctly, but I didn't change them:
iio_push_or_escallate_ring_event()
iio_trigger_dettach_poll_func()
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Commit d43c36dc removed sched.h from interrupt.h and distributed sched.h
to users which needed it. This finishes it up for staging.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
linux/sched.h include was removed form linux/poll.h by
commmit a99bbaf5ee
Required for definition of TASK_INTERRUPTIBLE amongst others
From: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The IIO core expects request_irq to work, which doesn't appear to exist
on s390.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The I2C_CLIENT_INSMOD macro is only useful for i2c drivers which
implement device detection. The tsl2561 driver doesn't, so there
is no point in calling it.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Jonathan Cameron <jic23@cam.ac.uk>
The build of the dabusb driver broke:
drivers/media/video/dabusb.c:758: error: unknown field 'nodename' specified in initializer
drivers/media/video/dabusb.c:758: warning: initialization from incompatible pointer type
make[3]: *** wait: No child processes. Stop.
Due to this commit:
e454cea: Driver-Core: extend devnode callbacks to provide permissions
Missing the dabusb driver's dabusb_nodename() callback.
Similar issues with the iio/industrialio driver in staging, pointed out
and patched by Jean Delvare.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Industrialio-parts-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Error handling code following a kmalloc or kzalloc should free the
allocated data.
The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@r exists@
local idexpression x;
statement S;
expression E;
identifier f,f1,l;
position p1,p2;
expression *ptr != NULL;
@@
x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
<... when != x
when != if (...) { <+...x...+> }
(
x->f1 = E
|
(x->f1 == NULL || ...)
|
f(...,x->f1,...)
)
...>
(
return \(0\|<+...x...+>\|ptr\);
|
return@p2 ...;
)
@script:python@
p1 << r.p1;
p2 << r.p2;
@@
print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
device attr's should be static, otherwise duplicate identifiers are
created:
drivers/staging/iio/trigger/iio-trig-gpio.o:(.data+0x1c): multiple definition of `dev_attr_name'
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This needs considerably more work, all comments / suggestions
welcomed.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Simple example of how a gpio trigger driver would work.
Things to be added include interupt type control (high, low).
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The original posting of this driver led to a discussion in
which it was commented that a better system was needed
for dealing with the many possible periodic interrupt
sources available on some SoCs. Unfortunately that is
a big task and as far as I know, no-one has taken it
on as yet. So in the meantime this driver is still
in here.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Changes since V2:
* Moved to new registration methodology.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Example of relatively common case of device sampling
based on internal clock and providing a data ready
signal to indicate that new data is available to be
read out.
Generic trigger approach used to allow other devices
to be sampled 'at the same time' as this the accelerometer.
This is very useful in various motion estimation algorithms.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Please note this ring buffer implementation is very much a
work in progress (and hence RFC). In it's current form
it is stable and reasonably efficient. There are a couple
of unlikely cases that will lead to more data being lost
that is strictly necessary. The target was for the case
of requiring regular sampling even during user space reads.
All comments welcome.
The intention is to make this only one of several
implementations with run time selection. For now there
is only one, so it is hard coded into the drivers using it.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Add general registration support for IIO triggers. These
are currently only used to initialize a 'poll' of a given
device. Examples include the lis3l02dq's data ready signal
being used to initialize a read and gpio triggers being
used to allow externally synchronized sensor reading.
Each trigger can cause any number of 'consumer' devices
to be polled with each storing data into a related ring
buffer.
Two stage triggering is supported with 'fast' and 'slow'
paths. The first is used for things like pulling a data
hold line high and the second for actual read which
may take far longer.
Changes since V2:
* As with IIO triggers now use a registration approach
much closer to that of input leading to cleaner code.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Example of how a device with a hardware ring buffer is
handled within IIO.
Changes since V2:
* Moved to new registration functions giving much cleaner
interface.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This provides a unified interface for hardware and software
ring buffers.
Changes since V2:
* Moved to a more consistent structure. Now the ring buffer
has an associated struct device which is a child of the
relevant iio_dev. This in turn has two children, one
for the event interface and one for the access interface.
These two interfaces are now managed via cdev structures.
* Numerous minor cleanups
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This provides only very minimal support for this device.
Note that an alternate driver has been posted to the input
mailing list.
When the original LMKL discussion that led to the descision
to develop IIO occured, the question on whether the differing
requirements of IIO and input drivers made it a good idea
to have unified drivers was left as an open question.
It still is. All opinions on this question welcome.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
A later patch in the series will add data ready triggering
and ring buffer support.
This core patch provides an event interface and sysfs
based reading of values.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This is a pretty minimalist example of an IIO driver.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Core support for MAX1361, MAX1362, MAX1363, MAX1364,
MAX1136, MAX1137, MAX1138, MAX1139, MAX1236, MAX1237,
MAX1238, MAX1239.
Ring buffer support later in series.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>