Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc:
mmc: bfin_sdh: fix alloc size for private data
mmc: sdhci-s3c: add platform_8bit_width() hook
mmc: jz4740: don't treat NULL clk as an error
mmc: mmci: don't read command response when invalid
mmc: ushc: Remove duplicate include of usb.h

+45 -9
+1 -1
drivers/mmc/host/bfin_sdh.c
··· 462 462 goto out; 463 463 } 464 464 465 - mmc = mmc_alloc_host(sizeof(*mmc), &pdev->dev); 465 + mmc = mmc_alloc_host(sizeof(struct sdh_host), &pdev->dev); 466 466 if (!mmc) { 467 467 ret = -ENOMEM; 468 468 goto out;
+3 -2
drivers/mmc/host/jz4740_mmc.c
··· 14 14 */ 15 15 16 16 #include <linux/mmc/host.h> 17 + #include <linux/err.h> 17 18 #include <linux/io.h> 18 19 #include <linux/irq.h> 19 20 #include <linux/interrupt.h> ··· 828 827 } 829 828 830 829 host->clk = clk_get(&pdev->dev, "mmc"); 831 - if (!host->clk) { 832 - ret = -ENOENT; 830 + if (IS_ERR(host->clk)) { 831 + ret = PTR_ERR(host->clk); 833 832 dev_err(&pdev->dev, "Failed to get mmc clock\n"); 834 833 goto err_free_host; 835 834 }
+5 -5
drivers/mmc/host/mmci.c
··· 342 342 343 343 host->cmd = NULL; 344 344 345 - cmd->resp[0] = readl(base + MMCIRESPONSE0); 346 - cmd->resp[1] = readl(base + MMCIRESPONSE1); 347 - cmd->resp[2] = readl(base + MMCIRESPONSE2); 348 - cmd->resp[3] = readl(base + MMCIRESPONSE3); 349 - 350 345 if (status & MCI_CMDTIMEOUT) { 351 346 cmd->error = -ETIMEDOUT; 352 347 } else if (status & MCI_CMDCRCFAIL && cmd->flags & MMC_RSP_CRC) { 353 348 cmd->error = -EILSEQ; 349 + } else { 350 + cmd->resp[0] = readl(base + MMCIRESPONSE0); 351 + cmd->resp[1] = readl(base + MMCIRESPONSE1); 352 + cmd->resp[2] = readl(base + MMCIRESPONSE2); 353 + cmd->resp[3] = readl(base + MMCIRESPONSE3); 354 354 } 355 355 356 356 if (!cmd->data || cmd->error) {
+36
drivers/mmc/host/sdhci-s3c.c
··· 277 277 host->clock = clock; 278 278 } 279 279 280 + /** 281 + * sdhci_s3c_platform_8bit_width - support 8bit buswidth 282 + * @host: The SDHCI host being queried 283 + * @width: MMC_BUS_WIDTH_ macro for the bus width being requested 284 + * 285 + * We have 8-bit width support but is not a v3 controller. 286 + * So we add platform_8bit_width() and support 8bit width. 287 + */ 288 + static int sdhci_s3c_platform_8bit_width(struct sdhci_host *host, int width) 289 + { 290 + u8 ctrl; 291 + 292 + ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL); 293 + 294 + switch (width) { 295 + case MMC_BUS_WIDTH_8: 296 + ctrl |= SDHCI_CTRL_8BITBUS; 297 + ctrl &= ~SDHCI_CTRL_4BITBUS; 298 + break; 299 + case MMC_BUS_WIDTH_4: 300 + ctrl |= SDHCI_CTRL_4BITBUS; 301 + ctrl &= ~SDHCI_CTRL_8BITBUS; 302 + break; 303 + default: 304 + break; 305 + } 306 + 307 + sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL); 308 + 309 + return 0; 310 + } 311 + 280 312 static struct sdhci_ops sdhci_s3c_ops = { 281 313 .get_max_clock = sdhci_s3c_get_max_clk, 282 314 .set_clock = sdhci_s3c_set_clock, 283 315 .get_min_clock = sdhci_s3c_get_min_clock, 316 + .platform_8bit_width = sdhci_s3c_platform_8bit_width, 284 317 }; 285 318 286 319 static void sdhci_s3c_notify_change(struct platform_device *dev, int state) ··· 505 472 506 473 if (pdata->cd_type == S3C_SDHCI_CD_PERMANENT) 507 474 host->mmc->caps = MMC_CAP_NONREMOVABLE; 475 + 476 + if (pdata->host_caps) 477 + host->mmc->caps |= pdata->host_caps; 508 478 509 479 host->quirks |= (SDHCI_QUIRK_32BIT_DMA_ADDR | 510 480 SDHCI_QUIRK_32BIT_DMA_SIZE);
-1
drivers/mmc/host/ushc.c
··· 19 19 #include <linux/module.h> 20 20 #include <linux/usb.h> 21 21 #include <linux/kernel.h> 22 - #include <linux/usb.h> 23 22 #include <linux/slab.h> 24 23 #include <linux/dma-mapping.h> 25 24 #include <linux/mmc/host.h>