Re: [PATCH] staging: lustre: mdc: use __FMODE_EXEC macro
On Tue, 2014-11-18 at 01:46 +0300, Dan Carpenter wrote: > On Mon, Nov 17, 2014 at 02:23:48PM -0800, Juston Li wrote: > > FMODE_EXEC is type fmode_t but is used in operations > > with integers which leads to sparse warnings: > > drivers/staging/lustre/lustre/mdc/mdc_lib.c:198:21: warning: restricted > > fmode_t degrades to integer > > drivers/staging/lustre/lustre/mdc/mdc_locks.c:300:49: warning: restricted > > fmode_t degrades to integer > > > > Fix by using __FMODE_EXEC macro defined in fs.h. > > > > Note the same warnings occurs with other fmode flags > > here but they don't have a corresponding int macro. > > > > When are FMODE_EXEC and __FMODE_EXEC not defined? I think they're > always defined. I don't understand the point of these ifdefs. I guess > maybe they are for compatability with obsolete kernels? > > regards, > dan carpenter > Seems to be the case. Looked at some old commits (2.6.17) and found FMODE_EXEC was mainlined to allow lustre to be installed on a vanilla kernel. Since you pointed it out, if we are dealing with compatability with obselete kernels, __FMODE_EXEC was added later in 2.6.38. Wondering if I should address the case where FMODE_EXEC is defined but __FMODE_EXEC isn't since I currently only check __FMODE_EXEC. Regards, Juston Li ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: lustre: mdc: use __FMODE_EXEC macro
FMODE_EXEC is type fmode_t but is used in operations with integers which leads to sparse warnings: drivers/staging/lustre/lustre/mdc/mdc_lib.c:198:21: warning: restricted fmode_t degrades to integer drivers/staging/lustre/lustre/mdc/mdc_locks.c:300:49: warning: restricted fmode_t degrades to integer Fix by using __FMODE_EXEC macro defined in fs.h. Note the same warnings occurs with other fmode flags here but they don't have a corresponding int macro. Signed-off-by: Juston Li --- drivers/staging/lustre/lustre/mdc/mdc_lib.c | 4 ++-- drivers/staging/lustre/lustre/mdc/mdc_locks.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c b/drivers/staging/lustre/lustre/mdc/mdc_lib.c index e8732cc..34c9a86 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c @@ -194,8 +194,8 @@ static __u64 mds_pack_open_flags(__u64 flags, __u32 mode) cr_flags |= MDS_OPEN_SYNC; if (flags & O_DIRECTORY) cr_flags |= MDS_OPEN_DIRECTORY; -#ifdef FMODE_EXEC - if (flags & FMODE_EXEC) +#ifdef __FMODE_EXEC + if (flags & __FMODE_EXEC) cr_flags |= MDS_FMODE_EXEC; #endif if (cl_is_lov_delay_create(flags)) diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c index b58147e..c05afa8 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c @@ -296,8 +296,8 @@ static struct ptlrpc_request *mdc_intent_open_pack(struct obd_export *exp, } else { if (it->it_flags & (FMODE_WRITE|MDS_OPEN_TRUNC)) mode = LCK_CW; -#ifdef FMODE_EXEC - else if (it->it_flags & FMODE_EXEC) +#ifdef __FMODE_EXEC + else if (it->it_flags & __FMODE_EXEC) mode = LCK_PR; #endif else -- 2.1.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: lustre: mdc: use __FMODE_EXEC macro
FMODE_EXEC is type fmode_t but is used in operations with integers which leads to sparse warnings: drivers/staging/lustre/lustre/mdc/mdc_lib.c:198:21: warning: restricted fmode_t degrades to integer drivers/staging/lustre/lustre/mdc/mdc_locks.c:300:49: warning: restricted fmode_t degrades to integer Fix by using __FMODE_EXEC macro defined in fs.h. Note the same warnings occurs with other fmode flags here but they don't have a corresponding int macro. Changes since v1: remove ifdefs. FMODE_EXEC and __FMODE_EXEC should always be defined in fs.h Signed-off-by: Juston Li --- drivers/staging/lustre/lustre/mdc/mdc_lib.c | 4 +--- drivers/staging/lustre/lustre/mdc/mdc_locks.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c b/drivers/staging/lustre/lustre/mdc/mdc_lib.c index e8732cc..4e59995 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c @@ -194,10 +194,8 @@ static __u64 mds_pack_open_flags(__u64 flags, __u32 mode) cr_flags |= MDS_OPEN_SYNC; if (flags & O_DIRECTORY) cr_flags |= MDS_OPEN_DIRECTORY; -#ifdef FMODE_EXEC - if (flags & FMODE_EXEC) + if (flags & __FMODE_EXEC) cr_flags |= MDS_FMODE_EXEC; -#endif if (cl_is_lov_delay_create(flags)) cr_flags |= MDS_OPEN_DELAY_CREATE; diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c index b58147e..8c9b4f5 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c @@ -296,10 +296,8 @@ static struct ptlrpc_request *mdc_intent_open_pack(struct obd_export *exp, } else { if (it->it_flags & (FMODE_WRITE|MDS_OPEN_TRUNC)) mode = LCK_CW; -#ifdef FMODE_EXEC - else if (it->it_flags & FMODE_EXEC) + else if (it->it_flags & __FMODE_EXEC) mode = LCK_PR; -#endif else mode = LCK_CR; } -- 2.1.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8723au: fix sparse warning
change cast to __le16 to fix the following warning: drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c:1488:20: warning: cast to restricted __le16 Signed-off-by: Juston Li --- drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c index 04d0183..e23af8e 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c @@ -1485,7 +1485,7 @@ void Hal_EfuseParseIDCode(struct rtw_adapter *padapter, u8 *hwinfo) u16 EEPROMId; /* Checl 0x8129 again for making sure autoload status!! */ - EEPROMId = le16_to_cpu(*((u16 *) hwinfo)); + EEPROMId = le16_to_cpu(*((__le16 *) hwinfo)); if (EEPROMId != RTL_EEPROM_ID) { DBG_8723A("EEPROM ID(%#x) is invalid!!\n", EEPROMId); pEEPROM->bautoload_fail_flag = true; -- 2.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] 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. Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_chip.c | 11 ++-- drivers/staging/sm750fb/ddk750_dvi.c| 4 +-- drivers/staging/sm750fb/ddk750_help.c | 2 -- drivers/staging/sm750fb/ddk750_sii164.c | 11 drivers/staging/sm750fb/sm750.h | 10 +++ drivers/staging/sm750fb/sm750_accel.c | 49 - drivers/staging/sm750fb/sm750_accel.h | 2 +- drivers/staging/sm750fb/sm750_cursor.c | 9 +++--- drivers/staging/sm750fb/sm750_help.h| 28 +++ drivers/staging/sm750fb/sm750_hw.c | 4 +-- drivers/staging/sm750fb/sm750_hw.h | 3 -- 11 files changed, 41 insertions(+), 92 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index 8b47c1b..b2137c8 100644 --- a/drivers/staging/sm750fb/ddk750_chip.c +++ b/drivers/staging/sm750fb/ddk750_chip.c @@ -17,7 +17,7 @@ logical_chip_type_t getChipType(void) char physicalRev; logical_chip_type_t chip; - physicalID = devId750;//either 0x718 or 0x750 + physicalID = devId750; /* either 0x718 or 0x750 / physicalRev = revId750; if (physicalID == 0x718) @@ -257,7 +257,7 @@ int ddk750_initHw(initchip_param_t *pInitParam) unsigned int ulReg; #if 0 - //move the code to map regiter function. + /* move the code to map regiter function. */ if (getChipType() == SM718) { /* turn on big endian bit*/ ulReg = PEEK32(0x74); @@ -487,8 +487,6 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll) } } } - - //printk("Finally: pll->n[%lu],m[%lu],od[%lu],pod[%lu]\n",pll->N,pll->M,pll->OD,pll->POD); return ret; } @@ -580,14 +578,9 @@ pll_value_t *pPLL /* Structure to hold the value to be set in PLL */ } /* Restore input frequency from Khz to hz unit */ -//pPLL->inputFreq *= 1000; ulRequestClk *= 1000; pPLL->inputFreq = DEFAULT_INPUT_CLOCK; /* Default reference clock */ -/* Output debug information */ - //DDKDEBUGPRINT((DISPLAY_LEVEL, "calcPllValue: Requested Frequency = %d\n", ulRequestClk)); - //DDKDEBUGPRINT((DISPLAY_LEVEL, "calcPllValue: Input CLK = %dHz, M=%d, N=%d, OD=%d, POD=%d\n", pPLL->inputFreq, pPLL->M, pPLL->N, pPLL->OD, pPLL->POD)); - /* Return actual frequency that the PLL can set */ ret = calcPLL(pPLL); return ret; diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c index f5932bb..b2bf7e6 100644 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ b/drivers/staging/sm750fb/ddk750_dvi.c @@ -51,7 +51,7 @@ int dviInit( vsyncEnable, deskewEnable, deskewSetting, continuousSyncEnable, pllFilterEnable, pllFilterValue); } - return -1;//error + return -1; /* error */ } @@ -66,7 +66,6 @@ unsigned short dviGetVendorID(void) { dvi_ctrl_device_t *pCurrentDviCtrl; -//pCurrentDviCtrl = getDviCtrl(); pCurrentDviCtrl = g_dcftSupportedDviController; if (pCurrentDviCtrl != (dvi_ctrl_device_t *)0) return pCurrentDviCtrl->pfnGetVendorId(); @@ -86,7 +85,6 @@ unsigned short dviGetDeviceID(void) { dvi_ctrl_device_t *pCurrentDviCtrl; -//pCurrentDviCtrl = getDviCtrl(); pCurrentDviCtrl = g_dcftSupportedDviController; if (pCurrentDviCtrl != (dvi_ctrl_device_t *)0) return pCurrentDviCtrl->pfnGetDeviceId(); diff --git a/drivers/staging/sm750fb/ddk750_help.c b/drivers/staging/sm750fb/ddk750_help.c index 647004d..96c18eb 100644 --- a/drivers/staging/sm750fb/ddk750_help.c +++ b/drivers/staging/sm750fb/ddk750_help.c @@ -1,5 +1,3 @@ -//#include "ddk750_reg.h" -//#include "ddk750_chip.h" #include "ddk750_help.h" void __iomem * mmio750 = NULL; diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c index 84464c1..b6395b8 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.c +++ b/drivers/staging/sm750fb/ddk750_sii164.c @@ -125,10 +125,7 @@ long sii164InitChip( unsigned char pllFilterValue ) { -//unsigned char ucRegIndex, ucRegValue; -//unsigned char ucDeviceAddress, unsigned char config; -//unsigned long delayCount; /* Initialize the i2c bus */ #ifdef USE_HW_I2C @@ -141,10 +138,6 @@ long sii164InitChip( /* Check if SII164 Chip exists */ if ((sii164GetVendorID() == SII164_VENDOR_ID) &&am
Re: [PATCH] staging: sm750fb: fix c99 comments
On Fri, Jun 12, 2015 at 2:21 AM, Konrad Zapalowicz wrote: >> diff --git a/drivers/staging/sm750fb/ddk750_chip.c >> b/drivers/staging/sm750fb/ddk750_chip.c >> index 8b47c1b..b2137c8 100644 >> --- a/drivers/staging/sm750fb/ddk750_chip.c >> +++ b/drivers/staging/sm750fb/ddk750_chip.c >> @@ -17,7 +17,7 @@ logical_chip_type_t getChipType(void) >> char physicalRev; >> logical_chip_type_t chip; >> >> - physicalID = devId750;//either 0x718 or 0x750 >> + physicalID = devId750; /* either 0x718 or 0x750 / > > Does the code compile? I'm worried that the above line will produce > error as the comment block is not properly closed. > > - konrad Good catch, can't believe I missed that. I'll fix, actually test compile this time and resend. Regards Juston ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] 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 --- drivers/staging/sm750fb/ddk750_chip.c | 11 ++-- drivers/staging/sm750fb/ddk750_dvi.c| 4 +-- drivers/staging/sm750fb/ddk750_help.c | 2 -- drivers/staging/sm750fb/ddk750_sii164.c | 11 drivers/staging/sm750fb/sm750.h | 10 +++ drivers/staging/sm750fb/sm750_accel.c | 49 - drivers/staging/sm750fb/sm750_accel.h | 2 +- drivers/staging/sm750fb/sm750_cursor.c | 9 +++--- drivers/staging/sm750fb/sm750_help.h| 28 +++ drivers/staging/sm750fb/sm750_hw.c | 4 +-- drivers/staging/sm750fb/sm750_hw.h | 3 -- 11 files changed, 41 insertions(+), 92 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index 8b47c1b..981736f 100644 --- a/drivers/staging/sm750fb/ddk750_chip.c +++ b/drivers/staging/sm750fb/ddk750_chip.c @@ -17,7 +17,7 @@ logical_chip_type_t getChipType(void) char physicalRev; logical_chip_type_t chip; - physicalID = devId750;//either 0x718 or 0x750 + physicalID = devId750; /* either 0x718 or 0x750 */ physicalRev = revId750; if (physicalID == 0x718) @@ -257,7 +257,7 @@ int ddk750_initHw(initchip_param_t *pInitParam) unsigned int ulReg; #if 0 - //move the code to map regiter function. + /* move the code to map regiter function. */ if (getChipType() == SM718) { /* turn on big endian bit*/ ulReg = PEEK32(0x74); @@ -487,8 +487,6 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll) } } } - - //printk("Finally: pll->n[%lu],m[%lu],od[%lu],pod[%lu]\n",pll->N,pll->M,pll->OD,pll->POD); return ret; } @@ -580,14 +578,9 @@ pll_value_t *pPLL /* Structure to hold the value to be set in PLL */ } /* Restore input frequency from Khz to hz unit */ -//pPLL->inputFreq *= 1000; ulRequestClk *= 1000; pPLL->inputFreq = DEFAULT_INPUT_CLOCK; /* Default reference clock */ -/* Output debug information */ - //DDKDEBUGPRINT((DISPLAY_LEVEL, "calcPllValue: Requested Frequency = %d\n", ulRequestClk)); - //DDKDEBUGPRINT((DISPLAY_LEVEL, "calcPllValue: Input CLK = %dHz, M=%d, N=%d, OD=%d, POD=%d\n", pPLL->inputFreq, pPLL->M, pPLL->N, pPLL->OD, pPLL->POD)); - /* Return actual frequency that the PLL can set */ ret = calcPLL(pPLL); return ret; diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c index f5932bb..b2bf7e6 100644 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ b/drivers/staging/sm750fb/ddk750_dvi.c @@ -51,7 +51,7 @@ int dviInit( vsyncEnable, deskewEnable, deskewSetting, continuousSyncEnable, pllFilterEnable, pllFilterValue); } - return -1;//error + return -1; /* error */ } @@ -66,7 +66,6 @@ unsigned short dviGetVendorID(void) { dvi_ctrl_device_t *pCurrentDviCtrl; -//pCurrentDviCtrl = getDviCtrl(); pCurrentDviCtrl = g_dcftSupportedDviController; if (pCurrentDviCtrl != (dvi_ctrl_device_t *)0) return pCurrentDviCtrl->pfnGetVendorId(); @@ -86,7 +85,6 @@ unsigned short dviGetDeviceID(void) { dvi_ctrl_device_t *pCurrentDviCtrl; -//pCurrentDviCtrl = getDviCtrl(); pCurrentDviCtrl = g_dcftSupportedDviController; if (pCurrentDviCtrl != (dvi_ctrl_device_t *)0) return pCurrentDviCtrl->pfnGetDeviceId(); diff --git a/drivers/staging/sm750fb/ddk750_help.c b/drivers/staging/sm750fb/ddk750_help.c index 647004d..96c18eb 100644 --- a/drivers/staging/sm750fb/ddk750_help.c +++ b/drivers/staging/sm750fb/ddk750_help.c @@ -1,5 +1,3 @@ -//#include "ddk750_reg.h" -//#include "ddk750_chip.h" #include "ddk750_help.h" void __iomem * mmio750 = NULL; diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c index 84464c1..b6395b8 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.c +++ b/drivers/staging/sm750fb/ddk750_sii164.c @@ -125,10 +125,7 @@ long sii164InitChip( unsigned char pllFilterValue ) { -//unsigned char ucRegIndex, ucRegValue; -//unsigned char ucDeviceAddress, unsigned char config; -//unsigned long delayCount; /* Initialize the i2c bus */ #ifdef USE_HW_I2C @@ -141,10 +138,6 @@ long sii164InitChip( /* Check if SII164 Chip exists */ if ((s
[PATCH] staging: sm750fb: use tabs for indentation
Replace spaces with tabs for indentation to fix the checkpatch.pl warning 'WARNING: please, no spaces at the start of a line' checkpatch doesn't catch comments indented by spaces but I fixed comments adjacent to warnings as well so they would remain aligned. Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_display.c | 96 drivers/staging/sm750fb/ddk750_display.h | 2 +- drivers/staging/sm750fb/ddk750_dvi.c | 66 ++--- drivers/staging/sm750fb/ddk750_help.h| 4 +- drivers/staging/sm750fb/ddk750_hwi2c.c | 252 ++- drivers/staging/sm750fb/ddk750_mode.c| 142 +-- drivers/staging/sm750fb/ddk750_mode.h| 46 ++-- drivers/staging/sm750fb/ddk750_power.c | 254 ++-- drivers/staging/sm750fb/ddk750_power.h | 8 +- drivers/staging/sm750fb/ddk750_reg.h | 18 +- drivers/staging/sm750fb/ddk750_sii164.c | 400 +++ drivers/staging/sm750fb/ddk750_sii164.h | 29 ++- drivers/staging/sm750fb/sm750.h | 24 +- drivers/staging/sm750fb/sm750_accel.c| 364 ++-- drivers/staging/sm750fb/sm750_accel.h| 4 +- drivers/staging/sm750fb/sm750_help.h | 26 +- drivers/staging/sm750fb/sm750_hw.c | 70 +++--- drivers/staging/sm750fb/sm750_hw.h | 28 +-- 18 files changed, 906 insertions(+), 927 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index a3e6720..cae9d91 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -24,7 +24,7 @@ static void setDisplayControl(int ctrl, int dispState) /* Timing should be enabled first before enabling the plane * because changing at the same time does not guarantee that * the plane will also enabled or disabled. -*/ +*/ ulDisplayCtrlReg = FIELD_SET(ulDisplayCtrlReg, PANEL_DISPLAY_CTRL, TIMING, ENABLE); POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg); @@ -145,26 +145,26 @@ static void waitNextVerticalSync(int ctrl, int delay) return; } -while (delay-- > 0) -{ -/* Wait for end of vsync. */ -do -{ -status = FIELD_GET(PEEK32(SYSTEM_CTRL), - SYSTEM_CTRL, - PANEL_VSYNC); -} -while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE); - -/* Wait for start of vsync. */ -do -{ -status = FIELD_GET(PEEK32(SYSTEM_CTRL), - SYSTEM_CTRL, - PANEL_VSYNC); -} -while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); -} + while (delay-- > 0) + { + /* Wait for end of vsync. */ + do + { + status = FIELD_GET(PEEK32(SYSTEM_CTRL), +SYSTEM_CTRL, +PANEL_VSYNC); + } + while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE); + + /* Wait for start of vsync. */ + do + { + status = FIELD_GET(PEEK32(SYSTEM_CTRL), + SYSTEM_CTRL, + PANEL_VSYNC); + } + while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); + } }else{ @@ -275,33 +275,33 @@ void ddk750_setLogicalDispOut(disp_output_t output) int ddk750_initDVIDisp(void) { -/* Initialize DVI. If the dviInit fail and the VendorID or the DeviceID are - not zeroed, then set the failure flag. If it is zeroe, it might mean - that the system is in Dual CRT Monitor configuration. */ - -/* De-skew enabled with default 111b value. - This will fix some artifacts problem in some mode on board 2.2. - Somehow this fix does not affect board 2.1. - */ -if ((dviInit(1, /* Select Rising Edge */ -1, /* Select 24-bit bus */ -0, /* Select Single Edge clock */ -1, /* Enable HSync as is */ -1, /* Enable VSync as is */ -1, /* Enable De-skew */ -7, /* Set the de-skew setting to maximum setup */ -1, /* Enable continuous Sync */ -1, /* Enable PLL Filter */ -4 /* Use the recommended value for PLL Filter value */ -) != 0) && (dviGetVendorID()
[PATCH v2] staging: sm750fb: use tabs for indentation
Replace spaces with tabs for indentation to fix the checkpatch.pl warning 'WARNING: please, no spaces at the start of a line' checkpatch doesn't catch comments indented by spaces but I fixed comments adjacent to warnings as well so they would remain aligned. Changes since v1: fix alignment in ddk750_display.c:154 didn't remove a space in ddk750_hwi2c.c:48 Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_display.c | 96 drivers/staging/sm750fb/ddk750_display.h | 2 +- drivers/staging/sm750fb/ddk750_dvi.c | 66 ++--- drivers/staging/sm750fb/ddk750_help.h| 4 +- drivers/staging/sm750fb/ddk750_hwi2c.c | 252 ++- drivers/staging/sm750fb/ddk750_mode.c| 142 +-- drivers/staging/sm750fb/ddk750_mode.h| 46 ++-- drivers/staging/sm750fb/ddk750_power.c | 254 ++-- drivers/staging/sm750fb/ddk750_power.h | 8 +- drivers/staging/sm750fb/ddk750_reg.h | 18 +- drivers/staging/sm750fb/ddk750_sii164.c | 400 +++ drivers/staging/sm750fb/ddk750_sii164.h | 29 ++- drivers/staging/sm750fb/sm750.h | 24 +- drivers/staging/sm750fb/sm750_accel.c| 364 ++-- drivers/staging/sm750fb/sm750_accel.h| 4 +- drivers/staging/sm750fb/sm750_help.h | 26 +- drivers/staging/sm750fb/sm750_hw.c | 70 +++--- drivers/staging/sm750fb/sm750_hw.h | 28 +-- 18 files changed, 906 insertions(+), 927 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index a3e6720..7aa22c1 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -24,7 +24,7 @@ static void setDisplayControl(int ctrl, int dispState) /* Timing should be enabled first before enabling the plane * because changing at the same time does not guarantee that * the plane will also enabled or disabled. -*/ +*/ ulDisplayCtrlReg = FIELD_SET(ulDisplayCtrlReg, PANEL_DISPLAY_CTRL, TIMING, ENABLE); POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg); @@ -145,26 +145,26 @@ static void waitNextVerticalSync(int ctrl, int delay) return; } -while (delay-- > 0) -{ -/* Wait for end of vsync. */ -do -{ -status = FIELD_GET(PEEK32(SYSTEM_CTRL), - SYSTEM_CTRL, - PANEL_VSYNC); -} -while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE); - -/* Wait for start of vsync. */ -do -{ -status = FIELD_GET(PEEK32(SYSTEM_CTRL), - SYSTEM_CTRL, - PANEL_VSYNC); -} -while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); -} + while (delay-- > 0) + { + /* Wait for end of vsync. */ + do + { + status = FIELD_GET(PEEK32(SYSTEM_CTRL), + SYSTEM_CTRL, + PANEL_VSYNC); + } + while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE); + + /* Wait for start of vsync. */ + do + { + status = FIELD_GET(PEEK32(SYSTEM_CTRL), + SYSTEM_CTRL, + PANEL_VSYNC); + } + while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); + } }else{ @@ -275,33 +275,33 @@ void ddk750_setLogicalDispOut(disp_output_t output) int ddk750_initDVIDisp(void) { -/* Initialize DVI. If the dviInit fail and the VendorID or the DeviceID are - not zeroed, then set the failure flag. If it is zeroe, it might mean - that the system is in Dual CRT Monitor configuration. */ - -/* De-skew enabled with default 111b value. - This will fix some artifacts problem in some mode on board 2.2. - Somehow this fix does not affect board 2.1. - */ -if ((dviInit(1, /* Select Rising Edge */ -1, /* Select 24-bit bus */ -0, /* Select Single Edge clock */ -1, /* Enable HSync as is */ -1, /* Enable VSync as is */ -1, /* Enable De-skew */ -7, /* Set the de-skew setting to maximum setup */ -1, /* Enable continuous Sync */ -1, /* Enable PLL Filter */ -
Re: [PATCH v2] staging: sm750fb: use tabs for indentation
On Fri, Jun 19, 2015 at 10:21 PM, Greg KH wrote: > > On Fri, Jun 19, 2015 at 10:13:11PM -0700, Juston Li wrote: > > Replace spaces with tabs for indentation to fix the checkpatch.pl warning > > 'WARNING: please, no spaces at the start of a line' > > > > checkpatch doesn't catch comments indented by spaces but I fixed comments > > adjacent to warnings as well so they would remain aligned. > > > > Changes since v1: > > fix alignment in ddk750_display.c:154 > > didn't remove a space in ddk750_hwi2c.c:48 > > The version info here should go below the --- line, so it doesn't show > up in the changelog itself. > > third time's a charm? Thanks for the tip, resent as v3. *cross fingers* Regards Juston ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3] staging: sm750fb: use tabs for indentation
Replace spaces with tabs for indentation to fix the checkpatch.pl warning 'WARNING: please, no spaces at the start of a line' checkpatch doesn't catch comments indented by spaces but I fixed comments adjacent to warnings as well so they would remain aligned. Signed-off-by: Juston Li --- Changes since v2: move version info out of changelog Changes since v1: fix alignment in ddk750_display.c:154 didn't remove a space in ddk750_hwi2c.c:48 drivers/staging/sm750fb/ddk750_display.c | 96 drivers/staging/sm750fb/ddk750_display.h | 2 +- drivers/staging/sm750fb/ddk750_dvi.c | 66 ++--- drivers/staging/sm750fb/ddk750_help.h| 4 +- drivers/staging/sm750fb/ddk750_hwi2c.c | 252 ++- drivers/staging/sm750fb/ddk750_mode.c| 142 +-- drivers/staging/sm750fb/ddk750_mode.h| 46 ++-- drivers/staging/sm750fb/ddk750_power.c | 254 ++-- drivers/staging/sm750fb/ddk750_power.h | 8 +- drivers/staging/sm750fb/ddk750_reg.h | 18 +- drivers/staging/sm750fb/ddk750_sii164.c | 400 +++ drivers/staging/sm750fb/ddk750_sii164.h | 29 ++- drivers/staging/sm750fb/sm750.h | 24 +- drivers/staging/sm750fb/sm750_accel.c| 364 ++-- drivers/staging/sm750fb/sm750_accel.h| 4 +- drivers/staging/sm750fb/sm750_help.h | 26 +- drivers/staging/sm750fb/sm750_hw.c | 70 +++--- drivers/staging/sm750fb/sm750_hw.h | 28 +-- 18 files changed, 906 insertions(+), 927 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index a3e6720..7aa22c1 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -24,7 +24,7 @@ static void setDisplayControl(int ctrl, int dispState) /* Timing should be enabled first before enabling the plane * because changing at the same time does not guarantee that * the plane will also enabled or disabled. -*/ +*/ ulDisplayCtrlReg = FIELD_SET(ulDisplayCtrlReg, PANEL_DISPLAY_CTRL, TIMING, ENABLE); POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg); @@ -145,26 +145,26 @@ static void waitNextVerticalSync(int ctrl, int delay) return; } -while (delay-- > 0) -{ -/* Wait for end of vsync. */ -do -{ -status = FIELD_GET(PEEK32(SYSTEM_CTRL), - SYSTEM_CTRL, - PANEL_VSYNC); -} -while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE); - -/* Wait for start of vsync. */ -do -{ -status = FIELD_GET(PEEK32(SYSTEM_CTRL), - SYSTEM_CTRL, - PANEL_VSYNC); -} -while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); -} + while (delay-- > 0) + { + /* Wait for end of vsync. */ + do + { + status = FIELD_GET(PEEK32(SYSTEM_CTRL), + SYSTEM_CTRL, + PANEL_VSYNC); + } + while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE); + + /* Wait for start of vsync. */ + do + { + status = FIELD_GET(PEEK32(SYSTEM_CTRL), + SYSTEM_CTRL, + PANEL_VSYNC); + } + while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); + } }else{ @@ -275,33 +275,33 @@ void ddk750_setLogicalDispOut(disp_output_t output) int ddk750_initDVIDisp(void) { -/* Initialize DVI. If the dviInit fail and the VendorID or the DeviceID are - not zeroed, then set the failure flag. If it is zeroe, it might mean - that the system is in Dual CRT Monitor configuration. */ - -/* De-skew enabled with default 111b value. - This will fix some artifacts problem in some mode on board 2.2. - Somehow this fix does not affect board 2.1. - */ -if ((dviInit(1, /* Select Rising Edge */ -1, /* Select 24-bit bus */ -0, /* Select Single Edge clock */ -1, /* Enable HSync as is */ -1, /* Enable VSync as is */ -1, /* Enable De-skew */ -7, /* Set the de-skew setting to maximum setup */ -1, /* Enable continuous
Re: [PATCH] Staging: sm750fb: Fix C99 Comments
On Fri, Jun 19, 2015 at 10:25 PM, Amitoj Kaur Chawla wrote: > Used C89 instead of C99 Comments and removed C99 comments performing > prints only. > Problem found using checkpatch.pl > > ERROR: do not use C99 // comments > > Signed-off-by: Amitoj Kaur Chawla These changes have already been added in the staging-next tree included in commit 'staging: sm750fb: fix c99 comments' You should base future changes against gregkh staging-testing branch. Regards Juston ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3] staging: sm750fb: use tabs for indentation
On Sat, Jun 20, 2015 at 12:43 AM, Sudip Mukherjee wrote: > On Fri, Jun 19, 2015 at 10:50:57PM -0700, Juston Li wrote: >> Replace spaces with tabs for indentation to fix the checkpatch.pl warning >> 'WARNING: please, no spaces at the start of a line' >> >> checkpatch doesn't catch comments indented by spaces but I fixed comments >> adjacent to warnings as well so they would remain aligned. >> >> Signed-off-by: Juston Li >> --- > >> diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c >> b/drivers/staging/sm750fb/ddk750_hwi2c.c >> index 7826376..23d6e19 100644 >> --- a/drivers/staging/sm750fb/ddk750_hwi2c.c >> +++ b/drivers/staging/sm750fb/ddk750_hwi2c.c >> @@ -9,71 +9,69 @@ >> #define HWI2C_WAIT_TIMEOUT 0xF >> >> >> -int hwI2CInit( >> -unsigned char busSpeedMode >> -) >> +int hwI2CInit(unsigned char busSpeedMode) > but this is what you say in commit message. Please only do one type of > change in a single patch. Yeah, there were a couple of those changes I forgot to mention. They were cases where there was nothing to align the lines to and it was easier just to fix the overall code style. It is a separate change so I'll remove the changes and resend. I actually finished on several other checkpatch.pl fix patches so I'll just include this in a patchset. Regards Juston ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/4] staging: sm750fb: checkpatch.pl fixes
This patch set includes 4 patches fixing indentation, spacing, brace placement and missing blank lines from checkpatch.pl warnings/errors in staging/sm750fb. Regards Juston - drivers/staging/sm750fb/ddk750_chip.c| 15 +-- drivers/staging/sm750fb/ddk750_chip.h| 12 +- drivers/staging/sm750fb/ddk750_display.c | 168 +--- drivers/staging/sm750fb/ddk750_display.h | 11 +- drivers/staging/sm750fb/ddk750_dvi.c | 75 +-- drivers/staging/sm750fb/ddk750_dvi.h | 3 +- drivers/staging/sm750fb/ddk750_help.c| 2 +- drivers/staging/sm750fb/ddk750_help.h| 4 +- drivers/staging/sm750fb/ddk750_hwi2c.c | 244 ++- drivers/staging/sm750fb/ddk750_mode.c| 164 +++ drivers/staging/sm750fb/ddk750_mode.h| 52 drivers/staging/sm750fb/ddk750_power.c | 254 ++-- drivers/staging/sm750fb/ddk750_power.h | 11 +- drivers/staging/sm750fb/ddk750_reg.h | 18 +-- drivers/staging/sm750fb/ddk750_sii164.c | 394 +--- drivers/staging/sm750fb/ddk750_sii164.h | 32 ++--- drivers/staging/sm750fb/sm750.c | 2 +- drivers/staging/sm750fb/sm750.h | 58 - drivers/staging/sm750fb/sm750_accel.c| 374 - drivers/staging/sm750fb/sm750_accel.h| 4 +- drivers/staging/sm750fb/sm750_cursor.c | 49 +++ drivers/staging/sm750fb/sm750_help.h | 28 ++-- drivers/staging/sm750fb/sm750_hw.c | 205 +++-- drivers/staging/sm750fb/sm750_hw.h | 42 +++--- 24 files changed, 1163 insertions(+), 1058 deletions(-) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/4] staging: sm750fb: fix brace placement
Fix brace placement errors and warnings caught by checkpatch.pl ERROR: that open brace { should be on the previous line WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_chip.h| 12 ++ drivers/staging/sm750fb/ddk750_display.c | 66 ++-- drivers/staging/sm750fb/ddk750_display.h | 3 +- drivers/staging/sm750fb/ddk750_dvi.c | 6 +-- drivers/staging/sm750fb/ddk750_dvi.h | 3 +- drivers/staging/sm750fb/ddk750_hwi2c.c | 6 +-- drivers/staging/sm750fb/ddk750_mode.c| 13 ++- drivers/staging/sm750fb/ddk750_mode.h| 6 +-- drivers/staging/sm750fb/ddk750_power.c | 27 - drivers/staging/sm750fb/ddk750_power.h | 3 +- drivers/staging/sm750fb/ddk750_sii164.c | 16 +++- drivers/staging/sm750fb/ddk750_sii164.h | 3 +- drivers/staging/sm750fb/sm750_accel.c| 46 +++--- drivers/staging/sm750fb/sm750_cursor.c | 23 +-- drivers/staging/sm750fb/sm750_hw.c | 33 ++-- 15 files changed, 86 insertions(+), 180 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_chip.h b/drivers/staging/sm750fb/ddk750_chip.h index 4e030e8..6ff0436 100644 --- a/drivers/staging/sm750fb/ddk750_chip.h +++ b/drivers/staging/sm750fb/ddk750_chip.h @@ -8,8 +8,7 @@ #include /* This is all the chips recognized by this library */ -typedef enum _logical_chip_type_t -{ +typedef enum _logical_chip_type_t { SM_UNKNOWN, SM718, SM750, @@ -18,8 +17,7 @@ typedef enum _logical_chip_type_t logical_chip_type_t; -typedef enum _clock_type_t -{ +typedef enum _clock_type_t { MXCLK_PLL, PRIMARY_PLL, SECONDARY_PLL, @@ -28,8 +26,7 @@ typedef enum _clock_type_t } clock_type_t; -typedef struct _pll_value_t -{ +typedef struct _pll_value_t { clock_type_t clockType; unsigned long inputFreq; /* Input clock frequency to the PLL */ @@ -42,8 +39,7 @@ typedef struct _pll_value_t pll_value_t; /* input struct to initChipParam() function */ -typedef struct _initchip_param_t -{ +typedef struct _initchip_param_t { unsigned short powerMode;/* Use power mode 0 or 1 */ unsigned short chipClock;/** * Speed of main chip clock in MHz unit diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index 4a3cb86..90c5c9e 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -15,12 +15,10 @@ static void setDisplayControl(int ctrl, int dispState) cnt = 0; /* Set the primary display control */ - if (!ctrl) - { + if (!ctrl) { ulDisplayCtrlReg = PEEK32(PANEL_DISPLAY_CTRL); /* Turn on/off the Panel display control */ - if (dispState) - { + if (dispState) { /* Timing should be enabled first before enabling the plane * because changing at the same time does not guarantee that * the plane will also enabled or disabled. @@ -45,16 +43,13 @@ static void setDisplayControl(int ctrl, int dispState) * until a few delay. Need to write * and read it a couple times */ - do - { + do { cnt++; POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg); } while ((PEEK32(PANEL_DISPLAY_CTRL) & ~ulReservedBits) != (ulDisplayCtrlReg & ~ulReservedBits)); printk("Set Panel Plane enbit:after tried %d times\n", cnt); - } - else - { + } else { /* When turning off, there is no rule on the programming * sequence since whenever the clock is off, then it does not * matter whether the plane is enabled or disabled. @@ -71,14 +66,11 @@ static void setDisplayControl(int ctrl, int dispState) POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg); } - } /* Set the secondary display control */ - else - { + } else { ulDisplayCtrlReg = PEEK32(CRT_DISPLAY_CTRL); - if (dispState) - { + if (dispState) { /* Timing should be enabled first before enabling the plane because changing at the same time does not guarantee that the plane will also enabled or disabled. */ @@ -100,16 +92,13 @@ static void setDisplayControl(int ctrl, int dispState) FIELD_SET(0, CRT_DISPLAY_CTR
[PATCH 2/4] staging: sm750fb: fix spacing issues
Fix spacing errors and warnings caught by checkpatch.pl ERROR: space prohibited after that open parenthesis '(' ERROR: space required before the open brace '{' ERROR: need consistent spacing around ERROR: trailing whitespace WARNING: unnecessary whitespace before a quoted newline Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_chip.c| 14 ++-- drivers/staging/sm750fb/ddk750_display.c | 22 +++--- drivers/staging/sm750fb/ddk750_display.h | 6 +- drivers/staging/sm750fb/ddk750_dvi.c | 4 +- drivers/staging/sm750fb/ddk750_help.c| 2 +- drivers/staging/sm750fb/ddk750_mode.c| 16 ++--- drivers/staging/sm750fb/ddk750_power.c | 18 ++--- drivers/staging/sm750fb/sm750.c | 2 +- drivers/staging/sm750fb/sm750.h | 34 - drivers/staging/sm750fb/sm750_accel.c| 26 +++ drivers/staging/sm750fb/sm750_cursor.c | 40 +-- drivers/staging/sm750fb/sm750_help.h | 4 +- drivers/staging/sm750fb/sm750_hw.c | 120 +++ drivers/staging/sm750fb/sm750_hw.h | 14 ++-- 14 files changed, 158 insertions(+), 164 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index f4975d2..d7435d7 100644 --- a/drivers/staging/sm750fb/ddk750_chip.c +++ b/drivers/staging/sm750fb/ddk750_chip.c @@ -268,7 +268,7 @@ int ddk750_initHw(initchip_param_t *pInitParam) #endif - if (pInitParam->powerMode != 0 ) + if (pInitParam->powerMode != 0) pInitParam->powerMode = 0; setPowerMode(pInitParam->powerMode); @@ -464,17 +464,17 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll) RN = N * request; quo = RN / input; rem = RN % input;/* rem always small than 14318181 */ - fl_quo = (rem * 1 /input); + fl_quo = (rem * 1 / input); for (d = xcnt - 1; d >= 0; d--) { X = xparm[d].value; M = quo*X; M += fl_quo * X / 1; /* round step */ - M += (fl_quo*X % 1)>5000?1:0; + M += (fl_quo*X % 1) > 5000?1:0; if (M < 256 && M > 0) { unsigned int diff; - tmpClock = pll->inputFreq *M / N / X; + tmpClock = pll->inputFreq * M / N / X; diff = absDiff(tmpClock, request_orig); if (diff < miniDiff) { pll->M = M; @@ -599,9 +599,9 @@ unsigned int formatPllReg(pll_value_t *pPLL) On returning a 32 bit number, the value can be applied to any PLL in the calling function. */ ulPllReg = - FIELD_SET( 0, PANEL_PLL_CTRL, BYPASS, OFF) - | FIELD_SET( 0, PANEL_PLL_CTRL, POWER, ON) - | FIELD_SET( 0, PANEL_PLL_CTRL, INPUT, OSC) + FIELD_SET(0, PANEL_PLL_CTRL, BYPASS, OFF) + | FIELD_SET(0, PANEL_PLL_CTRL, POWER, ON) + | FIELD_SET(0, PANEL_PLL_CTRL, INPUT, OSC) #ifndef VALIDATION_CHIP | FIELD_VALUE(0, PANEL_PLL_CTRL, POD,pPLL->POD) #endif diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index 1c4049f..4a3cb86 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -49,7 +49,7 @@ static void setDisplayControl(int ctrl, int dispState) { cnt++; POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg); - } while((PEEK32(PANEL_DISPLAY_CTRL) & ~ulReservedBits) != + } while ((PEEK32(PANEL_DISPLAY_CTRL) & ~ulReservedBits) != (ulDisplayCtrlReg & ~ulReservedBits)); printk("Set Panel Plane enbit:after tried %d times\n", cnt); } @@ -104,7 +104,7 @@ static void setDisplayControl(int ctrl, int dispState) { cnt++; POKE32(CRT_DISPLAY_CTRL, ulDisplayCtrlReg); - } while((PEEK32(CRT_DISPLAY_CTRL) & ~ulReservedBits) != + } while ((PEEK32(CRT_DISPLAY_CTRL) & ~ulReservedBits) != (ulDisplayCtrlReg & ~ulReservedBits)); printk("Set Crt Plane enbit:after tried %d times\n", cnt); } @@ -132,7 +132,7 @@ static void setDisplayControl(int ctrl, int dispState) static void waitNextVerticalSync(int ctrl, int delay) { unsigned int status; - if(!ctrl){ + if (!ctrl) { /* primary contro
[PATCH 4/4] staging: sm750fb: add missing blank line after declarations
fixes checkpatch.pl WARNING: Missing a blank line after declarations Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_chip.c| 1 + drivers/staging/sm750fb/ddk750_display.c | 2 ++ drivers/staging/sm750fb/ddk750_dvi.c | 1 + drivers/staging/sm750fb/ddk750_mode.c| 3 +++ drivers/staging/sm750fb/ddk750_power.c | 1 + drivers/staging/sm750fb/ddk750_sii164.c | 1 + 6 files changed, 9 insertions(+) diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index d7435d7..5e6798e 100644 --- a/drivers/staging/sm750fb/ddk750_chip.c +++ b/drivers/staging/sm750fb/ddk750_chip.c @@ -474,6 +474,7 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll) M += (fl_quo*X % 1) > 5000?1:0; if (M < 256 && M > 0) { unsigned int diff; + tmpClock = pll->inputFreq * M / N / X; diff = absDiff(tmpClock, request_orig); if (diff < miniDiff) { diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index 90c5c9e..70e7f10 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -121,6 +121,7 @@ static void setDisplayControl(int ctrl, int dispState) static void waitNextVerticalSync(int ctrl, int delay) { unsigned int status; + if (!ctrl) { /* primary controller */ @@ -210,6 +211,7 @@ static void swPanelPowerSequence(int disp, int delay) void ddk750_setLogicalDispOut(disp_output_t output) { unsigned int reg; + if (output & PNL_2_USAGE) { /* set panel path controller select */ reg = PEEK32(PANEL_DISPLAY_CTRL); diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c index a18bb4c..a7a2351 100644 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ b/drivers/staging/sm750fb/ddk750_dvi.c @@ -43,6 +43,7 @@ int dviInit( ) { dvi_ctrl_device_t *pCurrentDviCtrl; + pCurrentDviCtrl = g_dcftSupportedDviController; if (pCurrentDviCtrl->pfnInit != NULL) { return pCurrentDviCtrl->pfnInit(edgeSelect, busSelect, dualEdgeClkSelect, hsyncEnable, diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c index 9d10446..2399b17 100644 --- a/drivers/staging/sm750fb/ddk750_mode.c +++ b/drivers/staging/sm750fb/ddk750_mode.c @@ -80,6 +80,7 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll) int ret = 0; int cnt = 0; unsigned int ulTmpValue, ulReg; + if (pll->clockType == SECONDARY_PLL) { /* programe secondary pixel clock */ POKE32(CRT_PLL_CTRL, formatPllReg(pll)); @@ -120,6 +121,7 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll) } else if (pll->clockType == PRIMARY_PLL) { unsigned int ulReservedBits; + POKE32(PANEL_PLL_CTRL, formatPllReg(pll)); POKE32(PANEL_HORIZONTAL_TOTAL, @@ -184,6 +186,7 @@ int ddk750_setModeTiming(mode_parameter_t *parm, clock_type_t clock) { pll_value_t pll; unsigned int uiActualPixelClk; + pll.inputFreq = DEFAULT_INPUT_CLOCK; pll.clockType = clock; diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c index c545c2d..c8c51be 100644 --- a/drivers/staging/sm750fb/ddk750_power.c +++ b/drivers/staging/sm750fb/ddk750_power.c @@ -5,6 +5,7 @@ void ddk750_setDPMS(DPMS_t state) { unsigned int value; + if (getChipType() == SM750LE) { value = PEEK32(CRT_DISPLAY_CTRL); POKE32(CRT_DISPLAY_CTRL, FIELD_VALUE(value, CRT_DISPLAY_CTRL, DPMS, state)); diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c index 3c55df1..e476584 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.c +++ b/drivers/staging/sm750fb/ddk750_sii164.c @@ -334,6 +334,7 @@ static void sii164SelectHotPlugDetectionMode(sii164_hot_plug_mode_t hotPlugMode) void sii164EnableHotPlugDetection(unsigned char enableHotPlug) { unsigned char detectReg; + detectReg = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT); /* Depending on each DVI controller, need to enable the hot plug based on each -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/4] staging: sm750fb: use tabs for indentation
Replace spaces with tabs for indentation to fix the checkpatch.pl error ERROR: code indent should use tabs where possible WARNING: please, no spaces at the start of a line Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_display.c | 100 drivers/staging/sm750fb/ddk750_display.h | 2 +- drivers/staging/sm750fb/ddk750_dvi.c | 66 ++--- drivers/staging/sm750fb/ddk750_help.h| 4 +- drivers/staging/sm750fb/ddk750_hwi2c.c | 246 +-- drivers/staging/sm750fb/ddk750_mode.c| 142 +-- drivers/staging/sm750fb/ddk750_mode.h| 46 ++-- drivers/staging/sm750fb/ddk750_power.c | 254 ++-- drivers/staging/sm750fb/ddk750_power.h | 8 +- drivers/staging/sm750fb/ddk750_reg.h | 18 +- drivers/staging/sm750fb/ddk750_sii164.c | 399 +++ drivers/staging/sm750fb/ddk750_sii164.h | 29 ++- drivers/staging/sm750fb/sm750.h | 24 +- drivers/staging/sm750fb/sm750_accel.c| 364 ++-- drivers/staging/sm750fb/sm750_accel.h| 4 +- drivers/staging/sm750fb/sm750_help.h | 26 +- drivers/staging/sm750fb/sm750_hw.c | 70 +++--- drivers/staging/sm750fb/sm750_hw.h | 28 +-- 18 files changed, 908 insertions(+), 922 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index a3e6720..1c4049f 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -24,7 +24,7 @@ static void setDisplayControl(int ctrl, int dispState) /* Timing should be enabled first before enabling the plane * because changing at the same time does not guarantee that * the plane will also enabled or disabled. -*/ +*/ ulDisplayCtrlReg = FIELD_SET(ulDisplayCtrlReg, PANEL_DISPLAY_CTRL, TIMING, ENABLE); POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg); @@ -135,8 +135,8 @@ static void waitNextVerticalSync(int ctrl, int delay) if(!ctrl){ /* primary controller */ -/* Do not wait when the Primary PLL is off or display control is already off. - This will prevent the software to wait forever. */ + /* Do not wait when the Primary PLL is off or display control is already off. + This will prevent the software to wait forever. */ if ((FIELD_GET(PEEK32(PANEL_PLL_CTRL), PANEL_PLL_CTRL, POWER) == PANEL_PLL_CTRL_POWER_OFF) || (FIELD_GET(PEEK32(PANEL_DISPLAY_CTRL), PANEL_DISPLAY_CTRL, TIMING) == @@ -145,26 +145,26 @@ static void waitNextVerticalSync(int ctrl, int delay) return; } -while (delay-- > 0) -{ -/* Wait for end of vsync. */ -do -{ -status = FIELD_GET(PEEK32(SYSTEM_CTRL), - SYSTEM_CTRL, - PANEL_VSYNC); -} -while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE); - -/* Wait for start of vsync. */ -do -{ -status = FIELD_GET(PEEK32(SYSTEM_CTRL), - SYSTEM_CTRL, - PANEL_VSYNC); -} -while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); -} + while (delay-- > 0) + { + /* Wait for end of vsync. */ + do + { + status = FIELD_GET(PEEK32(SYSTEM_CTRL), + SYSTEM_CTRL, + PANEL_VSYNC); + } + while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE); + + /* Wait for start of vsync. */ + do + { + status = FIELD_GET(PEEK32(SYSTEM_CTRL), + SYSTEM_CTRL, + PANEL_VSYNC); + } + while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); + } }else{ @@ -275,33 +275,33 @@ void ddk750_setLogicalDispOut(disp_output_t output) int ddk750_initDVIDisp(void) { -/* Initialize DVI. If the dviInit fail and the VendorID or the DeviceID are - not zeroed, then set the failure flag. If it is zeroe, it might mean - that the system is in Dual CRT Monitor configuration. */ - -/* De-skew enabled with default 111b value. - This will fix some artifacts problem in some mode on board 2.2. - Somehow this fi
Re: [PATCH 1/4] staging: sm750fb: use tabs for indentation
My apologies, I thought I removed all of those. Fixed for real this time, resending. Regards Juston On Sat, Jun 20, 2015 at 3:45 AM, Sudip Mukherjee wrote: > On Sat, Jun 20, 2015 at 01:48:32AM -0700, Juston Li wrote: >> Replace spaces with tabs for indentation to fix the checkpatch.pl error >> ERROR: code indent should use tabs where possible >> WARNING: please, no spaces at the start of a line >> >> Signed-off-by: Juston Li >> --- > >> diff --git a/drivers/staging/sm750fb/ddk750_sii164.c >> b/drivers/staging/sm750fb/ddk750_sii164.c >> index b6395b8..c09748c 100644 >> --- a/drivers/staging/sm750fb/ddk750_sii164.c >> +++ b/drivers/staging/sm750fb/ddk750_sii164.c > >> >> @@ -279,27 +279,25 @@ char *sii164GetChipString(void) >> * Input: >> * powerUp - Flag to set the power down or up >> */ >> -void sii164SetPower( >> -unsigned char powerUp >> -) >> +void sii164SetPower(unsigned char powerUp) > is it that same patch again? different kind of change should go in a separate > patch. > > regards > sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: sm750fb: use tabs for indentation
On Mon, Jun 22, 2015 at 10:46 AM, Dan Carpenter wrote: > On Fri, Jun 19, 2015 at 05:50:50PM -0700, Juston Li wrote: >> void sii164ClearInterrupt(void) >> { >> -unsigned char detectReg; >> + unsigned char detectReg; >> >> -/* Clear the MDI interrupt */ >> -detectReg = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT); >> -i2cWriteReg(SII164_I2C_ADDRESS, SII164_DETECT, detectReg | >> SII164_DETECT_MONITOR_STATE_CLEAR); > > The patch accidentally deletes this write. > >> + /* Clear the MDI interrupt */ >> + detectReg = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT); >> } > > regards, > dan carpenter This was fixed and patch is now included in the patchset: [PATCH v2 00/19] staging: sm750fb: checkpatch.pl fixes Regards Juston ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 00/19] staging: sm750fb: checkpatch.pl fixes
This patch set includes 19 patches fixing indentation, spacing, brace placement and missing blank lines from checkpatch.pl warnings/errors in staging/sm750fb. Regards Juston - Changes since v2: * Fix Subject * Don't rearrange lines in PATCH 01 * Split up spacing fixes patch by checkpatch errors into 14 patches * Split up brace fixes patch by checkpatch errors in 3 patches - Diffstat drivers/staging/sm750fb/ddk750_chip.c| 15 +- drivers/staging/sm750fb/ddk750_chip.h| 12 +- drivers/staging/sm750fb/ddk750_display.c | 168 + drivers/staging/sm750fb/ddk750_display.h | 11 +- drivers/staging/sm750fb/ddk750_dvi.c | 75 ++-- drivers/staging/sm750fb/ddk750_dvi.h | 3 +- drivers/staging/sm750fb/ddk750_help.c| 2 +- drivers/staging/sm750fb/ddk750_help.h| 4 +- drivers/staging/sm750fb/ddk750_hwi2c.c | 244 ++--- drivers/staging/sm750fb/ddk750_mode.c| 164 - drivers/staging/sm750fb/ddk750_mode.h| 52 +-- drivers/staging/sm750fb/ddk750_power.c | 254 +++--- drivers/staging/sm750fb/ddk750_power.h | 11 +- drivers/staging/sm750fb/ddk750_reg.h | 18 +- drivers/staging/sm750fb/ddk750_sii164.c | 389 +++-- drivers/staging/sm750fb/ddk750_sii164.h | 31 +- drivers/staging/sm750fb/sm750.c | 2 +- drivers/staging/sm750fb/sm750.h | 56 +-- drivers/staging/sm750fb/sm750_accel.c| 379 ++-- drivers/staging/sm750fb/sm750_accel.h| 4 +- drivers/staging/sm750fb/sm750_cursor.c | 51 +-- drivers/staging/sm750fb/sm750_help.h | 28 +- drivers/staging/sm750fb/sm750_hw.c | 218 ++-- drivers/staging/sm750fb/sm750_hw.h | 42 +-- 24 files changed, 1154 insertions(+), 1079 deletions(-) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 02/19] staging: sm750fb: remove spacing after open parenthesis
fixes checkpatch.pl warning: ERROR: space prohibited after that open parenthesis '(' Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_chip.c | 6 +++--- drivers/staging/sm750fb/ddk750_mode.c | 2 +- drivers/staging/sm750fb/ddk750_power.c | 8 drivers/staging/sm750fb/sm750_help.h | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index f4975d2..1069a2d 100644 --- a/drivers/staging/sm750fb/ddk750_chip.c +++ b/drivers/staging/sm750fb/ddk750_chip.c @@ -599,9 +599,9 @@ unsigned int formatPllReg(pll_value_t *pPLL) On returning a 32 bit number, the value can be applied to any PLL in the calling function. */ ulPllReg = - FIELD_SET( 0, PANEL_PLL_CTRL, BYPASS, OFF) - | FIELD_SET( 0, PANEL_PLL_CTRL, POWER, ON) - | FIELD_SET( 0, PANEL_PLL_CTRL, INPUT, OSC) + FIELD_SET(0, PANEL_PLL_CTRL, BYPASS, OFF) + | FIELD_SET(0, PANEL_PLL_CTRL, POWER, ON) + | FIELD_SET(0, PANEL_PLL_CTRL, INPUT, OSC) #ifndef VALIDATION_CHIP | FIELD_VALUE(0, PANEL_PLL_CTRL, POD,pPLL->POD) #endif diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c index 1f93d07..31424b2 100644 --- a/drivers/staging/sm750fb/ddk750_mode.c +++ b/drivers/staging/sm750fb/ddk750_mode.c @@ -43,7 +43,7 @@ static unsigned long displayControlAdjust_SM750LE(mode_parameter_t *pModeParam, /* Set bit 29:27 of display control register for the right clock */ /* Note that SM750LE only need to supported 7 resoluitons. */ - if ( x == 800 && y == 600 ) + if (x == 800 && y == 600 ) dispControl = FIELD_SET(dispControl, CRT_DISPLAY_CTRL, CLK, PLL41); else if (x == 1024 && y == 768) dispControl = FIELD_SET(dispControl, CRT_DISPLAY_CTRL, CLK, PLL65); diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c index b7a108b..44b8eb1 100644 --- a/drivers/staging/sm750fb/ddk750_power.c +++ b/drivers/staging/sm750fb/ddk750_power.c @@ -59,17 +59,17 @@ void setPowerMode(unsigned int powerMode) { control_value = #ifdef VALIDATION_CHIP - FIELD_SET( control_value, POWER_MODE_CTRL, 336CLK, OFF) | + FIELD_SET(control_value, POWER_MODE_CTRL, 336CLK, OFF) | #endif - FIELD_SET( control_value, POWER_MODE_CTRL, OSC_INPUT, OFF); + FIELD_SET(control_value, POWER_MODE_CTRL, OSC_INPUT, OFF); } else { control_value = #ifdef VALIDATION_CHIP - FIELD_SET( control_value, POWER_MODE_CTRL, 336CLK, ON) | + FIELD_SET(control_value, POWER_MODE_CTRL, 336CLK, ON) | #endif - FIELD_SET( control_value, POWER_MODE_CTRL, OSC_INPUT, ON); + FIELD_SET(control_value, POWER_MODE_CTRL, OSC_INPUT, ON); } /* Program new power mode. */ diff --git a/drivers/staging/sm750fb/sm750_help.h b/drivers/staging/sm750fb/sm750_help.h index 8ba4f8d..ac0744e 100644 --- a/drivers/staging/sm750fb/sm750_help.h +++ b/drivers/staging/sm750fb/sm750_help.h @@ -43,7 +43,7 @@ #define FIELD_CLEAR(reg, field) \ ( \ - ~ _F_MASK(reg ## _ ## field) \ + ~_F_MASK(reg ## _ ## field) \ ) /* Field Macros */ -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 01/19] staging: sm750fb: use tabs for indentation
Replace spaces with tabs for indentation to fix the checkpatch.pl error ERROR: code indent should use tabs where possible WARNING: please, no spaces at the start of a line Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_display.c | 100 drivers/staging/sm750fb/ddk750_display.h | 2 +- drivers/staging/sm750fb/ddk750_dvi.c | 66 +++--- drivers/staging/sm750fb/ddk750_help.h| 4 +- drivers/staging/sm750fb/ddk750_hwi2c.c | 246 +-- drivers/staging/sm750fb/ddk750_mode.c| 142 +-- drivers/staging/sm750fb/ddk750_mode.h| 46 ++-- drivers/staging/sm750fb/ddk750_power.c | 254 ++-- drivers/staging/sm750fb/ddk750_power.h | 8 +- drivers/staging/sm750fb/ddk750_reg.h | 18 +- drivers/staging/sm750fb/ddk750_sii164.c | 394 +++ drivers/staging/sm750fb/ddk750_sii164.h | 28 +-- drivers/staging/sm750fb/sm750.h | 24 +- drivers/staging/sm750fb/sm750_accel.c| 370 ++--- drivers/staging/sm750fb/sm750_accel.h| 4 +- drivers/staging/sm750fb/sm750_help.h | 26 +- drivers/staging/sm750fb/sm750_hw.c | 70 +++--- drivers/staging/sm750fb/sm750_hw.h | 28 +-- 18 files changed, 915 insertions(+), 915 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index a3e6720..1c4049f 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -24,7 +24,7 @@ static void setDisplayControl(int ctrl, int dispState) /* Timing should be enabled first before enabling the plane * because changing at the same time does not guarantee that * the plane will also enabled or disabled. -*/ +*/ ulDisplayCtrlReg = FIELD_SET(ulDisplayCtrlReg, PANEL_DISPLAY_CTRL, TIMING, ENABLE); POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg); @@ -135,8 +135,8 @@ static void waitNextVerticalSync(int ctrl, int delay) if(!ctrl){ /* primary controller */ -/* Do not wait when the Primary PLL is off or display control is already off. - This will prevent the software to wait forever. */ + /* Do not wait when the Primary PLL is off or display control is already off. + This will prevent the software to wait forever. */ if ((FIELD_GET(PEEK32(PANEL_PLL_CTRL), PANEL_PLL_CTRL, POWER) == PANEL_PLL_CTRL_POWER_OFF) || (FIELD_GET(PEEK32(PANEL_DISPLAY_CTRL), PANEL_DISPLAY_CTRL, TIMING) == @@ -145,26 +145,26 @@ static void waitNextVerticalSync(int ctrl, int delay) return; } -while (delay-- > 0) -{ -/* Wait for end of vsync. */ -do -{ -status = FIELD_GET(PEEK32(SYSTEM_CTRL), - SYSTEM_CTRL, - PANEL_VSYNC); -} -while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE); - -/* Wait for start of vsync. */ -do -{ -status = FIELD_GET(PEEK32(SYSTEM_CTRL), - SYSTEM_CTRL, - PANEL_VSYNC); -} -while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); -} + while (delay-- > 0) + { + /* Wait for end of vsync. */ + do + { + status = FIELD_GET(PEEK32(SYSTEM_CTRL), + SYSTEM_CTRL, + PANEL_VSYNC); + } + while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE); + + /* Wait for start of vsync. */ + do + { + status = FIELD_GET(PEEK32(SYSTEM_CTRL), + SYSTEM_CTRL, + PANEL_VSYNC); + } + while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); + } }else{ @@ -275,33 +275,33 @@ void ddk750_setLogicalDispOut(disp_output_t output) int ddk750_initDVIDisp(void) { -/* Initialize DVI. If the dviInit fail and the VendorID or the DeviceID are - not zeroed, then set the failure flag. If it is zeroe, it might mean - that the system is in Dual CRT Monitor configuration. */ - -/* De-skew enabled with default 111b value. - This will fix some artifacts problem in some mode on board 2.2. - Somehow th
[PATCH v3 05/19] staging: sm750fb: remove space between function name and parenthesis
fixes checkpatch.pl warning: WARNING: space prohibited between function name and open parenthesis '(' Signed-off-by: Juston Li --- drivers/staging/sm750fb/sm750_accel.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index 3c61103..bb96ea5 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -278,11 +278,11 @@ unsigned int rop2) /* ROP value */ { write_dpr(accel, DE_SOURCE, - FIELD_SET (0, DE_SOURCE, WRAP, DISABLE) | + FIELD_SET(0, DE_SOURCE, WRAP, DISABLE) | FIELD_VALUE(0, DE_SOURCE, X_K1, sx) | FIELD_VALUE(0, DE_SOURCE, Y_K2, sy)); /* dpr0 */ write_dpr(accel, DE_DESTINATION, - FIELD_SET (0, DE_DESTINATION, WRAP, DISABLE) | + FIELD_SET(0, DE_DESTINATION, WRAP, DISABLE) | FIELD_VALUE(0, DE_DESTINATION, X,dx) | FIELD_VALUE(0, DE_DESTINATION, Y,dy)); /* dpr04 */ write_dpr(accel, DE_DIMENSION, @@ -390,11 +390,11 @@ int hw_imageblit(struct lynx_accel *accel, /* Note: For 2D Source in Host Write, only X_K1_MONO field is needed, and Y_K2 field is not used. For mono bitmap, use startBit for X_K1. */ write_dpr(accel, DE_SOURCE, - FIELD_SET (0, DE_SOURCE, WRAP, DISABLE) | + FIELD_SET(0, DE_SOURCE, WRAP, DISABLE) | FIELD_VALUE(0, DE_SOURCE, X_K1_MONO, startBit)); /* dpr00 */ write_dpr(accel, DE_DESTINATION, - FIELD_SET (0, DE_DESTINATION, WRAP, DISABLE) | + FIELD_SET(0, DE_DESTINATION, WRAP, DISABLE) | FIELD_VALUE(0, DE_DESTINATION, X,dx)| FIELD_VALUE(0, DE_DESTINATION, Y,dy)); /* dpr04 */ -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 04/19] staging: sm750fb: add space before open parenthesis
fixes checkpatch.pl error: ERROR: space required before the open parenthesis '(' Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_display.c | 20 +-- drivers/staging/sm750fb/ddk750_dvi.c | 2 +- drivers/staging/sm750fb/ddk750_help.c| 2 +- drivers/staging/sm750fb/ddk750_mode.c| 12 +++ drivers/staging/sm750fb/ddk750_power.c | 6 ++-- drivers/staging/sm750fb/sm750_accel.c| 8 ++--- drivers/staging/sm750fb/sm750_cursor.c | 32 - drivers/staging/sm750fb/sm750_help.h | 2 +- drivers/staging/sm750fb/sm750_hw.c | 62 9 files changed, 73 insertions(+), 73 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index 1c4049f..973dec3 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -49,7 +49,7 @@ static void setDisplayControl(int ctrl, int dispState) { cnt++; POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg); - } while((PEEK32(PANEL_DISPLAY_CTRL) & ~ulReservedBits) != + } while ((PEEK32(PANEL_DISPLAY_CTRL) & ~ulReservedBits) != (ulDisplayCtrlReg & ~ulReservedBits)); printk("Set Panel Plane enbit:after tried %d times\n", cnt); } @@ -104,7 +104,7 @@ static void setDisplayControl(int ctrl, int dispState) { cnt++; POKE32(CRT_DISPLAY_CTRL, ulDisplayCtrlReg); - } while((PEEK32(CRT_DISPLAY_CTRL) & ~ulReservedBits) != + } while ((PEEK32(CRT_DISPLAY_CTRL) & ~ulReservedBits) != (ulDisplayCtrlReg & ~ulReservedBits)); printk("Set Crt Plane enbit:after tried %d times\n", cnt); } @@ -132,7 +132,7 @@ static void setDisplayControl(int ctrl, int dispState) static void waitNextVerticalSync(int ctrl, int delay) { unsigned int status; - if(!ctrl){ + if (!ctrl){ /* primary controller */ /* Do not wait when the Primary PLL is off or display control is already off. @@ -233,14 +233,14 @@ static void swPanelPowerSequence(int disp, int delay) void ddk750_setLogicalDispOut(disp_output_t output) { unsigned int reg; - if(output & PNL_2_USAGE){ + if (output & PNL_2_USAGE){ /* set panel path controller select */ reg = PEEK32(PANEL_DISPLAY_CTRL); reg = FIELD_VALUE(reg, PANEL_DISPLAY_CTRL, SELECT, (output & PNL_2_MASK)>>PNL_2_OFFSET); POKE32(PANEL_DISPLAY_CTRL, reg); } - if(output & CRT_2_USAGE){ + if (output & CRT_2_USAGE){ /* set crt path controller select */ reg = PEEK32(CRT_DISPLAY_CTRL); reg = FIELD_VALUE(reg, CRT_DISPLAY_CTRL, SELECT, (output & CRT_2_MASK)>>CRT_2_OFFSET); @@ -250,25 +250,25 @@ void ddk750_setLogicalDispOut(disp_output_t output) } - if(output & PRI_TP_USAGE){ + if (output & PRI_TP_USAGE){ /* set primary timing and plane en_bit */ setDisplayControl(0, (output&PRI_TP_MASK)>>PRI_TP_OFFSET); } - if(output & SEC_TP_USAGE){ + if (output & SEC_TP_USAGE){ /* set secondary timing and plane en_bit*/ setDisplayControl(1, (output&SEC_TP_MASK)>>SEC_TP_OFFSET); } - if(output & PNL_SEQ_USAGE){ + if (output & PNL_SEQ_USAGE){ /* set panel sequence */ swPanelPowerSequence((output&PNL_SEQ_MASK)>>PNL_SEQ_OFFSET, 4); } - if(output & DAC_USAGE) + if (output & DAC_USAGE) setDAC((output & DAC_MASK)>>DAC_OFFSET); - if(output & DPMS_USAGE) + if (output & DPMS_USAGE) ddk750_setDPMS((output & DPMS_MASK) >> DPMS_OFFSET); } diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c index 35866fa..4c64436 100644 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ b/drivers/staging/sm750fb/ddk750_dvi.c @@ -45,7 +45,7 @@ int dviInit( { dvi_ctrl_device_t *pCurrentDviCtrl; pCurrentDviCtrl = g_dcftSupportedDviController; - if(pCurrentDviCtrl->pfnInit != NULL) + if (pCurrentDviCtrl->pfnInit != NULL) { return pCurrentDviCtrl->pfnInit(edgeSelect, busSelect, dualEdgeClkSelect, hsyncEnable, vsyncEnable, deskewEnable, deskewSetting, continuousSyncEnable, diff -
[PATCH v3 03/19] staging: sm750fb: remove space before close parenthesis
fixes checkpatch.pl error: ERROR: space prohibited before that close parenthesis ')' Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_chip.c | 2 +- drivers/staging/sm750fb/ddk750_mode.c | 2 +- drivers/staging/sm750fb/sm750_accel.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index 1069a2d..fb1c533 100644 --- a/drivers/staging/sm750fb/ddk750_chip.c +++ b/drivers/staging/sm750fb/ddk750_chip.c @@ -268,7 +268,7 @@ int ddk750_initHw(initchip_param_t *pInitParam) #endif - if (pInitParam->powerMode != 0 ) + if (pInitParam->powerMode != 0) pInitParam->powerMode = 0; setPowerMode(pInitParam->powerMode); diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c index 31424b2..4ee9ceb 100644 --- a/drivers/staging/sm750fb/ddk750_mode.c +++ b/drivers/staging/sm750fb/ddk750_mode.c @@ -43,7 +43,7 @@ static unsigned long displayControlAdjust_SM750LE(mode_parameter_t *pModeParam, /* Set bit 29:27 of display control register for the right clock */ /* Note that SM750LE only need to supported 7 resoluitons. */ - if (x == 800 && y == 600 ) + if (x == 800 && y == 600) dispControl = FIELD_SET(dispControl, CRT_DISPLAY_CTRL, CLK, PLL41); else if (x == 1024 && y == 768) dispControl = FIELD_SET(dispControl, CRT_DISPLAY_CTRL, CLK, PLL65); diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index 668258c..ed82813 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -363,7 +363,7 @@ int hw_imageblit(struct lynx_accel *accel, Note that input pitch is BYTE value, but the 2D Pitch register uses pixel values. Need Byte to pixel conversion. */ - if(bytePerPixel == 3 ){ + if(bytePerPixel == 3){ dx *= 3; width *= 3; startBit *= 3; -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 07/19] staging: sm750fb: add space after close brace
fixes checkpatch.pl error: ERROR: space required after that close brace '}' Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_display.c | 2 +- drivers/staging/sm750fb/ddk750_mode.c| 2 +- drivers/staging/sm750fb/ddk750_power.c | 2 +- drivers/staging/sm750fb/sm750.h | 2 +- drivers/staging/sm750fb/sm750_cursor.c | 8 drivers/staging/sm750fb/sm750_hw.c | 16 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index c7171a4..4a3cb86 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -166,7 +166,7 @@ static void waitNextVerticalSync(int ctrl, int delay) while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); } - }else { + } else { /* Do not wait when the Primary PLL is off or display control is already off. This will prevent the software to wait forever. */ diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c index efc1fab..3d8b06d 100644 --- a/drivers/staging/sm750fb/ddk750_mode.c +++ b/drivers/staging/sm750fb/ddk750_mode.c @@ -109,7 +109,7 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll) if (getChipType() == SM750LE) { displayControlAdjust_SM750LE(pModeParam, ulTmpValue); - }else { + } else { ulReg = PEEK32(CRT_DISPLAY_CTRL) & FIELD_CLEAR(CRT_DISPLAY_CTRL, VSYNC_PHASE) & FIELD_CLEAR(CRT_DISPLAY_CTRL, HSYNC_PHASE) diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c index e2c0bb3..5f697b8 100644 --- a/drivers/staging/sm750fb/ddk750_power.c +++ b/drivers/staging/sm750fb/ddk750_power.c @@ -8,7 +8,7 @@ void ddk750_setDPMS(DPMS_t state) if (getChipType() == SM750LE) { value = PEEK32(CRT_DISPLAY_CTRL); POKE32(CRT_DISPLAY_CTRL, FIELD_VALUE(value, CRT_DISPLAY_CTRL, DPMS, state)); - }else { + } else { value = PEEK32(SYSTEM_CTRL); value= FIELD_VALUE(value, SYSTEM_CTRL, DPMS, state); POKE32(SYSTEM_CTRL, value); diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index bf894cc..3785afc 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -53,7 +53,7 @@ struct lynx_share{ int mtrr_off; struct{ int vram; - }mtrr; + } mtrr; /* all smi graphic adaptor got below attributes */ unsigned long vidmem_start; unsigned long vidreg_start; diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c index 3a21af9..2fcec32 100644 --- a/drivers/staging/sm750fb/sm750_cursor.c +++ b/drivers/staging/sm750fb/sm750_cursor.c @@ -143,7 +143,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor, if (opr & (0x80 >> j)) { /* use fg color,id = 2 */ data |= 2 << (j*2); - }else { + } else { /* use bg color,id = 1 */ data |= 1 << (j*2); } @@ -173,7 +173,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor, /* need a return */ pstart += offset; pbuffer = pstart; - }else { + } else { pbuffer += sizeof(u16); } @@ -223,7 +223,7 @@ void hw_cursor_setData2(struct lynx_cursor *cursor, if (opr & (0x80 >> j)) { /* use fg color,id = 2 */ data |= 2 << (j*2); - }else { + } else { /* use bg color,id = 1 */ data |= 1 << (j*2); } @@ -242,7 +242,7 @@ void hw_cursor_setData2(struct lynx_cursor *cursor, /* need a return */ pstart += offset; pbuffer = pstart; - }else { + } else { pbuffer += sizeof(u16); } diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index 4dfc6e6..a43f936 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -56,7 +56,7 @@ int hw_sm750_map(struct lynx_share* share, struct pci_dev* pdev)
[PATCH v3 06/19] staging: sm750fb: add space before open brace
fixes checkpatch.pl error: ERROR: space required before the open brace '{' Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_display.c | 14 drivers/staging/sm750fb/ddk750_mode.c| 8 ++--- drivers/staging/sm750fb/ddk750_power.c | 4 +-- drivers/staging/sm750fb/sm750_accel.c| 6 ++-- drivers/staging/sm750fb/sm750_cursor.c | 14 drivers/staging/sm750fb/sm750_hw.c | 56 6 files changed, 51 insertions(+), 51 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index 973dec3..c7171a4 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -132,7 +132,7 @@ static void setDisplayControl(int ctrl, int dispState) static void waitNextVerticalSync(int ctrl, int delay) { unsigned int status; - if (!ctrl){ + if (!ctrl) { /* primary controller */ /* Do not wait when the Primary PLL is off or display control is already off. @@ -166,7 +166,7 @@ static void waitNextVerticalSync(int ctrl, int delay) while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); } - }else{ + }else { /* Do not wait when the Primary PLL is off or display control is already off. This will prevent the software to wait forever. */ @@ -233,14 +233,14 @@ static void swPanelPowerSequence(int disp, int delay) void ddk750_setLogicalDispOut(disp_output_t output) { unsigned int reg; - if (output & PNL_2_USAGE){ + if (output & PNL_2_USAGE) { /* set panel path controller select */ reg = PEEK32(PANEL_DISPLAY_CTRL); reg = FIELD_VALUE(reg, PANEL_DISPLAY_CTRL, SELECT, (output & PNL_2_MASK)>>PNL_2_OFFSET); POKE32(PANEL_DISPLAY_CTRL, reg); } - if (output & CRT_2_USAGE){ + if (output & CRT_2_USAGE) { /* set crt path controller select */ reg = PEEK32(CRT_DISPLAY_CTRL); reg = FIELD_VALUE(reg, CRT_DISPLAY_CTRL, SELECT, (output & CRT_2_MASK)>>CRT_2_OFFSET); @@ -250,17 +250,17 @@ void ddk750_setLogicalDispOut(disp_output_t output) } - if (output & PRI_TP_USAGE){ + if (output & PRI_TP_USAGE) { /* set primary timing and plane en_bit */ setDisplayControl(0, (output&PRI_TP_MASK)>>PRI_TP_OFFSET); } - if (output & SEC_TP_USAGE){ + if (output & SEC_TP_USAGE) { /* set secondary timing and plane en_bit*/ setDisplayControl(1, (output&SEC_TP_MASK)>>SEC_TP_OFFSET); } - if (output & PNL_SEQ_USAGE){ + if (output & PNL_SEQ_USAGE) { /* set panel sequence */ swPanelPowerSequence((output&PNL_SEQ_MASK)>>PNL_SEQ_OFFSET, 4); } diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c index cfe528c..efc1fab 100644 --- a/drivers/staging/sm750fb/ddk750_mode.c +++ b/drivers/staging/sm750fb/ddk750_mode.c @@ -107,9 +107,9 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll) FIELD_SET(0, CRT_DISPLAY_CTRL, PLANE, ENABLE); - if (getChipType() == SM750LE){ + if (getChipType() == SM750LE) { displayControlAdjust_SM750LE(pModeParam, ulTmpValue); - }else{ + }else { ulReg = PEEK32(CRT_DISPLAY_CTRL) & FIELD_CLEAR(CRT_DISPLAY_CTRL, VSYNC_PHASE) & FIELD_CLEAR(CRT_DISPLAY_CTRL, HSYNC_PHASE) @@ -179,7 +179,7 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll) } #endif } - else{ + else { ret = -1; } return ret; @@ -193,7 +193,7 @@ int ddk750_setModeTiming(mode_parameter_t *parm, clock_type_t clock) pll.clockType = clock; uiActualPixelClk = calcPllValue(parm->pixel_clock, &pll); - if (getChipType() == SM750LE){ + if (getChipType() == SM750LE) { /* set graphic mode via IO method */ outb_p(0x88, 0x3d4); outb_p(0x06, 0x3d5); diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c index a2d9ee6..e2c0bb3 100644 --- a/drivers/staging/sm750fb/ddk750_power.c +++ b/drivers/staging/sm750fb/ddk750_power.c @@ -5,10 +5,10 @@ void ddk750_setDPMS(DPMS_t state) { unsigned int value; - if (getChipType() == SM750LE){ + if (getChipType() == SM750LE) { value = PEEK32(CRT_DISPLAY_CTRL);
[PATCH v3 17/19] staging: sm750fb: move while statement to follow do close brace
fixes checkpatch.pl error: ERROR: while should follow close brace '}' Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_display.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index bd2be7f..90c5c9e 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -139,16 +139,14 @@ static void waitNextVerticalSync(int ctrl, int delay) status = FIELD_GET(PEEK32(SYSTEM_CTRL), SYSTEM_CTRL, PANEL_VSYNC); - } - while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE); + } while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE); /* Wait for start of vsync. */ do { status = FIELD_GET(PEEK32(SYSTEM_CTRL), SYSTEM_CTRL, PANEL_VSYNC); - } - while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); + } while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); } } else { @@ -168,16 +166,14 @@ static void waitNextVerticalSync(int ctrl, int delay) status = FIELD_GET(PEEK32(SYSTEM_CTRL), SYSTEM_CTRL, CRT_VSYNC); - } - while (status == SYSTEM_CTRL_CRT_VSYNC_ACTIVE); + } while (status == SYSTEM_CTRL_CRT_VSYNC_ACTIVE); /* Wait for start of vsync. */ do { status = FIELD_GET(PEEK32(SYSTEM_CTRL), SYSTEM_CTRL, CRT_VSYNC); - } - while (status == SYSTEM_CTRL_CRT_VSYNC_INACTIVE); + } while (status == SYSTEM_CTRL_CRT_VSYNC_INACTIVE); } } } -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 10/19] staging: sm750fb: add space after return type
fixes checkpatch.pl warning: WARNING: missing space after return type Signed-off-by: Juston Li --- drivers/staging/sm750fb/sm750.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index 124921e..320908bc 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -108,12 +108,12 @@ struct lynxfb_crtc { void *priv; - int(*proc_setMode)(struct lynxfb_crtc*, + int (*proc_setMode)(struct lynxfb_crtc*, struct fb_var_screeninfo*, struct fb_fix_screeninfo*); - int(*proc_checkMode)(struct lynxfb_crtc*, struct fb_var_screeninfo*); - int(*proc_setColReg)(struct lynxfb_crtc*, ushort, ushort, ushort, ushort); + int (*proc_checkMode)(struct lynxfb_crtc*, struct fb_var_screeninfo*); + int (*proc_setColReg)(struct lynxfb_crtc*, ushort, ushort, ushort, ushort); void (*clear)(struct lynxfb_crtc*); /* pan display */ int (*proc_panDisplay)(struct lynxfb_crtc *, @@ -140,12 +140,12 @@ struct lynxfb_output { */ void *priv; - int(*proc_setMode)(struct lynxfb_output*, + int (*proc_setMode)(struct lynxfb_output*, struct fb_var_screeninfo*, struct fb_fix_screeninfo*); - int(*proc_checkMode)(struct lynxfb_output*, struct fb_var_screeninfo*); - int(*proc_setBLANK)(struct lynxfb_output*, int); + int (*proc_checkMode)(struct lynxfb_output*, struct fb_var_screeninfo*); + int (*proc_setBLANK)(struct lynxfb_output*, int); void (*clear)(struct lynxfb_output*); }; -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 08/19] staging: sm750fb: add space after enum definition
fixes checkpatch.pl warning: WARNING: missing space after enum definition Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_display.h | 2 +- drivers/staging/sm750fb/sm750_hw.h | 8 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_display.h b/drivers/staging/sm750fb/ddk750_display.h index 018a661..a7f50cc 100644 --- a/drivers/staging/sm750fb/ddk750_display.h +++ b/drivers/staging/sm750fb/ddk750_display.h @@ -129,7 +129,7 @@ typedef enum _disp_output_t } disp_output_t; #else -typedef enum _disp_output_t{ +typedef 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 diff --git a/drivers/staging/sm750fb/sm750_hw.h b/drivers/staging/sm750fb/sm750_hw.h index adc61edf..af2db7c 100644 --- a/drivers/staging/sm750fb/sm750_hw.h +++ b/drivers/staging/sm750fb/sm750_hw.h @@ -9,7 +9,7 @@ #endif -enum sm750_pnltype{ +enum sm750_pnltype { sm750_24TFT = 0,/* 24bit tft */ @@ -19,7 +19,7 @@ enum sm750_pnltype{ }; /* vga channel is not concerned */ -enum sm750_dataflow{ +enum sm750_dataflow { sm750_simul_pri,/* primary => all head */ sm750_simul_sec,/* secondary => all head */ @@ -30,13 +30,13 @@ enum sm750_dataflow{ }; -enum sm750_channel{ +enum sm750_channel { sm750_primary = 0, /* enum value equal to the register filed data */ sm750_secondary = 1, }; -enum sm750_path{ +enum sm750_path { sm750_panel = 1, sm750_crt = 2, sm750_pnc = 3,/* panel and crt */ -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 11/19] staging: sm750fb: consistent spacing around operators
fixes checkpatch.pl error: ERROR: need consistent spacing around '' Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_chip.c| 4 ++-- drivers/staging/sm750fb/ddk750_display.h | 4 ++-- drivers/staging/sm750fb/sm750.h | 2 +- drivers/staging/sm750fb/sm750_hw.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index fb1c533..633201e 100644 --- a/drivers/staging/sm750fb/ddk750_chip.c +++ b/drivers/staging/sm750fb/ddk750_chip.c @@ -464,7 +464,7 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll) RN = N * request; quo = RN / input; rem = RN % input;/* rem always small than 14318181 */ - fl_quo = (rem * 1 /input); + fl_quo = (rem * 1 / input); for (d = xcnt - 1; d >= 0; d--) { X = xparm[d].value; @@ -474,7 +474,7 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll) M += (fl_quo*X % 1)>5000?1:0; if (M < 256 && M > 0) { unsigned int diff; - tmpClock = pll->inputFreq *M / N / X; + tmpClock = pll->inputFreq * M / N / X; diff = absDiff(tmpClock, request_orig); if (diff < miniDiff) { pll->M = M; diff --git a/drivers/staging/sm750fb/ddk750_display.h b/drivers/staging/sm750fb/ddk750_display.h index a7f50cc..afdf201 100644 --- a/drivers/staging/sm750fb/ddk750_display.h +++ b/drivers/staging/sm750fb/ddk750_display.h @@ -46,7 +46,7 @@ 0: both off */ #define SEC_TP_OFFSET 5 -#define SEC_TP_MASK (1<< SEC_TP_OFFSET) +#define SEC_TP_MASK (1 << SEC_TP_OFFSET) #define SEC_TP_USAGE (SEC_TP_MASK << 16) #define SEC_TP_ON ((0x1 << SEC_TP_OFFSET)|SEC_TP_USAGE) #define SEC_TP_OFF ((0x0 << SEC_TP_OFFSET)|SEC_TP_USAGE) @@ -67,7 +67,7 @@ #define DAC_OFFSET 7 #define DAC_MASK (1 << DAC_OFFSET) #define DAC_USAGE (DAC_MASK << 16) -#define DAC_ON ((0x0<< DAC_OFFSET)|DAC_USAGE) +#define DAC_ON ((0x0 << DAC_OFFSET)|DAC_USAGE) #define DAC_OFF ((0x1 << DAC_OFFSET)|DAC_USAGE) /* DPMS only affect D-SUB head diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index 320908bc..b0ff0b5 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -10,7 +10,7 @@ #define MB(x) ((x)<<20) #define MHZ(x) ((x) * 100) /* align should be 2,4,8,16 */ -#define PADDING(align, data) (((data)+(align)-1)&(~((align) -1))) +#define PADDING(align, data) (((data)+(align)-1)&(~((align) - 1))) extern int smi_indent; diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index a43f936..7a5d522 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -330,7 +330,7 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc* crtc, modparm.pixel_clock = ps_to_hz(var->pixclock); modparm.vertical_sync_polarity = (var->sync & FB_SYNC_HOR_HIGH_ACT) ? POS:NEG; modparm.horizontal_sync_polarity = (var->sync & FB_SYNC_VERT_HIGH_ACT) ? POS:NEG; - modparm.clock_phase_polarity = (var->sync& FB_SYNC_COMP_HIGH_ACT) ? POS:NEG; + modparm.clock_phase_polarity = (var->sync & FB_SYNC_COMP_HIGH_ACT) ? POS:NEG; modparm.horizontal_display_end = var->xres; modparm.horizontal_sync_width = var->hsync_len; modparm.horizontal_sync_start = var->xres + var->right_margin; @@ -369,7 +369,7 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc* crtc, FIELD_VALUE(0, PANEL_FB_WIDTH, OFFSET, fix->line_length)); POKE32(PANEL_WINDOW_WIDTH, - FIELD_VALUE(0, PANEL_WINDOW_WIDTH, WIDTH, var->xres -1)| + FIELD_VALUE(0, PANEL_WINDOW_WIDTH, WIDTH, var->xres - 1)| FIELD_VALUE(0, PANEL_WINDOW_WIDTH, X, var->xoffset)); POKE32(PANEL_WINDOW_HEIGHT, -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 18/19] staging: sm750fb: remove unnecessary braces
fixes checkpatch.pl warning: WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Juston Li --- drivers/staging/sm750fb/sm750_accel.c | 9 +++-- drivers/staging/sm750fb/sm750_hw.c| 6 ++ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index f7a617e..291a47b 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -259,9 +259,8 @@ unsigned int rop2) /* ROP value */ FIELD_VALUE(0, DE_WINDOW_WIDTH, DESTINATION, (dPitch/Bpp)) | FIELD_VALUE(0, DE_WINDOW_WIDTH, SOURCE, (sPitch/Bpp))); /* dpr3c */ - if (accel->de_wait() != 0) { + if (accel->de_wait() != 0) return -1; - } { @@ -332,9 +331,8 @@ int hw_imageblit(struct lynx_accel *accel, ul4BytesPerScan = ulBytesPerScan & ~3; ulBytesRemain = ulBytesPerScan & 3; - if (accel->de_wait() != 0) { + if (accel->de_wait() != 0) return -1; - } /* 2D Source Base. Use 0 for HOST Blt. @@ -402,9 +400,8 @@ int hw_imageblit(struct lynx_accel *accel, /* Write MONO data (line by line) to 2D Engine data port */ for (i = 0; i < height; i++) { /* For each line, send the data in chunks of 4 bytes */ - for (j = 0; j < (ul4BytesPerScan/4); j++) { + for (j = 0; j < (ul4BytesPerScan/4); j++) write_dpPort(accel, *(unsigned int *)(pSrcbuf + (j * 4))); - } if (ulBytesRemain) { memcpy(ajRemain, pSrcbuf+ul4BytesPerScan, ulBytesRemain); diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index 20a8d3b..97a0f63 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -187,9 +187,8 @@ int hw_sm750_inithw(struct lynx_share *share, struct pci_dev *pdev) } /* init 2d engine */ - if (!share->accel_off) { + if (!share->accel_off) hw_sm750_initAccel(share); - } return 0; } @@ -536,9 +535,8 @@ int hw_sm750_setBLANK(struct lynxfb_output* output, int blank) POKE32(CRT_DISPLAY_CTRL, FIELD_VALUE(PEEK32(CRT_DISPLAY_CTRL), CRT_DISPLAY_CTRL, BLANK, crtdb)); } - if (output->paths & sm750_panel) { + if (output->paths & sm750_panel) POKE32(PANEL_DISPLAY_CTRL, FIELD_VALUE(PEEK32(PANEL_DISPLAY_CTRL), PANEL_DISPLAY_CTRL, DATA, pps)); - } return 0; } -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 15/19] staging: sm750fb: remove unnecessary whitespace
fixes checkpatch.pl warning: WARNING: unnecessary whitespace before a quoted newline Signed-off-by: Juston Li --- drivers/staging/sm750fb/sm750.c| 2 +- drivers/staging/sm750fb/sm750_hw.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index 8e201f1..1ff14b2 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -967,7 +967,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index) var->accel_flags = 0; var->vmode = FB_VMODE_NONINTERLACED; - pr_debug("#1 show info->cmap : \nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n", + pr_debug("#1 show info->cmap :\nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n", info->cmap.start, info->cmap.len, info->cmap.red, info->cmap.green, info->cmap.blue, info->cmap.transp); diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index 3b8107c..d397382 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -253,7 +253,7 @@ int hw_sm750_output_setMode(struct lynxfb_output* output, POKE32(DISPLAY_CONTROL_750LE, reg); } - pr_info("ddk setlogicdispout done \n"); + pr_info("ddk setlogicdispout done\n"); return ret; } @@ -493,14 +493,14 @@ int hw_sm750_setBLANK(struct lynxfb_output* output, int blank) #else case VESA_NO_BLANKING: #endif - pr_info("flag = FB_BLANK_UNBLANK \n"); + pr_info("flag = FB_BLANK_UNBLANK\n"); dpms = SYSTEM_CTRL_DPMS_VPHP; pps = PANEL_DISPLAY_CTRL_DATA_ENABLE; crtdb = CRT_DISPLAY_CTRL_BLANK_OFF; break; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 10) case FB_BLANK_NORMAL: - pr_info("flag = FB_BLANK_NORMAL \n"); + pr_info("flag = FB_BLANK_NORMAL\n"); dpms = SYSTEM_CTRL_DPMS_VPHP; pps = PANEL_DISPLAY_CTRL_DATA_DISABLE; crtdb = CRT_DISPLAY_CTRL_BLANK_ON; -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 13/19] staging: sm750fb: add space after semicolon
fixes checkpatch.pl error: ERROR: space required after that ';' Signed-off-by: Juston Li --- drivers/staging/sm750fb/sm750.h| 2 +- drivers/staging/sm750fb/sm750_cursor.c | 12 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index 4f56dcb..2bcd65d 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -168,7 +168,7 @@ struct lynxfb_par { ({ \ unsigned long long hz = 1000*1000*1000*1000ULL; \ do_div(hz, ps); \ - (unsigned long)hz;}) + (unsigned long)hz; }) static inline unsigned long ps_to_hz(unsigned int psvalue) { diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c index 9dabac1..4ed7ca2 100644 --- a/drivers/staging/sm750fb/sm750_cursor.c +++ b/drivers/staging/sm750fb/sm750_cursor.c @@ -122,7 +122,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor, odd=0; */ - for (i = 0;i < count;i++) + for (i = 0; i < count; i++) { color = *pcol++; mask = *pmsk++; @@ -137,7 +137,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor, else opr = mask & color; - for (j = 0;j < 8;j++) + for (j = 0; j < 8; j++) { if (opr & (0x80 >> j)) @@ -149,7 +149,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor, } } #else - for (j = 0;j < 8;j++) { + for (j = 0; j < 8; j++) { if (mask & (0x80>>j)) { if (rop == ROP_XOR) opr = mask ^ color; @@ -204,7 +204,7 @@ void hw_cursor_setData2(struct lynx_cursor *cursor, pstart = cursor->vstart; pbuffer = pstart; - for (i = 0;i < count;i++) + for (i = 0; i < count; i++) { color = *pcol++; mask = *pmsk++; @@ -217,7 +217,7 @@ void hw_cursor_setData2(struct lynx_cursor *cursor, else opr = mask & color; - for (j = 0;j < 8;j++) + for (j = 0; j < 8; j++) { if (opr & (0x80 >> j)) @@ -229,7 +229,7 @@ void hw_cursor_setData2(struct lynx_cursor *cursor, } } #else - for (j = 0;j < 8;j++) { + for (j = 0; j < 8; j++) { if (mask & (1<http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 12/19] staging: sm750fb: add spaces around operators
fixes checkpath.pl error: ERROR: spaces required around that '' Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_chip.c | 2 +- drivers/staging/sm750fb/ddk750_power.c | 2 +- drivers/staging/sm750fb/sm750.h| 2 +- drivers/staging/sm750fb/sm750_accel.c | 4 ++-- drivers/staging/sm750fb/sm750_cursor.c | 12 ++-- drivers/staging/sm750fb/sm750_help.h | 2 +- drivers/staging/sm750fb/sm750_hw.c | 8 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index 633201e..d7435d7 100644 --- a/drivers/staging/sm750fb/ddk750_chip.c +++ b/drivers/staging/sm750fb/ddk750_chip.c @@ -471,7 +471,7 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll) M = quo*X; M += fl_quo * X / 1; /* round step */ - M += (fl_quo*X % 1)>5000?1:0; + M += (fl_quo*X % 1) > 5000?1:0; if (M < 256 && M > 0) { unsigned int diff; tmpClock = pll->inputFreq * M / N / X; diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c index 5f697b8..28d4402 100644 --- a/drivers/staging/sm750fb/ddk750_power.c +++ b/drivers/staging/sm750fb/ddk750_power.c @@ -10,7 +10,7 @@ void ddk750_setDPMS(DPMS_t state) POKE32(CRT_DISPLAY_CTRL, FIELD_VALUE(value, CRT_DISPLAY_CTRL, DPMS, state)); } else { value = PEEK32(SYSTEM_CTRL); - value= FIELD_VALUE(value, SYSTEM_CTRL, DPMS, state); + value = FIELD_VALUE(value, SYSTEM_CTRL, DPMS, state); POKE32(SYSTEM_CTRL, value); } } diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index b0ff0b5..4f56dcb 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -172,7 +172,7 @@ struct lynxfb_par { static inline unsigned long ps_to_hz(unsigned int psvalue) { - unsigned long long numerator=1000*1000*1000*1000ULL; + unsigned long long numerator = 1000*1000*1000*1000ULL; /* 10^12 / picosecond period gives frequency in Hz */ do_div(numerator, psvalue); return (unsigned long)numerator; diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index 25dc15b..2ea447e 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -414,10 +414,10 @@ int hw_imageblit(struct lynx_accel *accel, write_dpr(accel, DE_CONTROL, de_ctrl | deGetTransparency(accel)); /* Write MONO data (line by line) to 2D Engine data port */ - for (i=0; i> j)) @@ -149,7 +149,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor, } } #else - for (j=0;j<8;j++) { + for (j = 0;j < 8;j++) { if (mask & (0x80>>j)) { if (rop == ROP_XOR) opr = mask ^ color; @@ -204,7 +204,7 @@ void hw_cursor_setData2(struct lynx_cursor *cursor, pstart = cursor->vstart; pbuffer = pstart; - for (i=0;i> j)) @@ -229,7 +229,7 @@ void hw_cursor_setData2(struct lynx_cursor *cursor, } } #else - for (j=0;j<8;j++) { + for (j = 0;j < 8;j++) { if (mask & (1<state.initParm; if (parm->chip_clk == 0) - parm->chip_clk = (getChipType() == SM750LE)? + parm->chip_clk = (getChipType() == SM750LE) ? DEFAULT_SM750LE_CHIP_CLOCK : DEFAULT_SM750_CHIP_CLOCK; @@ -421,7 +421,7 @@ void hw_sm750_crtc_clear(struct lynxfb_crtc* crtc) int hw_sm750_setColReg(struct lynxfb_crtc* crtc, ushort index, ushort red, ushort green, ushort blue) { - static unsigned int add[]={PANEL_PALETTE_RAM, CRT_PALETTE_RAM}; + static unsigned int add[] = {PANEL_PALETTE_RAM, CRT_PALETTE_RAM}; POKE32(add[crtc->channel] + index*4, (red<<16)|(green<<8)|blue); return 0; } @@ -580,7 +580,7 @@ void hw_sm750_initAccel(struct lynx_share *share) int hw_sm750le_deWait(void) { - int i=0x1000; + int i = 0x1000; while (i--) { unsigned int dwVal = PEEK32(DE_STATE2); if ((FIELD_GET(dwVal, DE_STATE2, DE_STATUS) == DE_STATE2_DE_STATUS_IDLE) && @@ -597,7 +597,7 @@ int hw_sm750le_deWait(void) int hw_sm750_deWait(void) { - int i=0x1000; + int i = 0x1000; while (i--) {
[PATCH v3 16/19] staging: sm750fb: fix brace placement
Fix brace placement errors caught by checkpatch.pl ERROR: that open brace { should be on the previous line Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_chip.h| 12 +++ drivers/staging/sm750fb/ddk750_display.c | 54 ++-- drivers/staging/sm750fb/ddk750_display.h | 3 +- drivers/staging/sm750fb/ddk750_dvi.c | 6 ++-- drivers/staging/sm750fb/ddk750_dvi.h | 3 +- drivers/staging/sm750fb/ddk750_hwi2c.c | 6 ++-- drivers/staging/sm750fb/ddk750_mode.c| 13 +++- drivers/staging/sm750fb/ddk750_mode.h| 6 ++-- drivers/staging/sm750fb/ddk750_power.c | 27 +--- drivers/staging/sm750fb/ddk750_power.h | 3 +- drivers/staging/sm750fb/ddk750_sii164.c | 16 +++--- drivers/staging/sm750fb/ddk750_sii164.h | 3 +- drivers/staging/sm750fb/sm750_accel.c| 45 +- drivers/staging/sm750fb/sm750_cursor.c | 23 ++ drivers/staging/sm750fb/sm750_hw.c | 27 ++-- 15 files changed, 81 insertions(+), 166 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_chip.h b/drivers/staging/sm750fb/ddk750_chip.h index 4e030e8..6ff0436 100644 --- a/drivers/staging/sm750fb/ddk750_chip.h +++ b/drivers/staging/sm750fb/ddk750_chip.h @@ -8,8 +8,7 @@ #include /* This is all the chips recognized by this library */ -typedef enum _logical_chip_type_t -{ +typedef enum _logical_chip_type_t { SM_UNKNOWN, SM718, SM750, @@ -18,8 +17,7 @@ typedef enum _logical_chip_type_t logical_chip_type_t; -typedef enum _clock_type_t -{ +typedef enum _clock_type_t { MXCLK_PLL, PRIMARY_PLL, SECONDARY_PLL, @@ -28,8 +26,7 @@ typedef enum _clock_type_t } clock_type_t; -typedef struct _pll_value_t -{ +typedef struct _pll_value_t { clock_type_t clockType; unsigned long inputFreq; /* Input clock frequency to the PLL */ @@ -42,8 +39,7 @@ typedef struct _pll_value_t pll_value_t; /* input struct to initChipParam() function */ -typedef struct _initchip_param_t -{ +typedef struct _initchip_param_t { unsigned short powerMode;/* Use power mode 0 or 1 */ unsigned short chipClock;/** * Speed of main chip clock in MHz unit diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index 4a3cb86..bd2be7f 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -15,12 +15,10 @@ static void setDisplayControl(int ctrl, int dispState) cnt = 0; /* Set the primary display control */ - if (!ctrl) - { + if (!ctrl) { ulDisplayCtrlReg = PEEK32(PANEL_DISPLAY_CTRL); /* Turn on/off the Panel display control */ - if (dispState) - { + if (dispState) { /* Timing should be enabled first before enabling the plane * because changing at the same time does not guarantee that * the plane will also enabled or disabled. @@ -45,16 +43,13 @@ static void setDisplayControl(int ctrl, int dispState) * until a few delay. Need to write * and read it a couple times */ - do - { + do { cnt++; POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg); } while ((PEEK32(PANEL_DISPLAY_CTRL) & ~ulReservedBits) != (ulDisplayCtrlReg & ~ulReservedBits)); printk("Set Panel Plane enbit:after tried %d times\n", cnt); - } - else - { + } else { /* When turning off, there is no rule on the programming * sequence since whenever the clock is off, then it does not * matter whether the plane is enabled or disabled. @@ -71,14 +66,11 @@ static void setDisplayControl(int ctrl, int dispState) POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg); } - } /* Set the secondary display control */ - else - { + } else { ulDisplayCtrlReg = PEEK32(CRT_DISPLAY_CTRL); - if (dispState) - { + if (dispState) { /* Timing should be enabled first before enabling the plane because changing at the same time does not guarantee that the plane will also enabled or disabled. */ @@ -100,16 +92,13 @@ static void setDisplayControl(int ctrl, int dispState) FIELD_SET(0, CRT_DISPLAY_CTRL, RESERVED_3_MASK, ENABLE) |
[PATCH v3 14/19] staging: sm750fb: remove trailing whitespace
fixes checkpatch.pl error: ERROR: trailing whitespace Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_dvi.c | 2 +- drivers/staging/sm750fb/sm750_accel.c | 4 ++-- drivers/staging/sm750fb/sm750_hw.c| 24 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c index 4c64436..c42db85 100644 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ b/drivers/staging/sm750fb/ddk750_dvi.c @@ -1,4 +1,4 @@ -#define USE_DVICHIP +#define USE_DVICHIP #ifdef USE_DVICHIP #include "ddk750_help.h" #include "ddk750_reg.h" diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index 2ea447e..866bb99 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -37,7 +37,7 @@ void hw_de_init(struct lynx_accel *accel) { /* setup 2d engine registers */ u32 reg, clr; - + write_dpr(accel, DE_MASKS, 0x); /* dpr1c */ @@ -82,7 +82,7 @@ void hw_de_init(struct lynx_accel *accel) void hw_set2dformat(struct lynx_accel *accel, int fmt) { u32 reg; - + /* fmt=0,1,2 for 8,16,32,bpp on sm718/750/502 */ reg = read_dpr(accel, DE_STRETCH_FORMAT); reg = FIELD_VALUE(reg, DE_STRETCH_FORMAT, PIXEL_FORMAT, fmt); diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index 4941e2a..3b8107c 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -28,7 +28,7 @@ int hw_sm750_map(struct lynx_share* share, struct pci_dev* pdev) { int ret; struct sm750_share *spec_share; - + spec_share = container_of(share, struct sm750_share, share); ret = 0; @@ -60,7 +60,7 @@ int hw_sm750_map(struct lynx_share* share, struct pci_dev* pdev) pr_info("mmio virtual addr = %p\n", share->pvReg); } - + share->accel.dprBase = share->pvReg + DE_BASE_ADDR_TYPE1; share->accel.dpPortBase = share->pvReg + DE_PORT_ADDR_TYPE1; @@ -104,7 +104,7 @@ int hw_sm750_inithw(struct lynx_share *share, struct pci_dev *pdev) { struct sm750_share *spec_share; struct init_status *parm; - + spec_share = container_of(share, struct sm750_share, share); parm = &spec_share->state.initParm; if (parm->chip_clk == 0) @@ -202,7 +202,7 @@ int hw_sm750_inithw(struct lynx_share *share, struct pci_dev *pdev) resource_size_t hw_sm750_getVMSize(struct lynx_share *share) { resource_size_t ret; - + ret = ddk750_getVMSize(); return ret; } @@ -211,7 +211,7 @@ resource_size_t hw_sm750_getVMSize(struct lynx_share *share) int hw_sm750_output_checkMode(struct lynxfb_output* output, struct fb_var_screeninfo* var) { - + return 0; } @@ -222,7 +222,7 @@ int hw_sm750_output_setMode(struct lynxfb_output* output, int ret; disp_output_t dispSet; int channel; - + ret = 0; dispSet = 0; channel = *output->channel; @@ -259,14 +259,14 @@ int hw_sm750_output_setMode(struct lynxfb_output* output, void hw_sm750_output_clear(struct lynxfb_output* output) { - + return; } int hw_sm750_crtc_checkMode(struct lynxfb_crtc* crtc, struct fb_var_screeninfo* var) { struct lynx_share *share; - + share = container_of(crtc, struct lynxfb_par, crtc)->share; @@ -303,7 +303,7 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc* crtc, struct lynx_share *share; struct lynxfb_par *par; - + ret = 0; par = container_of(crtc, struct lynxfb_par, crtc); share = par->share; @@ -414,7 +414,7 @@ exit: void hw_sm750_crtc_clear(struct lynxfb_crtc* crtc) { - + return; } @@ -428,7 +428,7 @@ int hw_sm750_setColReg(struct lynxfb_crtc* crtc, ushort index, int hw_sm750le_setBLANK(struct lynxfb_output * output, int blank) { int dpms, crtdb; - + switch (blank) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 10) @@ -483,7 +483,7 @@ int hw_sm750le_setBLANK(struct lynxfb_output * output, int blank) { int hw_sm750_setBLANK(struct lynxfb_output* output, int blank) { unsigned int dpms, pps, crtdb; - + dpms = pps = crtdb = 0; switch (blank) -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 09/19] staging: sm750fb: add space after struct definition
fixes checkpatch.pl warning: WARNING: missing space after struct definition Signed-off-by: Juston Li --- drivers/staging/sm750fb/sm750.h| 12 ++-- drivers/staging/sm750fb/sm750_hw.h | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index 3785afc..124921e 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -14,7 +14,7 @@ extern int smi_indent; -struct lynx_accel{ +struct lynx_accel { /* base virtual address of DPR registers */ volatile unsigned char __iomem * dprBase; /* base virtual address of de data port */ @@ -41,7 +41,7 @@ struct lynx_accel{ /* lynx_share stands for a presentation of two frame buffer that use one smi adaptor , it is similar to a basic class of C++ */ -struct lynx_share{ +struct lynx_share { /* common members */ u16 devid; u8 revid; @@ -68,7 +68,7 @@ struct lynx_share{ void (*resume)(struct lynx_share*); }; -struct lynx_cursor{ +struct lynx_cursor { /* cursor width ,height and size */ int w; int h; @@ -92,7 +92,7 @@ struct lynx_cursor{ void (*setData)(struct lynx_cursor *, u16, const u8*, const u8*); }; -struct lynxfb_crtc{ +struct lynxfb_crtc { unsigned char __iomem *vCursor; /* virtual address of cursor */ unsigned char __iomem *vScreen; /* virtual address of on_screen */ int oCursor; /* cursor address offset in vidmem */ @@ -123,7 +123,7 @@ struct lynxfb_crtc{ struct lynx_cursor cursor; }; -struct lynxfb_output{ +struct lynxfb_output { int dpms; int paths; /* which paths(s) this output stands for,for sm750: @@ -149,7 +149,7 @@ struct lynxfb_output{ void (*clear)(struct lynxfb_output*); }; -struct lynxfb_par{ +struct lynxfb_par { /* either 0 or 1 for dual head adaptor,0 is the older one registered */ int index; unsigned int pseudo_palette[256]; diff --git a/drivers/staging/sm750fb/sm750_hw.h b/drivers/staging/sm750fb/sm750_hw.h index af2db7c..ef0a16f 100644 --- a/drivers/staging/sm750fb/sm750_hw.h +++ b/drivers/staging/sm750fb/sm750_hw.h @@ -42,7 +42,7 @@ enum sm750_path { sm750_pnc = 3,/* panel and crt */ }; -struct init_status{ +struct init_status { ushort powerMode; /* below three clocks are in unit of MHZ*/ ushort chip_clk; @@ -52,7 +52,7 @@ struct init_status{ ushort resetMemory; }; -struct sm750_state{ +struct sm750_state { struct init_status initParm; enum sm750_pnltype pnltype; enum sm750_dataflow dataflow; @@ -66,7 +66,7 @@ struct sm750_state{ in C++ */ -struct sm750_share{ +struct sm750_share { /* it's better to put lynx_share struct to the first place of sm750_share */ struct lynx_share share; struct sm750_state state; -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 19/19] staging: sm750fb: add missing blank line after declarations
fixes checkpatch.pl: WARNING: Missing a blank line after declarations Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_chip.c| 1 + drivers/staging/sm750fb/ddk750_display.c | 2 ++ drivers/staging/sm750fb/ddk750_dvi.c | 1 + drivers/staging/sm750fb/ddk750_mode.c| 3 +++ drivers/staging/sm750fb/ddk750_power.c | 1 + drivers/staging/sm750fb/ddk750_sii164.c | 1 + drivers/staging/sm750fb/sm750_accel.c| 1 + drivers/staging/sm750fb/sm750_cursor.c | 2 ++ drivers/staging/sm750fb/sm750_hw.c | 7 +++ 9 files changed, 19 insertions(+) diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index d7435d7..5e6798e 100644 --- a/drivers/staging/sm750fb/ddk750_chip.c +++ b/drivers/staging/sm750fb/ddk750_chip.c @@ -474,6 +474,7 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll) M += (fl_quo*X % 1) > 5000?1:0; if (M < 256 && M > 0) { unsigned int diff; + tmpClock = pll->inputFreq * M / N / X; diff = absDiff(tmpClock, request_orig); if (diff < miniDiff) { diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index 90c5c9e..70e7f10 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -121,6 +121,7 @@ static void setDisplayControl(int ctrl, int dispState) static void waitNextVerticalSync(int ctrl, int delay) { unsigned int status; + if (!ctrl) { /* primary controller */ @@ -210,6 +211,7 @@ static void swPanelPowerSequence(int disp, int delay) void ddk750_setLogicalDispOut(disp_output_t output) { unsigned int reg; + if (output & PNL_2_USAGE) { /* set panel path controller select */ reg = PEEK32(PANEL_DISPLAY_CTRL); diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c index a18bb4c..a7a2351 100644 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ b/drivers/staging/sm750fb/ddk750_dvi.c @@ -43,6 +43,7 @@ int dviInit( ) { dvi_ctrl_device_t *pCurrentDviCtrl; + pCurrentDviCtrl = g_dcftSupportedDviController; if (pCurrentDviCtrl->pfnInit != NULL) { return pCurrentDviCtrl->pfnInit(edgeSelect, busSelect, dualEdgeClkSelect, hsyncEnable, diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c index 9d10446..2399b17 100644 --- a/drivers/staging/sm750fb/ddk750_mode.c +++ b/drivers/staging/sm750fb/ddk750_mode.c @@ -80,6 +80,7 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll) int ret = 0; int cnt = 0; unsigned int ulTmpValue, ulReg; + if (pll->clockType == SECONDARY_PLL) { /* programe secondary pixel clock */ POKE32(CRT_PLL_CTRL, formatPllReg(pll)); @@ -120,6 +121,7 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll) } else if (pll->clockType == PRIMARY_PLL) { unsigned int ulReservedBits; + POKE32(PANEL_PLL_CTRL, formatPllReg(pll)); POKE32(PANEL_HORIZONTAL_TOTAL, @@ -184,6 +186,7 @@ int ddk750_setModeTiming(mode_parameter_t *parm, clock_type_t clock) { pll_value_t pll; unsigned int uiActualPixelClk; + pll.inputFreq = DEFAULT_INPUT_CLOCK; pll.clockType = clock; diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c index c545c2d..c8c51be 100644 --- a/drivers/staging/sm750fb/ddk750_power.c +++ b/drivers/staging/sm750fb/ddk750_power.c @@ -5,6 +5,7 @@ void ddk750_setDPMS(DPMS_t state) { unsigned int value; + if (getChipType() == SM750LE) { value = PEEK32(CRT_DISPLAY_CTRL); POKE32(CRT_DISPLAY_CTRL, FIELD_VALUE(value, CRT_DISPLAY_CTRL, DPMS, state)); diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c index a5153be..0bdf3db 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.c +++ b/drivers/staging/sm750fb/ddk750_sii164.c @@ -340,6 +340,7 @@ void sii164EnableHotPlugDetection( ) { unsigned char detectReg; + detectReg = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT); /* Depending on each DVI controller, need to enable the hot plug based on each diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index 291a47b..b75ffbd 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -152,6 +152,7 @@ unsigned int rop2) /* ROP value */ { unsigned int nDirection, de_ctrl; int opSign; + nDirection = LEFT_TO_RIGHT; /* Direction of
Re: [PATCH] staging: sm750fb: use tabs for indentation
On Wed, Jun 24, 2015 at 2:28 AM, Dan Carpenter wrote: > Have you sent this patchset to the list? I don't see it in my inbox. > > regards, > dan carpenter Odd, I sent it on Saturday. Anyways made a change to it and just sent in v3. Thanks Juston ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 16/19] staging: sm750fb: fix brace placement
On Thu, Jun 25, 2015 at 5:17 AM, Sudip Mukherjee wrote: > On Wed, Jun 24, 2015 at 09:25:17AM -0700, Juston Li wrote: >> Fix brace placement errors caught by checkpatch.pl >> ERROR: that open brace { should be on the previous line >> >> Signed-off-by: Juston Li >> --- > >> @@ -71,14 +66,11 @@ static void setDisplayControl(int ctrl, int dispState) >> POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg); >> } >> >> - } >> /* Set the secondary display control */ >> - else >> - { >> + } else { > just a thought. The comment previously was at the beginning of the else > block, but now it will be placed inside the if block - at the end. > will it confuse code readers afterwards? > > regards > sudip I placed it above the else to make it consistent with the if statement with similar comment that the else corresponds to: /* Set the primary display control */ - if (!ctrl)+ if (!ctrl) { Thanks Juston ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 11/19] staging: sm750fb: consistent spacing around operators
On Thu, Jun 25, 2015 at 4:56 AM, Sudip Mukherjee wrote: > On Wed, Jun 24, 2015 at 09:25:12AM -0700, Juston Li wrote: >> fixes checkpatch.pl error: >> ERROR: need consistent spacing around '' > little bit confused. > 1) Your subject says consistent space around operators but here it says > around '' The specific checkpatch.pl error was different for each error, the quotes were suppose to contain the specific operator but I left it out so that there would be one generic error message. The quotes left behind were confusing, sorry. > 2) Considering that you are giving consitent space around operators, then > i think you have missed few operators like '|','&',':' in this > patch. > These were the only instances the checkpatch.pl error came up. This patch only fixes even spacing around a specific operator. Other operators either have even or no spacing around them with PATCH 11/19 fixing any operators with spacing around required. This leaves operators that checkpatch deems spacing as optional which I left as a separate issue to be addressed of making optional spacing of operators consistent with each other. Thanks Juston ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 16/19] staging: sm750fb: fix brace placement
On Thu, Jun 25, 2015 at 1:31 PM, Dan Carpenter wrote: > Once you add the else statement, then that kind of doesn't make sense. > Sudip is right. It should be: > > } else { > /* commentary about else side */ Yeah, that does make more sense. I'll change it, thanks. Patchset was responded by Greg's patch bot, I'll resend when I figure out why. Regards Juston ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 11/19] staging: sm750fb: consistent spacing around operators
On Thu, Jun 25, 2015 at 9:05 PM, Sudip Mukherjee wrote: > Usually I use the checkpatch which is in linux-next. That will be the > latest version. If you compare, last commit on checkpatch of staging > tree was on April 16th, where as last commit in linux-next is on > June 19th. And if you use this checkpatch you will see these warnings > also. :) Thanks for the tip, I'll use the latest checkpatch and fix the warnings. Your help has been much appreciated Regards Juston ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 11/19] staging: sm750fb: consistent spacing around operators
On Thu, Jun 25, 2015 at 9:05 PM, Sudip Mukherjee wrote: > Usually I use the checkpatch which is in linux-next. That will be the > latest version. If you compare, last commit on checkpatch of staging > tree was on April 16th, where as last commit in linux-next is on > June 19th. And if you use this checkpatch you will see these warnings > also. :) Just wanted to clarify. So even with the linux-next checkpatch.pl, no errors/warnings show for me. Only when I run checkpatch.pl with the '--strict' option does it give the following checks for various operators: CHECK: space preferred before that '|' (ctx:VxE) Are these the warnings you are referring too? Do you want me to fix all of these for this patch? Regards Juston ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 00/19] staging: sm750fb: checkpatch.pl fixes
This patch set includes 19 patches fixing indentation, spacing, brace placement and missing blank lines from checkpatch.pl warnings/errors in staging/sm750fb. Regards Juston - Changes since v3: * Fix comment placement 16/19 * Rebase to current staging-testing Changes since v2: * Fix Subject * Don't rearrange lines in 01/19 * Split up spacing fixes patch by checkpatch errors into 14 patches * Split up brace fixes patch by checkpatch errors in 3 patches - Diffstat: drivers/staging/sm750fb/ddk750_chip.c| 15 +- drivers/staging/sm750fb/ddk750_chip.h| 12 +- drivers/staging/sm750fb/ddk750_display.c | 170 - drivers/staging/sm750fb/ddk750_display.h | 11 +- drivers/staging/sm750fb/ddk750_dvi.c | 75 ++-- drivers/staging/sm750fb/ddk750_dvi.h | 3 +- drivers/staging/sm750fb/ddk750_help.c| 2 +- drivers/staging/sm750fb/ddk750_help.h| 4 +- drivers/staging/sm750fb/ddk750_hwi2c.c | 244 +++-- drivers/staging/sm750fb/ddk750_mode.c| 164 + drivers/staging/sm750fb/ddk750_mode.h| 52 ++- drivers/staging/sm750fb/ddk750_power.c | 254 +++--- drivers/staging/sm750fb/ddk750_power.h | 11 +- drivers/staging/sm750fb/ddk750_reg.h | 18 +- drivers/staging/sm750fb/ddk750_sii164.c | 389 ++--- drivers/staging/sm750fb/ddk750_sii164.h | 31 +- drivers/staging/sm750fb/sm750.c | 2 +- drivers/staging/sm750fb/sm750.h | 58 +-- drivers/staging/sm750fb/sm750_accel.c| 379 ++-- drivers/staging/sm750fb/sm750_accel.h| 4 +- drivers/staging/sm750fb/sm750_cursor.c | 51 ++- drivers/staging/sm750fb/sm750_help.h | 28 +- drivers/staging/sm750fb/sm750_hw.c | 218 ++-- drivers/staging/sm750fb/sm750_hw.h | 42 +-- 24 files changed, 1081 insertions(+), 1156 deletions(-) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 02/19] staging: sm750fb: remove spacing after open parenthesis
Fixes checkpatch.pl warning: ERROR: space prohibited after that open parenthesis '(' Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_chip.c | 6 +++--- drivers/staging/sm750fb/ddk750_mode.c | 2 +- drivers/staging/sm750fb/ddk750_power.c | 8 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index f4975d2..1069a2d 100644 --- a/drivers/staging/sm750fb/ddk750_chip.c +++ b/drivers/staging/sm750fb/ddk750_chip.c @@ -599,9 +599,9 @@ unsigned int formatPllReg(pll_value_t *pPLL) On returning a 32 bit number, the value can be applied to any PLL in the calling function. */ ulPllReg = - FIELD_SET( 0, PANEL_PLL_CTRL, BYPASS, OFF) - | FIELD_SET( 0, PANEL_PLL_CTRL, POWER, ON) - | FIELD_SET( 0, PANEL_PLL_CTRL, INPUT, OSC) + FIELD_SET(0, PANEL_PLL_CTRL, BYPASS, OFF) + | FIELD_SET(0, PANEL_PLL_CTRL, POWER, ON) + | FIELD_SET(0, PANEL_PLL_CTRL, INPUT, OSC) #ifndef VALIDATION_CHIP | FIELD_VALUE(0, PANEL_PLL_CTRL, POD,pPLL->POD) #endif diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c index 1f93d07..31424b2 100644 --- a/drivers/staging/sm750fb/ddk750_mode.c +++ b/drivers/staging/sm750fb/ddk750_mode.c @@ -43,7 +43,7 @@ static unsigned long displayControlAdjust_SM750LE(mode_parameter_t *pModeParam, /* Set bit 29:27 of display control register for the right clock */ /* Note that SM750LE only need to supported 7 resoluitons. */ - if ( x == 800 && y == 600 ) + if (x == 800 && y == 600 ) dispControl = FIELD_SET(dispControl, CRT_DISPLAY_CTRL, CLK, PLL41); else if (x == 1024 && y == 768) dispControl = FIELD_SET(dispControl, CRT_DISPLAY_CTRL, CLK, PLL65); diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c index b7a108b..44b8eb1 100644 --- a/drivers/staging/sm750fb/ddk750_power.c +++ b/drivers/staging/sm750fb/ddk750_power.c @@ -59,17 +59,17 @@ void setPowerMode(unsigned int powerMode) { control_value = #ifdef VALIDATION_CHIP - FIELD_SET( control_value, POWER_MODE_CTRL, 336CLK, OFF) | + FIELD_SET(control_value, POWER_MODE_CTRL, 336CLK, OFF) | #endif - FIELD_SET( control_value, POWER_MODE_CTRL, OSC_INPUT, OFF); + FIELD_SET(control_value, POWER_MODE_CTRL, OSC_INPUT, OFF); } else { control_value = #ifdef VALIDATION_CHIP - FIELD_SET( control_value, POWER_MODE_CTRL, 336CLK, ON) | + FIELD_SET(control_value, POWER_MODE_CTRL, 336CLK, ON) | #endif - FIELD_SET( control_value, POWER_MODE_CTRL, OSC_INPUT, ON); + FIELD_SET(control_value, POWER_MODE_CTRL, OSC_INPUT, ON); } /* Program new power mode. */ -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 05/19] staging: sm750fb: remove space between function name and parenthesis
Fixes checkpatch.pl warning: WARNING: space prohibited between function name and open parenthesis '(' Signed-off-by: Juston Li --- drivers/staging/sm750fb/sm750_accel.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index 3c61103..bb96ea5 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -278,11 +278,11 @@ unsigned int rop2) /* ROP value */ { write_dpr(accel, DE_SOURCE, - FIELD_SET (0, DE_SOURCE, WRAP, DISABLE) | + FIELD_SET(0, DE_SOURCE, WRAP, DISABLE) | FIELD_VALUE(0, DE_SOURCE, X_K1, sx) | FIELD_VALUE(0, DE_SOURCE, Y_K2, sy)); /* dpr0 */ write_dpr(accel, DE_DESTINATION, - FIELD_SET (0, DE_DESTINATION, WRAP, DISABLE) | + FIELD_SET(0, DE_DESTINATION, WRAP, DISABLE) | FIELD_VALUE(0, DE_DESTINATION, X,dx) | FIELD_VALUE(0, DE_DESTINATION, Y,dy)); /* dpr04 */ write_dpr(accel, DE_DIMENSION, @@ -390,11 +390,11 @@ int hw_imageblit(struct lynx_accel *accel, /* Note: For 2D Source in Host Write, only X_K1_MONO field is needed, and Y_K2 field is not used. For mono bitmap, use startBit for X_K1. */ write_dpr(accel, DE_SOURCE, - FIELD_SET (0, DE_SOURCE, WRAP, DISABLE) | + FIELD_SET(0, DE_SOURCE, WRAP, DISABLE) | FIELD_VALUE(0, DE_SOURCE, X_K1_MONO, startBit)); /* dpr00 */ write_dpr(accel, DE_DESTINATION, - FIELD_SET (0, DE_DESTINATION, WRAP, DISABLE) | + FIELD_SET(0, DE_DESTINATION, WRAP, DISABLE) | FIELD_VALUE(0, DE_DESTINATION, X,dx)| FIELD_VALUE(0, DE_DESTINATION, Y,dy)); /* dpr04 */ -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 03/19] staging: sm750fb: remove space before close parenthesis
Fixes checkpatch.pl error: ERROR: space prohibited before that close parenthesis ')' Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_chip.c | 2 +- drivers/staging/sm750fb/ddk750_mode.c | 2 +- drivers/staging/sm750fb/sm750_accel.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index 1069a2d..fb1c533 100644 --- a/drivers/staging/sm750fb/ddk750_chip.c +++ b/drivers/staging/sm750fb/ddk750_chip.c @@ -268,7 +268,7 @@ int ddk750_initHw(initchip_param_t *pInitParam) #endif - if (pInitParam->powerMode != 0 ) + if (pInitParam->powerMode != 0) pInitParam->powerMode = 0; setPowerMode(pInitParam->powerMode); diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c index 31424b2..4ee9ceb 100644 --- a/drivers/staging/sm750fb/ddk750_mode.c +++ b/drivers/staging/sm750fb/ddk750_mode.c @@ -43,7 +43,7 @@ static unsigned long displayControlAdjust_SM750LE(mode_parameter_t *pModeParam, /* Set bit 29:27 of display control register for the right clock */ /* Note that SM750LE only need to supported 7 resoluitons. */ - if (x == 800 && y == 600 ) + if (x == 800 && y == 600) dispControl = FIELD_SET(dispControl, CRT_DISPLAY_CTRL, CLK, PLL41); else if (x == 1024 && y == 768) dispControl = FIELD_SET(dispControl, CRT_DISPLAY_CTRL, CLK, PLL65); diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index 668258c..ed82813 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -363,7 +363,7 @@ int hw_imageblit(struct lynx_accel *accel, Note that input pitch is BYTE value, but the 2D Pitch register uses pixel values. Need Byte to pixel conversion. */ - if(bytePerPixel == 3 ){ + if(bytePerPixel == 3){ dx *= 3; width *= 3; startBit *= 3; -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 04/19] staging: sm750fb: add space before open parenthesis
Fixes checkpatch.pl error: ERROR: space required before the open parenthesis '(' Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_display.c | 20 +-- drivers/staging/sm750fb/ddk750_dvi.c | 2 +- drivers/staging/sm750fb/ddk750_help.c| 2 +- drivers/staging/sm750fb/ddk750_mode.c| 12 +++ drivers/staging/sm750fb/ddk750_power.c | 6 ++-- drivers/staging/sm750fb/sm750_accel.c| 8 ++--- drivers/staging/sm750fb/sm750_cursor.c | 32 - drivers/staging/sm750fb/sm750_help.h | 2 +- drivers/staging/sm750fb/sm750_hw.c | 62 9 files changed, 73 insertions(+), 73 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index 1c4049f..973dec3 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -49,7 +49,7 @@ static void setDisplayControl(int ctrl, int dispState) { cnt++; POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg); - } while((PEEK32(PANEL_DISPLAY_CTRL) & ~ulReservedBits) != + } while ((PEEK32(PANEL_DISPLAY_CTRL) & ~ulReservedBits) != (ulDisplayCtrlReg & ~ulReservedBits)); printk("Set Panel Plane enbit:after tried %d times\n", cnt); } @@ -104,7 +104,7 @@ static void setDisplayControl(int ctrl, int dispState) { cnt++; POKE32(CRT_DISPLAY_CTRL, ulDisplayCtrlReg); - } while((PEEK32(CRT_DISPLAY_CTRL) & ~ulReservedBits) != + } while ((PEEK32(CRT_DISPLAY_CTRL) & ~ulReservedBits) != (ulDisplayCtrlReg & ~ulReservedBits)); printk("Set Crt Plane enbit:after tried %d times\n", cnt); } @@ -132,7 +132,7 @@ static void setDisplayControl(int ctrl, int dispState) static void waitNextVerticalSync(int ctrl, int delay) { unsigned int status; - if(!ctrl){ + if (!ctrl){ /* primary controller */ /* Do not wait when the Primary PLL is off or display control is already off. @@ -233,14 +233,14 @@ static void swPanelPowerSequence(int disp, int delay) void ddk750_setLogicalDispOut(disp_output_t output) { unsigned int reg; - if(output & PNL_2_USAGE){ + if (output & PNL_2_USAGE){ /* set panel path controller select */ reg = PEEK32(PANEL_DISPLAY_CTRL); reg = FIELD_VALUE(reg, PANEL_DISPLAY_CTRL, SELECT, (output & PNL_2_MASK)>>PNL_2_OFFSET); POKE32(PANEL_DISPLAY_CTRL, reg); } - if(output & CRT_2_USAGE){ + if (output & CRT_2_USAGE){ /* set crt path controller select */ reg = PEEK32(CRT_DISPLAY_CTRL); reg = FIELD_VALUE(reg, CRT_DISPLAY_CTRL, SELECT, (output & CRT_2_MASK)>>CRT_2_OFFSET); @@ -250,25 +250,25 @@ void ddk750_setLogicalDispOut(disp_output_t output) } - if(output & PRI_TP_USAGE){ + if (output & PRI_TP_USAGE){ /* set primary timing and plane en_bit */ setDisplayControl(0, (output&PRI_TP_MASK)>>PRI_TP_OFFSET); } - if(output & SEC_TP_USAGE){ + if (output & SEC_TP_USAGE){ /* set secondary timing and plane en_bit*/ setDisplayControl(1, (output&SEC_TP_MASK)>>SEC_TP_OFFSET); } - if(output & PNL_SEQ_USAGE){ + if (output & PNL_SEQ_USAGE){ /* set panel sequence */ swPanelPowerSequence((output&PNL_SEQ_MASK)>>PNL_SEQ_OFFSET, 4); } - if(output & DAC_USAGE) + if (output & DAC_USAGE) setDAC((output & DAC_MASK)>>DAC_OFFSET); - if(output & DPMS_USAGE) + if (output & DPMS_USAGE) ddk750_setDPMS((output & DPMS_MASK) >> DPMS_OFFSET); } diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c index 35866fa..4c64436 100644 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ b/drivers/staging/sm750fb/ddk750_dvi.c @@ -45,7 +45,7 @@ int dviInit( { dvi_ctrl_device_t *pCurrentDviCtrl; pCurrentDviCtrl = g_dcftSupportedDviController; - if(pCurrentDviCtrl->pfnInit != NULL) + if (pCurrentDviCtrl->pfnInit != NULL) { return pCurrentDviCtrl->pfnInit(edgeSelect, busSelect, dualEdgeClkSelect, hsyncEnable, vsyncEnable, deskewEnable, deskewSetting, continuousSyncEnable, diff -
[PATCH v4 07/19] staging: sm750fb: add space after close brace
Fixes checkpatch.pl error: ERROR: space required after that close brace '}' Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_display.c | 2 +- drivers/staging/sm750fb/ddk750_mode.c| 2 +- drivers/staging/sm750fb/ddk750_power.c | 2 +- drivers/staging/sm750fb/sm750.h | 2 +- drivers/staging/sm750fb/sm750_cursor.c | 8 drivers/staging/sm750fb/sm750_hw.c | 16 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index c7171a4..4a3cb86 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -166,7 +166,7 @@ static void waitNextVerticalSync(int ctrl, int delay) while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); } - }else { + } else { /* Do not wait when the Primary PLL is off or display control is already off. This will prevent the software to wait forever. */ diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c index efc1fab..3d8b06d 100644 --- a/drivers/staging/sm750fb/ddk750_mode.c +++ b/drivers/staging/sm750fb/ddk750_mode.c @@ -109,7 +109,7 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll) if (getChipType() == SM750LE) { displayControlAdjust_SM750LE(pModeParam, ulTmpValue); - }else { + } else { ulReg = PEEK32(CRT_DISPLAY_CTRL) & FIELD_CLEAR(CRT_DISPLAY_CTRL, VSYNC_PHASE) & FIELD_CLEAR(CRT_DISPLAY_CTRL, HSYNC_PHASE) diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c index e2c0bb3..5f697b8 100644 --- a/drivers/staging/sm750fb/ddk750_power.c +++ b/drivers/staging/sm750fb/ddk750_power.c @@ -8,7 +8,7 @@ void ddk750_setDPMS(DPMS_t state) if (getChipType() == SM750LE) { value = PEEK32(CRT_DISPLAY_CTRL); POKE32(CRT_DISPLAY_CTRL, FIELD_VALUE(value, CRT_DISPLAY_CTRL, DPMS, state)); - }else { + } else { value = PEEK32(SYSTEM_CTRL); value= FIELD_VALUE(value, SYSTEM_CTRL, DPMS, state); POKE32(SYSTEM_CTRL, value); diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index 71e9a7a..8ac5410 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -53,7 +53,7 @@ struct lynx_share{ int mtrr_off; struct{ int vram; - }mtrr; + } mtrr; /* all smi graphic adaptor got below attributes */ unsigned long vidmem_start; unsigned long vidreg_start; diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c index 3a21af9..2fcec32 100644 --- a/drivers/staging/sm750fb/sm750_cursor.c +++ b/drivers/staging/sm750fb/sm750_cursor.c @@ -143,7 +143,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor, if (opr & (0x80 >> j)) { /* use fg color,id = 2 */ data |= 2 << (j*2); - }else { + } else { /* use bg color,id = 1 */ data |= 1 << (j*2); } @@ -173,7 +173,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor, /* need a return */ pstart += offset; pbuffer = pstart; - }else { + } else { pbuffer += sizeof(u16); } @@ -223,7 +223,7 @@ void hw_cursor_setData2(struct lynx_cursor *cursor, if (opr & (0x80 >> j)) { /* use fg color,id = 2 */ data |= 2 << (j*2); - }else { + } else { /* use bg color,id = 1 */ data |= 1 << (j*2); } @@ -242,7 +242,7 @@ void hw_cursor_setData2(struct lynx_cursor *cursor, /* need a return */ pstart += offset; pbuffer = pstart; - }else { + } else { pbuffer += sizeof(u16); } diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index 4dfc6e6..a43f936 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -56,7 +56,7 @@ int hw_sm750_map(struct lynx_share* share, struct pci_dev* pdev)
[PATCH v4 09/19] staging: sm750fb: add space after struct definition
Fixes checkpatch.pl warning: WARNING: missing space after struct definition Signed-off-by: Juston Li --- drivers/staging/sm750fb/sm750.h| 12 ++-- drivers/staging/sm750fb/sm750_hw.h | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index 8ac5410..9989ff6 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -14,7 +14,7 @@ extern int smi_indent; -struct lynx_accel{ +struct lynx_accel { /* base virtual address of DPR registers */ volatile unsigned char __iomem * dprBase; /* base virtual address of de data port */ @@ -41,7 +41,7 @@ struct lynx_accel{ /* lynx_share stands for a presentation of two frame buffer that use one smi adaptor , it is similar to a basic class of C++ */ -struct lynx_share{ +struct lynx_share { /* common members */ u16 devid; u8 revid; @@ -68,7 +68,7 @@ struct lynx_share{ void (*resume)(struct lynx_share*); }; -struct lynx_cursor{ +struct lynx_cursor { /* cursor width ,height and size */ int w; int h; @@ -92,7 +92,7 @@ struct lynx_cursor{ void (*setData)(struct lynx_cursor *, u16, const u8*, const u8*); }; -struct lynxfb_crtc{ +struct lynxfb_crtc { unsigned char __iomem *vCursor; /* virtual address of cursor */ unsigned char __iomem *vScreen; /* virtual address of on_screen */ int oCursor; /* cursor address offset in vidmem */ @@ -123,7 +123,7 @@ struct lynxfb_crtc{ struct lynx_cursor cursor; }; -struct lynxfb_output{ +struct lynxfb_output { int dpms; int paths; /* which paths(s) this output stands for,for sm750: @@ -149,7 +149,7 @@ struct lynxfb_output{ void (*clear)(struct lynxfb_output*); }; -struct lynxfb_par{ +struct lynxfb_par { /* either 0 or 1 for dual head adaptor,0 is the older one registered */ int index; unsigned int pseudo_palette[256]; diff --git a/drivers/staging/sm750fb/sm750_hw.h b/drivers/staging/sm750fb/sm750_hw.h index af2db7c..ef0a16f 100644 --- a/drivers/staging/sm750fb/sm750_hw.h +++ b/drivers/staging/sm750fb/sm750_hw.h @@ -42,7 +42,7 @@ enum sm750_path { sm750_pnc = 3,/* panel and crt */ }; -struct init_status{ +struct init_status { ushort powerMode; /* below three clocks are in unit of MHZ*/ ushort chip_clk; @@ -52,7 +52,7 @@ struct init_status{ ushort resetMemory; }; -struct sm750_state{ +struct sm750_state { struct init_status initParm; enum sm750_pnltype pnltype; enum sm750_dataflow dataflow; @@ -66,7 +66,7 @@ struct sm750_state{ in C++ */ -struct sm750_share{ +struct sm750_share { /* it's better to put lynx_share struct to the first place of sm750_share */ struct lynx_share share; struct sm750_state state; -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 11/19] staging: sm750fb: consistent spacing around operators
Fixes checkpatch.pl error: ERROR: need consistent spacing around operator Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_chip.c| 4 ++-- drivers/staging/sm750fb/ddk750_display.h | 4 ++-- drivers/staging/sm750fb/sm750.h | 2 +- drivers/staging/sm750fb/sm750_hw.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index fb1c533..633201e 100644 --- a/drivers/staging/sm750fb/ddk750_chip.c +++ b/drivers/staging/sm750fb/ddk750_chip.c @@ -464,7 +464,7 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll) RN = N * request; quo = RN / input; rem = RN % input;/* rem always small than 14318181 */ - fl_quo = (rem * 1 /input); + fl_quo = (rem * 1 / input); for (d = xcnt - 1; d >= 0; d--) { X = xparm[d].value; @@ -474,7 +474,7 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll) M += (fl_quo*X % 1)>5000?1:0; if (M < 256 && M > 0) { unsigned int diff; - tmpClock = pll->inputFreq *M / N / X; + tmpClock = pll->inputFreq * M / N / X; diff = absDiff(tmpClock, request_orig); if (diff < miniDiff) { pll->M = M; diff --git a/drivers/staging/sm750fb/ddk750_display.h b/drivers/staging/sm750fb/ddk750_display.h index a7f50cc..afdf201 100644 --- a/drivers/staging/sm750fb/ddk750_display.h +++ b/drivers/staging/sm750fb/ddk750_display.h @@ -46,7 +46,7 @@ 0: both off */ #define SEC_TP_OFFSET 5 -#define SEC_TP_MASK (1<< SEC_TP_OFFSET) +#define SEC_TP_MASK (1 << SEC_TP_OFFSET) #define SEC_TP_USAGE (SEC_TP_MASK << 16) #define SEC_TP_ON ((0x1 << SEC_TP_OFFSET)|SEC_TP_USAGE) #define SEC_TP_OFF ((0x0 << SEC_TP_OFFSET)|SEC_TP_USAGE) @@ -67,7 +67,7 @@ #define DAC_OFFSET 7 #define DAC_MASK (1 << DAC_OFFSET) #define DAC_USAGE (DAC_MASK << 16) -#define DAC_ON ((0x0<< DAC_OFFSET)|DAC_USAGE) +#define DAC_ON ((0x0 << DAC_OFFSET)|DAC_USAGE) #define DAC_OFF ((0x1 << DAC_OFFSET)|DAC_USAGE) /* DPMS only affect D-SUB head diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index 2d04c0f..ae872bd 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -10,7 +10,7 @@ #define MB(x) ((x)<<20) #define MHZ(x) ((x) * 100) /* align should be 2,4,8,16 */ -#define PADDING(align, data) (((data)+(align)-1)&(~((align) -1))) +#define PADDING(align, data) (((data)+(align)-1)&(~((align) - 1))) extern int smi_indent; diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index a43f936..7a5d522 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -330,7 +330,7 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc* crtc, modparm.pixel_clock = ps_to_hz(var->pixclock); modparm.vertical_sync_polarity = (var->sync & FB_SYNC_HOR_HIGH_ACT) ? POS:NEG; modparm.horizontal_sync_polarity = (var->sync & FB_SYNC_VERT_HIGH_ACT) ? POS:NEG; - modparm.clock_phase_polarity = (var->sync& FB_SYNC_COMP_HIGH_ACT) ? POS:NEG; + modparm.clock_phase_polarity = (var->sync & FB_SYNC_COMP_HIGH_ACT) ? POS:NEG; modparm.horizontal_display_end = var->xres; modparm.horizontal_sync_width = var->hsync_len; modparm.horizontal_sync_start = var->xres + var->right_margin; @@ -369,7 +369,7 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc* crtc, FIELD_VALUE(0, PANEL_FB_WIDTH, OFFSET, fix->line_length)); POKE32(PANEL_WINDOW_WIDTH, - FIELD_VALUE(0, PANEL_WINDOW_WIDTH, WIDTH, var->xres -1)| + FIELD_VALUE(0, PANEL_WINDOW_WIDTH, WIDTH, var->xres - 1)| FIELD_VALUE(0, PANEL_WINDOW_WIDTH, X, var->xoffset)); POKE32(PANEL_WINDOW_HEIGHT, -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 08/19] staging: sm750fb: add space after enum definition
Fixes checkpatch.pl warning: WARNING: missing space after enum definition Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_display.h | 2 +- drivers/staging/sm750fb/sm750_hw.h | 8 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_display.h b/drivers/staging/sm750fb/ddk750_display.h index 018a661..a7f50cc 100644 --- a/drivers/staging/sm750fb/ddk750_display.h +++ b/drivers/staging/sm750fb/ddk750_display.h @@ -129,7 +129,7 @@ typedef enum _disp_output_t } disp_output_t; #else -typedef enum _disp_output_t{ +typedef 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 diff --git a/drivers/staging/sm750fb/sm750_hw.h b/drivers/staging/sm750fb/sm750_hw.h index adc61edf..af2db7c 100644 --- a/drivers/staging/sm750fb/sm750_hw.h +++ b/drivers/staging/sm750fb/sm750_hw.h @@ -9,7 +9,7 @@ #endif -enum sm750_pnltype{ +enum sm750_pnltype { sm750_24TFT = 0,/* 24bit tft */ @@ -19,7 +19,7 @@ enum sm750_pnltype{ }; /* vga channel is not concerned */ -enum sm750_dataflow{ +enum sm750_dataflow { sm750_simul_pri,/* primary => all head */ sm750_simul_sec,/* secondary => all head */ @@ -30,13 +30,13 @@ enum sm750_dataflow{ }; -enum sm750_channel{ +enum sm750_channel { sm750_primary = 0, /* enum value equal to the register filed data */ sm750_secondary = 1, }; -enum sm750_path{ +enum sm750_path { sm750_panel = 1, sm750_crt = 2, sm750_pnc = 3,/* panel and crt */ -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 01/19] staging: sm750fb: use tabs for indentation
Replace spaces with tabs for indentation to fix the checkpatch.pl error ERROR: code indent should use tabs where possible WARNING: please, no spaces at the start of a line Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_display.c | 100 drivers/staging/sm750fb/ddk750_display.h | 2 +- drivers/staging/sm750fb/ddk750_dvi.c | 66 +++--- drivers/staging/sm750fb/ddk750_help.h| 4 +- drivers/staging/sm750fb/ddk750_hwi2c.c | 246 +-- drivers/staging/sm750fb/ddk750_mode.c| 142 +-- drivers/staging/sm750fb/ddk750_mode.h| 46 ++-- drivers/staging/sm750fb/ddk750_power.c | 254 ++-- drivers/staging/sm750fb/ddk750_power.h | 8 +- drivers/staging/sm750fb/ddk750_reg.h | 18 +- drivers/staging/sm750fb/ddk750_sii164.c | 394 +++ drivers/staging/sm750fb/ddk750_sii164.h | 28 +-- drivers/staging/sm750fb/sm750.h | 26 +- drivers/staging/sm750fb/sm750_accel.c| 370 ++--- drivers/staging/sm750fb/sm750_accel.h| 4 +- drivers/staging/sm750fb/sm750_help.h | 26 +- drivers/staging/sm750fb/sm750_hw.c | 70 +++--- drivers/staging/sm750fb/sm750_hw.h | 28 +-- 18 files changed, 916 insertions(+), 916 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index a3e6720..1c4049f 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -24,7 +24,7 @@ static void setDisplayControl(int ctrl, int dispState) /* Timing should be enabled first before enabling the plane * because changing at the same time does not guarantee that * the plane will also enabled or disabled. -*/ +*/ ulDisplayCtrlReg = FIELD_SET(ulDisplayCtrlReg, PANEL_DISPLAY_CTRL, TIMING, ENABLE); POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg); @@ -135,8 +135,8 @@ static void waitNextVerticalSync(int ctrl, int delay) if(!ctrl){ /* primary controller */ -/* Do not wait when the Primary PLL is off or display control is already off. - This will prevent the software to wait forever. */ + /* Do not wait when the Primary PLL is off or display control is already off. + This will prevent the software to wait forever. */ if ((FIELD_GET(PEEK32(PANEL_PLL_CTRL), PANEL_PLL_CTRL, POWER) == PANEL_PLL_CTRL_POWER_OFF) || (FIELD_GET(PEEK32(PANEL_DISPLAY_CTRL), PANEL_DISPLAY_CTRL, TIMING) == @@ -145,26 +145,26 @@ static void waitNextVerticalSync(int ctrl, int delay) return; } -while (delay-- > 0) -{ -/* Wait for end of vsync. */ -do -{ -status = FIELD_GET(PEEK32(SYSTEM_CTRL), - SYSTEM_CTRL, - PANEL_VSYNC); -} -while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE); - -/* Wait for start of vsync. */ -do -{ -status = FIELD_GET(PEEK32(SYSTEM_CTRL), - SYSTEM_CTRL, - PANEL_VSYNC); -} -while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); -} + while (delay-- > 0) + { + /* Wait for end of vsync. */ + do + { + status = FIELD_GET(PEEK32(SYSTEM_CTRL), + SYSTEM_CTRL, + PANEL_VSYNC); + } + while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE); + + /* Wait for start of vsync. */ + do + { + status = FIELD_GET(PEEK32(SYSTEM_CTRL), + SYSTEM_CTRL, + PANEL_VSYNC); + } + while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); + } }else{ @@ -275,33 +275,33 @@ void ddk750_setLogicalDispOut(disp_output_t output) int ddk750_initDVIDisp(void) { -/* Initialize DVI. If the dviInit fail and the VendorID or the DeviceID are - not zeroed, then set the failure flag. If it is zeroe, it might mean - that the system is in Dual CRT Monitor configuration. */ - -/* De-skew enabled with default 111b value. - This will fix some artifacts problem in some mode on board 2.2. - Somehow th
[PATCH v4 13/19] staging: sm750fb: add space after semicolon
Fixes checkpatch.pl error: ERROR: space required after that ';' Signed-off-by: Juston Li --- drivers/staging/sm750fb/sm750.h| 2 +- drivers/staging/sm750fb/sm750_cursor.c | 12 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index d6916fd..9b101a9 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -168,7 +168,7 @@ struct lynxfb_par { ({ \ unsigned long long hz = 1000*1000*1000*1000ULL; \ do_div(hz, ps); \ - (unsigned long)hz;}) + (unsigned long)hz; }) static inline unsigned long ps_to_hz(unsigned int psvalue) { diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c index 9dabac1..4ed7ca2 100644 --- a/drivers/staging/sm750fb/sm750_cursor.c +++ b/drivers/staging/sm750fb/sm750_cursor.c @@ -122,7 +122,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor, odd=0; */ - for (i = 0;i < count;i++) + for (i = 0; i < count; i++) { color = *pcol++; mask = *pmsk++; @@ -137,7 +137,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor, else opr = mask & color; - for (j = 0;j < 8;j++) + for (j = 0; j < 8; j++) { if (opr & (0x80 >> j)) @@ -149,7 +149,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor, } } #else - for (j = 0;j < 8;j++) { + for (j = 0; j < 8; j++) { if (mask & (0x80>>j)) { if (rop == ROP_XOR) opr = mask ^ color; @@ -204,7 +204,7 @@ void hw_cursor_setData2(struct lynx_cursor *cursor, pstart = cursor->vstart; pbuffer = pstart; - for (i = 0;i < count;i++) + for (i = 0; i < count; i++) { color = *pcol++; mask = *pmsk++; @@ -217,7 +217,7 @@ void hw_cursor_setData2(struct lynx_cursor *cursor, else opr = mask & color; - for (j = 0;j < 8;j++) + for (j = 0; j < 8; j++) { if (opr & (0x80 >> j)) @@ -229,7 +229,7 @@ void hw_cursor_setData2(struct lynx_cursor *cursor, } } #else - for (j = 0;j < 8;j++) { + for (j = 0; j < 8; j++) { if (mask & (1<http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 12/19] 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 --- drivers/staging/sm750fb/ddk750_chip.c | 2 +- drivers/staging/sm750fb/ddk750_power.c | 2 +- drivers/staging/sm750fb/sm750.h| 2 +- drivers/staging/sm750fb/sm750_accel.c | 4 ++-- drivers/staging/sm750fb/sm750_cursor.c | 12 ++-- drivers/staging/sm750fb/sm750_help.h | 2 +- drivers/staging/sm750fb/sm750_hw.c | 8 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index 633201e..d7435d7 100644 --- a/drivers/staging/sm750fb/ddk750_chip.c +++ b/drivers/staging/sm750fb/ddk750_chip.c @@ -471,7 +471,7 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll) M = quo*X; M += fl_quo * X / 1; /* round step */ - M += (fl_quo*X % 1)>5000?1:0; + M += (fl_quo*X % 1) > 5000?1:0; if (M < 256 && M > 0) { unsigned int diff; tmpClock = pll->inputFreq * M / N / X; diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c index 5f697b8..28d4402 100644 --- a/drivers/staging/sm750fb/ddk750_power.c +++ b/drivers/staging/sm750fb/ddk750_power.c @@ -10,7 +10,7 @@ void ddk750_setDPMS(DPMS_t state) POKE32(CRT_DISPLAY_CTRL, FIELD_VALUE(value, CRT_DISPLAY_CTRL, DPMS, state)); } else { value = PEEK32(SYSTEM_CTRL); - value= FIELD_VALUE(value, SYSTEM_CTRL, DPMS, state); + value = FIELD_VALUE(value, SYSTEM_CTRL, DPMS, state); POKE32(SYSTEM_CTRL, value); } } diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index ae872bd..d6916fd 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -172,7 +172,7 @@ struct lynxfb_par { static inline unsigned long ps_to_hz(unsigned int psvalue) { - unsigned long long numerator=1000*1000*1000*1000ULL; + unsigned long long numerator = 1000*1000*1000*1000ULL; /* 10^12 / picosecond period gives frequency in Hz */ do_div(numerator, psvalue); return (unsigned long)numerator; diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index 25dc15b..2ea447e 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -414,10 +414,10 @@ int hw_imageblit(struct lynx_accel *accel, write_dpr(accel, DE_CONTROL, de_ctrl | deGetTransparency(accel)); /* Write MONO data (line by line) to 2D Engine data port */ - for (i=0; i> j)) @@ -149,7 +149,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor, } } #else - for (j=0;j<8;j++) { + for (j = 0;j < 8;j++) { if (mask & (0x80>>j)) { if (rop == ROP_XOR) opr = mask ^ color; @@ -204,7 +204,7 @@ void hw_cursor_setData2(struct lynx_cursor *cursor, pstart = cursor->vstart; pbuffer = pstart; - for (i=0;i> j)) @@ -229,7 +229,7 @@ void hw_cursor_setData2(struct lynx_cursor *cursor, } } #else - for (j=0;j<8;j++) { + for (j = 0;j < 8;j++) { if (mask & (1<state.initParm; if (parm->chip_clk == 0) - parm->chip_clk = (getChipType() == SM750LE)? + parm->chip_clk = (getChipType() == SM750LE) ? DEFAULT_SM750LE_CHIP_CLOCK : DEFAULT_SM750_CHIP_CLOCK; @@ -421,7 +421,7 @@ void hw_sm750_crtc_clear(struct lynxfb_crtc* crtc) int hw_sm750_setColReg(struct lynxfb_crtc* crtc, ushort index, ushort red, ushort green, ushort blue) { - static unsigned int add[]={PANEL_PALETTE_RAM, CRT_PALETTE_RAM}; + static unsigned int add[] = {PANEL_PALETTE_RAM, CRT_PALETTE_RAM}; POKE32(add[crtc->channel] + index*4, (red<<16)|(green<<8)|blue); return 0; } @@ -580,7 +580,7 @@ void hw_sm750_initAccel(struct lynx_share *share) int hw_sm750le_deWait(void) { - int i=0x1000; + int i = 0x1000; while (i--) { unsigned int dwVal = PEEK32(DE_STATE2); if ((FIELD_GET(dwVal, DE_STATE2, DE_STATUS) == DE_STATE2_DE_STATUS_IDLE) &
[PATCH v4 14/19] staging: sm750fb: remove trailing whitespace
Fixes checkpatch.pl error: ERROR: trailing whitespace Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_dvi.c | 2 +- drivers/staging/sm750fb/sm750_accel.c | 4 ++-- drivers/staging/sm750fb/sm750_hw.c| 24 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c index 4c64436..c42db85 100644 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ b/drivers/staging/sm750fb/ddk750_dvi.c @@ -1,4 +1,4 @@ -#define USE_DVICHIP +#define USE_DVICHIP #ifdef USE_DVICHIP #include "ddk750_help.h" #include "ddk750_reg.h" diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index 2ea447e..866bb99 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -37,7 +37,7 @@ void hw_de_init(struct lynx_accel *accel) { /* setup 2d engine registers */ u32 reg, clr; - + write_dpr(accel, DE_MASKS, 0x); /* dpr1c */ @@ -82,7 +82,7 @@ void hw_de_init(struct lynx_accel *accel) void hw_set2dformat(struct lynx_accel *accel, int fmt) { u32 reg; - + /* fmt=0,1,2 for 8,16,32,bpp on sm718/750/502 */ reg = read_dpr(accel, DE_STRETCH_FORMAT); reg = FIELD_VALUE(reg, DE_STRETCH_FORMAT, PIXEL_FORMAT, fmt); diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index 4941e2a..3b8107c 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -28,7 +28,7 @@ int hw_sm750_map(struct lynx_share* share, struct pci_dev* pdev) { int ret; struct sm750_share *spec_share; - + spec_share = container_of(share, struct sm750_share, share); ret = 0; @@ -60,7 +60,7 @@ int hw_sm750_map(struct lynx_share* share, struct pci_dev* pdev) pr_info("mmio virtual addr = %p\n", share->pvReg); } - + share->accel.dprBase = share->pvReg + DE_BASE_ADDR_TYPE1; share->accel.dpPortBase = share->pvReg + DE_PORT_ADDR_TYPE1; @@ -104,7 +104,7 @@ int hw_sm750_inithw(struct lynx_share *share, struct pci_dev *pdev) { struct sm750_share *spec_share; struct init_status *parm; - + spec_share = container_of(share, struct sm750_share, share); parm = &spec_share->state.initParm; if (parm->chip_clk == 0) @@ -202,7 +202,7 @@ int hw_sm750_inithw(struct lynx_share *share, struct pci_dev *pdev) resource_size_t hw_sm750_getVMSize(struct lynx_share *share) { resource_size_t ret; - + ret = ddk750_getVMSize(); return ret; } @@ -211,7 +211,7 @@ resource_size_t hw_sm750_getVMSize(struct lynx_share *share) int hw_sm750_output_checkMode(struct lynxfb_output* output, struct fb_var_screeninfo* var) { - + return 0; } @@ -222,7 +222,7 @@ int hw_sm750_output_setMode(struct lynxfb_output* output, int ret; disp_output_t dispSet; int channel; - + ret = 0; dispSet = 0; channel = *output->channel; @@ -259,14 +259,14 @@ int hw_sm750_output_setMode(struct lynxfb_output* output, void hw_sm750_output_clear(struct lynxfb_output* output) { - + return; } int hw_sm750_crtc_checkMode(struct lynxfb_crtc* crtc, struct fb_var_screeninfo* var) { struct lynx_share *share; - + share = container_of(crtc, struct lynxfb_par, crtc)->share; @@ -303,7 +303,7 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc* crtc, struct lynx_share *share; struct lynxfb_par *par; - + ret = 0; par = container_of(crtc, struct lynxfb_par, crtc); share = par->share; @@ -414,7 +414,7 @@ exit: void hw_sm750_crtc_clear(struct lynxfb_crtc* crtc) { - + return; } @@ -428,7 +428,7 @@ int hw_sm750_setColReg(struct lynxfb_crtc* crtc, ushort index, int hw_sm750le_setBLANK(struct lynxfb_output * output, int blank) { int dpms, crtdb; - + switch (blank) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 10) @@ -483,7 +483,7 @@ int hw_sm750le_setBLANK(struct lynxfb_output * output, int blank) { int hw_sm750_setBLANK(struct lynxfb_output* output, int blank) { unsigned int dpms, pps, crtdb; - + dpms = pps = crtdb = 0; switch (blank) -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 15/19] staging: sm750fb: remove unnecessary whitespace
Fixes checkpatch.pl warning: WARNING: unnecessary whitespace before a quoted newline Signed-off-by: Juston Li --- drivers/staging/sm750fb/sm750.c| 2 +- drivers/staging/sm750fb/sm750_hw.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index 8e201f1..1ff14b2 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -967,7 +967,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index) var->accel_flags = 0; var->vmode = FB_VMODE_NONINTERLACED; - pr_debug("#1 show info->cmap : \nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n", + pr_debug("#1 show info->cmap :\nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n", info->cmap.start, info->cmap.len, info->cmap.red, info->cmap.green, info->cmap.blue, info->cmap.transp); diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index 3b8107c..d397382 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -253,7 +253,7 @@ int hw_sm750_output_setMode(struct lynxfb_output* output, POKE32(DISPLAY_CONTROL_750LE, reg); } - pr_info("ddk setlogicdispout done \n"); + pr_info("ddk setlogicdispout done\n"); return ret; } @@ -493,14 +493,14 @@ int hw_sm750_setBLANK(struct lynxfb_output* output, int blank) #else case VESA_NO_BLANKING: #endif - pr_info("flag = FB_BLANK_UNBLANK \n"); + pr_info("flag = FB_BLANK_UNBLANK\n"); dpms = SYSTEM_CTRL_DPMS_VPHP; pps = PANEL_DISPLAY_CTRL_DATA_ENABLE; crtdb = CRT_DISPLAY_CTRL_BLANK_OFF; break; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 10) case FB_BLANK_NORMAL: - pr_info("flag = FB_BLANK_NORMAL \n"); + pr_info("flag = FB_BLANK_NORMAL\n"); dpms = SYSTEM_CTRL_DPMS_VPHP; pps = PANEL_DISPLAY_CTRL_DATA_DISABLE; crtdb = CRT_DISPLAY_CTRL_BLANK_ON; -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 17/19] staging: sm750fb: move while to follow do close brace
Fixes checkpatch.pl error: ERROR: while should follow close brace '}' Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_display.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index a64ea32..abd6283 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -139,16 +139,14 @@ static void waitNextVerticalSync(int ctrl, int delay) status = FIELD_GET(PEEK32(SYSTEM_CTRL), SYSTEM_CTRL, PANEL_VSYNC); - } - while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE); + } while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE); /* Wait for start of vsync. */ do { status = FIELD_GET(PEEK32(SYSTEM_CTRL), SYSTEM_CTRL, PANEL_VSYNC); - } - while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); + } while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); } } else { @@ -168,16 +166,14 @@ static void waitNextVerticalSync(int ctrl, int delay) status = FIELD_GET(PEEK32(SYSTEM_CTRL), SYSTEM_CTRL, CRT_VSYNC); - } - while (status == SYSTEM_CTRL_CRT_VSYNC_ACTIVE); + } while (status == SYSTEM_CTRL_CRT_VSYNC_ACTIVE); /* Wait for start of vsync. */ do { status = FIELD_GET(PEEK32(SYSTEM_CTRL), SYSTEM_CTRL, CRT_VSYNC); - } - while (status == SYSTEM_CTRL_CRT_VSYNC_INACTIVE); + } while (status == SYSTEM_CTRL_CRT_VSYNC_INACTIVE); } } } -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 10/19] staging: sm750fb: add space after return type
Fixes checkpatch.pl warning: WARNING: missing space after return type Signed-off-by: Juston Li --- drivers/staging/sm750fb/sm750.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index 9989ff6..2d04c0f 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -108,12 +108,12 @@ struct lynxfb_crtc { void *priv; - int(*proc_setMode)(struct lynxfb_crtc*, + int (*proc_setMode)(struct lynxfb_crtc*, struct fb_var_screeninfo*, struct fb_fix_screeninfo*); - int(*proc_checkMode)(struct lynxfb_crtc*, struct fb_var_screeninfo*); - int(*proc_setColReg)(struct lynxfb_crtc*, ushort, ushort, ushort, ushort); + int (*proc_checkMode)(struct lynxfb_crtc*, struct fb_var_screeninfo*); + int (*proc_setColReg)(struct lynxfb_crtc*, ushort, ushort, ushort, ushort); void (*clear)(struct lynxfb_crtc*); /* pan display */ int (*proc_panDisplay)(struct lynxfb_crtc *, @@ -140,12 +140,12 @@ struct lynxfb_output { */ void *priv; - int(*proc_setMode)(struct lynxfb_output*, + int (*proc_setMode)(struct lynxfb_output*, struct fb_var_screeninfo*, struct fb_fix_screeninfo*); - int(*proc_checkMode)(struct lynxfb_output*, struct fb_var_screeninfo*); - int(*proc_setBLANK)(struct lynxfb_output*, int); + int (*proc_checkMode)(struct lynxfb_output*, struct fb_var_screeninfo*); + int (*proc_setBLANK)(struct lynxfb_output*, int); void (*clear)(struct lynxfb_output*); }; -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 18/19] staging: sm750fb: remove unnecessary braces
Fixes checkpatch.pl warning: WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Juston Li --- drivers/staging/sm750fb/sm750_accel.c | 9 +++-- drivers/staging/sm750fb/sm750_hw.c| 6 ++ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index f7a617e..291a47b 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -259,9 +259,8 @@ unsigned int rop2) /* ROP value */ FIELD_VALUE(0, DE_WINDOW_WIDTH, DESTINATION, (dPitch/Bpp)) | FIELD_VALUE(0, DE_WINDOW_WIDTH, SOURCE, (sPitch/Bpp))); /* dpr3c */ - if (accel->de_wait() != 0) { + if (accel->de_wait() != 0) return -1; - } { @@ -332,9 +331,8 @@ int hw_imageblit(struct lynx_accel *accel, ul4BytesPerScan = ulBytesPerScan & ~3; ulBytesRemain = ulBytesPerScan & 3; - if (accel->de_wait() != 0) { + if (accel->de_wait() != 0) return -1; - } /* 2D Source Base. Use 0 for HOST Blt. @@ -402,9 +400,8 @@ int hw_imageblit(struct lynx_accel *accel, /* Write MONO data (line by line) to 2D Engine data port */ for (i = 0; i < height; i++) { /* For each line, send the data in chunks of 4 bytes */ - for (j = 0; j < (ul4BytesPerScan/4); j++) { + for (j = 0; j < (ul4BytesPerScan/4); j++) write_dpPort(accel, *(unsigned int *)(pSrcbuf + (j * 4))); - } if (ulBytesRemain) { memcpy(ajRemain, pSrcbuf+ul4BytesPerScan, ulBytesRemain); diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index 20a8d3b..97a0f63 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -187,9 +187,8 @@ int hw_sm750_inithw(struct lynx_share *share, struct pci_dev *pdev) } /* init 2d engine */ - if (!share->accel_off) { + if (!share->accel_off) hw_sm750_initAccel(share); - } return 0; } @@ -536,9 +535,8 @@ int hw_sm750_setBLANK(struct lynxfb_output* output, int blank) POKE32(CRT_DISPLAY_CTRL, FIELD_VALUE(PEEK32(CRT_DISPLAY_CTRL), CRT_DISPLAY_CTRL, BLANK, crtdb)); } - if (output->paths & sm750_panel) { + if (output->paths & sm750_panel) POKE32(PANEL_DISPLAY_CTRL, FIELD_VALUE(PEEK32(PANEL_DISPLAY_CTRL), PANEL_DISPLAY_CTRL, DATA, pps)); - } return 0; } -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v4 06/19] staging: sm750fb: add space before open brace
Fixes checkpatch.pl error: ERROR: space required before the open brace '{' Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_display.c | 14 drivers/staging/sm750fb/ddk750_mode.c| 8 ++--- drivers/staging/sm750fb/ddk750_power.c | 4 +-- drivers/staging/sm750fb/sm750_accel.c| 6 ++-- drivers/staging/sm750fb/sm750_cursor.c | 14 drivers/staging/sm750fb/sm750_hw.c | 56 6 files changed, 51 insertions(+), 51 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index 973dec3..c7171a4 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -132,7 +132,7 @@ static void setDisplayControl(int ctrl, int dispState) static void waitNextVerticalSync(int ctrl, int delay) { unsigned int status; - if (!ctrl){ + if (!ctrl) { /* primary controller */ /* Do not wait when the Primary PLL is off or display control is already off. @@ -166,7 +166,7 @@ static void waitNextVerticalSync(int ctrl, int delay) while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); } - }else{ + }else { /* Do not wait when the Primary PLL is off or display control is already off. This will prevent the software to wait forever. */ @@ -233,14 +233,14 @@ static void swPanelPowerSequence(int disp, int delay) void ddk750_setLogicalDispOut(disp_output_t output) { unsigned int reg; - if (output & PNL_2_USAGE){ + if (output & PNL_2_USAGE) { /* set panel path controller select */ reg = PEEK32(PANEL_DISPLAY_CTRL); reg = FIELD_VALUE(reg, PANEL_DISPLAY_CTRL, SELECT, (output & PNL_2_MASK)>>PNL_2_OFFSET); POKE32(PANEL_DISPLAY_CTRL, reg); } - if (output & CRT_2_USAGE){ + if (output & CRT_2_USAGE) { /* set crt path controller select */ reg = PEEK32(CRT_DISPLAY_CTRL); reg = FIELD_VALUE(reg, CRT_DISPLAY_CTRL, SELECT, (output & CRT_2_MASK)>>CRT_2_OFFSET); @@ -250,17 +250,17 @@ void ddk750_setLogicalDispOut(disp_output_t output) } - if (output & PRI_TP_USAGE){ + if (output & PRI_TP_USAGE) { /* set primary timing and plane en_bit */ setDisplayControl(0, (output&PRI_TP_MASK)>>PRI_TP_OFFSET); } - if (output & SEC_TP_USAGE){ + if (output & SEC_TP_USAGE) { /* set secondary timing and plane en_bit*/ setDisplayControl(1, (output&SEC_TP_MASK)>>SEC_TP_OFFSET); } - if (output & PNL_SEQ_USAGE){ + if (output & PNL_SEQ_USAGE) { /* set panel sequence */ swPanelPowerSequence((output&PNL_SEQ_MASK)>>PNL_SEQ_OFFSET, 4); } diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c index cfe528c..efc1fab 100644 --- a/drivers/staging/sm750fb/ddk750_mode.c +++ b/drivers/staging/sm750fb/ddk750_mode.c @@ -107,9 +107,9 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll) FIELD_SET(0, CRT_DISPLAY_CTRL, PLANE, ENABLE); - if (getChipType() == SM750LE){ + if (getChipType() == SM750LE) { displayControlAdjust_SM750LE(pModeParam, ulTmpValue); - }else{ + }else { ulReg = PEEK32(CRT_DISPLAY_CTRL) & FIELD_CLEAR(CRT_DISPLAY_CTRL, VSYNC_PHASE) & FIELD_CLEAR(CRT_DISPLAY_CTRL, HSYNC_PHASE) @@ -179,7 +179,7 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll) } #endif } - else{ + else { ret = -1; } return ret; @@ -193,7 +193,7 @@ int ddk750_setModeTiming(mode_parameter_t *parm, clock_type_t clock) pll.clockType = clock; uiActualPixelClk = calcPllValue(parm->pixel_clock, &pll); - if (getChipType() == SM750LE){ + if (getChipType() == SM750LE) { /* set graphic mode via IO method */ outb_p(0x88, 0x3d4); outb_p(0x06, 0x3d5); diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c index a2d9ee6..e2c0bb3 100644 --- a/drivers/staging/sm750fb/ddk750_power.c +++ b/drivers/staging/sm750fb/ddk750_power.c @@ -5,10 +5,10 @@ void ddk750_setDPMS(DPMS_t state) { unsigned int value; - if (getChipType() == SM750LE){ + if (getChipType() == SM750LE) { value = PEEK32(CRT_DISPLAY_CTRL);
[PATCH v4 19/19] staging: sm750fb: add missing blank line after declarations
Fixes checkpatch.pl WARNING: Missing a blank line after declarations Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_chip.c| 1 + drivers/staging/sm750fb/ddk750_display.c | 2 ++ drivers/staging/sm750fb/ddk750_dvi.c | 1 + drivers/staging/sm750fb/ddk750_mode.c| 3 +++ drivers/staging/sm750fb/ddk750_power.c | 1 + drivers/staging/sm750fb/ddk750_sii164.c | 1 + drivers/staging/sm750fb/sm750_accel.c| 1 + drivers/staging/sm750fb/sm750_cursor.c | 2 ++ drivers/staging/sm750fb/sm750_hw.c | 7 +++ 9 files changed, 19 insertions(+) diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index d7435d7..5e6798e 100644 --- a/drivers/staging/sm750fb/ddk750_chip.c +++ b/drivers/staging/sm750fb/ddk750_chip.c @@ -474,6 +474,7 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll) M += (fl_quo*X % 1) > 5000?1:0; if (M < 256 && M > 0) { unsigned int diff; + tmpClock = pll->inputFreq * M / N / X; diff = absDiff(tmpClock, request_orig); if (diff < miniDiff) { diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index abd6283..8348113 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -121,6 +121,7 @@ static void setDisplayControl(int ctrl, int dispState) static void waitNextVerticalSync(int ctrl, int delay) { unsigned int status; + if (!ctrl) { /* primary controller */ @@ -210,6 +211,7 @@ static void swPanelPowerSequence(int disp, int delay) void ddk750_setLogicalDispOut(disp_output_t output) { unsigned int reg; + if (output & PNL_2_USAGE) { /* set panel path controller select */ reg = PEEK32(PANEL_DISPLAY_CTRL); diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c index a18bb4c..a7a2351 100644 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ b/drivers/staging/sm750fb/ddk750_dvi.c @@ -43,6 +43,7 @@ int dviInit( ) { dvi_ctrl_device_t *pCurrentDviCtrl; + pCurrentDviCtrl = g_dcftSupportedDviController; if (pCurrentDviCtrl->pfnInit != NULL) { return pCurrentDviCtrl->pfnInit(edgeSelect, busSelect, dualEdgeClkSelect, hsyncEnable, diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c index 9d10446..2399b17 100644 --- a/drivers/staging/sm750fb/ddk750_mode.c +++ b/drivers/staging/sm750fb/ddk750_mode.c @@ -80,6 +80,7 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll) int ret = 0; int cnt = 0; unsigned int ulTmpValue, ulReg; + if (pll->clockType == SECONDARY_PLL) { /* programe secondary pixel clock */ POKE32(CRT_PLL_CTRL, formatPllReg(pll)); @@ -120,6 +121,7 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll) } else if (pll->clockType == PRIMARY_PLL) { unsigned int ulReservedBits; + POKE32(PANEL_PLL_CTRL, formatPllReg(pll)); POKE32(PANEL_HORIZONTAL_TOTAL, @@ -184,6 +186,7 @@ int ddk750_setModeTiming(mode_parameter_t *parm, clock_type_t clock) { pll_value_t pll; unsigned int uiActualPixelClk; + pll.inputFreq = DEFAULT_INPUT_CLOCK; pll.clockType = clock; diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c index c545c2d..c8c51be 100644 --- a/drivers/staging/sm750fb/ddk750_power.c +++ b/drivers/staging/sm750fb/ddk750_power.c @@ -5,6 +5,7 @@ void ddk750_setDPMS(DPMS_t state) { unsigned int value; + if (getChipType() == SM750LE) { value = PEEK32(CRT_DISPLAY_CTRL); POKE32(CRT_DISPLAY_CTRL, FIELD_VALUE(value, CRT_DISPLAY_CTRL, DPMS, state)); diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c index a5153be..0bdf3db 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.c +++ b/drivers/staging/sm750fb/ddk750_sii164.c @@ -340,6 +340,7 @@ void sii164EnableHotPlugDetection( ) { unsigned char detectReg; + detectReg = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT); /* Depending on each DVI controller, need to enable the hot plug based on each diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index 291a47b..b75ffbd 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -152,6 +152,7 @@ unsigned int rop2) /* ROP value */ { unsigned int nDirection, de_ctrl; int opSign; + nDirection = LEFT_TO_RIGHT; /* Direction of
[PATCH v4 16/19] staging: sm750fb: fix brace placement
Fix brace placement errors caught by checkpatch.pl ERROR: that open brace { should be on the previous line Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_chip.h| 12 +++ drivers/staging/sm750fb/ddk750_display.c | 56 ++-- drivers/staging/sm750fb/ddk750_display.h | 3 +- drivers/staging/sm750fb/ddk750_dvi.c | 6 ++-- drivers/staging/sm750fb/ddk750_dvi.h | 3 +- drivers/staging/sm750fb/ddk750_hwi2c.c | 6 ++-- drivers/staging/sm750fb/ddk750_mode.c| 13 +++- drivers/staging/sm750fb/ddk750_mode.h| 6 ++-- drivers/staging/sm750fb/ddk750_power.c | 27 +-- drivers/staging/sm750fb/ddk750_power.h | 3 +- drivers/staging/sm750fb/ddk750_sii164.c | 16 +++-- drivers/staging/sm750fb/ddk750_sii164.h | 3 +- drivers/staging/sm750fb/sm750_accel.c| 45 - drivers/staging/sm750fb/sm750_cursor.c | 23 + drivers/staging/sm750fb/sm750_hw.c | 27 ++- 15 files changed, 82 insertions(+), 167 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_chip.h b/drivers/staging/sm750fb/ddk750_chip.h index 4e030e8..6ff0436 100644 --- a/drivers/staging/sm750fb/ddk750_chip.h +++ b/drivers/staging/sm750fb/ddk750_chip.h @@ -8,8 +8,7 @@ #include /* This is all the chips recognized by this library */ -typedef enum _logical_chip_type_t -{ +typedef enum _logical_chip_type_t { SM_UNKNOWN, SM718, SM750, @@ -18,8 +17,7 @@ typedef enum _logical_chip_type_t logical_chip_type_t; -typedef enum _clock_type_t -{ +typedef enum _clock_type_t { MXCLK_PLL, PRIMARY_PLL, SECONDARY_PLL, @@ -28,8 +26,7 @@ typedef enum _clock_type_t } clock_type_t; -typedef struct _pll_value_t -{ +typedef struct _pll_value_t { clock_type_t clockType; unsigned long inputFreq; /* Input clock frequency to the PLL */ @@ -42,8 +39,7 @@ typedef struct _pll_value_t pll_value_t; /* input struct to initChipParam() function */ -typedef struct _initchip_param_t -{ +typedef struct _initchip_param_t { unsigned short powerMode;/* Use power mode 0 or 1 */ unsigned short chipClock;/** * Speed of main chip clock in MHz unit diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index 4a3cb86..a64ea32 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -15,12 +15,10 @@ static void setDisplayControl(int ctrl, int dispState) cnt = 0; /* Set the primary display control */ - if (!ctrl) - { + if (!ctrl) { ulDisplayCtrlReg = PEEK32(PANEL_DISPLAY_CTRL); /* Turn on/off the Panel display control */ - if (dispState) - { + if (dispState) { /* Timing should be enabled first before enabling the plane * because changing at the same time does not guarantee that * the plane will also enabled or disabled. @@ -45,16 +43,13 @@ static void setDisplayControl(int ctrl, int dispState) * until a few delay. Need to write * and read it a couple times */ - do - { + do { cnt++; POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg); } while ((PEEK32(PANEL_DISPLAY_CTRL) & ~ulReservedBits) != (ulDisplayCtrlReg & ~ulReservedBits)); printk("Set Panel Plane enbit:after tried %d times\n", cnt); - } - else - { + } else { /* When turning off, there is no rule on the programming * sequence since whenever the clock is off, then it does not * matter whether the plane is enabled or disabled. @@ -71,14 +66,11 @@ static void setDisplayControl(int ctrl, int dispState) POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg); } - } - /* Set the secondary display control */ - else - { + } else { + /* Set the secondary display control */ ulDisplayCtrlReg = PEEK32(CRT_DISPLAY_CTRL); - if (dispState) - { + if (dispState) { /* Timing should be enabled first before enabling the plane because changing at the same time does not guarantee that the plane will also enabled or disabled. */ @@ -100,16 +92,13 @@ static void setDisplayControl(int ctrl, int dispState) FIELD_SET(0, CRT_DISPLAY_CTRL, RESERV
[PATCH v5 00/19] staging: sm750fb: checkpatch.pl fixes
This patch set includes 19 patches fixing indentation, spacing, brace placement and missing blank lines from checkpatch.pl warnings/errors in staging/sm750fb. Regards Juston - Changes since v4: * Rebase to current staging-testing Changes since v3: * Fix comment placement 16/19 * Rebase to current staging-testing Changes since v2: * Fix Subject * Don't rearrange lines in 01/19 * Split up spacing fixes patch by checkpatch errors into 14 patches * Split up brace fixes patch by checkpatch errors in 3 patches - Diffstat: drivers/staging/sm750fb/ddk750_chip.c| 15 +- drivers/staging/sm750fb/ddk750_chip.h| 12 +- drivers/staging/sm750fb/ddk750_display.c | 170 - drivers/staging/sm750fb/ddk750_display.h | 11 +- drivers/staging/sm750fb/ddk750_dvi.c | 75 ++-- drivers/staging/sm750fb/ddk750_help.c| 2 +- drivers/staging/sm750fb/ddk750_help.h| 4 +- drivers/staging/sm750fb/ddk750_hwi2c.c | 244 +++-- drivers/staging/sm750fb/ddk750_mode.c| 164 + drivers/staging/sm750fb/ddk750_mode.h| 52 ++- drivers/staging/sm750fb/ddk750_power.c | 254 +++--- drivers/staging/sm750fb/ddk750_power.h | 11 +- drivers/staging/sm750fb/ddk750_reg.h | 18 +- drivers/staging/sm750fb/ddk750_sii164.c | 389 ++--- drivers/staging/sm750fb/ddk750_sii164.h | 31 +- drivers/staging/sm750fb/sm750.c | 2 +- drivers/staging/sm750fb/sm750.h | 58 +-- drivers/staging/sm750fb/sm750_accel.c| 379 ++-- drivers/staging/sm750fb/sm750_accel.h| 4 +- drivers/staging/sm750fb/sm750_cursor.c | 51 ++- drivers/staging/sm750fb/sm750_help.h | 28 +- drivers/staging/sm750fb/sm750_hw.c | 19 +- drivers/staging/sm750fb/sm750_hw.h | 42 +-- 23 files changed, 984 insertions(+), 1051 deletions(-) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 02/19] staging: sm750fb: remove spacing after open parenthesis
Fixes checkpatch.pl warning: ERROR: space prohibited after that open parenthesis '(' Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_chip.c | 6 +++--- drivers/staging/sm750fb/ddk750_mode.c | 2 +- drivers/staging/sm750fb/ddk750_power.c | 8 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index f4975d2..1069a2d 100644 --- a/drivers/staging/sm750fb/ddk750_chip.c +++ b/drivers/staging/sm750fb/ddk750_chip.c @@ -599,9 +599,9 @@ unsigned int formatPllReg(pll_value_t *pPLL) On returning a 32 bit number, the value can be applied to any PLL in the calling function. */ ulPllReg = - FIELD_SET( 0, PANEL_PLL_CTRL, BYPASS, OFF) - | FIELD_SET( 0, PANEL_PLL_CTRL, POWER, ON) - | FIELD_SET( 0, PANEL_PLL_CTRL, INPUT, OSC) + FIELD_SET(0, PANEL_PLL_CTRL, BYPASS, OFF) + | FIELD_SET(0, PANEL_PLL_CTRL, POWER, ON) + | FIELD_SET(0, PANEL_PLL_CTRL, INPUT, OSC) #ifndef VALIDATION_CHIP | FIELD_VALUE(0, PANEL_PLL_CTRL, POD,pPLL->POD) #endif diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c index 1f93d07..31424b2 100644 --- a/drivers/staging/sm750fb/ddk750_mode.c +++ b/drivers/staging/sm750fb/ddk750_mode.c @@ -43,7 +43,7 @@ static unsigned long displayControlAdjust_SM750LE(mode_parameter_t *pModeParam, /* Set bit 29:27 of display control register for the right clock */ /* Note that SM750LE only need to supported 7 resoluitons. */ - if ( x == 800 && y == 600 ) + if (x == 800 && y == 600 ) dispControl = FIELD_SET(dispControl, CRT_DISPLAY_CTRL, CLK, PLL41); else if (x == 1024 && y == 768) dispControl = FIELD_SET(dispControl, CRT_DISPLAY_CTRL, CLK, PLL65); diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c index b7a108b..44b8eb1 100644 --- a/drivers/staging/sm750fb/ddk750_power.c +++ b/drivers/staging/sm750fb/ddk750_power.c @@ -59,17 +59,17 @@ void setPowerMode(unsigned int powerMode) { control_value = #ifdef VALIDATION_CHIP - FIELD_SET( control_value, POWER_MODE_CTRL, 336CLK, OFF) | + FIELD_SET(control_value, POWER_MODE_CTRL, 336CLK, OFF) | #endif - FIELD_SET( control_value, POWER_MODE_CTRL, OSC_INPUT, OFF); + FIELD_SET(control_value, POWER_MODE_CTRL, OSC_INPUT, OFF); } else { control_value = #ifdef VALIDATION_CHIP - FIELD_SET( control_value, POWER_MODE_CTRL, 336CLK, ON) | + FIELD_SET(control_value, POWER_MODE_CTRL, 336CLK, ON) | #endif - FIELD_SET( control_value, POWER_MODE_CTRL, OSC_INPUT, ON); + FIELD_SET(control_value, POWER_MODE_CTRL, OSC_INPUT, ON); } /* Program new power mode. */ -- 2.4.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 04/19] staging: sm750fb: add space before open parenthesis
Fixes checkpatch.pl error: ERROR: space required before the open parenthesis '(' Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_display.c | 20 ++-- drivers/staging/sm750fb/ddk750_dvi.c | 2 +- drivers/staging/sm750fb/ddk750_help.c| 2 +- drivers/staging/sm750fb/ddk750_mode.c| 12 ++-- drivers/staging/sm750fb/ddk750_power.c | 6 +++--- drivers/staging/sm750fb/sm750_accel.c| 8 drivers/staging/sm750fb/sm750_cursor.c | 32 drivers/staging/sm750fb/sm750_help.h | 2 +- 8 files changed, 42 insertions(+), 42 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index 1c4049f..973dec3 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -49,7 +49,7 @@ static void setDisplayControl(int ctrl, int dispState) { cnt++; POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg); - } while((PEEK32(PANEL_DISPLAY_CTRL) & ~ulReservedBits) != + } while ((PEEK32(PANEL_DISPLAY_CTRL) & ~ulReservedBits) != (ulDisplayCtrlReg & ~ulReservedBits)); printk("Set Panel Plane enbit:after tried %d times\n", cnt); } @@ -104,7 +104,7 @@ static void setDisplayControl(int ctrl, int dispState) { cnt++; POKE32(CRT_DISPLAY_CTRL, ulDisplayCtrlReg); - } while((PEEK32(CRT_DISPLAY_CTRL) & ~ulReservedBits) != + } while ((PEEK32(CRT_DISPLAY_CTRL) & ~ulReservedBits) != (ulDisplayCtrlReg & ~ulReservedBits)); printk("Set Crt Plane enbit:after tried %d times\n", cnt); } @@ -132,7 +132,7 @@ static void setDisplayControl(int ctrl, int dispState) static void waitNextVerticalSync(int ctrl, int delay) { unsigned int status; - if(!ctrl){ + if (!ctrl){ /* primary controller */ /* Do not wait when the Primary PLL is off or display control is already off. @@ -233,14 +233,14 @@ static void swPanelPowerSequence(int disp, int delay) void ddk750_setLogicalDispOut(disp_output_t output) { unsigned int reg; - if(output & PNL_2_USAGE){ + if (output & PNL_2_USAGE){ /* set panel path controller select */ reg = PEEK32(PANEL_DISPLAY_CTRL); reg = FIELD_VALUE(reg, PANEL_DISPLAY_CTRL, SELECT, (output & PNL_2_MASK)>>PNL_2_OFFSET); POKE32(PANEL_DISPLAY_CTRL, reg); } - if(output & CRT_2_USAGE){ + if (output & CRT_2_USAGE){ /* set crt path controller select */ reg = PEEK32(CRT_DISPLAY_CTRL); reg = FIELD_VALUE(reg, CRT_DISPLAY_CTRL, SELECT, (output & CRT_2_MASK)>>CRT_2_OFFSET); @@ -250,25 +250,25 @@ void ddk750_setLogicalDispOut(disp_output_t output) } - if(output & PRI_TP_USAGE){ + if (output & PRI_TP_USAGE){ /* set primary timing and plane en_bit */ setDisplayControl(0, (output&PRI_TP_MASK)>>PRI_TP_OFFSET); } - if(output & SEC_TP_USAGE){ + if (output & SEC_TP_USAGE){ /* set secondary timing and plane en_bit*/ setDisplayControl(1, (output&SEC_TP_MASK)>>SEC_TP_OFFSET); } - if(output & PNL_SEQ_USAGE){ + if (output & PNL_SEQ_USAGE){ /* set panel sequence */ swPanelPowerSequence((output&PNL_SEQ_MASK)>>PNL_SEQ_OFFSET, 4); } - if(output & DAC_USAGE) + if (output & DAC_USAGE) setDAC((output & DAC_MASK)>>DAC_OFFSET); - if(output & DPMS_USAGE) + if (output & DPMS_USAGE) ddk750_setDPMS((output & DPMS_MASK) >> DPMS_OFFSET); } diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c index 35866fa..4c64436 100644 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ b/drivers/staging/sm750fb/ddk750_dvi.c @@ -45,7 +45,7 @@ int dviInit( { dvi_ctrl_device_t *pCurrentDviCtrl; pCurrentDviCtrl = g_dcftSupportedDviController; - if(pCurrentDviCtrl->pfnInit != NULL) + if (pCurrentDviCtrl->pfnInit != NULL) { return pCurrentDviCtrl->pfnInit(edgeSelect, busSelect, dualEdgeClkSelect, hsyncEnable, vsyncEnable, deskewEnable, deskewSetting, continuousSyncEnable, diff --git a/drivers/staging/sm750fb/ddk750_help.c b/drive
[PATCH v5 08/19] staging: sm750fb: add space after enum definition
Fixes checkpatch.pl warning: WARNING: missing space after enum definition Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_display.h | 2 +- drivers/staging/sm750fb/sm750_hw.h | 8 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_display.h b/drivers/staging/sm750fb/ddk750_display.h index 018a661..a7f50cc 100644 --- a/drivers/staging/sm750fb/ddk750_display.h +++ b/drivers/staging/sm750fb/ddk750_display.h @@ -129,7 +129,7 @@ typedef enum _disp_output_t } disp_output_t; #else -typedef enum _disp_output_t{ +typedef 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 diff --git a/drivers/staging/sm750fb/sm750_hw.h b/drivers/staging/sm750fb/sm750_hw.h index adc61edf..af2db7c 100644 --- a/drivers/staging/sm750fb/sm750_hw.h +++ b/drivers/staging/sm750fb/sm750_hw.h @@ -9,7 +9,7 @@ #endif -enum sm750_pnltype{ +enum sm750_pnltype { sm750_24TFT = 0,/* 24bit tft */ @@ -19,7 +19,7 @@ enum sm750_pnltype{ }; /* vga channel is not concerned */ -enum sm750_dataflow{ +enum sm750_dataflow { sm750_simul_pri,/* primary => all head */ sm750_simul_sec,/* secondary => all head */ @@ -30,13 +30,13 @@ enum sm750_dataflow{ }; -enum sm750_channel{ +enum sm750_channel { sm750_primary = 0, /* enum value equal to the register filed data */ sm750_secondary = 1, }; -enum sm750_path{ +enum sm750_path { sm750_panel = 1, sm750_crt = 2, sm750_pnc = 3,/* panel and crt */ -- 2.4.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 03/19] staging: sm750fb: remove space before close parenthesis
Fixes checkpatch.pl error: ERROR: space prohibited before that close parenthesis ')' Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_chip.c | 2 +- drivers/staging/sm750fb/ddk750_mode.c | 2 +- drivers/staging/sm750fb/sm750_accel.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index 1069a2d..fb1c533 100644 --- a/drivers/staging/sm750fb/ddk750_chip.c +++ b/drivers/staging/sm750fb/ddk750_chip.c @@ -268,7 +268,7 @@ int ddk750_initHw(initchip_param_t *pInitParam) #endif - if (pInitParam->powerMode != 0 ) + if (pInitParam->powerMode != 0) pInitParam->powerMode = 0; setPowerMode(pInitParam->powerMode); diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c index 31424b2..4ee9ceb 100644 --- a/drivers/staging/sm750fb/ddk750_mode.c +++ b/drivers/staging/sm750fb/ddk750_mode.c @@ -43,7 +43,7 @@ static unsigned long displayControlAdjust_SM750LE(mode_parameter_t *pModeParam, /* Set bit 29:27 of display control register for the right clock */ /* Note that SM750LE only need to supported 7 resoluitons. */ - if (x == 800 && y == 600 ) + if (x == 800 && y == 600) dispControl = FIELD_SET(dispControl, CRT_DISPLAY_CTRL, CLK, PLL41); else if (x == 1024 && y == 768) dispControl = FIELD_SET(dispControl, CRT_DISPLAY_CTRL, CLK, PLL65); diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index 64d0458..10cc022 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -363,7 +363,7 @@ int hw_imageblit(struct lynx_accel *accel, Note that input pitch is BYTE value, but the 2D Pitch register uses pixel values. Need Byte to pixel conversion. */ - if(bytePerPixel == 3 ){ + if(bytePerPixel == 3){ dx *= 3; width *= 3; startBit *= 3; -- 2.4.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 06/19] staging: sm750fb: add space before open brace
Fixes checkpatch.pl error: ERROR: space required before the open brace '{' Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_display.c | 14 +++--- drivers/staging/sm750fb/ddk750_mode.c| 8 drivers/staging/sm750fb/ddk750_power.c | 4 ++-- drivers/staging/sm750fb/sm750_accel.c| 6 +++--- drivers/staging/sm750fb/sm750_cursor.c | 14 +++--- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index 973dec3..c7171a4 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -132,7 +132,7 @@ static void setDisplayControl(int ctrl, int dispState) static void waitNextVerticalSync(int ctrl, int delay) { unsigned int status; - if (!ctrl){ + if (!ctrl) { /* primary controller */ /* Do not wait when the Primary PLL is off or display control is already off. @@ -166,7 +166,7 @@ static void waitNextVerticalSync(int ctrl, int delay) while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); } - }else{ + }else { /* Do not wait when the Primary PLL is off or display control is already off. This will prevent the software to wait forever. */ @@ -233,14 +233,14 @@ static void swPanelPowerSequence(int disp, int delay) void ddk750_setLogicalDispOut(disp_output_t output) { unsigned int reg; - if (output & PNL_2_USAGE){ + if (output & PNL_2_USAGE) { /* set panel path controller select */ reg = PEEK32(PANEL_DISPLAY_CTRL); reg = FIELD_VALUE(reg, PANEL_DISPLAY_CTRL, SELECT, (output & PNL_2_MASK)>>PNL_2_OFFSET); POKE32(PANEL_DISPLAY_CTRL, reg); } - if (output & CRT_2_USAGE){ + if (output & CRT_2_USAGE) { /* set crt path controller select */ reg = PEEK32(CRT_DISPLAY_CTRL); reg = FIELD_VALUE(reg, CRT_DISPLAY_CTRL, SELECT, (output & CRT_2_MASK)>>CRT_2_OFFSET); @@ -250,17 +250,17 @@ void ddk750_setLogicalDispOut(disp_output_t output) } - if (output & PRI_TP_USAGE){ + if (output & PRI_TP_USAGE) { /* set primary timing and plane en_bit */ setDisplayControl(0, (output&PRI_TP_MASK)>>PRI_TP_OFFSET); } - if (output & SEC_TP_USAGE){ + if (output & SEC_TP_USAGE) { /* set secondary timing and plane en_bit*/ setDisplayControl(1, (output&SEC_TP_MASK)>>SEC_TP_OFFSET); } - if (output & PNL_SEQ_USAGE){ + if (output & PNL_SEQ_USAGE) { /* set panel sequence */ swPanelPowerSequence((output&PNL_SEQ_MASK)>>PNL_SEQ_OFFSET, 4); } diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c index cfe528c..efc1fab 100644 --- a/drivers/staging/sm750fb/ddk750_mode.c +++ b/drivers/staging/sm750fb/ddk750_mode.c @@ -107,9 +107,9 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll) FIELD_SET(0, CRT_DISPLAY_CTRL, PLANE, ENABLE); - if (getChipType() == SM750LE){ + if (getChipType() == SM750LE) { displayControlAdjust_SM750LE(pModeParam, ulTmpValue); - }else{ + }else { ulReg = PEEK32(CRT_DISPLAY_CTRL) & FIELD_CLEAR(CRT_DISPLAY_CTRL, VSYNC_PHASE) & FIELD_CLEAR(CRT_DISPLAY_CTRL, HSYNC_PHASE) @@ -179,7 +179,7 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll) } #endif } - else{ + else { ret = -1; } return ret; @@ -193,7 +193,7 @@ int ddk750_setModeTiming(mode_parameter_t *parm, clock_type_t clock) pll.clockType = clock; uiActualPixelClk = calcPllValue(parm->pixel_clock, &pll); - if (getChipType() == SM750LE){ + if (getChipType() == SM750LE) { /* set graphic mode via IO method */ outb_p(0x88, 0x3d4); outb_p(0x06, 0x3d5); diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c index a2d9ee6..e2c0bb3 100644 --- a/drivers/staging/sm750fb/ddk750_power.c +++ b/drivers/staging/sm750fb/ddk750_power.c @@ -5,10 +5,10 @@ void ddk750_setDPMS(DPMS_t state) { unsigned int value; - if (getChipType() == SM750LE){ + if (getChipType() == SM750LE) { value = PEEK32(CRT_DISPLAY_CTRL); POKE32(CRT_DISPLAY_CTRL, FIELD_VALUE(value, CRT_DISPLAY_CTRL, DPMS, stat
[PATCH v5 05/19] staging: sm750fb: remove space between function name and parenthesis
Fixes checkpatch.pl warning: WARNING: space prohibited between function name and open parenthesis '(' Signed-off-by: Juston Li --- drivers/staging/sm750fb/sm750_accel.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index 73d84de..982cf1e 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -278,11 +278,11 @@ unsigned int rop2) /* ROP value */ { write_dpr(accel, DE_SOURCE, - FIELD_SET (0, DE_SOURCE, WRAP, DISABLE) | + FIELD_SET(0, DE_SOURCE, WRAP, DISABLE) | FIELD_VALUE(0, DE_SOURCE, X_K1, sx) | FIELD_VALUE(0, DE_SOURCE, Y_K2, sy)); /* dpr0 */ write_dpr(accel, DE_DESTINATION, - FIELD_SET (0, DE_DESTINATION, WRAP, DISABLE) | + FIELD_SET(0, DE_DESTINATION, WRAP, DISABLE) | FIELD_VALUE(0, DE_DESTINATION, X,dx) | FIELD_VALUE(0, DE_DESTINATION, Y,dy)); /* dpr04 */ write_dpr(accel, DE_DIMENSION, @@ -390,11 +390,11 @@ int hw_imageblit(struct lynx_accel *accel, /* Note: For 2D Source in Host Write, only X_K1_MONO field is needed, and Y_K2 field is not used. For mono bitmap, use startBit for X_K1. */ write_dpr(accel, DE_SOURCE, - FIELD_SET (0, DE_SOURCE, WRAP, DISABLE) | + FIELD_SET(0, DE_SOURCE, WRAP, DISABLE) | FIELD_VALUE(0, DE_SOURCE, X_K1_MONO, startBit)); /* dpr00 */ write_dpr(accel, DE_DESTINATION, - FIELD_SET (0, DE_DESTINATION, WRAP, DISABLE) | + FIELD_SET(0, DE_DESTINATION, WRAP, DISABLE) | FIELD_VALUE(0, DE_DESTINATION, X,dx)| FIELD_VALUE(0, DE_DESTINATION, Y,dy)); /* dpr04 */ -- 2.4.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 01/19] staging: sm750fb: use tabs for indentation
Replace spaces with tabs for indentation to fix the checkpatch.pl error ERROR: code indent should use tabs where possible WARNING: please, no spaces at the start of a line Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_display.c | 100 drivers/staging/sm750fb/ddk750_display.h | 2 +- drivers/staging/sm750fb/ddk750_dvi.c | 66 +++--- drivers/staging/sm750fb/ddk750_help.h| 4 +- drivers/staging/sm750fb/ddk750_hwi2c.c | 246 +-- drivers/staging/sm750fb/ddk750_mode.c| 142 +-- drivers/staging/sm750fb/ddk750_mode.h| 46 ++-- drivers/staging/sm750fb/ddk750_power.c | 254 ++-- drivers/staging/sm750fb/ddk750_power.h | 8 +- drivers/staging/sm750fb/ddk750_reg.h | 18 +- drivers/staging/sm750fb/ddk750_sii164.c | 394 +++ drivers/staging/sm750fb/ddk750_sii164.h | 28 +-- drivers/staging/sm750fb/sm750.h | 26 +- drivers/staging/sm750fb/sm750_accel.c| 370 ++--- drivers/staging/sm750fb/sm750_accel.h| 4 +- drivers/staging/sm750fb/sm750_help.h | 26 +- drivers/staging/sm750fb/sm750_hw.h | 28 +-- 17 files changed, 881 insertions(+), 881 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index a3e6720..1c4049f 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -24,7 +24,7 @@ static void setDisplayControl(int ctrl, int dispState) /* Timing should be enabled first before enabling the plane * because changing at the same time does not guarantee that * the plane will also enabled or disabled. -*/ +*/ ulDisplayCtrlReg = FIELD_SET(ulDisplayCtrlReg, PANEL_DISPLAY_CTRL, TIMING, ENABLE); POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg); @@ -135,8 +135,8 @@ static void waitNextVerticalSync(int ctrl, int delay) if(!ctrl){ /* primary controller */ -/* Do not wait when the Primary PLL is off or display control is already off. - This will prevent the software to wait forever. */ + /* Do not wait when the Primary PLL is off or display control is already off. + This will prevent the software to wait forever. */ if ((FIELD_GET(PEEK32(PANEL_PLL_CTRL), PANEL_PLL_CTRL, POWER) == PANEL_PLL_CTRL_POWER_OFF) || (FIELD_GET(PEEK32(PANEL_DISPLAY_CTRL), PANEL_DISPLAY_CTRL, TIMING) == @@ -145,26 +145,26 @@ static void waitNextVerticalSync(int ctrl, int delay) return; } -while (delay-- > 0) -{ -/* Wait for end of vsync. */ -do -{ -status = FIELD_GET(PEEK32(SYSTEM_CTRL), - SYSTEM_CTRL, - PANEL_VSYNC); -} -while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE); - -/* Wait for start of vsync. */ -do -{ -status = FIELD_GET(PEEK32(SYSTEM_CTRL), - SYSTEM_CTRL, - PANEL_VSYNC); -} -while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); -} + while (delay-- > 0) + { + /* Wait for end of vsync. */ + do + { + status = FIELD_GET(PEEK32(SYSTEM_CTRL), + SYSTEM_CTRL, + PANEL_VSYNC); + } + while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE); + + /* Wait for start of vsync. */ + do + { + status = FIELD_GET(PEEK32(SYSTEM_CTRL), + SYSTEM_CTRL, + PANEL_VSYNC); + } + while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); + } }else{ @@ -275,33 +275,33 @@ void ddk750_setLogicalDispOut(disp_output_t output) int ddk750_initDVIDisp(void) { -/* Initialize DVI. If the dviInit fail and the VendorID or the DeviceID are - not zeroed, then set the failure flag. If it is zeroe, it might mean - that the system is in Dual CRT Monitor configuration. */ - -/* De-skew enabled with default 111b value. - This will fix some artifacts problem in some mode on board 2.2. - Somehow this fix does not affect board 2.1. - */ -if ((dvi
[PATCH v5 09/19] staging: sm750fb: add space after struct definition
Fixes checkpatch.pl warning: WARNING: missing space after struct definition Signed-off-by: Juston Li --- drivers/staging/sm750fb/sm750.h| 12 ++-- drivers/staging/sm750fb/sm750_hw.h | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index 8ac5410..9989ff6 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -14,7 +14,7 @@ extern int smi_indent; -struct lynx_accel{ +struct lynx_accel { /* base virtual address of DPR registers */ volatile unsigned char __iomem * dprBase; /* base virtual address of de data port */ @@ -41,7 +41,7 @@ struct lynx_accel{ /* lynx_share stands for a presentation of two frame buffer that use one smi adaptor , it is similar to a basic class of C++ */ -struct lynx_share{ +struct lynx_share { /* common members */ u16 devid; u8 revid; @@ -68,7 +68,7 @@ struct lynx_share{ void (*resume)(struct lynx_share*); }; -struct lynx_cursor{ +struct lynx_cursor { /* cursor width ,height and size */ int w; int h; @@ -92,7 +92,7 @@ struct lynx_cursor{ void (*setData)(struct lynx_cursor *, u16, const u8*, const u8*); }; -struct lynxfb_crtc{ +struct lynxfb_crtc { unsigned char __iomem *vCursor; /* virtual address of cursor */ unsigned char __iomem *vScreen; /* virtual address of on_screen */ int oCursor; /* cursor address offset in vidmem */ @@ -123,7 +123,7 @@ struct lynxfb_crtc{ struct lynx_cursor cursor; }; -struct lynxfb_output{ +struct lynxfb_output { int dpms; int paths; /* which paths(s) this output stands for,for sm750: @@ -149,7 +149,7 @@ struct lynxfb_output{ void (*clear)(struct lynxfb_output*); }; -struct lynxfb_par{ +struct lynxfb_par { /* either 0 or 1 for dual head adaptor,0 is the older one registered */ int index; unsigned int pseudo_palette[256]; diff --git a/drivers/staging/sm750fb/sm750_hw.h b/drivers/staging/sm750fb/sm750_hw.h index af2db7c..ef0a16f 100644 --- a/drivers/staging/sm750fb/sm750_hw.h +++ b/drivers/staging/sm750fb/sm750_hw.h @@ -42,7 +42,7 @@ enum sm750_path { sm750_pnc = 3,/* panel and crt */ }; -struct init_status{ +struct init_status { ushort powerMode; /* below three clocks are in unit of MHZ*/ ushort chip_clk; @@ -52,7 +52,7 @@ struct init_status{ ushort resetMemory; }; -struct sm750_state{ +struct sm750_state { struct init_status initParm; enum sm750_pnltype pnltype; enum sm750_dataflow dataflow; @@ -66,7 +66,7 @@ struct sm750_state{ in C++ */ -struct sm750_share{ +struct sm750_share { /* it's better to put lynx_share struct to the first place of sm750_share */ struct lynx_share share; struct sm750_state state; -- 2.4.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 07/19] staging: sm750fb: add space after close brace
Fixes checkpatch.pl error: ERROR: space required after that close brace '}' Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_display.c | 2 +- drivers/staging/sm750fb/ddk750_mode.c| 2 +- drivers/staging/sm750fb/ddk750_power.c | 2 +- drivers/staging/sm750fb/sm750.h | 2 +- drivers/staging/sm750fb/sm750_cursor.c | 8 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index c7171a4..4a3cb86 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -166,7 +166,7 @@ static void waitNextVerticalSync(int ctrl, int delay) while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); } - }else { + } else { /* Do not wait when the Primary PLL is off or display control is already off. This will prevent the software to wait forever. */ diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c index efc1fab..3d8b06d 100644 --- a/drivers/staging/sm750fb/ddk750_mode.c +++ b/drivers/staging/sm750fb/ddk750_mode.c @@ -109,7 +109,7 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll) if (getChipType() == SM750LE) { displayControlAdjust_SM750LE(pModeParam, ulTmpValue); - }else { + } else { ulReg = PEEK32(CRT_DISPLAY_CTRL) & FIELD_CLEAR(CRT_DISPLAY_CTRL, VSYNC_PHASE) & FIELD_CLEAR(CRT_DISPLAY_CTRL, HSYNC_PHASE) diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c index e2c0bb3..5f697b8 100644 --- a/drivers/staging/sm750fb/ddk750_power.c +++ b/drivers/staging/sm750fb/ddk750_power.c @@ -8,7 +8,7 @@ void ddk750_setDPMS(DPMS_t state) if (getChipType() == SM750LE) { value = PEEK32(CRT_DISPLAY_CTRL); POKE32(CRT_DISPLAY_CTRL, FIELD_VALUE(value, CRT_DISPLAY_CTRL, DPMS, state)); - }else { + } else { value = PEEK32(SYSTEM_CTRL); value= FIELD_VALUE(value, SYSTEM_CTRL, DPMS, state); POKE32(SYSTEM_CTRL, value); diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index 71e9a7a..8ac5410 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -53,7 +53,7 @@ struct lynx_share{ int mtrr_off; struct{ int vram; - }mtrr; + } mtrr; /* all smi graphic adaptor got below attributes */ unsigned long vidmem_start; unsigned long vidreg_start; diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c index 3a21af9..2fcec32 100644 --- a/drivers/staging/sm750fb/sm750_cursor.c +++ b/drivers/staging/sm750fb/sm750_cursor.c @@ -143,7 +143,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor, if (opr & (0x80 >> j)) { /* use fg color,id = 2 */ data |= 2 << (j*2); - }else { + } else { /* use bg color,id = 1 */ data |= 1 << (j*2); } @@ -173,7 +173,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor, /* need a return */ pstart += offset; pbuffer = pstart; - }else { + } else { pbuffer += sizeof(u16); } @@ -223,7 +223,7 @@ void hw_cursor_setData2(struct lynx_cursor *cursor, if (opr & (0x80 >> j)) { /* use fg color,id = 2 */ data |= 2 << (j*2); - }else { + } else { /* use bg color,id = 1 */ data |= 1 << (j*2); } @@ -242,7 +242,7 @@ void hw_cursor_setData2(struct lynx_cursor *cursor, /* need a return */ pstart += offset; pbuffer = pstart; - }else { + } else { pbuffer += sizeof(u16); } -- 2.4.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 10/19] staging: sm750fb: add space after return type
Fixes checkpatch.pl warning: WARNING: missing space after return type Signed-off-by: Juston Li --- drivers/staging/sm750fb/sm750.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index 9989ff6..2d04c0f 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -108,12 +108,12 @@ struct lynxfb_crtc { void *priv; - int(*proc_setMode)(struct lynxfb_crtc*, + int (*proc_setMode)(struct lynxfb_crtc*, struct fb_var_screeninfo*, struct fb_fix_screeninfo*); - int(*proc_checkMode)(struct lynxfb_crtc*, struct fb_var_screeninfo*); - int(*proc_setColReg)(struct lynxfb_crtc*, ushort, ushort, ushort, ushort); + int (*proc_checkMode)(struct lynxfb_crtc*, struct fb_var_screeninfo*); + int (*proc_setColReg)(struct lynxfb_crtc*, ushort, ushort, ushort, ushort); void (*clear)(struct lynxfb_crtc*); /* pan display */ int (*proc_panDisplay)(struct lynxfb_crtc *, @@ -140,12 +140,12 @@ struct lynxfb_output { */ void *priv; - int(*proc_setMode)(struct lynxfb_output*, + int (*proc_setMode)(struct lynxfb_output*, struct fb_var_screeninfo*, struct fb_fix_screeninfo*); - int(*proc_checkMode)(struct lynxfb_output*, struct fb_var_screeninfo*); - int(*proc_setBLANK)(struct lynxfb_output*, int); + int (*proc_checkMode)(struct lynxfb_output*, struct fb_var_screeninfo*); + int (*proc_setBLANK)(struct lynxfb_output*, int); void (*clear)(struct lynxfb_output*); }; -- 2.4.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 13/19] staging: sm750fb: add space after semicolon
Fixes checkpatch.pl error: ERROR: space required after that ';' Signed-off-by: Juston Li --- drivers/staging/sm750fb/sm750.h| 2 +- drivers/staging/sm750fb/sm750_cursor.c | 12 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index d6916fd..9b101a9 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -168,7 +168,7 @@ struct lynxfb_par { ({ \ unsigned long long hz = 1000*1000*1000*1000ULL; \ do_div(hz, ps); \ - (unsigned long)hz;}) + (unsigned long)hz; }) static inline unsigned long ps_to_hz(unsigned int psvalue) { diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c index 9dabac1..4ed7ca2 100644 --- a/drivers/staging/sm750fb/sm750_cursor.c +++ b/drivers/staging/sm750fb/sm750_cursor.c @@ -122,7 +122,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor, odd=0; */ - for (i = 0;i < count;i++) + for (i = 0; i < count; i++) { color = *pcol++; mask = *pmsk++; @@ -137,7 +137,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor, else opr = mask & color; - for (j = 0;j < 8;j++) + for (j = 0; j < 8; j++) { if (opr & (0x80 >> j)) @@ -149,7 +149,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor, } } #else - for (j = 0;j < 8;j++) { + for (j = 0; j < 8; j++) { if (mask & (0x80>>j)) { if (rop == ROP_XOR) opr = mask ^ color; @@ -204,7 +204,7 @@ void hw_cursor_setData2(struct lynx_cursor *cursor, pstart = cursor->vstart; pbuffer = pstart; - for (i = 0;i < count;i++) + for (i = 0; i < count; i++) { color = *pcol++; mask = *pmsk++; @@ -217,7 +217,7 @@ void hw_cursor_setData2(struct lynx_cursor *cursor, else opr = mask & color; - for (j = 0;j < 8;j++) + for (j = 0; j < 8; j++) { if (opr & (0x80 >> j)) @@ -229,7 +229,7 @@ void hw_cursor_setData2(struct lynx_cursor *cursor, } } #else - for (j = 0;j < 8;j++) { + for (j = 0; j < 8; j++) { if (mask & (1<http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 11/19] staging: sm750fb: consistent spacing around operators
Fixes checkpatch.pl error: ERROR: need consistent spacing around operator Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_chip.c| 4 ++-- drivers/staging/sm750fb/ddk750_display.h | 4 ++-- drivers/staging/sm750fb/sm750.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index fb1c533..633201e 100644 --- a/drivers/staging/sm750fb/ddk750_chip.c +++ b/drivers/staging/sm750fb/ddk750_chip.c @@ -464,7 +464,7 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll) RN = N * request; quo = RN / input; rem = RN % input;/* rem always small than 14318181 */ - fl_quo = (rem * 1 /input); + fl_quo = (rem * 1 / input); for (d = xcnt - 1; d >= 0; d--) { X = xparm[d].value; @@ -474,7 +474,7 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll) M += (fl_quo*X % 1)>5000?1:0; if (M < 256 && M > 0) { unsigned int diff; - tmpClock = pll->inputFreq *M / N / X; + tmpClock = pll->inputFreq * M / N / X; diff = absDiff(tmpClock, request_orig); if (diff < miniDiff) { pll->M = M; diff --git a/drivers/staging/sm750fb/ddk750_display.h b/drivers/staging/sm750fb/ddk750_display.h index a7f50cc..afdf201 100644 --- a/drivers/staging/sm750fb/ddk750_display.h +++ b/drivers/staging/sm750fb/ddk750_display.h @@ -46,7 +46,7 @@ 0: both off */ #define SEC_TP_OFFSET 5 -#define SEC_TP_MASK (1<< SEC_TP_OFFSET) +#define SEC_TP_MASK (1 << SEC_TP_OFFSET) #define SEC_TP_USAGE (SEC_TP_MASK << 16) #define SEC_TP_ON ((0x1 << SEC_TP_OFFSET)|SEC_TP_USAGE) #define SEC_TP_OFF ((0x0 << SEC_TP_OFFSET)|SEC_TP_USAGE) @@ -67,7 +67,7 @@ #define DAC_OFFSET 7 #define DAC_MASK (1 << DAC_OFFSET) #define DAC_USAGE (DAC_MASK << 16) -#define DAC_ON ((0x0<< DAC_OFFSET)|DAC_USAGE) +#define DAC_ON ((0x0 << DAC_OFFSET)|DAC_USAGE) #define DAC_OFF ((0x1 << DAC_OFFSET)|DAC_USAGE) /* DPMS only affect D-SUB head diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index 2d04c0f..ae872bd 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -10,7 +10,7 @@ #define MB(x) ((x)<<20) #define MHZ(x) ((x) * 100) /* align should be 2,4,8,16 */ -#define PADDING(align, data) (((data)+(align)-1)&(~((align) -1))) +#define PADDING(align, data) (((data)+(align)-1)&(~((align) - 1))) extern int smi_indent; -- 2.4.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 15/19] staging: sm750fb: remove unnecessary whitespace
Fixes checkpatch.pl warning: WARNING: unnecessary whitespace before a quoted newline Signed-off-by: Juston Li --- drivers/staging/sm750fb/sm750.c| 2 +- drivers/staging/sm750fb/sm750_hw.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index 4d165ca..c7ab818 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -967,7 +967,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index) var->accel_flags = 0; var->vmode = FB_VMODE_NONINTERLACED; - pr_debug("#1 show info->cmap : \nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n", + pr_debug("#1 show info->cmap :\nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n", info->cmap.start, info->cmap.len, info->cmap.red, info->cmap.green, info->cmap.blue, info->cmap.transp); diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index 359165d..fb9c631 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -250,7 +250,7 @@ int hw_sm750_output_setMode(struct lynxfb_output *output, POKE32(DISPLAY_CONTROL_750LE, reg); } - pr_info("ddk setlogicdispout done \n"); + pr_info("ddk setlogicdispout done\n"); return ret; } @@ -489,14 +489,14 @@ int hw_sm750_setBLANK(struct lynxfb_output *output, int blank) #else case VESA_NO_BLANKING: #endif - pr_info("flag = FB_BLANK_UNBLANK \n"); + pr_info("flag = FB_BLANK_UNBLANK\n"); dpms = SYSTEM_CTRL_DPMS_VPHP; pps = PANEL_DISPLAY_CTRL_DATA_ENABLE; crtdb = CRT_DISPLAY_CTRL_BLANK_OFF; break; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 10) case FB_BLANK_NORMAL: - pr_info("flag = FB_BLANK_NORMAL \n"); + pr_info("flag = FB_BLANK_NORMAL\n"); dpms = SYSTEM_CTRL_DPMS_VPHP; pps = PANEL_DISPLAY_CTRL_DATA_DISABLE; crtdb = CRT_DISPLAY_CTRL_BLANK_ON; -- 2.4.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 12/19] 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 --- drivers/staging/sm750fb/ddk750_chip.c | 2 +- drivers/staging/sm750fb/ddk750_power.c | 2 +- drivers/staging/sm750fb/sm750.h| 2 +- drivers/staging/sm750fb/sm750_accel.c | 4 ++-- drivers/staging/sm750fb/sm750_cursor.c | 12 ++-- drivers/staging/sm750fb/sm750_help.h | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index 633201e..d7435d7 100644 --- a/drivers/staging/sm750fb/ddk750_chip.c +++ b/drivers/staging/sm750fb/ddk750_chip.c @@ -471,7 +471,7 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll) M = quo*X; M += fl_quo * X / 1; /* round step */ - M += (fl_quo*X % 1)>5000?1:0; + M += (fl_quo*X % 1) > 5000?1:0; if (M < 256 && M > 0) { unsigned int diff; tmpClock = pll->inputFreq * M / N / X; diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c index 5f697b8..28d4402 100644 --- a/drivers/staging/sm750fb/ddk750_power.c +++ b/drivers/staging/sm750fb/ddk750_power.c @@ -10,7 +10,7 @@ void ddk750_setDPMS(DPMS_t state) POKE32(CRT_DISPLAY_CTRL, FIELD_VALUE(value, CRT_DISPLAY_CTRL, DPMS, state)); } else { value = PEEK32(SYSTEM_CTRL); - value= FIELD_VALUE(value, SYSTEM_CTRL, DPMS, state); + value = FIELD_VALUE(value, SYSTEM_CTRL, DPMS, state); POKE32(SYSTEM_CTRL, value); } } diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index ae872bd..d6916fd 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -172,7 +172,7 @@ struct lynxfb_par { static inline unsigned long ps_to_hz(unsigned int psvalue) { - unsigned long long numerator=1000*1000*1000*1000ULL; + unsigned long long numerator = 1000*1000*1000*1000ULL; /* 10^12 / picosecond period gives frequency in Hz */ do_div(numerator, psvalue); return (unsigned long)numerator; diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index afe73e8..0cfe96c 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -414,10 +414,10 @@ int hw_imageblit(struct lynx_accel *accel, write_dpr(accel, DE_CONTROL, de_ctrl | deGetTransparency(accel)); /* Write MONO data (line by line) to 2D Engine data port */ - for (i=0; i> j)) @@ -149,7 +149,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor, } } #else - for (j=0;j<8;j++) { + for (j = 0;j < 8;j++) { if (mask & (0x80>>j)) { if (rop == ROP_XOR) opr = mask ^ color; @@ -204,7 +204,7 @@ void hw_cursor_setData2(struct lynx_cursor *cursor, pstart = cursor->vstart; pbuffer = pstart; - for (i=0;i> j)) @@ -229,7 +229,7 @@ void hw_cursor_setData2(struct lynx_cursor *cursor, } } #else - for (j=0;j<8;j++) { + for (j = 0;j < 8;j++) { if (mask & (1<http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 16/19] staging: sm750fb: fix brace placement
Fix brace placement errors caught by checkpatch.pl ERROR: that open brace { should be on the previous line Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_chip.h| 12 +++ drivers/staging/sm750fb/ddk750_display.c | 56 ++-- drivers/staging/sm750fb/ddk750_display.h | 3 +- drivers/staging/sm750fb/ddk750_dvi.c | 6 ++-- drivers/staging/sm750fb/ddk750_hwi2c.c | 6 ++-- drivers/staging/sm750fb/ddk750_mode.c| 13 +++- drivers/staging/sm750fb/ddk750_mode.h| 6 ++-- drivers/staging/sm750fb/ddk750_power.c | 27 +-- drivers/staging/sm750fb/ddk750_power.h | 3 +- drivers/staging/sm750fb/ddk750_sii164.c | 16 +++-- drivers/staging/sm750fb/ddk750_sii164.h | 3 +- drivers/staging/sm750fb/sm750_accel.c| 45 - drivers/staging/sm750fb/sm750_cursor.c | 23 + 13 files changed, 71 insertions(+), 148 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_chip.h b/drivers/staging/sm750fb/ddk750_chip.h index 4e030e8..6ff0436 100644 --- a/drivers/staging/sm750fb/ddk750_chip.h +++ b/drivers/staging/sm750fb/ddk750_chip.h @@ -8,8 +8,7 @@ #include /* This is all the chips recognized by this library */ -typedef enum _logical_chip_type_t -{ +typedef enum _logical_chip_type_t { SM_UNKNOWN, SM718, SM750, @@ -18,8 +17,7 @@ typedef enum _logical_chip_type_t logical_chip_type_t; -typedef enum _clock_type_t -{ +typedef enum _clock_type_t { MXCLK_PLL, PRIMARY_PLL, SECONDARY_PLL, @@ -28,8 +26,7 @@ typedef enum _clock_type_t } clock_type_t; -typedef struct _pll_value_t -{ +typedef struct _pll_value_t { clock_type_t clockType; unsigned long inputFreq; /* Input clock frequency to the PLL */ @@ -42,8 +39,7 @@ typedef struct _pll_value_t pll_value_t; /* input struct to initChipParam() function */ -typedef struct _initchip_param_t -{ +typedef struct _initchip_param_t { unsigned short powerMode;/* Use power mode 0 or 1 */ unsigned short chipClock;/** * Speed of main chip clock in MHz unit diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index 4a3cb86..a64ea32 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -15,12 +15,10 @@ static void setDisplayControl(int ctrl, int dispState) cnt = 0; /* Set the primary display control */ - if (!ctrl) - { + if (!ctrl) { ulDisplayCtrlReg = PEEK32(PANEL_DISPLAY_CTRL); /* Turn on/off the Panel display control */ - if (dispState) - { + if (dispState) { /* Timing should be enabled first before enabling the plane * because changing at the same time does not guarantee that * the plane will also enabled or disabled. @@ -45,16 +43,13 @@ static void setDisplayControl(int ctrl, int dispState) * until a few delay. Need to write * and read it a couple times */ - do - { + do { cnt++; POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg); } while ((PEEK32(PANEL_DISPLAY_CTRL) & ~ulReservedBits) != (ulDisplayCtrlReg & ~ulReservedBits)); printk("Set Panel Plane enbit:after tried %d times\n", cnt); - } - else - { + } else { /* When turning off, there is no rule on the programming * sequence since whenever the clock is off, then it does not * matter whether the plane is enabled or disabled. @@ -71,14 +66,11 @@ static void setDisplayControl(int ctrl, int dispState) POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg); } - } - /* Set the secondary display control */ - else - { + } else { + /* Set the secondary display control */ ulDisplayCtrlReg = PEEK32(CRT_DISPLAY_CTRL); - if (dispState) - { + if (dispState) { /* Timing should be enabled first before enabling the plane because changing at the same time does not guarantee that the plane will also enabled or disabled. */ @@ -100,16 +92,13 @@ static void setDisplayControl(int ctrl, int dispState) FIELD_SET(0, CRT_DISPLAY_CTRL, RESERVED_3_MASK, ENABLE) | FIELD_SET(0, CRT_DISPLAY_CTRL, RESERV
[PATCH v5 19/19] staging: sm750fb: add missing blank line after declarations
Fixes checkpatch.pl WARNING: Missing a blank line after declarations Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_chip.c| 1 + drivers/staging/sm750fb/ddk750_display.c | 2 ++ drivers/staging/sm750fb/ddk750_dvi.c | 1 + drivers/staging/sm750fb/ddk750_mode.c| 3 +++ drivers/staging/sm750fb/ddk750_power.c | 1 + drivers/staging/sm750fb/ddk750_sii164.c | 1 + drivers/staging/sm750fb/sm750_accel.c| 1 + drivers/staging/sm750fb/sm750_cursor.c | 2 ++ drivers/staging/sm750fb/sm750_hw.c | 7 +++ 9 files changed, 19 insertions(+) diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index d7435d7..5e6798e 100644 --- a/drivers/staging/sm750fb/ddk750_chip.c +++ b/drivers/staging/sm750fb/ddk750_chip.c @@ -474,6 +474,7 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll) M += (fl_quo*X % 1) > 5000?1:0; if (M < 256 && M > 0) { unsigned int diff; + tmpClock = pll->inputFreq * M / N / X; diff = absDiff(tmpClock, request_orig); if (diff < miniDiff) { diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index abd6283..8348113 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -121,6 +121,7 @@ static void setDisplayControl(int ctrl, int dispState) static void waitNextVerticalSync(int ctrl, int delay) { unsigned int status; + if (!ctrl) { /* primary controller */ @@ -210,6 +211,7 @@ static void swPanelPowerSequence(int disp, int delay) void ddk750_setLogicalDispOut(disp_output_t output) { unsigned int reg; + if (output & PNL_2_USAGE) { /* set panel path controller select */ reg = PEEK32(PANEL_DISPLAY_CTRL); diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c index a18bb4c..a7a2351 100644 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ b/drivers/staging/sm750fb/ddk750_dvi.c @@ -43,6 +43,7 @@ int dviInit( ) { dvi_ctrl_device_t *pCurrentDviCtrl; + pCurrentDviCtrl = g_dcftSupportedDviController; if (pCurrentDviCtrl->pfnInit != NULL) { return pCurrentDviCtrl->pfnInit(edgeSelect, busSelect, dualEdgeClkSelect, hsyncEnable, diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c index 9d10446..2399b17 100644 --- a/drivers/staging/sm750fb/ddk750_mode.c +++ b/drivers/staging/sm750fb/ddk750_mode.c @@ -80,6 +80,7 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll) int ret = 0; int cnt = 0; unsigned int ulTmpValue, ulReg; + if (pll->clockType == SECONDARY_PLL) { /* programe secondary pixel clock */ POKE32(CRT_PLL_CTRL, formatPllReg(pll)); @@ -120,6 +121,7 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll) } else if (pll->clockType == PRIMARY_PLL) { unsigned int ulReservedBits; + POKE32(PANEL_PLL_CTRL, formatPllReg(pll)); POKE32(PANEL_HORIZONTAL_TOTAL, @@ -184,6 +186,7 @@ int ddk750_setModeTiming(mode_parameter_t *parm, clock_type_t clock) { pll_value_t pll; unsigned int uiActualPixelClk; + pll.inputFreq = DEFAULT_INPUT_CLOCK; pll.clockType = clock; diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c index c545c2d..c8c51be 100644 --- a/drivers/staging/sm750fb/ddk750_power.c +++ b/drivers/staging/sm750fb/ddk750_power.c @@ -5,6 +5,7 @@ void ddk750_setDPMS(DPMS_t state) { unsigned int value; + if (getChipType() == SM750LE) { value = PEEK32(CRT_DISPLAY_CTRL); POKE32(CRT_DISPLAY_CTRL, FIELD_VALUE(value, CRT_DISPLAY_CTRL, DPMS, state)); diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c index a5153be..0bdf3db 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.c +++ b/drivers/staging/sm750fb/ddk750_sii164.c @@ -340,6 +340,7 @@ void sii164EnableHotPlugDetection( ) { unsigned char detectReg; + detectReg = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT); /* Depending on each DVI controller, need to enable the hot plug based on each diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index 0f563a9..1dd06a2 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -152,6 +152,7 @@ unsigned int rop2) /* ROP value */ { unsigned int nDirection, de_ctrl; int opSign; + nDirection = LEFT_TO_RIGHT; /* Direction of
[PATCH v5 18/19] staging: sm750fb: remove unnecessary braces
Fixes checkpatch.pl warning: WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Juston Li --- drivers/staging/sm750fb/sm750_accel.c | 9 +++-- drivers/staging/sm750fb/sm750_hw.c| 6 ++ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index 23be0f7..0f563a9 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -259,9 +259,8 @@ unsigned int rop2) /* ROP value */ FIELD_VALUE(0, DE_WINDOW_WIDTH, DESTINATION, (dPitch/Bpp)) | FIELD_VALUE(0, DE_WINDOW_WIDTH, SOURCE, (sPitch/Bpp))); /* dpr3c */ - if (accel->de_wait() != 0) { + if (accel->de_wait() != 0) return -1; - } { @@ -332,9 +331,8 @@ int hw_imageblit(struct lynx_accel *accel, ul4BytesPerScan = ulBytesPerScan & ~3; ulBytesRemain = ulBytesPerScan & 3; - if (accel->de_wait() != 0) { + if (accel->de_wait() != 0) return -1; - } /* 2D Source Base. Use 0 for HOST Blt. @@ -402,9 +400,8 @@ int hw_imageblit(struct lynx_accel *accel, /* Write MONO data (line by line) to 2D Engine data port */ for (i = 0; i < height; i++) { /* For each line, send the data in chunks of 4 bytes */ - for (j = 0; j < (ul4BytesPerScan/4); j++) { + for (j = 0; j < (ul4BytesPerScan/4); j++) write_dpPort(accel, *(unsigned int *)(pSrcbuf + (j * 4))); - } if (ulBytesRemain) { memcpy(ajRemain, pSrcbuf+ul4BytesPerScan, ulBytesRemain); diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index fb9c631..d1d6ae7 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -188,9 +188,8 @@ int hw_sm750_inithw(struct lynx_share *share, struct pci_dev *pdev) } /* init 2d engine */ - if (!share->accel_off) { + if (!share->accel_off) hw_sm750_initAccel(share); - } return 0; } @@ -537,9 +536,8 @@ int hw_sm750_setBLANK(struct lynxfb_output *output, int blank) POKE32(CRT_DISPLAY_CTRL, FIELD_VALUE(PEEK32(CRT_DISPLAY_CTRL), CRT_DISPLAY_CTRL, BLANK, crtdb)); } - if (output->paths & sm750_panel) { + if (output->paths & sm750_panel) POKE32(PANEL_DISPLAY_CTRL, FIELD_VALUE(PEEK32(PANEL_DISPLAY_CTRL), PANEL_DISPLAY_CTRL, DATA, pps)); - } return 0; } -- 2.4.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 14/19] staging: sm750fb: remove trailing whitespace
Fixes checkpatch.pl error: ERROR: trailing whitespace Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_dvi.c | 2 +- drivers/staging/sm750fb/sm750_accel.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c index 4c64436..c42db85 100644 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ b/drivers/staging/sm750fb/ddk750_dvi.c @@ -1,4 +1,4 @@ -#define USE_DVICHIP +#define USE_DVICHIP #ifdef USE_DVICHIP #include "ddk750_help.h" #include "ddk750_reg.h" diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index 0cfe96c..db950d4 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -37,7 +37,7 @@ void hw_de_init(struct lynx_accel *accel) { /* setup 2d engine registers */ u32 reg, clr; - + write_dpr(accel, DE_MASKS, 0x); /* dpr1c */ @@ -82,7 +82,7 @@ void hw_de_init(struct lynx_accel *accel) void hw_set2dformat(struct lynx_accel *accel, int fmt) { u32 reg; - + /* fmt=0,1,2 for 8,16,32,bpp on sm718/750/502 */ reg = read_dpr(accel, DE_STRETCH_FORMAT); reg = FIELD_VALUE(reg, DE_STRETCH_FORMAT, PIXEL_FORMAT, fmt); -- 2.4.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 17/19] staging: sm750fb: move while to follow do close brace
Fixes checkpatch.pl error: ERROR: while should follow close brace '}' Signed-off-by: Juston Li --- drivers/staging/sm750fb/ddk750_display.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index a64ea32..abd6283 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -139,16 +139,14 @@ static void waitNextVerticalSync(int ctrl, int delay) status = FIELD_GET(PEEK32(SYSTEM_CTRL), SYSTEM_CTRL, PANEL_VSYNC); - } - while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE); + } while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE); /* Wait for start of vsync. */ do { status = FIELD_GET(PEEK32(SYSTEM_CTRL), SYSTEM_CTRL, PANEL_VSYNC); - } - while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); + } while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE); } } else { @@ -168,16 +166,14 @@ static void waitNextVerticalSync(int ctrl, int delay) status = FIELD_GET(PEEK32(SYSTEM_CTRL), SYSTEM_CTRL, CRT_VSYNC); - } - while (status == SYSTEM_CTRL_CRT_VSYNC_ACTIVE); + } while (status == SYSTEM_CTRL_CRT_VSYNC_ACTIVE); /* Wait for start of vsync. */ do { status = FIELD_GET(PEEK32(SYSTEM_CTRL), SYSTEM_CTRL, CRT_VSYNC); - } - while (status == SYSTEM_CTRL_CRT_VSYNC_INACTIVE); + } while (status == SYSTEM_CTRL_CRT_VSYNC_INACTIVE); } } } -- 2.4.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: lustre: lmv: lmv_internal.h: fix checkpatch.pl spacing errors
lmv_internal.h:96: ERROR: space prohibited after that open parenthesis '(' lmv_internal.h:96: ERROR: space required before the open parenthesis '(' lmv_internal.h:147: WARNING: space prohibited between function name and open parenthesis '(' Signed-off-by: Juston Li --- drivers/staging/lustre/lustre/lmv/lmv_internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/lmv/lmv_internal.h b/drivers/staging/lustre/lustre/lmv/lmv_internal.h index 80e6604..b911e76 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_internal.h +++ b/drivers/staging/lustre/lustre/lmv/lmv_internal.h @@ -93,7 +93,7 @@ static inline struct lmv_stripe_md *lmv_get_mea(struct ptlrpc_request *req) if (mea->mea_count == 0) return NULL; - if( mea->mea_magic != MEA_MAGIC_LAST_CHAR && + if (mea->mea_magic != MEA_MAGIC_LAST_CHAR && mea->mea_magic != MEA_MAGIC_ALL_CHARS && mea->mea_magic != MEA_MAGIC_HASH_SEGMENT) return NULL; @@ -144,7 +144,7 @@ struct lmv_tgt_desc *lmv_locate_mds(struct lmv_obd *lmv, struct md_op_data *op_data, struct lu_fid *fid); /* lproc_lmv.c */ -#if defined (CONFIG_PROC_FS) +#if defined(CONFIG_PROC_FS) void lprocfs_lmv_init_vars(struct lprocfs_static_vars *lvars); #else static inline void lprocfs_lmv_init_vars(struct lprocfs_static_vars *lvars) -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging/lustre: use __noreturn for lbug_with_loc
fixes sparse error: drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c:149:6: error: symbol 'lbug_with_loc'redeclared with different type (originally declared at drivers/staging/lustre/lustre/libcfs/linux/../../../include/linux/libcfs/libcfs_private.h:82) - different modifiers Use the __noreturn macro instead of __attribute__((noreturn)) The macro is exactly that but its usage seems more common and it is bit more readable. Signed-off-by: Juston Li --- drivers/staging/lustre/include/linux/libcfs/libcfs_private.h | 2 +- drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h index 9544860..6af733d 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h @@ -79,7 +79,7 @@ do { \ #define KLASSERT(e) LASSERT(e) -void lbug_with_loc(struct libcfs_debug_msg_data *)__attribute__((noreturn)); +void __noreturn lbug_with_loc(struct libcfs_debug_msg_data *); #define LBUG() \ do { \ diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c index 4545d54..8689ea7 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c @@ -146,7 +146,7 @@ void libcfs_run_lbug_upcall(struct libcfs_debug_msg_data *msgdata) } /* coverity[+kill] */ -void lbug_with_loc(struct libcfs_debug_msg_data *msgdata) +void __noreturn lbug_with_loc(struct libcfs_debug_msg_data *msgdata) { libcfs_catastrophe = 1; libcfs_debug_msg(msgdata, "LBUG\n"); -- 2.5.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel