Commit graph

1177 commits

Author SHA1 Message Date
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
Michael Hennerich
f316983fe0 staging: iio: adc: convert ADI drivers to use kfifo.
sw_ring is depreciated and therefore won't move out of staging.
Prerequisite for lifting affected drivers is to convert them to kfifo.
Update copyright.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-30 10:28:10 -04:00
Michael Hennerich
fc6d11398e iio: core: iio_chan_spec_ext_info: Add private handle
There is currently no user, but we might need it in future.
So better add it now, before we have to convert drivers afterwards.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-29 21:26:17 -04:00
Michael Hennerich
73e016ef94 iio: frequency: Update DDS drivers to use new channel naming convention
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-29 21:26:17 -04:00
Michael Hennerich
e4e8d1ce81 iio: Rename iio/dds to iio/frequency
Generalize naming to allow other frequency synthesis techniques as well.
No functional changes.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-29 21:25:04 -04: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
Roland Stigge
5d4a6789d5 staging: iio: lpc32xx-adc: Remove driver conflict due to device tree
Previously, the touchscreen and ADC drivers of the LPC32xx SoC had a Kconfig
conflict declared because they use the same hardware. Upon the introduction of
device tree support in both drivers, the conflict must be removed to enable
the same kernel to support different hardware (configured via the device tree).

Signed-off-by: Roland Stigge <stigge@antcom.de>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-29 18:14:40 -07:00
Jonathan Cameron
8af2c75a32 IIO: Move the core abi documentation from staging
This file contains only the most generic elements. Other
class specific and device specific ABI documents will follow
over time.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-25 11:12:23 -07:00
Jonathan Cameron
a980e04609 IIO: Move the core files to drivers/iio
Take the core support + the kfifo buffer implentation out of
staging.  Whilst we are far from done in improving this subsystem
it is now at a stage where the userspae interfaces (provided by
the core) can be considered stable.

Drivers will follow over a longer time scale.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-25 11:11:38 -07: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
68284a1292 staging:iio:Documentation Trivial typo fixes.
Just a couple of things I came across whilst reviewing this file for
moving out of staging. I doubt anyone cares, but seemed sensible to fix
them now!

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-25 11:00:43 -07:00
Jonathan Cameron
49c36dffbd staging:iio:documentation pull a few sysfs entries out of main docs.
These two attributes are only used in the one driver.  Whilst they
are fairly general I'm not entirely happy committing to them at
this stage.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-25 11:00:12 -07:00
Lars-Peter Clausen
ae467dd55d staging:iio:dac:ad5446: Update Kconfig entry
There is one device supported by the driver which is not listed in the Kconfig
help test. This patch adds it. Also we are past the point were we can possible
fit all devices supported by the driver in the Kconfig entry title, so just list
the initial device that was supported by this driver and note that similar
devices are supported as well.

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-25 10:57:21 -07:00
Lars-Peter Clausen
18e5ab31ee staging:iio:dac:ad5446: Add support for the AD5662
The AD5662 is compatible to the AD5660, but uses an external
reference instead of an internal.

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-25 10:57:21 -07:00
Lars-Peter Clausen
5e06bdfb46 staging:iio:dac:ad5446: Return cached value for 'raw' attribute
We can not read back the value from the device, but we cache the value anyway so
we might as well return the cached value instead of an error.

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-25 10:57:20 -07:00
Lars-Peter Clausen
cae329e04a staging:iio:dac:ad5446: Consolidate store_sample and store_pwr_down functions
The devices supported by this drivers only have a single shift register, which
contains both the power down mode and the output sample. So writing the power
down mode and the output sample can be done by the same function. Call this
function prepare_write as it will prepare the spi message for a write. Also
introduce a small helper function which performs the whole write by calling the
chip the specific prepare function followed by a spi_sync.

