This patch removes explicit NULL comparison and writes it in its
shorter form. Detected with coccinelle.
Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch removes explicit NULL comparison and replaces it with
its shorter form. Detected with coccinelle.
Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch removes explicit NULL comparison and replaces it
with its shorter form. Detected with coccinelle.
Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch checks if an error occurred on probe and stops the
device in order to avoid wasting power.
Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
New Functionality
* Watermark logic for buffers. Allows for blocking reads to block until
their requested amount is available - previously they only blocked until
a single scan of data was available. Also allows for polling for a
watermark amount of data to be available. This feature was first proposed
some time ago to good responses, but not taken further by the original author
Octavian has picked up the gauntlet and taken it through
to merging (along with the hardware fifo support that follows).
* New approach to hardware fifo handling - in particular handling the
interaction of a hardware fifo feeding into a software fifo and their
watershed events. We don't have every possible case well covered yet,
but this is certainly a good, flexible starting point. This will replace
the previous approach used in ancient drivers (sca3000) where we just
exposed the hardware buffer directly to userspace. Very few pieces of
hardware have sufficiently long buffers for that to be an adequate solution.
* bmc150_accel - hardware fifo support.
* mlx90614 - support dual IR sensor devices + some refactoring to clean up the
code and allow some other functionality currently under review.
* L3GD20H gyroscope support added to the st_gyro driver.
* lis3lv02d accelerometer added to the st_gyro driver. Note this part is
also supported by the older lis3 driver under misc. A lengthy discussion
took place and concluded that holding parts out on the basis that whole
driver would be subsumed into this one was counter productive. Better
to add part support and add additional features as people need them.
Basically there was not advantage in not merging the support.
* max517 driver gains support for MAX520 and MAX521 DACs.
Documentation
* 3.20 -> 4.0 renaming for recent docs. Whilst technically a fix, I think
people will cope until the next merge merge window.
* An ABI typo hat -> What: More ABIs should have hats.
* Document in_rot_offset, illuminance_raw and illuminance_scale.
Cleanups
* Fix a scale extraction bug in generic_buffer.c example.
* Constify a load of device tree related structures.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAABCAAGBQJVGapUAAoJEFSFNJnE9BaI6FAQAKBSW1Fl0cc4mweAfDmUnDzp
jFxKKGeIDDOBQyChjANq5zI+X8r2Bh1iy6qShfooXsOoGYNYumL2DHWPTThwEcWp
I2/qHPaKkArL9k7os+TYCG5e3y1TRCeZGgvDEcvzPGCuPMel5Y5x5gqd3e6YCc0j
59sIeyltMCIivyK+vo5gsNJoQQWzkcKdlUZ6eCFpYR8tEi23rgGTyaftd82Odncs
pJ2B98If3iaicght6ffKU716r6zI5Nfo121tiZeBAuXWyZ4lBzlJ/RBohXAUOziP
qLh0G0H3xhfo3K+Ph9tS8JOLweG8DnRJb2Sl2SE9FFyoXW1FqlgYvsstVXmkk4So
JuLJvwfTvHJWmvuy5aP4QtaR57wwxLa6vNjd1qZfb4/0f5Ugdsve5fETfyTXla6g
mhRnInuc6rwJBLEOLhPbZ8+e8CmnUB6KUuSISFTOJZA20ygbNIOdWXo17VXrGZdV
qBU2F9TX12p9D85O8Ee+AhdlUCALwWruj0ccsPIt6v/UZUcJ9TOrB06yOBBCCfqL
W9xdVj5xIGR54yLBONP9enLtNitbOogDF308I5QGEOAZUYzsrtjh9HhjN1UEcvKM
D96uNKFCLFHgfrwN+3OKfIPeRWAnznanaTJUMfBSvkT6X5dEMt72prYpl1JIFiVO
ZiWA/9hi70+Y/9bgqe1L
=kqSc
-----END PGP SIGNATURE-----
Merge tag 'iio-for-4.1b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
Second set of new devices, functionality and cleanup for IIO in the 4.1 cycle.
New Functionality
* Watermark logic for buffers. Allows for blocking reads to block until
their requested amount is available - previously they only blocked until
a single scan of data was available. Also allows for polling for a
watermark amount of data to be available. This feature was first proposed
some time ago to good responses, but not taken further by the original author
Octavian has picked up the gauntlet and taken it through
to merging (along with the hardware fifo support that follows).
* New approach to hardware fifo handling - in particular handling the
interaction of a hardware fifo feeding into a software fifo and their
watershed events. We don't have every possible case well covered yet,
but this is certainly a good, flexible starting point. This will replace
the previous approach used in ancient drivers (sca3000) where we just
exposed the hardware buffer directly to userspace. Very few pieces of
hardware have sufficiently long buffers for that to be an adequate solution.
* bmc150_accel - hardware fifo support.
* mlx90614 - support dual IR sensor devices + some refactoring to clean up the
code and allow some other functionality currently under review.
* L3GD20H gyroscope support added to the st_gyro driver.
* lis3lv02d accelerometer added to the st_gyro driver. Note this part is
also supported by the older lis3 driver under misc. A lengthy discussion
took place and concluded that holding parts out on the basis that whole
driver would be subsumed into this one was counter productive. Better
to add part support and add additional features as people need them.
Basically there was not advantage in not merging the support.
* max517 driver gains support for MAX520 and MAX521 DACs.
Documentation
* 3.20 -> 4.0 renaming for recent docs. Whilst technically a fix, I think
people will cope until the next merge merge window.
* An ABI typo hat -> What: More ABIs should have hats.
* Document in_rot_offset, illuminance_raw and illuminance_scale.
Cleanups
* Fix a scale extraction bug in generic_buffer.c example.
* Constify a load of device tree related structures.
Kernel version for new ABI in 4.0 has been documented
as 3.20, since the changes have been merged before the kernel
version number change.
Change kernel version from 3.20 to 4.0.
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The model is detected by reading the EEPROM configuration during
probing.
Signed-off-by: Vianney le Clément de Saint-Marcq <vianney.leclement@essensium.com>
Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add symbols for all accessible RAM and EEPROM registers, as well as the
sleep command and timings defined in the datasheet.
Signed-off-by: Vianney le Clément de Saint-Marcq <vianney.leclement@essensium.com>
Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
We only advertise hardware fifo support if the I2C bus supports full
I2C or smbus I2C block data reads since it is mandatory to read the
full frame in one read (otherwise the rest of the frame is discarded).
The hardware fifo is enabled only when triggers are not active because:
(a) when using the any-motion trigger the user expects to see samples
based on ROC events, but the fifo stores samples based on the sample
frequency
(b) the data-ready trigger is waking the CPU for for every sample, so
using the hardware fifo does not have any benefit
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Some devices have hardware buffers that can store a number of samples
for later consumption. Hardware usually provides interrupts to notify
the processor when the FIFO is full or when it has reached a certain
watermark level. This helps with reducing the number of interrupts to
the host processor and thus it helps decreasing the power consumption.
This patch enables usage of hardware FIFOs for IIO devices in
conjunction with software device buffers. When the hardware FIFO is
enabled the samples are stored in the hardware FIFO. The samples are
later flushed to the device software buffer when the number of entries
in the hardware FIFO reaches the hardware watermark or when a flush
operation is triggered by the user when doing a non-blocking read
on an empty software device buffer.
In order to implement hardware FIFO support the device drivers must
implement the following new operations: setting and getting the
hardware FIFO watermark level, flushing the hardware FIFO to the
software device buffer. The device must also expose information about
the hardware FIFO such it's minimum and maximum watermark and if
necessary a list of supported watermark values. Finally, the device
driver must activate the hardware FIFO when the device buffer is
enabled, if the current device settings allows it.
The software device buffer watermark is passed by the IIO core to the
device driver as a hint for the hardware FIFO watermark. The device
driver can adjust this value to allow for hardware limitations (such
as capping it to the maximum hardware watermark or adjust it to a
value that is supported by the hardware). It can also disable the
hardware watermark (and implicitly the hardware FIFO) it this value is
below the minimum hardware watermark.
Since a driver may support hardware FIFO only when not in triggered
buffer mode (due to different semantics of hardware FIFO sampling and
triggered sampling) this patch changes the IIO core code to allow
falling back to non-triggered buffered mode if no trigger is enabled.
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Currently the IIO buffer blocking read only wait until at least one
data element is available.
This patch makes the reader sleep until enough data is collected before
returning to userspace. This should limit the read() calls count when
trying to get data in batches.
Co-author: Yannick Bedhomme <yannick.bedhomme@mobile-devices.fr>
Signed-off-by: Josselin Costanzi <josselin.costanzi@mobile-devices.fr>
[rebased and remove buffer timeout]
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
It can be used exactly like L3GD20 but it has a different WhoAmI
register value.
Signed-off-by: Robert Dolca <robert.dolca@intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
When using generic_buffer to read data, the scale is not properly
detected for scale shared by type. This is caused by a problem
with the generation of generic name out of the full name.
E.g.: for current->name in_accel_z, the extracted generic name
is "in" (when it should be "in_accel"). This is used in generic_buffer
to generate scale and offset paths (in_accel_scale).
Consider the in_ or out_ prefix when extracting the generic name
from the full name.
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch adds ABI documentation entries for in_rot_offset.
At least one user for these is present that is the HID Sensors Driver.
Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
MAX520 and MAX521 are protocol-compatible with the already supported
chips, just have more channels.
Signed-off-by: Antonio Fiol <antonio@fiol.es>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
of_device_id is always used as const.
(See driver.of_match_table and open firmware functions)
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patchset adds ABI documentation for the following attributes:
in_illuminance_scale, used atleast once in al3320a staging/iio/light/
in_illuminance_calibscale, used atleast once in cm32181
in_illuminance_input, used in cm3232 at least once
in_illuminance_raw used atleast once in al3320a
in_illuminance_clear_raw and in_illuminance_ir_raw exposed by
gp2ap020a00f with modifiers IIO_MOD_LIGHT_CLEAR and
IIO_MOD_LIGHT_IR respectively.
Signed-off-by: Darshana Padmadas <darshanapadmadas@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This adds support for the LIS3LV02 accelerometer found in the
ST Microelectronics Nomadik board series.
Cc: devicetree@vger.kernel.org
Cc: Denis CIOCCA <denis.ciocca@st.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch fixes the checkpatch.pl error:
ERROR: trailing statements should be on next line
Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the checkpatch.pl error:
ERROR: space required after that ',' (ctx:VxV)
Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the checkpatch.pl warnings:
ERROR: space required before the open parenthesis '('
+ switch(divisor) {
ERROR: space required before the open parenthesis '('
+ switch(divisor) {
ERROR: space required before the open parenthesis '('
+ switch(reg) {
Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fix the checkpatch.pl warning:
ERROR: space required before the open parenthesis '('
Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the checkpatch.pl warnings:
ERROR: spaces required around that '=' (ctx:VxV)
ERROR: spaces required around that '<=' (ctx:VxV)
ERROR: spaces required around that '>' (ctx:VxV)
ERROR: space required before the open parenthesis '('
ERROR: space required after that ';' (ctx:VxV)
Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the checkpatch.pl errors:
ERROR: that open brace { should be on the previous line
ERROR: else should follow close brace '}'
WARNING: braces {} are not necessary for single statement blocks
ERROR: space required before the open brace '{'
Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
the comparison is always true as the dev_t has been initialized in the
init function and we are sending that initialized dev_t to the
cleanup().
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
the global variable majordev is no longer required, as it is not being
used anywhere.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
the dev_t was being stored in visorchipset_platform_device.dev.devt
while initializing the module. so pass that value as an argument to
cleanup() so that it can use this local variable instead of the global
variable.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
we are getting dev_t as an argument in the function, so use the local
variable instead of the global variable "majordev".
this global variable will be removed in one of the next patch of the
series.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
remove the variable "registered", which was used in the cleanup() to
detect if the driver has successfully initialized. the cleanup()
is called from module_exit, so its obvious that the module has
successfully initialized. if the initialization had failed, then
we will never be in the cleanup().
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove these flow hiding macros.
Miscellanea:
o Add a macro and function to replace a large inline
o Simplify #includes
o Add trace.c and update Makefile
o Remove static inline filename function and use kbasename instead
This reduces object size quite a lot: ~350KB (x86-64 allyesconfig)
$ size drivers/staging/rts5208/built-in.o*
text data bss dec hex filename
248385 36728 77888 363001 589f9 drivers/staging/rts5208/built-in.o.new
506691 83352 115896 705939 ac593 drivers/staging/rts5208/built-in.o.old
Done via coccinelle script and some typing.
@@
expression chip;
expression ret;
@@
- TRACE_RET(chip, ret);
+ rtsx_trace(chip);
+ return ret;
@@
expression chip;
identifier label;
@@
- TRACE_GOTO(chip, label);
+ rtsx_trace(chip);
+ goto label;
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This was generated by 'make coccicheck' using scripts at
scripts/coccinelle/api/memdup.cocci.
Signed-off-by: Niranjan Dighe <niranjan.dighe@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Create an rt_trace function using %pV to reduce overall code size.
Update the macro uses to remove unnecessary and now harmful parentheses.
Miscellanea around these changes:
o Coalesce formats
o Realign arguments
o Remove commented-out RT_TRACE uses
o Spelling fixes in formats
o Add missing newlines to formats
o Remove multiple newlines from formats
o Neaten formats where noticed
o Use %pM in one instance
Reduces code size ~20KB
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change function definition to match its prototype declaration. This
fixes the following warning generated by sparse:
drivers/staging/rtl8192u/r8192U_core.c:1970:6: warning: symbol
'rtl8192_update_ratr_table' was not declared. Should it be static?
Signed-off-by: Eddie Kovsky <ewk@edkovsky.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The function 'ieee80211_check_auth_response' is used only in this
file, so make it static. This patch fixes the following sparse
warning.
'ieee80211_check_auth_response' was not declared. Should it be static?
Signed-off-by: Cihangir Akturk <cakturk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Errors are correctly handled in oz_cdev_register() and oz_protocol_init(),
but then they are ignored in ozwpan_init().
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The condition pxmitpriv->hwxmit_entry == 5 is always false because
HWXMIT_ENTRY is always 4.
Signed-off-by: Matteo Semenzato <mattew8898@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Use the standard vsprintf kernel extension to format
mac addresses.
This reduces object code size a bit.
Miscellanea:
o Coalesce formats
o Realign arguments
o Remove the now unused MAC_FMT and MAC_ARG #defines
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fix spelling typo in comment and printk within fbtft
Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following errors by refactoring the comments'
style:
WARNING: line over 80 characters
ERROR: code indent should use tabs where possible
Signed-off-by: Cláudio Maia <crrm@isep.ipp.pt>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the following checkpatch warning:
WARNING: line over 80 characters
Signed-off-by: Cláudio Maia <crrm@isep.ipp.pt>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>