staging: sm750fb: fix improper typedef usage
PATCH 1/1 staging: sm750fb: fix improper typedef usage
Fix typedef usage which does not comply with kernel style guidelines.
--- drivers/staging/sm750fb/ddk750_chip.c | 31 ++++++++++++++-------------- drivers/staging/sm750fb/ddk750_chip.h | 35 ++++++++++++++------------------ drivers/staging/sm750fb/ddk750_display.c | 2 +- drivers/staging/sm750fb/ddk750_display.h | 12 +++++------ drivers/staging/sm750fb/ddk750_dvi.c | 12 +++++------ drivers/staging/sm750fb/ddk750_dvi.h | 4 ++-- drivers/staging/sm750fb/ddk750_mode.c | 10 +++++---- drivers/staging/sm750fb/ddk750_mode.h | 18 ++++++++-------- drivers/staging/sm750fb/ddk750_power.c | 2 +- drivers/staging/sm750fb/ddk750_power.h | 7 +++---- drivers/staging/sm750fb/ddk750_sii164.c | 2 +- drivers/staging/sm750fb/ddk750_sii164.h | 4 ++-- drivers/staging/sm750fb/sm750_hw.c | 8 ++++---- 13 files changed, 69 insertions(+), 78 deletions(-)
drivers/staging/sm750fb/ddk750_chip.c +15 -16
@@ -2,20 +2,19 @@#include "ddk750_reg.h" #include "ddk750_chip.h" #include "ddk750_power.h" -typedef struct _pllcalparam { +struct pllcalparam {unsigned char power;/* d : 0~ 6*/ unsigned char pod;unsigned char od;unsigned char value;/* value of 2 power d (2^d) */ -} -pllcalparam ; +}; -logical_chip_type_t getChipType (void ) +enum logical_chip_type_t getChipType (void ) {unsigned short physicalID;char physicalRev; -logical_chip_type_t chip; +enum logical_chip_type_t chip; physicalID = devId750;/* either 0x718 or 0x750 */ physicalRev = revId750;
@@ -44,12 +43,12 @@ inline unsigned int twoToPowerOfx(unsigned long x)return result; } -inline unsigned int calcPLL (pll_value_t *pPLL) +inline unsigned int calcPLL (struct pll_value_t *pPLL) {return (pPLL->inputFreq * pPLL->M / pPLL->N /twoToPowerOfx (pPLL->OD) /twoToPowerOfx (pPLL->POD)); } -unsigned int getPllValue (clock_type_t clockType,pll_value_t *pPLL) +unsigned int getPllValue (enum clock_type_t clockType,struct pll_value_t *pPLL) {unsigned int ulPllReg =0 ;
@@ -85,7 +84,7 @@ unsigned int getPllValue(clock_type_t clockType, pll_value_t *pPLL)unsigned int getChipClock (void ) { -pll_value_t pll; +struct pll_value_t pll;#if 1 if (getChipType () =SM750LE )return MHz (130 );
@@ -102,7 +101,7 @@ unsigned int getChipClock(void)*/ void setChipClock (unsigned int frequency) { -pll_value_t pll; +struct pll_value_t pll;unsigned int ulActualMxClk;#if 1 /* Cheok_0509: For SM750LE, the chip clock is fixed. Nothing to set. */
@@ -252,7 +251,7 @@ unsigned int ddk750_getVMSize(void) } -int ddk750_initHw (initchip_param_t *pInitParam) +int ddk750_initHw (struct initchip_param_t *pInitParam) {unsigned int ulReg;
@@ -405,10 +404,10 @@ unsigned int absDiff(unsigned int a, unsigned int b)M = {1,...,255} N = {2,...,15} */ -unsigned int calcPllValue (unsigned int request_orig,pll_value_t *pll) +unsigned int calcPllValue (unsigned int request_orig,struct pll_value_t *pll) {/* used for primary and secondary channel pixel clock pll */ -static pllcalparam xparm_PIXEL[] = { +static struct pllcalparam xparm_PIXEL[] = {/* 2^0 = 1*/ {0 ,0 ,0 ,1 },/* 2^ 1 =2*/ {1 ,0 ,1 ,2 },/* 2^ 2 = 4*/ {2 ,0 ,2 ,4 },
@@ -419,7 +418,7 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll) };/* used for MXCLK (chip clock) */ -static pllcalparam xparm_MXCLK[] = { +static struct pllcalparam xparm_MXCLK[] = {/* 2^0 = 1*/ {0 ,0 ,0 ,1 },/* 2^ 1 =2*/ {1 ,0 ,1 ,2 },/* 2^ 2 = 4*/ {2 ,0 ,2 ,4 },
@@ -433,7 +432,7 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll)unsigned int RN , quo, rem, fl_quo;unsigned int input, request;unsigned int tmpClock, ret; -pllcalparam *xparm; +struct pllcalparam *xparm;#if 1 if (getChipType () =SM750LE ) {
@@ -492,7 +491,7 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll)unsigned int calcPllValue2 (unsigned int ulRequestClk,/* Required pixel clock in Hz unit */ -pll_value_t *pPLL/* Structure to hold the value to be set in PLL */ +struct pll_value_t *pPLL/* Structure to hold the value to be set in PLL */ ) {unsigned int M ,N ,OD ,POD =0 , diff, pllClk, odPower, podPower;
@@ -590,7 +589,7 @@ pll_value_t *pPLL /* Structure to hold the value to be set in PLL */ -unsigned int formatPllReg (pll_value_t *pPLL) +unsigned int formatPllReg (struct pll_value_t *pPLL) {unsigned int ulPllReg =0 ;
drivers/staging/sm750fb/ddk750_chip.h +15 -20
@@ -8,29 +8,26 @@#include <linux/io.h> /* This is all the chips recognized by this library */ -typedef enum _logical_chip_type_t +enum logical_chip_type_t {SM_UNKNOWN ,SM718 ,SM750 ,SM750LE , -} -logical_chip_type_t ; +}; - -typedef enum _clock_type_t +enum clock_type_t {MXCLK_PLL ,PRIMARY_PLL ,SECONDARY_PLL ,VGA0_PLL ,VGA1_PLL , -} -clock_type_t ; +}; -typedef struct _pll_value_t +struct pll_value_t { - clock_type_t clockType; +enum clock_type_t clockType;unsigned long inputFreq;/* Input clock frequency to the PLL */ /* Use this when clockType = PANEL_PLL */
@@ -38,11 +35,10 @@ typedef struct _pll_value_tunsigned long N ;unsigned long OD ;unsigned long POD ; -} -pll_value_t; +};/* input struct to initChipParam() function */ -typedef struct _initchip_param_t +struct initchip_param_t {unsigned short powerMode;/* Use power mode 0 or 1 */ unsigned short chipClock;/**
@@ -71,18 +67,17 @@ typedef struct _initchip_param_t*/ /* More initialization parameter can be added if needed */ -} -initchip_param_t; +}; -logical_chip_type_t getChipType (void ); -unsigned int calcPllValue (unsigned int request,pll_value_t *pll); -unsigned int calcPllValue2 (unsigned int ,pll_value_t *); -unsigned int formatPllReg (pll_value_t *pPLL); +enum logical_chip_type_t getChipType (void ); +unsigned int calcPllValue (unsigned int request,struct pll_value_t *pll); +unsigned int calcPllValue2 (unsigned int ,struct pll_value_t *); +unsigned int formatPllReg (struct pll_value_t *pPLL);void ddk750_set_mmio (void __iomem *,unsigned short ,char );unsigned int ddk750_getVMSize (void ); -int ddk750_initHw (initchip_param_t *); -unsigned int getPllValue (clock_type_t clockType,pll_value_t *pPLL); +int ddk750_initHw (struct initchip_param_t *); +unsigned int getPllValue (enum clock_type_t clockType,struct pll_value_t *pPLL);unsigned int getChipClock (void );void setChipClock (unsigned int );void setMemoryClock (unsigned int frequency);
drivers/staging/sm750fb/ddk750_display.c +1 -1
@@ -230,7 +230,7 @@ static void swPanelPowerSequence(int disp, int delay) } -void ddk750_setLogicalDispOut (disp_output_t output) +void ddk750_setLogicalDispOut (enum disp_output_t output) {unsigned int reg;if (output &PNL_2_USAGE ){
drivers/staging/sm750fb/ddk750_display.h +5 -7
@@ -86,7 +86,7 @@CRT means crt path DSUB */ #if 0 -typedef enum _disp_output_t +enum disp_output_t { NO_DISPLAY = DPMS_OFF,
@@ -126,10 +126,9 @@ typedef enum _disp_output_t CRT_2_SEC|PRI_TP_OFF|DPMS_ON|DUAL_TFT_ON, -} -disp_output_t; +}; #else -typedef enum _disp_output_t{ +enum disp_output_t{ do_LCD1_PRI = PNL_2_PRI|PRI_TP_ON|PNL_SEQ_ON|DAC_ON, do_LCD1_SEC = PNL_2_SEC|SEC_TP_ON|PNL_SEQ_ON|DAC_ON, #if 0
@@ -150,11 +149,10 @@ typedef enum _disp_output_t{ do_CRT_PRI =CRT_2_PRI |PRI_TP_ON |DPMS_ON |DAC_ON , do_CRT_SEC = CRT_2_SEC|SEC_TP_ON|DPMS_ON|DAC_ON, #endif -} -disp_output_t; +};#endif -void ddk750_setLogicalDispOut (disp_output_t ); +void ddk750_setLogicalDispOut (enum disp_output_t );int ddk750_initDVIDisp (void );#endif
drivers/staging/sm750fb/ddk750_dvi.c +5 -6
@@ -9,7 +9,7 @@/* This global variable contains all the supported driver and its corresponding function API. Please set the function pointer to NULL whenever the function is not supported. */ -static dvi_ctrl_device_t g_dcftSupportedDviController[] +static struct dvi_ctrl_device_t g_dcftSupportedDviController[] {#ifdef DVI_CTRL_SII164 {
@@ -43,7 +43,7 @@ int dviInit(unsigned char pllFilterValue ) { -dvi_ctrl_device_t *pCurrentDviCtrl; +struct dvi_ctrl_device_t *pCurrentDviCtrl; pCurrentDviCtrl = g_dcftSupportedDviController;if (pCurrentDviCtrl->pfnInit !=NULL ) {
@@ -64,10 +64,10 @@ int dviInit(*/ unsigned short dviGetVendorID (void ) { -dvi_ctrl_device_t *pCurrentDviCtrl; +struct dvi_ctrl_device_t *pCurrentDviCtrl; pCurrentDviCtrl = g_dcftSupportedDviController; -if (pCurrentDviCtrl != (dvi_ctrl_device_t *)0 ) +if (pCurrentDviCtrl != (struct dvi_ctrl_device_t *)0 )return pCurrentDviCtrl->pfnGetVendorId ();return 0x0000 ;
@@ -83,10 +83,10 @@ unsigned short dviGetVendorID(void)*/ unsigned short dviGetDeviceID (void ) { -dvi_ctrl_device_t *pCurrentDviCtrl; +struct dvi_ctrl_device_t *pCurrentDviCtrl; pCurrentDviCtrl = g_dcftSupportedDviController; -if (pCurrentDviCtrl != (dvi_ctrl_device_t *)0 ) +if (pCurrentDviCtrl != (struct dvi_ctrl_device_t *)0 )return pCurrentDviCtrl->pfnGetDeviceId ();return 0x0000 ;
drivers/staging/sm750fb/ddk750_dvi.h +2 -2
@@ -26,7 +26,7 @@ typedef unsigned char (*PFN_DVICTRL_CHECKINTERRUPT)(void);typedef void (*PFN_DVICTRL_CLEARINTERRUPT )(void );/* Structure to hold all the function pointer to the DVI Controller. */ -typedef struct _dvi_ctrl_device_t +struct dvi_ctrl_device_t {PFN_DVICTRL_INIT pfnInit;PFN_DVICTRL_RESETCHIP pfnResetChip;
@@ -38,7 +38,7 @@ typedef struct _dvi_ctrl_device_tPFN_DVICTRL_ISCONNECTED pfnIsConnected;PFN_DVICTRL_CHECKINTERRUPT pfnCheckInterrupt;PFN_DVICTRL_CLEARINTERRUPT pfnClearInterrupt; -} dvi_ctrl_device_t; +};#define DVI_CTRL_SII164
drivers/staging/sm750fb/ddk750_mode.c +6 -4
@@ -13,7 +13,8 @@HW only supports 7 predefined pixel clocks, and clock select is in bit 29:27 of Display Control register. */ -static unsigned long displayControlAdjust_SM750LE (mode_parameter_t *pModeParam,unsigned long dispControl) +static unsigned long displayControlAdjust_SM750LE ( +struct mode_parameter_t *pModeParam,unsigned long dispControl) {unsigned long x, y;
@@ -75,7 +76,8 @@ static unsigned long displayControlAdjust_SM750LE(mode_parameter_t *pModeParam,/* only timing related registers will be programed */ -static int programModeRegisters (mode_parameter_t *pModeParam,pll_value_t *pll) +static int programModeRegisters (struct mode_parameter_t *pModeParam, +struct pll_value_t *pll) {int ret =0 ;int cnt =0 ;
@@ -185,9 +187,9 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll)return ret; } -int ddk750_setModeTiming (mode_parameter_t *parm,clock_type_t clock) +int ddk750_setModeTiming (struct mode_parameter_t *parm,enum clock_type_t clock) { -pll_value_t pll; +struct pll_value_t pll;unsigned int uiActualPixelClk; pll.inputFreq =DEFAULT_INPUT_CLOCK ; pll.clockType = clock;
drivers/staging/sm750fb/ddk750_mode.h +8 -10
@@ -3,29 +3,28 @@#include "ddk750_chip.h" -typedef enum _spolarity_t +enum spolarity_t {POS =0 ,/* positive */ NEG ,/* negative */ -} -spolarity_t ; +}; -typedef struct _mode_parameter_t +struct mode_parameter_t {/* Horizontal timing. */ unsigned long horizontal_total;unsigned long horizontal_display_end;unsigned long horizontal_sync_start;unsigned long horizontal_sync_width; - spolarity_t horizontal_sync_polarity; +enum spolarity_t horizontal_sync_polarity;/* Vertical timing. */ unsigned long vertical_total;unsigned long vertical_display_end;unsigned long vertical_sync_start;unsigned long vertical_sync_height; - spolarity_t vertical_sync_polarity; +enum spolarity_t vertical_sync_polarity;/* Refresh timing. */ unsigned long pixel_clock;
@@ -33,11 +32,10 @@ typedef struct _mode_parameter_tunsigned long vertical_frequency;/* Clock Phase. This clock phase only applies to Panel. */ - spolarity_t clock_phase_polarity; -} -mode_parameter_t; + enum spolarity_t clock_phase_polarity; +}; -int ddk750_setModeTiming (mode_parameter_t *,clock_type_t ); +int ddk750_setModeTiming (struct mode_parameter_t *,enum clock_type_t );#endif
drivers/staging/sm750fb/ddk750_power.c +1 -1
@@ -2,7 +2,7 @@#include "ddk750_reg.h" #include "ddk750_power.h" -void ddk750_setDPMS (DPMS_t state) +void ddk750_setDPMS (enum DPMS_t state) {unsigned int value;if (getChipType () =SM750LE ){
drivers/staging/sm750fb/ddk750_power.h +3 -4
@@ -1,14 +1,13 @@#ifndef DDK750_POWER_H__ #define DDK750_POWER_H__ -typedef enum _DPMS_t +enum DPMS_t { crtDPMS_ON =0x0 , crtDPMS_STANDBY =0x1 , crtDPMS_SUSPEND =0x2 , crtDPMS_OFF =0x3 , -} -DPMS_t ; +};#define setDAC (off) \ { \
@@ -18,7 +17,7 @@ DPMS_t; off)); \ } -void ddk750_setDPMS (DPMS_t ); +void ddk750_setDPMS (enum DPMS_t );unsigned int getPowerMode (void );
drivers/staging/sm750fb/ddk750_sii164.c +1 -1
@@ -308,7 +308,7 @@ void sii164SetPower(* This function selects the mode of the hot plug detection. */ static void sii164SelectHotPlugDetectionMode ( -sii164_hot_plug_mode_t hotPlugMode +enum sii164_hot_plug_mode_t hotPlugMode ) {unsigned char detectReg;
drivers/staging/sm750fb/ddk750_sii164.h +2 -2
@@ -4,13 +4,13 @@#define USE_DVICHIP /* Hot Plug detection mode structure */ -typedef enum _sii164_hot_plug_mode_t +enum sii164_hot_plug_mode_t {SII164_HOTPLUG_DISABLE =0 ,/* Disable Hot Plug output bit (always high). */ SII164_HOTPLUG_USE_MDI ,/* Use Monitor Detect Interrupt bit. */ SII164_HOTPLUG_USE_RSEN ,/* Use Receiver Sense detect bit. */ SII164_HOTPLUG_USE_HTPLG /* Use Hot Plug detect bit. */ -}sii164_hot_plug_mode_t ; +};/* Silicon Image SiI164 chip prototype */
drivers/staging/sm750fb/sm750_hw.c +4 -4
@@ -117,7 +117,7 @@ int hw_sm750_inithw(struct lynx_share *share, struct pci_dev *pdev)if (parm->master_clk =0 ) parm->master_clk = parm->chip_clk/3 ; -ddk750_initHw ((initchip_param_t *)&spec_share->state.initParm); +ddk750_initHw ((struct initchip_param_t *)&spec_share->state.initParm);/* for sm718,open pci burst */ if (share->devid =0x718 ){ POKE32(SYSTEM_CTRL,
@@ -220,7 +220,7 @@ int hw_sm750_output_setMode(struct lynxfb_output* output, struct fb_var_screeninfo* var, struct fb_fix_screeninfo* fix) { int ret; -disp_output_t dispSet; +enum disp_output_t dispSet;int channel; ret =0 ;
@@ -298,8 +298,8 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc* crtc, {int ret, fmt;u32 reg; -mode_parameter_t modparm; -clock_type_t clock; +struct mode_parameter_t modparm; +enum clock_type_t clock;struct lynx_share *share;struct lynxfb_par *par;
Sudip Mukherjee
maintainerQuoted 4 lines · Brian Stottler
Fix typedef usage which does not comply with kernel style guidelines.
Signed-off-by Brian Stottler <[email protected]>---
I think you need to update your tree. This patch will not apply due to changes already done in some of the files.
regards
sudip
Quoted 2 lines · Sudip Mukherjee
I think you need to update your tree. This patch will not apply due to changes already done in some of the files.
My mistake, thanks for the heads up. I will resubmit my corrected patch as soon as possible. Just to clarify, the tree in question is torvalds/linux.git, correct?
Thanks,
Brian Stottler
Sudip Mukherjee
maintainerQuoted 7 lines · Brian Stottler
Quoted 2 lines · Sudip Mukherjee
I think you need to update your tree. This patch will not apply due to changes already done in some of the files.
My mistake, thanks for the heads up. I will resubmit my corrected patch as soon as possible. Just to clarify, the tree in question is torvalds/linux.git, correct?
No, use Greg's staging-testing tree.
regards
sudip