History log of /drivers/staging/iio/adc/ad7298_core.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
12e55508921865aefdd80fd17afe70c191afbd1b 09-Jan-2012 Linus Torvalds <torvalds@linux-foundation.org> Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

* 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (466 commits)
net/hyperv: Add support for jumbo frame up to 64KB
net/hyperv: Add NETVSP protocol version negotiation
net/hyperv: Remove unnecessary kmap_atomic in netvsc driver
staging/rtl8192e: Register against lib80211
staging/rtl8192e: Convert to lib80211_crypt_info
staging/rtl8192e: Convert to lib80211_crypt_data and lib80211_crypt_ops
staging/rtl8192e: Add lib80211.h to rtllib.h
staging/mei: add watchdog device registration wrappers
drm/omap: GEM, deal with cache
staging: vt6656: int.c, int.h: Change return of function to void
staging: usbip: removed unused definitions from header
staging: usbip: removed dead code from receive function
staging:iio: Drop {mark,unmark}_in_use callbacks
staging:iio: Drop buffer mark_param_change callback
staging:iio: Drop the unused buffer enable() and is_enabled() callbacks
staging:iio: Drop buffer busy flag
staging:iio: Make sure a device is only opened once at a time
staging:iio: Disallow modifying buffer size when buffer is enabled
staging:iio: Disallow changing scan elements in all buffered modes
staging:iio: Use iio_buffer_enabled instead of open coding it
...

Fix up conflict in drivers/staging/iio/adc/ad799x_core.c (removal of
module_init due to using module_i2c_driver() helper, next to removal of
MODULE_ALIAS due to using MODULE_DEVICE_TABLE instead).
389ac488330d9946a0f7dd572acd790e41486a9e 05-Dec-2011 Jonathan Cameron <jic23@kernel.org> staging:iio:adc:ad7476 scrap read from buffer for sysfs access.

No known use case and complicates in kernel interface work.

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>
/drivers/staging/iio/adc/ad7298_core.c
94386ab0b4c5a4e15afae8542cb01caa2ff37594 05-Dec-2011 Lars-Peter Clausen <lars@metafoo.de> staging:iio: Remove redundant spi driver bus initialization

In ancient times it was necessary to manually initialize the bus field of an
spi_driver to spi_bus_type. These days this is done in spi_register_driver() so
we can drop the manual assignment.

The patch was generated using the following coccinelle semantic patch:
// <smpl>
@@
identifier _driver;
@@
struct spi_driver _driver = {
.driver = {
- .bus = &spi_bus_type,
},
};
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/staging/iio/adc/ad7298_core.c
c1a752883dda6287b075215e419a77359f33edff 22-Nov-2011 Dan Carpenter <dan.carpenter@oracle.com> Staging: iio: fix endian conversion in ad7298_scan_direct()

"tmp" is used to store the output from cpu_to_be16() so it should be
a __be16 bit type.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/staging/iio/adc/ad7298_core.c
55e4390cb04e8b0fbae8983c3494c9e24132db1b 16-Nov-2011 Lars-Peter Clausen <lars@metafoo.de> staging:iio: Add missing MODULE_DEVICE_TABLE and MODULE_ALIAS

Quite a few iio drivers provide no MODULE_DEVICE_TABLE or MODULE_ALIAS or only
provide a MODULE_ALIAS while they have support for multiple device ids. This
prevents auto module loading from working correctly.

This patch fixes it by adding the missing MODULE_DEVICE_TABLEs and
MODULE_ALIAS'.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/staging/iio/adc/ad7298_core.c
c8a9f8056f40f6201b84fdddb49a1c62630902c5 26-Oct-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio:treewide only use shared to decide on interfaces

Internally the fact that say scale is shared across channels is
actually of remarkably little interest. Hence lets not store it.
Numerous devices have weird combinations of channels sharing
scale anyway so it is not as though this was really telling
us much. Note however that we do still use the shared sysfs
attrs thus massively reducing the number of attrs in complex
drivers.

