1
0
Fork 0
Commit Graph

50 Commits (c55cc97a252488a8e2a9181c1c36713cad69ee18)

Author SHA1 Message Date
João Seckler 094c52dbaf staging: iio: ad7746: add device tree support
Add a of_device_id struct variable and subsequent call to
MODULE_DEVICE_TABLE macro to support device tree.

Signed-off-by: João Seckler <joaoseckler@gmail.com>
Signed-off-by: Lucas Oshiro <lucasseikioshiro@gmail.com>
Co-developed-by: Lucas Oshiro <lucasseikioshiro@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-05-26 18:48:14 +01:00
Greg Kroah-Hartman 2506abea7f staging: iio: add proper SPDX identifiers to remaining driver files
There are a number of IIO staging drivers that do not have a proper SPDX
identifier on it.  So fix that up and at the same time, remove the "free
form" license text, as that's pretty much impossible for any tool to
parse.

Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Michael Hennerich <Michael.Hennerich@analog.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03 11:10:17 +02:00
Michael Hennerich 9920ed25ec drivers: iio: Update MODULE AUTHOR email address
no functional changes

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-08-19 17:23:39 +01:00
Hernán Gonzalez 2c97342164 staging: iio: ad7746: Fix bound checkings
Also remove unnecessary parenthesis

Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-04-21 15:38:38 +01:00
Hernán Gonzalez afcd0b22e3 staging: iio: ad7746: Reorder variable declarations
Reorder some variable declarations in an inverse-pyramid scheme.

Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-04-15 16:09:52 +01:00
Hernán Gonzalez 7adedec254 staging: iio: ad7746: Reorder includes alphabetically
Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-04-15 16:08:37 +01:00
Hernán Gonzalez c9aff39fa1 staging: iio: ad7746: Fix multiple line dereference
Clear checkpatch.pl WARNING about multiple line derefence but creates a
new one of line over 80 characters. In my opinion, it improves
readability.

Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-04-15 16:06:38 +01:00
Hernán Gonzalez 2470bf57fc staging: iio: ad7746: Adjust arguments to match open parenthesis
Clear a couple more checkpatch.pl CHECKS.

Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-04-15 16:02:48 +01:00
Hernán Gonzalez 95302e54d2 staging: iio: ad7746: Automatically swap values in readings/writings
Data to read or write was being handled with the swab16() macro instead
of using i2c_smbus_{read,write}_swapped.

Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-04-15 16:00:28 +01:00
David Veenstra d90f21408b Staging: iio: ad7746: Adjust arguments to match open parenthesis
This patch clears all checkpatch.pl CHECKS, about alignment not matching
open parenthesis, whenever it is possible without going beyond 80 columns.

Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-10 15:20:25 +00:00
Markus Elfring aa6b707c14 staging: iio: ad7746: Improve unlocking of a mutex in ad7746_start_calib()
* Add a jump target so that a call of the function "mutex_unlock" is stored
  only twice in this function implementation.

* Replace two calls by goto statements.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 10:40:07 +00:00
Jonathan Cameron 6ff33cb3ce staging:iio:cdc: drop assign iio_info.driver_module
The equivalent of this is now done via macro magic when
the relevant register call is made.  The actual structure
elements will shortly go away.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2017-08-22 22:14:54 +01:00
Arushi Singhal e29e7b3236 staging: iio: Remove extra Parenthesis.
Remove the extra parenthesis remove the checkpatch issue.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25 16:04:38 +00:00
Narcisa Ana Maria Vasile 745c6dad49 staging: iio: cdc: ad7746: Fix alignment with paranthesis
This was reported by checkpatch.pl:
CHECK: Alignment should match open parenthesis

Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-23 19:43:35 +00:00
Arushi Singhal 63bb38c000 staging: iio: Replace a bit shift by a use of BIT.
This patch replaces bit shifting on 1 with the BIT(x) macro.
This was done with coccinelle:
@@
constant c;
@@

-1 << c
+BIT(c)

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-23 19:43:29 +00:00
Miguel Robles 1aca202610 Staging: iio: cdc: ad7746: use octal permissions instead of symbolic
Fix checkpatch warnings:
Symbolic permissions 'S_IWUSR' are not preferred.

