linux-stable/drivers/staging/sm750fb/ddk750_chip.h
Mihaela Muraru 9872fa751e Staging: sm750fb: fix do not add new typedefs warning
This patch fixes the checkpatch.pl warning: "WARNING: do not add new
typedefs". Hiding a variables of type 'struct' is not always a good
idea,because when we passing them as parameters we tempt to forget that
in this proces we work with  stack memory and allocatting struct on
stack is something that we should manage carefuly.

It is also delete the '_t' from the name of the structs and treat a line
over 80 character issue in ddk750_mode.c, that appear after my modification.

Signed-off-by: Mihaela Muraru <mihaela.muraru21@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16 10:24:18 +02:00

77 lines
2.1 KiB
C

#ifndef DDK750_CHIP_H__
#define DDK750_CHIP_H__
#define DEFAULT_INPUT_CLOCK 14318181 /* Default reference clock */
#ifndef SM750LE_REVISION_ID
#define SM750LE_REVISION_ID ((unsigned char)0xfe)
#endif
#include <linux/io.h>
/* This is all the chips recognized by this library */
typedef enum _logical_chip_type_t {
SM_UNKNOWN,
SM718,
SM750,
SM750LE,
}
logical_chip_type_t;
typedef enum _clock_type_t {
MXCLK_PLL,
PRIMARY_PLL,
SECONDARY_PLL,
VGA0_PLL,
VGA1_PLL,
}
clock_type_t;
struct pll_value {
clock_type_t clockType;
unsigned long inputFreq; /* Input clock frequency to the PLL */
/* Use this when clockType = PANEL_PLL */
unsigned long M;
unsigned long N;
unsigned long OD;
unsigned long POD;
};
/* input struct to initChipParam() function */
struct initchip_param {
unsigned short powerMode; /* Use power mode 0 or 1 */
unsigned short chipClock; /**
* Speed of main chip clock in MHz unit
* 0 = keep the current clock setting
* Others = the new main chip clock
*/
unsigned short memClock; /**
* Speed of memory clock in MHz unit
* 0 = keep the current clock setting
* Others = the new memory clock
*/
unsigned short masterClock; /**
* Speed of master clock in MHz unit
* 0 = keep the current clock setting
* Others = the new master clock
*/
unsigned short setAllEngOff; /**
* 0 = leave all engine state untouched.
* 1 = make sure they are off: 2D, Overlay,
* video alpha, alpha, hardware cursors
*/
unsigned char resetMemory; /**
* 0 = Do not reset the memory controller
* 1 = Reset the memory controller
*/
/* More initialization parameter can be added if needed */
};
logical_chip_type_t sm750_get_chip_type(void);
unsigned int calcPllValue(unsigned int request, struct pll_value *pll);
unsigned int formatPllReg(struct pll_value *pPLL);
void ddk750_set_mmio(void __iomem *, unsigned short, char);
unsigned int ddk750_getVMSize(void);
int ddk750_initHw(struct initchip_param *);
#endif