Provide the set_power at TWL4030 MMC
Subsystems (3)
PATCH 1/1 Provide the set_power at TWL4030 MMC
Custom board powered by VAUX2 and VAUX4 for MMC instead of VMMC Also it uses VMMC for MMC core power not voltage.
MMC1: uses VMMC1(voltage) and VMMC2(Vdd)
MMC2: uses VAUX2(voltage) and VAUX4(Vdd)
To address this issue, platform uses its custom power function.
---
arch/arm/mach-omap2/mmc-twl4030.c +9 -24
@@ -27,28 +27,6 @@#if defined(CONFIG_MMC_OMAP_HS ) || defined(CONFIG_MMC_OMAP_HS_MODULE ) -#define LDO_CLR 0x00 -#define VSEL_S2_CLR 0x40 - -#define VMMC1_DEV_GRP 0x27 -#define VMMC1_CLR 0x00 -#define VMMC1_315V 0x03 -#define VMMC1_300V 0x02 -#define VMMC1_285V 0x01 -#define VMMC1_185V 0x00 -#define VMMC1_DEDICATED 0x2A - -#define VMMC2_DEV_GRP 0x2B -#define VMMC2_CLR 0x40 -#define VMMC2_315V 0x0c -#define VMMC2_300V 0x0b -#define VMMC2_285V 0x0a -#define VMMC2_260V 0x08 -#define VMMC2_185V 0x06 -#define VMMC2_DEDICATED 0x2E - -#define VMMC_DEV_GRP_P1 0x20 -static u16 control_pbias_offset;static u16 control_devconf1_offset;
@@ -385,14 +363,21 @@ void __init hsmmc_init(struct twl4030_hsmmc_info *controllers)/* NOTE: we assume OMAP's MMC1 and MMC2 use * the TWL4030's VMMC1 and VMMC2, respectively; * and that OMAP's MMC3 isn't used. +* or provided by a platform. */ switch (c->mmc) {case 1 : - mmc->slots[0 ].set_power = twl_mmc1_set_power; +if (c->set_power) + mmc->slots[0 ].set_power = c->set_power; +else + mmc->slots[0 ].set_power = twl_mmc1_set_power;break ;case 2 : - mmc->slots[0 ].set_power = twl_mmc2_set_power; +if (c->set_power) + mmc->slots[0 ].set_power = c->set_power; +else + mmc->slots[0 ].set_power = twl_mmc2_set_power;break ;default :pr_err ("MMC%d configuration not supported!\n" , c->mmc);
arch/arm/mach-omap2/mmc-twl4030.h +43 -0
55 lines not on this page · raw message
Quoted 7 lines · Kyungmin Park
Custom board powered by VAUX2 and VAUX4 for MMC instead of VMMC Also it uses VMMC for MMC core power not voltage.
MMC1: uses VMMC1(voltage) and VMMC2(Vdd)
MMC2: uses VAUX2(voltage) and VAUX4(Vdd)To address this issue, platform uses its custom power function.
It would be a lot cleaner to do this with the regulator framework ... e.g. board init code associates each MMC controller with a few regulators using logical IDs, and the HSMMC glue just uses those regulators.
- Dave
Tony Lindgren
maintainerQuoted 7 lines · David Brownell
Quoted 6 lines · Kyungmin Park
Custom board powered by VAUX2 and VAUX4 for MMC instead of VMMC Also it uses VMMC for MMC core power not voltage.
MMC1: uses VMMC1(voltage) and VMMC2(Vdd)
MMC2: uses VAUX2(voltage) and VAUX4(Vdd)
Quoted 6 lines
Quoted 1 line
To address this issue, platform uses its custom power function.
It would be a lot cleaner to do this with the regulator framework ... e.g. board init code associates each MMC controller with a few regulators using logical IDs, and the HSMMC glue just uses those regulators.
Let's hold on with this patch until we first have the pending patches in the mainline, and can then convert the existing code to use regulator fwk. Then let's update this patch and apply it.
Regards,
Tony