Signed-off-by: Miguel Robles <miguel.robles@farole.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-19 11:05:15 +00:00
Aishwarya Pant 9854a1b5c4 staging:iio:cdc:ade7746 replace mlock with driver private lock
The IIO subsystem is redefining iio_dev mlock to be used by IIO core
only for protecting device operating mode changes.

In driver ad7746 wherever mlock was used to protect hardware state
changes, it has been replaced with a driver private lock.

Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-15 21:56:50 +00:00
simran singhal 95d73c616b staging: iio: cdc: ad7746: Remove exceptional & on function name
Remove & from function pointers to conform to the style found elsewhere
in the file.  Done using the following semantic patch

// <smpl>
@r@
identifier f;
@@

f(...) { ... }
@@
identifier r.f;
@@

- &f
+ f
// </smpl>

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-13 21:20:32 +00:00
Eva Rachel Retuya 579d542534 staging: iio: cdc: ad7746: add additional config defines
Introduce defines for shifting and mask under the config register for
better readability. Also, introduce helper variables for index
calculation.

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-11-01 18:50:09 +00:00
Arnd Bergmann 3089ec2c10 staging: iio: cdc/ad7746: fix missing return value
As found by "gcc -Wmaybe-uninitialized", the latest change to the
driver lacked an initalization for the return code in one of the
added cases:

drivers/staging/iio/cdc/ad7746.c: In function ‘ad7746_read_raw’:
drivers/staging/iio/cdc/ad7746.c:655:2: error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

This sets it to IIO_VAL_INT, which I think is what we want here.

Fixes: 2296c0623e ("staging: iio: cdc: ad7746: implement IIO_CHAN_INFO_SAMP_FREQ")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-10-25 17:25:34 +01:00
Eva Rachel Retuya 2296c0623e staging: iio: cdc: ad7746: implement IIO_CHAN_INFO_SAMP_FREQ
This driver predates the availability of IIO_CHAN_INFO_SAMP_FREQ
attribute wherein usage has some advantages like it can be accessed by
in-kernel consumers as well as reduces the code size.

Therefore, use IIO_CHAN_INFO_SAMP_FREQ to implement the
sampling_frequency attribute instead of using IIO_DEVICE_ATTR() macro.

Move code from the functions associated with IIO_DEVICE_ATTR() into
respective read and write hooks with the mask set to
IIO_CHAN_INFO_SAMP_FREQ.

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-10-23 19:28:04 +01:00
Janani Ravichandran 77cb59a42b staging: iio: Remove parentheses on the right hand side of assignment
Remove parentheses on the right hand side of assignment as they are not
needed. Semantic patch used:

@@
expression a, b, c, d;
@@

