[PATCH] staging: sm750fb: Fix CamelCase and remove volatile warnings

Madhur Kumar
2025-02-18T18:43:52Z

Fixed multiple coding style issues in sm750fb:
- Replaced CamelCase variable names with snake_case.
- Removed incorrect use of volatile in memory-mapped IO.

Signed-off-by: Madhur Kumar <madhurkumar004@gmail.com>
---
drivers/staging/sm750fb/ddk750_chip.c | 2 +-
drivers/staging/sm750fb/ddk750_dvi.c | 16 ++--
drivers/staging/sm750fb/ddk750_power.h | 9 +-
drivers/staging/sm750fb/ddk750_sii164.c | 120 ++++++++++++------------
drivers/staging/sm750fb/ddk750_sii164.h | 36 +++----
drivers/staging/sm750fb/sm750.c | 108 ++++++++++-----------
drivers/staging/sm750fb/sm750.h | 56 +++++------
drivers/staging/sm750fb/sm750_accel.c | 120 ++++++++++++------------
drivers/staging/sm750fb/sm750_accel.h | 16 ++--
drivers/staging/sm750fb/sm750_cursor.c | 14 +--
drivers/staging/sm750fb/sm750_cursor.h | 12 +--
drivers/staging/sm750fb/sm750_hw.c | 60 ++++++------
12 files changed, 286 insertions(+), 283 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c
index 02860d3ec365..67a2f60440ca 100644
--- a/drivers/staging/sm750fb/ddk750_chip.c
+++ b/drivers/staging/sm750fb/ddk750_chip.c
@@ -229,7 +229,7 @@ int ddk750_init_hw(struct initchip_param *p_init_param)
reg |= (VGA_CONFIGURATION_PLL | VGA_CONFIGURATION_MODE);
poke32(VGA_CONFIGURATION, reg);
} else {
-#if defined(__i386__) || defined(__x86_64__)
+#ifdef CONFIG_X86
/* set graphic mode via IO method */
outb_p(0x88, 0x3d4);
outb_p(0x06, 0x3d5);
diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c
index 8b81e8642f9e..6fef1ab484c1 100644
--- a/drivers/staging/sm750fb/ddk750_dvi.c
+++ b/drivers/staging/sm750fb/ddk750_dvi.c
@@ -16,15 +16,15 @@ static struct dvi_ctrl_device dcft_supported_dvi_controller[] = {
{
.init = sii164_init_chip,
.get_vendor_id = sii164_get_vendor_id,
- .get_device_id = sii164GetDeviceID,
+ .get_device_id = sii164_get_device_id,
#ifdef SII164_FULL_FUNCTIONS
- .reset_chip = sii164ResetChip,
- .get_chip_string = sii164GetChipString,
- .set_power = sii164SetPower,
- .enable_hot_plug_detection = sii164EnableHotPlugDetection,
- .is_connected = sii164IsConnected,
- .check_interrupt = sii164CheckInterrupt,
- .clear_interrupt = sii164ClearInterrupt,
+ .reset_chip = sii164_reset_chip,
+ .get_chip_string = sii164_get_chip_string,
+ .set_power = sii164_set_power,
+ .enable_hot_plug_detection = sii164_enable_hot_plug_detection,
+ .is_connected = sii164_is_connected,
+ .check_interrupt = sii164_check_interrupt,
+ .clear_interrupt = sii164_clear_interrupt,
#endif
},
#endif
diff --git a/drivers/staging/sm750fb/ddk750_power.h b/drivers/staging/sm750fb/ddk750_power.h
index 63c9e8b6ffb3..0c2658953ff5 100644
--- a/drivers/staging/sm750fb/ddk750_power.h
+++ b/drivers/staging/sm750fb/ddk750_power.h
@@ -3,10 +3,11 @@
#define DDK750_POWER_H__

enum dpms {
- crtDPMS_ON = 0x0,
- crtDPMS_STANDBY = 0x1,
- crtDPMS_SUSPEND = 0x2,
- crtDPMS_OFF = 0x3,
+ crt_dpms_on = 0x0,
+ crt_dpms_standby = 0x1,
+ crt_dpms_suspend = 0x2,
+ crt_dpms_off = 0x3,
+
};

#define set_DAC(off) { \
diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c
index 2532b60245ac..6340033bc4c5 100644
--- a/drivers/staging/sm750fb/ddk750_sii164.c
+++ b/drivers/staging/sm750fb/ddk750_sii164.c
@@ -12,11 +12,11 @@
#define USE_HW_I2C

#ifdef USE_HW_I2C
- #define i2cWriteReg sm750_hw_i2c_write_reg
- #define i2cReadReg sm750_hw_i2c_read_reg
+ #define i2c_write_reg sm750_hw_i2c_write_reg
+ #define i2c_read_reg sm750_hw_i2c_read_reg
#else
- #define i2cWriteReg sm750_sw_i2c_write_reg
- #define i2cReadReg sm750_sw_i2c_read_reg
+ #define i2c_write_reg sm750_sw_i2c_write_reg
+ #define i2c_read_reg sm750_sw_i2c_read_reg
#endif

/* SII164 Vendor and Device ID */
@@ -25,7 +25,7 @@

#ifdef SII164_FULL_FUNCTIONS
/* Name of the DVI Controller chip */
-static char *gDviCtrlChipName = "Silicon Image SiI 164";
+static char *g_dvi_ctrl_chip_name = "Silicon Image SiI 164";
#endif

/*
@@ -37,14 +37,14 @@ static char *gDviCtrlChipName = "Silicon Image SiI 164";
*/
unsigned short sii164_get_vendor_id(void)
{
- unsigned short vendorID;
+ unsigned short vendor_id;

- vendorID = ((unsigned short)i2cReadReg(SII164_I2C_ADDRESS,
+ vendor_id = ((unsigned short)i2c_read_reg(SII164_I2C_ADDRESS,
SII164_VENDOR_ID_HIGH) << 8) |
- (unsigned short)i2cReadReg(SII164_I2C_ADDRESS,
+ (unsigned short)i2c_read_reg(SII164_I2C_ADDRESS,
SII164_VENDOR_ID_LOW);

- return vendorID;
+ return vendor_id;
}

/*
@@ -54,16 +54,16 @@ unsigned short sii164_get_vendor_id(void)
* Output:
* Device ID
*/
-unsigned short sii164GetDeviceID(void)
+unsigned short sii164_get_device_id(void)
{
- unsigned short deviceID;
+ unsigned short device_id;

- deviceID = ((unsigned short)i2cReadReg(SII164_I2C_ADDRESS,
+ device_id = ((unsigned short)i2c_read_reg(SII164_I2C_ADDRESS,
SII164_DEVICE_ID_HIGH) << 8) |
- (unsigned short)i2cReadReg(SII164_I2C_ADDRESS,
+ (unsigned short)i2c_read_reg(SII164_I2C_ADDRESS,
SII164_DEVICE_ID_LOW);

- return deviceID;
+ return device_id;
}

/*
@@ -141,7 +141,7 @@ long sii164_init_chip(unsigned char edge_select,

/* Check if SII164 Chip exists */
if ((sii164_get_vendor_id() == SII164_VENDOR_ID) &&
- (sii164GetDeviceID() == SII164_DEVICE_ID)) {
+ (sii164_get_device_id() == SII164_DEVICE_ID)) {
/*
* Initialize SII164 controller chip.
*/
@@ -176,7 +176,7 @@ long sii164_init_chip(unsigned char edge_select,
else
config |= SII164_CONFIGURATION_VSYNC_AS_IS;

- i2cWriteReg(SII164_I2C_ADDRESS, SII164_CONFIGURATION, config);
+ i2c_write_reg(SII164_I2C_ADDRESS, SII164_CONFIGURATION, config);

/*
* De-skew enabled with default 111b value.
@@ -214,7 +214,7 @@ long sii164_init_chip(unsigned char edge_select,
config |= SII164_DESKEW_8_STEP;
break;
}
- i2cWriteReg(SII164_I2C_ADDRESS, SII164_DESKEW, config);
+ i2c_write_reg(SII164_I2C_ADDRESS, SII164_DESKEW, config);

/* Enable/Disable Continuous Sync. */
if (continuous_sync_enable == 0)
@@ -231,12 +231,12 @@ long sii164_init_chip(unsigned char edge_select,
/* Set the PLL Filter value */
config |= ((pll_filter_value & 0x07) << 1);

- i2cWriteReg(SII164_I2C_ADDRESS, SII164_PLL, config);
+ i2c_write_reg(SII164_I2C_ADDRESS, SII164_PLL, config);

/* Recover from Power Down and enable output. */
- config = i2cReadReg(SII164_I2C_ADDRESS, SII164_CONFIGURATION);
+ config = i2c_read_reg(SII164_I2C_ADDRESS, SII164_CONFIGURATION);
config |= SII164_CONFIGURATION_POWER_NORMAL;
- i2cWriteReg(SII164_I2C_ADDRESS, SII164_CONFIGURATION, config);
+ i2c_write_reg(SII164_I2C_ADDRESS, SII164_CONFIGURATION, config);

return 0;
}
@@ -253,11 +253,11 @@ long sii164_init_chip(unsigned char edge_select,
* sii164ResetChip
* This function resets the DVI Controller Chip.
*/
-void sii164ResetChip(void)
+void sii164_reset_chip(void)
{
/* Power down */
- sii164SetPower(0);
- sii164SetPower(1);
+ sii164_set_power(0);
+ sii164_set_power(1);
}

/*
@@ -267,9 +267,9 @@ void sii164ResetChip(void)
*
* It's convenient for application need to display the chip name.
*/
-char *sii164GetChipString(void)
+char *sii164_get_chip_string(void)
{
- return gDviCtrlChipName;
+ return g_dvi_ctrl_chip_name;
}

/*
@@ -279,21 +279,21 @@ char *sii164GetChipString(void)
* Input:
* powerUp - Flag to set the power down or up
*/
-void sii164SetPower(unsigned char powerUp)
+void sii164_set_power(unsigned char power_up)
{
unsigned char config;

- config = i2cReadReg(SII164_I2C_ADDRESS, SII164_CONFIGURATION);
- if (powerUp == 1) {
+ config = i2c_read_reg(SII164_I2C_ADDRESS, SII164_CONFIGURATION);
+ if (power_up == 1) {
/* Power up the chip */
config &= ~SII164_CONFIGURATION_POWER_MASK;
config |= SII164_CONFIGURATION_POWER_NORMAL;
- i2cWriteReg(SII164_I2C_ADDRESS, SII164_CONFIGURATION, config);
+ i2c_write_reg(SII164_I2C_ADDRESS, SII164_CONFIGURATION, config);
} else {
/* Power down the chip */
config &= ~SII164_CONFIGURATION_POWER_MASK;
config |= SII164_CONFIGURATION_POWER_DOWN;
- i2cWriteReg(SII164_I2C_ADDRESS, SII164_CONFIGURATION, config);
+ i2c_write_reg(SII164_I2C_ADDRESS, SII164_CONFIGURATION, config);
}
}

@@ -302,30 +302,30 @@ void sii164SetPower(unsigned char powerUp)
* This function selects the mode of the hot plug detection.
*/
static
-void sii164SelectHotPlugDetectionMode(enum sii164_hot_plug_mode hotPlugMode)
+void sii164_select_hot_plug_detection_mode(enum sii164_hot_plug_mode hot_plug_mode)
{
- unsigned char detectReg;
+ unsigned char detect_reg;

- detectReg = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT) &
+ detect_reg = i2c_read_reg(SII164_I2C_ADDRESS, SII164_DETECT) &
~SII164_DETECT_MONITOR_SENSE_OUTPUT_FLAG;
- switch (hotPlugMode) {
+ switch (hot_plug_mode) {
case SII164_HOTPLUG_DISABLE:
- detectReg |= SII164_DETECT_MONITOR_SENSE_OUTPUT_HIGH;
+ detect_reg |= SII164_DETECT_MONITOR_SENSE_OUTPUT_HIGH;
break;
case SII164_HOTPLUG_USE_MDI:
- detectReg &= ~SII164_DETECT_INTERRUPT_MASK;
- detectReg |= SII164_DETECT_INTERRUPT_BY_HTPLG_PIN;
- detectReg |= SII164_DETECT_MONITOR_SENSE_OUTPUT_MDI;
+ detect_reg &= ~SII164_DETECT_INTERRUPT_MASK;
+ detect_reg |= SII164_DETECT_INTERRUPT_BY_HTPLG_PIN;
+ detect_reg |= SII164_DETECT_MONITOR_SENSE_OUTPUT_MDI;
break;
case SII164_HOTPLUG_USE_RSEN:
- detectReg |= SII164_DETECT_MONITOR_SENSE_OUTPUT_RSEN;
+ detect_reg |= SII164_DETECT_MONITOR_SENSE_OUTPUT_RSEN;
break;
case SII164_HOTPLUG_USE_HTPLG:
- detectReg |= SII164_DETECT_MONITOR_SENSE_OUTPUT_HTPLG;
+ detect_reg |= SII164_DETECT_MONITOR_SENSE_OUTPUT_HTPLG;
break;
}

- i2cWriteReg(SII164_I2C_ADDRESS, SII164_DETECT, detectReg);
+ i2c_write_reg(SII164_I2C_ADDRESS, SII164_DETECT, detect_reg);
}

/*
@@ -334,19 +334,19 @@ void sii164SelectHotPlugDetectionMode(enum sii164_hot_plug_mode hotPlugMode)
*
* enableHotPlug - Enable (=1) / disable (=0) Hot Plug detection
*/
-void sii164EnableHotPlugDetection(unsigned char enableHotPlug)
+void sii164_enable_hot_plug_detection(unsigned char enable_hot_plug)
{
- unsigned char detectReg;
+ unsigned char detect_reg;

- detectReg = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT);
+ detect_reg = i2c_read_reg(SII164_I2C_ADDRESS, SII164_DETECT);

/* Depending on each DVI controller, need to enable the hot plug based
* on each individual chip design.
*/
- if (enableHotPlug != 0)
- sii164SelectHotPlugDetectionMode(SII164_HOTPLUG_USE_MDI);
+ if (enable_hot_plug != 0)
+ sii164_select_hot_plug_detection_mode(SII164_HOTPLUG_USE_MDI);
else
- sii164SelectHotPlugDetectionMode(SII164_HOTPLUG_DISABLE);
+ sii164_select_hot_plug_detection_mode(SII164_HOTPLUG_DISABLE);
}

/*
@@ -357,13 +357,13 @@ void sii164EnableHotPlugDetection(unsigned char enableHotPlug)
* 0 - Not Connected
* 1 - Connected
*/
-unsigned char sii164IsConnected(void)
+unsigned char sii164_is_connected(void)
{
- unsigned char hotPlugValue;
+ unsigned char hot_plug_value;

- hotPlugValue = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT) &
+ hot_plug_value = i2c_read_reg(SII164_I2C_ADDRESS, SII164_DETECT) &
SII164_DETECT_HOT_PLUG_STATUS_MASK;
- if (hotPlugValue == SII164_DETECT_HOT_PLUG_STATUS_ON)
+ if (hot_plug_value == SII164_DETECT_HOT_PLUG_STATUS_ON)
return 1;
else
return 0;
@@ -377,13 +377,13 @@ unsigned char sii164IsConnected(void)
* 0 - No interrupt
* 1 - Interrupt occurs
*/
-unsigned char sii164CheckInterrupt(void)
+unsigned char sii164_check_interrupt(void)
{
- unsigned char detectReg;
+ unsigned char detect_reg;

- detectReg = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT) &
+ detect_reg = i2c_read_reg(SII164_I2C_ADDRESS, SII164_DETECT) &
SII164_DETECT_MONITOR_STATE_MASK;
- if (detectReg == SII164_DETECT_MONITOR_STATE_CHANGE)
+ if (detect_reg == SII164_DETECT_MONITOR_STATE_CHANGE)
return 1;
else
return 0;
@@ -393,14 +393,14 @@ unsigned char sii164CheckInterrupt(void)
* sii164ClearInterrupt
* Clear the hot plug interrupt.
*/
-void sii164ClearInterrupt(void)
+void sii164_clear_interruptt(void)
{
- unsigned char detectReg;
+ unsigned char detect_reg;

/* Clear the MDI interrupt */
- detectReg = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT);
- i2cWriteReg(SII164_I2C_ADDRESS, SII164_DETECT,
- detectReg | SII164_DETECT_MONITOR_STATE_CLEAR);
+ detect_reg = i2c_read_reg(SII164_I2C_ADDRESS, SII164_DETECT);
+ i2c_write_reg(SII164_I2C_ADDRESS, SII164_DETECT,
+ detect_reg | SII164_DETECT_MONITOR_STATE_CLEAR);
}

#endif
diff --git a/drivers/staging/sm750fb/ddk750_sii164.h b/drivers/staging/sm750fb/ddk750_sii164.h
index 71a7c1cb42c4..737b0e4869ff 100644
--- a/drivers/staging/sm750fb/ddk750_sii164.h
+++ b/drivers/staging/sm750fb/ddk750_sii164.h
@@ -16,28 +16,28 @@ enum sii164_hot_plug_mode {
};

/* Silicon Image SiI164 chip prototype */
-long sii164_init_chip(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 sii164_init_chip(unsigned char edge_select,
+ unsigned char bus_select,
+ unsigned char dual_edge_clk_select,
+ unsigned char hsync_enable,
+ unsigned char vsync_enable,
+ unsigned char deskew_enable,
+ unsigned char deskew_setting,
+ unsigned char continuous_sync_enable,
+ unsigned char pll_filter_enable,
+ unsigned char pll_filter_value);

unsigned short sii164_get_vendor_id(void);
-unsigned short sii164GetDeviceID(void);
+unsigned short sii164_get_device_id(void);

#ifdef SII164_FULL_FUNCTIONS
-void sii164ResetChip(void);
-char *sii164GetChipString(void);
-void sii164SetPower(unsigned char powerUp);
-void sii164EnableHotPlugDetection(unsigned char enableHotPlug);
-unsigned char sii164IsConnected(void);
-unsigned char sii164CheckInterrupt(void);
-void sii164ClearInterrupt(void);
+void sii164_reset_chip(void);
+char *sii164_get_chip_string(void);
+void sii164_set_power(unsigned char power_up);
+void sii164_enable_hot_plug_detection(unsigned char enable_hot_plug);
+unsigned char sii164_is_connected(void);
+unsigned char sii164_check_interrupt(void);
+void sii164_clear_interrupt(void);
#endif
/*
* below register definition is used for
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 04c1b32a22c5..2cce27effc46 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -33,7 +33,7 @@
static int g_hwcursor = 1;
static int g_noaccel;
static int g_nomtrr;
-static const char *g_fbmode[] = {NULL, NULL};
+static const char * const g_fbmode[] = {NULL, NULL};
static const char *g_def_fbmode = "1024x768-32@60";
static char *g_settings;
static int g_dualview;
@@ -120,14 +120,14 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor)

sm750_hw_cursor_disable(cursor);
if (fbcursor->set & FB_CUR_SETSIZE)
- sm750_hw_cursor_setSize(cursor,
- fbcursor->image.width,
- fbcursor->image.height);
+ sm750_hw_cursor_set_size(cursor,
+ 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);
+ sm750_hw_cursor_set_pos(cursor,
+ 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 */
@@ -141,14 +141,14 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor)
((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);
+ sm750_hw_cursor_set_color(cursor, fg, bg);
}

if (fbcursor->set & (FB_CUR_SETSHAPE | FB_CUR_SETIMAGE)) {
- sm750_hw_cursor_setData(cursor,
- fbcursor->rop,
- fbcursor->image.data,
- fbcursor->mask);
+ sm750_hw_cursor_set_data(cursor,
+ fbcursor->rop,
+ fbcursor->image.data,
+ fbcursor->mask);
}

if (fbcursor->enable)
@@ -162,7 +162,7 @@ static void lynxfb_ops_fillrect(struct fb_info *info,
{
struct lynxfb_par *par;
struct sm750_dev *sm750_dev;
- unsigned int base, pitch, Bpp, rop;
+ unsigned int base, pitch, bpp, rop;
u32 color;

if (info->state != FBINFO_STATE_RUNNING)
@@ -177,9 +177,9 @@ static void lynxfb_ops_fillrect(struct fb_info *info,
*/
base = par->crtc.o_screen;
pitch = info->fix.line_length;
- Bpp = info->var.bits_per_pixel >> 3;
+ bpp = info->var.bits_per_pixel >> 3;

- color = (Bpp == 1) ? region->color :
+ color = (bpp == 1) ? region->color :
((u32 *)info->pseudo_palette)[region->color];
rop = (region->rop != ROP_COPY) ? HW_ROP2_XOR : HW_ROP2_COPY;

@@ -192,7 +192,7 @@ static void lynxfb_ops_fillrect(struct fb_info *info,
spin_lock(&sm750_dev->slock);

sm750_dev->accel.de_fillrect(&sm750_dev->accel,
- base, pitch, Bpp,
+ base, pitch, bpp,
region->dx, region->dy,
region->width, region->height,
color, rop);
@@ -204,7 +204,7 @@ static void lynxfb_ops_copyarea(struct fb_info *info,
{
struct lynxfb_par *par;
struct sm750_dev *sm750_dev;
- unsigned int base, pitch, Bpp;
+ unsigned int base, pitch, bpp;

par = info->par;
sm750_dev = par->dev;
@@ -215,7 +215,7 @@ static void lynxfb_ops_copyarea(struct fb_info *info,
*/
base = par->crtc.o_screen;
pitch = info->fix.line_length;
- Bpp = info->var.bits_per_pixel >> 3;
+ bpp = info->var.bits_per_pixel >> 3;

/*
* If not use spin_lock, system will die if user load driver
@@ -227,7 +227,7 @@ static void lynxfb_ops_copyarea(struct fb_info *info,

sm750_dev->accel.de_copyarea(&sm750_dev->accel,
base, pitch, region->sx, region->sy,
- base, pitch, Bpp, region->dx, region->dy,
+ base, pitch, bpp, region->dx, region->dy,
region->width, region->height,
HW_ROP2_COPY);
spin_unlock(&sm750_dev->slock);
@@ -236,7 +236,7 @@ static void lynxfb_ops_copyarea(struct fb_info *info,
static void lynxfb_ops_imageblit(struct fb_info *info,
const struct fb_image *image)
{
- unsigned int base, pitch, Bpp;
+ unsigned int base, pitch, bpp;
unsigned int fgcol, bgcol;
struct lynxfb_par *par;
struct sm750_dev *sm750_dev;
@@ -249,7 +249,7 @@ static void lynxfb_ops_imageblit(struct fb_info *info,
*/
base = par->crtc.o_screen;
pitch = info->fix.line_length;
- Bpp = info->var.bits_per_pixel >> 3;
+ bpp = info->var.bits_per_pixel >> 3;

/* TODO: Implement hardware acceleration for image->depth > 1 */
if (image->depth != 1) {
@@ -276,7 +276,7 @@ static void lynxfb_ops_imageblit(struct fb_info *info,

sm750_dev->accel.de_imageblit(&sm750_dev->accel,
image->data, image->width >> 3, 0,
- base, pitch, Bpp,
+ base, pitch, bpp,
image->dx, image->dy,
image->width, image->height,
fgcol, bgcol, HW_ROP2_COPY);
@@ -394,9 +394,9 @@ static int lynxfb_ops_set_par(struct fb_info *info)
pr_err("bpp %d not supported\n", var->bits_per_pixel);
return ret;
}
- ret = hw_sm750_crtc_setMode(crtc, var, fix);
+ ret = hw_sm750_crtc_set_mode(crtc, var, fix);
if (!ret)
- ret = hw_sm750_output_setMode(output, var, fix);
+ ret = hw_sm750_output_set_mode(output, var, fix);
return ret;
}

@@ -514,7 +514,7 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var,
return -ENOMEM;
}

- return hw_sm750_crtc_checkMode(crtc, var);
+ return hw_sm750_crtc_check_mode(crtc, var);
}

static int lynxfb_ops_setcolreg(unsigned int regno,
@@ -540,14 +540,16 @@ static int lynxfb_ops_setcolreg(unsigned int regno,
}

if (info->var.grayscale)
- red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8;
+ red = (red * 77 + green * 151 + blue * 28) >> 8;
+ green = (red * 77 + green * 151 + blue * 28) >> 8;
+ blue = (red * 77 + green * 151 + blue * 28) >> 8;

if (var->bits_per_pixel == 8 &&
info->fix.visual == FB_VISUAL_PSEUDOCOLOR) {
red >>= 8;
green >>= 8;
blue >>= 8;
- ret = hw_sm750_setColReg(crtc, regno, red, green, blue);
+ ret = hw_sm750_set_col_reg(crtc, regno, red, green, blue);
goto exit;
}

@@ -579,7 +581,7 @@ static int lynxfb_ops_blank(int blank, struct fb_info *info)
pr_debug("blank = %d.\n", blank);
par = info->par;
output = &par->output;
- return output->proc_setBLANK(output, blank);
+ return output->proc_set_blank(output, blank);
}

static int sm750fb_set_drv(struct lynxfb_par *par)
@@ -600,44 +602,44 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
crtc->vidmem_size >>= 1;

/* setup crtc and output member */
- sm750_dev->hwCursor = g_hwcursor;
+ sm750_dev->hw_cursor = g_hwcursor;

crtc->line_pad = 16;
crtc->xpanstep = 8;
crtc->ypanstep = 1;
crtc->ywrapstep = 0;

- output->proc_setBLANK = (sm750_dev->revid == SM750LE_REVISION_ID) ?
- hw_sm750le_setBLANK : hw_sm750_setBLANK;
+ output->proc_set_blank = (sm750_dev->revid == SM750LE_REVISION_ID) ?
+ hw_sm750le_set_blank : hw_sm750_set_blank;
/* chip specific phase */
sm750_dev->accel.de_wait = (sm750_dev->revid == SM750LE_REVISION_ID) ?
- hw_sm750le_deWait : hw_sm750_deWait;
+ hw_sm750le_de_wait : hw_sm750_de_wait;
switch (sm750_dev->dataflow) {
case sm750_simul_pri:
output->paths = sm750_pnc;
crtc->channel = sm750_primary;
crtc->o_screen = 0;
- crtc->v_screen = sm750_dev->pvMem;
+ crtc->v_screen = sm750_dev->pv_mem;
pr_info("use simul primary mode\n");
break;
case sm750_simul_sec:
output->paths = sm750_pnc;
crtc->channel = sm750_secondary;
crtc->o_screen = 0;
- crtc->v_screen = sm750_dev->pvMem;
+ crtc->v_screen = sm750_dev->pv_mem;
break;
case sm750_dual_normal:
if (par->index == 0) {
output->paths = sm750_panel;
crtc->channel = sm750_primary;
crtc->o_screen = 0;
- crtc->v_screen = sm750_dev->pvMem;
+ crtc->v_screen = sm750_dev->pv_mem;
} else {
output->paths = sm750_crt;
crtc->channel = sm750_secondary;
/* not consider of padding stuffs for o_screen,need fix */
crtc->o_screen = sm750_dev->vidmem_size >> 1;
- crtc->v_screen = sm750_dev->pvMem + crtc->o_screen;
+ crtc->v_screen = sm750_dev->pv_mem + crtc->o_screen;
}
break;
case sm750_dual_swap:
@@ -645,7 +647,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
output->paths = sm750_panel;
crtc->channel = sm750_secondary;
crtc->o_screen = 0;
- crtc->v_screen = sm750_dev->pvMem;
+ crtc->v_screen = sm750_dev->pv_mem;
} else {
output->paths = sm750_crt;
crtc->channel = sm750_primary;
@@ -653,7 +655,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
* need fix
*/
crtc->o_screen = sm750_dev->vidmem_size >> 1;
- crtc->v_screen = sm750_dev->pvMem + crtc->o_screen;
+ crtc->v_screen = sm750_dev->pv_mem + crtc->o_screen;
}
break;
default:
@@ -733,7 +735,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
"kernel HELPERS prepared vesa_modes",
};

- static const char *fixId[2] = {
+ static const char *fix_id[2] = {
"sm750_fb1", "sm750_fb2",
};

@@ -757,14 +759,14 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
* must be set after crtc member initialized
*/
crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
- crtc->cursor.mmio = sm750_dev->pvReg +
+ crtc->cursor.mmio = sm750_dev->pv_reg +
0x800f0 + (int)crtc->channel * 0x140;

pr_info("crtc->cursor.mmio = %p\n", crtc->cursor.mmio);
crtc->cursor.max_h = 64;
crtc->cursor.max_w = 64;
crtc->cursor.size = crtc->cursor.max_h * crtc->cursor.max_w * 2 / 8;
- crtc->cursor.vstart = sm750_dev->pvMem + crtc->cursor.offset;
+ crtc->cursor.vstart = sm750_dev->pv_mem + crtc->cursor.offset;

memset_io(crtc->cursor.vstart, 0, crtc->cursor.size);
if (!g_hwcursor)
@@ -855,7 +857,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
fix->ywrapstep = crtc->ywrapstep;
fix->accel = FB_ACCEL_SMI;

- strscpy(fix->id, fixId[index], sizeof(fix->id));
+ strscpy(fix->id, fix_id[index], sizeof(fix->id));

fix->smem_start = crtc->o_screen + sm750_dev->vidmem_start;
pr_info("fix->smem_start = %lx\n", fix->smem_start);
@@ -911,12 +913,12 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)

swap = 0;

- sm750_dev->initParm.chip_clk = 0;
- sm750_dev->initParm.mem_clk = 0;
- sm750_dev->initParm.master_clk = 0;
- sm750_dev->initParm.powerMode = 0;
- sm750_dev->initParm.setAllEngOff = 0;
- sm750_dev->initParm.resetMemory = 1;
+ sm750_dev->init_pram.chip_clk = 0;
+ sm750_dev->init_pram.mem_clk = 0;
+ sm750_dev->init_pram.master_clk = 0;
+ sm750_dev->init_pram.power_mode = 0;
+ sm750_dev->init_pram.set_all_eng_off = 0;
+ sm750_dev->init_pram.reset_memory = 1;

/* defaultly turn g_hwcursor on for both view */
g_hwcursor = 3;
@@ -935,9 +937,9 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
} else if (!strncmp(opt, "nocrt", strlen("nocrt"))) {
sm750_dev->nocrt = 1;
} else if (!strncmp(opt, "36bit", strlen("36bit"))) {
- sm750_dev->pnltype = sm750_doubleTFT;
+ sm750_dev->pnltype = sm750_double_tft;
} else if (!strncmp(opt, "18bit", strlen("18bit"))) {
- sm750_dev->pnltype = sm750_dualTFT;
+ sm750_dev->pnltype = sm750_dual_tft;
} else if (!strncmp(opt, "24bit", strlen("24bit"))) {
sm750_dev->pnltype = sm750_24TFT;
} else if (!strncmp(opt, "nohwc0", strlen("nohwc0"))) {
@@ -1083,7 +1085,7 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
sm750_dev->mtrr.vram = arch_phys_wc_add(sm750_dev->vidmem_start,
sm750_dev->vidmem_size);

- memset_io(sm750_dev->pvMem, 0, sm750_dev->vidmem_size);
+ memset_io(sm750_dev->pv_mem, 0, sm750_dev->vidmem_size);

pci_set_drvdata(pdev, sm750_dev);

@@ -1114,8 +1116,8 @@ static void lynxfb_pci_remove(struct pci_dev *pdev)
sm750fb_framebuffer_release(sm750_dev);
arch_phys_wc_del(sm750_dev->mtrr.vram);

- iounmap(sm750_dev->pvReg);
- iounmap(sm750_dev->pvMem);
+ iounmap(sm750_dev->pv_reg);
+ iounmap(sm750_dev->pv_mem);
kfree(g_settings);
}

diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h
index aff69661c8e6..8eab90f0f33b 100644
--- a/drivers/staging/sm750fb/sm750.h
+++ b/drivers/staging/sm750fb/sm750.h
@@ -14,8 +14,8 @@

enum sm750_pnltype {
sm750_24TFT = 0, /* 24bit tft */
- sm750_dualTFT = 2, /* dual 18 bit tft */
- sm750_doubleTFT = 1, /* 36 bit double pixel tft */
+ sm750_dual_tft = 2, /* dual 18 bit tft */
+ sm750_double_tft = 1, /* 36 bit double pixel tft */
};

/* vga channel is not concerned */
@@ -39,20 +39,20 @@ enum sm750_path {
};

struct init_status {
- ushort powerMode;
+ ushort power_mode;
/* below three clocks are in unit of MHZ*/
ushort chip_clk;
ushort mem_clk;
ushort master_clk;
- ushort setAllEngOff;
- ushort resetMemory;
+ ushort set_all_eng_off;
+ ushort reset_memory;
};

struct lynx_accel {
/* base virtual address of DPR registers */
- volatile unsigned char __iomem *dprBase;
+ unsigned char __iomem *dpr_base;
/* base virtual address of de data port */
- volatile unsigned char __iomem *dpPortBase;
+ unsigned char __iomem *dp_port_base;

/* function pointers */
void (*de_init)(struct lynx_accel *accel);
@@ -97,12 +97,12 @@ struct sm750_dev {
unsigned long vidreg_start;
__u32 vidmem_size;
__u32 vidreg_size;
- void __iomem *pvReg;
- unsigned char __iomem *pvMem;
+ void __iomem *pv_reg;
+ unsigned char __iomem *pv_mem;
/* locks*/
spinlock_t slock;

- struct init_status initParm;
+ struct init_status init_parm;
enum sm750_pnltype pnltype;
enum sm750_dataflow dataflow;
int nocrt;
@@ -113,7 +113,7 @@ struct sm750_dev {
* 2: secondary crtc hw cursor enabled
* 3: both ctrc hw cursor enabled
*/
- int hwCursor;
+ int hw_cursor;
};

struct lynx_cursor {
@@ -128,7 +128,7 @@ struct lynx_cursor {
char __iomem *vstart;
int offset;
/* mmio addr of hw cursor */
- volatile char __iomem *mmio;
+ char __iomem *mmio;
};

struct lynxfb_crtc {