Commit Graph

32 Commits (a10d206ef1a83121ab7430cb196e0376a7145b22)

Author SHA1 Message Date
Lars-Peter Clausen a651cf9b5f staging:iio:resolver: Use dev_to_iio_dev()
Replace open-coded instances of getting a iio_dev struct from a device struct
with dev_to_iio_dev().

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>
2012-05-14 13:39:22 -07:00
Lars-Peter Clausen 7cbb753701 staging:iio: Streamline API function naming
Currently we use two different naming schemes in the IIO API, iio_verb_object
and iio_object_verb. E.g iio_device_register and iio_allocate_device. This
patches renames instances of the later to the former. The patch also renames allocate to
alloc as this seems to be the preferred form throughout the kernel.

In particular the following renames are performed by the patch:
	iio_put_device -> iio_device_put
	iio_allocate_device -> iio_device_alloc
	iio_free_device -> iio_device_free
	iio_get_trigger -> iio_trigger_get
	iio_put_trigger -> iio_trigger_put
	iio_allocate_trigger -> iio_trigger_alloc
	iio_free_trigger -> iio_trigger_free

The conversion was done with the following coccinelle patch with manual fixes to
comments and documentation.

<smpl>
@@
@@
-iio_put_device
+iio_device_put
@@
@@
-iio_allocate_device
+iio_device_alloc
@@
@@
-iio_free_device
+iio_device_free
@@
@@
-iio_get_trigger
+iio_trigger_get
@@
@@
-iio_put_trigger
+iio_trigger_put
@@
@@
-iio_allocate_trigger
+iio_trigger_alloc
@@
@@
-iio_free_trigger
+iio_trigger_free
</smpl>

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>
2012-04-29 21:23:49 -04:00
Jonathan Cameron 06458e277e IIO: Move core headers to include/linux/iio
Step 1 in moving the IIO core out of staging.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-25 11:01:43 -07:00
Jonathan Cameron 6246577071 staging:iio:resolver Add IIO_CHAN_INFO_RAW entries to all drivers.
Precursor to making value read / write attribute optional.
No processed values in resolvers at the moment.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-18 16:38:20 -07:00
Linus Torvalds 12e5550892 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).
2012-01-09 12:18:17 -08:00
Lars-Peter Clausen 55e4390cb0 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>
2011-11-26 16:48:04 -08:00
Lars-Peter Clausen ae6ae6fec3 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>
2011-11-17 12:15:40 -08:00
Jonathan Cameron d2fffd6c2f 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>
2011-10-17 15:34:53 -07:00
Jonathan Cameron 3e2c96eab9 staging:iio: gpio build dependency fixing
Numerous drivers either had pointless includes of gpio.h
or should have been dependent on GENERIC_GPIO and were not.
Conversion of ads1210 to use array registration triggered
build failures that highlighted all was not well.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-17 15:25:28 -07:00
Jonathan Cameron 93decf3661 staging:iio:resolver:ad2s1210 cleanup gpio handling.
Basically make use of the gpio array functions.
Technically the free doesn't need as much info
as given here, but this keeps it clean and easy
to follow.

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>
2011-10-05 13:47:48 -07:00
Jonathan Cameron f97beb535b staging:iio:resolver:ad2s1210 drop raw config register access
This should never have been exposed to userspace

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>
2011-10-05 13:47:48 -07:00
Jonathan Cameron 29148543c5 staging:iio:resolver:ad2s1210 minimal chan spec conversion.
Just convert the raw reads in this patch.

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>
2011-10-05 13:47:47 -07:00
Jonathan Cameron bf52f0591f staging:iio:resolver:ad2s1210 ensure iio_dev->name is set
This is needed to ensure the required name attribute is
created. Using an id table is the route most consistent
with other drivers.

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>
2011-10-05 13:47:47 -07:00
Jonathan Cameron 10e4a52b6e staging:iio:resolver rename ad2s120x ->ad2s1200
There are far too many possible part numbers that are
not covered in here to have such a generic name.
So move to naming after one of the supported parts.

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>
2011-10-05 13:47:47 -07:00
Jonathan Cameron 9c5ed82942 staging:iio:resolver:ad2s120x chan spec conversion
Straight forward conversion.

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>
2011-10-05 13:47:47 -07:00
Jonathan Cameron 199d847a2d staging:iio:resolver:ad2s90 chan spec conversion
Trivial conversion.

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>
2011-10-05 13:47:46 -07:00
Jonathan Cameron 19147f5bc6 staging:iio:resolver:ad2s90 ensure name is passed to iio_core.
Scraps the pointless name define and adds an id table.
It's not technically required in drivers with only one supported
part but it does make the probe code more consistent.

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>
2011-10-05 13:47:46 -07:00
Jonathan Cameron 72a86ccd3a staging:iio:resolver:ad2s90 fix registration of null pointer
When the new allocation code was introduced a stray pointer
to iio_dev structure was left in the chip state structure.
This was never set but was then registered with the core.

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>
2011-10-05 13:47:46 -07:00
Manuel Stahl 0aeac51d1b staging: iio: Move sensor drivers to sub menus
We have a lot of drivers now, so the iio sub menu becomes quite large.
This patch creates sub menus for the different sensors.

Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-26 17:31:50 -07:00
Jonathan Cameron 26d25ae3f0 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>
2011-09-06 16:02:01 -07:00
Jonathan Cameron 3e39440789 staging:iio:fix using iio_priv or iio_dev after iio_unregister_device
This includes calling iio_free_device as that should only be called
before the device has been registered.