(
  a = (c == d)
|
  a =
- (
  b
- )
)
Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 19:37:15 -08:00
Shraddha Barke 859ba4684e Staging: iio: cdc: Remove unused macros
Remove the macros since they are not used anywhere throughout the
kernel.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:48:19 -07:00
Greg Kroah-Hartman 5da654541b Second set of new drivers, functionality and cleanups for IIO in the 4.4 cycle.
Core stuff
 * adjust resistance documentation to allow for output devices.
 
 New device support:
 * bmc150
  - split the i2c driver up into a core and i2c_regmap part including regmap
    conversion.
  - add spi support.
 * mcp4531 digitial potentiometer driver.
 * Measurement Specialties set of drivers with a core library module providing
   common functionality.  Note that the htu21 has a driver in hwmon, but the
   view from that side was that, given the range of devices the same silicon
   turns up in are not all typical hwmon material, that driver would be
   deprecated in favour of this new support.
  - ms8607 temperature, pressure and humidty sensor
  - ms5637 temperature and pressure sensor
  - htu21 temperature and humidity sensor
  - tsys02d temperature sensor
  - tsys01 temperature sensor
 
 Cleanups
 * tree wide.
  - squish cases where irq 0 is still considered valid.
 * apds9960
  - sparse endian warning cleanups by making endianness explicit.
 * ad5504
  - leave group naming to the core.
 * ad7746
  - cleanup comment style.
  - drop an unnecessary bit of dev_info
  - add some appropriate uses of the BIT macro.
 * ad799x
  - leave group naming to the core.
 * hdc100x - introduced this cycle,.
  - fix a wrong offset value.
 * lidar
  - add missing MODULE_DEVICE_TABLE for dt.
 * max1363
  - leave sysfs group naming to the core.
 * m62332 got the Harmut treatment and as ever he found a 'few' bits the
   rest of us had missed!
  - Share scale and offset attributes across channels.
  - Shutdown the device on driver remove
  - Use ARRAY_SIZE rather than a hard coded count for channels.
  - Return more directly in the write_raw callback dropping a local variable
    along the way.
  - a few style issues
  - move to reading the regulator voltage for each use allowing for dynamic
    regulators.  This is a common feature across drivers so we might end
    up with more fixes throughout the tree for this.
 * mlx96014 - introduced this cycle.
  - fixed up a spot of error handling.
 * vz89x - introduced this cycle.
  - work around a hardware quirk.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJWG/HnAAoJEFSFNJnE9BaI3skQAJa/x5iZKRfR15pbYcYrgfUl
 P0yOh2l5+PufKUQVqKla9wmYjoriXoKLvC2UtFyvnCj72H8zPt24N+Fx9kab/Wy0
 YXnq/KgppQ9NFat3mYUxQoRFg7tlNkEj1jDF0iynNCSGUW6TJYxvHkto0oZOzi0O
 b9oejTci+1+8mreShiobALp12bappQVBWy3TUmcEnGr/RmOPi+YQaYO+YGcPUx6R
 YPCHw6/QpDukUJ82gnWtvarHFuf8LwmZ9lz+OzMY9Xy1ytglwHOnhnimWai0qEGz
 TSaFqM/HKFB8f9hY08srfqaAz1q+Gx56yQQsGlhGtwvVELKn5HhDpgiAJImc0ZG/
 B7hUB9Gi7TWbGlE/VvCGRPjFkVVnDibtNd9OJaeQPZD8KwRR320bA+6o49RVAa92
 0tFfybEe8I2y3577QkH7enYr+5CV/RtvWxBjwxzODAwWypzPWNTyfgsd9JKxnDYH
 cL9DejGQhGDgyM47Q8FEKTJovTc6ueP/1/5v4p6Qeg8WsaAC18bl3zKGJ3jywIiR
 Ec/8icxdxmT+UUDJAPKOMSBraOnUDa/q1blaNtMb9bqSlbMmE9vz3w71uBvfpzE5
 /snq1j4yAyomE74x6lfb6Amzv1q6VVI72ewOtGng0kgYAV5t6+m2oVz8p+hYShZO
 Q7d1RqBZrEtsjYyg9qNn
 =LXV9
 -----END PGP SIGNATURE-----

Merge tag 'iio-for-4.4b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

Second set of new drivers, functionality and cleanups for IIO in the 4.4 cycle.

Core stuff
* adjust resistance documentation to allow for output devices.

New device support:
* bmc150
 - split the i2c driver up into a core and i2c_regmap part including regmap
   conversion.
 - add spi support.
* mcp4531 digitial potentiometer driver.
* Measurement Specialties set of drivers with a core library module providing
  common functionality.  Note that the htu21 has a driver in hwmon, but the
  view from that side was that, given the range of devices the same silicon
  turns up in are not all typical hwmon material, that driver would be
  deprecated in favour of this new support.
 - ms8607 temperature, pressure and humidty sensor
 - ms5637 temperature and pressure sensor
 - htu21 temperature and humidity sensor
 - tsys02d temperature sensor
 - tsys01 temperature sensor

Cleanups
* tree wide.
 - squish cases where irq 0 is still considered valid.
* apds9960
 - sparse endian warning cleanups by making endianness explicit.
* ad5504
 - leave group naming to the core.
* ad7746
 - cleanup comment style.
 - drop an unnecessary bit of dev_info
 - add some appropriate uses of the BIT macro.
* ad799x
 - leave group naming to the core.
* hdc100x - introduced this cycle,.
 - fix a wrong offset value.
