Commit Graph

2346 Commits

Author SHA1 Message Date
Bo Yu
0a124e98f4 Staging: iio: return expression instead of return ret
The following Coccinelle script was used to detect this:

@@
local idexpression ret;
expression e;
@@

-ret =
+return
       e;
-return ret;

Signed-off-by: Bo YU <tsu.yubo@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-11 18:24:38 +00:00
sayli karnik
3a1e329385 staging: iio: ade7759: Move contents of header file to source file
The contents of ade7759.h are only used in ade7759.c. Move the header
contents to the source file and delete the header file.

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-11 17:17:25 +00:00
Narcisa Ana Maria Vasile
2df79e1bdd staging: iio: accel: Rename source files and update Makefile
Rename adis162xx_core.c files to adis162xx.c because
these are the only source files for these drivers.

Update Makefile to correspond to the new file names.

Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>

 rename drivers/staging/iio/accel/{adis16201_core.c => adis16201.c} (100%)
 rename drivers/staging/iio/accel/{adis16203_core.c => adis16203.c} (100%)
 rename drivers/staging/iio/accel/{adis16209_core.c => adis16209.c} (100%)
 rename drivers/staging/iio/accel/{adis16240_core.c => adis16240.c} (100%)
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-05 11:25:25 +00:00
Katie Dunne
0f0c106aa9 staging: iio: meter: ade7753: Clean up includes
Alphabetize header files.

Signed-off-by: Katie Dunne <kdunne@mail.ccsf.edu>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-04 17:35:16 +00:00
Katie Dunne
63a98d2511 staging: iio: meter: ade7753: Move header content to implementation file
The contents of ade7753.h are only used in ade7753.c. Move the header
contents to the implementation file and delete the header file.

Signed-off-by: Katie Dunne <kdunne@mail.ccsf.edu>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-04 17:34:27 +00:00
Narcisa Ana Maria Vasile
aa04a7078b staging: iio: adis16240: Move contents of the header to the source file
The contents of the header file are used only by this single
source file. Move content into .c file and remove header.

Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-04 16:37:29 +00:00
Narcisa Ana Maria Vasile
21a123beaf staging: iio: adis16209: Move contents of the header to the source file
The contents of the header file are used only by this single
source file. Move content into .c file and remove header.

Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-04 16:24:49 +00:00
Narcisa Ana Maria Vasile
dc35fa5628 staging: iio: ad9834: Moved contents of the header to the source file
Moved the contents of the header(ad9834.h) into the corresponding source
file with the exception of the platform data struct which is supposed to be
used from somewhere else other than the driver.

Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-02 19:44:06 +00:00
Narcisa Ana Maria Vasile
d89aa24585 staging: iio: ad9832: Moved contents of the header to the source file
Moved the contents of the header(ad9832.h) into the corresponding source file
with the exception of the platform data struct which is supposed to be
used from somewhere else other than the driver.

Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-02 19:09:09 +00:00
Varsha Rao
a8baa3c02a staging: iio: adis16203: Move header file content to source file.
The contents of the header file are used only by this single source
file. Moved content into adis16203_core.c file and removed adis16203.h
file. Arranged #include files in alphabetical order.

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-02 18:58:15 +00:00
simran singhal
346834727a staging: iio: accel: adis16201: Move header file content to source file
The contents of the header file are used only by this single
source file. Move content into .c and remove .h.

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-02 18:58:10 +00:00
sayli karnik
8f867691eb staging: iio: ad7152: Use BIT() macro for left shifting 1
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-02-25 16:46:21 +00:00
Derek Robson
31b9f91913 Staging: iio: impedance-analyzer: ad5933.c - style fix
Change permissions to octal style.
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-02-19 11:06:40 +00:00
Gargi Sharma
fb364cea3d staging: iio: compress return logic
Simplify function returns by merging assignment and return.
Found with Coccinelle.

