Skip to content

Commit

Permalink
mfd: Rename all twl4030_i2c*
Browse files Browse the repository at this point in the history
This patch renames function names like twl4030_i2c_write_u8,
twl4030_i2c_read_u8 to twl_i2c_write_u8, twl_i2c_read_u8
and also common variable in twl-core.c

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
balajitk authored and Samuel Ortiz committed Dec 13, 2009
1 parent b07682b commit fc7b92f
Show file tree
Hide file tree
Showing 13 changed files with 187 additions and 160 deletions.
18 changes: 9 additions & 9 deletions drivers/gpio/twl4030-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static unsigned int gpio_usage_count;
*/
static inline int gpio_twl4030_write(u8 address, u8 data)
{
return twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, data, address);
return twl_i2c_write_u8(TWL4030_MODULE_GPIO, data, address);
}

/*----------------------------------------------------------------------*/
Expand Down Expand Up @@ -117,7 +117,7 @@ static inline int gpio_twl4030_read(u8 address)
u8 data;
int ret = 0;

ret = twl4030_i2c_read_u8(TWL4030_MODULE_GPIO, &data, address);
ret = twl_i2c_read_u8(TWL4030_MODULE_GPIO, &data, address);
return (ret < 0) ? ret : data;
}

Expand All @@ -142,7 +142,7 @@ static void twl4030_led_set_value(int led, int value)
cached_leden &= ~mask;
else
cached_leden |= mask;
status = twl4030_i2c_write_u8(TWL4030_MODULE_LED, cached_leden,
status = twl_i2c_write_u8(TWL4030_MODULE_LED, cached_leden,
TWL4030_LED_LEDEN);
mutex_unlock(&gpio_lock);
}
Expand Down Expand Up @@ -223,23 +223,23 @@ static int twl_request(struct gpio_chip *chip, unsigned offset)
}

/* initialize PWM to always-drive */
status = twl4030_i2c_write_u8(module, 0x7f,
status = twl_i2c_write_u8(module, 0x7f,
TWL4030_PWMx_PWMxOFF);
if (status < 0)
goto done;
status = twl4030_i2c_write_u8(module, 0x7f,
status = twl_i2c_write_u8(module, 0x7f,
TWL4030_PWMx_PWMxON);
if (status < 0)
goto done;

/* init LED to not-driven (high) */
module = TWL4030_MODULE_LED;
status = twl4030_i2c_read_u8(module, &cached_leden,
status = twl_i2c_read_u8(module, &cached_leden,
TWL4030_LED_LEDEN);
if (status < 0)
goto done;
cached_leden &= ~ledclr_mask;
status = twl4030_i2c_write_u8(module, cached_leden,
status = twl_i2c_write_u8(module, cached_leden,
TWL4030_LED_LEDEN);
if (status < 0)
goto done;
Expand Down Expand Up @@ -370,7 +370,7 @@ static int __devinit gpio_twl4030_pulls(u32 ups, u32 downs)
message[i] = bit_mask;
}

return twl4030_i2c_write(TWL4030_MODULE_GPIO, message,
return twl_i2c_write(TWL4030_MODULE_GPIO, message,
REG_GPIOPUPDCTR1, 5);
}

Expand All @@ -387,7 +387,7 @@ static int __devinit gpio_twl4030_debounce(u32 debounce, u8 mmc_cd)
debounce >>= 8;
message[3] = (debounce & 0x03);

return twl4030_i2c_write(TWL4030_MODULE_GPIO, message,
return twl_i2c_write(TWL4030_MODULE_GPIO, message,
REG_GPIO_DEBEN1, 3);
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/input/keyboard/twl4030_keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ struct twl4030_keypad {
static int twl4030_kpread(struct twl4030_keypad *kp,
u8 *data, u32 reg, u8 num_bytes)
{
int ret = twl4030_i2c_read(TWL4030_MODULE_KEYPAD, data, reg, num_bytes);
int ret = twl_i2c_read(TWL4030_MODULE_KEYPAD, data, reg, num_bytes);

if (ret < 0)
dev_warn(kp->dbg_dev,
Expand All @@ -145,7 +145,7 @@ static int twl4030_kpread(struct twl4030_keypad *kp,

static int twl4030_kpwrite_u8(struct twl4030_keypad *kp, u8 data, u32 reg)
{
int ret = twl4030_i2c_write_u8(TWL4030_MODULE_KEYPAD, data, reg);
int ret = twl_i2c_write_u8(TWL4030_MODULE_KEYPAD, data, reg);

if (ret < 0)
dev_warn(kp->dbg_dev,
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/misc/twl4030-pwrbutton.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static irqreturn_t powerbutton_irq(int irq, void *_pwr)
local_irq_enable();
#endif

err = twl4030_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &value,
err = twl_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &value,
STS_HW_CONDITIONS);
if (!err) {
input_report_key(pwr, KEY_POWER, value & PWR_PWRON_IRQ);
Expand Down
Loading

0 comments on commit fc7b92f

Please sign in to comment.