Commit graph

65 commits

Author SHA1 Message Date
Colin Ian King
f0e00da2db staging: sm750fb: initialize max_d to maximum D value of 6
max_d is not initialized and should be set to the largest D
value of 6.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-29 14:41:15 -07:00
Mike Rapoport
603dd4932e staging: sm750fb: move MHz() and roundedDiv() close to their usage
The MHz() and roundedDiv macros are used only by ddk750_chip.c, so move
their definition there.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:33:00 -08:00
Mike Rapoport
e074da3f80 staging: sm750fb: replace absDiff with kernel standard abs macro
<linux/kernel.h> already has 'abs', use it instead of custom absDiff

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:33:00 -08:00
Mike Rapoport
0f23be7050 staging: sm750fb: use BIT macro for DMA_ABORT_INTERRUPT single-bit fields
Replace complex definition of DMA_ABORT_INTERRUPT register fields with
BIT() macro and use open-coded implementation for register manipulation

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 19:52:37 -08:00
Mike Rapoport
6fba39cf32 staging: sm750fb: use BIT macro for PANEL_DISPLAY_CTRL single-bit fields
Replace complex definition of PANEL_DISPLAY_CTRL register fields with BIT()
macro and use open-coded implementation for register manipulations.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 19:52:37 -08:00
Mike Rapoport
85e4db5347 staging: sm750fb: share common bits in display control registers
The display control registers for primary and secondary display share some
of the bits and those bits can be defined in a single place and then used
for manipulations of the relevant registers.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 19:52:37 -08:00
Mike Rapoport
d97981431f staging: sm750fb: use BIT macro for VGA_CONFIGURATION single-bit fields
Replace complex defintion of VGA_CONFIGURATION register fields with BIT()
macro and use open-coded implementation for VGA_CONFIGURATION
manipulations.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 19:52:37 -08:00
Mike Rapoport
cdd5df644a staging: sm750fb: change defintion of PANEL_PLL_CTRL multi-bit fields
Use more straight-forward definitions for multi-bit field of
PANEL_PLL_CTRL register and use open-coded implementation for register
manipulations.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 19:52:37 -08:00
Mike Rapoport
5557eb17b3 staging: sm750fb: use BIT macro for PLL_CTRL single-bit fields
Replace complex defintion of PLL_CTRL fields with BIT() macro and use
open-coded implementation for PLL register manipulations.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 19:52:37 -08:00
Mike Rapoport
54feb93153 staging: sm750fb: rename PANEL_PLL_CTRL_* fields to PLL_CTRL_*
Several PLL control registers have the same layout and therefore the
field definitions may be shared for those registers. Renaming
definitions of PANEL_PLL_CTRL_* fields to more generic PLL_CTRL_* will
allow reusing these definitions for other PLL control registers.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 19:52:37 -08:00
Mike Rapoport
0c4d85fc7f staging: sm750fb: formatPllReg: fix comment formatting
Fix comment alignment and formatting to follow kernel coding style

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 19:52:37 -08:00
Mike Rapoport
375b4d427e staging: sm750fb: formatPllReg: rename ulPllReg to reg
Remove HungarianCamelCase notation

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 19:52:37 -08:00
Mike Rapoport
05e9d9ea44 staging: sm750fb: use BIT macro for MODE0_GATE single-bit fields
Replace complex definition of MODE0_GATE register fields with BIT() macro
and use open-coded implementation for register manipulations.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:51:36 -08:00
Mike Rapoport
6e8aa4a136 staging: sm750fb: change definition of CURRENT_GATE multi-bit fields
Use more straight-forward definitions for multi-bit fields of
CURRENT_GATE register and use open-coded implementation for register
manipulation.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:51:36 -08:00
Mike Rapoport
19aa211387 staging: sm750fb: set{Memory, Master}Clock: rename ulReg to reg
Remove HungarianCamelCase notation

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:51:36 -08:00
Mike Rapoport
90946e5293 staging: sm750fb: use BIT macro for CURRENT_GATE single-bit fields
Replace complex definition of CURRENT_GATE register fields with BIT() macro
and use open-coded implementation for register manipulations.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:51:36 -08:00
Mike Rapoport
5538d5c8bd staging: sm750fb: change definition of MISC_CTRL multi-bit fields
Use more straight-forward definitions for multi-bit fields of MISC_CTRL
register and use open-coded implementation for register manipulations.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:51:36 -08:00
Mike Rapoport
5372350be3 staging: sm750fb: use BIT macro for MISC_CTRL single-bit fields
Replace complex definition of MISC_CTRL register fields with BIT() macro
and use open-coded implementation for register manipulations.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:51:36 -08:00
Mike Rapoport
8bc728cf01 staging: sm750fb: ddk750_initHw: rename ulReg to reg
Remove HungarianCamelCase notation

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:51:36 -08:00
Mike Rapoport
7a81b9477a staging: sm750fb: remove unused pllcalparam typedef
The pllcalparam type is not used and can be removed.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:03:28 -07:00
Mike Rapoport
a61dc139ce staging: sm750fb: simplify PLL divisors calculations
The calcPllValues currently uses arrays of PLL parametres that contain
possible PLL control register field values and redundant data that is
calculated according to those values. The usage of these arrays can be
replaced with simple arithmetics.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:03:28 -07:00
Mike Rapoport
cfac7d6a70 staging: sm750fb: remove '#if 1' conditionals
The code enclosed in '#if 1' anyway gets compiled. Removing useless
conditionals.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:02:42 -07:00
Mike Rapoport
b02f9240e0 staging: sm750fb: remove some unnecessary castings
The clock divisor calculations in setMasterClock and setMemoryClock
unnecessaryly cast unsigned int to unsigned int. Removing the casting.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:05:40 -07:00
Mike Rapoport
7092d76f14 staging: sm750fb: rename getChipClock to get_mxclk_freq
The getChipClock is used to detect MXCLK frequency. Make it's name
reflect what the function is actually doing.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:05:40 -07:00
Mike Rapoport
7751e0e2d2 staging: sm750fb: merge calcPLL and getPllValue into getChipClock
The getChipClock function is used only to get MXCLK frequency, which
makes most of getPllValue function unused and thus. The detection of
MXCLK frequency may be implemented directly in getChipClock rendering
getPllValue and calcPLL unused.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:05:40 -07:00
Amitoj Kaur Chawla
43ce0b538a staging: sm750fb: Rename miniDiff
Rename miniDiff to mini_diff to avoid CamelCase. Problem found using
checkpatch.pl
CHECK: Avoid CamelCase: <miniDiff>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 20:33:51 -07:00
Amitoj Kaur Chawla
a76f23d66d staging: sm750fb: Remove space after opening brace
Remove space after opening brace '{'. Problem found using
checkpatch.pl
CHECK: Blank lines aren't necessary after an open brace '{'

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 20:32:07 -07:00
Amitoj Kaur Chawla
2a66a986b4 staging: sm750fb: Remove space before closing brace
Remove space before closing brace '}'. Problem found using
checkpatch.pl
CHECK: Blank lines aren't necessary before a close brace '}'

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 20:32:07 -07:00
Amitoj Kaur Chawla
a0fd4b57ba staging: sm750fb: Remove space after cast
Remove unnecessary space after cast. Problem found using checkpatch.pl
CHECK: No space is necessary after a cast

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 20:32:07 -07:00
Shraddha Barke
80fb74c387 Staging: sm750fb: Use ARRAY_SIZE macro
ARRAY_SIZE is more concise to use when the size of an array is divided
by the size of its first element.

