[PATCH v2 15/17] staging: sm750fb: ddk750_swi2c: further reduce CamelCase

From: Mike Rapoport
Date: Fri Sep 04 2015 - 04:22:31 EST


Rename remaining CamelCase variables

Signed-off-by: Mike Rapoport <mike.rapoport@xxxxxxxxx>
---
drivers/staging/sm750fb/ddk750_swi2c.c | 122 ++++++++++++++++-----------------
drivers/staging/sm750fb/ddk750_swi2c.h | 20 +++---
2 files changed, 71 insertions(+), 71 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c b/drivers/staging/sm750fb/ddk750_swi2c.c
index 94f4c46..ed14277 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -98,11 +98,11 @@ static void sm750_sw_i2c_wait(void)
*/
while (peekIO(0x3ce, 0x61) & 0x10);
#else
- int i, Temp;
+ int i, tmp;

for (i = 0; i < 600; i++) {
- Temp = i;
- Temp += i;
+ tmp = i;
+ tmp += i;
}
#endif
}
@@ -121,23 +121,23 @@ static void sm750_sw_i2c_wait(void)
*/
static void sm750_sw_i2c_scl(unsigned char value)
{
- unsigned long ulGPIOData;
- unsigned long ulGPIODirection;
+ unsigned long gpio_data;
+ unsigned long gpio_dir;

- ulGPIODirection = PEEK32(sw_i2c_clk_gpio_data_dir_reg);
+ gpio_dir = PEEK32(sw_i2c_clk_gpio_data_dir_reg);
if (value) { /* High */
/* Set direction as input. This will automatically pull the signal up. */
- ulGPIODirection &= ~(1 << sw_i2c_clk_gpio);
- POKE32(sw_i2c_clk_gpio_data_dir_reg, ulGPIODirection);
+ gpio_dir &= ~(1 << sw_i2c_clk_gpio);
+ POKE32(sw_i2c_clk_gpio_data_dir_reg, gpio_dir);
} else { /* Low */
/* Set the signal down */
- ulGPIOData = PEEK32(sw_i2c_clk_gpio_data_reg);
- ulGPIOData &= ~(1 << sw_i2c_clk_gpio);
- POKE32(sw_i2c_clk_gpio_data_reg, ulGPIOData);
+ gpio_data = PEEK32(sw_i2c_clk_gpio_data_reg);
+ gpio_data &= ~(1 << sw_i2c_clk_gpio);
+ POKE32(sw_i2c_clk_gpio_data_reg, gpio_data);

/* Set direction as output */
- ulGPIODirection |= (1 << sw_i2c_clk_gpio);
- POKE32(sw_i2c_clk_gpio_data_dir_reg, ulGPIODirection);
+ gpio_dir |= (1 << sw_i2c_clk_gpio);
+ POKE32(sw_i2c_clk_gpio_data_dir_reg, gpio_dir);
}
}

@@ -155,23 +155,23 @@ static void sm750_sw_i2c_scl(unsigned char value)
*/
static void sm750_sw_i2c_sda(unsigned char value)
{
- unsigned long ulGPIOData;
- unsigned long ulGPIODirection;
+ unsigned long gpio_data;
+ unsigned long gpio_dir;

- ulGPIODirection = PEEK32(sw_i2c_data_gpio_data_dir_reg);
+ gpio_dir = PEEK32(sw_i2c_data_gpio_data_dir_reg);
if (value) { /* High */
/* Set direction as input. This will automatically pull the signal up. */
- ulGPIODirection &= ~(1 << sw_i2c_data_gpio);
- POKE32(sw_i2c_data_gpio_data_dir_reg, ulGPIODirection);
+ gpio_dir &= ~(1 << sw_i2c_data_gpio);
+ POKE32(sw_i2c_data_gpio_data_dir_reg, gpio_dir);
} else { /* Low */
/* Set the signal down */
- ulGPIOData = PEEK32(sw_i2c_data_gpio_data_reg);
- ulGPIOData &= ~(1 << sw_i2c_data_gpio);
- POKE32(sw_i2c_data_gpio_data_reg, ulGPIOData);
+ gpio_data = PEEK32(sw_i2c_data_gpio_data_reg);
+ gpio_data &= ~(1 << sw_i2c_data_gpio);
+ POKE32(sw_i2c_data_gpio_data_reg, gpio_data);

/* Set direction as output */
- ulGPIODirection |= (1 << sw_i2c_data_gpio);
- POKE32(sw_i2c_data_gpio_data_dir_reg, ulGPIODirection);
+ gpio_dir |= (1 << sw_i2c_data_gpio);
+ POKE32(sw_i2c_data_gpio_data_dir_reg, gpio_dir);
}
}

