Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'mmc-v4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc

Pull MMC fixes from Ulf Hansson:
"Here are a couple of mmc fixes intended for v4.13-rc1.

I have also included a couple of cleanup patches in this pull request
for OMAP2+, related to the omap_hsmmc driver. The reason is because of
the changes are also depending on OMAP SoC specific code, so this
simplifies how to deal with this.

Summary:

MMC host:
- sunxi: Correct time phase settings
- omap_hsmmc: Clean up some dead code
- dw_mmc: Fix message printed for deprecated num-slots DT binding
- dw_mmc: Fix DT documentation"

* tag 'mmc-v4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
Documentation: dw-mshc: deprecate num-slots
mmc: dw_mmc: fix the wrong condition check of getting num-slots from DT
mmc: host: omap_hsmmc: remove unused platform callbacks
ARM: OMAP2+: hsmmc.c: Remove dead code
mmc: sunxi: Keep default timing phase settings for new timing mode

+16 -284
-1
Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt
··· 78 78 }; 79 79 80 80 dwmmc0@12200000 { 81 - num-slots = <1>; 82 81 cap-mmc-highspeed; 83 82 cap-sd-highspeed; 84 83 broken-cd;
-1
Documentation/devicetree/bindings/mmc/img-dw-mshc.txt
··· 24 24 25 25 fifo-depth = <0x20>; 26 26 bus-width = <4>; 27 - num-slots = <1>; 28 27 disable-wp; 29 28 };
-2
Documentation/devicetree/bindings/mmc/k3-dw-mshc.txt
··· 36 36 37 37 /* Board portion */ 38 38 dwmmc0@fcd03000 { 39 - num-slots = <1>; 40 39 vmmc-supply = <&ldo12>; 41 40 fifo-depth = <0x100>; 42 41 pinctrl-names = "default"; ··· 51 52 52 53 dwmmc_1: dwmmc1@f723e000 { 53 54 compatible = "hisilicon,hi6220-dw-mshc"; 54 - num-slots = <0x1>; 55 55 bus-width = <0x4>; 56 56 disable-wp; 57 57 cap-sd-highspeed;
+7 -9
Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
··· 12 12 * #address-cells: should be 1. 13 13 * #size-cells: should be 0. 14 14 15 - # Slots: The slot specific information are contained within child-nodes with 16 - each child-node representing a supported slot. There should be atleast one 17 - child node representing a card slot. The name of the child node representing 18 - the slot is recommended to be slot@n where n is the unique number of the slot 19 - connected to the controller. The following are optional properties which 20 - can be included in the slot child node. 15 + # Slots (DEPRECATED): The slot specific information are contained within 16 + child-nodes with each child-node representing a supported slot. There should 17 + be atleast one child node representing a card slot. The name of the child node 18 + representing the slot is recommended to be slot@n where n is the unique number 19 + of the slot connected to the controller. The following are optional properties 20 + which can be included in the slot child node. 21 21 22 22 * reg: specifies the physical slot number. The valid values of this 23 23 property is 0 to (num-slots -1), where num-slots is the value ··· 63 63 clock(cclk_out). If it's not specified, max is 200MHZ and min is 400KHz by default. 64 64 (Use the "max-frequency" instead of "clock-freq-min-max".) 65 65 66 - * num-slots: specifies the number of slots supported by the controller. 66 + * num-slots (DEPRECATED): specifies the number of slots supported by the controller. 67 67 The number of physical slots actually used could be equal or less than the 68 68 value specified by num-slots. If this property is not specified, the value 69 69 of num-slot property is assumed to be 1. ··· 124 124 dwmmc0@12200000 { 125 125 clock-frequency = <400000000>; 126 126 clock-freq-min-max = <400000 200000000>; 127 - num-slots = <1>; 128 127 broken-cd; 129 128 fifo-depth = <0x80>; 130 129 card-detect-delay = <200>; ··· 138 139 dwmmc0@12200000 { 139 140 clock-frequency = <400000000>; 140 141 clock-freq-min-max = <400000 200000000>; 141 - num-slots = <1>; 142 142 broken-cd; 143 143 fifo-depth = <0x80>; 144 144 card-detect-delay = <200>;
-1
Documentation/devicetree/bindings/mmc/zx-dw-mshc.txt
··· 25 25 clock-frequency = <50000000>; 26 26 clocks = <&topcrm SD0_AHB>, <&topcrm SD0_WCLK>; 27 27 clock-names = "biu", "ciu"; 28 - num-slots = <1>; 29 28 max-frequency = <50000000>; 30 29 cap-sdio-irq; 31 30 cap-sd-highspeed;
+2 -237
arch/arm/mach-omap2/hsmmc.c
··· 32 32 33 33 #define HSMMC_NAME_LEN 9 34 34 35 - static void omap_hsmmc1_before_set_reg(struct device *dev, 36 - int power_on, int vdd) 37 - { 38 - u32 reg, prog_io; 39 - struct omap_hsmmc_platform_data *mmc = dev->platform_data; 40 - 41 - if (mmc->remux) 42 - mmc->remux(dev, power_on); 43 - 44 - /* 45 - * Assume we power both OMAP VMMC1 (for CMD, CLK, DAT0..3) and the 46 - * card with Vcc regulator (from twl4030 or whatever). OMAP has both 47 - * 1.8V and 3.0V modes, controlled by the PBIAS register. 48 - * 49 - * In 8-bit modes, OMAP VMMC1A (for DAT4..7) needs a supply, which 50 - * is most naturally TWL VSIM; those pins also use PBIAS. 51 - * 52 - * FIXME handle VMMC1A as needed ... 53 - */ 54 - if (power_on) { 55 - if (cpu_is_omap2430()) { 56 - reg = omap_ctrl_readl(OMAP243X_CONTROL_DEVCONF1); 57 - if ((1 << vdd) >= MMC_VDD_30_31) 58 - reg |= OMAP243X_MMC1_ACTIVE_OVERWRITE; 59 - else 60 - reg &= ~OMAP243X_MMC1_ACTIVE_OVERWRITE; 61 - omap_ctrl_writel(reg, OMAP243X_CONTROL_DEVCONF1); 62 - } 63 - 64 - if (mmc->internal_clock) { 65 - reg = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0); 66 - reg |= OMAP2_MMCSDIO1ADPCLKISEL; 67 - omap_ctrl_writel(reg, OMAP2_CONTROL_DEVCONF0); 68 - } 69 - 70 - reg = omap_ctrl_readl(control_pbias_offset); 71 - if (cpu_is_omap3630()) { 72 - /* Set MMC I/O to 52MHz */ 73 - prog_io = omap_ctrl_readl(OMAP343X_CONTROL_PROG_IO1); 74 - prog_io |= OMAP3630_PRG_SDMMC1_SPEEDCTRL; 75 - omap_ctrl_writel(prog_io, OMAP343X_CONTROL_PROG_IO1); 76 - } else { 77 - reg |= OMAP2_PBIASSPEEDCTRL0; 78 - } 79 - reg &= ~OMAP2_PBIASLITEPWRDNZ0; 80 - omap_ctrl_writel(reg, control_pbias_offset); 81 - } else { 82 - reg = omap_ctrl_readl(control_pbias_offset); 83 - reg &= ~OMAP2_PBIASLITEPWRDNZ0; 84 - omap_ctrl_writel(reg, control_pbias_offset); 85 - } 86 - } 87 - 88 - static void omap_hsmmc1_after_set_reg(struct device *dev, int power_on, int vdd) 89 - { 90 - u32 reg; 91 - 92 - /* 100ms delay required for PBIAS configuration */ 93 - msleep(100); 94 - 95 - if (power_on) { 96 - reg = omap_ctrl_readl(control_pbias_offset); 97 - reg |= (OMAP2_PBIASLITEPWRDNZ0 | OMAP2_PBIASSPEEDCTRL0); 98 - if ((1 << vdd) <= MMC_VDD_165_195) 99 - reg &= ~OMAP2_PBIASLITEVMODE0; 100 - else 101 - reg |= OMAP2_PBIASLITEVMODE0; 102 - omap_ctrl_writel(reg, control_pbias_offset); 103 - } else { 104 - reg = omap_ctrl_readl(control_pbias_offset); 105 - reg |= (OMAP2_PBIASSPEEDCTRL0 | OMAP2_PBIASLITEPWRDNZ0 | 106 - OMAP2_PBIASLITEVMODE0); 107 - omap_ctrl_writel(reg, control_pbias_offset); 108 - } 109 - } 110 - 111 - static void hsmmc2_select_input_clk_src(struct omap_hsmmc_platform_data *mmc) 112 - { 113 - u32 reg; 114 - 115 - reg = omap_ctrl_readl(control_devconf1_offset); 116 - if (mmc->internal_clock) 117 - reg |= OMAP2_MMCSDIO2ADPCLKISEL; 118 - else 119 - reg &= ~OMAP2_MMCSDIO2ADPCLKISEL; 120 - omap_ctrl_writel(reg, control_devconf1_offset); 121 - } 122 - 123 - static void hsmmc2_before_set_reg(struct device *dev, int power_on, int vdd) 124 - { 125 - struct omap_hsmmc_platform_data *mmc = dev->platform_data; 126 - 127 - if (mmc->remux) 128 - mmc->remux(dev, power_on); 129 - 130 - if (power_on) 131 - hsmmc2_select_input_clk_src(mmc); 132 - } 133 - 134 - static int am35x_hsmmc2_set_power(struct device *dev, int power_on, int vdd) 135 - { 136 - struct omap_hsmmc_platform_data *mmc = dev->platform_data; 137 - 138 - if (power_on) 139 - hsmmc2_select_input_clk_src(mmc); 140 - 141 - return 0; 142 - } 143 - 144 - static int nop_mmc_set_power(struct device *dev, int power_on, int vdd) 145 - { 146 - return 0; 147 - } 148 - 149 35 static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c, 150 36 struct omap_hsmmc_platform_data *mmc) 151 37 { ··· 43 157 return -ENOMEM; 44 158 } 45 159 46 - if (c->name) 47 - strncpy(hc_name, c->name, HSMMC_NAME_LEN); 48 - else 49 - snprintf(hc_name, (HSMMC_NAME_LEN + 1), "mmc%islot%i", 50 - c->mmc, 1); 160 + snprintf(hc_name, (HSMMC_NAME_LEN + 1), "mmc%islot%i", c->mmc, 1); 51 161 mmc->name = hc_name; 52 162 mmc->caps = c->caps; 53 - mmc->internal_clock = !c->ext_clock; 54 163 mmc->reg_offset = 0; 55 164 56 - if (c->cover_only) { 57 - /* detect if mobile phone cover removed */ 58 - mmc->gpio_cd = -EINVAL; 59 - mmc->gpio_cod = c->gpio_cd; 60 - } else { 61 - /* card detect pin on the mmc socket itself */ 62 - mmc->gpio_cd = c->gpio_cd; 63 - mmc->gpio_cod = -EINVAL; 64 - } 65 - mmc->gpio_wp = c->gpio_wp; 66 - 67 - mmc->remux = c->remux; 68 - mmc->init_card = c->init_card; 69 - 70 - if (c->nonremovable) 71 - mmc->nonremovable = 1; 72 - 73 - /* 74 - * NOTE: MMC slots should have a Vcc regulator set up. 75 - * This may be from a TWL4030-family chip, another 76 - * controllable regulator, or a fixed supply. 77 - * 78 - * temporary HACK: ocr_mask instead of fixed supply 79 - */ 80 - if (soc_is_am35xx()) 81 - mmc->ocr_mask = MMC_VDD_165_195 | 82 - MMC_VDD_26_27 | 83 - MMC_VDD_27_28 | 84 - MMC_VDD_29_30 | 85 - MMC_VDD_30_31 | 86 - MMC_VDD_31_32; 87 - else 88 - mmc->ocr_mask = c->ocr_mask; 89 - 90 - if (!soc_is_am35xx()) 91 - mmc->features |= HSMMC_HAS_PBIAS; 92 - 93 - switch (c->mmc) { 94 - case 1: 95 - if (mmc->features & HSMMC_HAS_PBIAS) { 96 - /* on-chip level shifting via PBIAS0/PBIAS1 */ 97 - mmc->before_set_reg = 98 - omap_hsmmc1_before_set_reg; 99 - mmc->after_set_reg = 100 - omap_hsmmc1_after_set_reg; 101 - } 102 - 103 - if (soc_is_am35xx()) 104 - mmc->set_power = nop_mmc_set_power; 105 - 106 - /* OMAP3630 HSMMC1 supports only 4-bit */ 107 - if (cpu_is_omap3630() && 108 - (c->caps & MMC_CAP_8_BIT_DATA)) { 109 - c->caps &= ~MMC_CAP_8_BIT_DATA; 110 - c->caps |= MMC_CAP_4_BIT_DATA; 111 - mmc->caps = c->caps; 112 - } 113 - break; 114 - case 2: 115 - if (soc_is_am35xx()) 116 - mmc->set_power = am35x_hsmmc2_set_power; 117 - 118 - if (c->ext_clock) 119 - c->transceiver = 1; 120 - if (c->transceiver && (c->caps & MMC_CAP_8_BIT_DATA)) { 121 - c->caps &= ~MMC_CAP_8_BIT_DATA; 122 - c->caps |= MMC_CAP_4_BIT_DATA; 123 - } 124 - if (mmc->features & HSMMC_HAS_PBIAS) { 125 - /* off-chip level shifting, or none */ 126 - mmc->before_set_reg = hsmmc2_before_set_reg; 127 - mmc->after_set_reg = NULL; 128 - } 129 - break; 130 - case 3: 131 - case 4: 132 - case 5: 133 - mmc->before_set_reg = NULL; 134 - mmc->after_set_reg = NULL; 135 - break; 136 - default: 137 - pr_err("MMC%d configuration not supported!\n", c->mmc); 138 - kfree(hc_name); 139 - return -ENODEV; 140 - } 141 165 return 0; 142 166 } 143 167 ··· 56 260 void omap_hsmmc_late_init(struct omap2_hsmmc_info *c) 57 261 { 58 262 struct platform_device *pdev; 59 - struct omap_hsmmc_platform_data *mmc_pdata; 60 263 int res; 61 264 62 265 if (omap_hsmmc_done != 1) ··· 64 269 omap_hsmmc_done++; 65 270 66 271 for (; c->mmc; c++) { 67 - if (!c->deferred) 68 - continue; 69 - 70 272 pdev = c->pdev; 71 273 if (!pdev) 72 274 continue; 73 - 74 - mmc_pdata = pdev->dev.platform_data; 75 - if (!mmc_pdata) 76 - continue; 77 - 78 - if (c->cover_only) { 79 - /* detect if mobile phone cover removed */ 80 - mmc_pdata->gpio_cd = -EINVAL; 81 - mmc_pdata->gpio_cod = c->gpio_cd; 82 - } else { 83 - /* card detect pin on the mmc socket itself */ 84 - mmc_pdata->gpio_cd = c->gpio_cd; 85 - mmc_pdata->gpio_cod = -EINVAL; 86 - } 87 - mmc_pdata->gpio_wp = c->gpio_wp; 88 - 89 275 res = omap_device_register(pdev); 90 276 if (res) 91 - pr_err("Could not late init MMC %s\n", 92 - c->name); 277 + pr_err("Could not late init MMC\n"); 93 278 } 94 279 } 95 280 ··· 111 336 if (oh->dev_attr != NULL) { 112 337 mmc_dev_attr = oh->dev_attr; 113 338 mmc_data->controller_flags = mmc_dev_attr->flags; 114 - /* 115 - * erratum 2.1.1.128 doesn't apply if board has 116 - * a transceiver is attached 117 - */ 118 - if (hsmmcinfo->transceiver) 119 - mmc_data->controller_flags &= 120 - ~OMAP_HSMMC_BROKEN_MULTIBLOCK_READ; 121 339 } 122 340 123 341 pdev = platform_device_alloc(name, ctrl_nr - 1); ··· 134 366 } 135 367 136 368 hsmmcinfo->pdev = pdev; 137 - 138 - if (hsmmcinfo->deferred) 139 - goto free_mmc; 140 369 141 370 res = omap_device_register(pdev); 142 371 if (res) {
-9
arch/arm/mach-omap2/hsmmc.h
··· 12 12 u8 mmc; /* controller 1/2/3 */ 13 13 u32 caps; /* 4/8 wires and any additional host 14 14 * capabilities OR'd (ref. linux/mmc/host.h) */ 15 - bool transceiver; /* MMC-2 option */ 16 - bool ext_clock; /* use external pin for input clock */ 17 - bool cover_only; /* No card detect - just cover switch */ 18 - bool nonremovable; /* Nonremovable e.g. eMMC */ 19 - bool deferred; /* mmc needs a deferred probe */ 20 15 int gpio_cd; /* or -EINVAL */ 21 16 int gpio_wp; /* or -EINVAL */ 22 - char *name; /* or NULL for default */ 23 17 struct platform_device *pdev; /* mmc controller instance */ 24 - int ocr_mask; /* temporary HACK */ 25 - /* Remux (pad configuration) when powering on/off */ 26 - void (*remux)(struct device *dev, int power_on); 27 18 /* init some special card */ 28 19 void (*init_card)(struct mmc_card *card); 29 20 };
+1 -1
drivers/mmc/host/dw_mmc.c
··· 2957 2957 } 2958 2958 2959 2959 /* find out number of slots supported */ 2960 - if (device_property_read_u32(dev, "num-slots", &pdata->num_slots)) 2960 + if (!device_property_read_u32(dev, "num-slots", &pdata->num_slots)) 2961 2961 dev_info(dev, "'num-slots' was deprecated.\n"); 2962 2962 2963 2963 if (device_property_read_u32(dev, "fifo-depth", &pdata->fifo_depth))
-11
drivers/mmc/host/omap_hsmmc.c
··· 356 356 struct mmc_host *mmc = host->mmc; 357 357 int ret = 0; 358 358 359 - if (mmc_pdata(host)->set_power) 360 - return mmc_pdata(host)->set_power(host->dev, power_on, vdd); 361 - 362 359 /* 363 360 * If we don't see a Vcc regulator, assume it's a fixed 364 361 * voltage always-on regulator. 365 362 */ 366 363 if (IS_ERR(mmc->supply.vmmc)) 367 364 return 0; 368 - 369 - if (mmc_pdata(host)->before_set_reg) 370 - mmc_pdata(host)->before_set_reg(host->dev, power_on, vdd); 371 365 372 366 ret = omap_hsmmc_set_pbias(host, false, 0); 373 367 if (ret) ··· 393 399 if (ret) 394 400 return ret; 395 401 } 396 - 397 - if (mmc_pdata(host)->after_set_reg) 398 - mmc_pdata(host)->after_set_reg(host->dev, power_on, vdd); 399 402 400 403 return 0; 401 404 ··· 460 469 int ret; 461 470 struct mmc_host *mmc = host->mmc; 462 471 463 - if (mmc_pdata(host)->set_power) 464 - return 0; 465 472 466 473 ret = mmc_regulator_get_supply(mmc); 467 474 if (ret == -EPROBE_DEFER)
+6 -2
drivers/mmc/host/sunxi-mmc.c
··· 793 793 } 794 794 mmc_writel(host, REG_CLKCR, rval); 795 795 796 - if (host->cfg->needs_new_timings) 797 - mmc_writel(host, REG_SD_NTSR, SDXC_2X_TIMING_MODE); 796 + if (host->cfg->needs_new_timings) { 797 + /* Don't touch the delay bits */ 798 + rval = mmc_readl(host, REG_SD_NTSR); 799 + rval |= SDXC_2X_TIMING_MODE; 800 + mmc_writel(host, REG_SD_NTSR, rval); 801 + } 798 802 799 803 ret = sunxi_mmc_clk_set_phase(host, ios, rate); 800 804 if (ret)
-10
include/linux/platform_data/hsmmc-omap.h
··· 55 55 u32 caps; /* Used for the MMC driver on 2430 and later */ 56 56 u32 pm_caps; /* PM capabilities of the mmc */ 57 57 58 - /* use the internal clock */ 59 - unsigned internal_clock:1; 60 - 61 58 /* nonremovable e.g. eMMC */ 62 59 unsigned nonremovable:1; 63 60 ··· 70 73 int gpio_cd; /* gpio (card detect) */ 71 74 int gpio_cod; /* gpio (cover detect) */ 72 75 int gpio_wp; /* gpio (write protect) */ 73 - 74 - int (*set_power)(struct device *dev, int power_on, int vdd); 75 - void (*remux)(struct device *dev, int power_on); 76 - /* Call back before enabling / disabling regulators */ 77 - void (*before_set_reg)(struct device *dev, int power_on, int vdd); 78 - /* Call back after enabling / disabling regulators */ 79 - void (*after_set_reg)(struct device *dev, int power_on, int vdd); 80 76 /* if we have special card, init it using this callback */ 81 77 void (*init_card)(struct mmc_card *card); 82 78