Semantic patch:
@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-02-18 18:58:08 +00:00
sayli karnik
bf0adab4cd staging: iio: adis16240_core: Replace symbolic permission with octal permission
The patch resolves following checkpatch issue:
WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using
octal permissions '0444'.

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-02-18 18:52:52 +00:00
Jonathan Cameron
0097e20e77 staging:iio:adc:lpc32xx Move out of staging.
There are a few more little cleanups that could be done on this driver, but
I don't think any are sufficient to justify not moving it out of staging.

It's a very simple driver (presumably for a simple part) so not much that can
go wrong.  I think it was only ever in staging because that's where IIO was
as a whole at the time and then we forgot about it!

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Cc: Roland Stigge <stigge@antcom.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-02-11 11:19:25 +00:00
Jonathan Cameron
7901b2a145 staging:iio:adc:lpc32xx rename local state structure to _state
Previously it was called _info with instances as info.  This caused some
confusion against the info structure that are used in the core of IIO.

Since this driver was written it's become a fairly strong convention to
use _state and st for instances so change to that.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-02-11 11:19:21 +00:00
Jonathan Cameron
5023574adc staging:iio:adc:lpc32xx Apply consistent prefix to local defines
There was a bit of a random mixture going on here so change all prefixes
to LPC32XXAD_

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-02-11 11:19:14 +00:00
Jonathan Cameron
af8f651b39 staging:iio:adc:spear Move out of staging.
There are some unanswered questions due to disagreements between the code
and various datasheets (including between different datasheets for the same
part).

I don't think that is necessarily a reason to keep it in staging however.
I'm partly posting this patch inorder to reignite debate and with a bit
of luck find someone who has one of these to test!

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-02-11 11:17:33 +00:00
Brian Masney
bcbbd0fa82 staging: iio: isl29028: add copyright
Add Brian Masney's copyright to the header for the several rounds of
staging cleanups that has been done to this driver.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-02-11 09:48:45 +00:00
Brian Masney
0b59c388f8 staging: iio: isl29028: use the runtime power management for system sleep
With the introduction of runtime power management in commit 2db5054ac2
("staging: iio: isl29028: add runtime power management support"), the
system could go to sleep and turn off the device without notifying the
runtime power management code. This patch changes the system suspend
and resume to go through the runtime power management.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-02-11 09:46:38 +00:00
Brian Masney
45e2852b8b staging: iio: isl29028: fix incorrect sleep time when taking initial proximity reading
When proximity is enabled in isl29028_enable_proximity(), the function
msleep() is called with the sampling frequency, which is not correct.
This patch changes the code to sleep the specified amount of time listed
in the datasheet instead.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-02-11 09:41:09 +00:00
Brian Masney
55bf851b4a staging: iio: isl29028: change mdelay() to msleep()
This driver in some cases can busy wait for upwards of 100 ms. Since the
kernel at this point is not running in atomic context, and is running in
process context, we can safely use msleep() instead. This patch changes
the two occurrences of mdelay() to msleep().

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-02-11 09:38:21 +00:00
Derek Robson
92196732be Staging: iio: meter: meter.h - style fix
Changed file permissions to octal.
Found with checkpatch.

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-02-11 09:33:07 +00:00
Artur Lorincz
2eaf14277b iio: adc: ad7192: fixed symbolic permission references 'S_IRUGO | S_IWUSR'
Replaced the symbolic permission references S_IRUGO and S_IWUSR with their
octal counterparts.

Signed-off-by: Artur Lorincz <larturus@yahoo.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-02-05 09:19:06 +00:00
Michael S. Hansen
640fa30a70 iio: addac: adt7136: Fix style to use octal file permissions.
Signed-off-by: Michael S. Hansen <michael.schacht.hansen@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-02-05 09:14:38 +00:00
Derek Robson
6144f61af6 Staging: iio: resolver: ad2s1210.c - style fix
Changed symbolic permissions to octal permissions.
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-02-04 11:44:35 +00:00
Julián de Gortari
7f47d56c5b Staging: iio: adc: ad7816: fix symbolic permissions coding style issue
Octal permissions should be used instead of symbolic ones for easier
reading.