* lidar
 - add missing MODULE_DEVICE_TABLE for dt.
* max1363
 - leave sysfs group naming to the core.
* m62332 got the Harmut treatment and as ever he found a 'few' bits the
  rest of us had missed!
 - Share scale and offset attributes across channels.
 - Shutdown the device on driver remove
 - Use ARRAY_SIZE rather than a hard coded count for channels.
 - Return more directly in the write_raw callback dropping a local variable
   along the way.
 - a few style issues
 - move to reading the regulator voltage for each use allowing for dynamic
   regulators.  This is a common feature across drivers so we might end
   up with more fixes throughout the tree for this.
* mlx96014 - introduced this cycle.
 - fixed up a spot of error handling.
* vz89x - introduced this cycle.
 - work around a hardware quirk.
2015-10-16 21:28:55 -07:00
Hugo Camboulive 18a16b5e26 staging: iio: adc: fix comment block coding style issue
This patch to ad7746.c makes the comment blocks end with a */
on a separate line, and start with a /* on an empty line.

Signed-off-by: Hugo Camboulive <hugo.camboulive@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-10-11 10:21:22 +01:00
Hugo Camboulive bdddc22f07 staging: iio: adc: fix comment block coding style issue
This patch to ad7746.c makes the comment block end with a */
on a separate line.

Signed-off-by: Hugo Camboulive <hugo.camboulive@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 08:31:07 +01:00
Ioana Ciornei 252fb58ceb staging: iio: cdc: use devm_iio_device_register instead iio_device_register
Replace iio_device_register with resource managed devm_iio_device_register in order
to ease the error path. Also delete de remove function since there is no need after
this change.

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 08:31:07 +01:00
Shraddha Barke e38f898320 Staging: iio: cdc: Remove unnecessary dev_info
Remove dev_info as the information can be obtained by other means

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-09-30 18:20:53 +01:00
Shraddha Barke 46d4503bc8 Staging: iio: cdc: Prefer using the BIT macro
Replace bit shifting on 1 with the BIT(x) macro

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-09-30 18:20:53 +01:00
Shraddha Barke 5b8ffb5565 Staging: iio: cdc: Prefer using the BIT macro
This patch replaces bit shifting on 1 with the BIT(x) macro

This was done with coccinelle:
@@ int g; @@

-(1 << g)
+BIT(g)

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:55 -07:00
Masanari Iida e3c5be2bda staging: iio: Fix typo in iio
Correct spelling typo in comment within staging/iio

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-04-23 21:44:41 +01:00
Lars-Peter Clausen 112b0b79b2 staging:iio:ad7746: Do not store the transfer buffer on the stack
Some I2C controllers might not be able to handle transfer buffers that are
stored on stack.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-12-03 20:22:28 +00:00
Lars-Peter Clausen d4adb07c7a staging:iio:ad7746: Mark transfer buffer as __be32
Fixes the following warnings from sparse:
	drivers/staging/iio/cdc/ad7746.c:599:25: warning: cast to restricted __be32
	drivers/staging/iio/cdc/ad7746.c:599:25: warning: cast to restricted __be32
	drivers/staging/iio/cdc/ad7746.c:599:25: warning: cast to restricted __be32
	drivers/staging/iio/cdc/ad7746.c:599:25: warning: cast to restricted __be32
	drivers/staging/iio/cdc/ad7746.c:599:25: warning: cast to restricted __be32
	drivers/staging/iio/cdc/ad7746.c:599:25: warning: cast to restricted __be32

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-12-03 20:22:28 +00:00
Lars-Peter Clausen 4f9be98586 staging:iio:ad7746: Report scale as fractional value
Move the complexity of calculating the fixed point scale to the core.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-01 16:19:13 +01:00
Sachin Kamat 0eab65c64a staging: iio: ad7746: Use devm_iio_device_alloc
Using devm_iio_device_alloc makes code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-28 20:21:34 +01:00
Jonathan Cameron a556d1722f staging:iio:cdc:ad7746 move to info_mask_(shared_by_type/separate)
The original info_mask is going away in favour of the broken out versions.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-03-17 19:49:39 +00:00
Bill Pemberton e543acf07d staging: iio: remove use of __devexit_p
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 15:02:23 -08:00
Bill Pemberton 447d4f29ee staging: iio: remove use of __devexit
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 14:59:37 -08:00
Bill Pemberton 4ae1c61ff2 staging: iio: remove use of __devinit
CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 14:31:41 -08:00
Peter Senna Tschudin 73327b4c80 drivers/staging/iio: Remove unnecessary semicolon
A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r1@
statement S;
position p,p1;
@@
S@p1;@p