The two power down bits are always placed ontop of the msb of the output sample,
so we can easily calculate their position by adding the channels shift to the
channels realbits.

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-25 10:57:20 -07:00
Lars-Peter Clausen
83f0f5723e staging:iio:dac:ad5446: Convert to extended channel attributes
Use extended channel attributes instead of raw sysfs files for the additional
channel attributes.

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-25 10:57:20 -07:00
Lars-Peter Clausen
11a7df4890 staging:iio:dac:ad5446: Remove duplicated chip_info entries
There are three identical chip_info entries. Remove two of them and use the id
of the remaining entry for all three device table entries.

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-25 10:57:20 -07:00
Lars-Peter Clausen
4e5d3f92cf staging:iio:dac:ad5446: Do not check for individual chip ids in probe
Use the chip_info's int_vref_mv field to decide whether a certain chip has a
internal reference or not. There is no need to check for individual chip ids.

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-25 10:57:20 -07:00
Lars-Peter Clausen
39c58b6079 staging:iio:dac:ad5446: Remove unused struct field
Remove the unused "poll_work" field from the ad5446_state struct.

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-25 10:57:20 -07:00
Lars-Peter Clausen
af836d9a38 staging:iio:dac:ad5446: Fix 24bit transfers
We currently only write 16 bit in case where we should write 24 bit. The spi message
length is calculated from the channel storage_size, but since the storage size
is only 16 bit we end up with the wrong value for devices which have power down
bits and thus a register with 24 bit. Since each store function knows how many
bytes it has to write just use the spi_write function from there instead of
going through the hassle of manually preparing a spi_message and keeping buffers
in the state struct.

Another advantage of this patch is that it will make implementing support for
similar I2C based DACs much easier.

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-25 10:57:19 -07:00
Lars-Peter Clausen
5ff6a99d7c staging:iio:dac:ad5446: Remove duplicated write sample functions
AD5620_LOAD and AD5446_LOAD are both 0, so all these three functions are
identical and we can replace them with only one.

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-25 10:57:19 -07:00
Lars-Peter Clausen
07ffd0d071 staging:iio:dac:ad5446: Do not exit powerdown when writing a sample
Both the powerdown mode bits and the sample value are stored in the same
register, so writing a sample while the device is powered down will clear the
power down bits. To avoid this only update the cached value when the device is
powered down.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>

----
v1 actually had a small bug in that it would still write to the device's
register when the sample was updated while the device was powered down. This was
not critical since it would send out the powerdown mode again.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-25 10:57:19 -07:00
Jon Brenner
0f3bcfe67f staging: iio: tsl2x7x: bugfixes
TAOS (version 9a) tsl2x7x driver change / bug fix.

Fixed - removed decimal multiplications.
        Added missing 'static' declarations
        Fixed _read_raw case logic to allow reading of _PROCESSED IIO_LIGHT
	Replaced udelay with mdelay to accomodate eabi.

Signed-off-by: Jon Brenner <jbrenner@taosinc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-24 16:13:10 -07:00
Jon Brenner
3c97c08b57 staging: iio: add TAOS tsl2x7x driver
TAOS device driver (version 9) for the tsl/tmd 2771 and 2772 device families (inc. all variants).

Update:
Removed bonus lines.

Signed-off-by: Jon Brenner <jbrenner@taosinc.com>
Acked-by: Jonathan Cameron<jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-24 11:47:09 -07:00
Jonathan Cameron
842cd10044 staging:iio: pull out demux cleanup for a particular buffer.
This will come in handy again when we move to multiple buffers
so lets pull it out into a little utility function now.

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
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
f5ee7b807f staging:iio:impedance-analyser make use of iio_sw_buffer_preenable
This avoids some code duplication by using the generic form
in a non performance critical place.

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
c562ccbf58 staging:iio:meter:ad7758 use iio_sw_buffer_preenable to avoid code repition
Using this generic function adds a little overhead to a slow path but
reduces the amount of code repitition in exchange.

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
c163318782 staging:iio:adc:ad799x use iio_sw_buffer_preenable to avoid code repitiion
Using this generic function cuts down on repeated code at the cost of
a little overhead in a slow path.

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
a64c0634e5 staging:iio:adc:ad7887 make use of iio_sw_buffer_preenable.
Using this generic function cuts down on repeated code at the cost
of some computation in a slow path.

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
81a4fc0121 staging:iio:adc:ad7793 use iio_sw_buffer_preenable to avoid repitition.
Now the generic function caches the scan size a lot of what was here
was redundant and is removed.

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
46df6378c8 staging:iio:adc:ad7476 use iio_sw_buffer_preenable instead of local version.
Now the generic version caches the scan size the version in this driver
is redundant.

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
8f03aabc0f staging:iio:adc:ad7298 use iio_sw_buffer_preenable to avoid code repitition.
Here some addition elements are needed, but this generic function cuts
down on the amount of code.

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
2150489ffb staging:iio:adc:ad7192 make use of iio_sw_buffer_preenable.
This is not a fast path, so although the original code was more consise
use the generic case to cut down on code repitition.

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
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
f1264809eb staging:iio: scan_index_timestamp move to iio_dev from buffer
This is just a locally cached value that is device specific (rather
than buffer specific.) Hence it wants to come out of the buffer before
we add multiple buffer support.

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
6b3b58ed15 staging:iio:buffer: pull computation of scan length into a utility function.
Principal reason is to make later patches more coherent and easier to review
but this set in itself separates a logical entity out nicely wihin the code.

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:36 -07:00
Jonathan Cameron
a714af276f staging:iio:buffer trivial use of strtobool to remove dodgy equivalent.
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:36 -07:00
Roland Stigge
1f9e349460 iio: Add device tree support to LPC32xx ADC
This patch adds device tree support to the LPC32xx's ADC.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-24 11:04:07 -07:00
Laxman Dewangan
057340e3de staging: iio: light: isl29018: use regmap for register access
Using regmap for accessing register through i2c bus. This will
remove the code for caching registers, read-modify-write logics.
Also it will provide the debugfs feature to dump register
through regmap debugfs.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Grant Grundler <grundler@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-24 11:02:14 -07:00
Laxman Dewangan
610202ddc6 staging: iio: light: of: Fix vendor prefix of isl29018/isl29028
ISL29018/ISL29028 is from Intersil Corporation and making the
vendor prefix for this part as "isil" for OF compatibity.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-24 11:02:14 -07:00
Laxman Dewangan
b9a62c650b staging: iio: light: convert multiple spaces to tab
Using tab inplace of multiple spaces for indenting.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-20 08:31:19 -07:00
Jonathan Cameron
251640a74b staging:iio: drop procesed_val element of chan_spec.
There is no longer any need for this as we have separate
info_mask elements for raw and processed value reads.

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:21 -07:00
Jonathan Cameron
75a973c754 staging:iio: Make read / write attributes for channel values optional.
Until now all channels have had read/write attributes. This patch
allows for channels where we can't actually read the value (or for
output devices, write it!)