@@ -183,19 +183,19 @@ static void sm750_sw_i2c_sda(unsigned char value)
*/
static unsigned char sm750_sw_i2c_read_sda(void)
{
- unsigned long ulGPIODirection;
- unsigned long ulGPIOData;
+ unsigned long gpio_dir;
+ unsigned long gpio_data;

/* Make sure that the direction is input (High) */
- ulGPIODirection = PEEK32(sw_i2c_data_gpio_data_dir_reg);
- if ((ulGPIODirection & (1 << sw_i2c_data_gpio)) != (~(1 << sw_i2c_data_gpio))) {
- ulGPIODirection &= ~(1 << sw_i2c_data_gpio);
- POKE32(sw_i2c_data_gpio_data_dir_reg, ulGPIODirection);
+ gpio_dir = PEEK32(sw_i2c_data_gpio_data_dir_reg);
+ if ((gpio_dir & (1 << sw_i2c_data_gpio)) != (~(1 << sw_i2c_data_gpio))) {
+ gpio_dir &= ~(1 << sw_i2c_data_gpio);
+ POKE32(sw_i2c_data_gpio_data_dir_reg, gpio_dir);
}

/* Now read the SDA line */
- ulGPIOData = PEEK32(sw_i2c_data_gpio_data_reg);
- if (ulGPIOData & (1 << sw_i2c_data_gpio))
+ gpio_data = PEEK32(sw_i2c_data_gpio_data_reg);
+ if (gpio_data & (1 << sw_i2c_data_gpio))
return 1;
else
return 0;
@@ -340,15 +340,15 @@ static unsigned char sm750_sw_i2c_read_byte(unsigned char ack)
* This function initializes GPIO port for SW I2C communication.
*
* Parameters:
- * i2cClkGPIO - The GPIO pin to be used as i2c SCL
- * i2cDataGPIO - The GPIO pin to be used as i2c SDA
+ * clk_gpio - The GPIO pin to be used as i2c SCL
+ * data_gpio - The GPIO pin to be used as i2c SDA
*
* Return Value:
* -1 - Fail to initialize the i2c
* 0 - Success
*/
-static long sm750le_i2c_init(unsigned char i2cClkGPIO,
- unsigned char i2cDataGPIO)
+static long sm750le_i2c_init(unsigned char clk_gpio,
+ unsigned char data_gpio)
{
int i;

@@ -357,14 +357,14 @@ static long sm750le_i2c_init(unsigned char i2cClkGPIO,
sw_i2c_clk_gpio_data_dir_reg = GPIO_DATA_DIRECTION_SM750LE;

/* Initialize the Clock GPIO Offset */
- sw_i2c_clk_gpio = i2cClkGPIO;
+ sw_i2c_clk_gpio = clk_gpio;

/* Initialize the GPIO pin for the i2c Data Register */
sw_i2c_data_gpio_data_reg = GPIO_DATA_SM750LE;
sw_i2c_data_gpio_data_dir_reg = GPIO_DATA_DIRECTION_SM750LE;

/* Initialize the Data GPIO Offset */
- sw_i2c_data_gpio = i2cDataGPIO;
+ sw_i2c_data_gpio = data_gpio;

/* Note that SM750LE don't have GPIO MUX and power is always on */

@@ -379,26 +379,26 @@ static long sm750le_i2c_init(unsigned char i2cClkGPIO,
* This function initializes the i2c attributes and bus
*
* Parameters:
- * i2cClkGPIO - The GPIO pin to be used as i2c SCL
- * i2cDataGPIO - The GPIO pin to be used as i2c SDA
+ * clk_gpio - The GPIO pin to be used as i2c SCL
+ * data_gpio - The GPIO pin to be used as i2c SDA
*
* Return Value:
* -1 - Fail to initialize the i2c
* 0 - Success
*/
long sm750_sw_i2c_init(
- unsigned char i2cClkGPIO,
- unsigned char i2cDataGPIO
+ unsigned char clk_gpio,
+ unsigned char data_gpio
)
{
int i;

/* Return 0 if the GPIO pins to be used is out of range. The range is only from [0..63] */
- if ((i2cClkGPIO > 31) || (i2cDataGPIO > 31))
+ if ((clk_gpio > 31) || (data_gpio > 31))
return -1;

if (getChipType() == SM750LE)
- return sm750le_i2c_init(i2cClkGPIO, i2cDataGPIO);
+ return sm750le_i2c_init(clk_gpio, data_gpio);

/* Initialize the GPIO pin for the i2c Clock Register */
sw_i2c_clk_gpio_mux_reg = GPIO_MUX;
@@ -406,7 +406,7 @@ long sm750_sw_i2c_init(
sw_i2c_clk_gpio_data_dir_reg = GPIO_DATA_DIRECTION;

/* Initialize the Clock GPIO Offset */
- sw_i2c_clk_gpio = i2cClkGPIO;
+ sw_i2c_clk_gpio = clk_gpio;

/* Initialize the GPIO pin for the i2c Data Register */
sw_i2c_data_gpio_mux_reg = GPIO_MUX;
@@ -414,7 +414,7 @@ long sm750_sw_i2c_init(
sw_i2c_data_gpio_data_dir_reg = GPIO_DATA_DIRECTION;

/* Initialize the Data GPIO Offset */
- sw_i2c_data_gpio = i2cDataGPIO;
+ sw_i2c_data_gpio = data_gpio;

/* Enable the GPIO pins for the i2c Clock and Data (GPIO MUX) */
POKE32(sw_i2c_clk_gpio_mux_reg,
@@ -436,16 +436,16 @@ long sm750_sw_i2c_init(
* This function reads the slave device's register
*
* Parameters:
- * deviceAddress - i2c Slave device address which register
+ * addr - i2c Slave device address which register
* to be read from
- * registerIndex - Slave device's register to be read
+ * reg - Slave device's register to be read
*
* Return Value:
* Register value
*/
unsigned char sm750_sw_i2c_read_reg(
- unsigned char deviceAddress,
- unsigned char registerIndex
+ unsigned char addr,
+ unsigned char reg
)
{
unsigned char data;
@@ -454,14 +454,14 @@ unsigned char sm750_sw_i2c_read_reg(
sm750_sw_i2c_start();

/* Send the device address */
- sm750_sw_i2c_write_byte(deviceAddress);
+ sm750_sw_i2c_write_byte(addr);

/* Send the register index */
- sm750_sw_i2c_write_byte(registerIndex);
+ sm750_sw_i2c_write_byte(reg);

/* Get the bus again and get the data from the device read address */
sm750_sw_i2c_start();
- sm750_sw_i2c_write_byte(deviceAddress + 1);
+ sm750_sw_i2c_write_byte(addr + 1);
data = sm750_sw_i2c_read_byte(1);

/* Stop swI2C and release the bus */
@@ -474,9 +474,9 @@ unsigned char sm750_sw_i2c_read_reg(
* This function writes a value to the slave device's register
*
* Parameters:
- * deviceAddress - i2c Slave device address which register
+ * addr - i2c Slave device address which register
* to be written
- * registerIndex - Slave device's register to be written
+ * reg - Slave device's register to be written
* data - Data to be written to the register
*
* Result:
@@ -484,12 +484,12 @@ unsigned char sm750_sw_i2c_read_reg(
* -1 - Fail
*/
long sm750_sw_i2c_write_reg(
- unsigned char deviceAddress,
- unsigned char registerIndex,
+ unsigned char addr,
+ unsigned char reg,
unsigned char data
)
{
- long returnValue = 0;
+ long ret = 0;

/* Send the Start signal */
sm750_sw_i2c_start();
@@ -497,14 +497,14 @@ long sm750_sw_i2c_write_reg(
/* Send the device address and read the data. All should return success
in order for the writing processed to be successful
*/
- if ((sm750_sw_i2c_write_byte(deviceAddress) != 0) ||
- (sm750_sw_i2c_write_byte(registerIndex) != 0) ||
+ if ((sm750_sw_i2c_write_byte(addr) != 0) ||
+ (sm750_sw_i2c_write_byte(reg) != 0) ||
(sm750_sw_i2c_write_byte(data) != 0)) {
- returnValue = -1;
+ ret = -1;
}

/* Stop i2c and release the bus */
sm750_sw_i2c_stop();

- return returnValue;
+ return ret;
}
diff --git a/drivers/staging/sm750fb/ddk750_swi2c.h b/drivers/staging/sm750fb/ddk750_swi2c.h
index 27a04f3a..b53629c 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.h
+++ b/drivers/staging/sm750fb/ddk750_swi2c.h
@@ -29,33 +29,33 @@
* 0 - Success
*/
long sm750_sw_i2c_init(
- unsigned char i2cClkGPIO,
- unsigned char i2cDataGPIO
+ unsigned char clk_gpio,
+ unsigned char data_gpio
);

/*
* This function reads the slave device's register
*
* Parameters:
- * deviceAddress - i2c Slave device address which register
+ * addr - i2c Slave device address which register
* to be read from
- * registerIndex - Slave device's register to be read
+ * reg - Slave device's register to be read
*
* Return Value:
* Register value
*/
unsigned char sm750_sw_i2c_read_reg(
- unsigned char deviceAddress,
- unsigned char registerIndex
+ unsigned char addr,
+ unsigned char reg
);

/*
* This function writes a value to the slave device's register
*
* Parameters:
- * deviceAddress - i2c Slave device address which register
+ * addr - i2c Slave device address which register
* to be written
- * registerIndex - Slave device's register to be written
+ * reg - Slave device's register to be written
* data - Data to be written to the register
*
* Result:
@@ -63,8 +63,8 @@ unsigned char sm750_sw_i2c_read_reg(
* -1 - Fail
*/
long sm750_sw_i2c_write_reg(
- unsigned char deviceAddress,
- unsigned char registerIndex,
+ unsigned char addr,
+ unsigned char reg,
unsigned char data
);

--
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/