Re: [PATCH v2 3/5] OMAP4-HSMMC: Adding MMC-TWL regulator changes

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

 



<<snip>>

> As I understand it, the PBIAS configuration is required for HSMMC
> irrespective of how the power is supplied, thus it is not TWL related.
> The TWL stuff should not be in hsmmc.c.
>
> Also I would suggest the only change to omap_hsmmc is:
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index e9caf69..f792cff 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -465,8 +465,6 @@ static int omap_hsmmc_gpio_init(struct
> omap_mmc_platform_data *pdata)
>       int ret;
>
>       if (gpio_is_valid(pdata->slots[0].switch_pin)) {
> -               pdata->suspend = omap_hsmmc_suspend_cdirq;
> -               pdata->resume = omap_hsmmc_resume_cdirq;
>               if (pdata->slots[0].cover)
>                       pdata->slots[0].get_cover_state =
>                                       omap_hsmmc_get_cover_state;
> @@ -2160,6 +2158,8 @@ static int __init omap_hsmmc_probe(struct
> platform_device *pdev)
>                               "Unable to grab MMC CD IRQ\n");
>                       goto err_irq_cd;
>               }
> +               pdata->suspend = omap_hsmmc_suspend_cdirq;
> +               pdata->resume = omap_hsmmc_resume_cdirq;
>       }
>
>       OMAP_HSMMC_WRITE(host->base, ISE, INT_EN_MASK);
>
>
> And that the late init function is used to do the rest e.g.
> find a home for these 3 functions:
>
> static int omap4_twl6030_hsmmc_late_init(struct device *dev)
> {
>        int ret = 0;
>        struct platform_device *pdev = container_of(dev,
>                                        struct platform_device, dev);
>        struct omap_mmc_platform_data *pdata = dev->platform_data;
>
>        /* MMC1 Card detect Configuration */
>        if (pdev->id == 0) {
>                ret = omap4_hsmmc1_card_detect_config();
>                if (ret < 0)
>                        pr_err("Unable to configure Card detect for MMC1\n");
>                pdata->slots[0].card_detect = twl6030_mmc_card_detect;
>                pdata->slots[0].card_detect_irq = TWL6030_IRQ_BASE +
>                                                  MMCDETECT_INTR_OFFSET;
>        }
>        return ret;
> }
>
> static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev)
> {
>        struct omap_mmc_platform_data *pdata = dev->platform_data;
>
>        pdata->init = omap4_twl6030_hsmmc_late_init;
> }
>
> void __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers)
> {
>        struct omap2_hsmmc_info *c;
>
>        omap2_hsmmc_init(controllers);
>
>        for (c = controllers; c->mmc; c++)
>                omap4_twl6030_hsmmc_set_late_init(c->dev);
> }
>
> And then the board file becomes:
>
> static struct omap2_hsmmc_info mmc[] = {
>        {
>                .mmc            = 1,
>                .wires          = 8,
>                .gpio_cd        = -EINVAL,
>                .gpio_wp        = -EINVAL,
>        },
>        {
>                .mmc            = 2,
>                .wires          = 8,
>                .gpio_cd        = -EINVAL,
>                .gpio_wp        = -EINVAL,
>                .nonremovable   = true,
>        },
>        {}      /* Terminator */
> };
>
> static struct regulator_consumer_supply sdp4430_vmmc_supply[] = {
>        {
>                .supply         = "vmmc",
>                .dev_name       = "mmci-omap-hs.0",
>        },
>        {
>                .supply         = "vmmc",
>                .dev_name       = "mmci-omap-hs.1",
>        },
> };
>
> static int __init sdp4430_mmc_init(void)
> {
>        omap4_twl6030_hsmmc_init(mmc);
>        return 0;
> }
>

Thanks Adrian !
Agree and will move changes to board-4430 file
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux