@@ -650,6 +650,7 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data)
{
u8 count;
u8 ctrl;
+ u16 blk_sz;
int ret;
WARN_ON(host->data);
@@ -809,7 +810,13 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data)
sdhci_set_transfer_irqs(host);
/* We do not handle DMA boundaries, so set it to max (512 KiB) */
- sdhci_writew(host, SDHCI_MAKE_BLKSZ(7, data->blksz), SDHCI_BLOCK_SIZE);
+ if (host->ops->make_blksz)
+ blk_sz = host->ops->make_blksz(data->blksz);
+ else
+ blk_sz = SDHCI_MAKE_BLKSZ(7, data->blksz);
+
+ sdhci_writew(host, blk_sz, SDHCI_BLOCK_SIZE);
+
sdhci_writew(host, data->blocks, SDHCI_BLOCK_COUNT);
}
@@ -326,6 +326,7 @@ struct sdhci_ops {
unsigned int (*get_min_clock)(struct sdhci_host *host);
unsigned int (*get_timeout_clock)(struct sdhci_host *host);
unsigned int (*get_ro)(struct sdhci_host *host);
+ u16 (*make_blksz)(u16 blk_sz);
};
#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS