Commit Graph

223 Commits (a10d206ef1a83121ab7430cb196e0376a7145b22)

Author SHA1 Message Date
Peter Meerwald dcbc3c414e iio staging: fix cast warning and cleanup alignment code
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-15 17:33:18 +01:00
Lars-Peter Clausen 67bd5e26d4 staging:iio:accel:adis16xxx: Do not return error code in the interrupt handler
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-08 20:02:30 +01:00
Lars-Peter Clausen 0b30246ef1 staging:iio:lis3l02dq: Do not return error code in interrupt handler
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-08 20:02:29 +01:00
Lars-Peter Clausen a91aff1c09 staging:iio: Request threaded-only IRQs with IRQF_ONESHOT
Since commit 1c6c69525b ("genirq: Reject bogus threaded irq requests") threaded
IRQs without a primary handler need to be requested with IRQF_ONESHOT, otherwise
the request will fail. This patch adds the IRQF_ONESHOT to IIO drivers where it
is missing.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-08 20:02:24 +01:00
Jonathan Cameron f699d10202 staging:iio:accel:adis16204 support the rss channel via chan spec.
Reduces code and makes this channel available within the kernel.
Note that it is not added to the buffer, thus maintaining the
previous functionality of this driver.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
2012-06-30 10:15:25 +01:00
Jonathan Cameron 13d947db1c staging:iio:accel drop sysfs interface for resetting devices.
There is no reason why userspace should want to do this manually.
Hence, lets drop this abi.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
2012-06-30 10:15:14 +01:00
Jonathan Cameron c1f1a9d48f Merge branch 'fixes-togreg' into togreg 2012-06-30 10:14:29 +01:00
Jonathan Cameron 06d5199d4c staging:iio: Add some missing peak elements to the info_mask
These are supported by raw_read but not actually there.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
2012-06-30 10:12:36 +01:00
Jonathan Cameron 467d0becaf staging:iio:accel:adis16204 fix bug in channel modifier handling
Will result in the correct scale value for the x axis.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
2012-06-30 10:12:33 +01:00
Lars-Peter Clausen eaedfa54db staging: iio: Remove superfluous flush_scheduled_work
None of these drivers ever schedule any work, so there is no need to flush any
scheduled work when the driver is removed.

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-06-15 14:36:26 -07:00
Lars-Peter Clausen 4b522ce709 staging:iio:accel: 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:20 -07:00
Lars-Peter Clausen 8dc5afd8cb staging:iio:__lis3l02dq_write_data_ready_config: Pass IIO device directly
When calling __lis3l02dq_write_data_ready_config we pass the device struct of
embedded in the IIO device only to look up the IIO device from the device struct
again right away. This patch changes the code to pass the IIO device directly.

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:19 -07:00
Lars-Peter Clausen 4a5b761080 staging:iio:adis16240_read_ring_data: Pass IIO device directly
When calling adis16240_read_ring_data we pass the device struct of embedded in
the IIO device only to look up the IIO device from the device struct again right
away. This patch changes the code to pass the IIO device directly.

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:19 -07:00
Lars-Peter Clausen 0fbf0a15f9 staging:iio:adis16209_read_ring_data: Pass IIO device directly
When calling adis16209_read_ring_data we pass the device struct of embedded in
the IIO device only to look up the IIO device from the device struct again right
away. This patch changes the code to pass the IIO device directly.

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:19 -07:00
Lars-Peter Clausen ce7ea56c27 staging:iio:adis16204_read_ring_data: Pass IIO device directly
When calling adis16204_read_ring_data we pass the device struct of embedded in
the IIO device only to look up the IIO device from the device struct again right
away. This patch changes the code to pass the IIO device directly.

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:19 -07:00
Lars-Peter Clausen 8fa2c31507 staging:iio:adis16203_read_ring_data: Pass IIO device directly
When calling adis16203_read_ring_data we pass the device struct of embedded in
the IIO device only to look up the IIO device from the device struct again right
away. This patch changes the code to pass the IIO device directly.

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:19 -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 fd6487f843 staging:iio: Add caching of scan_timestamp to the core as well as buffers.
This will be needed when multiple buffer support is added.

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-24 11:23:38 -07:00
Jonathan Cameron 420fe2e947 staging:iio: add caching of the number of bytes in a scan.
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-24 11:23:37 -07:00
Jonathan Cameron 31313fc64d staging:iio:accel Add IIO_CHAN_INFO_RAW entries to all drivers.
Precursor to making value read / write attribute optional.
No processed values in accelerometers.

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:19 -07:00
Jonathan Cameron 691a4ca1b5 staging:iio:accel:sca3000 unwind use of IIO_CHAN macro.
This macro is being removed to simplify ongoing maintenance
so we need to unwind and remaining users.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-13 11:08:03 -07:00
Jonathan Cameron 3badbdac6c staging:iio:accel:lis3l02dq unwind use of IIO_CHAN macro.
This macro is being removed to simplify ongoing maintenance
so we need to unwind and remaining users.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-13 11:08:03 -07:00
Jonathan Cameron e13f3d5ac0 staging:iio:accel:adis16240 unwind use of IIO_CHAN macro.
This macro is being removed to simplify ongoing maintenance
so we need to unwind and remaining users.

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-13 11:08:03 -07:00
Jonathan Cameron f2007e5893 staging:iio:accel:adis16209 unwind use of IIO_CHAN macro.
This macro is being removed to simplify ongoing maintenance
so we need to unwind and remaining users.

