Commit graph

27 commits

Author SHA1 Message Date
Matthieu Simon c075b6f2d3 staging: sm750fb: Replace POKE32 and PEEK32 by inline functions
POKE32 and PEEK32 have been replaced by inlined functions poke32 and
peek32.
Having inline functions instead of macros help to get the correct
type-checking and avoid the possible precedence issues reported by
checkpatch.

Signed-off-by: Matthieu Simon <gmatthsim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:23:13 +01:00
Arnd Bergmann 52d0744d75 staging: sm750fb: prefix global identifiers
Renaming some symbols inside this driver caused a conflict with
an existing function, which in turn results in a link error:

drivers/staging/sm750fb/sm750fb.o: In function `enable_dma':
ddk750_hwi2c.c:(.text.enable_dma+0x0): multiple definition of `enable_dma'

This adds a sm750_ prefix to each global symbol in the sm750fb
driver that does not already have one. I manually looked for the
symbols and then converted the driver using

for i in calc_pll_value format_pll_reg set_power_mode set_current_gate    \
	enable_2d_engine enable_dma enable_gpio enable_i2c hw_set2dformat \
	hw_de_init hw_fillrect hw_copyarea hw_imageblit hw_cursor_enable  \
	hw_cursor_disable hw_cursor_setSize hw_cursor_setPos		  \
	hw_cursor_setColor hw_cursor_setData hw_cursor_setData2 ;
do
		sed -i "s:\<$i\>:sm750_$i:" drivers/staging/sm750fb/*.[ch]
done

Fixes: 03140dabf5 ("staging: sm750fb: Replace functions CamelCase naming with underscores.")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-10 13:55:03 +01:00
Elise Lennion 03140dabf5 staging: sm750fb: Replace functions CamelCase naming with underscores.
Replace CamelCase function names with underscores to comply with
the standard kernel coding style.

Signed-off-by: Elise Lennion <elise.lennion@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-30 11:13:11 -04:00
Eric S. Stone f5016082f6 staging: sm750fb: restructure multi-line comments to follow CodingStyle
Eliminates all checkpatch.pl BLOCK_COMMENT_STYLE warnings in
sm750fb, and coincidentally eliminates some line-length (80)
warnings.

Signed-off-by: Eric S. Stone <esstone@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-25 10:56:17 +02:00
Elise Lennion efe9bc08bf staging: sm750fb: Merge ddk750_help.* into ddk750_chip.*.
The file ddk750_help.c contained only one function declaration,
so it was merged into ddk750_chip.c to simplify the driver.

Also, ddk750_help.h was merged into ddk750_chip.h to keep consistency.

With these changes a few global variables are removed and the function
ddk750_set_mmio is rewritten, so its purpose in the code is clearer.

Signed-off-by: Elise Lennion <elise.lennion@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16 10:26:18 +02:00
Elizabeth Ferdman 35e4d8ca05 staging: sm750fb: conform to block comment style
Fix 2 checkpatch errors:
-Block comments use * on subsequent lines,
-Block comments use a trailing */ on a separate line
to conform to block commenting style.

Signed-off-by: Elizabeth Ferdman <gnudevliz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-02 16:51:56 +02:00
Moshe Green 06a4f429bf staging: sm750fb: rename getChipType to sm750_get_chip_type
Rename CamelCased function getChipType to sm750_get_chip_type
(prefex with sm750 in order to make the context of
the function clear).

This issue was found by checkpatch.pl

Signed-off-by: Moshe Green <mgmoshes@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-27 13:08:05 +02:00
Mike Rapoport 1282bade3b staging: sm750fb: remove dead code
Remove the code enclosed in '#if 0'

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29 15:20:35 +02:00
Mike Rapoport 9137f812e9 staging: sm750fb: ddk750_*i2c: shorten lines to under 80 characters
Fix some checkpatch warnings about long lines

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14 08:50:47 -07:00
Mike Rapoport 987f202a34 staging: sm750fb: ddk750_*i2c: remove multiple blank lines
Fix the checkpatch warning about multiple blank lines

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14 08:50:47 -07:00
Mike Rapoport fe82004489 staging: sm750fb: ddk750_swi2c: further reduce CamelCase
Rename remaining CamelCase variables

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14 08:50:47 -07:00
Mike Rapoport 53bc6b6e1a staging: sm750fb: ddk750_swi2c: rename CamelCase static variables
Rename static variables defining I2C GPIO pins and their control registers from
CamelCase.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14 08:50:47 -07:00
Mike Rapoport 6c78f4ce60 staging: sm750fb: ddk750_swi2c: rename CamelCase static functions
Fix the checkpatch warning about CamelCase.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14 08:50:47 -07:00
Mike Rapoport 01a64c4469 staging: sm750fb: ddk750_swi2c: staticize swI2C{SCL,SDA}
swI2C{SCL,SDA} are not used outside ddk750_swi2c, make them static

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14 08:50:47 -07:00
Mike Rapoport d33b42048e staging: sm750fb: rename swI2CWriteReg to sm750_sw_i2c_write_reg
Fix the checkpatch warning about CamelCase.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14 08:50:46 -07:00
Mike Rapoport 288836b69f staging: sm750fb: rename swI2CReadReg to sm750_sw_i2c_read_reg
Fix the checkpatch warning about CamelCase.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14 08:50:46 -07:00
Mike Rapoport f2ea7733dd staging: sm750fb: rename swI2CInit to sm750_sw_i2c_init
Fix the checkpatch warning about CamelCase.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14 08:50:46 -07:00
Isaac Assegai 6bdee8bddd Staging: sm750fb: ddk750_swi2c.c: Insert spaces before parenthesis
Insert spaces before open parenthesis in ddk750_swi2c.c
to rectify the following checkpatch errors:
ERROR: space required before the open parenthesis '('

