summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/cdc
AgeCommit message (Collapse)Author
2019-02-02staging: iio: cdc: ad7152: remove driver completelyAlexandru Ardelean
The AD7153 part has been obsoleted for some time. The AD7152 part will be obsolete in the coming future. Moving it out of staging doesn't make sense anymore. Which makes the driver enter a limbo state. This patch removes the driver completely, so that no effort is placed on it, allowing people to focus on other parts that will still be around. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-10-07staging: iio: cdc: ad7150: fix misaligned linesSlawomir Stepien
These lines were misaligned, but the checkpatch.pl didn't indicate them as such. Signed-off-by: Slawomir Stepien <sst@poczta.fm> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-10-07staging: iio: cdc: ad7150: use value copy to shorten the line lengthSlawomir Stepien
By using the copy of channel attribute, we can now make the lines short enough to eliminate the checkpatch.pl problem: CHECK: Alignment should match open parenthesis Signed-off-by: Slawomir Stepien <sst@poczta.fm> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-08-19drivers: iio: Update MODULE AUTHOR email addressMichael Hennerich
no functional changes Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-04-21staging: iio: ad7746: Fix bound checkingsHernán Gonzalez
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-15staging: iio: ad7746: Reorder variable declarationsHernán Gonzalez
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-15staging: iio: ad7746: Reorder includes alphabeticallyHernán Gonzalez
Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-04-15staging: iio: ad7746: Fix multiple line dereferenceHernán Gonzalez
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-15staging: iio: ad7746: Adjust arguments to match open parenthesisHernán Gonzalez
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-15staging: iio: ad7746: Automatically swap values in readings/writingsHernán Gonzalez
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-03-10staging:iio:ad7150: Align arguments to match open parenthesisTom Lebreux
This fixes the following checkpatch.pl CHECK: Alignment should match open parenthesis Signed-off-by: Tom Lebreux <tomlebreux@cock.li> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-10staging:iio:ad7152: Align arguments to match open parenthesisTom Lebreux
This patch fixes checkpatch.pl CHECK for alignment. Signed-off-by: Tom Lebreux <tomlebreux@cock.li> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-10Staging: iio: ad7746: Adjust arguments to match open parenthesisDavid Veenstra
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-01-08Staging: iio: cdc: ad7152: Prefer using BIT macroSumit Pundir
This patch fixes the following checkpatch.pl issue at multiple lines: CHECK: Prefer using the BIT macro Signed-off-by: Sumit Pundir <pundirsumit11@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-02staging: iio: ad7746: Improve unlocking of a mutex in ad7746_start_calib()Markus Elfring
* 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-02staging: iio: ad7152: Improve unlocking of a mutex in ad7152_start_calib()Markus Elfring
* 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-08-22staging:iio:cdc: drop assign iio_info.driver_moduleJonathan Cameron
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-05-28staging: iio: ad7152: Fix deadlock in ad7152_write_raw_samp_freq()Alexey Khoroshilov
ad7152_write_raw_samp_freq() is called by ad7152_write_raw() with chip->state_lock held. So, there is unavoidable deadlock when ad7152_write_raw_samp_freq() locks the mutex itself. The patch removes unneeded locking. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Fixes: 6572389bcc11 ("staging: iio: cdc: ad7152: Implement IIO_CHAN_INFO_SAMP_FREQ attribute") Acked-by: Lars-Peter Clausen <lars@metafoo.de> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25staging: iio: Remove extra Parenthesis.Arushi Singhal
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-23staging: iio: cdc: ad7746: Fix alignment with paranthesisNarcisa Ana Maria Vasile
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-23staging: iio: Add blank lines after function declarationsNarcisa Ana Maria Vasile
This was reported by checkpatch.pl: CHECK: Please use a blank line after function/struct/union/enum declarations Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-23staging: iio: Replace a bit shift by a use of BIT.Arushi Singhal
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-19Staging: iio: cdc: ad7746: use octal permissions instead of symbolicMiguel Robles
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-15Staging: iio: cdc: ad7152.c, use octal permissions instead of symbolicMiguel Robles
Fix checkpatch warnings: Symbolic permissions are not preferred. Consider using octal permissions. Signed-off-by: Miguel Robles <miguel.robles@farole.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-15staging:iio:cdc:ade7746 replace mlock with driver private lockAishwarya Pant
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-13staging: iio: cdc: ad7152: Remove exceptional & on function namesimran singhal
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-13staging: iio: cdc: ad7746: Remove exceptional & on function namesimran singhal
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-02-25staging: iio: ad7152: Use BIT() macro for left shifting 1sayli karnik
Replace left shifting on 1 with the BIT(x) macro as suggested by checkpatch.pl. Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-28drivers:staging:iio:cdc: Style fix.Anthony Brandon
Align parameters to parentheses. Signed-off-by: Anthony Brandon <anthony@amarulasolutions.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-12-04staging: iio: cdc: fix improper return valuePan Bian
At the end of function ad7150_write_event_config(), directly returns 0. As a result, the errors will be ignored by the callers. It may be better to return variable "ret". Signed-off-by: Pan Bian <bianpan2016@163.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-12-03staging: iio: replace symbolic permissionAmit Kumar Kushwaha
This patch fixes the following checkpatch.pl warning in ad7150.c WARNING: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred Occured during build. Signed-off-by: Amit Kushwaha <kushwaha.a@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-11-01staging: iio: cdc: ad7746: add additional config definesEva Rachel Retuya
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-10-25staging: iio: cdc/ad7746: fix missing return valueArnd Bergmann
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: 2296c0623eb7 ("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-23staging: iio: cdc: ad7152: Replace mlock with a local mutex locksayli karnik
mlock is intended to protect only switches between modes. Given this driver doesn't support more than one mode (sysfs polled reads only), replace mlock with a local mutex lock. Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-10-23staging: iio: cdc: ad7746: implement IIO_CHAN_INFO_SAMP_FREQEva Rachel Retuya
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-23staging: iio: cdc: ad7152: Implement IIO_CHAN_INFO_SAMP_FREQ attributesayli karnik
Attributes that were once privately defined become standard with time and hence a special global define is used. Hence update driver ad7152 to use IIO_CHAN_INFO_SAMP_FREQ which is a global define instead of IIO_DEV_ATTR_SAMP_FREQ. Move functionality from IIO_DEV_ATTR_SAMP_FREQ attribute into IIO_CHAN_INFO_SAMP_FREQ to implement the sampling_frequency attribute. Modify ad7152_read_raw() and ad7152_write_raw() to allow reading and writing the element as well. Also add a lock in the driver's private data. Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-10-03Staging: iio: ad7150: constify attribute_group structuresBhumika Goyal
Check for attribute_group structures that are only stored in the event_attrs filed of iio_info structure. As the event_attrs field of iio_info structures is constant, so these attribute_group structures can also be declared constant. Done using coccinelle: @r1 disable optional_qualifier @ identifier i; position p; @@ static struct attribute_group i@p = {...}; @ok1@ identifier r1.i; position p; struct iio_info x; @@ x.event_attrs=&i@p; @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ static +const struct attribute_group i={...}; @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct attribute_group i; File size before: text data bss dec hex filename 3561 1152 8 4721 1271 drivers/staging/iio/cdc/ad7150.o File size after: text data bss dec hex filename 3625 1088 8 4721 1271 drivers/staging/iio/cdc/ad7150.o Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-10-03staging: iio: cdc: ad7152: Add blank line after declarations to increase ↵Anchal Jain
readability Add a blank line after the function to increase the readability of the code. Signed-off-by: Anchal Jain <anchalj109@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-30iio:core: timestamping clock selection supportGregor Boirie
Adds a new per-device sysfs attribute "current_timestamp_clock" to allow userspace to select a particular POSIX clock for buffered samples and events timestamping. Following clocks, as listed in clock_gettime(2), are supported: CLOCK_REALTIME, CLOCK_MONOTONIC, CLOCK_MONOTONIC_RAW, CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_COARSE, CLOCK_BOOTTIME and CLOCK_TAI. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Acked-by: Sanchayan Maity <maitysanchayan@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-11staging: iio: Remove parentheses on the right hand side of assignmentJanani Ravichandran
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-01-04Staging: iio: cdc: ad7150: Fix alignment should match open parenthesisShraddha Barke
Fix the checkpatch warning of alignment should match open parenthesis. Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-01-04Staging: iio: cdc: ad7150: Prefer using the BIT macroShraddha Barke
Replace bit shifting on 1 with the BIT(x) macro Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-10-24staging: iio: cdc: Remove explicit comparisonsCristina Moraru
Remove comparisons to 0 or NULL Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16Staging: iio: cdc: Remove unused macrosShraddha Barke
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-16staging: iio: cdc: simplify return flowIoana Ciornei
Simplify return flow ad7150_write_event_params in order to reduce code length. Since i2c_smbus_write_word_data only returns a negative value or 0 the change is safe. This patch fixes the following coccicheck warning: drivers/staging/iio/cdc/ad7150.c:182:2-5: WARNING: end returns can be simpified if negative or 0 value Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16Merge tag 'iio-for-4.4b' of ↵Greg Kroah-Hartman
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-11staging: iio: adc: fix comment block coding style issueHugo Camboulive
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-04staging: iio: adc: fix comment block coding style issueHugo Camboulive
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-04staging: iio: cdc: use devm_iio_device_register instead iio_device_registerIoana Ciornei
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-09-30Staging: iio: cdc: Remove unnecessary dev_infoShraddha Barke
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>