Signed-off-by: Julián de Gortari <kiototeko@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-28 12:22:07 +00:00
Anthony Brandon
349ee0402c drivers:staging:iio:cdc: Style fix.
Align parameters to parentheses.

Signed-off-by: Anthony Brandon <anthony@amarulasolutions.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-28 12:17:45 +00:00
Alison Schofield
10e840dfb0 iio: trigger: free trigger resource correctly
These stand-alone trigger drivers were using iio_trigger_put()
where they should have been using iio_trigger_free().  The
iio_trigger_put() adds a module_put which is bad since they
never did a module_get.

In the sysfs driver, module_get/put's are used as triggers are
added & removed. This extra module_put() occurs on an error path
in the probe routine (probably rare).

In the bfin-timer & interrupt trigger drivers, the module resources
are not explicitly managed, so it's doing a put on something that
was never get'd.  It occurs on the probe error path and on the
remove path (not so rare).

Tested with the sysfs trigger driver.
The bfin & interrupt drivers were build tested & inspected only.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-22 16:14:21 +00:00
Brian Masney
2db5054ac2 staging: iio: isl29028: add runtime power management support
This patch adds runtime power management support to the isl29028 driver.
It defaults to powering off the device after two seconds of inactivity.

isl29028_chip_init_and_power_on() currently only zeros the CONFIGURE
register on the chip, which will cause the chip to turn off. This patch
also renames that function to isl29028_clear_configure_reg() since it is
now used in several places.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-22 13:21:40 +00:00
Brian Masney
0fac96ed50 staging: iio: isl29028: only set ALS scale when ALS/IR sensing is enabled
isl29028_chip_init_and_power_on() calls isl29028_set_als_scale() and
this is not needed until the user actually needs to take a reading from
the ALS/IR sensor. This patch moves the isl29028_set_als_scale() call
from isl29028_chip_init_and_power_on() to isl29028_set_als_ir_mode().
This sets the stage for faster resume times from runtime power
management if the user is only querying the proximity sensor.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-22 13:21:39 +00:00
Brian Masney
84a76694bc staging: iio: isl29028: only set proximity sampling rate when proximity is enabled
isl29028_chip_init_and_power_on() calls isl29028_set_proxim_sampling()
and this is not needed until the user actually needs to take a proximity
reading. This patch moves the isl29028_set_proxim_sampling() call from
isl29028_chip_init_and_power_on() to isl29028_enable_proximity().
This sets the stage for faster resume times from the runtime power
management if the user is only querying the ALS/IR sensor.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-22 13:21:38 +00:00
Brian Masney
6766342441 staging: iio: isl29028: remove enable flag from isl29028_enable_proximity()
isl29028_enable_proximity() has a boolean argument named enable. This
function is only called once and the enable flag is set to true in that
call. This patch removes the enable parameter from that function.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-22 13:21:38 +00:00
Brian Masney
71a0a64346 staging: iio: isl29028: remove unnecessary parenthesis
isl29028_write_raw() contains unnecessary parenthesis when checking to
see if the passed in lux scale is valid. This patch removes the
unnecessary parenthesis.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-22 13:21:37 +00:00
Brian Masney
8c93940268 staging: iio: isl29028: remove out of memory log message
If the call to devm_iio_device_alloc() fails, then isl29028_probe()
logs a message saying that memory cannot be allocated. The user's system
most likely has larger issues at this point. This patch removes that
error message since the error code is passed on and the message is not
necessary.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-22 13:21:37 +00:00
Brian Masney
65ac716b20 staging: iio: isl29028: remove unnecessary error logging in isl29028_chip_init_and_power_on()
If the call to isl29028_chip_init_and_power_on() in isl29028_probe()
fails, then isl29028_probe() will log an error message. All of the
error paths in that call path already have error logging in place. This
patch removes the unnecessary logging.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-22 13:21:36 +00:00
Brian Masney
578e02a7ed staging: iio: isl29028: made error messages consistent
The wording and style of the different error messages was not
consistent. This patch makes the wording and style consistent
throughout the driver.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-22 13:21:35 +00:00
Brian Masney
bcf5104e27 staging: iio: isl29028: move failure logging into isl29028_set_als_scale()
When isl29028_set_als_scale() fails, it was up to both callers to log
the failure message. This patch moves the logging into
isl29028_set_als_scale() to reduce the overall amount of code in the
driver.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-22 13:21:35 +00:00
Brian Masney
ae1e5238f7 staging: iio: isl29028: move failure logging into isl29028_set_proxim_sampling()
When isl29028_set_proxim_sampling() fails, it was up to both callers to
log the failure message. This patch moves the logging into
isl29028_set_proxim_sampling() to reduce the overall amount of code in
the driver.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-22 13:21:34 +00:00
Brian Masney
19140ae904 staging: iio: isl29028: remove unused define ISL29028_DEV_ATTR
The #define ISL29028_DEV_ATTR was not used so this patch removes the
unnecessary code.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-22 13:21:33 +00:00
Brian Masney
b1dda96935 staging: iio: isl29028: change newlines to improve readability
Add and remove newlines to improve code readability in preparation for
moving the driver out of staging.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-22 13:21:33 +00:00
Brian Masney
6db2fa0ab5 staging: iio: isl29028: made alignment of variables in struct isl29028_chip consistent
The alignment of the variables in the struct isl29028_chip is not
consistent. This changes all of the variables to use consistent
alignment to improve the code readability.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-22 13:21:32 +00:00
Brian Masney
b44b1f3193 staging: iio: isl29028: combine isl29028_proxim_get() and isl29028_read_proxim()
isl29028_proxim_get() checks to see if the promixity needs to be
enabled on the chip and then calls isl29028_read_proxim(). There
are no other callers of isl29028_read_proxim(). The naming between
these two functions can be confusing so this patch combines the
two to avoid the confusion.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-22 13:21:32 +00:00
Brian Masney
c4f6092598 staging: iio: isl29028: fix alignment of function arguments
Two separate calls to regmap_update_bits() in isl29028_set_als_scale()
and isl29028_set_als_ir_mode() did not have their function arguments
on the next line aligned correctly to the open parenthesis. This patch
corrects the alignment.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-22 13:21:31 +00:00
Scott Matheina
06fc41daae staging:iio:addac:adt7316 Fixes Alignment should match open parenthesis
Fixes style issue where Alignment doesn't match open parenthesis

Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-10 19:54:57 +00:00
Jonathan Cameron
8abd5ba539 iio:kfifo_buf header include push down.
As a precursor to splitting buffer.h, lets make sure all drivers
include the relevant headers rather than relying on picking them
up from kfifo_buf.h.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2017-01-10 19:54:53 +00:00
Eva Rachel Retuya
17be2a2905 staging: iio: ad7606: replace range/range_available with corresponding scale
Eliminate the non-standard attributes in_voltage_range and
in_voltage_range_available. Implement in_voltage_scale_available in place
of these attributes and update the SCALE accordingly. The array
scale_avail is introduced to hold the available scale values.

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>
2017-01-07 12:56:05 -05:00
rishabh hardas
04e917305d iio:trigger: Fix coding style in iio-trig-bfin-timer.c by aligning parameters with opening bracket.
Fixes a warning flagged by checkpatch.pl

Signed-off-by: rishabh hardas <rishabheudyptula@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-07 11:59:55 -05:00
Scott Matheina
9a18636ebb staging:iio:adt7316: Fix braces not present on all arms of if else statement
Adds braces to second arm of if else statement.

Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-12-30 18:49:16 +00:00