Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions arch/arm/boot/dts/meson8b_odroidc.dts
Original file line numberDiff line numberDiff line change
Expand Up@@ -504,6 +504,13 @@
num_chipselect = <2>;
cs_gpios = "GPIOX_20", "GPIOX_21";

mmc-slot@0 {
compatible = "mmc-spi-slot";
reg = <0x0>;
spi-max-frequency = <2000000>;
voltage-ranges = <3300 3300>;
};

spidev@0 {
spi-max-frequency = <2000000>;
compatible = "spidev";
Expand Down
25 changes: 12 additions & 13 deletions drivers/mmc/card/block.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -133,6 +133,10 @@ enum {
MMC_PACKED_NR_SINGLE,
};

#if defined(CONFIG_MACH_MESON8B_ODROIDC)
#define AML_SDHC_RESERVED_IDX 0
#endif

module_param(perdev_minors, int, 0444);
MODULE_PARM_DESC(perdev_minors, "Minors numbers to allocate per device");

Expand DownExpand Up@@ -2205,25 +2209,16 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
*/
#if defined(CONFIG_MACH_MESON8B_ODROIDC)
if (strncmp(dev_name(mmc_dev(card->host)), "aml_sdhc.0", 8) == 0) {
md->name_idx = 0;
__set_bit(md->name_idx, name_use);
} else if (strncmp(dev_name(mmc_dev(card->host)), "aml_sdio.0", 8) == 0) {
if (!subname) {
md->name_idx = find_first_zero_bit(name_use, max_devices);
__set_bit(md->name_idx, name_use);
} else {
md->name_idx = ((struct mmc_blk_data *)
dev_to_disk(parent)->private_data)->name_idx;
}
}
#else
md->name_idx = AML_SDHC_RESERVED_IDX;
} else
#endif
if (!subname) {
md->name_idx = find_first_zero_bit(name_use, max_devices);
__set_bit(md->name_idx, name_use);
} else
md->name_idx = ((struct mmc_blk_data *)
dev_to_disk(parent)->private_data)->name_idx;
#endif

md->area_type = area_type;

/*
Expand DownExpand Up@@ -2660,6 +2655,10 @@ static int __init mmc_blk_init(void)
{
int res;

#if defined(CONFIG_MACH_MESON8B_ODROIDC)
__set_bit(AML_SDHC_RESERVED_IDX, name_use);
#endif

if (perdev_minors != CONFIG_MMC_BLOCK_MINORS)
pr_info("mmcblk: using %d minors per device\n", perdev_minors);

Expand Down
4 changes: 4 additions & 0 deletions drivers/mmc/host/mmc_spi.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -153,6 +153,7 @@ struct mmc_spi_host {
dma_addr_t ones_dma;
};

static struct mmc_claim mmc_spi_claim;

/****************************************************************************/

Expand DownExpand Up@@ -1365,6 +1366,9 @@ static int mmc_spi_probe(struct spi_device *spi)
if (!mmc)
goto nomem;

spin_lock_init(&mmc_spi_claim.lock);
init_waitqueue_head(&mmc_spi_claim.wq);
mmc->alldev_claim = &mmc_spi_claim;
mmc->ops = &mmc_spi_ops;
mmc->max_blk_size = MMC_SPI_BLOCKSIZE;
mmc->max_segs = MMC_SPI_BLOCKSATONCE;
Expand Down