Note the addition of extend_name = "supply" for the supply voltage
adc.  This brings this driver into line with the other adis parts.

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-13 11:08:02 -07:00
Jonathan Cameron 4b788176d8 staging:iio:accel:adis16204 unwind use of IIO_CHAN macro.
This macro is being removed to simplify ongoing maintenance
so we need to unwind and remaining users.

Note that previously the supply was not indexed. I have made
it indexed for consistency with other similar devices and
for internal consistency with the aux adc port.

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-13 11:08:02 -07:00
Jonathan Cameron 554ae98185 staging:iio:accel:adis16203 unwind use of IIO_CHAN macro.
This macro is being removed to simplify ongoing maintenance
so we need to unwind and remaining users.

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-13 11:08:02 -07:00
Jonathan Cameron e81dafe942 staging:iio:accel:adis16201 unwind use of IIO_CHAN macro.
This macro is being removed to simplify ongoing maintenance
so we need to unwind and remaining users.

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-13 11:08:02 -07:00
Jonathan Cameron 8b1f52278f staging:iio:accel:lis3l02dq add symmetry to check for presence of trigger.
Checking indio_dev->modes is uggly and not symmetric with the conditions
on whether triggers are allowed in the first place.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 13:26:33 -07:00
Justin P. Mattock 4abf6f8b29 drivers:staging:iio Fix typos and comments in staging iio.
The below patch fixes some comments and some typos that I have found
while reading drivers/staging/iio/*

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-02 16:33:52 -08:00
Lars-Peter Clausen 7e632344ad staging:iio: Setup buffer access functions when allocating the buffer
Setup the buffer access functions in the buffer allocate function. There is no
need to let each driver handle this on its own.

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-02-09 10:03:51 -08: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
Jonathan Cameron f79a909890 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>
2011-12-08 12:13:58 -08:00
Jonathan Cameron 443a9ea566 staging:iio:accel:lis3l02dq scrap reading from buffer for sysfs access.
No obvious usecase 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>
2011-12-08 12:11:09 -08:00
Jonathan Cameron 66748b5ada 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>
2011-12-08 12:11:09 -08:00
Jonathan Cameron 550268ca11 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>
2011-12-08 12:11:08 -08:00
Jonathan Cameron 1612244f8a 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>
2011-12-08 12:11:08 -08:00
Jonathan Cameron c15c4f1dea 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>
2011-12-08 12:05:04 -08:00
Andreas Ruprecht d666c0d490 Staging: iio/accel: Added a range check for val in store_measurement_mode()
In sca3000_store_measurement_mode() we use val to and it with a mask.
This mask is only two bits long (as we are only interested in the
lowest two bits), so a value bigger than 3 was silently ignored so
far.

Now this function will return -EINVAL, if val is bigger than 3.

Signed-off-by: Andreas Ruprecht <rupran@einserver.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08 11:30:24 -08:00
Andreas Ruprecht bba42776f5 Staging: iio/accel: Changed data type of mask in store_measurement_mode() to u8
In sca3000_store_measurement_mode() we parse a value from a string
buffer via kstrtou8, and store the parsed value into a u8 after
and-ing it with mask.

As we are only interested in the lowest two bits here and mask is
initialized with a fixed value 0x03, mask may as well be a u8.

Signed-off-by: Andreas Ruprecht <rupran@einserver.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08 11:30:23 -08:00
Andreas Ruprecht 28998e005b Staging: iio/accel: Changed return type of lis3l02dq_read_event_config() to int
The lis3l02dq_read_event_config() function returned an ssize_t up to
now, which lead to a compiler warning in line 660 (initialization from
incompatible pointer type). The iio_info struct is defined to accept an
int-returning function as the read_event_config parameter.

Also it seems odd to have the check for (ret < 0) and return ret in
this case, when the return type is signed.

Signed-off-by: Andreas Ruprecht <rupran@einserver.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 19:37:33 +09:00
Thomas Meyer d83fb18494 staging: iio: Use kcalloc instead of kzalloc to allocate array
The advantage of kcalloc is, that will prevent integer overflows which could
result from the multiplication of number of elements and size and it is also
a bit nicer to read.

The semantic patch that makes this change is available
in https://lkml.org/lkml/2011/11/25/107

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 19:37:33 +09:00
Andreas Ruprecht 3b724ca145 Staging: iio/accel: Changed data type of val in store_measurement_mode to u8
The code in sca3000_store_measurement_mode() uses the variable val to
do bitwise operations with an int mask and or-s it into st->rx[0] which
is an entry in a u8 array (see sca3000.h).

This means up to now values larger than a u8 were silently ignored and
just the lower 8 bits counted into the value that was written into
st->rx[0]. This code will return -ERANGE if the value in buf was too
large to fit into a u8.

Signed-off-by: Andreas Ruprecht <rupran@einserver.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:12:06 +09:00
Andreas Ruprecht 359f9caa4d Staging: iio/accel: Changed data type for val to unsigned long in write_frequency
In lis3102dq_write_frequency() we used a long variable to store the
value parsed from the char* buffer buf, as there only was a
strict_strtol() function to parse values.
Now we have got kstrto* which allows us to convert to the right data
type in most cases.

In this particular function we want to write a frequency value, and it
doesn't make sense to allow negative values here (as Dan Carpenter
pointed out in a previous email).
This means we can now parse the value into an unsigned long and get an
error for invalid (e.g. negative) values.

Signed-off-by: Andreas Ruprecht <rupran@einserver.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:12:06 +09:00
Andreas Ruprecht bae5b53753 Staging: iio/accel: Changed data type in adis16220_write_16bit to u16
In the adis16220_write_16bit() function we used a long value to store
parsed data from the char* buffer buf.
The called function to actually write the data,
adis16220_spi_write_reg_16(), takes a u16 value as a parameter, so up
to now a value larger than u16 was silently ignored as it was only
truncated when passing the parameter.
Now this function will only accept values fitting into a u16.

Additionally the parsing function was changed to overcome the now
obsolete strict_strtol() function.

Signed-off-by: Andreas Ruprecht <rupran@einserver.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:12:06 +09: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
Jonathan Cameron c8a9f8056f 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>
2011-11-26 16:35:04 -08:00
Lars-Peter Clausen 924f8a21dd 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>
2011-11-26 16:35:04 -08:00
Jonathan Cameron af5046af1c 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>
2011-11-26 16:35: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