Understanding regulator_consumer_supply usage for LS240/WL1271 on 2.6.37

179 views
Skip to first unread message

Jaya Kumar

unread,
Aug 3, 2011, 6:26:47 AM8/3/11
to row...@googlegroups.com
Hi Rowboat experts,

I hope this question is not off-topic. I'm having difficulty
understanding the appropriate usage of regulator_consumer_supply. I
have an LS240 module that is powered via VBAT so it is always on and
it is interfaced to MMC3. I saw that on zoom this might be similar. So
I copied:

static struct regulator_consumer_supply wiser2_vmmc3_supply = {
.supply = "vmmc",
.dev_name = "mmci-omap-hs.2",
};

I don't yet understand why dev_name is setup that way but continuing on:

static struct regulator_init_data wiser2_vmmc3 = {
.constraints = {
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
},
.num_consumer_supplies = 1,
.consumer_supplies = &wiser2_vmmc3_supply,
};

#define WISER2_WLAN_PMENA_GPIO (16) // GPIO_16 is connected to
WL_EN of LS240
#define WISER2_WLAN_IRQ_GPIO (15)

static struct fixed_voltage_config wiser2_vwlan = {
.supply_name = "vwl1271",
.microvolts = 1800000, /* 1.80V */
// .gpio = WISER2_WLAN_PMENA_GPIO, // we don't have
a gpio to control regulator
.startup_delay = 70000, /* 70ms */
.enable_high = 1,
.enabled_at_boot = 0,
.init_data = &wiser2_vmmc3,
};

static struct platform_device wiser2_wlan_regulator = {
.name = "reg-fixed-voltage",
.id = 1,
.dev = {
.platform_data = &wiser2_vwlan,
},
};

struct wl12xx_platform_data wiser2_wlan_data __initdata = {
.irq = OMAP_GPIO_IRQ(WISER2_WLAN_IRQ_GPIO),
.board_ref_clock = WL12XX_REFCLOCK_38, /* 38.4 MHz */ // this is
wrong, I have a 32.768kHz slowclock but just setting this for now
};

/* WL12xx WLAN Init */
if (wl12xx_set_platform_data(&wiser2_wlan_data))
pr_err("error setting wl12xx data\n");
platform_device_register(&wiser2_wlan_regulator);

Unfortunately, this setup doesn't seem to work because we never get
into wl1271_probe of the wl12xx_sdio.ko, we only get to its
wl1271_init. I think the reason it doesn't get to the probe is because
it is failing out during the regulator setup, specifically:

[ 7.203643] mmci-omap-hs mmci-omap-hs.2: could not set regulator OCR (-22)

I thought this might be due to:
{
.name = "wl1271",
.mmc = 3,
.caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
.gpio_wp = -EINVAL,
.gpio_cd = -EINVAL,
.nonremovable = true,
},

So I took out MMC_CAP_POWER_OFF_CARD but this has no effect.

I was wondering if maybe I'm going about this in a wrong way. That is,
maybe I shouldn't be trying to copy the regulator based implementation
of omap3evm/zoom/pandora and should instead just setup
wl12xx_platform_data and directly have platform_device with .name
wl12xx?

I would really appreciate any advice on this.

Thanks,
jayakumar

2637_bootlog2.txt
board-omap3wiser2.c

belovictor

unread,
Sep 12, 2011, 3:30:37 PM9/12/11
to rowboat
Hi,

On Aug 3, 2:26 pm, Jaya Kumar <jayakumar.l...@gmail.com> wrote:
> [    7.203643] mmci-omap-hs mmci-omap-hs.2: could not set regulator OCR (-22)

This error is caused by incorrect kernel build configuration.
You need to add CONFIG_REGULATOR_FIXED_VOLTAGE=y to .config and
rebuild the kernel...

Best regards,
Victor Belov
Reply all
Reply to author
Forward
0 new messages