Side effect is that certain drivers that were abusing this
(mostly my work) needed to do a few more checks on what the
channel they are being queried on actually is.

This is also helpful for in kernel interfaces where we
just want to query the scale and don't care whether it
is shared with other channels or not.

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>
/drivers/staging/iio/adc/ad7298_core.c
924f8a21dd13223cc1493a916c6769cf73e0d45e 26-Oct-2011 Lars-Peter Clausen <lars@metafoo.de> staging:iio: Do not use bitmasks for channel info addresses

Currently the iio framework uses bitmasks for the address field of channel info
attributes. This is for historical reasons and no longer required since it will
only ever query a single info attribute at once. This patch changes the code to
use the non-shifted iio_chan_info_enum values for the info attribute address.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/staging/iio/adc/ad7298_core.c
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>
/drivers/staging/iio/adc/ad7298_core.c
ae6ae6fec3f7d6919e0146996df37b665c75f662 16-Nov-2011 Lars-Peter Clausen <lars@metafoo.de> staging:iio: Use module_spi_driver to register SPI driver

Use the newly introduced module_spi_driver macro for registering SPI drivers.
This allows us to remove a few lines of boilerplate code.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/staging/iio/adc/ad7298_core.c
d2fffd6c2fd60fe9ab63ef30758d9d43a5057549 14-Oct-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio: fix removal path to allow correct freeing.

Fix a dumb lack of consideration of the effect of combining
the iio_device_unregister and iio_free_device calls into
one. There is no valid place to free some of the sysfs
array elements.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/staging/iio/adc/ad7298_core.c
84f79ecb0c1f39393b96e1401d4e8a1d498f3613 06-Oct-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio:adc:naming: dev_info to indio_dev for consistency

We had a random missmatch of these two. Lets pick the most common
and get rid of the other.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/staging/iio/adc/ad7298_core.c
6835cb6b438b77ba82ad5a23944bbfb12128f5db 27-Sep-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio: unwind the IIO_IN -> IIO_VOLTAGE define

This was originally there to avoid churn during a complex change.
Now everything is stable lets get rid of this as it is missleading
and confusing.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/staging/iio/adc/ad7298_core.c
14555b14455f9acbdf0e500ae96140828a970796 21-Sep-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio: replacing term ring with buffer in the IIO core.

They aren't always ring buffers, so just use buffer for all naming.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/staging/iio/adc/ad7298_core.c
3811cd6291bb5a11c8d830831149d6369e7d3b68 21-Sep-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio: rename ring_generic.h -> buffer_generic.h

Nothing in this file is specific to RING buffers so rename it.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/staging/iio/adc/ad7298_core.c
26d25ae3f0d8ffe350aacc75b71198d6b35bd1f4 02-Sep-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio: rework of attribute registration.

This set also includes quite a number of bug fixes of particularly
remove functions.

Necessary due to issue pointed out in Bart Van Assche's patch:
docs/driver-model: Document device.groups

V2: Rebase due to patch reordering.
V3: Pull various error fixes and cleanups out into their own patches.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <Michael.Hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/staging/iio/adc/ad7298_core.c
c009f7e42617bd52b61a35de621cd1deda08042b 30-Aug-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio:buffering cleanup ring_buffer_register_ex naming.

Now the old method is long gone, lets get rid of the _ex and whilst
here remove the unused id parameter.

Trivial mechanical change, but will break any out of tree drivers
using this.

V2: rebase
V3: rebase

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/staging/iio/adc/ad7298_core.c
1aa042783251c27a93e31929c24647729db326d4 30-Aug-2011 Jonathan Cameron <jic23@cam.ac.uk> staging: iio: push the main buffer chrdev down to the top level.

Sorry all, this one is very invasive, though the driver changes are
just trivial interface fixes. Not all done yet.

