Re: [REPOST][PATCH] Fix IGEPv2 second MMC channel power supply

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

2010/12/4 Marc Zyngier <maz@xxxxxxxxxxxxxxx>:
> Commit 72f381ba056 (omap3: Remove VMMC2 regulator on IGEP v2)
> removed an unused regulator entry, but left the second MMC channel
> (used by the Libertas WLAN module) without link to power regulator.
> This causes the SDIO module to fail being detected.
>
> This patch adds the two regulators that actually feed the WLAN module
> (1v8 from the TWL4030 VIO LDO, and a fixed 3v3). With that patch, the
> second channel is properly detected. Details of the power supply
> implementation were kindly provided by Enric Balletbo i Serra.
>
> Also change vmmc1 to use symbolic names instead of direct device
> reference.
>
> Tested on an IGEPv2 Rev-B.
>
> Signed-off-by: Marc Zyngier <maz@xxxxxxxxxxxxxxx>
> Acked-by: Enric Balletbo i Serra <eballetbo@xxxxxxxxx>
> Cc: Tony Lindgren <tony@xxxxxxxxxxx>
> ---
> Âarch/arm/mach-omap2/board-igep0020.c | Â 61 ++++++++++++++++++++++++++++-----
> Â1 files changed, 51 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
> index 5e035a5..9a85e60 100644
> --- a/arch/arm/mach-omap2/board-igep0020.c
> +++ b/arch/arm/mach-omap2/board-igep0020.c
> @@ -19,6 +19,7 @@
> Â#include <linux/interrupt.h>
>
> Â#include <linux/regulator/machine.h>
> +#include <linux/regulator/fixed.h>
> Â#include <linux/i2c/twl.h>
> Â#include <linux/mmc/host.h>
>
> @@ -257,9 +258,8 @@ static inline void __init igep2_init_smsc911x(void) { }
> Âstatic struct omap_board_config_kernel igep2_config[] __initdata = {
> Â};
>
> -static struct regulator_consumer_supply igep2_vmmc1_supply = {
> -    .supply     = "vmmc",
> -};
> +static struct regulator_consumer_supply igep2_vmmc1_supply =
> + Â Â Â REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0");
>
> Â/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
> Âstatic struct regulator_init_data igep2_vmmc1 = {
> @@ -276,6 +276,52 @@ static struct regulator_init_data igep2_vmmc1 = {
>    Â.consumer_supplies   Â= &igep2_vmmc1_supply,
> Â};
>
> +static struct regulator_consumer_supply igep2_vio_supply =
> + Â Â Â REGULATOR_SUPPLY("vmmc_aux", "mmci-omap-hs.1");
> +
> +static struct regulator_init_data igep2_vio = {
> + Â Â Â .constraints = {
> + Â Â Â Â Â Â Â .min_uV Â Â Â Â Â Â Â Â = 1800000,
> + Â Â Â Â Â Â Â .max_uV Â Â Â Â Â Â Â Â = 1800000,
> + Â Â Â Â Â Â Â .apply_uV Â Â Â Â Â Â Â = 1,
> +        .valid_modes_mask    = REGULATOR_MODE_NORMAL
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â | REGULATOR_MODE_STANDBY,
> +        .valid_ops_mask     = REGULATOR_CHANGE_VOLTAGE
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â | REGULATOR_CHANGE_MODE
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â | REGULATOR_CHANGE_STATUS,
> + Â Â Â },
> + Â Â Â .num_consumer_supplies Â= 1,
> +    .consumer_supplies   Â= &igep2_vio_supply,
> +};
> +
> +static struct regulator_consumer_supply igep2_vmmc2_supply =
> + Â Â Â REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1");
> +
> +static struct regulator_init_data igep2_vmmc2 = {
> +    .constraints      Â= {
> +        .valid_modes_mask    = REGULATOR_MODE_NORMAL,
> +        .always_on       Â= 1,
> + Â Â Â },
> + Â Â Â .num_consumer_supplies Â= 1,
> +    .consumer_supplies   Â= &igep2_vmmc2_supply,
> +};
> +
> +static struct fixed_voltage_config igep2_vwlan = {
> +    .supply_name      Â= "vwlan",
> +    .microvolts       = 3300000,
> +    .gpio          = -EINVAL,
> +    .enabled_at_boot    Â= 1,
> +    .init_data       Â= &igep2_vmmc2,
> +};
> +
> +static struct platform_device igep2_vwlan_device = {
> +    .name      = "reg-fixed-voltage",
> +    .id       = 0,
> + Â Â Â .dev = {
> + Â Â Â Â Â Â Â .platform_data Â= &igep2_vwlan,
> + Â Â Â },
> +};
> +
> Âstatic struct omap2_hsmmc_info mmc[] = {
> Â Â Â Â{
>        Â.mmc      Â= 1,
> @@ -373,12 +419,6 @@ static int igep2_twl_gpio_setup(struct device *dev,
> Â Â Â Âomap2_hsmmc_init(mmc);
>
> Â Â Â Â/*
> - Â Â Â Â* link regulators to MMC adapters ... we "know" the
> - Â Â Â Â* regulators will be set up only *after* we return.
> - Â Â Â Â*/
> - Â Â Â igep2_vmmc1_supply.dev = mmc[0].dev;
> -
> - Â Â Â /*
> Â Â Â Â * REVISIT: need ehci-omap hooks for external VBUS
> Â Â Â Â * power switch and overcurrent detect
> Â Â Â Â */
> @@ -489,6 +529,7 @@ static void __init igep2_display_init(void)
>
> Âstatic struct platform_device *igep2_devices[] __initdata = {
> Â Â Â Â&igep2_dss_device,
> + Â Â Â &igep2_vwlan_device,
> Â};
>
> Âstatic void __init igep2_init_irq(void)
> @@ -519,7 +560,7 @@ static struct twl4030_platform_data igep2_twldata = {
>    Â.gpio      = &igep2_twl4030_gpio_pdata,
> Â Â Â Â.vmmc1 Â Â Â Â Â= &igep2_vmmc1,
> Â Â Â Â.vpll2 Â Â Â Â Â= &igep2_vpll2,
> -
> +    .vio      Â= &igep2_vio,
> Â};
>
> Âstatic struct i2c_board_info __initdata igep2_i2c1_boardinfo[] = {
> --
> 1.7.3.2
>
>

Tony, please can this patch be included before 2.6.37 ? Without this
patch the wifi module on IGEP v2 board not works.

Thanks,
   Enric Balletbo i Serra.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux