Commit c0b839eb0c407a394b660b28e93325914c498dfe

Authored by Eric Lee
1 parent b7333c5ee1

mmc: block: Support the fixed index for mmcblk with aliases nodes

Showing 3 changed files with 19 additions and 2 deletions Side-by-side Diff

arch/arm/boot/dts/am33xx.dtsi
... ... @@ -35,6 +35,8 @@
35 35 phy1 = &usb1_phy;
36 36 ethernet0 = &cpsw_emac0;
37 37 ethernet1 = &cpsw_emac1;
  38 + mmc1 = &mmc1; /* Fixed to mmcblk1 for &mmc1 */
  39 + mmc0 = &mmc2; /* Fixed to mmcblk0 for &mmc2 */
38 40 };
39 41  
40 42 cpus {
drivers/mmc/card/block.c
... ... @@ -35,6 +35,7 @@
35 35 #include <linux/capability.h>
36 36 #include <linux/compat.h>
37 37 #include <linux/pm_runtime.h>
  38 +#include <linux/of.h>
38 39  
39 40 #include <linux/mmc/ioctl.h>
40 41 #include <linux/mmc/card.h>
... ... @@ -2038,6 +2039,7 @@
2038 2039 {
2039 2040 struct mmc_blk_data *md;
2040 2041 int devidx, ret;
  2042 + int idx = 0;
2041 2043  
2042 2044 devidx = find_first_zero_bit(dev_use, max_devices);
2043 2045 if (devidx >= max_devices)
... ... @@ -2057,7 +2059,20 @@
2057 2059 * index anymore so we keep track of a name index.
2058 2060 */
2059 2061 if (!subname) {
2060   - md->name_idx = find_first_zero_bit(name_use, max_devices);
  2062 + if (card->dev.parent->parent->of_node)
  2063 + idx = of_alias_get_id(card->dev.parent->parent->of_node,
  2064 + "mmc");
  2065 +
  2066 + if (idx < 0)
  2067 + md->name_idx = find_first_zero_bit(name_use,
  2068 + max_devices);
  2069 + else {
  2070 + if (test_bit(idx, name_use))
  2071 + md->name_idx = find_first_zero_bit(name_use,
  2072 + max_devices);
  2073 + else
  2074 + md->name_idx = (unsigned int)idx;
  2075 + }
2061 2076 __set_bit(md->name_idx, name_use);
2062 2077 } else
2063 2078 md->name_idx = ((struct mmc_blk_data *)
drivers/usb/musb/musb_cppi41.c
... ... @@ -548,7 +548,7 @@
548 548 csr &= ~MUSB_TXCSR_DMAENAB;
549 549 musb_writew(epio, MUSB_TXCSR, csr);
550 550 } else {
551   - cppi41_set_autoreq_mode(cppi41_channel, EP_MODE_AUTOREQ_NONE);
  551 + cppi41_set_autoreq_mode(cppi41_channel, EP_MODE_AUTOREG_NONE);
552 552  
553 553 csr = musb_readw(epio, MUSB_RXCSR);
554 554 csr &= ~(MUSB_RXCSR_H_REQPKT | MUSB_RXCSR_DMAENAB);