Modify the code indentations to fix the checkpatch issues.
Signed-off-by: Christophe Colin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Sparse spits out a warning that a __be16 was being assigned to a u16.
Change the type of txbuf16 to __be16 b/c it's a restricted type and
prevents mixing endianness.
Signed-off-by: Alex Wilson <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This patch replaces bit shifting on 1 with the BIT(x) macro.
This was done with coccinelle:
@@
constant c;
@@
-1 << c
+BIT(c)
Signed-off-by: Arushi Singhal <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Use a single string literal as the fmt argument passed to dev_err()
instead of multiple string literals split with an embedded backslash
character.
Signed-off-by: Alexander Kapshuk <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The default implementation of write_register keeps DC low for the first
byte only. SH1106 requires DC to be low for all bytes of a multi-byte
command. To deal with this limitation we currently use a separate call
to write_reg for each single command byte what is not really efficient.
Therefore override the default implementation of write_register with an
own one which keeps DC low for all bytes.
Signed-off-by: Heiner Kallweit <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
There are drivers like fb_sh1106 which allocate a txbuf less than 1 KiB.
In this case the message would include "0 KiB buffer memory" what
doesn't make sense and in general I doubt that there is any benefit in
informing the user about allocation of a very small buffer.
Therefore omit this message part if the buffer has less than 1 KiB.
Signed-off-by: Heiner Kallweit <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This patch adds support for the SH1106 OLED controller chip.
It's similar to the SSD1306, however it supports only a subset of
commands and the internal video memory has a different width.
Major differences:
- Internal video memory has a width of 132 pixels
- Only a subset of commands is supported
- Only page addressing mode is supported, no support for vertical and
horizontal addressing
- SPI frequency limited to 2 MHz according to the datasheet
Successfully tested with a 1.3" OLED display with this chip and
SPI interface.
Signed-off-by: Heiner Kallweit <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Merged two if conditionals into a single one, since they had exactly
the same condition.
Signed-off-by: Narcisa Ana Maria Vasile <[email protected]>
Acked-by: Julia Lawall <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This allows making some of the actual arrays const.
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Running make C=1 M=drivers/staging/fbtft reports warnings about conversion
from __be16 to unsigned short. Change the type of the variables being
assigned into __be16 to remove those warnings.
Signed-off-by: Anthony Brandon <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
__be16 type variables should be used with return value of macro
cpu_to_be16()
Signed-off-by: Julián de Gortari <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Remove blank line before closing brace to fix the checkpatch
issue blank lines aren't necessary before a close brace '}'.
Signed-off-by: Gargi Sharma <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Indent code to match alignment with open parentheses, to
fix the checkpatch issue alignment should match open parenthesis.
Signed-off-by: Gargi Sharma <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Return value of strlcpy() is not checked. Name string is silently
truncated if longer that SPI_NAME_SIZE, whilst not detrimental to
the program logic it would be nice to notify the user. Module is
currently quite verbose, adding extra pr_warn() calls will not overly
impact this verbosity.
Check return value from call to strlcpy(). If source string is
truncated call pr_warn() to notify user.
Signed-off-by: Tobin C. Harding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Current call to strncmp() uses a magic number. There is a compile
time constant defined for this buffer, included and used already at
other sites in the file.
Remove magic number. Replace with pre-existing compile time constant.
Signed-off-by: Tobin C. Harding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Module copies a user supplied string (module parameter) into a buffer
using strncpy() and does not check that the buffer is null terminated.
Replace call to strncpy() with call to strlcpy() ensuring that the
buffer is null terminated.
Signed-off-by: Tobin C. Harding <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fix the following formatting issues:
CHECK: Alignment should match open parenthesis
Signed-off-by: Umang Raghuvanshi <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Having a local variable of 1024 bytes on 64-bit architectures is a bit
too much, and I ran into this warning while trying to see what functions
use the largest stack:
drivers/staging/fbtft/fbtft-sysfs.c: In function 'store_gamma_curve':
drivers/staging/fbtft/fbtft-sysfs.c:132:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=]
As there is no need for 64-bit gamma values (on 32-bit architectures,
we don't use those either), I'm changing the type from 'unsigned long'
to 'u32' here, which cuts the required space in half everywhere.
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fix the following formatting issues:
CHECK: Alignment should match open parenthesis
Signed-off-by: Umang Raghuvanshi <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fix the following errors:
Use 4 digit octal (0777) not decimal permissions
Signed-off-by: Abdul Rauf <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
There are multiple entries for ili9225 display defined in
flexfb_chip_table array. remove duplicate entries and
keep single entry.
Signed-off-by: Amitesh Singh <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Refactor write_vmem() for sake of readability.
While here, fix indentation in one comment.
Acked-by: Noralf Trønnes <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
There is 64x48 display exists. In order to support that set multiplexer
to 48 pixels and window address to proper position in the graphic display
data RAM.
Acked-by: Noralf Trønnes <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
There is no need to duplicate what SPI core already does, i.e. mapping buffers
for DMA capable transfers.
Remove all related pices of code.
Note, that code, besides its redundancy, was buggy: DMA address potentially can
be 0, SPI slave device has nothing to do with DMA capable device properties and
DMA mask in particular.
Suggested-by: Noralf Trønnes <[email protected]>
Acked-by: Noralf Trønnes <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
First of all, fbtft in current state doesn't allow to override GPIOs to be
optional, like "reset" one. It might be a bug somewhere, but rather out of
scope of this fix.
Second, not all GPIOs available on the board would be SoC based, some of them
might sit on I2C GPIO expanders, for example, on Intel Edison/Arduino, and thus
any communication with them might sleep.
Besides that using udelay() and mdelay() is kinda resource wasteful.
Summarize all of the above, convert fbtft_reset() function to non-atomic
variant by using gpio_set_value_cansleep(), usleep_range(), and msleep().
Reviewed-by: Noralf Trønnes <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
These changes where identified by checkpatch.pl as needed changes to
align the code with the linux development coding style. The several
lines of text where aligned with the precending parenthesis.
Signed-off-by: Scott Matheina <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This patch fixes the following checkpatch.pl warning
WARNING: line over 80 characters
Signed-off-by: Maninder Singh <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
ERROR: Use 4 digit octal (0777) not decimal permissions
This error was detected by checkpatch.pl
Signed-off-by: Nadim Almas <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.
Export the module alias information using the MODULE_DEVICE_TABLE() macro.
Before this patch:
$ modinfo drivers/staging/fbtft/flexfb.ko | grep alias
$
After this patch:
$ modinfo drivers/staging/fbtft/flexfb.ko | grep alias
alias: platform:flexpfb
Signed-off-by: Javier Martinez Canillas <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This is a patch to the fb_agm1264k-fl.c file that fixes up the following
issue:
WARNING: Too many leading tabs - consider code refactoring
Add new function iterate_diffusion_matrix() to refactor a piece of code
inside write_vmem().
Signed-off-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
These arrays use -1, -2, and -3 as initiators for various types of
writes to initialize hardware.
No values are used that conflict with using these arrays as s16
instead of int and reducing overall data is good.
$ size drivers/staging/fbtft/built-in.o*
text data bss dec hex filename
116120 32872 4152 153144 25638 drivers/staging/fbtft/built-in.o.new
116104 36344 6200 158648 26bb8 drivers/staging/fbtft/built-in.o.old
Miscellaneous:
o Realign some of the arrays to make reading a bit easier
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This patch resolves all the following CHECKs caught by checkpatch.pl
CHECK: Alignment should match open parenthesis
Signed-off-by: Harman Kalra <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Commit 367e8560e8 introduced a bug
in fbtft-core where fps is always 0, this is because variable
update_time is not assigned correctly.
Signed-off-by: Ksenija Stanojevic <[email protected]>
Fixes: 367e8560e8 ("Staging: fbtbt: Replace timespec with ktime_t")
Cc: stable <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fixed the following checkpatch warnings (task #10 of eudyptula challenge):
- NULL comparison rewritten to use '!' operator
Signed-off-by: Carlos Palminha <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Use !x instead of x == NULL. This patch was found by checkpatch.
Signed-off-by: Sandhya Bankar <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
add spaces around << to fix the checkpatch issue, spaces preferred
around that '<<'.
Signed-off-by: Gargi Sharma <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Move && up to the previous line, to fix the checkpatch issue Logical
continuations should be on the previous line.
Signed-off-by: Gargi Sharma <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fix checkpatch.pl warning:
Block comments use * on subsequent lines
Block comments use a trailing */ on a separate line
Signed-off-by: Anson Jacob <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fix checkpatch.pl warning:
Block comments use * on subsequent lines
Block comments use a trailing */ on a separate line
Signed-off-by: Anson Jacob <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fix checkpatch.pl warning:
Block comments use * on subsequent lines
Block comments use a trailing */ on a separate line
Signed-off-by: Anson Jacob <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>