Also one case of iio_free_device being called on a registered device.

This has been pulled out of the reworking attributes patch.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 16:00:29 -07:00
Paul Gortmaker 99c978529a 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>
2011-08-25 17:01:20 -07:00
Jonathan Cameron 705099a763 staging:iio:various Stop drivers putting sysfs attributes in a directory named after the device.
No idea how this particularly 'quirk' got in there in the first
place.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 13:28:45 -07:00
Jonathan Cameron 58f08b0af8 staging:iio:resolver:ad2s90 general cleanup
Very simple driver, so not much to do.

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>
2011-06-28 14:39:50 -07:00
Jonathan Cameron 8f2bd8363f staging:iio:resolver:ad2s120x cleanup.
I've currently squashed the vel + pos combined attribute.  If people need them
precisely paired I doubt they will get them from the sysfs interface anyway.
If that is a requirement it should come via a buffer implementation.

Note this patch leaves the completely non standard interface alone.
That will get fixed later.

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>
2011-06-28 14:39:50 -07:00
Jonathan Cameron b19e9ad5e2 staging:iio:resolver:ad2s1210 general driver cleanup.
Note I haven't made any changes to the userspace interface as yet.
This is all about cleaning up what was actually there (handling
all errors etc).

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>
2011-06-28 14:39:49 -07:00
Jonathan Cameron 6fe8135fcc 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>
2011-05-19 16:15:05 -07:00
Jonathan Cameron 6f7c8ee585 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>
2011-04-25 17:23:09 -07:00
Greg Kroah-Hartman 983bbfd091 Staging: iio: fix up world writable sysfs files.
You should not be able to write to sysfs files from any user.

Cc: Graf Yang <graf.yang@analog.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Cc: Jonathan Cameron <jic23@cam.ac.uk>
Cc: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-10 10:56:18 -08:00
Graf Yang 817e5c65c5 staging: iio: resolver: new driver for AD2S1210 devices
Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09 15:46:45 -08:00
Graf Yang ffd7a62f0d staging: iio: resolver: new driver for AD2S1200/1205 devices
Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09 15:46:45 -08:00
Graf Yang f46d9f154a staging: iio: resolver: new driver for AD2S90 devices
This also kicks off the new resolver subsection.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09 15:46:44 -08:00