Hi,
I'm getting a twl_reg twl_reg.7: can't register VMMC2, -22 error. What
could the reason be?
[ 14.808441] twl4030: PIH (irq 7) chaining IRQs 368..375
[ 14.808471] twl4030: power (irq 373) chaining IRQs 376..383
[ 14.808898] twl4030: gpio (irq 368) chaining IRQs 384..401
[ 14.812438] regulator: VUSB1V5: 1500 mV normal standby
[ 14.812957] regulator: VUSB1V8: 1800 mV normal standby
[ 14.813507] regulator: VUSB3V1: 3100 mV normal standby
[ 14.815338] twl4030_usb twl4030_usb: Initialized TWL4030 USB module
[ 14.816192] regulator: VMMC1: 1850 <--> 3150 mV normal standby
[ 14.816741] regulator: VDAC: 1800 mV normal standby
[ 14.817291] regulator: VPLL2: 1800 mV normal standby
[ 14.817932] regulator: VMMC2: 1850 mV normal standby
[ 14.818206] twl_reg twl_reg.7: can't register VMMC2, -22
[ 14.818237] twl_reg: probe of twl_reg.7 failed with error -22
[ 14.818878] regulator: VSIM: 1800 <--> 3000 mV normal standby
Here are some code snippets for the relevant modifications:
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c
b/arch/arm/mach-omap2/board-omap3beagle.c
index b23e9bb..04fc7ce 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -332,6 +334,15 @@ static struct twl4030_hsmmc_info mmc[] = {
.gpio_wp = -EINVAL,
.name = "MMC1"
},
+ {
+ .mmc = 2,
+ .wires = 4,
+ .gpio_cd = -EINVAL,
+ .gpio_wp = -EINVAL,
+ .nonremovable = true,
+ .power_saving = true,
+ .name = "wl1271",
+ },
{} /* Terminator */
};
@@ -339,6 +350,11 @@ static struct regulator_consumer_supply
beagle_vmmc1_supply = {
.supply = "vmmc",
};
+static struct regulator_consumer_supply beagle_vmmc2_supply = {
+ .supply = "vmmc",
+ .dev_name = "mmci-omap-hs.1",
+};
+
static struct regulator_consumer_supply beagle_vsim_supply = {
.supply = "vmmc_aux",
};
@@ -348,11 +364,18 @@ static struct gpio_led gpio_leds[];
static int beagle_twl_gpio_setup(struct device *dev,
unsigned gpio, unsigned ngpio)
{
+ /* The MMC controller that is connected to the wl1271 device
+ * should have the card detect gpio disabled. This is
+ * achieved by initializing it with a negative value.
+ */
+ mmc[CONFIG_TIWLAN_MMC_CONTROLLER - 1].gpio_cd = -EINVAL;
+
twl4030_mmc_init(mmc);
/* link regulators to MMC adapters */
beagle_vmmc1_supply.dev = mmc[0].dev;
beagle_vsim_supply.dev = mmc[0].dev;
+ beagle_vmmc2_supply.dev = mmc[1].dev;
return 0;
}
@@ -383,6 +406,21 @@ static struct regulator_init_data beagle_vmmc1 = {
.consumer_supplies = &beagle_vmmc1_supply,
};
+/* VMMC2 for MMC2 card */
+static struct regulator_init_data beagle_vmmc2 = {
+ .constraints = {
+ .min_uV = 1850000,
+ .max_uV = 1850000,
+ .apply_uV = true,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &beagle_vmmc2_supply,
+};
+
/* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */
static struct regulator_init_data beagle_vsim = {
.constraints = {
@@ -454,6 +492,7 @@ static struct twl4030_platform_data beagle_twldata = {
.codec = &beagle_codec_data,
.madc = &beagle_madc_data,
.vmmc1 = &beagle_vmmc1,
+ .vmmc2 = &beagle_vmmc2,
.vsim = &beagle_vsim,
.vdac = &beagle_vdac,
.vpll2 = &beagle_vpll2,
Best regards,
Elvis Dowson
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html