Commit graph

1177 commits

Author SHA1 Message Date
Jonathan Cameron
314be14bb8 iio: Rename _st_ functions to loose the bit that meant the staging version.
These were originally introduced when the plan was to have parallel
IIO cores in and out of staging with a slow move between them.
Now we have reached the point where the whole core has moved,
they need clearing up!

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-30 10:15:12 +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
05eda67d2c staging:iio:ad7793: Fix scan index for the "shorted" channel
The code expects the scan index to match the offset of the channel into the
channel array. For the "shorted" the offset is 3, but the scan index is set to
2. Also the scan index 2 is already taken by the previous channel. As a result
the "shorted" channel will appear to be selected if the previous channel is
selected and vice versa and it is not possible to sample the "shorted" channel
in buffered mode.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-30 10:12:30 +01:00
Peter Meerwald
ce7b04c629 iio staging: fix resource leak in _write_sysfs_int()
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-30 10:12:28 +01:00
Peter Meerwald
a4d429e362 iio staging: fix potential memory/resource leaks in find_type_by_name()
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-30 10:12:24 +01:00
Peter Meerwald
578f737dd3 iio staging: fix potential resource leak in generic_buffer
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-30 10:12:21 +01:00
Peter Meerwald
bb23378c0b staging: iio: quell asprintf() warning, missing #includes
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-26 14:57:30 -07:00
Peter Meerwald
1bcdfbcf75 staging: iio: use PRId64 format specifier for int64_t
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-26 14:57:30 -07:00
Peter Meerwald
42196d3963 staging: iio: fix warning 'static but used in inline function'
iio_utils.h:367:10: warning: ‘iioutils_break_up_name’ is static but used in inline function ‘build_channel_array’ which is not static [enabled by default]

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-26 14:57:29 -07:00
Peter Meerwald
d8da0eeed7 staging: iio: generic_buffer cleanup
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-26 14:57:29 -07:00
Peter Meerwald
b42f2a0c65 staging: iio: move comment
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-26 14:57:29 -07:00
Peter Meerwald
109379210e staging: iio: remove unused variable
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-26 14:57:29 -07:00
Peter Meerwald
1d633fd153 staging: iio: fix generic_buffer print2byte()
drop extra argument, move cast

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-26 14:57:28 -07:00
Peter Meerwald
8b32b11c2e staging: iio: fix typo, improve timestamp alignment comment
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-22 21:24:27 -07:00
Peter Meerwald
970689f10e staging: iio: simplify timestamp alignment in iio_simple_dummy
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-22 21:24:27 -07:00
Peter Meerwald
708706ff29 staging: iio: fix trigger handler of iio_simple_dummy driver
accessing first and last channel fails:
fakedata[0] is never accessed, out-of-bound access for last channel

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-22 21:24:27 -07:00
Lars-Peter Clausen
4bf8172772 staging:iio:trigger: Use to_iio_trigger() instead of dev_get_drvdata()
Use to_iio_trigger(dev) instead of dev_get_drvdata(dev). Both will return the
trigger which belongs to the device, but the the first on is a bit more
lightweight. Also this will eventually free up the drvdata pointer of the device
for driver specific data.

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-22 21:08:10 -07:00
Peter Meerwald
d163a19d91 iio staging: another typo in iio_simple_dummy_buffer
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:31:42 -07:00
Peter Meerwald
2a1d45ecc8 iio staging: fix spelling of suppression in isl29018
beware, does change the ABI as proximity_on_chip_ambient_infrared_supression
is changed to proximity_on_chip_ambient_infrared_suppression

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:29:29 -07:00
Peter Meerwald
7695afdeb4 iio staging: fix tsl2x7x file mode
just drop execute permission

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:29:29 -07:00
Peter Meerwald
0941b9307e iio staging: fix typos in tsl*: register
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:29:28 -07:00
Lars-Peter Clausen
ae3805c3ae staging:iio:adc:ad799x: Use new triggered buffer setup helper function
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

