Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 137495
b: refs/heads/master
c: 034ae7b
h: refs/heads/master
i:
  137493: 0865271
  137491: 12c4bb3
  137487: 3d6a872
v: v3
  • Loading branch information
David Brownell authored and Tony Lindgren committed Mar 24, 2009
1 parent d1e40b8 commit 98e630f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 07d83cc9c839a5f05c7c1b6d823a8f483bda0441
refs/heads/master: 034ae7b41720a26cadd4b2f02bf0b23e79240344
18 changes: 10 additions & 8 deletions trunk/arch/arm/mach-omap2/mmc-twl4030.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ static int twl_mmc_resume(struct device *dev, int slot)
static int twl_mmc_set_voltage(struct twl_mmc_controller *c, int vdd)
{
int ret;
u8 vmmc, dev_grp_val;
u8 vmmc = 0, dev_grp_val;

if (!vdd)
goto doit;

if (c->twl_vmmc_dev_grp == VMMC1_DEV_GRP) {
/* VMMC1: max 220 mA. And for 8-bit mode,
Expand All @@ -203,8 +206,7 @@ static int twl_mmc_set_voltage(struct twl_mmc_controller *c, int vdd)
/* error if VSIM needed */
break;
default:
vmmc = 0;
break;
return -EINVAL;
}
} else if (c->twl_vmmc_dev_grp == VMMC2_DEV_GRP) {
/* VMMC2: max 100 mA */
Expand All @@ -230,21 +232,21 @@ static int twl_mmc_set_voltage(struct twl_mmc_controller *c, int vdd)
vmmc = VMMC2_315V;
break;
default:
vmmc = 0;
break;
return -EINVAL;
}
} else {
return 0;
return -EINVAL;
}

if (vmmc)
doit:
if (vdd)
dev_grp_val = VMMC_DEV_GRP_P1; /* Power up */
else
dev_grp_val = LDO_CLR; /* Power down */

ret = twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
dev_grp_val, c->twl_vmmc_dev_grp);
if (ret)
if (ret || !vdd)
return ret;

ret = twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
Expand Down

0 comments on commit 98e630f

Please sign in to comment.