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 goto out; 463 } 464 465 - mmc = mmc_alloc_host(sizeof(*mmc), &pdev->dev); 466 if (!mmc) { 467 ret = -ENOMEM; 468 goto out;
··· 462 goto out; 463 } 464 465 + mmc = mmc_alloc_host(sizeof(struct sdh_host), &pdev->dev); 466 if (!mmc) { 467 ret = -ENOMEM; 468 goto out;
+3 -2
drivers/mmc/host/jz4740_mmc.c
··· 14 */ 15 16 #include <linux/mmc/host.h> 17 #include <linux/io.h> 18 #include <linux/irq.h> 19 #include <linux/interrupt.h> ··· 828 } 829 830 host->clk = clk_get(&pdev->dev, "mmc"); 831 - if (!host->clk) { 832 - ret = -ENOENT; 833 dev_err(&pdev->dev, "Failed to get mmc clock\n"); 834 goto err_free_host; 835 }
··· 14 */ 15 16 #include <linux/mmc/host.h> 17 + #include <linux/err.h> 18 #include <linux/io.h> 19 #include <linux/irq.h> 20 #include <linux/interrupt.h> ··· 827 } 828 829 host->clk = clk_get(&pdev->dev, "mmc"); 830 + if (IS_ERR(host->clk)) { 831 + ret = PTR_ERR(host->clk); 832 dev_err(&pdev->dev, "Failed to get mmc clock\n"); 833 goto err_free_host; 834 }
+5 -5
drivers/mmc/host/mmci.c
··· 342 343 host->cmd = NULL; 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 if (status & MCI_CMDTIMEOUT) { 351 cmd->error = -ETIMEDOUT; 352 } else if (status & MCI_CMDCRCFAIL && cmd->flags & MMC_RSP_CRC) { 353 cmd->error = -EILSEQ; 354 } 355 356 if (!cmd->data || cmd->error) {
··· 342 343 host->cmd = NULL; 344 345 if (status & MCI_CMDTIMEOUT) { 346 cmd->error = -ETIMEDOUT; 347 } else if (status & MCI_CMDCRCFAIL && cmd->flags & MMC_RSP_CRC) { 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 } 355 356 if (!cmd->data || cmd->error) {
+36
drivers/mmc/host/sdhci-s3c.c
··· 277 host->clock = clock; 278 } 279 280 static struct sdhci_ops sdhci_s3c_ops = { 281 .get_max_clock = sdhci_s3c_get_max_clk, 282 .set_clock = sdhci_s3c_set_clock, 283 .get_min_clock = sdhci_s3c_get_min_clock, 284 }; 285 286 static void sdhci_s3c_notify_change(struct platform_device *dev, int state) ··· 505 506 if (pdata->cd_type == S3C_SDHCI_CD_PERMANENT) 507 host->mmc->caps = MMC_CAP_NONREMOVABLE; 508 509 host->quirks |= (SDHCI_QUIRK_32BIT_DMA_ADDR | 510 SDHCI_QUIRK_32BIT_DMA_SIZE);
··· 277 host->clock = clock; 278 } 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 + 312 static struct sdhci_ops sdhci_s3c_ops = { 313 .get_max_clock = sdhci_s3c_get_max_clk, 314 .set_clock = sdhci_s3c_set_clock, 315 .get_min_clock = sdhci_s3c_get_min_clock, 316 + .platform_8bit_width = sdhci_s3c_platform_8bit_width, 317 }; 318 319 static void sdhci_s3c_notify_change(struct platform_device *dev, int state) ··· 472 473 if (pdata->cd_type == S3C_SDHCI_CD_PERMANENT) 474 host->mmc->caps = MMC_CAP_NONREMOVABLE; 475 + 476 + if (pdata->host_caps) 477 + host->mmc->caps |= pdata->host_caps; 478 479 host->quirks |= (SDHCI_QUIRK_32BIT_DMA_ADDR | 480 SDHCI_QUIRK_32BIT_DMA_SIZE);
-1
drivers/mmc/host/ushc.c
··· 19 #include <linux/module.h> 20 #include <linux/usb.h> 21 #include <linux/kernel.h> 22 - #include <linux/usb.h> 23 #include <linux/slab.h> 24 #include <linux/dma-mapping.h> 25 #include <linux/mmc/host.h>
··· 19 #include <linux/module.h> 20 #include <linux/usb.h> 21 #include <linux/kernel.h> 22 #include <linux/slab.h> 23 #include <linux/dma-mapping.h> 24 #include <linux/mmc/host.h>