v2 introduces separate elements for processed and raw thus removing
some special case code from the core.  Thanks to Lars-Peter for an
excellent suggestion!

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:21 -07:00
Jonathan Cameron
a8c0ed7565 staging:iio:isl29028 Add IIO_CHAN_INFO_RAW/PROCESSED entries
Precursor to making value read / write attribute optional.
This one stands along as it merged just before the series
doing all the other drivers.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-18 16:38:21 -07:00
Lars-Peter Clausen
a74437e46b staging:iio:meter 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: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-18 16:38:21 -07:00
Lars-Peter Clausen
41fd935b18 staging:iio: Add IIO_CHAN_INFO_RAW entries to the dummy driver
Precursor to making value read / write attribute optional.
No processed values in resolvers at the moment.

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-18 16:38:21 -07:00
Jonathan Cameron
e33e075082 staging:iio:cdc Add IIO_CHAN_INFO_RAW/PROCESSED entries to all drivers.
Precursor to making value read / write attribute optional.

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
Jonathan Cameron
967d3fe0dc staging:iio:impedance Add IIO_CHAN_INFO_RAW/PROCESSED entries to all drivers.
Precursor to making value read / write attribute optional.

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
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
Jonathan Cameron
4d9948b363 staging:iio:magnetometer Add IIO_CHAN_INFO_RAW entries to all drivers.
Precursor to making value read / write attribute optional.
No processed values for magnetometers.

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
Jonathan Cameron
90354d0038 staging:iio:light Add IIO_CHAN_INFO_RAW/PROCESSED entries to all drivers.
Precursor to making value read / write attribute optional.
Note that minimal change route taken here. The read_raw callbacks
in both drivers could do fewer checks to identify the channel than
they now do.

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
Jonathan Cameron
a5d016d466 staging:iio:imu Add IIO_CHAN_INFO_RAW entries to all drivers.
Precursor to making value read / write attribute optional.
No processed values in IMU.

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
Jonathan Cameron
fbaff213a3 staging:iio:gyro Add IIO_CHAN_INFO_RAW entries to all drivers.
Precursor to making value read / write attribute optional.
No processed values in gyroscopes.

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
09f4eb4046 staging:iio:dac Add IIO_CHAN_INFO_RAW entries to all drivers.
Precursor to making value read / write attribute optional.
No processed versions in DACs.

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
b11f98ff8c staging:iio:adc Add IIO_CHAN_INFO_RAW entries to all drivers.
Precursor to making value read / write attribute optional.
No processed values for adc's.

Updated to include the spear adc driver (hence introducing a
dependency on the patch that adds that driver).

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
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
5ccb3adbd7 staging:iio: add a raw and processed elements to info_mask
This will allow us to have drivers where the channel value
may not be read or written but other information is available.
Also adds the ability to have both processed and raw access
to a given channel, though in most cases this doesn't make
sense.

