Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/drzeus/mmc

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc:
  mmc_spi: support for non-byte-aligned cards
  omap_hsmmc: Do not expect cmd/data to be non-null when CC/TC occurs
  mmc: Fix compile for omap_hsmmc.c
  mmc_spi: convert timeout handling to jiffies and avoid busy waiting
  mmc_spi: do not check CID and CSD blocks with CRC16
  omap_hsmmc: Flush posted write to IRQ
  New mail address for Pierre Ossman
  imxmmc: move RSSR BLR
  imxmmc: init-exit rework
  mmc: Accept EXT_CSD rev 1.3 since it is backwards compatible with 1.2
  • Loading branch information
Linus Torvalds committed Apr 8, 2009
2 parents 7831d56 + ab5a643 commit d2e2d7c
Show file tree
Hide file tree
Showing 9 changed files with 164 additions and 85 deletions.
6 changes: 3 additions & 3 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3057,7 +3057,7 @@ S: Supported

MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND SDIO SUBSYSTEM
P: Pierre Ossman
M: drzeus-mmc@drzeus.cx
M: pierre@ossman.eu
L: linux-kernel@vger.kernel.org
S: Maintained

Expand Down Expand Up @@ -3939,7 +3939,7 @@ S: Maintained

SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) DRIVER
P: Pierre Ossman
M: drzeus-sdhci@drzeus.cx
M: pierre@ossman.eu
L: sdhci-devel@lists.ossman.eu
S: Maintained

Expand Down Expand Up @@ -4926,7 +4926,7 @@ S: Maintained

W83L51xD SD/MMC CARD INTERFACE DRIVER
P: Pierre Ossman
M: drzeus-wbsd@drzeus.cx
M: pierre@ossman.eu
L: linux-kernel@vger.kernel.org
S: Maintained

Expand Down
2 changes: 1 addition & 1 deletion drivers/mmc/core/mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static int mmc_read_ext_csd(struct mmc_card *card)
}

ext_csd_struct = ext_csd[EXT_CSD_REV];
if (ext_csd_struct > 2) {
if (ext_csd_struct > 3) {
printk(KERN_ERR "%s: unrecognised EXT_CSD structure "
"version %d\n", mmc_hostname(card->host),
ext_csd_struct);
Expand Down
21 changes: 12 additions & 9 deletions drivers/mmc/core/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,15 +362,6 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
if (err)
goto err;

/*
* For SPI, enable CRC as appropriate.
*/
if (mmc_host_is_spi(host)) {
err = mmc_spi_set_crc(host, use_spi_crc);
if (err)
goto err;
}

/*
* Fetch CID from card.
*/
Expand Down Expand Up @@ -457,6 +448,18 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
goto free_card;
}

/*
* For SPI, enable CRC as appropriate.
* This CRC enable is located AFTER the reading of the
* card registers because some SDHC cards are not able
* to provide valid CRCs for non-512-byte blocks.
*/
if (mmc_host_is_spi(host)) {
err = mmc_spi_set_crc(host, use_spi_crc);
if (err)
goto free_card;
}

/*
* Attempt to change to high-speed (if supported)
*/
Expand Down
19 changes: 7 additions & 12 deletions drivers/mmc/host/imxmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,13 +307,6 @@ static void imxmci_setup_data(struct imxmci_host *host, struct mmc_data *data)

wmb();

if (host->actual_bus_width == MMC_BUS_WIDTH_4)
BLR(host->dma) = 0; /* burst 64 byte read / 64 bytes write */
else
BLR(host->dma) = 16; /* burst 16 byte read / 16 bytes write */

RSSR(host->dma) = DMA_REQ_SDHC;

set_bit(IMXMCI_PEND_DMA_DATA_b, &host->pending_events);
clear_bit(IMXMCI_PEND_CPU_DATA_b, &host->pending_events);

Expand Down Expand Up @@ -818,9 +811,11 @@ static void imxmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
if (ios->bus_width == MMC_BUS_WIDTH_4) {
host->actual_bus_width = MMC_BUS_WIDTH_4;
imx_gpio_mode(PB11_PF_SD_DAT3);
BLR(host->dma) = 0; /* burst 64 byte read/write */
} else {
host->actual_bus_width = MMC_BUS_WIDTH_1;
imx_gpio_mode(GPIO_PORTB | GPIO_IN | GPIO_PUEN | 11);
BLR(host->dma) = 16; /* burst 16 byte read/write */
}

if (host->power_mode != ios->power_mode) {
Expand Down Expand Up @@ -938,7 +933,7 @@ static void imxmci_check_status(unsigned long data)
mod_timer(&host->timer, jiffies + (HZ>>1));
}

static int imxmci_probe(struct platform_device *pdev)
static int __init imxmci_probe(struct platform_device *pdev)
{
struct mmc_host *mmc;
struct imxmci_host *host = NULL;
Expand Down Expand Up @@ -1034,6 +1029,7 @@ static int imxmci_probe(struct platform_device *pdev)
}
host->dma_allocated = 1;
imx_dma_setup_handlers(host->dma, imxmci_dma_irq, NULL, host);
RSSR(host->dma) = DMA_REQ_SDHC;

tasklet_init(&host->tasklet, imxmci_tasklet_fnc, (unsigned long)host);
host->status_reg=0;
Expand Down Expand Up @@ -1079,7 +1075,7 @@ static int imxmci_probe(struct platform_device *pdev)
return ret;
}

static int imxmci_remove(struct platform_device *pdev)
static int __exit imxmci_remove(struct platform_device *pdev)
{
struct mmc_host *mmc = platform_get_drvdata(pdev);

Expand Down Expand Up @@ -1145,8 +1141,7 @@ static int imxmci_resume(struct platform_device *dev)
#endif /* CONFIG_PM */

static struct platform_driver imxmci_driver = {
.probe = imxmci_probe,
.remove = imxmci_remove,
.remove = __exit_p(imxmci_remove),
.suspend = imxmci_suspend,
.resume = imxmci_resume,
.driver = {
Expand All @@ -1157,7 +1152,7 @@ static struct platform_driver imxmci_driver = {

static int __init imxmci_init(void)
{
return platform_driver_register(&imxmci_driver);
return platform_driver_probe(&imxmci_driver, imxmci_probe);
}

static void __exit imxmci_exit(void)
Expand Down
Loading

0 comments on commit d2e2d7c

Please sign in to comment.