Commit graph

357 commits

Author SHA1 Message Date
Eva Rachel Retuya 6504b9bdf6 staging: sm750fb: convert pr_err() to dev_err()
Replace pr_err() calls with respective dev_err() counterpart.
Change is safe since pdev is not NULL, this was identified by hand.
Semantic patch used to detect and apply the transformation:

@r exists@
identifier f,s,i;
position p;
@@

f(...,struct s *i,...) {
  <+...
  pr_err@p(...)
  ...+>
}

@s@
identifier r.s, dev;
@@

struct s {
	...
	struct device dev;
	...
};

@t@
identifier r.i, s.dev;
expression fmt;
position r.p;
@@

- pr_err@p(
+ dev_err(&i->dev,
			fmt, ...);

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhaktipriya Shridhar fcf59a7c61 staging: sm750fb: Remove Unused macro
The macro PEEK32 is used nowhere in the file. Hence,removed.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Amitoj Kaur Chawla 13b79a0d88 staging: sm750fb: Use pcim_enable_device()
Devm_ functions allocate memory that is released when a driver
detaches.
Replace pci_enable_device with the managed pcim_enable_device
and remove corresponding pci_disable_device from probe and
suspend functions of a pci_dev.

Also, an unnecessary label has been removed by replacing it
with a direct return statement.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Amitoj Kaur Chawla 677c507211 staging: sm750fb: Replace kzalloc with devm_kzalloc
Devm_ functions allocate memory that is released when a driver
detaches.
Replace kzalloc with devm_kzalloc and remove corresponding
kfrees from probe and remove functions of a pci_dev.

Also, an unnecessary label has been removed by replacing it
with a direct return statement.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Amitoj Kaur Chawla fad2564eaa staging: sm750fb: Remove unnecessary pci_set_drvdata()
Unnecessary pci_set_drvdata() has been removed since the driver
core clears the driver data to NULL after device release or on
probe failure. There is no need to manually clear the device
driver data to NULL.

The Coccinelle semantic patch used to make this change is as follows:
//<smpl>
@@
struct pci_dev *pci;
@@
- pci_set_drvdata(pci, NULL);
//</smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Amitoj Kaur Chawla 732053a0a0 staging: sm750fb: Remove parentheses from return arguments
Remove unnecessary parentheses from return arguments.

The Coccinelle semantic patch that makes this change is as follows:

// <smpl>
@@
identifier i;
constant c;
@@

return
- (
    \(i\|-i\|i(...)\|c\)
- )
  ;
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Amitoj Kaur Chawla 16fdf7d5bd staging: sm750fb: Remove header files
Remove duplicate include files. Found using includecheck.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-22 12:03:22 -08:00
Mike Rapoport 779494492e staging: sm750fb: remove sm750_help.h
This header only contains unused FIELD_*() macros and friends and may be
removed

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 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 0d5d733b4a staging: sm750: change definition of multi-bit register fields
Use stratigh-forward of multi-bit register fields

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 10dfcb0644 staging: sm750fb: use BIT() macro for single-bit fields definition
Replace complex definition of single-bit fields with BIT() macro for the
registers that are not currently referenced by the driver.

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 7ea833df30 staging: sm750fb: change definition of CRT_FB_ADDRESS fields
Use stratight-forward definition of CRT_FB_ADDRESS register fields
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-15 18:26:17 -08:00
Mike Rapoport d6a4cba73c staging: sm750fb: change definition of CRT_FB_WIDTH fields
Use stratight-forward definition of CRT_FB_WIDTH register fields
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-15 18:26:17 -08:00
Mike Rapoport 8bac9c84cc staging: sm750fb: change definition of DE_WINDOW_WIDTH fields
Use stratight-forward definition of DE_WINDOW_WIDTH register fields
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-15 18:26:17 -08:00
Mike Rapoport f7a61fde48 staging: sm750fb: change definition of DE_STRETCH_FORMAT fields
Use stratight-forward definition of DE_STRETCH_FORMAT register fields
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-15 18:26:17 -08:00
Mike Rapoport 7124080feb staging: sm750fb: change definition of DE_PITCH fields
Use stratight-forward definition of DE_PITCH register fields
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-15 18:26:17 -08:00
Mike Rapoport e2e2258774 staging: sm750fb: change definition of DE_CONTROL fields
Use stratight-forward definition of DE_CONTROL register fields
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-15 18:26:17 -08:00
Mike Rapoport 0fab34b5a1 staging: sm750fb: change definition of DE_DIMENSION fields
Use stratight-forward definition of DE_DIMENSION register fields
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-15 18:26:17 -08:00
Mike Rapoport aeaab18678 staging: sm750fb: change definition of DE_DESTINATION fields
Use stratight-forward definition of DE_DESTINATION register fields
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-15 18:26:17 -08:00
Mike Rapoport cf6d8f0bd4 staging: sm750fb: change definition of DE_SOURCE fields
Use stratight-forward definition of DE_SOURCE register fields
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-15 18:26:17 -08:00
Mike Rapoport 6aa178eeda staging: sm750fb: change definition of HWC_COLOR_{12, 3} fields
Use straight-forward definition of HWC_COLOR_{12,3} register fields instead
of magic numbers

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-15 18:26:17 -08:00
Mike Rapoport fe3bd267a4 staging: sm750fb: change definition of HWC_LOCATION fields
Use BIT() macro for single-bit fields of HWC_LOCATION register and
define HWC_LOCATION_{X,Y}_MASK for masking the address bits.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-15 18:26:17 -08:00
Mike Rapoport 672f75b0b3 staging: sm750fb: change definition of HWC_ADDRESS fields
Use BIT() macro for single-bit fields of HWC_ADDRESS register and
define HWC_ADDRESS_ADDRESS_MASK for masking the address bits.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-15 18:26:17 -08:00
Mike Rapoport 8ffe46109b staging: sm750fb: change definition of PANEL_VERTICAL_SYNC fields
Use stratight-forward definition of PANEL_VERTICAL_SYNC register fields
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-15 18:26:17 -08:00
Mike Rapoport 6014a31dd6 staging: sm750fb: change definition of PANEL_VERTICAL_TOTAL fields
Use stratight-forward definition of PANEL_VERTICAL_TOTAL register fields
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-15 18:26:17 -08:00
Mike Rapoport a6f17bc44d staging: sm750fb: change definition of PANEL_HORIZONTAL_SYNC fields
Use stratight-forward definition of PANEL_HORIZONTAL_SYNC register fields
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-15 18:26:17 -08:00
Mike Rapoport 620c391258 staging: sm750fb: change definition of CRT_VERTICAL_SYNC fields
Use stratight-forward definition of CRT_VERTICAL_SYNC register fields
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-15 18:26:17 -08:00
Mike Rapoport 3d5158d3e3 staging: sm750fb: change definition of CRT_VERTICAL_TOTAL fields
Use stratight-forward definition of CRT_VERTICAL_TOTAL register fields
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-15 18:26:17 -08:00
Mike Rapoport 1adb3c2338 staging: sm750fb: change definition of CRT_HORIZONTAL_SYNC fields
Use stratight-forward definition of CRT_HORIZONTAL_SYNC register fields
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-15 18:26:17 -08:00
Mike Rapoport 32849f85e6 staging: sm750fb: change definition of CRT_HORIZONTAL_TOTAL fields
Use stratight-forward definition of CRT_HORIZONTAL_TOTAL register fields
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-15 18:26:17 -08:00
Mike Rapoport aed4b787b0 staging: sm750fb: change definition of CRT_AUTO_CENTERING_BR fields
Use stratight-forward definition of CRT_AUTO_CENTERING_BR register fields
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-15 18:26:17 -08:00
Mike Rapoport 85943dae29 staging: sm750fb: change definition of CRT_AUTO_CENTERING_TL fields
Use stratight-forward definition of CRT_AUTO_CENTERING_TL register fields

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-15 18:26:17 -08:00
Amitoj Kaur Chawla a1883f3f5a staging: sm750fb: Remove inclusion of header file
version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-15 18:26:17 -08:00
Janani Ravichandran da6985f599 staging: sm750fb: Fix indentation of if...else statements
This patch clears the checkpatch warning about suspect code indent for
conditional statements in the file.

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:49:09 -08:00
Janani Ravichandran 60c0bdcb09 staging: sm750fb: Eliminate commented out code
This patch removes commented out code in the file.

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:49:09 -08:00
Janani Ravichandran a597523832 staging: sm750fb: Remove unneeded braces in if...else statements
Remove unnecessary braces in if...else statements where both branches have a single statement each.

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:49:09 -08:00
Mike Rapoport 60112069a9 staging: sm750fb: change definition of PANEL_HORIZONTAL_TOTAL fields
Use stratight-forward defintion of PANEL_HORIZONTAL_TOTAL register fields
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 3e155b8134 staging: sm750fb: use BIT macro for I2C_STATUS fields
Replace complex definition of I2C_STATUS 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 b71413e0d5 staging: sm750fb: use BIT macro for I2C_CTRL fields
Replace complex definition of I2C_CTRL 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 cdce1f1877 staging: sm750fb: change definition of CRT_DISPLAY_CTRL multi-bit fields
Use more straight-forward definitions for multi-bit fields of
CRT_DISPLAY_CTRL 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-11 19:52:37 -08:00
Mike Rapoport d8264edf44 staging: sm750fb: use BIT macro for CRT_DISPLAY_CTRL single-bit fields
Replace complex definition of CRT_DISPLAY_CTRL 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 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 27b047bbe1 staging: sm750fb: change definition of PANEL_PLANE_BR fields
Use stratight-forward defintion of PANEL_PLANE_BR register fields 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 30ca5cb63c staging: sm750fb: change definition of PANEL_PLANE_TL fields
Use stratight-forward defintion of PANEL_PLANE_TL register fields

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 f91969f773 staging: sm750fb: change definition of PANEL_WINDOW_HEIGHT fields
Use stratight-forward defintion of PANEL_WINDOW_HEIGHT register fields 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 4c221d82cf staging: sm750fb: change definition of PANEL_WINDOW_WIDTH fields
Use stratight-forward defintion of PANEL_WINDOW_WIDTH register fields 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 26a3cc907c staging: sm750fb: change definition of PANEL_FB_WIDTH fields
Use stratight-forward defintion of PANEL_FB_WIDTH register fields 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 4463690afc staging: sm750fb: change definition of PANEL_FB_ADDRESS fields
Use BIT() macro for single-bit fields of PANEL_FB_ADDRESS register and
define PANEL_FB_ADDRESS_ADDRESS_MASK for masking the address bits.

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 c4e893b7cc staging: sm750fb: change definition of PANEL_DISPLAY_CTRL multi-bit fields
Use more straight-forward definitions for multi-bit fields of
PANEL_DISPLAY_CTRL 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-11 19:52:37 -08:00
Mike Rapoport f5d7f1905f staging: sm750fb: remove PANEL_DISPLAY_CTRL_TFT_DISP defines
The PANEL_DISPLAY_CTRL_TFT_DISP definitions artificially encode
PANEL_DISPLAY_CTRL_DUAL_DISPLAY and PANEL_DISPLAY_CTRL_DOUBLE_PIXEL bits
combinations. Replace the PANEL_DISPLAY_CTRL_TFT_DISP usage with direct use
of the bits defined in the datasheet.

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 5b621779c2 staging: sm750fb: hw_sm750_setBLANK: reduce printk verbosity
pr_debug would be enough

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 b117b637da staging: sm750fb: refactor setDisplayControl function
The enable/disbable sequence in setDisplayControl function is duplicated
for primary and secondary display controllers. The function can be
refactored so that the common part of register access will be shared for
both controllers.

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 9bd2c86b5a staging: sm750fb: merge reserved bits of PANEL/CRT_DISPLAY_CTRL registers
Use single mask for reserved bits in PANEL_DISPLAY_CTRL and
CRT_DISPLAY_CTRL 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 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 7755265a99 staging: sm750fb: setDisplayControl: rename local vairables
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 c436e6ba7e staging: sm750fb: programModeRegisters: rename local vairables
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 e6f10d2814 staging: sm750fb: change definition of VGA_CONFIGURATION multi-bit field
Use more straight-forward definitions for multi-bit field of
VGA_CONFIGURATION register.

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 cf25a70436 staging: sm750fb: drop redundant defines for PLL_CTRL fields
The PLL_CTRL fields have common defines for several PLL control
registers and re-defining the same values per register is not needed.

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 79254c60db staging: sm750fb: use PLL_CTRL_POWER defines for CRT_PLL_CTRL
Use PLL_CTRL_POWER definitions for CRT_PLL_CTRL register access

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
Matej Vasek fbb8c96357 staging: sm750fb, fix typos
The code contained typos like "structur", "fointers", etc. Fix that.

No code change, only comments.

Signed-off-by: Matej Vasek <xvasek1@fi.muni.cz>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Teddy Wang <teddy.wang@siliconmotion.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: <linux-fbdev@vger.kernel.org>
Cc: <devel@driverdev.osuosl.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:53:35 -08:00
Bogicevic Sasa fe7185908a drivers:staging:sm750fb Fix all space preferred around messages
This fixes all messages from checkpatch.pl about space preferred

Signed-off-by: Bogicevic Sasa <brutallesale@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:52:31 -08:00
Othmar Pasteka 04c73f2896 staging: sm750fb: fix style for if clause
Fix for checkpatch.pl complaints:
ERROR: that open brace { should be on the previous line
CHECK: spaces preferred around that '+' (ctx:VxV)

Signed-off-by: Othmar Pasteka <pasteka@kabsi.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:52:31 -08:00
Mike Rapoport f41b17fc3f staging: sm750fb: change definition of POWER_MODE_CTRL multi-bit field
Use more straight-forward definitions for multi-bit field of
POWER_MODE_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 776980cf0f staging: sm750fb: use BIT macro for POWER_MODE_CTRL single-bit fields
Replace complex definition of POWER_MODE_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 a941245109 staging: sm750fb: change definition of MODE0_GATE multi-bit fields
Use more straight-forward definitions for multi-bit fields of MODE0_GATE
register.

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 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 2a5149e0a2 staging: sm750fb: use BIT macro for GPIO_MUX single-bit fields
Replace complex definition of GPIO_MUX 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 9a357143bc staging: sm750fb: ddk750_sii164: fix defines for i2c{Read, Write}reg
For case when USE_HW_I2C is not defined, i2c{Read,Write}reg was wrongly
defined to use old function names.

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 a8856ff88e staging: sm750fb: change definition of SYSTEM_CTRL multi-bit fields
Use more straight-forward definitions for multi-bit fields of
SYSTEM_CTRL register and replace FIELD_GET/SET for these fields with
open-coded implementation.

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 410c756d41 staging: sm750fb: use BIT macro for SYSTEM_CTRL single-bit fields
Replace complex definition of SYSTEM_CTRL fields and usage of
FIELD_GET/SET with BIT() macro and open-coded register value modifications

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 1c3ad30688 staging: sm750fb: remove unused DE_STATE2_DE_RESERVED
Definition of reserved fields in a register is not interesting

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 ae6061dbfc staging: sm750fb: use BIT macro for DE_STATE2 single-bit fields
Replace complex definition of DE_STATE1 fields and usage of FIELD_GET
with BIT() macro and open-coded register value modifications

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 c808d6ce4a staging: sm750fb: use BIT macro for DE_STATE1 single-bit field
Replace complex definition of DE_STATE1 field and usage of FIELD_SET with
BIT() macro and open-coded register value modifications

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 9eced7438d staging: sm750fb: hw_sm750(le)_deWait: rename dwVal to val
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 61da1a12d8 staging: sm750fb: lynxfb_pci_probe: remove some pr_info
Several pr_info statements in lynxfb_pci_probe seem like debug leftovers
and may be removed.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:50:53 -08:00
Mike Rapoport a50bc32d32 staging: sm750fb: introduce sm750fb_frambuffer_alloc
Split framebuffer allocation and registration into a dedicated function
to simplify lynxfb_pci_probe

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:50:53 -08:00
Mike Rapoport 9324f9193b staging: sm750fb: introduce sm750fb_frambuffer_release
Use a function to unregister framebuffer info and release its resources.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:50:53 -08:00
Mike Rapoport a3f92cc94c staging: sm750fb: replace dual member of sm750_dev with fb_count
Will be used in futher refactoring of driver _probe and _remove methods.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:50:53 -08:00
Mike Rapoport 473baa2df6 staging: sm750fb: lynxfb_pci_remove: remove unused variable
The par variable in lynxfb_pci_remove is only assigned a value and never
used afterwards. Remove it.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:50:53 -08:00
Mike Rapoport baf24530a4 staging: sm750fb: lynxfb_pci_probe: return actual errors
The lynxfb_pci_probe always returned -ENODEV in case of error. Modify it
so that actual error code will be propogated to the caller.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:50:53 -08:00
Mike Rapoport 0fbc7c5056 staging: sm750fb: disable PCI device if lynxfb_pci_probe fails
In case of error during lynxfb_pci_probe, the function returned without
calling pci_disable_device. Fix it by adding pci_disable_device on the
error cleanup path.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:50:53 -08:00
Shraddha Barke cdfeaae5b3 Staging: sm750fb: Remove unused modedb.h file
The header file modedb.h is only included in sm750.c but the things
defined by modedb.h are not used anywhere in sm750.c. Thus, drop
the include in sm750.c and modedb.h can be dropped completely.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Acked-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Mike Rapoport af28398d31 staging: sm750fb: remove unused fields from struct sm750_dev
The {x,y}LCD fields of struct sm750_dev are 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-27 17:04:57 +09:00
Mike Rapoport 823e034c0f staging: sm750fb: remove '#ifdef CAP_EXP*' conditionals
There are several occurencies of '#ifdef CAP_EXP<something>', spelled
differently each time. None of these is ever defined and therefore they
enclose dead code that can be removed.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 17:04:57 +09:00
Mike Rapoport e359b6a863 staging: sm750fb: merge lynx_share into sm750_dev
Both struct lynx_share and struct sm750_dev reprsent some parts of the
SM750 graphics adapter. There is no point to keep these parts in
different structures.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 17:04:57 +09:00
Mike Rapoport 8ac97f19df staging: sm750fb: remove unused field in lynx_cursor
The lynx_share field in lynx_cursor structure is never 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-27 17:04:57 +09:00