diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/host/mmc_spi.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c index 35508584ac2a..547eb857b1b3 100644 --- a/drivers/mmc/host/mmc_spi.c +++ b/drivers/mmc/host/mmc_spi.c | |||
@@ -1131,11 +1131,20 @@ static int mmc_spi_get_ro(struct mmc_host *mmc) | |||
1131 | return 0; | 1131 | return 0; |
1132 | } | 1132 | } |
1133 | 1133 | ||
1134 | static int mmc_spi_get_cd(struct mmc_host *mmc) | ||
1135 | { | ||
1136 | struct mmc_spi_host *host = mmc_priv(mmc); | ||
1137 | |||
1138 | if (host->pdata && host->pdata->get_cd) | ||
1139 | return !!host->pdata->get_cd(mmc->parent); | ||
1140 | return -ENOSYS; | ||
1141 | } | ||
1134 | 1142 | ||
1135 | static const struct mmc_host_ops mmc_spi_ops = { | 1143 | static const struct mmc_host_ops mmc_spi_ops = { |
1136 | .request = mmc_spi_request, | 1144 | .request = mmc_spi_request, |
1137 | .set_ios = mmc_spi_set_ios, | 1145 | .set_ios = mmc_spi_set_ios, |
1138 | .get_ro = mmc_spi_get_ro, | 1146 | .get_ro = mmc_spi_get_ro, |
1147 | .get_cd = mmc_spi_get_cd, | ||
1139 | }; | 1148 | }; |
1140 | 1149 | ||
1141 | 1150 | ||
@@ -1319,17 +1328,23 @@ static int mmc_spi_probe(struct spi_device *spi) | |||
1319 | goto fail_glue_init; | 1328 | goto fail_glue_init; |
1320 | } | 1329 | } |
1321 | 1330 | ||
1331 | /* pass platform capabilities, if any */ | ||
1332 | if (host->pdata) | ||
1333 | mmc->caps |= host->pdata->caps; | ||
1334 | |||
1322 | status = mmc_add_host(mmc); | 1335 | status = mmc_add_host(mmc); |
1323 | if (status != 0) | 1336 | if (status != 0) |
1324 | goto fail_add_host; | 1337 | goto fail_add_host; |
1325 | 1338 | ||
1326 | dev_info(&spi->dev, "SD/MMC host %s%s%s%s\n", | 1339 | dev_info(&spi->dev, "SD/MMC host %s%s%s%s%s\n", |
1327 | mmc->class_dev.bus_id, | 1340 | mmc->class_dev.bus_id, |
1328 | host->dma_dev ? "" : ", no DMA", | 1341 | host->dma_dev ? "" : ", no DMA", |
1329 | (host->pdata && host->pdata->get_ro) | 1342 | (host->pdata && host->pdata->get_ro) |
1330 | ? "" : ", no WP", | 1343 | ? "" : ", no WP", |
1331 | (host->pdata && host->pdata->setpower) | 1344 | (host->pdata && host->pdata->setpower) |
1332 | ? "" : ", no poweroff"); | 1345 | ? "" : ", no poweroff", |
1346 | (mmc->caps & MMC_CAP_NEEDS_POLL) | ||
1347 | ? ", cd polling" : ""); | ||
1333 | return 0; | 1348 | return 0; |
1334 | 1349 | ||
1335 | fail_add_host: | 1350 | fail_add_host: |