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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Change permissions to octal style.
Found using checkpatch
Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Changed file permissions to octal.
Found with checkpatch.
Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>