Signed-off-by: Isaac Assegai <isaac.a.travers@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-18 22:10:02 -07:00
Isaac Assegai d3f431d0ff Staging: sm750fb: ddk750_swi2c.c: Place braces on correct lines
Place braces on correct lines in ddk750_swi2c.c
to rectify the following checkpatch errors:
ERROR: that open brace { should be on the previous line

Signed-off-by: Isaac Assegai <isaac.a.travers@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-18 22:10:02 -07:00
Isaac Assegai 6d43b0f482 Staging: sm750fb: ddk750_swi2c.c: Insert spaces around operators
Insert spaces around comparison operators in ddk750_swi2c.c
to rectify the following set of checkpatch errors:
ERROR: spaces required around that '='
ERROR: spaces required around that '<'
ERROR: spaces required around that '>='

Signed-off-by: Isaac Assegai <isaac.a.travers@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-18 22:10:02 -07:00
Isaac Assegai 7ef803a92d Staging: sm750fb: ddk750_swi2c.c: Replace spaces with tabs
Replace spaces with tabs in ddk750_swi2c.c to
rectify the following checkpatch warnings:
WARNING: please, no spaces at the start of a line

Signed-off-by: Isaac Assegai <isaac.a.travers@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-18 22:10:02 -07:00
Isaac Assegai f31b55ac2a Staging: sm750fb: Insert spaces after commas in two files.
Insert Spaces after commas to rectify the following
checkpatch errors in ddk750_power.c and ddk750_swi2c.c:
ERROR: space required after that ','

Signed-off-by: Isaac Assegai <isaac.a.travers@gmail.com>:
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:26:31 -07:00
Ricardo Ribalda Delgado 6a9df4303b staging/sm75fb: Declare static functions as such
This patch fixes this sparse warning

CHECK   drivers/staging/sm750fb/ddk750_swi2c.c
drivers/staging/sm750fb/ddk750_swi2c.c:223:6: warning: symbol
  'swI2CStart' was not declared. Should it be static?
drivers/staging/sm750fb/ddk750_swi2c.c:234:6: warning: symbol
  'swI2CStop' was not declared. Should it be static?
drivers/staging/sm750fb/ddk750_swi2c.c:252:6: warning: symbol
  'swI2CWriteByte' was not declared. Should it be static?
drivers/staging/sm750fb/ddk750_swi2c.c:320:15: warning: symbol
  'swI2CReadByte' was not declared. Should it be static?
drivers/staging/sm750fb/ddk750_swi2c.c:361:6: warning: symbol
  'swI2CInit_SM750LE' was not declared. Should it be static?

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 14:00:54 +01:00
Supriya Karanth 6946edd07a staging: sm750fb: remove parantheses from return statements
found by checkpatch.pl :ERROR: return is not a function,
parentheses are not required

changes made using coccinelle script:

@@
expression e,e1;
@@
(
return (e / e1);
|
return
-(
e
-)
;
)

Signed-off-by: Supriya Karanth <iskaranth@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15 18:41:15 +01:00
Sudip Mukherjee 4933b29bd4 staging: sm750fb: remove unused functions
removed the functions which were not used anywhere.
it has been build tested also confirmed with git grep that there is
no other reference of these functions.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-10 21:08:06 +01:00
Sudip Mukherjee c97df7c2c0 staging: sm750fb: remove pragma optimize
remove use of #pragma optimize which will usually be ignored by the
compiler.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-10 16:02:35 +01:00
Sudip Mukherjee 81dee67e21 staging: sm750fb: add sm750 to staging
sm750 of Silicon Motion is pci-e display controller device and has
features like dual display and 2D acceleration. This patch adds the
driver to staging.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 16:37:31 -08:00