Ultimately will lead to simpler code by allowing us to drop
the special case handling for the value reading cases.

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
Laxman Dewangan
892cb6dc9f staging: iio: light: isl29028: fix correct mask value
The mask value in the read_raw/write_raw is absolute
value, not the bit position value.
Fixing this in the implemented function to check value,
not with the bit position value.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-18 16:37:05 -07:00
Stefan Roese
b3201b563d staging:iio:adc: Add SPEAr ADC driver
This patch implements the basic single data conversion support for
the SPEAr600 SoC ADC. The register layout of SPEAr600 differs a bit
from other SPEAr SoC variants (e.g. SPEAr3xx). These differences are
handled via DT compatible testing. Resulting in a multi-arch binary.

This driver is currently tested only on SPEAr600. Future patches may add
support for other SoC variants (SPEAr3xx) and features like software
buffer or DMA.

Signed-off-by: Stefan Roese <sr@denx.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Viresh Kumar <viresh.kumar@st.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-13 11:18:23 -07:00
Laxman Dewangan
6d59ba2f96 staging: iio: add driver for isl29028
Intersil's ISL29028 is concurrent Ambient Light and
Proximity Sensor device.
Add driver to access the light and IR intensity and
proximity value via iio interface.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-13 11:14:35 -07:00
Laxman Dewangan
ce85a1cbcc staging: iio: add channel info for sampling frequency
Adding channel info IIO_CHAN_INFO_SAMP_FREQ to select
different sampling frequency per channel wise.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-13 11:14:35 -07:00
Jonathan Cameron
5b6bd35cc9 staging:iio:core drop the IIO_CHAN macro for ease of maintenance.
I was warned long ago that this macro would cause trouble but didn't
heed the advice, hence I'm unwinding it now!

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-13 11:08:04 -07:00
Jonathan Cameron
926c045222 staging:iio:meter:ade7758 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:04 -07:00
Jonathan Cameron
cdacc05bfa staging:iio:impedance-analyzer:ad5933 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:04 -07:00
Jonathan Cameron
bbdb955527 staging:iio:gyro:adis16260 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:04 -07:00
Jonathan Cameron
7643f09e9f staging:iio:accel:ad7780 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:04 -07:00
Jonathan Cameron
85871cd8b1 staging:iio:adc:ad7476 unwind use of IIO_CHAN macro.
This macro is being removed to simplify ongoing maintenance
so we need to unwind and remaining users.

V2 has the cleanup Lars-Peter suggested.

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
95e48f7740 staging:iio:adc:ad7298 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
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
344692b1ed staging:iio: chan_spec - take extend_name constant.
I can't envision a case where this is not constant and we
don't seem to have any in tree, so lets clear up this loose
end.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-13 10:59:38 -07:00
Jonathan Cameron
ef97d42173 staging:iio:iio_core.h make less dependent on other included headers
There are a lot of pointers to structures used in here that are not
declared unless a particular header is included first.  Deal with
the IIO specific ones by putting in forward declarations and the
other ones by including kernel.h and device.h.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-13 10:59:38 -07:00
Jonathan Cameron
a7322fc2fa staging:iio:Documentation: Fix a cut and paste error.
falling is repeated in some entries instead of 1x falling and 1x rising
for the entry.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-13 10:59:38 -07:00
Jonathan Cameron
fe3f8f87ed staging:iio:light:tsl2563 channel spec buglet / always reading same adc.
The IIO_LIGHT channel was not marked as being a processed_val despite
clearly being in lux.

The IIO_INTENSITY channel reads were dependent on channel and that isn't
specified for either adc (as they now use modifiers).  Hence use the
modifier instead.

