History log of /drivers/staging/iio/buffer.h
Revision Date Author Comments
004d81339a3039e6402aa1ab73c5f986c9036786 21-Feb-2012 Lars-Peter Clausen <lars@metafoo.de> staging:iio: Remove declaration for non existing function

The declaration for iio_buffer_deinit has been around for quite some time, but
the function itself has never been added. So remove the declaration.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7933514043d42e69663a5123a53fab50eb0b4aba 19-Dec-2011 Lars-Peter Clausen <lars@metafoo.de> staging:iio: Drop {mark,unmark}_in_use callbacks

These callbacks are currently used by the individual buffer implementations to
ensure that the request_update callback is not issued while the buffer is in use.
But the core already provides sufficient measures to prevent this from happening
in the first place. So it is safe to remove them.

There is one functional change due to this patch. Since the buffer is no longer
marked as in use when the chrdev is opened, it is now possible to enable the
buffer while it is opened. This did not work before, because mark_param_change
did fail if the buffer was marked as in use.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
869871b58c7f7c26ccf7a89cbe599e9b963b8e69 19-Dec-2011 Lars-Peter Clausen <lars@metafoo.de> staging:iio: Drop buffer mark_param_change callback

Right now we have a mark_param_change callback in the buffer access
functions struct, which should be called whenever the parameters (length,
bytes per datum) of the buffer change. But it is only called when the user
changes the buffer size, not when the bytes per datum change. Additionally each
buffer implementation already keeps track internally whether its parameters
have changed, making the call to mark_param_change after changing the buffer
length redundant. Since each buffer implementation knows best when one of its
parameters has changed just make tracking of this internal and drop the
mark_param_change callback.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
307276cb8366d9c163160fe2775f5bfe7b9c1495 19-Dec-2011 Lars-Peter Clausen <lars@metafoo.de> staging:iio: Drop the unused buffer enable() and is_enabled() callbacks

Currently none of the buffer implementations implements the enable() or
is_enable() nor does core code try to call these. So it is safe to remove them.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
68bc73043224fb1a5a22ff9e77a9c758b9828525 19-Dec-2011 Lars-Peter Clausen <lars@metafoo.de> staging:iio: Drop buffer busy flag

The flag is only cleared, never set or tested, so it is safe to remove it.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
8fe64955e47277abf4a3ec56383ea9b9487bd029 12-Dec-2011 Lars-Peter Clausen <lars@metafoo.de> staging:iio:kfifo_buf: Fix potential buffer overflow in iio_read_first_n_kfifo

n is the number of bytes to read, not the number of samples. So if there is
enough data available we will write to the userspace buffer beyond its bounds.
Fix this by copying n bytes maximum. Also round n down to the next multiple of
the sample size, so we will only read complete samples. If the buffer is too
small to hold at least one sample return -EINVAL.

Also update the documentation of read_first_n to reflect the fact that 'n' is
supposed to be in bytes and not in samples.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
5f070a36d62e27f55dcdcee735da683fe85bc10f 05-Dec-2011 Jonathan Cameron <jic23@kernel.org> staging:iio:buffer.h update struct buffer docs.

These docs have lagged recent developments.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
f79a9098902635c7a2bcaf3d83fb5ce90c2c961f 05-Dec-2011 Jonathan Cameron <jic23@kernel.org> staging:iio:buffer struct iio_buffer doesn't need an indio_dev pointer.

In all existing cases, the calls are coming from a location where
the indio_dev is already available.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
f7ff6945d0651fbeb61dc80f3b14059e808b3535 05-Dec-2011 Jonathan Cameron <jic23@kernel.org> staging:iio:buffer scrap to_iio_buffer as it no longer has meaning.

Now buffers do not have a specific dev structure, this is garbage.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
f32971ce0a008979f85e16a5090790e94eea9e9b 05-Dec-2011 Jonathan Cameron <jic23@kernel.org> staging:iio:buffer stop allowing for read_last callback.

No longer needed now we don't allow sysfs acccess to buffer data.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
66748b5ada7fb847882baf56e910da7bae75670d 05-Dec-2011 Jonathan Cameron <jic23@kernel.org> staging:iio:buffer remove unused owner field from struct iio_buffer

Legacy of having multiple chrdevs that never got cleaned up.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
550268ca1111a5b4737f15f7bf646cede9d1f0cd 05-Dec-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio: scrap scan_count and ensure all drivers use active_scan_mask

Obviously drivers should only use this for pushing to buffers.
They need buffer->scan_mask for pulling from them post demux.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1612244f8a70dae6a7f266e78c5ba22a3db75780 05-Dec-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio:buffer move setup ops from buffer instance to iio_dev

These callbacks should not be buffer instance specific.
Hence move them out of the buffer.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
3771a0a88bd28cbf58e7e7dec3abb704ab61f5ec 05-Dec-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio: remove userspace access to bytes per datum.

There are no known reasons why userspace should want this value.
It can be established from the buffer description anyway.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
c15c4f1dea101f14f54ee081f07dbdaf4fa74e19 05-Dec-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio:buffer drop bpe field.

Has no remaining users.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
5ada4ea9be1614644687d61dd4a2ae771964f8b5 05-Dec-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio: add demux optionally to path from device to buffer

This gives you only what you ask for which is handy
for some devices with weird scan combinations.

Routes all data flow through a core utility function.
That and this demuxing support will be needed to do
demuxing to multiple destinations in kernel.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Tested-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
beb80600b017ff4c407e9e72eb7f9a884fed4210 05-Dec-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio:buffer add a cache of the timestamp scan index.

Basically avoids looking it up lots of times.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
af5046af1c812839f085030f358a01814666fc80 26-Oct-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio: header reorganization

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.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>