if (unlikely(reg == SDHCI_PRESENT_STATE)) {
if (boarddata && boarddata->always_present)
val |= SDHCI_CARD_PRESENT;
else if (imx_data->flags & ESDHC_FLAG_GPIO_FOR_CD_WP) {
if (boarddata && gpio_is_valid(boarddata->cd_gpio)
&& gpio_get_value(boarddata->cd_gpio))
/* no card, if a valid gpio says so */
val &= ~SDHCI_CARD_PRESENT;
else
/* in all other cases assume card is present */
val |= SDHCI_CARD_PRESENT;
}
}