Also as part of the conversion drop scan_timestamp being enabled by default,
since it is a left over of an earlier cleanup.

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-18 17:26:10 -07:00
Lars-Peter Clausen
cc4dd03a6a staging:iio:adc:ad7887: Use new triggered buffer setup helper function
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

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-18 17:26:10 -07:00
Lars-Peter Clausen
82796edca9 staging:iio:adc:ad7793: Use new triggered buffer setup helper function
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

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-18 17:26:10 -07:00
Lars-Peter Clausen
74ed964931 staging:iio:adc:ad7606: Use new triggered buffer setup helper function
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

Also as part of the conversion drop scan_timestamp being enabled by default,
since it is a left over of an earlier cleanup.

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-18 17:26:10 -07:00
Lars-Peter Clausen
397b85dd86 staging:iio:adc:ad7476: Use new triggered buffer setup helper function
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

Also as part of the conversion drop scan_timestamp being enabled by default,
since it is a left over of an earlier cleanup.

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-18 17:26:10 -07:00
Lars-Peter Clausen
d045b9d21b staging:iio:adc:ad7298: Use new triggered buffer setup helper function
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

The previous code was not passing the temperature channel to iio_buffer_register
since the temperature channel can not be used in buffered mode. With the new
helper functions it is not possible to do this, instead the scan index for the
temperature channel is set to -1 which will cause iio_buffer_register to ignore
the channel. (Also While we are at it also assign the symbolic constant instead
of the raw value to the channel address for the temperature channel).

Also as part of the conversion drop scan_timestamp being enabled by default,
since it is a left over of an earlier cleanup.

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-18 17:26:09 -07:00
Lars-Peter Clausen
a648232dc5 staging:iio:adc:ad7192: Use new triggered buffer setup helper function
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

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-18 17:26:09 -07:00
Peter Meerwald
60ba16e35b staging: iio:: fix some typos
typos in comments, fix ring_sw module description

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-15 14:39:18 -07:00
Peter Meerwald
a21601463d staging: iio: add IIO_ALTVOLTAGE to iio_event_monitor example
IIO_ALTVOLTAGE is used by frequency/adf4350 and frequency/ad9523

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-15 14:39:18 -07: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
Peter Meerwald
25c38aa3d1 staging: iio: fix typos in simple dummy driver
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
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
07a8329c48 staging:iio:adis16400: Fix ADIS163xx AUX_ADC address
The ADIS163xx variants use a different register address for the auxiliary ADC
channel than the ADIS16400. This patch fixes them to use the correct address.

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:25 -07:00
Lars-Peter Clausen
bb7cf8bc52 staging:iio:adis16400: Fix ADIS16334 temperature address
The channel spec for ADUS16334's temperature channel uses the address and scan
index for the Z-axis acceleration channel. This patch fixes it to use the
temperature channel address and scan index instead.

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:25 -07:00
Lars-Peter Clausen
6f30592e8c staging:iio:adis16400: Fix ADIS16300 temperature address
The ADIS16300 uses the same address for the temperature register as the
ADIS16350 and not the same as the ADIS16400.

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:25 -07:00
Lars-Peter Clausen
791de6771e staging:iio:adis16400: Fix ADIS16300 ROLL_OUT register address
In the current driver ROLL_OUT register address is the same as the PITCH_OUT
register address. This patch fixes it to use the correct address.

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:25 -07:00
Leed Aguilar
4d9505af77 staging:iio:gyro:adis16080: remove sparse warnings
Removed the following sparse warning:

In function 'adis16080_read_raw':
warning: 'ut' may be used uninitialized in this function

Signed-off-by: Leed Aguilar <leed.aguilar@ti.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-14 17:30:17 -07:00
Greg Kroah-Hartman
89a86a2da3 Merge branch 'staging-linus' into staging-next
We need this for the pstore fixes that went into the staging-linus branch, so
that things apply properly for the pstore/android code merge.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-13 16:57:09 -07:00
Lars-Peter Clausen
33735a94af staging:iio:ad7298: Fix linker error due to missing IIO kfifo buffer
The ad7298 drivers buffer implementation uses the IIO kfifo buffer, so it needs
to select IIO_KFIFO_BUF. Otherwise (if no other driver selects the symbol) the
following linker error will occur:

