No subject


Mon Jun 27 16:47:34 EDT 2011


_________________________________________
static struct regulator_consumer_supply omap4_panda_vmmc5_supply = {
        .supply = "vmmc",
        .dev_name = "omap_hsmmc.4",
};

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

static struct fixed_voltage_config panda_vwlan = {
        .supply_name = "vwl1271",
        .microvolts = 1800000, /* 1.8V */
        .gpio = GPIO_WIFI_PMENA,
        .startup_delay = 70000, /* 70msec */
        .enable_high = 1,
        .enabled_at_boot = 0,
        .init_data = &panda_vmmc5,
};

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

If this can't work for you, can you list why in the change log.

If your mmc controller doesn't yet support vmmc control. It should
be very easy to add it first.

Thanks.


> +	} else {
> +		gpio_set_value(DA850_WLAN_EN, 0);
> +	}
> +}
> +
> +static struct davinci_mmc_config da850_wl12xx_mmc_config = {
> +	.set_power	= wl12xx_set_power,
> +	.wires		= 4,
> +	.max_freq	= 25000000,
> +	.caps		= MMC_CAP_4_BIT_DATA | MMC_CAP_NONREMOVABLE |
> +			  MMC_CAP_POWER_OFF_CARD,
> +	.version	= MMC_CTLR_VERSION_2,
> +};
> +
> +static const short da850_wl12xx_pins[] __initconst = {
> +	DA850_MMCSD1_DAT_0, DA850_MMCSD1_DAT_1, DA850_MMCSD1_DAT_2,
> +	DA850_MMCSD1_DAT_3, DA850_MMCSD1_CLK, DA850_MMCSD1_CMD,
> +	DA850_GPIO6_9, DA850_GPIO6_10,
> +	-1
> +};
> +
> +static struct wl12xx_platform_data da850_wl12xx_wlan_data __initdata = {
> +	.irq			= -1,
> +	.board_ref_clock	= WL12XX_REFCLOCK_38,
> +	.platform_quirks	= WL12XX_PLATFORM_QUIRK_EDGE_IRQ,
> +};
> +
> +static __init int da850_wl12xx_init(void)
> +{
> +	int ret;
> +
> +	ret = davinci_cfg_reg_list(da850_wl12xx_pins);
> +	if (ret) {
> +		pr_err("wl12xx/mmc mux setup failed: %d\n", ret);
> +		goto exit;
> +	}
> +
> +	ret = da850_register_mmcsd1(&da850_wl12xx_mmc_config);
> +	if (ret) {
> +		pr_err("wl12xx/mmc registration failed: %d\n", ret);
> +		goto exit;
> +	}
> +
> +	ret = gpio_request_one(DA850_WLAN_EN, GPIOF_OUT_INIT_LOW, "wl12xx_en");
> +	if (ret) {
> +		pr_err("Could not request wl12xx enable gpio: %d\n", ret);
> +		goto exit;
> +	}
> +
> +	ret = gpio_request_one(DA850_WLAN_IRQ, GPIOF_IN, "wl12xx_irq");
> +	if (ret) {
> +		pr_err("Could not request wl12xx irq gpio: %d\n", ret);
> +		goto free_wlan_en;
> +	}
> +
> +	da850_wl12xx_wlan_data.irq = gpio_to_irq(DA850_WLAN_IRQ);
> +
> +	ret = wl12xx_set_platform_data(&da850_wl12xx_wlan_data);
> +	if (ret) {
> +		pr_err("Could not set wl12xx data: %d\n", ret);
> +		goto free_wlan_irq;
> +	}
> +
> +	return 0;
> +
> +free_wlan_irq:
> +	gpio_free(DA850_WLAN_IRQ);
> +
> +free_wlan_en:
> +	gpio_free(DA850_WLAN_EN);
> +
> +exit:
> +	return ret;
> +}
> +
> +#else /* CONFIG_DA850_WL12XX */
> +
> +static __init int da850_wl12xx_init(void)
> +{
> +	return 0;
> +}
> +
> +#endif /* CONFIG_DA850_WL12XX */
> +
>  #define DA850EVM_SATA_REFCLKPN_RATE	(100 * 1000 * 1000)
>  
>  static __init void da850_evm_init(void)
> @@ -1171,6 +1280,11 @@ static __init void da850_evm_init(void)
>  		if (ret)
>  			pr_warning("da850_evm_init: mmcsd0 registration failed:"
>  					" %d\n", ret);
> +
> +		ret = da850_wl12xx_init();
> +		if (ret)
> +			pr_warning("da850_evm_init: wl12xx initialization"
> +				   " failed: %d\n", ret);
>  	}
>  
>  	davinci_serial_init(&da850_evm_uart_config);




More information about the linux-arm-kernel mailing list