aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-04-14iio: dac: add support for stm32 DACFabrice Gasnier5-0/+582
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]>
2017-04-14dt-bindings: iio: stm32-dac: Add support for STM32 DACFabrice Gasnier1-0/+61
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]>
2017-04-14Staging: iio: accel: adis16203: fixed a brace coding style issueRené Hickersberger?=1-2/+1
Fixed a brace coding style issue. Signed-off-by: René Hickersberger <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2017-04-14iio: imu: st_lsm6dsx: simplify data ready pin parsingLorenzo Bianconi1-9/+1
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]>
2017-04-14iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO, S_IWUSR)Chen Guanqiao1-2/+2
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]>
2017-04-14staging: iio: ad5933: Protect DIRECT mode using claim/release helpersNarcisa Ana Maria Vasile1-22/+28
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]>
2017-04-14iio: adc: add max1117/max1118/max1119 ADC driverAkinobu Mita4-0/+341
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]>
2017-04-14iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO, S_IWUSR, S_IXUGO)Chen Guanqiao1-10/+10
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]>
2017-04-14iio: stm32 trigger: Add counter enable modesBenjamin Gaignard2-0/+95
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]>
2017-04-14iio: stm32 trigger: Add quadrature encoder deviceBenjamin Gaignard3-10/+282
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]>
2017-04-14iio: proximity: as3935: fix as3935_writeMatt Ranostay1-2/+1
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]>
2017-04-14iio: dac: ad7303: fix channel descriptionPavel Roskin1-3/+3
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]>
2017-04-14staging: ks7010: remove unused spin_lockTobin C. Harding2-2/+0
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]>
2017-04-14staging: ks7010: remove unused structure descriptionTobin C. Harding1-6/+0
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]>
2017-04-14staging: ks7010: remove unused read_bufTobin C. Harding2-12/+3
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]>
2017-04-14staging: ks7010: remove unused completionTobin C. Harding2-2/+0
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]>
2017-04-14staging: rtl8723bs: ensure cmd is large enough for %4s scanf formatColin Ian King1-1/+1
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]>
2017-04-14staging: lustre: checking for NULL instead if IS_ERRDan Carpenter1-2/+2
lustre_cfg_new() returns error pointers and never NULL. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-04-14staging: media: atomisp: i2c: removed unnecessary white space before comma ↵Valerio Genovese1-1/+1
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]>
2017-04-14staging: atomisp: avoid false-positive maybe-uninitialized warningArnd Bergmann1-8/+8
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]>
2017-04-14atomisp: remove UDS kernel codeAlan Cox7-85/+23
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]>
2017-04-14atomisp: remove xnr3_0_5 and xnr3_0_11Alan Cox9-596/+0
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]>
2017-04-14atomisp: remove fixedbds kernel codeAlan Cox6-100/+19
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]>
2017-04-14atomisp: remove satm kernelAlan Cox5-122/+0
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]>
2017-04-14atomisp: remove contiguous handlingAlan Cox4-61/+15
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]>
2017-04-14atomisp: remove sh_css_malloc indirections where we canAlan Cox4-65/+72
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]>
2017-04-14atomisp: remove indirection from sh_css_mallocAlan Cox3-49/+25
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]>
2017-04-14atomisp: unwrap the _ex malloc/free functionsAlan Cox2-25/+7
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]>
2017-04-14atomisp: remove most of the uses of atomisp_kernel_mallocAlan Cox4-32/+28
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]>
2017-04-14staging: atomisp: move mipi_info assignment to next line in ↵Daeseok Youn1-3/+5
__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]>
2017-04-14staging: atomisp: replace "&isp->asd[i]" with "asd" in __get_asd_from_port()Daeseok Youn1-2/+2
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]>
2017-04-14staging: atomisp: remove enable_isp_irq function and add disable_isp_irqDaeseok Youn1-27/+9
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]>
2017-04-14staging/atomisp: fix spelling mistake: "falied" -> "failed"Colin Ian King1-1/+1
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]>
2017-04-14staging: atomisp: use local variable to reduce number of referencesDaeseok Youn1-17/+20
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]>
2017-04-11staging: ks7010: move check and break to top of loopTobin C. Harding1-20/+14
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]>
2017-04-11staging: ks7010: remove multi-way decisionTobin C. Harding1-23/+25
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]>
2017-04-11staging: ks7010: remove unused macroTobin C. Harding1-2/+0
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]>
2017-04-11staging: ks7010: fix checkpatch MULTILINE_DEREFERENCETobin C. Harding1-5/+7
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]>
2017-04-11staging: ks7010: fix checkpatch LOGICAL_CONTINUATIONSTobin C. Harding1-30/+28
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]>
2017-04-11staging: ks7010: rename identifier packet to skbTobin C. Harding2-22/+22
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]>
2017-04-11staging: ks7010: add task to TODO fileTobin C. Harding1-0/+2
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]>
2017-04-11staging: ks7010: rename RecvMIC to recv_micTobin C. Harding1-3/+3
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]>
2017-04-11staging: ks7010: fix checkpatch UNNECESSARY_ELSETobin C. Harding1-16/+15
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]>
2017-04-11staging: ks7010: fix checkpatch PARENTHESIS_ALIGNMENTTobin C. Harding1-1/+1
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]>
2017-04-11staging: ks7010: utilize local variableTobin C. Harding1-4/+4
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]>
2017-04-11staging: ks7010: simplify calls to memcpy()Tobin C. Harding1-19/+12
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]>
2017-04-11staging: ks7010: move null check before dereferenceTobin C. Harding1-3/+2
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]>
2017-04-11staging: ks7010: fix multi-way decisionTobin C. Harding1-12/+2
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]>
2017-04-11staging: ks7010: factor out send stop requestTobin C. Harding1-20/+32
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]>
2017-04-11staging: ks7010: fix function return code pathTobin C. Harding1-18/+15
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]>