drivers/built-in.o: In function `ad7298_register_ring_funcs_and_init':
	(.text+0x245cf2): undefined reference to `iio_kfifo_allocate'
drivers/built-in.o: In function `ad7298_register_ring_funcs_and_init':
	(.text+0x245d7d): undefined reference to `iio_kfifo_free'
drivers/built-in.o: In function `ad7298_ring_cleanup':
	(.text+0x245dcd): undefined reference to `iio_kfifo_free'

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-12 11:12:19 -07:00
Lars-Peter Clausen
279bf2e57c staging:iio:ad7606: Re-add missing scale attribute
Commit 50ac23be ("staging:iio:adc:ad7606 add local define for chan_spec
structures.") accidentally removed the scale info_mask flag. This patch
adds it back again.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: stable <stable@vger.kernel.org>  [3.2+]
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-07 14:34:07 +09:00
Leed Aguilar
4bf8523df9 staging:iio:magnetometer:ak8975: remove 'mode' attribute
The raw data reading process (ak8975_read_axis) sets the
single measurement mode to take a sample and once the
conversion is completed the device enters into power-down
mode automatically, therefore there is no need to enable
a flag for this to happen.

Signed-off-by: Leed Aguilar <leed.aguilar@ti.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-07 14:32:59 +09:00
Leed Aguilar
82f2acdce1 staging:iio:magnetometer:ak8975: use gpio_request_one api
Use gpio_request_one api, it looks cleaner.

Signed-off-by: Leed Aguilar <leed.aguilar@ti.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-07 14:32:59 +09:00
Leed Aguilar
040f3e5833 staging:iio:magnetometer:ak8975: set power-down mode after reading fuse ROM data
Fuse ROM data access mode is the only mode which does not
transition to power-down mode automatically.

As per the AK8975 data sheet, it is recomended to set the
power-down mode first before attempting to change into
another mode.

Signed-off-by: Leed Aguilar <leed.aguilar@ti.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-07 14:32:59 +09:00
Shubhrajyoti D
f61343b397 staging: iio: ak8975: Make it behave better as modules
The memory regions of the probe and remove are move
to __devinit and __devexit respectively.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-05 14:06:18 +09:00
Shubhrajyoti D
1079def493 staging: iio: hmc5843: Make it behave better as modules
The memory regions of the probe and remove are move
to __devinit and __devexit respectively.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-05 14:06:17 +09:00
Lars-Peter Clausen
dbdc025bb2 staging:iio: Move DAC drivers out of staging
The IIO DAC drivers are in a reasonably good shape. They all make use of channel
spec and non of them provides non-documented sysfs attributes. Code style should
be OK as well, both checkpatch and coccicheck only report trivial issues.

So lets move the whole folder out of staging.

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-05 14:02:25 +09:00
Lars-Peter Clausen
20374d1a36 staging:iio:dac:ad5791: Move private structs and defines from header to C file
The header for this driver contains some private structs and defines, which do
not have to be shared between multiple source files, as well as the platform
data struct for this driver, which has to be shared with other source files.
Since there is no need to expose those private structs and defines move them to
the source file.

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-05 13:47:33 +09:00
Lars-Peter Clausen
a98348b74e staging:iio:dac:ad5504: Move private structs and defines from header to C file
The header for this driver contains some private structs and defines, which do
not have to be shared between multiple source files, as well as the platform
data struct for this driver, which has to be shared with other source files.
Since there is no need to expose those private structs and defines move them to
the source file.

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-05 13:47:33 +09:00
Lars-Peter Clausen
4f0a788dc8 staging:iio:dac:ad5504: Check if IRQ was requested before freeing it
IRQ support is optional, so we have to check whether it was actually requested
before we attempt to free it.

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-05 13:47:32 +09:00
Lars-Peter Clausen
4468cb5525 staging:iio:dac:ad5791: Use strtobool for boolean values
Use strtobool for parsing the powerdown value instead of strict_strtol, since
the powerdown attribute is a boolean value.

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-05 13:47:32 +09:00
Lars-Peter Clausen
2490594e89 staging:iio:dac:ad5624r: Use strtobool for boolean values
Use strtobool for parsing the powerdown value instead of strict_strtol, since
the powerdown attribute is a boolean value.

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-05 13:47:32 +09:00
Lars-Peter Clausen
3bbbf150ff staging:iio:dac:ad5504: Use strtobool for boolean values
Use strtobool for parsing the powerdown value instead of strict_strtol, since
the powerdown attribute is a boolean value.

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-05 13:47:32 +09:00
Lars-Peter Clausen
159fe695ae staging:iio:dac: Remove dac.h
Now that all drivers have been converted to channel spec, we can finally remove
the dac.h file since it is no longer used.

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-05 13:47:32 +09:00
Lars-Peter Clausen
4cd8d87446 staging:iio:dac:max517: Convert to channel spec
Convert the max517 driver to channel spec. As part of the conversion the
"out_voltage_1&2_raw" property, which updates both channel 1 and 2
simultaneously with the same value, is lost, since this is not really covered by
the IIO spec and has only a limited use case in practice.

Also the channel index for the sysfs files is now zero based instead of one
based, which means all channel numbers will be lower by one. E.g.
"out_voltage_1_scale" instead of "out_voltage_2_scale"

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Roland Stigge <stigge@antcom.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-05 13:47:31 +09:00
Lars-Peter Clausen
cadb695113 staging:iio:dac: Remove unused dac.h includes
None of these drivers use anything from dac.h, so remove the include.

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-05 13:47:31 +09:00
Lars-Peter Clausen
4571b39b0b staging:iio:dac:ad5791: Convert to extended channel attributes
Use extended channel attributes instead of raw sysfs files for the additional
channel attributes. This allows us to remove some boilerplate code.

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-05 13:47:31 +09:00
Lars-Peter Clausen
fe4586a875 staging:iio:dac:ad5686: Convert to extended channel attributes
Use extended channel attributes instead of raw sysfs files for the additional
channel attributes. This allows us to remove some boilerplate code.

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-05 13:47:31 +09:00
Lars-Peter Clausen
66eb90505e staging:iio:dac:ad5624r: Convert to extended channel attributes
Use extended channel attributes instead of raw sysfs files for the additional
channel attributes. This allows us to remove some boilerplate code.

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-05 13:47:30 +09:00
Lars-Peter Clausen
8d05d7773d staging:iio:dac:ad5504: Convert to extended channel attributes
Use extended channel attributes instead of raw sysfs files for the additional
channel attributes. This allows us to remove some boilerplate code.

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-05 13:47:30 +09:00
Lars-Peter Clausen
868e0862c9 staging:iio:dac:ad5380: Convert to extended channel attributes
Use extended channel attributes instead of raw sysfs files for the additional
channel attributes. This allows us to remove some boilerplate code.

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-05 13:47:30 +09:00
Lars-Peter Clausen
09d48aa9f6 staging:iio:dac:ad5446: Use iio_enum for powerdown modes
This allows us to remove some boilerplate code for comparing and formatting the
enum strings.

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-05 13:47:30 +09:00
Lars-Peter Clausen
26628f6b53 staging:iio:dac:ad5064: Use iio_enum for powerdown modes
This allows us to remove some boilerplate code for comparing and formatting the
enum strings.

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-05 13:47:30 +09:00
Sachin Kamat
44dd5b0253 staging: iio: Remove version.h header file inclusion
version.h header file is no longer required.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-04 21:19:42 -07:00
Johan Hovold
04723de09d staging:iio: remove num_interrupt_lines from documentation
Commit 5aa9618896 ("staging:iio: remove broken support for
multiple event interfaces.") removed the num_interrupt_lines field from
struct iio_info but the documentation was never updated.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-04 21:15:31 -07:00
Peter Meerwald
357fcff5bd staging: iio: add support for hmc5883/hmc5883l to hmc5843 magnetometer driver
v3 addresses review comments:
* rotate tables (Jonathan Cameron)
* remove trailing space, add newline in sysfs output (Jonathan Cameron)
* split out patch for reorganization of hmc5843_set_rate() (Jonathan Cameron)
* use static table to describe chip variants (Jonathan Cameron)

v2 addresses review comments:
* fixes and cleanups have been split out (Jonathan Cameron)
* constants are generally prefixed HMC5843_, except when related
  specifically to hmc5883 (Jonathan Cameron)
* simplify code and avoid temp buffer in
  hmc5843_show_sampling_frequencies_available() (Lars-Peter Clausen)
* use sysfs_streq() instead of strncmp()/strlen() in
  hmc5843_check_sampling_frequency() (Lars-Peter Clausen)

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-17 08:24:56 -07:00
Peter Meerwald
4fd4d7d8de staging: iio: reorganize hmc5843_set_rate()
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-17 08:24:56 -07:00
Peter Meerwald
4906a15c03 staging: iio: rename function/data to consistently start with hmc5843_
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-17 08:24:56 -07:00
Peter Meerwald
c7c34af049 staging: iio: cleanup and move comments in hmc5843
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-17 08:24:55 -07:00
Peter Meerwald
e278df1c82 staging: iio: add check for measurement configuration value passed to hmc5843
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-17 08:24:55 -07:00
Peter Meerwald
13f6eb69b1 staging: iio: rework sampling rate setting in hmc5843
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-17 08:24:55 -07:00
Peter Meerwald
16b91a40ea staging: iio: rename and prefix CONSTANTs to distinguish between HMC5843 and HMC5883
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-16 13:28:09 -07:00
Peter Meerwald
d32ec5518f staging: iio: change strict_strtoul() to kstrtoul() in hmc5843
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-16 13:27:16 -07:00
Peter Meerwald
0462e2bb4e staging: iio: fix access to hmc5843 private data
i2c_get_clientdata(client) points to iio_dev, not hmc5843_data; fixes
issue similar to 62d2feb980

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-16 13:26:35 -07:00
Lars-Peter Clausen
196b59c1a2 staging:iio:meter: 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
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
527cf71fd0 staging:iio:magnetometer: 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
96f691f9bf staging:iio:light: 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:21 -07:00
Lars-Peter Clausen
dedb1e77aa staging:iio:imu: 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:21 -07:00
Lars-Peter Clausen
ba86dc46b8 staging:iio:impedance-analyzer: 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:21 -07:00
Lars-Peter Clausen
f72e0834b4 staging:iio:gyro: 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:21 -07:00
Lars-Peter Clausen
b671bb3bf0 staging:iio:frequency: 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:21 -07:00
Lars-Peter Clausen
ac3f851ef8 staging:iio:dac: 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:21 -07:00
Lars-Peter Clausen
d30a7f9df0 staging:iio:cdc: 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:21 -07:00
Lars-Peter Clausen
703196b6be staging:iio:addac: 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
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
62c5183971 staging:iio:adc: 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
ea19ed3b4f staging:iio:adis16400_ring: Pass IIO device directly
When calling adis16350_spi_read_all and adis16400_spi_read_burst 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:20 -07:00
Lars-Peter Clausen
2a0b871c4f staging:iio:ade7758_spi_read_burst: Pass IIO device directly
When calling ade7758_spi_read_burst 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:20 -07:00
Lars-Peter Clausen
48f29345ce staging:iio:adis16260_read_ring_data: Pass IIO device directly
When calling adis16260_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: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
5d4172cd63 staging:iio:dummy: Remove outdated comment
iio_device_free has to be called regardless of whether the device has been
registered or not when freeing it.

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:26:44 -07:00
Masanari Iida
99de0c2b34 staging: iio: Fix typo in iio
Correct spelling typo in staging/iio

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Acked-by: Michael Hennerich<michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-08 16:04:12 -07:00
Peter Meerwald
e8ccc11fbd staging: iio: call iio_device_unregister() in max517_remove()
Reported-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-02 15:53:43 -07:00
Greg Kroah-Hartman
d210267741 Merge 3.4-rc5 into staging-next
This resolves the conflict in:
	drivers/staging/vt6656/ioctl.c

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-02 11:48:07 -07:00