aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/otg/twl4030-usb.c
diff options
context:
space:
mode:
authorBalaji T K <balajitk@ti.com>2009-12-13 15:23:33 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2009-12-13 15:23:33 -0500
commitfc7b92fca4e546184557f1c53f84ad57c66b7695 (patch)
treef15b37df7d34f525d877d33186b840947aa65b4d /drivers/usb/otg/twl4030-usb.c
parentb07682b6056eb6701f8cb86aa5800e6f2ea7919b (diff)
mfd: Rename all twl4030_i2c*
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>
Diffstat (limited to 'drivers/usb/otg/twl4030-usb.c')
-rw-r--r--drivers/usb/otg/twl4030-usb.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/usb/otg/twl4030-usb.c b/drivers/usb/otg/twl4030-usb.c
index 3acbdb82bcf9..2be9f2fa41f9 100644
--- a/drivers/usb/otg/twl4030-usb.c
+++ b/drivers/usb/otg/twl4030-usb.c
@@ -276,16 +276,16 @@ static int twl4030_i2c_write_u8_verify(struct twl4030_usb *twl,
276{ 276{
277 u8 check; 277 u8 check;
278 278
279 if ((twl4030_i2c_write_u8(module, data, address) >= 0) && 279 if ((twl_i2c_write_u8(module, data, address) >= 0) &&
280 (twl4030_i2c_read_u8(module, &check, address) >= 0) && 280 (twl_i2c_read_u8(module, &check, address) >= 0) &&
281 (check == data)) 281 (check == data))
282 return 0; 282 return 0;
283 dev_dbg(twl->dev, "Write%d[%d,0x%x] wrote %02x but read %02x\n", 283 dev_dbg(twl->dev, "Write%d[%d,0x%x] wrote %02x but read %02x\n",
284 1, module, address, check, data); 284 1, module, address, check, data);
285 285
286 /* Failed once: Try again */ 286 /* Failed once: Try again */
287 if ((twl4030_i2c_write_u8(module, data, address) >= 0) && 287 if ((twl_i2c_write_u8(module, data, address) >= 0) &&
288 (twl4030_i2c_read_u8(module, &check, address) >= 0) && 288 (twl_i2c_read_u8(module, &check, address) >= 0) &&
289 (check == data)) 289 (check == data))
290 return 0; 290 return 0;
291 dev_dbg(twl->dev, "Write%d[%d,0x%x] wrote %02x but read %02x\n", 291 dev_dbg(twl->dev, "Write%d[%d,0x%x] wrote %02x but read %02x\n",
@@ -303,7 +303,7 @@ static inline int twl4030_usb_write(struct twl4030_usb *twl,
303{ 303{
304 int ret = 0; 304 int ret = 0;
305 305
306 ret = twl4030_i2c_write_u8(TWL4030_MODULE_USB, data, address); 306 ret = twl_i2c_write_u8(TWL4030_MODULE_USB, data, address);
307 if (ret < 0) 307 if (ret < 0)
308 dev_dbg(twl->dev, 308 dev_dbg(twl->dev,
309 "TWL4030:USB:Write[0x%x] Error %d\n", address, ret); 309 "TWL4030:USB:Write[0x%x] Error %d\n", address, ret);
@@ -315,7 +315,7 @@ static inline int twl4030_readb(struct twl4030_usb *twl, u8 module, u8 address)
315 u8 data; 315 u8 data;
316 int ret = 0; 316 int ret = 0;
317 317
318 ret = twl4030_i2c_read_u8(module, &data, address); 318 ret = twl_i2c_read_u8(module, &data, address);
319 if (ret >= 0) 319 if (ret >= 0)
320 ret = data; 320 ret = data;
321 else 321 else
@@ -462,7 +462,7 @@ static void twl4030_phy_power(struct twl4030_usb *twl, int on)
462 * SLEEP. We work around this by clearing the bit after usv3v1 462 * SLEEP. We work around this by clearing the bit after usv3v1
463 * is re-activated. This ensures that VUSB3V1 is really active. 463 * is re-activated. This ensures that VUSB3V1 is really active.
464 */ 464 */
465 twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, 465 twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0,
466 VUSB_DEDICATED2); 466 VUSB_DEDICATED2);
467 regulator_enable(twl->usb1v5); 467 regulator_enable(twl->usb1v5);
468 pwr &= ~PHY_PWR_PHYPWD; 468 pwr &= ~PHY_PWR_PHYPWD;
@@ -505,44 +505,44 @@ static void twl4030_phy_resume(struct twl4030_usb *twl)
505static int twl4030_usb_ldo_init(struct twl4030_usb *twl) 505static int twl4030_usb_ldo_init(struct twl4030_usb *twl)
506{ 506{
507 /* Enable writing to power configuration registers */ 507 /* Enable writing to power configuration registers */
508 twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0xC0, PROTECT_KEY); 508 twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0xC0, PROTECT_KEY);
509 twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0x0C, PROTECT_KEY); 509 twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0x0C, PROTECT_KEY);
510 510
511 /* put VUSB3V1 LDO in active state */ 511 /* put VUSB3V1 LDO in active state */
512 twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB_DEDICATED2); 512 twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB_DEDICATED2);
513 513
514 /* input to VUSB3V1 LDO is from VBAT, not VBUS */ 514 /* input to VUSB3V1 LDO is from VBAT, not VBUS */
515 twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x14, VUSB_DEDICATED1); 515 twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x14, VUSB_DEDICATED1);
516 516
517 /* Initialize 3.1V regulator */ 517 /* Initialize 3.1V regulator */
518 twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB3V1_DEV_GRP); 518 twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB3V1_DEV_GRP);
519 519
520 twl->usb3v1 = regulator_get(twl->dev, "usb3v1"); 520 twl->usb3v1 = regulator_get(twl->dev, "usb3v1");
521 if (IS_ERR(twl->usb3v1)) 521 if (IS_ERR(twl->usb3v1))
522 return -ENODEV; 522 return -ENODEV;
523 523
524 twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB3V1_TYPE); 524 twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB3V1_TYPE);
525 525
526 /* Initialize 1.5V regulator */ 526 /* Initialize 1.5V regulator */
527 twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB1V5_DEV_GRP); 527 twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB1V5_DEV_GRP);
528 528
529 twl->usb1v5 = regulator_get(twl->dev, "usb1v5"); 529 twl->usb1v5 = regulator_get(twl->dev, "usb1v5");
530 if (IS_ERR(twl->usb1v5)) 530 if (IS_ERR(twl->usb1v5))
531 goto fail1; 531 goto fail1;
532 532
533 twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB1V5_TYPE); 533 twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB1V5_TYPE);
534 534
535 /* Initialize 1.8V regulator */ 535 /* Initialize 1.8V regulator */
536 twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB1V8_DEV_GRP); 536 twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB1V8_DEV_GRP);
537 537
538 twl->usb1v8 = regulator_get(twl->dev, "usb1v8"); 538 twl->usb1v8 = regulator_get(twl->dev, "usb1v8");
539 if (IS_ERR(twl->usb1v8)) 539 if (IS_ERR(twl->usb1v8))
540 goto fail2; 540 goto fail2;
541 541
542 twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB1V8_TYPE); 542 twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB1V8_TYPE);
543 543
544 /* disable access to power configuration registers */ 544 /* disable access to power configuration registers */
545 twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0, PROTECT_KEY); 545 twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0, PROTECT_KEY);
546 546
547 return 0; 547 return 0;
548 548