Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: sm750fb: ddk750_swi2c: further reduce CamelCase

Rename remaining CamelCase variables

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Mike Rapoport and committed by
Greg Kroah-Hartman
fe820044 53bc6b6e

+71 -71
+61 -61
drivers/staging/sm750fb/ddk750_swi2c.c
··· 98 98 */ 99 99 while (peekIO(0x3ce, 0x61) & 0x10); 100 100 #else 101 - int i, Temp; 101 + int i, tmp; 102 102 103 103 for (i = 0; i < 600; i++) { 104 - Temp = i; 105 - Temp += i; 104 + tmp = i; 105 + tmp += i; 106 106 } 107 107 #endif 108 108 } ··· 121 121 */ 122 122 static void sw_i2c_scl(unsigned char value) 123 123 { 124 - unsigned long ulGPIOData; 125 - unsigned long ulGPIODirection; 124 + unsigned long gpio_data; 125 + unsigned long gpio_dir; 126 126 127 - ulGPIODirection = PEEK32(sw_i2c_clk_gpio_data_dir_reg); 127 + gpio_dir = PEEK32(sw_i2c_clk_gpio_data_dir_reg); 128 128 if (value) { /* High */ 129 129 /* Set direction as input. This will automatically pull the signal up. */ 130 - ulGPIODirection &= ~(1 << sw_i2c_clk_gpio); 131 - POKE32(sw_i2c_clk_gpio_data_dir_reg, ulGPIODirection); 130 + gpio_dir &= ~(1 << sw_i2c_clk_gpio); 131 + POKE32(sw_i2c_clk_gpio_data_dir_reg, gpio_dir); 132 132 } else { /* Low */ 133 133 /* Set the signal down */ 134 - ulGPIOData = PEEK32(sw_i2c_clk_gpio_data_reg); 135 - ulGPIOData &= ~(1 << sw_i2c_clk_gpio); 136 - POKE32(sw_i2c_clk_gpio_data_reg, ulGPIOData); 134 + gpio_data = PEEK32(sw_i2c_clk_gpio_data_reg); 135 + gpio_data &= ~(1 << sw_i2c_clk_gpio); 136 + POKE32(sw_i2c_clk_gpio_data_reg, gpio_data); 137 137 138 138 /* Set direction as output */ 139 - ulGPIODirection |= (1 << sw_i2c_clk_gpio); 140 - POKE32(sw_i2c_clk_gpio_data_dir_reg, ulGPIODirection); 139 + gpio_dir |= (1 << sw_i2c_clk_gpio); 140 + POKE32(sw_i2c_clk_gpio_data_dir_reg, gpio_dir); 141 141 } 142 142 } 143 143 ··· 155 155 */ 156 156 static void sw_i2c_sda(unsigned char value) 157 157 { 158 - unsigned long ulGPIOData; 159 - unsigned long ulGPIODirection; 158 + unsigned long gpio_data; 159 + unsigned long gpio_dir; 160 160 161 - ulGPIODirection = PEEK32(sw_i2c_data_gpio_data_dir_reg); 161 + gpio_dir = PEEK32(sw_i2c_data_gpio_data_dir_reg); 162 162 if (value) { /* High */ 163 163 /* Set direction as input. This will automatically pull the signal up. */ 164 - ulGPIODirection &= ~(1 << sw_i2c_data_gpio); 165 - POKE32(sw_i2c_data_gpio_data_dir_reg, ulGPIODirection); 164 + gpio_dir &= ~(1 << sw_i2c_data_gpio); 165 + POKE32(sw_i2c_data_gpio_data_dir_reg, gpio_dir); 166 166 } else { /* Low */ 167 167 /* Set the signal down */ 168 - ulGPIOData = PEEK32(sw_i2c_data_gpio_data_reg); 169 - ulGPIOData &= ~(1 << sw_i2c_data_gpio); 170 - POKE32(sw_i2c_data_gpio_data_reg, ulGPIOData); 168 + gpio_data = PEEK32(sw_i2c_data_gpio_data_reg); 169 + gpio_data &= ~(1 << sw_i2c_data_gpio); 170 + POKE32(sw_i2c_data_gpio_data_reg, gpio_data); 171 171 172 172 /* Set direction as output */ 173 - ulGPIODirection |= (1 << sw_i2c_data_gpio); 174 - POKE32(sw_i2c_data_gpio_data_dir_reg, ulGPIODirection); 173 + gpio_dir |= (1 << sw_i2c_data_gpio); 174 + POKE32(sw_i2c_data_gpio_data_dir_reg, gpio_dir); 175 175 } 176 176 } 177 177 ··· 183 183 */ 184 184 static unsigned char sw_i2c_read_sda(void) 185 185 { 186 - unsigned long ulGPIODirection; 187 - unsigned long ulGPIOData; 186 + unsigned long gpio_dir; 187 + unsigned long gpio_data; 188 188 189 189 /* Make sure that the direction is input (High) */ 190 - ulGPIODirection = PEEK32(sw_i2c_data_gpio_data_dir_reg); 191 - if ((ulGPIODirection & (1 << sw_i2c_data_gpio)) != (~(1 << sw_i2c_data_gpio))) { 192 - ulGPIODirection &= ~(1 << sw_i2c_data_gpio); 193 - POKE32(sw_i2c_data_gpio_data_dir_reg, ulGPIODirection); 190 + gpio_dir = PEEK32(sw_i2c_data_gpio_data_dir_reg); 191 + if ((gpio_dir & (1 << sw_i2c_data_gpio)) != (~(1 << sw_i2c_data_gpio))) { 192 + gpio_dir &= ~(1 << sw_i2c_data_gpio); 193 + POKE32(sw_i2c_data_gpio_data_dir_reg, gpio_dir); 194 194 } 195 195 196 196 /* Now read the SDA line */ 197 - ulGPIOData = PEEK32(sw_i2c_data_gpio_data_reg); 198 - if (ulGPIOData & (1 << sw_i2c_data_gpio)) 197 + gpio_data = PEEK32(sw_i2c_data_gpio_data_reg); 198 + if (gpio_data & (1 << sw_i2c_data_gpio)) 199 199 return 1; 200 200 else 201 201 return 0; ··· 340 340 * This function initializes GPIO port for SW I2C communication. 341 341 * 342 342 * Parameters: 343 - * i2cClkGPIO - The GPIO pin to be used as i2c SCL 344 - * i2cDataGPIO - The GPIO pin to be used as i2c SDA 343 + * clk_gpio - The GPIO pin to be used as i2c SCL 344 + * data_gpio - The GPIO pin to be used as i2c SDA 345 345 * 346 346 * Return Value: 347 347 * -1 - Fail to initialize the i2c 348 348 * 0 - Success 349 349 */ 350 - static long sm750le_i2c_init(unsigned char i2cClkGPIO, 351 - unsigned char i2cDataGPIO) 350 + static long sm750le_i2c_init(unsigned char clk_gpio, 351 + unsigned char data_gpio) 352 352 { 353 353 int i; 354 354 ··· 357 357 sw_i2c_clk_gpio_data_dir_reg = GPIO_DATA_DIRECTION_SM750LE; 358 358 359 359 /* Initialize the Clock GPIO Offset */ 360 - sw_i2c_clk_gpio = i2cClkGPIO; 360 + sw_i2c_clk_gpio = clk_gpio; 361 361 362 362 /* Initialize the GPIO pin for the i2c Data Register */ 363 363 sw_i2c_data_gpio_data_reg = GPIO_DATA_SM750LE; 364 364 sw_i2c_data_gpio_data_dir_reg = GPIO_DATA_DIRECTION_SM750LE; 365 365 366 366 /* Initialize the Data GPIO Offset */ 367 - sw_i2c_data_gpio = i2cDataGPIO; 367 + sw_i2c_data_gpio = data_gpio; 368 368 369 369 /* Note that SM750LE don't have GPIO MUX and power is always on */ 370 370 ··· 379 379 * This function initializes the i2c attributes and bus 380 380 * 381 381 * Parameters: 382 - * i2cClkGPIO - The GPIO pin to be used as i2c SCL 383 - * i2cDataGPIO - The GPIO pin to be used as i2c SDA 382 + * clk_gpio - The GPIO pin to be used as i2c SCL 383 + * data_gpio - The GPIO pin to be used as i2c SDA 384 384 * 385 385 * Return Value: 386 386 * -1 - Fail to initialize the i2c 387 387 * 0 - Success 388 388 */ 389 389 long sm750_sw_i2c_init( 390 - unsigned char i2cClkGPIO, 391 - unsigned char i2cDataGPIO 390 + unsigned char clk_gpio, 391 + unsigned char data_gpio 392 392 ) 393 393 { 394 394 int i; 395 395 396 396 /* Return 0 if the GPIO pins to be used is out of range. The range is only from [0..63] */ 397 - if ((i2cClkGPIO > 31) || (i2cDataGPIO > 31)) 397 + if ((clk_gpio > 31) || (data_gpio > 31)) 398 398 return -1; 399 399 400 400 if (getChipType() == SM750LE) 401 - return sm750le_i2c_init(i2cClkGPIO, i2cDataGPIO); 401 + return sm750le_i2c_init(clk_gpio, data_gpio); 402 402 403 403 /* Initialize the GPIO pin for the i2c Clock Register */ 404 404 sw_i2c_clk_gpio_mux_reg = GPIO_MUX; ··· 406 406 sw_i2c_clk_gpio_data_dir_reg = GPIO_DATA_DIRECTION; 407 407 408 408 /* Initialize the Clock GPIO Offset */ 409 - sw_i2c_clk_gpio = i2cClkGPIO; 409 + sw_i2c_clk_gpio = clk_gpio; 410 410 411 411 /* Initialize the GPIO pin for the i2c Data Register */ 412 412 sw_i2c_data_gpio_mux_reg = GPIO_MUX; ··· 414 414 sw_i2c_data_gpio_data_dir_reg = GPIO_DATA_DIRECTION; 415 415 416 416 /* Initialize the Data GPIO Offset */ 417 - sw_i2c_data_gpio = i2cDataGPIO; 417 + sw_i2c_data_gpio = data_gpio; 418 418 419 419 /* Enable the GPIO pins for the i2c Clock and Data (GPIO MUX) */ 420 420 POKE32(sw_i2c_clk_gpio_mux_reg, ··· 436 436 * This function reads the slave device's register 437 437 * 438 438 * Parameters: 439 - * deviceAddress - i2c Slave device address which register 439 + * addr - i2c Slave device address which register 440 440 * to be read from 441 - * registerIndex - Slave device's register to be read 441 + * reg - Slave device's register to be read 442 442 * 443 443 * Return Value: 444 444 * Register value 445 445 */ 446 446 unsigned char sm750_sw_i2c_read_reg( 447 - unsigned char deviceAddress, 448 - unsigned char registerIndex 447 + unsigned char addr, 448 + unsigned char reg 449 449 ) 450 450 { 451 451 unsigned char data; ··· 454 454 sw_i2c_start(); 455 455 456 456 /* Send the device address */ 457 - sw_i2c_write_byte(deviceAddress); 457 + sw_i2c_write_byte(addr); 458 458 459 459 /* Send the register index */ 460 - sw_i2c_write_byte(registerIndex); 460 + sw_i2c_write_byte(reg); 461 461 462 462 /* Get the bus again and get the data from the device read address */ 463 463 sw_i2c_start(); 464 - sw_i2c_write_byte(deviceAddress + 1); 464 + sw_i2c_write_byte(addr + 1); 465 465 data = sw_i2c_read_byte(1); 466 466 467 467 /* Stop swI2C and release the bus */ ··· 474 474 * This function writes a value to the slave device's register 475 475 * 476 476 * Parameters: 477 - * deviceAddress - i2c Slave device address which register 477 + * addr - i2c Slave device address which register 478 478 * to be written 479 - * registerIndex - Slave device's register to be written 479 + * reg - Slave device's register to be written 480 480 * data - Data to be written to the register 481 481 * 482 482 * Result: ··· 484 484 * -1 - Fail 485 485 */ 486 486 long sm750_sw_i2c_write_reg( 487 - unsigned char deviceAddress, 488 - unsigned char registerIndex, 487 + unsigned char addr, 488 + unsigned char reg, 489 489 unsigned char data 490 490 ) 491 491 { 492 - long returnValue = 0; 492 + long ret = 0; 493 493 494 494 /* Send the Start signal */ 495 495 sw_i2c_start(); ··· 497 497 /* Send the device address and read the data. All should return success 498 498 in order for the writing processed to be successful 499 499 */ 500 - if ((sw_i2c_write_byte(deviceAddress) != 0) || 501 - (sw_i2c_write_byte(registerIndex) != 0) || 500 + if ((sw_i2c_write_byte(addr) != 0) || 501 + (sw_i2c_write_byte(reg) != 0) || 502 502 (sw_i2c_write_byte(data) != 0)) { 503 - returnValue = -1; 503 + ret = -1; 504 504 } 505 505 506 506 /* Stop i2c and release the bus */ 507 507 sw_i2c_stop(); 508 508 509 - return returnValue; 509 + return ret; 510 510 }
+10 -10
drivers/staging/sm750fb/ddk750_swi2c.h
··· 29 29 * 0 - Success 30 30 */ 31 31 long sm750_sw_i2c_init( 32 - unsigned char i2cClkGPIO, 33 - unsigned char i2cDataGPIO 32 + unsigned char clk_gpio, 33 + unsigned char data_gpio 34 34 ); 35 35 36 36 /* 37 37 * This function reads the slave device's register 38 38 * 39 39 * Parameters: 40 - * deviceAddress - i2c Slave device address which register 40 + * addr - i2c Slave device address which register 41 41 * to be read from 42 - * registerIndex - Slave device's register to be read 42 + * reg - Slave device's register to be read 43 43 * 44 44 * Return Value: 45 45 * Register value 46 46 */ 47 47 unsigned char sm750_sw_i2c_read_reg( 48 - unsigned char deviceAddress, 49 - unsigned char registerIndex 48 + unsigned char addr, 49 + unsigned char reg 50 50 ); 51 51 52 52 /* 53 53 * This function writes a value to the slave device's register 54 54 * 55 55 * Parameters: 56 - * deviceAddress - i2c Slave device address which register 56 + * addr - i2c Slave device address which register 57 57 * to be written 58 - * registerIndex - Slave device's register to be written 58 + * reg - Slave device's register to be written 59 59 * data - Data to be written to the register 60 60 * 61 61 * Result: ··· 63 63 * -1 - Fail 64 64 */ 65 65 long sm750_sw_i2c_write_reg( 66 - unsigned char deviceAddress, 67 - unsigned char registerIndex, 66 + unsigned char addr, 67 + unsigned char reg, 68 68 unsigned char data 69 69 ); 70 70