On Thu, Sep 29, 2011 at 5:49 AM, Shashidhar Hiremath
<shashidh...@vayavyalabs.com> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to