RE: [PATCH 2/4] MMC/SD: Add callback function to detect card

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

 



> >>>>
> >>>> You patch uses (SDHCI_CARD_PRESENT | SDHCI_CARD_CDPL) Does that
> >>>> mean SDHCI_CARD_CDPL does work in that case?
> >>> No.
> >>> The SDHCI_CARD_CDPL[bit13] reflect the pin level:
> >>> CDPL: Card detect pin level. This bit reflects the inverse value of
> >>> the
> >> SDHC_CD pin for the card socket.
> >>> 0 No card present (SDHC_CD = 1)
> >>> 1 Card present (SDHC_CD = 0)
> >>>
> >>> So, this bit has the same effect as SDHCI_CARD_PRESENT[bit15], the
> >> difference is that debouncing is not performed on this bit.
> >>>
> >>> Freescale's controller supports the card detection, if card is
> >>> present,
> >> none-zero will be returned, otherwise, zero will be returned.
> >>>
> >>> You can see my other patch [3/4], I add one callback to detect the
> >>> card
> >> state in special platform: if the controller supports card detection,
> >> this callback will be performed in special platform (e.g. sdhci-of-
> >> esdhc.c) and return the card state (present or absent), if controller
> >> doesn't support card detection, this callback will be not performed
> >> and return -ENOSYS.
> >>
> >> OK, but the point is, the request can be stopped in sdhci_request().
> >> Can you just add your callback there?
> > Why can the request be stopped? Just because of card absent or
> SDHCI_DEVICE_DEAD?
> 
> Yes, both
> 
This function is to request command to the card, if callback is added here,
it just replaces the code:
present = sdhci_readl(host, SDHCI_PRESENT_STATE) &
                                SDHCI_CARD_PRESENT;
When SDHCI_QUIRK_BROKEN_CARD_DETECTION option is valid or the card is always present,
This will affect the performance because the driver always ask the card preset state
When card is present.
So I think the best way is to detect the card before performing the mmc_send_status function.


--
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