staging: sm750fb: cleaning code
Subsystems (2)
cover staging: sm750fb: cleaning code
Folowing patches are cleaning some warnings and checkups from checkpatch.pl
Matej Dujava (9):
staging: sm750fb: fix length of lines
staging: sm750fb: unifying macro definitions
staging: sm750fb: reordering of macro definitions
staging: sm750fb: removing unnecessary binary operations
staging: sm750fb: Remove typedef from "typedef enum
_logical_chip_type_t"
staging: sm750fb: Remove typedef from "typedef enum _clock_type_t"
staging: sm750fb: Remove typedef from "typedef enum _disp_output_t"
staging: sm750fb: Remove typedef from "typedef enum _DPMS_t"
staging: sm750fb: Remove typedef from "typedef enum
_sii164_hot_plug_mode_t"
drivers/staging/sm750fb/ddk750_chip.c | 11 ++-- drivers/staging/sm750fb/ddk750_chip.h | 16 +++--- drivers/staging/sm750fb/ddk750_display.c | 2 +- drivers/staging/sm750fb/ddk750_display.h | 86 ++++++++++++++++---------------- drivers/staging/sm750fb/ddk750_dvi.c | 35 +++++++------ drivers/staging/sm750fb/ddk750_dvi.h | 43 ++++++++-------- drivers/staging/sm750fb/ddk750_hwi2c.c | 37 +++++--------- drivers/staging/sm750fb/ddk750_mode.c | 2 +- drivers/staging/sm750fb/ddk750_mode.h | 2 +- drivers/staging/sm750fb/ddk750_power.c | 2 +- drivers/staging/sm750fb/ddk750_power.h | 7 ++- drivers/staging/sm750fb/ddk750_sii164.c | 49 ++++++++---------- drivers/staging/sm750fb/ddk750_sii164.h | 26 +++++----- drivers/staging/sm750fb/ddk750_swi2c.c | 21 +++----- drivers/staging/sm750fb/ddk750_swi2c.h | 18 ++----- drivers/staging/sm750fb/sm750.c | 26 +++++----- drivers/staging/sm750fb/sm750.h | 6 +-- drivers/staging/sm750fb/sm750_accel.c | 15 +++--- drivers/staging/sm750fb/sm750_cursor.c | 17 +++---- drivers/staging/sm750fb/sm750_hw.c | 4 +- 20 files changed, 194 insertions(+), 231 deletions(-)
Signature · 1 line
1.8.3.1
PATCH 7/9 staging: sm750fb: Remove typedef from "typedef enum _disp_output_t"
This patch removes typedefs from enum and renames it from "typedef enum _disp_output_t" to "enum disp_output" as per kernel coding standards.
--- drivers/staging/sm750fb/ddk750_display.c | 2 +- drivers/staging/sm750fb/ddk750_display.h | 8 ++++---- drivers/staging/sm750fb/sm750_hw.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/staging/sm750fb/ddk750_display.c +1 -1
@@ -110,7 +110,7 @@ static void swPanelPowerSequence(int disp, int delay)primary_wait_vertical_sync (delay); } -void ddk750_setLogicalDispOut (disp_output_t output) +void ddk750_setLogicalDispOut (enum disp_output output) {unsigned int reg;
drivers/staging/sm750fb/ddk750_display.h +4 -4
@@ -88,7 +88,7 @@* LCD1 means panel path TFT1 & panel path DVI (so enable DAC) * CRT means crt path DSUB */ -typedef enum _disp_output_t { +enum disp_output { 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 , do_LCD2_PRI =CRT_2_PRI |PRI_TP_ON |DUAL_TFT_ON ,
@@ -99,9 +99,9 @@*/ do_CRT_PRI =CRT_2_PRI |PRI_TP_ON |DPMS_ON |DAC_ON , do_CRT_SEC = CRT_2_SEC | SEC_TP_ON | DPMS_ON | DAC_ON, -} -disp_output_t; +}; -void ddk750_setLogicalDispOut (disp_output_t output); + +void ddk750_setLogicalDispOut (enum disp_output output);#endif
drivers/staging/sm750fb/sm750_hw.c +1 -1
@@ -184,7 +184,7 @@ int hw_sm750_output_setMode(struct lynxfb_output *output, struct fb_fix_screeninfo *fix) {int ret; -disp_output_t dispSet; +enum disp_output dispSet;int channel; ret =0 ;
Signature · 1 line
1.8.3.1
PATCH 9/9 staging: sm750fb: Remove typedef from "typedef enum _sii164_hot_plug_mode_t"
In reply to Matej DujavaThis patch removes typedefs from enum and renames it from "typedef enum _sii164_hot_plug_mode_t" to "enum sii164_hot_plug_mode" as per kernel coding standards.
--- drivers/staging/sm750fb/ddk750_sii164.c | 2 +- drivers/staging/sm750fb/ddk750_sii164.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/sm750fb/ddk750_sii164.c +1 -1
@@ -296,7 +296,7 @@ void sii164SetPower(unsigned char powerUp)* sii164SelectHotPlugDetectionMode * This function selects the mode of the hot plug detection. */ -static void sii164SelectHotPlugDetectionMode (sii164_hot_plug_mode_t hotPlugMode) +static void sii164SelectHotPlugDetectionMode (enum sii164_hot_plug_mode hotPlugMode) {unsigned char detectReg;
drivers/staging/sm750fb/ddk750_sii164.h +2 -2
@@ -4,12 +4,12 @@#define USE_DVICHIP /* Hot Plug detection mode structure */ -typedef enum _sii164_hot_plug_mode_t { +enum sii164_hot_plug_mode {SII164_HOTPLUG_DISABLE =0 ,/* Disable Hot Plug output bit (always high). */ SII164_HOTPLUG_USE_MDI ,/* Use Monitor Detect Interrupt bit. */ SII164_HOTPLUG_USE_RSEN ,/* Use Receiver Sense detect bit. */ SII164_HOTPLUG_USE_HTPLG /* Use Hot Plug detect bit. */ -}sii164_hot_plug_mode_t ; +};/* Silicon Image SiI164 chip prototype */
Signature · 1 line
1.8.3.1
PATCH 8/9 staging: sm750fb: Remove typedef from "typedef enum _DPMS_t"
In reply to Matej DujavaThis patch removes typedefs from enum and renames it from "typedef enum _DPMS_t" to "enum DPMS" as per kernel coding standards.
--- drivers/staging/sm750fb/ddk750_power.c | 2 +- drivers/staging/sm750fb/ddk750_power.h | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-)
drivers/staging/sm750fb/ddk750_power.c +1 -1
@@ -2,7 +2,7 @@#include "ddk750_reg.h" #include "ddk750_power.h" -void ddk750_set_dpms (DPMS_t state) +void ddk750_set_dpms (enum DPMS state) {unsigned int value;
drivers/staging/sm750fb/ddk750_power.h +3 -4
@@ -1,20 +1,19 @@#ifndef DDK750_POWER_H__ #define DDK750_POWER_H__ -typedef enum _DPMS_t { +enum DPMS { crtDPMS_ON =0x0 , crtDPMS_STANDBY =0x1 , crtDPMS_SUSPEND =0x2 , crtDPMS_OFF =0x3 , -} -DPMS_t ; +};#define setDAC (off) { \ poke32(MISC_CTRL, \ (peek32(MISC_CTRL) & ~MISC_CTRL_DAC_POWER_OFF) | (off)); \ } -void ddk750_set_dpms (DPMS_t state); +void ddk750_set_dpms (enum DPMS state);void sm750_set_power_mode (unsigned int powerMode);void sm750_set_current_gate (unsigned int gate);
Signature · 1 line
1.8.3.1
PATCH 5/9 staging: sm750fb: Remove typedef from "typedef enum _logical_chip_type_t"
In reply to Matej DujavaThis patch removes typedefs from enum and renames it from "typedef enum _logical_chip_type_t" to "enum logical_chip_type" as per kernel coding standards.
--- drivers/staging/sm750fb/ddk750_chip.c | 4 ++-- drivers/staging/sm750fb/ddk750_chip.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/staging/sm750fb/ddk750_chip.c +2 -2
@@ -7,9 +7,9 @@#define MHz (x) ((x) * 1000000) -static logical_chip_type_t chip; +static enum logical_chip_type chip; -logical_chip_type_t sm750_get_chip_type (void ) +enum logical_chip_type sm750_get_chip_type (void ) {return chip; }
drivers/staging/sm750fb/ddk750_chip.h +4 -4
@@ -23,13 +23,13 @@ static inline void poke32(u32 data, u32 addr) }/* This is all the chips recognized by this library */ -typedef enum _logical_chip_type_t { +enum logical_chip_type {SM_UNKNOWN ,SM718 ,SM750 ,SM750LE , -} -logical_chip_type_t ; +}; + typedef enum _clock_type_t { MXCLK_PLL,
@@ -93,7 +93,7 @@ struct initchip_param {/* More initialization parameter can be added if needed */ }; -logical_chip_type_t sm750_get_chip_type (void ); +enum logical_chip_type sm750_get_chip_type (void );void sm750_set_chip_type (unsigned short devId,u8 revId);unsigned int sm750_calc_pll_value (unsigned int request,struct pll_value *pll);unsigned int sm750_format_pll_reg (struct pll_value *pPLL);
Signature · 1 line
1.8.3.1
PATCH 6/9 staging: sm750fb: Remove typedef from "typedef enum _clock_type_t"
In reply to Matej DujavaThis patch removes typedefs from enum and renames it from "typedef enum _clock_type_t" to "enum clock_type" as per kernel coding standards.
--- drivers/staging/sm750fb/ddk750_chip.h | 8 ++++---- drivers/staging/sm750fb/ddk750_mode.c | 2 +- drivers/staging/sm750fb/ddk750_mode.h | 2 +- drivers/staging/sm750fb/sm750_hw.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-)
drivers/staging/sm750fb/ddk750_chip.h +4 -4
@@ -31,17 +31,17 @@ enum logical_chip_type { }; -typedef enum _clock_type_t { +enum clock_type {MXCLK_PLL ,PRIMARY_PLL ,SECONDARY_PLL ,VGA0_PLL ,VGA1_PLL , -} -clock_type_t ; +}; +struct pll_value { -clock_type_t clockType; +enum clock_type clockType;unsigned long inputFreq;/* Input clock frequency to the PLL */ /* Use this when clockType = PANEL_PLL */
drivers/staging/sm750fb/ddk750_mode.c +1 -1
@@ -205,7 +205,7 @@ static int programModeRegisters(struct mode_parameter *pModeParam,return ret; } -int ddk750_setModeTiming (struct mode_parameter *parm,clock_type_t clock) +int ddk750_setModeTiming (struct mode_parameter *parm,enum clock_type clock) {struct pll_value pll;unsigned int uiActualPixelClk;
drivers/staging/sm750fb/ddk750_mode.h +1 -1
@@ -32,5 +32,5 @@ struct mode_parameter { enum spolarity clock_phase_polarity; }; -int ddk750_setModeTiming (struct mode_parameter *parm,clock_type_t clock); +int ddk750_setModeTiming (struct mode_parameter *parm,enum clock_type clock);#endif
drivers/staging/sm750fb/sm750_hw.c +1 -1
@@ -253,7 +253,7 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc,int ret, fmt;u32 reg;struct mode_parameter modparm; -clock_type_t clock; +enum clock_type clock;struct sm750_dev *sm750_dev;struct lynxfb_par *par;
Signature · 1 line
1.8.3.1
PATCH 4/9 staging: sm750fb: removing unnecessary binary operations
In reply to Matej DujavaThis patch remove unnecessary operation (eg. ``X | (0x0 << Y)`` to ``X``).
--- drivers/staging/sm750fb/ddk750_display.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-)
drivers/staging/sm750fb/ddk750_display.h +16 -16
@@ -9,8 +9,8 @@#define PNL_2_OFFSET 0#define PNL_2_MASK (3 << PNL_2_OFFSET)#define PNL_2_USAGE (PNL_2_MASK << 16) -#define PNL_2_PRI ((0 << PNL_2_OFFSET) | PNL_2_USAGE) -#define PNL_2_SEC ((2 << PNL_2_OFFSET) | PNL_2_USAGE) +#define PNL_2_PRI (PNL_2_USAGE) +#define PNL_2_SEC (PNL_2_USAGE | (2 << PNL_2_OFFSET))/* * primary timing & plane enable bit
@@ -20,8 +20,8 @@#define PRI_TP_OFFSET 4#define PRI_TP_MASK BIT(PRI_TP_OFFSET)#define PRI_TP_USAGE (PRI_TP_MASK << 16) -#define PRI_TP_ON ((0x1 << PRI_TP_OFFSET) | PRI_TP_USAGE) -#define PRI_TP_OFF ((0x0 << PRI_TP_OFFSET) | PRI_TP_USAGE) +#define PRI_TP_ON (PRI_TP_USAGE | BIT(PRI_TP_OFFSET)) +#define PRI_TP_OFF (PRI_TP_USAGE)/* * panel sequency status
@@ -30,8 +30,8 @@#define PNL_SEQ_OFFSET 6#define PNL_SEQ_MASK BIT(PNL_SEQ_OFFSET)#define PNL_SEQ_USAGE (PNL_SEQ_MASK << 16) -#define PNL_SEQ_ON (BIT(PNL_SEQ_OFFSET) | PNL_SEQ_USAGE) -#define PNL_SEQ_OFF ((0 << PNL_SEQ_OFFSET) | PNL_SEQ_USAGE) +#define PNL_SEQ_ON (PNL_SEQ_USAGE | BIT(PNL_SEQ_OFFSET)) +#define PNL_SEQ_OFF (PNL_SEQ_USAGE)/* * dual digital output
@@ -40,8 +40,8 @@#define DUAL_TFT_OFFSET 8#define DUAL_TFT_MASK BIT(DUAL_TFT_OFFSET)#define DUAL_TFT_USAGE (DUAL_TFT_MASK << 16) -#define DUAL_TFT_ON (BIT(DUAL_TFT_OFFSET) | DUAL_TFT_USAGE) -#define DUAL_TFT_OFF ((0 << DUAL_TFT_OFFSET) | DUAL_TFT_USAGE) +#define DUAL_TFT_ON (DUAL_TFT_USAGE | BIT(DUAL_TFT_OFFSET)) +#define DUAL_TFT_OFF (DUAL_TFT_USAGE)/* * secondary timing & plane enable bit
@@ -51,8 +51,8 @@#define SEC_TP_OFFSET 5#define SEC_TP_MASK BIT(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) +#define SEC_TP_ON (SEC_TP_USAGE | BIT(SEC_TP_OFFSET)) +#define SEC_TP_OFF (SEC_TP_USAGE)/* * crt path select
@@ -61,8 +61,8 @@#define CRT_2_OFFSET 2#define CRT_2_MASK (3 << CRT_2_OFFSET)#define CRT_2_USAGE (CRT_2_MASK << 16) -#define CRT_2_PRI ((0x0 << CRT_2_OFFSET) | CRT_2_USAGE) -#define CRT_2_SEC ((0x2 << CRT_2_OFFSET) | CRT_2_USAGE) +#define CRT_2_PRI (CRT_2_USAGE) +#define CRT_2_SEC (CRT_2_USAGE | (0x2 << CRT_2_OFFSET))/* * DAC affect both DVI and DSUB
@@ -71,8 +71,8 @@#define DAC_OFFSET 7#define DAC_MASK BIT(DAC_OFFSET)#define DAC_USAGE (DAC_MASK << 16) -#define DAC_ON ((0x0 << DAC_OFFSET) | DAC_USAGE) -#define DAC_OFF ((0x1 << DAC_OFFSET) | DAC_USAGE) +#define DAC_ON (DAC_USAGE) +#define DAC_OFF (DAC_USAGE | BIT(DAC_OFFSET))/* * DPMS only affect D-SUB head
@@ -81,8 +81,8 @@#define DPMS_OFFSET 9#define DPMS_MASK (3 << DPMS_OFFSET)#define DPMS_USAGE (DPMS_MASK << 16) -#define DPMS_ON ((0 << DPMS_OFFSET) | DPMS_USAGE) -#define DPMS_OFF ((3 << DPMS_OFFSET) | DPMS_USAGE) +#define DPMS_ON (DPMS_USAGE) +#define DPMS_OFF (DPMS_USAGE | (0x3 << DPMS_OFFSET))/* * LCD1 means panel path TFT1 & panel path DVI (so enable DAC)
Signature · 1 line
1.8.3.1
PATCH 1/9 staging: sm750fb: fix length of lines
In reply to Matej DujavaThis patch breaks lines that are longer than 80 characters and joins together those, that are too short and can be placed at one.
--- drivers/staging/sm750fb/ddk750_chip.c | 7 +++-- drivers/staging/sm750fb/ddk750_dvi.c | 35 +++++++++++++---------- drivers/staging/sm750fb/ddk750_dvi.h | 43 ++++++++++++++--------------- drivers/staging/sm750fb/ddk750_hwi2c.c | 33 ++++++++-------------- drivers/staging/sm750fb/ddk750_sii164.c | 49 ++++++++++++++------------------- drivers/staging/sm750fb/ddk750_sii164.h | 22 +++++++-------- drivers/staging/sm750fb/ddk750_swi2c.c | 21 ++++---------- drivers/staging/sm750fb/ddk750_swi2c.h | 18 ++++-------- drivers/staging/sm750fb/sm750.c | 26 ++++++++--------- drivers/staging/sm750fb/sm750_accel.c | 15 +++++----- drivers/staging/sm750fb/sm750_cursor.c | 17 +++++------- 11 files changed, 125 insertions(+), 161 deletions(-)
drivers/staging/sm750fb/ddk750_chip.c +4 -3
@@ -175,7 +175,7 @@ static void set_master_clock(unsigned int frequency) }sm750_set_current_gate (reg); - } + } }unsigned int ddk750_get_vm_size (void )
@@ -224,7 +224,7 @@ int ddk750_init_hw(struct initchip_param *pInitParam)sm750_set_current_gate (reg);if (sm750_get_chip_type () !=SM750LE ) { -/* set panel pll and graphic mode via mmio_88 */ +/* set panel pll and graphic mode via mmio_88 */ reg =peek32 (VGA_CONFIGURATION ); reg |= (VGA_CONFIGURATION_PLL |VGA_CONFIGURATION_MODE );poke32 (VGA_CONFIGURATION , reg);
@@ -309,7 +309,8 @@ int ddk750_init_hw(struct initchip_param *pInitParam)* M = {1,...,255} * N = {2,...,15} */ -unsigned int sm750_calc_pll_value (unsigned int request_orig,struct pll_value *pll) +unsigned int sm750_calc_pll_value (unsigned int request_orig, +struct pll_value *pll) {/* * as sm750 register definition,
drivers/staging/sm750fb/ddk750_dvi.c +20 -15
@@ -29,26 +29,31 @@#endif }; -int dviInit ( -unsigned char edgeSelect, -unsigned char busSelect, -unsigned char dualEdgeClkSelect, -unsigned char hsyncEnable, -unsigned char vsyncEnable, -unsigned char deskewEnable, -unsigned char deskewSetting, -unsigned char continuousSyncEnable, -unsigned char pllFilterEnable, -unsigned char pllFilterValue - ) +int dviInit (unsigned char edgeSelect, +unsigned char busSelect, +unsigned char dualEdgeClkSelect, +unsigned char hsyncEnable, +unsigned char vsyncEnable, +unsigned char deskewEnable, +unsigned char deskewSetting, +unsigned char continuousSyncEnable, +unsigned char pllFilterEnable, +unsigned char pllFilterValue) {dvi_ctrl_device_t *pCurrentDviCtrl; pCurrentDviCtrl = g_dcftSupportedDviController;if (pCurrentDviCtrl->pfnInit) { -return pCurrentDviCtrl->pfnInit (edgeSelect, busSelect, dualEdgeClkSelect, hsyncEnable, - vsyncEnable, deskewEnable, deskewSetting, continuousSyncEnable, - pllFilterEnable, pllFilterValue); +return pCurrentDviCtrl->pfnInit (edgeSelect, + busSelect, + dualEdgeClkSelect, + hsyncEnable, + vsyncEnable, + deskewEnable, + deskewSetting, + continuousSyncEnable, + pllFilterEnable, + pllFilterValue); }return -1 ;/* error */ }
drivers/staging/sm750fb/ddk750_dvi.h +20 -23
55 lines not on this page · raw message
drivers/staging/sm750fb/ddk750_hwi2c.c +11 -22
@@ -8,9 +8,7 @@#define MAX_HWI2C_FIFO 16#define HWI2C_WAIT_TIMEOUT 0xF0000 -int sm750_hw_i2c_init ( -unsigned char bus_speed_mode -) +int sm750_hw_i2c_init (unsigned char bus_speed_mode) {unsigned int value;
@@ -81,11 +79,9 @@ static long hw_i2c_wait_tx_done(void)* Return Value: * Total number of bytes those are actually written. */ -static unsigned int hw_i2c_write_data ( -unsigned char addr, -unsigned int length, -unsigned char *buf -) +static unsigned int hw_i2c_write_data (unsigned char addr, +unsigned int length, +unsigned char *buf) {unsigned char count, i;unsigned int total_bytes =0 ;
@@ -148,11 +144,9 @@ static unsigned int hw_i2c_write_data(* Return Value: * Total number of actual bytes read from the slave device */ -static unsigned int hw_i2c_read_data ( -unsigned char addr, -unsigned int length, -unsigned char *buf -) +static unsigned int hw_i2c_read_data (unsigned char addr, +unsigned int length, +unsigned char *buf) {unsigned char count, i;unsigned int total_bytes =0 ;
@@ -212,10 +206,7 @@ static unsigned int hw_i2c_read_data(* Return Value: * Register value */ -unsigned char sm750_hw_i2c_read_reg ( -unsigned char addr, -unsigned char reg -) +unsigned char sm750_hw_i2c_read_reg (unsigned char addr,unsigned char reg) {unsigned char value =0xFF ;
@@ -238,11 +229,9 @@ unsigned char sm750_hw_i2c_read_reg(* 0 - Success * -1 - Fail */ -int sm750_hw_i2c_write_reg ( -unsigned char addr, -unsigned char reg, -unsigned char data -) +int sm750_hw_i2c_write_reg (unsigned char addr, +unsigned char reg, +unsigned char data) {unsigned char value[2 ];
drivers/staging/sm750fb/ddk750_sii164.c +21 -28
110 lines not on this page · raw message
drivers/staging/sm750fb/ddk750_sii164.h +10 -12
@@ -13,18 +13,16 @@/* Silicon Image SiI164 chip prototype */ -long sii164InitChip ( -unsigned char edgeSelect, -unsigned char busSelect, -unsigned char dualEdgeClkSelect, -unsigned char hsyncEnable, -unsigned char vsyncEnable, -unsigned char deskewEnable, -unsigned char deskewSetting, -unsigned char continuousSyncEnable, -unsigned char pllFilterEnable, -unsigned char pllFilterValue -); +long sii164InitChip (unsigned char edgeSelect, +unsigned char busSelect, +unsigned char dualEdgeClkSelect, +unsigned char hsyncEnable, +unsigned char vsyncEnable, +unsigned char deskewEnable, +unsigned char deskewSetting, +unsigned char continuousSyncEnable, +unsigned char pllFilterEnable, +unsigned char pllFilterValue);unsigned short sii164GetVendorID (void );unsigned short sii164GetDeviceID (void );
drivers/staging/sm750fb/ddk750_swi2c.c +6 -15
@@ -349,8 +349,7 @@ static unsigned char sw_i2c_read_byte(unsigned char ack)* -1 - Fail to initialize the i2c * 0 - Success */ -static long sm750le_i2c_init (unsigned char clk_gpio, -unsigned char data_gpio) +static long sm750le_i2c_init (unsigned char clk_gpio,unsigned char data_gpio) {int i;
@@ -388,10 +387,7 @@ static long sm750le_i2c_init(unsigned char clk_gpio,* -1 - Fail to initialize the i2c * 0 - Success */ -long sm750_sw_i2c_init ( -unsigned char clk_gpio, -unsigned char data_gpio -) +long sm750_sw_i2c_init (unsigned char clk_gpio,unsigned char data_gpio) {int i;
@@ -448,10 +444,7 @@ long sm750_sw_i2c_init(* Return Value: * Register value */ -unsigned char sm750_sw_i2c_read_reg ( -unsigned char addr, -unsigned char reg -) +unsigned char sm750_sw_i2c_read_reg (unsigned char addr,unsigned char reg) {unsigned char data;
@@ -488,11 +481,9 @@ unsigned char sm750_sw_i2c_read_reg(* 0 - Success * -1 - Fail */ -long sm750_sw_i2c_write_reg ( -unsigned char addr, -unsigned char reg, -unsigned char data -) +long sm750_sw_i2c_write_reg (unsigned char addr, +unsigned char reg, +unsigned char data) {long ret =0 ;
drivers/staging/sm750fb/ddk750_swi2c.h +5 -13
@@ -28,10 +28,7 @@* -1 - Fail to initialize the i2c * 0 - Success */ -long sm750_sw_i2c_init ( -unsigned char clk_gpio, -unsigned char data_gpio -); +long sm750_sw_i2c_init (unsigned char clk_gpio,unsigned char data_gpio);/* * This function reads the slave device's register
@@ -44,10 +41,7 @@ long sm750_sw_i2c_init(* Return Value: * Register value */ -unsigned char sm750_sw_i2c_read_reg ( -unsigned char addr, -unsigned char reg -); +unsigned char sm750_sw_i2c_read_reg (unsigned char addr,unsigned char reg);/* * This function writes a value to the slave device's register
@@ -62,10 +56,8 @@ unsigned char sm750_sw_i2c_read_reg(* 0 - Success * -1 - Fail */ -long sm750_sw_i2c_write_reg ( -unsigned char addr, -unsigned char reg, -unsigned char data -); +long sm750_sw_i2c_write_reg (unsigned char addr, +unsigned char reg, +unsigned char data);#endif /* _SWI2C_H_ */
drivers/staging/sm750fb/sm750.c +13 -13
@@ -112,42 +112,42 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor) cursor = &crtc->cursor;if (fbcursor->image.width > cursor->maxW || - fbcursor->image.height > cursor->maxH || - fbcursor->image.depth >1 ) { + fbcursor->image.height > cursor->maxH || + fbcursor->image.depth >1 ) {return -ENXIO ; }sm750_hw_cursor_disable (cursor);if (fbcursor->set &FB_CUR_SETSIZE )sm750_hw_cursor_setSize (cursor, - fbcursor->image.width, - fbcursor->image.height); + fbcursor->image.width, + fbcursor->image.height);if (fbcursor->set &FB_CUR_SETPOS )sm750_hw_cursor_setPos (cursor, - fbcursor->image.dx - info->var.xoffset, - fbcursor->image.dy - info->var.yoffset); + fbcursor->image.dx - info->var.xoffset, + fbcursor->image.dy - info->var.yoffset);if (fbcursor->set &FB_CUR_SETCMAP ) {/* get the 16bit color of kernel means */ u16 fg, bg; fg = ((info->cmap.red[fbcursor->image.fg_color] &0xf800 )) | - ((info->cmap.green[fbcursor->image.fg_color] &0xfc00 ) >>5 ) | - ((info->cmap.blue[fbcursor->image.fg_color] &0xf800 ) >>11 ); + ((info->cmap.green[fbcursor->image.fg_color] &0xfc00 ) >>5 ) | + ((info->cmap.blue[fbcursor->image.fg_color] &0xf800 ) >>11 ); bg = ((info->cmap.red[fbcursor->image.bg_color] &0xf800 )) | - ((info->cmap.green[fbcursor->image.bg_color] &0xfc00 ) >>5 ) | - ((info->cmap.blue[fbcursor->image.bg_color] &0xf800 ) >>11 ); + ((info->cmap.green[fbcursor->image.bg_color] &0xfc00 ) >>5 ) | + ((info->cmap.blue[fbcursor->image.bg_color] &0xf800 ) >>11 );sm750_hw_cursor_setColor (cursor, fg, bg); }if (fbcursor->set & (FB_CUR_SETSHAPE |FB_CUR_SETIMAGE )) {sm750_hw_cursor_setData (cursor, - fbcursor->rop, - fbcursor->image.data, - fbcursor->mask); + fbcursor->rop, + fbcursor->image.data, + fbcursor->mask); }if (fbcursor->enable)
drivers/staging/sm750fb/sm750_accel.c +8 -7
@@ -42,10 +42,11 @@ void sm750_hw_de_init(struct lynx_accel *accel)/* dpr1c */ reg =0x3 ; - clr =DE_STRETCH_FORMAT_PATTERN_XY |DE_STRETCH_FORMAT_PATTERN_Y_MASK | -DE_STRETCH_FORMAT_PATTERN_X_MASK | -DE_STRETCH_FORMAT_ADDRESSING_MASK | -DE_STRETCH_FORMAT_SOURCE_HEIGHT_MASK ; + clr =DE_STRETCH_FORMAT_PATTERN_XY | +DE_STRETCH_FORMAT_PATTERN_Y_MASK | +DE_STRETCH_FORMAT_PATTERN_X_MASK | +DE_STRETCH_FORMAT_ADDRESSING_MASK | +DE_STRETCH_FORMAT_SOURCE_HEIGHT_MASK ;/* DE_STRETCH bpp format need be initialized in setMode routine */ write_dpr(accel, DE_STRETCH_FORMAT,
@@ -84,9 +85,9 @@ void sm750_hw_set2dformat(struct lynx_accel *accel, int fmt) }int sm750_hw_fillrect (struct lynx_accel *accel, -u32 base,u32 pitch,u32 Bpp, -u32 x,u32 y,u32 width,u32 height, -u32 color,u32 rop) +u32 base,u32 pitch,u32 Bpp, +u32 x,u32 y,u32 width,u32 height, +u32 color,u32 rop) {u32 deCtrl;
drivers/staging/sm750fb/sm750_cursor.c +7 -10
@@ -60,15 +60,13 @@ void sm750_hw_cursor_disable(struct lynx_cursor *cursor)poke32 (HWC_ADDRESS ,0 ); } -void sm750_hw_cursor_setSize (struct lynx_cursor *cursor, -int w,int h) +void sm750_hw_cursor_setSize (struct lynx_cursor *cursor,int w,int h) { cursor->w = w; cursor->h = h; } -void sm750_hw_cursor_setPos (struct lynx_cursor *cursor, -int x,int y) +void sm750_hw_cursor_setPos (struct lynx_cursor *cursor,int x,int y) {u32 reg;
@@ -77,8 +75,7 @@ void sm750_hw_cursor_setPos(struct lynx_cursor *cursor,poke32 (HWC_LOCATION , reg); } -void sm750_hw_cursor_setColor (struct lynx_cursor *cursor, -u32 fg,u32 bg) +void sm750_hw_cursor_setColor (struct lynx_cursor *cursor,u32 fg,u32 bg) {u32 reg = (fg <<HWC_COLOR_12_2_RGB565_SHIFT ) &HWC_COLOR_12_2_RGB565_MASK ;
@@ -87,8 +84,8 @@ void sm750_hw_cursor_setColor(struct lynx_cursor *cursor,poke32 (HWC_COLOR_3 ,0xffe0 ); } -void sm750_hw_cursor_setData (struct lynx_cursor *cursor, -u16 rop,const u8 *pcol,const u8 *pmsk) +void sm750_hw_cursor_setData (struct lynx_cursor *cursor,u16 rop, +const u8 *pcol,const u8 *pmsk) {int i, j, count, pitch, offset;u8 color, mask, opr;
@@ -138,8 +135,8 @@ void sm750_hw_cursor_setData(struct lynx_cursor *cursor, } -void sm750_hw_cursor_setData2 (struct lynx_cursor *cursor, -u16 rop,const u8 *pcol,const u8 *pmsk) +void sm750_hw_cursor_setData2 (struct lynx_cursor *cursor,u16 rop, +const u8 *pcol,const u8 *pmsk) {int i, j, count, pitch, offset;u8 color, mask;
Signature · 1 line
1.8.3.1
PATCH 3/9 staging: sm750fb: reordering of macro definitions
In reply to Matej DujavaThis patch reorder definition of macros so all macros are in same order.
--- drivers/staging/sm750fb/ddk750_display.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/sm750fb/ddk750_display.h +1 -1
@@ -81,8 +81,8 @@#define DPMS_OFFSET 9#define DPMS_MASK (3 << DPMS_OFFSET)#define DPMS_USAGE (DPMS_MASK << 16) -#define DPMS_OFF ((3 << DPMS_OFFSET) | DPMS_USAGE)#define DPMS_ON ((0 << DPMS_OFFSET) | DPMS_USAGE) +#define DPMS_OFF ((3 << DPMS_OFFSET) | DPMS_USAGE)/* * LCD1 means panel path TFT1 & panel path DVI (so enable DAC)
Signature · 1 line
1.8.3.1
PATCH 2/9 staging: sm750fb: unifying macro definitions
In reply to Matej DujavaThis patch adds tabs into macro definitions so all rhs are on same column.
--- drivers/staging/sm750fb/ddk750_display.h | 74 ++++++++++++++++---------------- drivers/staging/sm750fb/ddk750_hwi2c.c | 4 +- drivers/staging/sm750fb/sm750.h | 6 +-- 3 files changed, 42 insertions(+), 42 deletions(-)
drivers/staging/sm750fb/ddk750_display.h +37 -37
@@ -6,8 +6,8 @@* 80000[29:28] */ -#define PNL_2_OFFSET 0 -#define PNL_2_MASK (3 << PNL_2_OFFSET) +#define PNL_2_OFFSET 0 +#define PNL_2_MASK (3 << PNL_2_OFFSET)#define PNL_2_USAGE (PNL_2_MASK << 16)#define PNL_2_PRI ((0 << PNL_2_OFFSET) | PNL_2_USAGE)#define PNL_2_SEC ((2 << PNL_2_OFFSET) | PNL_2_USAGE)
@@ -17,72 +17,72 @@* 1: 80000[8] & 80000[2] on * 0: both off */ -#define PRI_TP_OFFSET 4 -#define PRI_TP_MASK BIT(PRI_TP_OFFSET) -#define PRI_TP_USAGE (PRI_TP_MASK << 16) -#define PRI_TP_ON ((0x1 << PRI_TP_OFFSET) | PRI_TP_USAGE) -#define PRI_TP_OFF ((0x0 << PRI_TP_OFFSET) | PRI_TP_USAGE) +#define PRI_TP_OFFSET 4 +#define PRI_TP_MASK BIT(PRI_TP_OFFSET) +#define PRI_TP_USAGE (PRI_TP_MASK << 16) +#define PRI_TP_ON ((0x1 << PRI_TP_OFFSET) | PRI_TP_USAGE) +#define PRI_TP_OFF ((0x0 << PRI_TP_OFFSET) | PRI_TP_USAGE)/* * panel sequency status * 80000[27:24] */ -#define PNL_SEQ_OFFSET 6 -#define PNL_SEQ_MASK BIT(PNL_SEQ_OFFSET) -#define PNL_SEQ_USAGE (PNL_SEQ_MASK << 16) -#define PNL_SEQ_ON (BIT(PNL_SEQ_OFFSET) | PNL_SEQ_USAGE) -#define PNL_SEQ_OFF ((0 << PNL_SEQ_OFFSET) | PNL_SEQ_USAGE) +#define PNL_SEQ_OFFSET 6 +#define PNL_SEQ_MASK BIT(PNL_SEQ_OFFSET) +#define PNL_SEQ_USAGE (PNL_SEQ_MASK << 16) +#define PNL_SEQ_ON (BIT(PNL_SEQ_OFFSET) | PNL_SEQ_USAGE) +#define PNL_SEQ_OFF ((0 << PNL_SEQ_OFFSET) | PNL_SEQ_USAGE)/* * dual digital output * 80000[19] */ -#define DUAL_TFT_OFFSET 8 -#define DUAL_TFT_MASK BIT(DUAL_TFT_OFFSET) -#define DUAL_TFT_USAGE (DUAL_TFT_MASK << 16) -#define DUAL_TFT_ON (BIT(DUAL_TFT_OFFSET) | DUAL_TFT_USAGE) -#define DUAL_TFT_OFF ((0 << DUAL_TFT_OFFSET) | DUAL_TFT_USAGE) +#define DUAL_TFT_OFFSET 8 +#define DUAL_TFT_MASK BIT(DUAL_TFT_OFFSET) +#define DUAL_TFT_USAGE (DUAL_TFT_MASK << 16) +#define DUAL_TFT_ON (BIT(DUAL_TFT_OFFSET) | DUAL_TFT_USAGE) +#define DUAL_TFT_OFF ((0 << DUAL_TFT_OFFSET) | DUAL_TFT_USAGE)/* * secondary timing & plane enable bit * 1:80200[8] & 80200[2] on * 0: both off */ -#define SEC_TP_OFFSET 5 -#define SEC_TP_MASK BIT(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) +#define SEC_TP_OFFSET 5 +#define SEC_TP_MASK BIT(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)/* * crt path select * 80200[19:18] */ -#define CRT_2_OFFSET 2 -#define CRT_2_MASK (3 << CRT_2_OFFSET) -#define CRT_2_USAGE (CRT_2_MASK << 16) -#define CRT_2_PRI ((0x0 << CRT_2_OFFSET) | CRT_2_USAGE) -#define CRT_2_SEC ((0x2 << CRT_2_OFFSET) | CRT_2_USAGE) +#define CRT_2_OFFSET 2 +#define CRT_2_MASK (3 << CRT_2_OFFSET) +#define CRT_2_USAGE (CRT_2_MASK << 16) +#define CRT_2_PRI ((0x0 << CRT_2_OFFSET) | CRT_2_USAGE) +#define CRT_2_SEC ((0x2 << CRT_2_OFFSET) | CRT_2_USAGE)/* * DAC affect both DVI and DSUB * 4[20] */ -#define DAC_OFFSET 7 -#define DAC_MASK BIT(DAC_OFFSET) -#define DAC_USAGE (DAC_MASK << 16) -#define DAC_ON ((0x0 << DAC_OFFSET) | DAC_USAGE) -#define DAC_OFF ((0x1 << DAC_OFFSET) | DAC_USAGE) +#define DAC_OFFSET 7 +#define DAC_MASK BIT(DAC_OFFSET) +#define DAC_USAGE (DAC_MASK << 16) +#define DAC_ON ((0x0 << DAC_OFFSET) | DAC_USAGE) +#define DAC_OFF ((0x1 << DAC_OFFSET) | DAC_USAGE)/* * DPMS only affect D-SUB head * 0[31:30] */ -#define DPMS_OFFSET 9 -#define DPMS_MASK (3 << DPMS_OFFSET) -#define DPMS_USAGE (DPMS_MASK << 16) -#define DPMS_OFF ((3 << DPMS_OFFSET) | DPMS_USAGE) -#define DPMS_ON ((0 << DPMS_OFFSET) | DPMS_USAGE) +#define DPMS_OFFSET 9 +#define DPMS_MASK (3 << DPMS_OFFSET) +#define DPMS_USAGE (DPMS_MASK << 16) +#define DPMS_OFF ((3 << DPMS_OFFSET) | DPMS_USAGE) +#define DPMS_ON ((0 << DPMS_OFFSET) | DPMS_USAGE)/* * LCD1 means panel path TFT1 & panel path DVI (so enable DAC)
drivers/staging/sm750fb/ddk750_hwi2c.c +2 -2
@@ -5,8 +5,8 @@#include "ddk750_hwi2c.h" #include "ddk750_power.h" -#define MAX_HWI2C_FIFO 16 -#define HWI2C_WAIT_TIMEOUT 0xF0000 +#define MAX_HWI2C_FIFO 16 +#define HWI2C_WAIT_TIMEOUT 0xF0000int sm750_hw_i2c_init (unsigned char bus_speed_mode) {
drivers/staging/sm750fb/sm750.h +3 -3
@@ -1,14 +1,14 @@#ifndef LYNXDRV_H_ #define LYNXDRV_H_ -#define FB_ACCEL_SMI 0xab +#define FB_ACCEL_SMI 0xab -#define MHZ (x) ((x) * 1000000) +#define MHZ (x) ((x) * 1000000)#define DEFAULT_SM750_CHIP_CLOCK 290#define DEFAULT_SM750LE_CHIP_CLOCK 333#ifndef SM750LE_REVISION_ID -#define SM750LE_REVISION_ID ((unsigned char)0xfe) +#define SM750LE_REVISION_ID ((unsigned char)0xfe)#endif enum sm750_pnltype {
Signature · 1 line
1.8.3.1
Re: [PATCH 1/9] staging: sm750fb: fix length of lines
In reply to Matej DujavaQuoted 3 lines · Matej Dujava
This patch breaks lines that are longer than 80 characters and joins together those, that are too short and can be placed at one.
The patch basically doesn't match the changelog.
regards,
dan carpenter
Re: [PATCH 3/9] staging: sm750fb: reordering of macro definitions
In reply to Matej DujavaQuoted 12 lines · Matej Dujava
This patch reorder definition of macros so all macros are in same order.
Signed-off-by Matej Dujava <[email protected]>--- drivers/staging/sm750fb/ddk750_display.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/sm750fb/ddk750_display.h +0
-0
drivers/staging/sm750fb/ddk750_display.h line 85
Quoted 6 lines
drivers/staging/sm750fb/ddk750_display.h +1
-1@@ -81,8 +81,8 @@#define DPMS_OFFSET 9#define DPMS_MASK (3 << DPMS_OFFSET)#define DPMS_USAGE (DPMS_MASK << 16) -#define DPMS_OFF ((3 << DPMS_OFFSET) | DPMS_USAGE)#define DPMS_ON ((0 << DPMS_OFFSET) | DPMS_USAGE) +#define DPMS_OFF ((3 << DPMS_OFFSET) | DPMS_USAGE)
What "order" are you speaking of here?
I don't understand why this change is needed, sorry.
greg k-h
Re: [PATCH 4/9] staging: sm750fb: removing unnecessary binary operations
In reply to Matej DujavaQuoted 12 lines · Matej Dujava
This patch remove unnecessary operation (eg. ``X | (
0x0<< Y)`` to ``X``).Signed-off-by Matej Dujava <[email protected]>--- drivers/staging/sm750fb/ddk750_display.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-)drivers/staging/sm750fb/ddk750_display.h +0
-0
drivers/staging/sm750fb/ddk750_display.h line 13
Quoted 7 lines
drivers/staging/sm750fb/ddk750_display.h +2
-2@@ -9,8 +9,8 @@#define PNL_2_OFFSET 0#define PNL_2_MASK (3 << PNL_2_OFFSET)#define PNL_2_USAGE (PNL_2_MASK << 16) -#define PNL_2_PRI ((0 << PNL_2_OFFSET) | PNL_2_USAGE) -#define PNL_2_SEC ((2 << PNL_2_OFFSET) | PNL_2_USAGE) +#define PNL_2_PRI (PNL_2_USAGE) +#define PNL_2_SEC (PNL_2_USAGE | (2 << PNL_2_OFFSET))
But the original makes more sense to read, don't you think so?
thanks,
greg k-h
Quoted 1 line · Matej Dujava
Folowing patches are cleaning some warnings and checkups from checkpatch.pl
I've only reviewed a few of these, please fix them up based on the comments you have received so far and resend.
thanks,
greg k-h
PATCH v2 3/7 staging: sm750fb: Remove typedef from "typedef enum _logical_chip_type_t"
In reply to Matej DujavaThis patch removes typedefs from enum and renames it from "typedef enum _logical_chip_type_t" to "enum logical_chip_type" as per kernel coding standards.
--- drivers/staging/sm750fb/ddk750_chip.c | 2 +- drivers/staging/sm750fb/ddk750_chip.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/staging/sm750fb/ddk750_chip.c +1 -1
@@ -7,7 +7,7 @@static logical_chip_type_t chip; -logical_chip_type_t sm750_get_chip_type (void ) +enum logical_chip_type sm750_get_chip_type (void ) {return chip; }
drivers/staging/sm750fb/ddk750_chip.h +4 -4
@@ -23,13 +23,13 @@ static inline void poke32(u32 data, u32 addr) }/* This is all the chips recognized by this library */ -typedef enum _logical_chip_type_t { +enum logical_chip_type {SM_UNKNOWN ,SM718 ,SM750 ,SM750LE , -} -logical_chip_type_t ; +}; + typedef enum _clock_type_t { MXCLK_PLL,
@@ -93,7 +93,7 @@ struct initchip_param {/* More initialization parameter can be added if needed */ }; -logical_chip_type_t sm750_get_chip_type (void ); +enum logical_chip_type sm750_get_chip_type (void );void sm750_set_chip_type (unsigned short devId,u8 revId);unsigned int sm750_calc_pll_value (unsigned int request,struct pll_value *pll);unsigned int sm750_format_pll_reg (struct pll_value *pPLL);
Signature · 1 line
1.8.3.1
PATCH v2 2/7 staging: sm750fb: unifying macro usage and definitions
In reply to Matej DujavaThis patch adds tabs into macro definitions so all rhs are on same column. Removing MHz macro from ddk_chip.c file and reuse MHZ from sm750.h.
--- drivers/staging/sm750fb/ddk750_chip.c | 18 ++++---- drivers/staging/sm750fb/ddk750_display.h | 78 ++++++++++++++++---------------- drivers/staging/sm750fb/ddk750_hwi2c.c | 4 +- drivers/staging/sm750fb/sm750.h | 6 +-- 4 files changed, 52 insertions(+), 54 deletions(-)
drivers/staging/sm750fb/ddk750_chip.c +8 -10
@@ -5,8 +5,6 @@#include "ddk750_chip.h" #include "ddk750_power.h" -#define MHz (x) ((x) * 1000000) -static logical_chip_type_t chip;logical_chip_type_t sm750_get_chip_type (void )
@@ -36,7 +34,7 @@ static unsigned int get_mxclk_freq(void)unsigned int M ,N ,OD ,POD ;if (sm750_get_chip_type () ==SM750LE ) -return MHz (130 ); +return MHZ (130 ); pll_reg =peek32 (MXCLK_PLL_CTRL );M = (pll_reg &PLL_CTRL_M_MASK ) >>PLL_CTRL_M_SHIFT ;
@@ -98,8 +96,8 @@ static void set_memory_clock(unsigned int frequency)* Set the frequency to the maximum frequency * that the DDR Memory can take which is 336MHz. */ -if (frequency >MHz (336 )) - frequency =MHz (336 ); +if (frequency >MHZ (336 )) + frequency =MHZ (336 );/* Calculate the divisor */ divisor =DIV_ROUND_CLOSEST (get_mxclk_freq (), frequency);
@@ -150,8 +148,8 @@ static void set_master_clock(unsigned int frequency)* Set the frequency to the maximum frequency * that the SM750 engine can run, which is about 190 MHz. */ -if (frequency >MHz (190 )) - frequency =MHz (190 ); +if (frequency >MHZ (190 )) + frequency =MHZ (190 );/* Calculate the divisor */ divisor =DIV_ROUND_CLOSEST (get_mxclk_freq (), frequency);
@@ -237,13 +235,13 @@ int ddk750_init_hw(struct initchip_param *pInitParam) }/* Set the Main Chip Clock */ -set_chip_clock (MHz ((unsigned int )pInitParam->chipClock)); +set_chip_clock (MHZ ((unsigned int )pInitParam->chipClock));/* Set up memory clock. */ -set_memory_clock (MHz (pInitParam->memClock)); +set_memory_clock (MHZ (pInitParam->memClock));/* Set up master clock */ -set_master_clock (MHz (pInitParam->masterClock)); +set_master_clock (MHZ (pInitParam->masterClock));/* * Reset the memory controller.
drivers/staging/sm750fb/ddk750_display.h +39 -39
122 lines not on this page · raw message
drivers/staging/sm750fb/ddk750_hwi2c.c +2 -2
@@ -5,8 +5,8 @@#include "ddk750_hwi2c.h" #include "ddk750_power.h" -#define MAX_HWI2C_FIFO 16 -#define HWI2C_WAIT_TIMEOUT 0xF0000 +#define MAX_HWI2C_FIFO 16 +#define HWI2C_WAIT_TIMEOUT 0xF0000int sm750_hw_i2c_init (unsigned char bus_speed_mode) {
drivers/staging/sm750fb/sm750.h +3 -3
@@ -1,14 +1,14 @@#ifndef LYNXDRV_H_ #define LYNXDRV_H_ -#define FB_ACCEL_SMI 0xab +#define FB_ACCEL_SMI 0xab -#define MHZ (x) ((x) * 1000000) +#define MHZ (x) ((x) * 1000000)#define DEFAULT_SM750_CHIP_CLOCK 290#define DEFAULT_SM750LE_CHIP_CLOCK 333#ifndef SM750LE_REVISION_ID -#define SM750LE_REVISION_ID ((unsigned char)0xfe) +#define SM750LE_REVISION_ID ((unsigned char)0xfe)#endif enum sm750_pnltype {
Signature · 1 line
1.8.3.1
v2 cover staging: sm750fb: cleaning code
In reply to Matej DujavaFolowing patch set cleans some warnings and checkups from checkpatch.pl and also fix code to better fot linux code style.
Changes since v1 [1]:
* staging: sm750fb: fix length of lines, function calls and declaration
* created better description
* squashed:
staging: sm750fb: unifying macro definitions
staging: sm750fb: reordering of macro definitions
staging: sm750fb: removing unnecessary binary operations
* delete duplicit macro for MHZ
[1] https://lkml.org/lkml/2017/5/15/284
Matej Dujava (7):
staging: sm750fb: fix length of lines, function calls and declaration
staging: sm750fb: unifying macro usage and definitions
staging: sm750fb: Remove typedef from "typedef enum
_logical_chip_type_t"
staging: sm750fb: Remove typedef from "typedef enum _clock_type_t"
staging: sm750fb: Remove typedef from "typedef enum _disp_output_t"
staging: sm750fb: Remove typedef from "typedef enum _DPMS_t"
staging: sm750fb: Remove typedef from "typedef enum
_sii164_hot_plug_mode_t"
drivers/staging/sm750fb/ddk750_chip.c | 27 +++++----- drivers/staging/sm750fb/ddk750_chip.h | 16 +++--- drivers/staging/sm750fb/ddk750_display.c | 2 +- drivers/staging/sm750fb/ddk750_display.h | 86 ++++++++++++++++---------------- drivers/staging/sm750fb/ddk750_dvi.c | 35 +++++++------ drivers/staging/sm750fb/ddk750_dvi.h | 43 ++++++++-------- drivers/staging/sm750fb/ddk750_hwi2c.c | 37 +++++--------- drivers/staging/sm750fb/ddk750_mode.c | 2 +- drivers/staging/sm750fb/ddk750_mode.h | 2 +- drivers/staging/sm750fb/ddk750_power.c | 2 +- drivers/staging/sm750fb/ddk750_power.h | 7 ++- drivers/staging/sm750fb/ddk750_sii164.c | 49 ++++++++---------- drivers/staging/sm750fb/ddk750_sii164.h | 26 +++++----- drivers/staging/sm750fb/ddk750_swi2c.c | 21 +++----- drivers/staging/sm750fb/ddk750_swi2c.h | 18 ++----- drivers/staging/sm750fb/sm750.c | 26 +++++----- drivers/staging/sm750fb/sm750.h | 6 +-- drivers/staging/sm750fb/sm750_accel.c | 15 +++--- drivers/staging/sm750fb/sm750_cursor.c | 17 +++---- drivers/staging/sm750fb/sm750_hw.c | 4 +- 20 files changed, 201 insertions(+), 240 deletions(-)
Signature · 1 line
1.8.3.1
PATCH v2 6/7 staging: sm750fb: Remove typedef from "typedef enum _DPMS_t"
This patch removes typedefs from enum and renames it from "typedef enum _DPMS_t" to "enum DPMS" as per kernel coding standards.
--- drivers/staging/sm750fb/ddk750_power.c | 2 +- drivers/staging/sm750fb/ddk750_power.h | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-)
drivers/staging/sm750fb/ddk750_power.c +1 -1
@@ -2,7 +2,7 @@#include "ddk750_reg.h" #include "ddk750_power.h" -void ddk750_set_dpms (DPMS_t state) +void ddk750_set_dpms (enum DPMS state) {unsigned int value;
drivers/staging/sm750fb/ddk750_power.h +3 -4
@@ -1,20 +1,19 @@#ifndef DDK750_POWER_H__ #define DDK750_POWER_H__ -typedef enum _DPMS_t { +enum DPMS { crtDPMS_ON =0x0 , crtDPMS_STANDBY =0x1 , crtDPMS_SUSPEND =0x2 , crtDPMS_OFF =0x3 , -} -DPMS_t ; +};#define setDAC (off) { \ poke32(MISC_CTRL, \ (peek32(MISC_CTRL) & ~MISC_CTRL_DAC_POWER_OFF) | (off)); \ } -void ddk750_set_dpms (DPMS_t state); +void ddk750_set_dpms (enum DPMS state);void sm750_set_power_mode (unsigned int powerMode);void sm750_set_current_gate (unsigned int gate);
Signature · 1 line
1.8.3.1
PATCH v2 4/7 staging: sm750fb: Remove typedef from "typedef enum _clock_type_t"
In reply to Matej DujavaThis patch removes typedefs from enum and renames it from "typedef enum _clock_type_t" to "enum clock_type" as per kernel coding standards.
--- drivers/staging/sm750fb/ddk750_chip.h | 8 ++++---- drivers/staging/sm750fb/ddk750_mode.c | 2 +- drivers/staging/sm750fb/ddk750_mode.h | 2 +- drivers/staging/sm750fb/sm750_hw.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-)
drivers/staging/sm750fb/ddk750_chip.h +4 -4
@@ -31,17 +31,17 @@ enum logical_chip_type { }; -typedef enum _clock_type_t { +enum clock_type {MXCLK_PLL ,PRIMARY_PLL ,SECONDARY_PLL ,VGA0_PLL ,VGA1_PLL , -} -clock_type_t ; +}; +struct pll_value { -clock_type_t clockType; +enum clock_type clockType;unsigned long inputFreq;/* Input clock frequency to the PLL */ /* Use this when clockType = PANEL_PLL */
drivers/staging/sm750fb/ddk750_mode.c +1 -1
@@ -205,7 +205,7 @@ static int programModeRegisters(struct mode_parameter *pModeParam,return ret; } -int ddk750_setModeTiming (struct mode_parameter *parm,clock_type_t clock) +int ddk750_setModeTiming (struct mode_parameter *parm,enum clock_type clock) {struct pll_value pll;unsigned int uiActualPixelClk;
drivers/staging/sm750fb/ddk750_mode.h +1 -1
@@ -32,5 +32,5 @@ struct mode_parameter { enum spolarity clock_phase_polarity; }; -int ddk750_setModeTiming (struct mode_parameter *parm,clock_type_t clock); +int ddk750_setModeTiming (struct mode_parameter *parm,enum clock_type clock);#endif
drivers/staging/sm750fb/sm750_hw.c +1 -1
@@ -253,7 +253,7 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc,int ret, fmt;u32 reg;struct mode_parameter modparm; -clock_type_t clock; +enum clock_type clock;struct sm750_dev *sm750_dev;struct lynxfb_par *par;
Signature · 1 line
1.8.3.1
PATCH v2 7/7 staging: sm750fb: Remove typedef from "typedef enum _sii164_hot_plug_mode_t"
In reply to Matej DujavaThis patch removes typedefs from enum and renames it from "typedef enum _sii164_hot_plug_mode_t" to "enum sii164_hot_plug_mode" as per kernel coding standards.
--- drivers/staging/sm750fb/ddk750_sii164.c | 2 +- drivers/staging/sm750fb/ddk750_sii164.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/sm750fb/ddk750_sii164.c +1 -1
@@ -296,7 +296,7 @@ void sii164SetPower(unsigned char powerUp)* sii164SelectHotPlugDetectionMode * This function selects the mode of the hot plug detection. */ -static void sii164SelectHotPlugDetectionMode (sii164_hot_plug_mode_t hotPlugMode) +static void sii164SelectHotPlugDetectionMode (enum sii164_hot_plug_mode hotPlugMode) {unsigned char detectReg;
drivers/staging/sm750fb/ddk750_sii164.h +2 -2
@@ -4,12 +4,12 @@#define USE_DVICHIP /* Hot Plug detection mode structure */ -typedef enum _sii164_hot_plug_mode_t { +enum sii164_hot_plug_mode {SII164_HOTPLUG_DISABLE =0 ,/* Disable Hot Plug output bit (always high). */ SII164_HOTPLUG_USE_MDI ,/* Use Monitor Detect Interrupt bit. */ SII164_HOTPLUG_USE_RSEN ,/* Use Receiver Sense detect bit. */ SII164_HOTPLUG_USE_HTPLG /* Use Hot Plug detect bit. */ -}sii164_hot_plug_mode_t ; +};/* Silicon Image SiI164 chip prototype */
Signature · 1 line
1.8.3.1
PATCH v2 5/7 staging: sm750fb: Remove typedef from "typedef enum _disp_output_t"
In reply to Matej DujavaThis patch removes typedefs from enum and renames it from "typedef enum _disp_output_t" to "enum disp_output" as per kernel coding standards.
--- drivers/staging/sm750fb/ddk750_display.c | 2 +- drivers/staging/sm750fb/ddk750_display.h | 8 ++++---- drivers/staging/sm750fb/sm750_hw.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/staging/sm750fb/ddk750_display.c +1 -1
@@ -110,7 +110,7 @@ static void swPanelPowerSequence(int disp, int delay)primary_wait_vertical_sync (delay); } -void ddk750_setLogicalDispOut (disp_output_t output) +void ddk750_setLogicalDispOut (enum disp_output output) {unsigned int reg;
drivers/staging/sm750fb/ddk750_display.h +4 -4
@@ -88,7 +88,7 @@* LCD1 means panel path TFT1 & panel path DVI (so enable DAC) * CRT means crt path DSUB */ -typedef enum _disp_output_t { +enum disp_output { 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 , do_LCD2_PRI =CRT_2_PRI |PRI_TP_ON |DUAL_TFT_ON ,
@@ -99,9 +99,9 @@*/ do_CRT_PRI =CRT_2_PRI |PRI_TP_ON |DPMS_ON |DAC_ON , do_CRT_SEC = CRT_2_SEC | SEC_TP_ON | DPMS_ON | DAC_ON, -} -disp_output_t; +}; -void ddk750_setLogicalDispOut (disp_output_t output); + +void ddk750_setLogicalDispOut (enum disp_output output);#endif
drivers/staging/sm750fb/sm750_hw.c +1 -1
@@ -184,7 +184,7 @@ int hw_sm750_output_setMode(struct lynxfb_output *output, struct fb_fix_screeninfo *fix) {int ret; -disp_output_t dispSet; +enum disp_output dispSet;int channel; ret =0 ;
Signature · 1 line
1.8.3.1
PATCH v2 1/7 staging: sm750fb: fix length of lines, function calls and declaration
In reply to Matej DujavaThis patch breaks lines that are longer than 80 characters and joins together those, that are too short and can be placed at one.
Function calls and declarations are updated to fit kernel code style.
--- drivers/staging/sm750fb/ddk750_chip.c | 7 +++-- drivers/staging/sm750fb/ddk750_dvi.c | 35 +++++++++++++---------- drivers/staging/sm750fb/ddk750_dvi.h | 43 ++++++++++++++--------------- drivers/staging/sm750fb/ddk750_hwi2c.c | 33 ++++++++-------------- drivers/staging/sm750fb/ddk750_sii164.c | 49 ++++++++++++++------------------- drivers/staging/sm750fb/ddk750_sii164.h | 22 +++++++-------- drivers/staging/sm750fb/ddk750_swi2c.c | 21 ++++---------- drivers/staging/sm750fb/ddk750_swi2c.h | 18 ++++-------- drivers/staging/sm750fb/sm750.c | 26 ++++++++--------- drivers/staging/sm750fb/sm750_accel.c | 15 +++++----- drivers/staging/sm750fb/sm750_cursor.c | 17 +++++------- 11 files changed, 125 insertions(+), 161 deletions(-)
drivers/staging/sm750fb/ddk750_chip.c +4 -3
@@ -175,7 +175,7 @@ static void set_master_clock(unsigned int frequency) }sm750_set_current_gate (reg); - } + } }unsigned int ddk750_get_vm_size (void )
@@ -224,7 +224,7 @@ int ddk750_init_hw(struct initchip_param *pInitParam)sm750_set_current_gate (reg);if (sm750_get_chip_type () !=SM750LE ) { -/* set panel pll and graphic mode via mmio_88 */ +/* set panel pll and graphic mode via mmio_88 */ reg =peek32 (VGA_CONFIGURATION ); reg |= (VGA_CONFIGURATION_PLL |VGA_CONFIGURATION_MODE );poke32 (VGA_CONFIGURATION , reg);
@@ -309,7 +309,8 @@ int ddk750_init_hw(struct initchip_param *pInitParam)* M = {1,...,255} * N = {2,...,15} */ -unsigned int sm750_calc_pll_value (unsigned int request_orig,struct pll_value *pll) +unsigned int sm750_calc_pll_value (unsigned int request_orig, +struct pll_value *pll) {/* * as sm750 register definition,
drivers/staging/sm750fb/ddk750_dvi.c +20 -15
@@ -29,26 +29,31 @@#endif }; -int dviInit ( -unsigned char edgeSelect, -unsigned char busSelect, -unsigned char dualEdgeClkSelect, -unsigned char hsyncEnable, -unsigned char vsyncEnable, -unsigned char deskewEnable, -unsigned char deskewSetting, -unsigned char continuousSyncEnable, -unsigned char pllFilterEnable, -unsigned char pllFilterValue - ) +int dviInit (unsigned char edgeSelect, +unsigned char busSelect, +unsigned char dualEdgeClkSelect, +unsigned char hsyncEnable, +unsigned char vsyncEnable, +unsigned char deskewEnable, +unsigned char deskewSetting, +unsigned char continuousSyncEnable, +unsigned char pllFilterEnable, +unsigned char pllFilterValue) {dvi_ctrl_device_t *pCurrentDviCtrl; pCurrentDviCtrl = g_dcftSupportedDviController;if (pCurrentDviCtrl->pfnInit) { -return pCurrentDviCtrl->pfnInit (edgeSelect, busSelect, dualEdgeClkSelect, hsyncEnable, - vsyncEnable, deskewEnable, deskewSetting, continuousSyncEnable, - pllFilterEnable, pllFilterValue); +return pCurrentDviCtrl->pfnInit (edgeSelect, + busSelect, + dualEdgeClkSelect, + hsyncEnable, + vsyncEnable, + deskewEnable, + deskewSetting, + continuousSyncEnable, + pllFilterEnable, + pllFilterValue); }return -1 ;/* error */ }
drivers/staging/sm750fb/ddk750_dvi.h +20 -23
55 lines not on this page · raw message
drivers/staging/sm750fb/ddk750_hwi2c.c +11 -22
@@ -8,9 +8,7 @@#define MAX_HWI2C_FIFO 16#define HWI2C_WAIT_TIMEOUT 0xF0000 -int sm750_hw_i2c_init ( -unsigned char bus_speed_mode -) +int sm750_hw_i2c_init (unsigned char bus_speed_mode) {unsigned int value;
@@ -81,11 +79,9 @@ static long hw_i2c_wait_tx_done(void)* Return Value: * Total number of bytes those are actually written. */ -static unsigned int hw_i2c_write_data ( -unsigned char addr, -unsigned int length, -unsigned char *buf -) +static unsigned int hw_i2c_write_data (unsigned char addr, +unsigned int length, +unsigned char *buf) {unsigned char count, i;unsigned int total_bytes =0 ;
@@ -148,11 +144,9 @@ static unsigned int hw_i2c_write_data(* Return Value: * Total number of actual bytes read from the slave device */ -static unsigned int hw_i2c_read_data ( -unsigned char addr, -unsigned int length, -unsigned char *buf -) +static unsigned int hw_i2c_read_data (unsigned char addr, +unsigned int length, +unsigned char *buf) {unsigned char count, i;unsigned int total_bytes =0 ;
@@ -212,10 +206,7 @@ static unsigned int hw_i2c_read_data(* Return Value: * Register value */ -unsigned char sm750_hw_i2c_read_reg ( -unsigned char addr, -unsigned char reg -) +unsigned char sm750_hw_i2c_read_reg (unsigned char addr,unsigned char reg) {unsigned char value =0xFF ;
@@ -238,11 +229,9 @@ unsigned char sm750_hw_i2c_read_reg(* 0 - Success * -1 - Fail */ -int sm750_hw_i2c_write_reg ( -unsigned char addr, -unsigned char reg, -unsigned char data -) +int sm750_hw_i2c_write_reg (unsigned char addr, +unsigned char reg, +unsigned char data) {unsigned char value[2 ];
drivers/staging/sm750fb/ddk750_sii164.c +21 -28
110 lines not on this page · raw message
drivers/staging/sm750fb/ddk750_sii164.h +10 -12
@@ -13,18 +13,16 @@/* Silicon Image SiI164 chip prototype */ -long sii164InitChip ( -unsigned char edgeSelect, -unsigned char busSelect, -unsigned char dualEdgeClkSelect, -unsigned char hsyncEnable, -unsigned char vsyncEnable, -unsigned char deskewEnable, -unsigned char deskewSetting, -unsigned char continuousSyncEnable, -unsigned char pllFilterEnable, -unsigned char pllFilterValue -); +long sii164InitChip (unsigned char edgeSelect, +unsigned char busSelect, +unsigned char dualEdgeClkSelect, +unsigned char hsyncEnable, +unsigned char vsyncEnable, +unsigned char deskewEnable, +unsigned char deskewSetting, +unsigned char continuousSyncEnable, +unsigned char pllFilterEnable, +unsigned char pllFilterValue);unsigned short sii164GetVendorID (void );unsigned short sii164GetDeviceID (void );
drivers/staging/sm750fb/ddk750_swi2c.c +6 -15
@@ -349,8 +349,7 @@ static unsigned char sw_i2c_read_byte(unsigned char ack)* -1 - Fail to initialize the i2c * 0 - Success */ -static long sm750le_i2c_init (unsigned char clk_gpio, -unsigned char data_gpio) +static long sm750le_i2c_init (unsigned char clk_gpio,unsigned char data_gpio) {int i;
@@ -388,10 +387,7 @@ static long sm750le_i2c_init(unsigned char clk_gpio,* -1 - Fail to initialize the i2c * 0 - Success */ -long sm750_sw_i2c_init ( -unsigned char clk_gpio, -unsigned char data_gpio -) +long sm750_sw_i2c_init (unsigned char clk_gpio,unsigned char data_gpio) {int i;
@@ -448,10 +444,7 @@ long sm750_sw_i2c_init(* Return Value: * Register value */ -unsigned char sm750_sw_i2c_read_reg ( -unsigned char addr, -unsigned char reg -) +unsigned char sm750_sw_i2c_read_reg (unsigned char addr,unsigned char reg) {unsigned char data;
@@ -488,11 +481,9 @@ unsigned char sm750_sw_i2c_read_reg(* 0 - Success * -1 - Fail */ -long sm750_sw_i2c_write_reg ( -unsigned char addr, -unsigned char reg, -unsigned char data -) +long sm750_sw_i2c_write_reg (unsigned char addr, +unsigned char reg, +unsigned char data) {long ret =0 ;
drivers/staging/sm750fb/ddk750_swi2c.h +5 -13
@@ -28,10 +28,7 @@* -1 - Fail to initialize the i2c * 0 - Success */ -long sm750_sw_i2c_init ( -unsigned char clk_gpio, -unsigned char data_gpio -); +long sm750_sw_i2c_init (unsigned char clk_gpio,unsigned char data_gpio);/* * This function reads the slave device's register
@@ -44,10 +41,7 @@ long sm750_sw_i2c_init(* Return Value: * Register value */ -unsigned char sm750_sw_i2c_read_reg ( -unsigned char addr, -unsigned char reg -); +unsigned char sm750_sw_i2c_read_reg (unsigned char addr,unsigned char reg);/* * This function writes a value to the slave device's register
@@ -62,10 +56,8 @@ unsigned char sm750_sw_i2c_read_reg(* 0 - Success * -1 - Fail */ -long sm750_sw_i2c_write_reg ( -unsigned char addr, -unsigned char reg, -unsigned char data -); +long sm750_sw_i2c_write_reg (unsigned char addr, +unsigned char reg, +unsigned char data);#endif /* _SWI2C_H_ */
drivers/staging/sm750fb/sm750.c +13 -13
@@ -112,42 +112,42 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor) cursor = &crtc->cursor;if (fbcursor->image.width > cursor->maxW || - fbcursor->image.height > cursor->maxH || - fbcursor->image.depth >1 ) { + fbcursor->image.height > cursor->maxH || + fbcursor->image.depth >1 ) {return -ENXIO ; }sm750_hw_cursor_disable (cursor);if (fbcursor->set &FB_CUR_SETSIZE )sm750_hw_cursor_setSize (cursor, - fbcursor->image.width, - fbcursor->image.height); + fbcursor->image.width, + fbcursor->image.height);if (fbcursor->set &FB_CUR_SETPOS )sm750_hw_cursor_setPos (cursor, - fbcursor->image.dx - info->var.xoffset, - fbcursor->image.dy - info->var.yoffset); + fbcursor->image.dx - info->var.xoffset, + fbcursor->image.dy - info->var.yoffset);if (fbcursor->set &FB_CUR_SETCMAP ) {/* get the 16bit color of kernel means */ u16 fg, bg; fg = ((info->cmap.red[fbcursor->image.fg_color] &0xf800 )) | - ((info->cmap.green[fbcursor->image.fg_color] &0xfc00 ) >>5 ) | - ((info->cmap.blue[fbcursor->image.fg_color] &0xf800 ) >>11 ); + ((info->cmap.green[fbcursor->image.fg_color] &0xfc00 ) >>5 ) | + ((info->cmap.blue[fbcursor->image.fg_color] &0xf800 ) >>11 ); bg = ((info->cmap.red[fbcursor->image.bg_color] &0xf800 )) | - ((info->cmap.green[fbcursor->image.bg_color] &0xfc00 ) >>5 ) | - ((info->cmap.blue[fbcursor->image.bg_color] &0xf800 ) >>11 ); + ((info->cmap.green[fbcursor->image.bg_color] &0xfc00 ) >>5 ) | + ((info->cmap.blue[fbcursor->image.bg_color] &0xf800 ) >>11 );sm750_hw_cursor_setColor (cursor, fg, bg); }if (fbcursor->set & (FB_CUR_SETSHAPE |FB_CUR_SETIMAGE )) {sm750_hw_cursor_setData (cursor, - fbcursor->rop, - fbcursor->image.data, - fbcursor->mask); + fbcursor->rop, + fbcursor->image.data, + fbcursor->mask); }if (fbcursor->enable)
drivers/staging/sm750fb/sm750_accel.c +8 -7
@@ -42,10 +42,11 @@ void sm750_hw_de_init(struct lynx_accel *accel)/* dpr1c */ reg =0x3 ; - clr =DE_STRETCH_FORMAT_PATTERN_XY |DE_STRETCH_FORMAT_PATTERN_Y_MASK | -DE_STRETCH_FORMAT_PATTERN_X_MASK | -DE_STRETCH_FORMAT_ADDRESSING_MASK | -DE_STRETCH_FORMAT_SOURCE_HEIGHT_MASK ; + clr =DE_STRETCH_FORMAT_PATTERN_XY | +DE_STRETCH_FORMAT_PATTERN_Y_MASK | +DE_STRETCH_FORMAT_PATTERN_X_MASK | +DE_STRETCH_FORMAT_ADDRESSING_MASK | +DE_STRETCH_FORMAT_SOURCE_HEIGHT_MASK ;/* DE_STRETCH bpp format need be initialized in setMode routine */ write_dpr(accel, DE_STRETCH_FORMAT,
@@ -84,9 +85,9 @@ void sm750_hw_set2dformat(struct lynx_accel *accel, int fmt) }int sm750_hw_fillrect (struct lynx_accel *accel, -u32 base,u32 pitch,u32 Bpp, -u32 x,u32 y,u32 width,u32 height, -u32 color,u32 rop) +u32 base,u32 pitch,u32 Bpp, +u32 x,u32 y,u32 width,u32 height, +u32 color,u32 rop) {u32 deCtrl;
drivers/staging/sm750fb/sm750_cursor.c +7 -10
@@ -60,15 +60,13 @@ void sm750_hw_cursor_disable(struct lynx_cursor *cursor)poke32 (HWC_ADDRESS ,0 ); } -void sm750_hw_cursor_setSize (struct lynx_cursor *cursor, -int w,int h) +void sm750_hw_cursor_setSize (struct lynx_cursor *cursor,int w,int h) { cursor->w = w; cursor->h = h; } -void sm750_hw_cursor_setPos (struct lynx_cursor *cursor, -int x,int y) +void sm750_hw_cursor_setPos (struct lynx_cursor *cursor,int x,int y) {u32 reg;
@@ -77,8 +75,7 @@ void sm750_hw_cursor_setPos(struct lynx_cursor *cursor,poke32 (HWC_LOCATION , reg); } -void sm750_hw_cursor_setColor (struct lynx_cursor *cursor, -u32 fg,u32 bg) +void sm750_hw_cursor_setColor (struct lynx_cursor *cursor,u32 fg,u32 bg) {u32 reg = (fg <<HWC_COLOR_12_2_RGB565_SHIFT ) &HWC_COLOR_12_2_RGB565_MASK ;
@@ -87,8 +84,8 @@ void sm750_hw_cursor_setColor(struct lynx_cursor *cursor,poke32 (HWC_COLOR_3 ,0xffe0 ); } -void sm750_hw_cursor_setData (struct lynx_cursor *cursor, -u16 rop,const u8 *pcol,const u8 *pmsk) +void sm750_hw_cursor_setData (struct lynx_cursor *cursor,u16 rop, +const u8 *pcol,const u8 *pmsk) {int i, j, count, pitch, offset;u8 color, mask, opr;
@@ -138,8 +135,8 @@ void sm750_hw_cursor_setData(struct lynx_cursor *cursor, } -void sm750_hw_cursor_setData2 (struct lynx_cursor *cursor, -u16 rop,const u8 *pcol,const u8 *pmsk) +void sm750_hw_cursor_setData2 (struct lynx_cursor *cursor,u16 rop, +const u8 *pcol,const u8 *pmsk) {int i, j, count, pitch, offset;u8 color, mask;
Signature · 1 line
1.8.3.1
v3 cover staging: sm750fb: cleaning code
In reply to Matej DujavaFolowing patch set cleans some warnings and checkups from checkpatch.pl and also fix code to better fot linux code style.
Changes since v2 [1]:
* staging: sm750fb: unifying macro usage and definitions
* move definition of MHZ macro from c file to header.
[1] https://lkml.org/lkml/2017/5/15/875
Matej Dujava (7):
staging: sm750fb: fix length of lines, function calls and declaration
staging: sm750fb: unifying macro usage and definitions
staging: sm750fb: Remove typedef from "typedef enum
_logical_chip_type_t"
staging: sm750fb: Remove typedef from "typedef enum _clock_type_t"
staging: sm750fb: Remove typedef from "typedef enum _disp_output_t"
staging: sm750fb: Remove typedef from "typedef enum _DPMS_t"
staging: sm750fb: Remove typedef from "typedef enum
_sii164_hot_plug_mode_t"
drivers/staging/sm750fb/ddk750_chip.c | 29 ++++++----- drivers/staging/sm750fb/ddk750_chip.h | 21 ++++---- drivers/staging/sm750fb/ddk750_display.c | 2 +- drivers/staging/sm750fb/ddk750_display.h | 86 ++++++++++++++++---------------- drivers/staging/sm750fb/ddk750_dvi.c | 35 +++++++------ drivers/staging/sm750fb/ddk750_dvi.h | 43 ++++++++-------- drivers/staging/sm750fb/ddk750_hwi2c.c | 37 +++++--------- drivers/staging/sm750fb/ddk750_mode.c | 2 +- drivers/staging/sm750fb/ddk750_mode.h | 2 +- drivers/staging/sm750fb/ddk750_power.c | 2 +- drivers/staging/sm750fb/ddk750_power.h | 7 ++- drivers/staging/sm750fb/ddk750_sii164.c | 49 ++++++++---------- drivers/staging/sm750fb/ddk750_sii164.h | 26 +++++----- drivers/staging/sm750fb/ddk750_swi2c.c | 21 +++----- drivers/staging/sm750fb/ddk750_swi2c.h | 18 ++----- drivers/staging/sm750fb/sm750.c | 26 +++++----- drivers/staging/sm750fb/sm750.h | 6 +-- drivers/staging/sm750fb/sm750_accel.c | 15 +++--- drivers/staging/sm750fb/sm750_cursor.c | 17 +++---- drivers/staging/sm750fb/sm750_hw.c | 4 +- 20 files changed, 205 insertions(+), 243 deletions(-)
Signature · 1 line
1.8.3.1
PATCH v3 1/7 staging: sm750fb: fix length of lines, function calls and declaration
This patch breaks lines that are longer than 80 characters and joins together those, that are too short and can be placed at one.
Function calls and declarations are updated to fit kernel code style.
--- drivers/staging/sm750fb/ddk750_chip.c | 7 +++-- drivers/staging/sm750fb/ddk750_dvi.c | 35 +++++++++++++---------- drivers/staging/sm750fb/ddk750_dvi.h | 43 ++++++++++++++--------------- drivers/staging/sm750fb/ddk750_hwi2c.c | 33 ++++++++-------------- drivers/staging/sm750fb/ddk750_sii164.c | 49 ++++++++++++++------------------- drivers/staging/sm750fb/ddk750_sii164.h | 22 +++++++-------- drivers/staging/sm750fb/ddk750_swi2c.c | 21 ++++---------- drivers/staging/sm750fb/ddk750_swi2c.h | 18 ++++-------- drivers/staging/sm750fb/sm750.c | 26 ++++++++--------- drivers/staging/sm750fb/sm750_accel.c | 15 +++++----- drivers/staging/sm750fb/sm750_cursor.c | 17 +++++------- 11 files changed, 125 insertions(+), 161 deletions(-)
drivers/staging/sm750fb/ddk750_chip.c +4 -3
@@ -175,7 +175,7 @@ static void set_master_clock(unsigned int frequency) }sm750_set_current_gate (reg); - } + } }unsigned int ddk750_get_vm_size (void )
@@ -224,7 +224,7 @@ int ddk750_init_hw(struct initchip_param *pInitParam)sm750_set_current_gate (reg);if (sm750_get_chip_type () !=SM750LE ) { -/* set panel pll and graphic mode via mmio_88 */ +/* set panel pll and graphic mode via mmio_88 */ reg =peek32 (VGA_CONFIGURATION ); reg |= (VGA_CONFIGURATION_PLL |VGA_CONFIGURATION_MODE );poke32 (VGA_CONFIGURATION , reg);
@@ -309,7 +309,8 @@ int ddk750_init_hw(struct initchip_param *pInitParam)* M = {1,...,255} * N = {2,...,15} */ -unsigned int sm750_calc_pll_value (unsigned int request_orig,struct pll_value *pll) +unsigned int sm750_calc_pll_value (unsigned int request_orig, +struct pll_value *pll) {/* * as sm750 register definition,
drivers/staging/sm750fb/ddk750_dvi.c +20 -15
@@ -29,26 +29,31 @@#endif }; -int dviInit ( -unsigned char edgeSelect, -unsigned char busSelect, -unsigned char dualEdgeClkSelect, -unsigned char hsyncEnable, -unsigned char vsyncEnable, -unsigned char deskewEnable, -unsigned char deskewSetting, -unsigned char continuousSyncEnable, -unsigned char pllFilterEnable, -unsigned char pllFilterValue - ) +int dviInit (unsigned char edgeSelect, +unsigned char busSelect, +unsigned char dualEdgeClkSelect, +unsigned char hsyncEnable, +unsigned char vsyncEnable, +unsigned char deskewEnable, +unsigned char deskewSetting, +unsigned char continuousSyncEnable, +unsigned char pllFilterEnable, +unsigned char pllFilterValue) {dvi_ctrl_device_t *pCurrentDviCtrl; pCurrentDviCtrl = g_dcftSupportedDviController;if (pCurrentDviCtrl->pfnInit) { -return pCurrentDviCtrl->pfnInit (edgeSelect, busSelect, dualEdgeClkSelect, hsyncEnable, - vsyncEnable, deskewEnable, deskewSetting, continuousSyncEnable, - pllFilterEnable, pllFilterValue); +return pCurrentDviCtrl->pfnInit (edgeSelect, + busSelect, + dualEdgeClkSelect, + hsyncEnable, + vsyncEnable, + deskewEnable, + deskewSetting, + continuousSyncEnable, + pllFilterEnable, + pllFilterValue); }return -1 ;/* error */ }
drivers/staging/sm750fb/ddk750_dvi.h +20 -23
55 lines not on this page · raw message
drivers/staging/sm750fb/ddk750_hwi2c.c +11 -22
@@ -8,9 +8,7 @@#define MAX_HWI2C_FIFO 16#define HWI2C_WAIT_TIMEOUT 0xF0000 -int sm750_hw_i2c_init ( -unsigned char bus_speed_mode -) +int sm750_hw_i2c_init (unsigned char bus_speed_mode) {unsigned int value;
@@ -81,11 +79,9 @@ static long hw_i2c_wait_tx_done(void)* Return Value: * Total number of bytes those are actually written. */ -static unsigned int hw_i2c_write_data ( -unsigned char addr, -unsigned int length, -unsigned char *buf -) +static unsigned int hw_i2c_write_data (unsigned char addr, +unsigned int length, +unsigned char *buf) {unsigned char count, i;unsigned int total_bytes =0 ;
@@ -148,11 +144,9 @@ static unsigned int hw_i2c_write_data(* Return Value: * Total number of actual bytes read from the slave device */ -static unsigned int hw_i2c_read_data ( -unsigned char addr, -unsigned int length, -unsigned char *buf -) +static unsigned int hw_i2c_read_data (unsigned char addr, +unsigned int length, +unsigned char *buf) {unsigned char count, i;unsigned int total_bytes =0 ;
@@ -212,10 +206,7 @@ static unsigned int hw_i2c_read_data(* Return Value: * Register value */ -unsigned char sm750_hw_i2c_read_reg ( -unsigned char addr, -unsigned char reg -) +unsigned char sm750_hw_i2c_read_reg (unsigned char addr,unsigned char reg) {unsigned char value =0xFF ;
@@ -238,11 +229,9 @@ unsigned char sm750_hw_i2c_read_reg(* 0 - Success * -1 - Fail */ -int sm750_hw_i2c_write_reg ( -unsigned char addr, -unsigned char reg, -unsigned char data -) +int sm750_hw_i2c_write_reg (unsigned char addr, +unsigned char reg, +unsigned char data) {unsigned char value[2 ];
drivers/staging/sm750fb/ddk750_sii164.c +21 -28
110 lines not on this page · raw message
drivers/staging/sm750fb/ddk750_sii164.h +10 -12
@@ -13,18 +13,16 @@/* Silicon Image SiI164 chip prototype */ -long sii164InitChip ( -unsigned char edgeSelect, -unsigned char busSelect, -unsigned char dualEdgeClkSelect, -unsigned char hsyncEnable, -unsigned char vsyncEnable, -unsigned char deskewEnable, -unsigned char deskewSetting, -unsigned char continuousSyncEnable, -unsigned char pllFilterEnable, -unsigned char pllFilterValue -); +long sii164InitChip (unsigned char edgeSelect, +unsigned char busSelect, +unsigned char dualEdgeClkSelect, +unsigned char hsyncEnable, +unsigned char vsyncEnable, +unsigned char deskewEnable, +unsigned char deskewSetting, +unsigned char continuousSyncEnable, +unsigned char pllFilterEnable, +unsigned char pllFilterValue);unsigned short sii164GetVendorID (void );unsigned short sii164GetDeviceID (void );
drivers/staging/sm750fb/ddk750_swi2c.c +6 -15
@@ -349,8 +349,7 @@ static unsigned char sw_i2c_read_byte(unsigned char ack)* -1 - Fail to initialize the i2c * 0 - Success */ -static long sm750le_i2c_init (unsigned char clk_gpio, -unsigned char data_gpio) +static long sm750le_i2c_init (unsigned char clk_gpio,unsigned char data_gpio) {int i;
@@ -388,10 +387,7 @@ static long sm750le_i2c_init(unsigned char clk_gpio,* -1 - Fail to initialize the i2c * 0 - Success */ -long sm750_sw_i2c_init ( -unsigned char clk_gpio, -unsigned char data_gpio -) +long sm750_sw_i2c_init (unsigned char clk_gpio,unsigned char data_gpio) {int i;
@@ -448,10 +444,7 @@ long sm750_sw_i2c_init(* Return Value: * Register value */ -unsigned char sm750_sw_i2c_read_reg ( -unsigned char addr, -unsigned char reg -) +unsigned char sm750_sw_i2c_read_reg (unsigned char addr,unsigned char reg) {unsigned char data;
@@ -488,11 +481,9 @@ unsigned char sm750_sw_i2c_read_reg(* 0 - Success * -1 - Fail */ -long sm750_sw_i2c_write_reg ( -unsigned char addr, -unsigned char reg, -unsigned char data -) +long sm750_sw_i2c_write_reg (unsigned char addr, +unsigned char reg, +unsigned char data) {long ret =0 ;
drivers/staging/sm750fb/ddk750_swi2c.h +5 -13
@@ -28,10 +28,7 @@* -1 - Fail to initialize the i2c * 0 - Success */ -long sm750_sw_i2c_init ( -unsigned char clk_gpio, -unsigned char data_gpio -); +long sm750_sw_i2c_init (unsigned char clk_gpio,unsigned char data_gpio);/* * This function reads the slave device's register
@@ -44,10 +41,7 @@ long sm750_sw_i2c_init(* Return Value: * Register value */ -unsigned char sm750_sw_i2c_read_reg ( -unsigned char addr, -unsigned char reg -); +unsigned char sm750_sw_i2c_read_reg (unsigned char addr,unsigned char reg);/* * This function writes a value to the slave device's register
@@ -62,10 +56,8 @@ unsigned char sm750_sw_i2c_read_reg(* 0 - Success * -1 - Fail */ -long sm750_sw_i2c_write_reg ( -unsigned char addr, -unsigned char reg, -unsigned char data -); +long sm750_sw_i2c_write_reg (unsigned char addr, +unsigned char reg, +unsigned char data);#endif /* _SWI2C_H_ */
drivers/staging/sm750fb/sm750.c +13 -13
@@ -112,42 +112,42 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor) cursor = &crtc->cursor;if (fbcursor->image.width > cursor->maxW || - fbcursor->image.height > cursor->maxH || - fbcursor->image.depth >1 ) { + fbcursor->image.height > cursor->maxH || + fbcursor->image.depth >1 ) {return -ENXIO ; }sm750_hw_cursor_disable (cursor);if (fbcursor->set &FB_CUR_SETSIZE )sm750_hw_cursor_setSize (cursor, - fbcursor->image.width, - fbcursor->image.height); + fbcursor->image.width, + fbcursor->image.height);if (fbcursor->set &FB_CUR_SETPOS )sm750_hw_cursor_setPos (cursor, - fbcursor->image.dx - info->var.xoffset, - fbcursor->image.dy - info->var.yoffset); + fbcursor->image.dx - info->var.xoffset, + fbcursor->image.dy - info->var.yoffset);if (fbcursor->set &FB_CUR_SETCMAP ) {/* get the 16bit color of kernel means */ u16 fg, bg; fg = ((info->cmap.red[fbcursor->image.fg_color] &0xf800 )) | - ((info->cmap.green[fbcursor->image.fg_color] &0xfc00 ) >>5 ) | - ((info->cmap.blue[fbcursor->image.fg_color] &0xf800 ) >>11 ); + ((info->cmap.green[fbcursor->image.fg_color] &0xfc00 ) >>5 ) | + ((info->cmap.blue[fbcursor->image.fg_color] &0xf800 ) >>11 ); bg = ((info->cmap.red[fbcursor->image.bg_color] &0xf800 )) | - ((info->cmap.green[fbcursor->image.bg_color] &0xfc00 ) >>5 ) | - ((info->cmap.blue[fbcursor->image.bg_color] &0xf800 ) >>11 ); + ((info->cmap.green[fbcursor->image.bg_color] &0xfc00 ) >>5 ) | + ((info->cmap.blue[fbcursor->image.bg_color] &0xf800 ) >>11 );sm750_hw_cursor_setColor (cursor, fg, bg); }if (fbcursor->set & (FB_CUR_SETSHAPE |FB_CUR_SETIMAGE )) {sm750_hw_cursor_setData (cursor, - fbcursor->rop, - fbcursor->image.data, - fbcursor->mask); + fbcursor->rop, + fbcursor->image.data, + fbcursor->mask); }if (fbcursor->enable)
drivers/staging/sm750fb/sm750_accel.c +8 -7
@@ -42,10 +42,11 @@ void sm750_hw_de_init(struct lynx_accel *accel)/* dpr1c */ reg =0x3 ; - clr =DE_STRETCH_FORMAT_PATTERN_XY |DE_STRETCH_FORMAT_PATTERN_Y_MASK | -DE_STRETCH_FORMAT_PATTERN_X_MASK | -DE_STRETCH_FORMAT_ADDRESSING_MASK | -DE_STRETCH_FORMAT_SOURCE_HEIGHT_MASK ; + clr =DE_STRETCH_FORMAT_PATTERN_XY | +DE_STRETCH_FORMAT_PATTERN_Y_MASK | +DE_STRETCH_FORMAT_PATTERN_X_MASK | +DE_STRETCH_FORMAT_ADDRESSING_MASK | +DE_STRETCH_FORMAT_SOURCE_HEIGHT_MASK ;/* DE_STRETCH bpp format need be initialized in setMode routine */ write_dpr(accel, DE_STRETCH_FORMAT,
@@ -84,9 +85,9 @@ void sm750_hw_set2dformat(struct lynx_accel *accel, int fmt) }int sm750_hw_fillrect (struct lynx_accel *accel, -u32 base,u32 pitch,u32 Bpp, -u32 x,u32 y,u32 width,u32 height, -u32 color,u32 rop) +u32 base,u32 pitch,u32 Bpp, +u32 x,u32 y,u32 width,u32 height, +u32 color,u32 rop) {u32 deCtrl;
drivers/staging/sm750fb/sm750_cursor.c +7 -10
@@ -60,15 +60,13 @@ void sm750_hw_cursor_disable(struct lynx_cursor *cursor)poke32 (HWC_ADDRESS ,0 ); } -void sm750_hw_cursor_setSize (struct lynx_cursor *cursor, -int w,int h) +void sm750_hw_cursor_setSize (struct lynx_cursor *cursor,int w,int h) { cursor->w = w; cursor->h = h; } -void sm750_hw_cursor_setPos (struct lynx_cursor *cursor, -int x,int y) +void sm750_hw_cursor_setPos (struct lynx_cursor *cursor,int x,int y) {u32 reg;
@@ -77,8 +75,7 @@ void sm750_hw_cursor_setPos(struct lynx_cursor *cursor,poke32 (HWC_LOCATION , reg); } -void sm750_hw_cursor_setColor (struct lynx_cursor *cursor, -u32 fg,u32 bg) +void sm750_hw_cursor_setColor (struct lynx_cursor *cursor,u32 fg,u32 bg) {u32 reg = (fg <<HWC_COLOR_12_2_RGB565_SHIFT ) &HWC_COLOR_12_2_RGB565_MASK ;
@@ -87,8 +84,8 @@ void sm750_hw_cursor_setColor(struct lynx_cursor *cursor,poke32 (HWC_COLOR_3 ,0xffe0 ); } -void sm750_hw_cursor_setData (struct lynx_cursor *cursor, -u16 rop,const u8 *pcol,const u8 *pmsk) +void sm750_hw_cursor_setData (struct lynx_cursor *cursor,u16 rop, +const u8 *pcol,const u8 *pmsk) {int i, j, count, pitch, offset;u8 color, mask, opr;
@@ -138,8 +135,8 @@ void sm750_hw_cursor_setData(struct lynx_cursor *cursor, } -void sm750_hw_cursor_setData2 (struct lynx_cursor *cursor, -u16 rop,const u8 *pcol,const u8 *pmsk) +void sm750_hw_cursor_setData2 (struct lynx_cursor *cursor,u16 rop, +const u8 *pcol,const u8 *pmsk) {int i, j, count, pitch, offset;u8 color, mask;
Signature · 1 line
1.8.3.1
PATCH v3 4/7 staging: sm750fb: Remove typedef from "typedef enum _clock_type_t"
In reply to Matej DujavaThis patch removes typedefs from enum and renames it from "typedef enum _clock_type_t" to "enum clock_type" as per kernel coding standards.
--- drivers/staging/sm750fb/ddk750_chip.h | 8 ++++---- drivers/staging/sm750fb/ddk750_mode.c | 2 +- drivers/staging/sm750fb/ddk750_mode.h | 2 +- drivers/staging/sm750fb/sm750_hw.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-)
drivers/staging/sm750fb/ddk750_chip.h +4 -4
@@ -32,17 +32,17 @@ enum logical_chip_type { }; -typedef enum _clock_type_t { +enum clock_type {MXCLK_PLL ,PRIMARY_PLL ,SECONDARY_PLL ,VGA0_PLL ,VGA1_PLL , -} -clock_type_t ; +}; +struct pll_value { -clock_type_t clockType; +enum clock_type clockType;unsigned long inputFreq;/* Input clock frequency to the PLL */ /* Use this when clockType = PANEL_PLL */
drivers/staging/sm750fb/ddk750_mode.c +1 -1
@@ -205,7 +205,7 @@ static int programModeRegisters(struct mode_parameter *pModeParam,return ret; } -int ddk750_setModeTiming (struct mode_parameter *parm,clock_type_t clock) +int ddk750_setModeTiming (struct mode_parameter *parm,enum clock_type clock) {struct pll_value pll;unsigned int uiActualPixelClk;
drivers/staging/sm750fb/ddk750_mode.h +1 -1
@@ -32,5 +32,5 @@ struct mode_parameter { enum spolarity clock_phase_polarity; }; -int ddk750_setModeTiming (struct mode_parameter *parm,clock_type_t clock); +int ddk750_setModeTiming (struct mode_parameter *parm,enum clock_type clock);#endif
drivers/staging/sm750fb/sm750_hw.c +1 -1
@@ -253,7 +253,7 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc,int ret, fmt;u32 reg;struct mode_parameter modparm; -clock_type_t clock; +enum clock_type clock;struct sm750_dev *sm750_dev;struct lynxfb_par *par;
Signature · 1 line
1.8.3.1
PATCH v3 6/7 staging: sm750fb: Remove typedef from "typedef enum _DPMS_t"
In reply to Matej DujavaThis patch removes typedefs from enum and renames it from "typedef enum _DPMS_t" to "enum DPMS" as per kernel coding standards.
--- drivers/staging/sm750fb/ddk750_power.c | 2 +- drivers/staging/sm750fb/ddk750_power.h | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-)
drivers/staging/sm750fb/ddk750_power.c +1 -1
@@ -2,7 +2,7 @@#include "ddk750_reg.h" #include "ddk750_power.h" -void ddk750_set_dpms (DPMS_t state) +void ddk750_set_dpms (enum DPMS state) {unsigned int value;
drivers/staging/sm750fb/ddk750_power.h +3 -4
@@ -1,20 +1,19 @@#ifndef DDK750_POWER_H__ #define DDK750_POWER_H__ -typedef enum _DPMS_t { +enum DPMS { crtDPMS_ON =0x0 , crtDPMS_STANDBY =0x1 , crtDPMS_SUSPEND =0x2 , crtDPMS_OFF =0x3 , -} -DPMS_t ; +};#define setDAC (off) { \ poke32(MISC_CTRL, \ (peek32(MISC_CTRL) & ~MISC_CTRL_DAC_POWER_OFF) | (off)); \ } -void ddk750_set_dpms (DPMS_t state); +void ddk750_set_dpms (enum DPMS state);void sm750_set_power_mode (unsigned int powerMode);void sm750_set_current_gate (unsigned int gate);
Signature · 1 line
1.8.3.1
PATCH v3 7/7 staging: sm750fb: Remove typedef from "typedef enum _sii164_hot_plug_mode_t"
In reply to Matej DujavaThis patch removes typedefs from enum and renames it from "typedef enum _sii164_hot_plug_mode_t" to "enum sii164_hot_plug_mode" as per kernel coding standards.
--- drivers/staging/sm750fb/ddk750_sii164.c | 2 +- drivers/staging/sm750fb/ddk750_sii164.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/sm750fb/ddk750_sii164.c +1 -1
@@ -296,7 +296,7 @@ void sii164SetPower(unsigned char powerUp)* sii164SelectHotPlugDetectionMode * This function selects the mode of the hot plug detection. */ -static void sii164SelectHotPlugDetectionMode (sii164_hot_plug_mode_t hotPlugMode) +static void sii164SelectHotPlugDetectionMode (enum sii164_hot_plug_mode hotPlugMode) {unsigned char detectReg;
drivers/staging/sm750fb/ddk750_sii164.h +2 -2
@@ -4,12 +4,12 @@#define USE_DVICHIP /* Hot Plug detection mode structure */ -typedef enum _sii164_hot_plug_mode_t { +enum sii164_hot_plug_mode {SII164_HOTPLUG_DISABLE =0 ,/* Disable Hot Plug output bit (always high). */ SII164_HOTPLUG_USE_MDI ,/* Use Monitor Detect Interrupt bit. */ SII164_HOTPLUG_USE_RSEN ,/* Use Receiver Sense detect bit. */ SII164_HOTPLUG_USE_HTPLG /* Use Hot Plug detect bit. */ -}sii164_hot_plug_mode_t ; +};/* Silicon Image SiI164 chip prototype */
Signature · 1 line
1.8.3.1
PATCH v3 5/7 staging: sm750fb: Remove typedef from "typedef enum _disp_output_t"
In reply to Matej DujavaThis patch removes typedefs from enum and renames it from "typedef enum _disp_output_t" to "enum disp_output" as per kernel coding standards.
--- drivers/staging/sm750fb/ddk750_display.c | 2 +- drivers/staging/sm750fb/ddk750_display.h | 8 ++++---- drivers/staging/sm750fb/sm750_hw.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/staging/sm750fb/ddk750_display.c +1 -1
@@ -110,7 +110,7 @@ static void swPanelPowerSequence(int disp, int delay)primary_wait_vertical_sync (delay); } -void ddk750_setLogicalDispOut (disp_output_t output) +void ddk750_setLogicalDispOut (enum disp_output output) {unsigned int reg;
drivers/staging/sm750fb/ddk750_display.h +4 -4
@@ -88,7 +88,7 @@* LCD1 means panel path TFT1 & panel path DVI (so enable DAC) * CRT means crt path DSUB */ -typedef enum _disp_output_t { +enum disp_output { 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 , do_LCD2_PRI =CRT_2_PRI |PRI_TP_ON |DUAL_TFT_ON ,
@@ -99,9 +99,9 @@*/ do_CRT_PRI =CRT_2_PRI |PRI_TP_ON |DPMS_ON |DAC_ON , do_CRT_SEC = CRT_2_SEC | SEC_TP_ON | DPMS_ON | DAC_ON, -} -disp_output_t; +}; -void ddk750_setLogicalDispOut (disp_output_t output); + +void ddk750_setLogicalDispOut (enum disp_output output);#endif
drivers/staging/sm750fb/sm750_hw.c +1 -1
@@ -184,7 +184,7 @@ int hw_sm750_output_setMode(struct lynxfb_output *output, struct fb_fix_screeninfo *fix) {int ret; -disp_output_t dispSet; +enum disp_output dispSet;int channel; ret =0 ;
Signature · 1 line
1.8.3.1
PATCH v3 3/7 staging: sm750fb: Remove typedef from "typedef enum _logical_chip_type_t"
In reply to Matej DujavaThis patch removes typedefs from enum and renames it from "typedef enum _logical_chip_type_t" to "enum logical_chip_type" as per kernel coding standards.
--- drivers/staging/sm750fb/ddk750_chip.c | 4 ++-- drivers/staging/sm750fb/ddk750_chip.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/staging/sm750fb/ddk750_chip.c +2 -2
@@ -5,9 +5,9 @@#include "ddk750_chip.h" #include "ddk750_power.h" -static logical_chip_type_t chip; +static enum logical_chip_type chip; -logical_chip_type_t sm750_get_chip_type (void ) +enum logical_chip_type sm750_get_chip_type (void ) {return chip; }
drivers/staging/sm750fb/ddk750_chip.h +4 -4
@@ -24,13 +24,13 @@ static inline void poke32(u32 data, u32 addr) }/* This is all the chips recognized by this library */ -typedef enum _logical_chip_type_t { +enum logical_chip_type {SM_UNKNOWN ,SM718 ,SM750 ,SM750LE , -} -logical_chip_type_t ; +}; + typedef enum _clock_type_t { MXCLK_PLL,
@@ -94,7 +94,7 @@ struct initchip_param {/* More initialization parameter can be added if needed */ }; -logical_chip_type_t sm750_get_chip_type (void ); +enum logical_chip_type sm750_get_chip_type (void );void sm750_set_chip_type (unsigned short devId,u8 revId);unsigned int sm750_calc_pll_value (unsigned int request,struct pll_value *pll);unsigned int sm750_format_pll_reg (struct pll_value *pPLL);
Signature · 1 line
1.8.3.1
PATCH v3 2/7 staging: sm750fb: unifying macro usage and definitions
In reply to Matej DujavaThis patch adds tabs into macro definitions so all rhs are on same column. Move MHz macro from ddk_chip.c to ddk_chip.h.
--- drivers/staging/sm750fb/ddk750_chip.c | 18 ++++---- drivers/staging/sm750fb/ddk750_chip.h | 5 +- drivers/staging/sm750fb/ddk750_display.h | 78 ++++++++++++++++---------------- drivers/staging/sm750fb/ddk750_hwi2c.c | 4 +- drivers/staging/sm750fb/sm750.h | 6 +-- 5 files changed, 55 insertions(+), 56 deletions(-)
drivers/staging/sm750fb/ddk750_chip.c +8 -10
@@ -5,8 +5,6 @@#include "ddk750_chip.h" #include "ddk750_power.h" -#define MHz (x) ((x) * 1000000) -static logical_chip_type_t chip;logical_chip_type_t sm750_get_chip_type (void )
@@ -36,7 +34,7 @@ static unsigned int get_mxclk_freq(void)unsigned int M ,N ,OD ,POD ;if (sm750_get_chip_type () ==SM750LE ) -return MHz (130 ); +return MHZ (130 ); pll_reg =peek32 (MXCLK_PLL_CTRL );M = (pll_reg &PLL_CTRL_M_MASK ) >>PLL_CTRL_M_SHIFT ;
@@ -98,8 +96,8 @@ static void set_memory_clock(unsigned int frequency)* Set the frequency to the maximum frequency * that the DDR Memory can take which is 336MHz. */ -if (frequency >MHz (336 )) - frequency =MHz (336 ); +if (frequency >MHZ (336 )) + frequency =MHZ (336 );/* Calculate the divisor */ divisor =DIV_ROUND_CLOSEST (get_mxclk_freq (), frequency);
@@ -150,8 +148,8 @@ static void set_master_clock(unsigned int frequency)* Set the frequency to the maximum frequency * that the SM750 engine can run, which is about 190 MHz. */ -if (frequency >MHz (190 )) - frequency =MHz (190 ); +if (frequency >MHZ (190 )) + frequency =MHZ (190 );/* Calculate the divisor */ divisor =DIV_ROUND_CLOSEST (get_mxclk_freq (), frequency);
@@ -237,13 +235,13 @@ int ddk750_init_hw(struct initchip_param *pInitParam) }/* Set the Main Chip Clock */ -set_chip_clock (MHz ((unsigned int )pInitParam->chipClock)); +set_chip_clock (MHZ ((unsigned int )pInitParam->chipClock));/* Set up memory clock. */ -set_memory_clock (MHz (pInitParam->memClock)); +set_memory_clock (MHZ (pInitParam->memClock));/* Set up master clock */ -set_master_clock (MHz (pInitParam->masterClock)); +set_master_clock (MHZ (pInitParam->masterClock));/* * Reset the memory controller.
drivers/staging/sm750fb/ddk750_chip.h +3 -2
@@ -1,8 +1,9 @@#ifndef DDK750_CHIP_H__ #define DDK750_CHIP_H__ -#define DEFAULT_INPUT_CLOCK 14318181/* Default reference clock */ +#define MHZ (x) ((x) * 1000000) +#define DEFAULT_INPUT_CLOCK 14318181/* Default reference clock */ #ifndef SM750LE_REVISION_ID -#define SM750LE_REVISION_ID ((unsigned char)0xfe) +#define SM750LE_REVISION_ID ((unsigned char)0xfe)#endif #include <linux/io.h>
drivers/staging/sm750fb/ddk750_display.h +39 -39
122 lines not on this page · raw message
drivers/staging/sm750fb/ddk750_hwi2c.c +2 -2
@@ -5,8 +5,8 @@#include "ddk750_hwi2c.h" #include "ddk750_power.h" -#define MAX_HWI2C_FIFO 16 -#define HWI2C_WAIT_TIMEOUT 0xF0000 +#define MAX_HWI2C_FIFO 16 +#define HWI2C_WAIT_TIMEOUT 0xF0000int sm750_hw_i2c_init (unsigned char bus_speed_mode) {
drivers/staging/sm750fb/sm750.h +3 -3
@@ -1,14 +1,14 @@#ifndef LYNXDRV_H_ #define LYNXDRV_H_ -#define FB_ACCEL_SMI 0xab +#define FB_ACCEL_SMI 0xab -#define MHZ (x) ((x) * 1000000) +#define MHZ (x) ((x) * 1000000)#define DEFAULT_SM750_CHIP_CLOCK 290#define DEFAULT_SM750LE_CHIP_CLOCK 333#ifndef SM750LE_REVISION_ID -#define SM750LE_REVISION_ID ((unsigned char)0xfe) +#define SM750LE_REVISION_ID ((unsigned char)0xfe)#endif enum sm750_pnltype {
Signature · 1 line
1.8.3.1
Greg KH
maintainerQuoted 7 lines · Matej Dujava
Folowing patch set cleans some warnings and checkups from checkpatch.pl and also fix code to better fot linux code style.
Changes since v2 [1]:
* staging: sm750fb: unifying macro usage and definitions
* move definition of MHZ macro from c file to header.
Any reason you aren't cc:ing the staging tree maintainer so he knows to review these? :)
thanks,
greg k-h
Re: [PATCH v3 2/7] staging: sm750fb: unifying macro usage and definitions
In reply to Matej DujavaQuoted 26 lines · Matej Dujava
This patch adds tabs into macro definitions so all rhs are on same column. Move MHz macro from
ddk_chip.ctoddk_chip.h.Signed-off-by Matej Dujava <[email protected]>--- drivers/staging/sm750fb/ddk750_chip.c | 18 ++++---- drivers/staging/sm750fb/ddk750_chip.h | 5 +- drivers/staging/sm750fb/ddk750_display.h | 78 ++++++++++++++++---------------- drivers/staging/sm750fb/ddk750_hwi2c.c | 4 +- drivers/staging/sm750fb/sm750.h | 6 +-- 5 files changed, 55 insertions(+), 56 deletions(-)drivers/staging/sm750fb/ddk750_chip.c +0
-2@@ -5,8 +5,6 @@#include "ddk750_chip.h" #include "ddk750_power.h" -#define MHz (x) ((x) * 1000000) -static logical_chip_type_t chip;logical_chip_type_t sm750_get_chip_type (void )
drivers/staging/sm750fb/ddk750_chip.c static unsigned int get_mxclk_freq(void) · line 37
Quoted 5 lines
drivers/staging/sm750fb/ddk750_chip.c +1
-1@@ -36,7 +34,7 @@ static unsigned int get_mxclk_freq(void)unsigned int M ,N ,OD ,POD ;if (sm750_get_chip_type () ==SM750LE ) -return MHz (130 ); +return MHZ (130 );
But MHz makes more sense, don't you think so?
Please leave that as-is.
thanks,
greg k-h
Re: [PATCH v3 2/7] staging: sm750fb: unifying macro usage and definitions
Quoted 35 lines · Greg KH
Quoted 26 lines · Matej Dujava
This patch adds tabs into macro definitions so all rhs are on same column. Move MHz macro from
ddk_chip.ctoddk_chip.h.Signed-off-by Matej Dujava <[email protected]>--- drivers/staging/sm750fb/ddk750_chip.c | 18 ++++---- drivers/staging/sm750fb/ddk750_chip.h | 5 +- drivers/staging/sm750fb/ddk750_display.h | 78 ++++++++++++++++---------------- drivers/staging/sm750fb/ddk750_hwi2c.c | 4 +- drivers/staging/sm750fb/sm750.h | 6 +-- 5 files changed, 55 insertions(+), 56 deletions(-)drivers/staging/sm750fb/ddk750_chip.c +0
-2@@ -5,8 +5,6 @@#include "ddk750_chip.h" #include "ddk750_power.h" -#define MHz (x) ((x) * 1000000) -static logical_chip_type_t chip;logical_chip_type_t sm750_get_chip_type (void )drivers/staging/sm750fb/ddk750_chip.c static unsigned int get_mxclk_freq(void) · line 37
Quoted 5 lines
drivers/staging/sm750fb/ddk750_chip.c +1
-1@@ -36,7 +34,7 @@ static unsigned int get_mxclk_freq(void)unsigned int M ,N ,OD ,POD ;if (sm750_get_chip_type () ==SM750LE ) -return MHz (130 ); +return MHZ (130 );But MHz makes more sense, don't you think so?
Quoted 5 lines
Please leave that as-is.
thanks,
greg k-h
I see it, but there is:
sm750.h:#define MHZ(x) ((x) * 1000000)
ddk750_chip.c:#define MHz(x) ((x) * 1000000)
and I think macros should be in header files, so I removed declaration in c file.
Thank you,
Matej Dujava