These are generally for devlopment use only, remove these
from performance-critical code, convert to dev_dbg elswhere.
Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Group of probably overly rigorous whitespace and code cleanups.
- Alphabetize includes
- Assign to variables in the order they are defined
- Alignment issues
- Group alike statements together
- Use helper macros
Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add support for the TI family of digital potentiometers.
Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
removed several trailing whitespaces before assignment operations
Signed-off-by: Matt Ranostay <matt.ranostay@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add support for an optional regulator which, if found into device-tree,
will power on device at probing time.
The regulator is declared into ms5611 DTS entry as a "vdd-supply" property.
Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Use name of probed device instead of driver's one when registering device.
Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Computation of sens2 was wrong and is fixed by this patch, sens2 should be:
2 * (t - 2000)^2
See page 8 of ms5607 datasheet here:
http://www.meas-spec.com/product/pressure/MS5607-02BA03.aspx
Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Acked-by: Lucas De Marchi <lucas.demarchi@intel.com>
Acked-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This makes code consistent around inv_mpu6050 driver and
fixes the following checkpatch.pl warning:
CHECK: Alignment should match open parenthesis
Note that there were few cases were it was not possible to
fix this due to making the line too long, but we can live with that.
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This fixes the following checkpatch.pl warning:
WARNING: suspect code indent for conditional statements (8, 24)
+ if (kfifo_len(&st->timestamps) >
[...]
+ goto flush_fifo;
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This fixes the following checkpatch.pl warning:
ERROR: space prohibited before that ',' (ctx:WxE)
.shift = 0 ,
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Fixes the following checkpatch warning:
CHECK: Unnecessary parentheses around cpm->package.elements[i]
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This fixes the following checkpatch.pl warnings:
* WARNING: Missing a blank line after declarations
* CHECK: Blank lines aren't necessary before a close brace '}'
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This fixes the following checkpatch warning:
* WARNING: Comparisons should place the constant
on the right side of the test
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Acked-by: Crt Mori <cmo@melexis.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The preffered style for long (multi-line) comments is:
/*
* this is a multiline
* comment
*/
This also fixes checkpatch.pl warning:
WARNING: Block comments use * on subsequent lines
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Replaced i2c_smbus_read_i2c_block_data() with regmap_bulk_read()
function call. This is to make the driver code more consistent.
Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch moves hmc5843 driver from staging/iio/magnetometer
to iio/magnetometer, updates the corresponding Makefiles and
moves the hmc5843* entries to the 'Industrial I/O support ->
Magnetometer sensors' menu.
Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Cc: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add ABI file documenting hmc5843 non-standard attributes
meas_conf and meas_conf_available for bias current
configuration.
Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Cc: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Change static attribute meas_conf for bias current configuration
to channel attribute in_magn_meas_conf and also add
in_magn_meas_conf_available attribute to view available configurations.
This patch solves functionality bug: driver was using same function
hmc5843_set_measurement_configuration for setting bias current config
for all device types but the function was returning -EINVAL for any
setting >= 0x03 although, for sensor HMC5983, value 3 is valid.
API for setting bias measurement configuration:
normal - Normal measurement configuration (default):
In normal measurement configuration the device
follows normal measurement flow. Pins BP and BN
are left floating and high impedance.
positivebias - Positive bias configuration: In positive bias
configuration, a positive current is forced across
the resistive load on pins BP and BN.
negativebias - Negative bias configuration. In negative bias
configuration, a negative current is forced across
the resistive load on pins BP and BN.
disabled - Only available on HMC5983. Magnetic sensor is disabled.
Temperature sensor is enabled.
Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Cc: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
switch from using REGCACHE_FLAT to REGCACHE_RBTREE so initial hw values
are read from device. This also allows some volatile ranges to be
dropped.
Note that REGCACHE_FLAT is intended only for very low lag cases so doesn't
do nice things like read initial values from the device. Hence this change.
Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch fixes a few minor typos in the documentation comments for the
scan_type member of the iio_event_spec structure. The sign member name
was improperly capitalized as "Sign" in the comments. The storagebits
member name was improperly listed as "storage_bits" in the comments. The
endianness member entry in the comments was moved after the repeat
member entry in order to maintain consistency with the actual struct
iio_event_spec layout.
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The ms5611 driver started using the IIO_TRIGGERED_BUFFER infrastructure
which in turn depend on IIO_BUFFER, and it produces a build error now
if that is not enabled:
warning: (... && MS5611 && ...) selects IIO_TRIGGERED_BUFFER which has unmet direct dependencies (IIO && IIO_BUFFER)
buffer/industrialio-triggered-buffer.c: In function 'iio_triggered_buffer_setup':
buffer/industrialio-triggered-buffer.c:58:2: error: implicit declaration of function 'iio_device_attach_buffer' [-Werror=implicit-function-declaration]
pressure/ms5611_core.c: In function 'ms5611_trigger_handler':
pressure/ms5611_core.c:193:2: error: implicit declaration of function 'iio_push_to_buffers_with_timestamp' [-Werror=implicit-function-declaration]
This adds the second select.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 713bbb4efb ("iio: pressure: ms5611: Add triggered buffer support")
Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The newly added afe4404 driver implements suspend/resume using the
SIMPLE_DEV_PM_OPS() macro, which leaves out references to the actual
functions when CONFIG_PM is disabled, causing a harmless warning:
health/afe4404.c:509:12: error: 'afe4404_suspend' defined but not used
health/afe4404.c:530:12: error: 'afe4404_resume' defined but not used
This marks the functions as __maybe_unused so we don't get those
warnings.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 87aec56e27 ("iio: health: Add driver for the TI AFE4404 heart monitor")
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The newly added afe4403 driver implements suspend/resume using the
SIMPLE_DEV_PM_OPS() macro, which leaves out references to the actual
functions when CONFIG_PM is disabled, causing a harmless warning:
health/afe4403.c:509:12: error: 'afe4403_suspend' defined but not used
health/afe4403.c:530:12: error: 'afe4403_resume' defined but not used
This marks the functions as __maybe_unused so we don't get those
warnings.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: eec96d1e2d ("iio: health: Add driver for the TI AFE4403 heart monitor")
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The newly added afe4403 driver uses the regmap facility to abstract
the I2C and SPI access. However, it fails to ensure that regmap_spi
is actually present:
drivers/iio/built-in.o: In function `afe4403_probe':
:(.text+0x9bf8): undefined reference to `__devm_regmap_init_spi'
This adds a Kconfig select statement like the afe4404 I2C driver
has.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: eec96d1e2d ("iio: health: Add driver for the TI AFE4403 heart monitor")
Acked-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Coherent mapping guarantees that the device and CPU are in sync.
Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix comments to use trailing */ on separate lines.
Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add missing blank line after declaration of variables. Issue found by
checkpatch.
Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Improve readability by fitting all parts of the function header on the same line.
Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The return value of devm_kzalloc on failure of allocation of memory should
be -ENOMEM and not -1.
Found using Coccinelle. A simplified version of the semantic patch
used is:
//<smpl>
@@
expression *e;
@@
e = devm_kzalloc(...);
if (e == NULL) {
...
return
- -1
+ -ENOMEM
;
}
//</smpl>
The single call site does not perform any checks on the return value, hence
no change is required at the call site.
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
With concurrency managed workqueues, use of dedicated workqueues
can be replaced by using system_wq. Drop mux_rx_wq by using system_wq.
Since there is only one work item per mux_dev and different mux_devs
do not need to be ordered, increase of concurrency level by switching
to system_wq should not break anything.
cancel_work_sync() is used to ensure that work is not pending or
executing on any CPU.
Lastly, since all devices are suspended, which shutdowns the work item
before the driver can be unregistered, it is guaranteed that no work
item is pending or executing by the time exit path runs.
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Modify the nvec_write_sync function to return the error code
instead of the received message.
The received message is now returned as an output parameter.
Signed-off-by: Tomás Tormo <tomas.tormo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Support official DT bindings alongside with the deprecated ones.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Support fixed-link PHYs. This allows to remove some of the board-specific
link cvmx_helper code in the future.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Use trailing */ on a separate line when it is a block comment.
This patch fixes the last of the checkpatch warnings for the file.
Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Align arguments with the open parenthesis. Checkpatch found this issue.
Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Avoid the use of multiple blank lines. Checkpatch found this issue.
Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Avoid the use of multiple assignments in a single line. Checkpatch
found this issue.
Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove function ieee80211_wep_null from the file as is it blank and
remove its declaration from the header file.
Also remove its function call as it is of no use calling this function.
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The headers <asm/uaccess.h>,<asm/atomic.h>,<asm/atomic.h> should not be
directly included so replace them.
Warning generated by checkpatch.pl.
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch clears the checkpatch warning about suspect code indent for
conditional statements in the file.
Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch removes commented out code in the file.
Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove unnecessary braces in if...else statements where both branches have a single statement each.
Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the commented out places where macros PlatformAcquireSpinLock and
PlatformReleaseSpinLock are called as these macros are no longer used.
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The macros PlatformAcquireSpinLock and PlatformReleaseSpinLock are
not used anywhere so remove them. Used grep to find occurences.
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Since the variable ret is set at the beginning of the function and
never changes its value, we can just return the value it was set to.
Found using coccinelle with misc/returnvar.cocci.
Signed-off-by: Joseph Bisch <joseph.bisch@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
WARNING: Comparisons should place the constant on the right side of the test
Fixed this warning by placing the constant on right side.
Signed-off-by: Rakhi Sharma <rakhish1994@gmail.com>-
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
In this file,function names are otherwise used as pointers without &.
Found using coccinelle.
// <smpl>
@r@
identifier f;
@@
f(...) { ... }
@@
identifier r.f;
@@
- &f
+ f
// </smpl>
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
In this file,function names are otherwise used as pointers without &.
Found using coccinelle.
// <smpl>
@r@
identifier f;
@@
f(...) { ... }
@@
identifier r.f;
@@
- &f
+ f
// </smpl>
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
In this file,function names are otherwise used as pointers without &.
Found using coccinelle.
// <smpl>
@r@
identifier f;
@@
f(...) { ... }
@@
identifier r.f;
@@
- &f
+ f
// </smpl>
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Constants should be placed on the right hand side of comparisons. This
issue was identified by checkpatch.
Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>