Age | Commit message (Collapse) | Author | Files | Lines |
|
Add support for STMicroelectronics STM32 DAC. It's a 12-bit, voltage
output digital-to-analog converter. It has two output channels, each
with its own converter.
It supports 8 bits or 12bits left/right aligned data format. Only
12bits right-aligned is used here. It has built-in noise or
triangle waveform generator, and supports external triggers for
conversions.
Each channel can be used independently, with separate trigger, then
separate IIO devices are used to handle this. Core driver is intended
to share common resources such as clock, reset, reference voltage and
registers.
Signed-off-by: Fabrice Gasnier <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
|
|
Document STMicroelectronics STM32 DAC (digital-to-analog converter).
Signed-off-by: Fabrice Gasnier <[email protected]>
Acked-by: Rob Herring <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
|
|
Fixed a brace coding style issue.
Signed-off-by: René Hickersberger <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
|
|
Simplify st_lsm6dsx_of_get_drdy_pin routine since of_property_read_u32
error conditions are already managed in st_lsm6dsx_get_drdy_reg()
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
|
|
This fixes the coding style issue of using (S_IWUSR | S_IRUGO) in place of
4-digit octal numbers.
Signed-off-by: Chen Guanqiao <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
|
|
This device operates in DIRECT_MODE and BUFFER_HARDWARE mode.
Replace usages of iio_dev->mlock with iio_device_{claim|release}_direct_mode()
helper functions to guarantee DIRECT mode and consequently protect
BUFFER mode too.
Add and use a device private lock to protect against conflicting access of the
state data.
This helps with IIO subsystem redefining iio_dev->mlock to be used by
the IIO core only for protecting device operating mode changes.
ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes.
Protect changing of attributes inside ad5933_store(). Attributes
can no longer be changed while in buffered mode.
Remove lock from ad5933_work() because buffer mode should be enabled
when we reach this, and claiming DIRECT mode in all the other places
should protect it.
Signed-off-by: Narcisa Ana Maria Vasile <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
|
|
This adds max1117/max1118/max1119 8-bit, dual-channel ADC driver.
This new driver uses the zero length spi_transfers with the cs_change
flag set and/or the non-zero delay_usecs.
1. The zero length transfer with the spi_transfer.cs_change set is
required in order to select CH1. The chip select line must be brought
high and low again without transfer.
2. The zero length transfer with the spi_transfer.delay_usecs > 0 is
required for waiting the conversion to be complete. The conversion
begins with the falling edge of the chip select. During the conversion
process, SCLK is ignored.
These two usages are unusual. But the spi controller drivers that use
a default implementation of transfer_one_message() are likely to work.
(I've tested this adc driver with spi-omap2-mcspi and spi-xilinx)
On the other hand, some spi controller drivers that have their own
transfer_one_message() may not work. But at least for the zero length
transfer with delay_usecs > 0, I'm proposing a new testcase for the
spi-loopback-test that can test whether the delay_usecs setting has
taken effect.
Acked-by: Rob Herring <[email protected]>
Signed-off-by: Akinobu Mita <[email protected]>
Cc: Jonathan Cameron <[email protected]>
Cc: Hartmut Knaack <[email protected]>
Cc: Lars-Peter Clausen <[email protected]>
Cc: Peter Meerwald-Stadler <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Mark Brown <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
|
|
Removing use of deprecated macros(S_IRUGO, S_IWUSR, S_IXUGO), and replace
with 4 digit octal.
Signed-off-by: Chen Guanqiao <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
|
|
Device counting could be controlled by the level or the edges of
a trigger.
in_count0_enable_mode attibute allow to set the control mode.
Signed-off-by: Benjamin Gaignard <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
|
|
One of the features of STM32 trigger hardware block is a quadrature
encoder that can counts up/down depending of the levels and edges
of the selected external pins.
This patch allow to read/write the counter, get it direction,
set/get quadrature modes and get scale factor.
When counting up preset value is the limit of the counter.
When counting down the counter start from preset value down to 0.
This preset value could be set/get by using
/sys/bus/iio/devices/iio:deviceX/in_count0_preset attribute.
Signed-off-by: Benjamin Gaignard <[email protected]>
Reviewed-by: William Breathitt Gray <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
|
|
AS3935_WRITE_DATA macro bit is incorrect and the actual write
sequence is two leading zeros.
Cc: George McCollister <[email protected]>
Signed-off-by: Matt Ranostay <[email protected]>
Cc: <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
|
|
realbits, storagebits and shift should be numbers, not ASCII characters.
Signed-off-by: Pavel Roskin <[email protected]>
Reviewed-by: Lars-Peter Clausen <[email protected]>
Cc: <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
|
|
Driver SDIO private data structure description includes a spin_lock
that is never used. This data structure only contains a pointer to the
sdio_func and a pointer to the main device private data. A spin_lock
is not required here.
Remove unused spin_lock.
Signed-off-by: Tobin C. Harding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Driver SDIO header describes a structure that is never used. It can be
safely removed.
Remove unused structure description.
Signed-off-by: Tobin C. Harding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Driver SDIO code allocates memory for a buffer that is never used. It
can be safely removed.
Remove unused buffer, including allocation and freeing of memory.
Signed-off-by: Tobin C. Harding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Driver SDIO code initializes a completion that is never used. It can
be safely removed.
Remove unused completion.
Signed-off-by: Tobin C. Harding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
char array cmd is being scanned in using a %4s scanf format
specifier and so cmd must be an array of 5 chars. Increase size
to 5 chars to ensure we don't have an overflow.
Detected with static analysis by cppcheck:
"(error) Width 4 given in format string (no. 1) is larger than
destination buffer 'cmd[4]', use %3s to prevent overflowing it."
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
lustre_cfg_new() returns error pointers and never NULL.
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
in memset()
Removed extra space before comma in memset() as a part of
checkpatch.pl fix-up.
Signed-off-by: Valerio Genovese <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
In combination with CONFIG_PROFILE_ANNOTATED_BRANCHES=y, the unlikely()
inside of the WARN() macro becomes too complex for gcc to see that
we don't use the output arguments of mt9m114_to_res() are used
correctly:
drivers/staging/media/atomisp/i2c/mt9m114.c: In function 'mt9m114_get_fmt':
drivers/staging/media/atomisp/i2c/mt9m114.c:817:13: error: 'height' may be used uninitialized in this function [-Werror=maybe-uninitialized]
int width, height;
^~~~~~
drivers/staging/media/atomisp/i2c/mt9m114.c: In function 'mt9m114_s_exposure_selection':
drivers/staging/media/atomisp/i2c/mt9m114.c:1179:13: error: 'height' may be used uninitialized in this function [-Werror=maybe-uninitialized]
Without WARN_ON(), there is no problem, so by simply replacing it with
v4l2_err(), the warnings go away. The WARN() output is also not needed
here, as we'd probably catch the problem before even getting here,
and other checks for the same condition already use v4l2_err.
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
UDS is another layer which actually boils down to some trivial assignments so
remove it so inline the code.
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
These are not used in the driver so can go away.
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
This is a whole pile of code that wraps a single assignment. Remove it and
put the assignment in the caller. Once we have the kernels sorted we should
revisit these and remove all the pointless 1 item structs that go with it.
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
This isn't used so it can go in the bitbucket.
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The base hmm MMU code doesn't support contiguous allocations (they BUG), so
remove support from them from the higher levels of the heirarchy.
We still need to unwind all these layers but it turns out that some of the init
order stuff is rather sensitive and the simple cleanup breaks everything
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Where we know the buffer size is reasonably constrained we can just use kmalloc,
and where it will be large vmalloc. This still leaves a pile in the middle.
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
We have one hard coded set of behaviour so unpick the indirection and function
pointers. This isn't the whole story. A lot of the callers are known sizes and
use cases so we can switch them directly to kmalloc later on.
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
We are not using these for debugging or debug logging so remove the defines,
trim and rename the functions.
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
They can be replaced by kmalloc. There are a few that do need to pick kmalloc
or vmalloc. Those we leave for the moment.
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
__get_asd_from_port()
The line which is initializing mipi_info variable is too long
to read. It would be placed in next line.
Signed-off-by: Daeseok Youn <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The address of isp->asd[i] is already assigned to
local "asd" variable. "&isp->asd[i]" would be replaced with
just "asd".
Signed-off-by: Daeseok Youn <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Enable/Disable ISP irq is switched with "enable" parameter of
enable_isp_irq(). It would be better splited to two such as
enable_isp_irq()/disable_isp_irq().
But the enable_isp_irq() is no use in atomisp_cmd.c file.
So remove the enable_isp_irq() function and add
disable_isp_irq function only.
Signed-off-by: Daeseok Youn <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
trivial fix to spelling mistake in dev_err error message
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Define new local variable to reduce the number of reference.
The new local variable is added to save the addess of dfs
and used in atomisp_freq_scaling() function.
Signed-off-by: Daeseok Youn <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Function uses an if statement within a for loop to guard a block of
code. If 'if' statement conditional evaluates to false, loop breaks. The
same logic can be expressed by inverting the conditional and breaking
when new conditional evaluates to true. This allows the subsequent code
to be indented one level less, aiding readability. Reduced indentation
also allows for the code to be laid out more clearly and fixes two
checkpatch warnings.
Invert if statement conditional, break from for loop if new
conditional evaluates to true. Reduce indentation in subsequent code,
fix whitespace issues. Do not change program logic.
Signed-off-by: Tobin C. Harding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Function uses multi-way decision for control flow. Final statement of
function is spin_unlock(). Code can be simplified by adding a goto label
labelling the call to spin_unlock() and jumping to label instead of
using multi-way decision. This allows the code to be indented one
level less which adds to the readability.
Add goto label. Remove multi-way decision by jumping to label. Reduce
indentation in subsequent code. Do not change program logic.
Signed-off-by: Tobin C. Harding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Macro CHECK_ALINE is defined and never used.
Remove unused macro.
Signed-off-by: Tobin C. Harding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Checkpatch emits WARNING: Avoid multiple line dereference.
Fix up layout of function call, move dereference to single line.
Signed-off-by: Tobin C. Harding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Checkpatch emits multiple CHECK: Logical continuations should be on the
previous line.
Move logical continuations to the end of the previous line.
Signed-off-by: Tobin C. Harding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Kernel networking code predominately uses the identifier 'skb' for a struct
sk_buff pointer. Of 8088 instances of 'struct sk_buff *' within
net/ 6670 are named 'skb'. Following the principle of least surprise,
new networking code should use the identifier 'skb' for variables of
type 'struct sk_buff *'.
Rename identifier 'packet' to 'skb'.
Signed-off-by: Tobin C. Harding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Driver uses custom Michael MIC implementation. There is already an
implementation within the kernel. There is at least one other driver
already using the kernel implementation
(drivers/net/wireless/intersil/orinoco).
Add task to TODO file.
Signed-off-by: Tobin C. Harding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Identifier uses camel case, standard kernel style does not use camel
case.
Rename buffer 'RecvMIC' to 'recv_mic'.
Signed-off-by: Tobin C. Harding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Checkpatch emits WARNING: else is not generally useful after a break
or return. Two warnings of this type are emitted for this code block,
in both cases 'else' statements are unnecessary.
Remove unnecessary 'else' statements, reduce indentation in subsequent
code.
Signed-off-by: Tobin C. Harding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Checkpatch emits CHECK: Alignment should match open parenthesis.
Align argument to open parenthesis.
Signed-off-by: Tobin C. Harding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Function contains a local pointer variable defined to a memory location
within a structure. This memory location is later used by
dereferencing the struct instead of using the local pointer. The code
is cleaner if all references of the same memory location use the
local variable.
Utilize existing local pointer variable instead of dereferencing
struct.
Signed-off-by: Tobin C. Harding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Function uses overly complex calls to memcpy(). Code may be simplified
by the use of a local variable. Code sometimes uses explicit address
of initial array element and sometimes does not. Uniformity aids
readability. If array pointers are explicit it aids readability further.
Simplify calls to memcpy(). Add local pointer variable, define it to
the correct memory location. Use newly defined variable in calls to
memcpy(). Be uniform in use of explicit address of first element of
array (&foo[0]).
Signed-off-by: Tobin C. Harding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Function parameter is cast to a local pointer which is then
dereferenced before it is checked to be non-NULL.
Move pointer null check to be before the pointer is dereferenced.
Signed-off-by: Tobin C. Harding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Multi-way decision contains two anomalies.
Firstly, a local variable is defined to be the inverse truth variable
of a struct member. This local variable is used as the conditional to
the multi-way decision. This is unnecessary, the same logic can be
expressed using the struct member directly.
Secondly, there are four branches in the multi-way decision, two of
which can never be executed. This is dead code.
Remove unnecessary local variable. Remove two branches of multi-way
decision statement that can never be executed.
Signed-off-by: Tobin C. Harding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Function contains compound statement delineated by lone braces. This
statement represents a discreet set of functionality and thus can be
factored out into a separate function. Using a separate function
instead of a compound statement increases readability, reduces code
indentation, reduces function length, and generally looks more tidy.
Factor compound statement out to separate function.
Signed-off-by: Tobin C. Harding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Function has duplicate code clean up sequences; identical function
call followed by return. This would be better expressed with the use
of a goto statement, as is typical in-tree.
One call site places the clean up code within the 'else' branch of an
multi-way decision. This can be more clearly expressed by inverting
the initial decision conditional and jumping directly to the cleanup
code. Subsequent code indentation can then be reduced, aiding
readability.
Fix function return code execution path. Move clean up code to end of
function with a label. Replace duplicate clean up code within function
with a jump to label. Invert conditional, jump to label if new
conditional evaluates to true, reduce indentation in subsequent code.
Signed-off-by: Tobin C. Harding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|