Changes made using Coccinelle-

@@
type T;
T[] E;
@@

- (sizeof(E)/sizeof(E[...]))
+ ARRAY_SIZE(E)

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 20:32:07 -07:00
Amitoj Kaur Chawla
0ce5fdb14b staging: sm750fb: Remove multiple blank lines
Remove multiple blank lines. Problem found using checkpatch.pl
CHECK: Please don't use multiple blank lines

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08 09:50:08 +01:00
Amitoj Kaur Chawla
07387cba81 staging: sm750fb: Add space around ':'
Add space around operator ':'. Problem found using
checkpatch.pl
CHECK: spaces preferred around that ':' (ctx:VxV)

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08 09:43:18 +01:00
Amitoj Kaur Chawla
31418e3701 staging: sm750fb: Add space around '?'
Add space around operator '?'. Problem found using
checkpatch.pl
CHECK: spaces preferred around that '?' (ctx:VxV)

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08 09:43:18 +01:00
Amitoj Kaur Chawla
f40917ea0b staging: sm750fb: Add space around '*'
Add space around operator '*'. Problem found using
checkpatch.pl
CHECK: spaces preferred around that '*' (ctx:VxV)

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08 09:43:18 +01:00
Amitoj Kaur Chawla
c18c331193 staging: sm750fb: Add space around '/'
Add space around operator '/'. Problem found using
checkpatch.pl
CHECK: spaces preferred around that '/' (ctx:VxV)

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08 09:43:18 +01:00
Mike Rapoport
55a6cf5d4b staging: sm750fb: remove unused calcPllValue2 function
The calcPllValue2 function is never called and therefore it can be
removed.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-30 12:26:20 +02:00
Mike Rapoport
fb6f37a8c8 staging: sm750fb: staticize local functions in ddk750_chip
Several functions in ddk750_chip are not used elsewhere, let's make them
static.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-30 12:26:20 +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
174f264234 staging: sm750fb: replace twoToPowerOfx with shift operator
The function twoToPowerOfx that iteratively calculates the power of 2
may be replaced with shift operator

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29 04:16:31 +02:00
Mike Rapoport
4cf26d859a staging: sm750fb: replace custom MB(x) macro with appropriate SZ_xM
Use SZ_xM defined in linux/sizes.h instead of custom MB(x) macro

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29 04:16:30 +02:00
Juston Li
40403c1b13 staging: sm750fb: add missing blank line after declarations
Fixes checkpatch.pl
WARNING: Missing a blank line after declarations