V2 - bring the sca3000 with us.
V3 - fix ade7758 bugs in conversion.
V4 - add ad5933

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/staging/iio/adc/ad7298_core.c
99c978529a40132a6f7a5f136b4362b56fc88d8c 03-Jul-2011 Paul Gortmaker <paul.gortmaker@windriver.com> staging: Add module.h to drivers/staging users

Lots of people expect module.h to just "be there" without
any #include effort. But we are crushing that. So fix those
files in staging relying on implicit module.h presence.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/staging/iio/adc/ad7298_core.c
cdf387096e34e71eeb6238183dd1856fd94a4e38 12-Aug-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio:adc: unused header removals.

More headers now not needed after iio_chan_spec conversions.
A couple of drivers were using helpers from adc.h.

Given these were trivial, they are pushed down into the drivers.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/staging/iio/adc/ad7298_core.c
6fe8135fccd66aedcc55ded70824342587fd2499 18-May-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio: implement an iio_info structure to take some of the constant elements out of iio_dev.

This was suggested by Arnd Bergmann, Other elements may well
move in here in future, but it definitely makes sense for these.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/staging/iio/adc/ad7298_core.c
cc4a48e4cf92776656633aeb895520dc53893f32 18-May-2011 Michael Hennerich <michael.hennerich@analog.com> staging:iio:adc:AD7298: Use private data space from iio_allocate_device

Use private data space from iio_allocate_device

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/staging/iio/adc/ad7298_core.c
01a99e182333cc3b885028eaec9fde158dde4f16 18-May-2011 Michael Hennerich <michael.hennerich@analog.com> staging:iio:adc:ad7298: Convert to new channel registration method

Convert to new channel registration method Update
Add missing call to iio_trigger_notify_done()

Backported to a point that will allow the driver to build all the
way through the series.

V2: IIO_CHAN macro usage updated.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/staging/iio/adc/ad7298_core.c
845bd12ac78f92ba8905f45de7e17a4a8b3cef40 18-May-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio: use the new central name attribute creation code

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/staging/iio/adc/ad7298_core.c
70d4fd3fcd47e01c29754d59fffaaee47a690a50 18-May-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio:adc:ad7298 move to irqchip based trigger handling.

Untested. This one is of a different form, so worth a closer look than
the previous incredibly similar patches (which were based on the
adis16400 that I have tested).

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/staging/iio/adc/ad7298_core.c
6f7c8ee585e9db54cb29af1bdb93f29837824933 15-Apr-2011 Jonathan Cameron <jic23@cam.ac.uk> staging:iio: Add ability to allocate private data space to iio_allocate_device

Suggested by Arnd Bergmann. Note this will break ALL drivers that
are out of mainline. The fix is trivial change of
iio_allocate_device() -> iio_allocate_device(0)
Sorry if this causes issues for any one!

V2: Include new drivers in the update

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/staging/iio/adc/ad7298_core.c
7c31b984c4d119d0e32a1696fd4ca6b506a73d10 24-Feb-2011 Michael Hennerich <michael.hennerich@analog.com> IIO: ADC: New driver for the AD7298 8-channel SPI ADC

This patch adds support for the
AD7298: 8-Channel, 1MSPS, 12-Bit SAR ADC with Temperature Sensor
via SPI bus.

This patch replaces the existing ad7298.c driver completely.
It was necessary since, the old driver did not comply with the
IIO ABI for such devices.

Changes since V1:
IIO: ADC: New driver for the AD7298 8-channel SPI ADC

Add documentation for new sysfs file tempX_input.
Simplify bit defines.
Remove outdated comments.
Fix indention style.
ad7298_show_temp():
Add locking.
Simplify temperature calculation.
Change temperature result from degrees into milli degrees Celsius.
Rename file according to new sysfs ABI documentation

Add timestamp attributes.
Revise timestamp handling accordingly.
Preset timestamp generation.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Reviewed-by: Shubhrajyoti <Shubhrajyoti@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/staging/iio/adc/ad7298_core.c