@script:python r2@
p << r1.p;
p1 << r1.p1;
@@
if p[0].line != p1[0].line_end:
        cocci.include_match(False)
@@
position r1.p;
@@
-;@p
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-10-19 16:18:51 +01: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 7cbb753701 staging:iio: Streamline API function naming
Currently we use two different naming schemes in the IIO API, iio_verb_object
and iio_object_verb. E.g iio_device_register and iio_allocate_device. This
patches renames instances of the later to the former. The patch also renames allocate to
alloc as this seems to be the preferred form throughout the kernel.

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

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

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

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-29 21:23:49 -04:00
Jonathan Cameron 06458e277e IIO: Move core headers to include/linux/iio
Step 1 in moving the IIO core out of staging.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-25 11:01:43 -07:00
Jonathan Cameron 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 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
Linus Torvalds 12e5550892 Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
* 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (466 commits)
  net/hyperv: Add support for jumbo frame up to 64KB
  net/hyperv: Add NETVSP protocol version negotiation
  net/hyperv: Remove unnecessary kmap_atomic in netvsc driver
  staging/rtl8192e: Register against lib80211
  staging/rtl8192e: Convert to lib80211_crypt_info
  staging/rtl8192e: Convert to lib80211_crypt_data and lib80211_crypt_ops
  staging/rtl8192e: Add lib80211.h to rtllib.h
  staging/mei: add watchdog device registration wrappers
  drm/omap: GEM, deal with cache
  staging: vt6656: int.c, int.h: Change return of function to void
  staging: usbip: removed unused definitions from header
  staging: usbip: removed dead code from receive function
  staging:iio: Drop {mark,unmark}_in_use callbacks
  staging:iio: Drop buffer mark_param_change callback
  staging:iio: Drop the unused buffer enable() and is_enabled() callbacks
  staging:iio: Drop buffer busy flag
  staging:iio: Make sure a device is only opened once at a time
  staging:iio: Disallow modifying buffer size when buffer is enabled
  staging:iio: Disallow changing scan elements in all buffered modes
  staging:iio: Use iio_buffer_enabled instead of open coding it
  ...

Fix up conflict in drivers/staging/iio/adc/ad799x_core.c (removal of
module_init due to using module_i2c_driver() helper, next to removal of
MODULE_ALIAS due to using MODULE_DEVICE_TABLE instead).
2012-01-09 12:18:17 -08:00
Jonathan Cameron c8a9f8056f staging:iio:treewide only use shared to decide on interfaces
Internally the fact that say scale is shared across channels is
actually of remarkably little interest.  Hence lets not store it.
Numerous devices have weird combinations of channels sharing
scale anyway so it is not as though this was really telling
us much. Note however that we do still use the shared sysfs
attrs thus massively reducing the number of attrs in complex
drivers.

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

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

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:35:04 -08:00
Lars-Peter Clausen 924f8a21dd staging:iio: Do not use bitmasks for channel info addresses
Currently the iio framework uses bitmasks for the address field of channel info
attributes. This is for historical reasons and no longer required since it will
only ever query a single info attribute at once. This patch changes the code to
use the non-shifted iio_chan_info_enum values for the info attribute address.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:35:04 -08:00
Lars-Peter Clausen 6e5af184f8 staging:iio: Use module_i2c_driver to register I2C drivers
Use the newly introduced module_i2c_driver macro for registering I2C drivers.
This allows us to remove a few lines of boilerplate code.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-17 12:15:39 -08:00
Michael Hennerich 5c48cb9de1 iio: adc: Relocate Capacitance to Digital Converters (CDC) into own subdir
No functional changes.
Fix Kconfig description.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-19 13:55:43 -07:00