Signed-off-by: Juston Li <juston.h.li@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 22:52:53 -07:00
Juston Li
0d5e63c462 staging: sm750fb: add spaces around operators
Fixes checkpath.pl error:
ERROR: spaces required around that operator

Note running checkpatch.pl with '--strict' catches more
of these errors along with cases where spacing is optional
but preferred. Take care of these in a future patch.

Signed-off-by: Juston Li <juston.h.li@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 22:52:52 -07:00
Juston Li
6ab5b6d16b staging: sm750fb: consistent spacing around operators
Fixes checkpatch.pl error:
ERROR: need consistent spacing around operator

Signed-off-by: Juston Li <juston.h.li@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 22:52:52 -07:00
Juston Li
8332d94c97 staging: sm750fb: remove space before close parenthesis
Fixes checkpatch.pl error:
ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Juston Li <juston.h.li@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 22:52:00 -07:00
Juston Li
7f0ebcc290 staging: sm750fb: remove spacing after open parenthesis
Fixes checkpatch.pl warning:
ERROR: space prohibited after that open parenthesis '('

Signed-off-by: Juston Li <juston.h.li@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 22:51:59 -07:00
Greg Donald
eb0f4271ca drivers: staging: sm750fb: Fix "'foo * bar' should be 'foo *bar'" errors
Fix checkpatch.pl "'foo * bar' should be 'foo *bar'" errors

Signed-off-by: Greg Donald <gdonald@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-18 21:07:07 -07:00
Juston Li
5ee35ea775 staging: sm750fb: fix c99 comments
fixed all checkpatch.pl ERROR: do not use C99 // comments

Any C99 comments used to comment out code are simply removed.
Also some of the errors occur inside '#if 0' blocks which I
might as well fix since checkpatch.pl caught them but the blocks
themselves should probably be cleaned up later.

Changes since v1: close a comment block

Signed-off-by: Juston Li <juston.h.li@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12 17:20:33 -07:00
Isaac Assegai
63de0eb0bc Staging: sm750fb: Replace spaces with tabs at the start of lines
Replace spaces at the start of lines with tabs to rectify
the following warning:
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-05-31 12:04:35 +09:00
Amitoj Kaur Chawla
31296ba5c0 Staging: sm750fb: Remove space after parenthesis
Fixed error by removing space after open parenthesis '('
Problem found using checkpatch.pl
ERROR: space prohibited after that open parenthesis '('

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:23:59 +02:00
Greg Kroah-Hartman
97498bb576 Revert "Staging: sm750fb: Fix C99 Comments"
This reverts commit 6ad6b5ed3e.

It added a file that should not be in the kernel source tree.

Cc: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-04 12:00:25 +02:00