Reported-by: Jon Brenner <jbrenner@taosinc.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-13 10:59:38 -07:00
Marek Belisko
62d2feb980 staging: iio: hmc5843: Fix crash in probe function.
Fix crash after issuing:
	echo hmc5843 0x1e > /sys/class/i2c-dev/i2c-2/device/new_device

	[   37.180999] device: '2-001e': device_add
	[   37.188293] bus: 'i2c': add device 2-001e
	[   37.194549] PM: Adding info for i2c:2-001e
	[   37.200958] bus: 'i2c': driver_probe_device: matched device 2-001e with driver hmc5843
	[   37.210815] bus: 'i2c': really_probe: probing driver hmc5843 with device 2-001e
	[   37.224884] HMC5843 initialized
	[   37.228759] ------------[ cut here ]------------
	[   37.233612] kernel BUG at mm/slab.c:505!
	[   37.237701] Internal error: Oops - BUG: 0 [#1] PREEMPT
	[   37.243103] Modules linked in:
	[   37.246337] CPU: 0    Not tainted  (3.3.1-gta04+ #28)
	[   37.251647] PC is at kfree+0x84/0x144
	[   37.255493] LR is at kfree+0x20/0x144
	[   37.259338] pc : [<c00b408c>]    lr : [<c00b4028>]    psr: 40000093
	[   37.259368] sp : de249cd8  ip : 0000000c  fp : 00000090
	[   37.271362] r10: 0000000a  r9 : de229eac  r8 : c0236274
	[   37.276855] r7 : c09d6490  r6 : a0000013  r5 : de229c00  r4 : de229c10
	[   37.283691] r3 : c0f00218  r2 : 00000400  r1 : c0eea000  r0 : c00b4028
	[   37.290527] Flags: nZcv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
	[   37.298095] Control: 10c5387d  Table: 9e1d0019  DAC: 00000015
	[   37.304107] Process sh (pid: 91, stack limit = 0xde2482f0)
	[   37.309844] Stack: (0xde249cd8 to 0xde24a000)
	[   37.314422] 9cc0:                                                       de229c10 de229c00
	[   37.322998] 9ce0: de229c10 ffffffea 00000005 c0236274 de140a80 c00b4798 dec00080 de140a80
	[   37.331573] 9d00: c032f37c dec00080 000080d0 00000001 de229c00 de229c10 c048d578 00000005
	[   37.340148] 9d20: de229eac 0000000a 00000090 c032fa40 00000001 00000000 00000001 de229c10
	[   37.348724] 9d40: de229eac 00000029 c075b558 00000001 00000003 00000004 de229c10 c048d594
	[   37.357299] 9d60: 00000000 60000013 00000018 205b0007 37332020 3432322e 5d343838 c0060020
	[   37.365905] 9d80: de251600 00000001 00000000 de251600 00000001 c0065a84 de229c00 de229c48
	[   37.374481] 9da0: 00000006 0048d62c de229c38 de229c00 de229c00 de1f6c00 de1f6c20 00000001
	[   37.383056] 9dc0: 00000000 c048d62c 00000000 de229c00 de229c00 de1f6c00 de1f6c20 00000001
	[   37.391632] 9de0: 00000000 c048d62c 00000000 c0330164 00000000 de1f6c20 c048d62c de1f6c00
	[   37.400207] 9e00: c0330078 de1f6c04 c078d714 de189b58 00000000 c02ccfd8 de1f6c20 c0795f40
	[   37.408782] 9e20: c0238330 00000000 00000000 c02381a8 de1b9fc0 de1f6c20 de1f6c20 de249e48
	[   37.417358] 9e40: c0238330 c0236bb0 decdbed8 de7d0f14 de1f6c20 de1f6c20 de1f6c54 de1f6c20
	[   37.425933] 9e60: 00000000 c0238030 de1f6c20 c078d7bc de1f6c20 c02377ec de1f6c20 de1f6c28
	[   37.434509] 9e80: dee64cb0 c0236138 c047c554 de189b58 00000000 c004b45c de1f6c20 de1f6cd8
	[   37.443084] 9ea0: c0edfa6c de1f6c00 dee64c68 de1f6c04 de1f6c20 dee64cb8 c047c554 de189b58
	[   37.451690] 9ec0: 00000000 c02cd634 dee64c68 de249ef4 de23b008 dee64cb0 0000000d de23b000
	[   37.460266] 9ee0: de23b007 c02cd78c 00000002 00000000 00000000 35636d68 00333438 00000000
	[   37.468841] 9f00: 00000000 00000000 001e0000 00000000 00000000 00000000 00000000 0a10cec0
	[   37.477416] 9f20: 00000002 de249f80 0000000d dee62990 de189b40 c0234d88 0000000d c010c354
	[   37.485992] 9f40: 0000000d de210f28 000acc88 de249f80 0000000d de248000 00000000 c00b7bf8
	[   37.494567] 9f60: de210f28 000acc88 de210f28 000acc88 00000000 00000000 0000000d c00b7ed8
	[   37.503143] 9f80: 00000000 00000000 0000000d 00000000 0007fa28 0000000d 000acc88 00000004
	[   37.511718] 9fa0: c000e544 c000e380 0007fa28 0000000d 00000001 000acc88 0000000d 00000000
	[   37.520294] 9fc0: 0007fa28 0000000d 000acc88 00000004 00000001 00000020 00000002 00000000
	[   37.528869] 9fe0: 00000000 beab8624 0000ea05 b6eaebac 600d0010 00000001 00000000 00000000
	[   37.537475] [<c00b408c>] (kfree+0x84/0x144) from [<c0236274>] (device_add+0x530/0x57c)
	[   37.545806] [<c0236274>] (device_add+0x530/0x57c) from [<c032fa40>] (iio_device_register+0x8c8/0x990)
	[   37.555480] [<c032fa40>] (iio_device_register+0x8c8/0x990) from [<c0330164>] (hmc5843_probe+0xec/0x114)
	[   37.565338] [<c0330164>] (hmc5843_probe+0xec/0x114) from [<c02ccfd8>] (i2c_device_probe+0xc4/0xf8)
	[   37.574737] [<c02ccfd8>] (i2c_device_probe+0xc4/0xf8) from [<c02381a8>] (driver_probe_device+0x118/0x218)
	[   37.584777] [<c02381a8>] (driver_probe_device+0x118/0x218) from [<c0236bb0>] (bus_for_each_drv+0x4c/0x84)
	[   37.594818] [<c0236bb0>] (bus_for_each_drv+0x4c/0x84) from [<c0238030>] (device_attach+0x78/0xa4)
	[   37.604125] [<c0238030>] (device_attach+0x78/0xa4) from [<c02377ec>] (bus_probe_device+0x28/0x9c)
	[   37.613433] [<c02377ec>] (bus_probe_device+0x28/0x9c) from [<c0236138>] (device_add+0x3f4/0x57c)
	[   37.622650] [<c0236138>] (device_add+0x3f4/0x57c) from [<c02cd634>] (i2c_new_device+0xf8/0x19c)
	[   37.631805] [<c02cd634>] (i2c_new_device+0xf8/0x19c) from [<c02cd78c>] (i2c_sysfs_new_device+0xb4/0x130)
	[   37.641754] [<c02cd78c>] (i2c_sysfs_new_device+0xb4/0x130) from [<c0234d88>] (dev_attr_store+0x18/0x24)
	[   37.651611] [<c0234d88>] (dev_attr_store+0x18/0x24) from [<c010c354>] (sysfs_write_file+0x10c/0x140)
	[   37.661193] [<c010c354>] (sysfs_write_file+0x10c/0x140) from [<c00b7bf8>] (vfs_write+0xb0/0x178)
	[   37.670410] [<c00b7bf8>] (vfs_write+0xb0/0x178) from [<c00b7ed8>] (sys_write+0x3c/0x68)
	[   37.678833] [<c00b7ed8>] (sys_write+0x3c/0x68) from [<c000e380>] (ret_fast_syscall+0x0/0x3c)
	[   37.687683] Code: 1593301c e5932000 e3120080 1a000000 (e7f001f2)
	[   37.700775] ---[ end trace aaf805debdb69390 ]---

Client data was assigned to iio_dev structure in probe but in
hmc5843_init_client function casted to private driver data structure which
is wrong. Possibly calling mutex_init(&data->lock); corrupt data
which the lead to above crash.

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Cc: stable <stable@vger.kernel.org>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-12 14:34:31 -07:00
Jonathan Cameron
487db48506 staging:iio: use spi->irq valid rather than querying available modes
Given these drivers only try to add the trigger if a valid
irq is present it is clearer to check the same condition when
deciding whether to remove it on a later trigger.

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
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
Jonathan Cameron
0b27d678c7 staging:iio:max1363 enable use with inkernel interfaces.
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
Jonathan Cameron
ecbf20ca95 staging:iio fill in some missing docs
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
Jonathan Cameron
a9ea1b178f staging:iio:adc:max1363 fix missing update_scan_mask callback.
When moving over to the new sw_ring_preenable I managed to add
this callback to only one of the two iio_info structures. As
such only some devices will currently work.

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
Jonathan Cameron
09f78be78a staging:iio:buffer example fix typos
I have no idea how I managed to munge the previous
patch related to this.  Sorry all.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 13:26:32 -07:00
Preetham Chandru
40f32d9345 staging: iio: ak8975: Remove i2c client data corruption
i2c client data set is of type struct indio_dev pointer and hence the
pointer returned from i2c_get_clientdata() should be assigned to
an object of type struct indio_dev and not to an object of type
struct ak8975_data.

Also in ak8975_probe() client data should be set first
before calling ak8975_setup() as it references the client data.

Signed-off-by: Preetham Chandru R <pchandru@nvidia.com>
CC: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 09:19:29 -07:00
Lothar Waßmann
218f4d437d staging:iio:core add missing increment of loop index in iio_map_array_unregister()
staging:iio:core add missing increment of loop index in iio_map_array_unregister()

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 09:17:33 -07:00
Linus Torvalds
11bcb32848 The following text was taken from the original review request:
"[PATCH 0/3] RFC - module.h usage cleanups in fs/ and lib/"
 		https://lkml.org/lkml/2012/2/29/589
 --
 
 Fix up files in fs/ and lib/ dirs to only use module.h if they really
 need it.
 
 These are trivial in scope vs. the work done previously.  We now have
 things where any few remaining cleanups can be farmed out to arch or
 subsystem maintainers, and I have done so when possible.  What is
 remaining here represents the bits that don't clearly lie within a
 single arch/subsystem boundary, like the fs dir and the lib dir.
 
 Some duplicate includes arising from overlapping fixes from
 independent subsystem maintainer submissions are also quashed.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJPbNw3AAoJEOvOhAQsB9HWA7wQALrsQ6V6Z+B3KsvSoD5kFnpZ
 Y+4uggs+GdUdWmtRrZnTBp896gGuUgBxc3syA2XWd7Oqi49+c5c1m0cFxKyVdIHm
 fB+jmxS69soADtHR3cXmxcQshrUzUf2rTn8frcw4O/BmJuplv4xT9uPQzwGaRSZT
 gomQsQ1bGnkwjO2jfS8f/N5Mjr8u/z0WF7TTOTUSq+Cv3BervPaSPF1Ea6J8oo+N
 4+/n8RlU1HWiI4inrgrFPN6UHmE45BAL2xGbB47LgooHJW8P5kAnU+vxGScaoy1Q
 JKX9WKT3VCiwR3VOPa86iLKP3Y8a3VlhyGn+yzzcYkGX/n0tbT7aoRhQm21sGIv0
 DoeXWe7aiiY8cEW69G6GIfRPFl+Zh81m1Whbu7IZT/sV3asx6jWmEXE8CgCfeDt5
 mNQk9D4Irf6+rmCSbeSVC4L0eFfLxNFouNyh2aus/q+gIjKNKYwZQryHrodK4wpv
 UgMKSTZfPrTAWay2gCNWNqo3Zs8e1LDqkftetxeU3jx2kTuaNzBl4Y7mhsX7sLYe
 MsFX3JUJ2pn6XWbgqcY+bdr/mzgsCrjzqdf15MTUzEc5SIfVF+XpNNZN1ITwl6UA
 /ZH9keBu1mEdCoPU5W74kYwx4p35hIeWJGfc0MRp07ruf941F+SBgMD11B0+06f0
 pN0DcITTkD16+sS4x1cB
 =Z4w0
 -----END PGP SIGNATURE-----

Merge tag 'module-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux

Pull cleanup of fs/ and lib/ users of module.h from Paul Gortmaker:
 "Fix up files in fs/ and lib/ dirs to only use module.h if they really
  need it.

  These are trivial in scope vs the work done previously.  We now have
  things where any few remaining cleanups can be farmed out to arch or
  subsystem maintainers, and I have done so when possible.  What is
  remaining here represents the bits that don't clearly lie within a
  single arch/subsystem boundary, like the fs dir and the lib dir.

  Some duplicate includes arising from overlapping fixes from
  independent subsystem maintainer submissions are also quashed."

Fix up trivial conflicts due to clashes with other include file cleanups
(including some due to the previous bug.h cleanup pull).

* tag 'module-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux:
  lib: reduce the use of module.h wherever possible
  fs: reduce the use of module.h wherever possible
  includecheck: delete any duplicate instances of module.h
2012-03-24 10:24:31 -07:00
Linus Torvalds
69a7aebcf0 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
Pull trivial tree from Jiri Kosina:
 "It's indeed trivial -- mostly documentation updates and a bunch of
  typo fixes from Masanari.

  There are also several linux/version.h include removals from Jesper."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (101 commits)
  kcore: fix spelling in read_kcore() comment
  constify struct pci_dev * in obvious cases
  Revert "char: Fix typo in viotape.c"
  init: fix wording error in mm_init comment
  usb: gadget: Kconfig: fix typo for 'different'
  Revert "power, max8998: Include linux/module.h just once in drivers/power/max8998_charger.c"
  writeback: fix fn name in writeback_inodes_sb_nr_if_idle() comment header
  writeback: fix typo in the writeback_control comment
  Documentation: Fix multiple typo in Documentation
  tpm_tis: fix tis_lock with respect to RCU
  Revert "media: Fix typo in mixer_drv.c and hdmi_drv.c"
  Doc: Update numastat.txt
  qla4xxx: Add missing spaces to error messages
  compiler.h: Fix typo
  security: struct security_operations kerneldoc fix
  Documentation: broken URL in libata.tmpl
  Documentation: broken URL in filesystems.tmpl
  mtd: simplify return logic in do_map_probe()
  mm: fix comment typo of truncate_inode_pages_range
  power: bq27x00: Fix typos in comment
  ...
2012-03-20 21:12:50 -07:00
Grant Grundler
dbf717fd9a staging:iio:tsl2563 rewrite probe error handling
tsl2563 probe function has two minor issues with it's error handling paths:
1) it is silent (did not report errors to dmesg)
2) did not return failure code (mixed up use of ret and err)

