Re: [PATCH 1/1] mmc: Support of PCI mode for the dw_mmc driver This Patch adds the support for the scenario where the Synopsys Designware IP is present on the PCI bus.The patch adds the minimal modifications necessary for the driver to work on PCI pl

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

 



Hi Will,James,
When I looked at few examples of the pci platform support in kernel,I
could find that they have used separate files for pci and platform.I
feel I may not split the driver into 3 files since its not as complex
as sdhci driver.So can I merge the ifdefs and have separate functions
itself for pci and non-pci platforms instead of having ifdef's in each
function ?

On Thu, Sep 29, 2011 at 2:54 PM, Will Newton <will.newton@xxxxxxxxx> wrote:
>
> On Thu, Sep 29, 2011 at 5:49 AM, Shashidhar Hiremath
> <shashidharh@xxxxxxxxxxxxxxx> wrote:
> >>> +       .detect_delay_ms                = 200,
> >>> +       .fifo_depth                     = 32,
> >>> +};
> >>> +#endif
> >>> +
> >>>  static struct workqueue_struct *dw_mci_card_workqueue;
> >>>
> >>>  #if defined(CONFIG_DEBUG_FS)
> >>> @@ -682,6 +698,9 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> >>>  {
> >>>        struct dw_mci_slot *slot = mmc_priv(mmc);
> >>>        u32 regs;
> >>> +#ifdef CONFIG_MMC_DW_PCI
> >>> +       u32 card_detect;
> >>> +#endif
> >>>
> >>>        /* set default 1 bit mode */
> >>>        slot->ctype = SDMMC_CTYPE_1BIT;
> >>> @@ -716,7 +735,15 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> >>>        switch (ios->power_mode) {
> >>>        case MMC_POWER_UP:
> >>>                set_bit(DW_MMC_CARD_NEED_INIT, &slot->flags);
> >>> +#ifdef CONFIG_MMC_DW_PCI
> >>> +               /* Enable Power to the card that has been detected */
> >>> +               card_detect = mci_readl(slot->host, CDETECT);
> >>> +               mci_writel(slot->host, PWREN, ((~card_detect) & 0x1));
> >>> +               break;
> >>> +       case MMC_POWER_OFF:
> >>> +               mci_writel(slot->host, PWREN, 0);
> >>>                break;
> >>> +#endif
> >>
> >> It may be safe to not #ifdef this, all the hardware I have uses an
> >> external regulator so the PWREN bits do nothing. I could imagine
> >> hardware that was non-PCI that could use PWREN however.
> > The hardware that I was using required this to be done .else there was
> > not power to the card.
>
> I think it is safe to remove the #ifdef from around this block though
> - for devices with external regulators setting PWREN does nothing so
> it should be safe to do it unconditionally.



--
regards,
Shashidhar Hiremath
--
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