and two major issues:
3) goto fail2 would corrupt a free memory pool ("double free")
4) device registration failure did NOT cancel/flush delayed work.
   (and thus dereference a freed data structure later)

The "double free" is subtle and was introduced with this change:
    Author: Jonathan Cameron <jic23@cam.ac.uk>
    Date:   Mon Apr 18 12:58:55 2011 +0100
    staging:iio:tsl2563 take advantage of new iio_device_allocate private data.

Originally, chip was allocated seperately. Now it's appended to the
indio_dev by iio_allocate_device(sizeof(*chip)). So we only need one
kfree call as well (in iio_free_device()).

Gory details of tracking this down are here:
   http://crosbug.com/26819

Despite iio_device_registration failing, system can at least now boot.
Will follow up with a fix to "double register : in_intensity_both_raw"
error that is included in the bug report.

Signed-off-by: Grant Grundler <grundler@chromium.org>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Bryan Freed <bfreed@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-07 13:36:45 -08:00
Lars-Peter Clausen
4fee7e168b staging:iio: Fix compile error without CONFIG_DEBUG_FS
commit e553f182d ("staging: iio: core: Introduce debugfs support, add support
for direct register access") added a '#if defined(CONFIG_DEBUG_FS)' around
iio_read_channel_ext_info and iio_write_channel_ext_info causing the following
compile error if CONFIG_DEBUG_FS is not defined.

	drivers/staging/iio/industrialio-core.c:621:11: error: 'iio_read_channel_ext_info' undeclared (first use in this function)
	drivers/staging/iio/industrialio-core.c:623:11: error: 'iio_write_channel_ext_info' undeclared (first use in this function)

This patch fixes the issue by moving the functions out of the '#if
defined(CONFIG_DEBUG_FS)' section again.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-07 13:26:52 -08:00
Michael Hennerich
5f953732ac staging: iio: Convert platform_drivers to use module_platform_driver
No functional changes.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-02 16:35:39 -08:00
Michael Hennerich
0f1acee5f5 staging: iio: core: Avoid NULL pointer de-ref in case indio_dev->setup_ops are not in use
Drivers may not need setup_ops at all, so let the core supply
some empty ops.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-02 16:35:39 -08:00
Michael Hennerich
e553f182d5 staging: iio: core: Introduce debugfs support, add support for direct register access
Changes since V1:

Exclude iio debugfs code in case CONFIG_DEBUG_FS isn't enabled.
	Introduce helper function iio_get_debugfs_dentry.
	Document additions to struct iio_dev

iio_debugfs_read_reg:
	Use snprintf.
	Use a shorter fixed length.
	Introduce len instead of pointer math.

iio_debugfs_write_reg:
	Fix return value use PT_ERR.

Changes since V2:

Use debugfs_remove.
Fix whitespace damage.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-02 16:35:39 -08: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
Paul Gortmaker
13ae246db4 includecheck: delete any duplicate instances of module.h
Different tree maintainers picked up independently generated
trivial compile fixes based on linux-next testing, resulting
in some cases where a file would have got more than one addition
of module.h once everything was all merged together.

Delete any duplicates so includecheck isn't complaining about
anything related to module.h/export.h changes.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2012-02-28 19:31:56 -05:00
Michael Hennerich
cd4361c7e2 iio: core: constitfy available_scan_mask
The core must not modify available_scan_mask, because it causes problems
with drivers where multiple instances of the driver share the same mask set.
So make this explicit by marking available scan masks as const.

The max1363 driver needs some minor adjustment to accommodate this change.
Pull scan mask allocation into a separate function.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 12:14:04 -08:00
Lars-Peter Clausen
004d81339a staging:iio: Remove declaration for non existing function
The declaration for iio_buffer_deinit has been around for quite some time, but
the function itself has never been added. So remove the declaration.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 12:14:03 -08:00