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

mmc: dw_mmc: use the mmc_of_parse() instead of local parser

mmc_of_parse() have been already parsed the general capability.
Didn't need to use the local parser.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>

authored by

Jaehoon Chung and committed by
Chris Ball
d8a4fb0e 384a81d5

+1 -53
-5
Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
··· 69 69 70 70 * supports-highspeed: Enables support for high speed cards (up to 50MHz) 71 71 72 - * caps2-mmc-hs200-1_8v: Supports mmc HS200 SDR 1.8V mode 73 - 74 - * caps2-mmc-hs200-1_2v: Supports mmc HS200 SDR 1.2V mode 75 - 76 72 * broken-cd: as documented in mmc core bindings. 77 73 78 74 * vmmc-supply: The phandle to the regulator to use for vmmc. If this is ··· 99 103 clock-freq-min-max = <400000 200000000>; 100 104 num-slots = <1>; 101 105 supports-highspeed; 102 - caps2-mmc-hs200-1_8v; 103 106 broken-cd; 104 107 fifo-depth = <0x80>; 105 108 card-detect-delay = <200>;
+1 -48
drivers/mmc/host/dw_mmc.c
··· 2046 2046 return quirks; 2047 2047 } 2048 2048 2049 - /* find out bus-width for a given slot */ 2050 - static u32 dw_mci_of_get_bus_wd(struct device *dev, u8 slot) 2051 - { 2052 - struct device_node *np = dw_mci_of_find_slot_node(dev, slot); 2053 - u32 bus_wd = 1; 2054 - 2055 - if (!np) 2056 - return 1; 2057 - 2058 - if (of_property_read_u32(np, "bus-width", &bus_wd)) 2059 - dev_err(dev, "bus-width property not found, assuming width" 2060 - " as 1\n"); 2061 - return bus_wd; 2062 - } 2063 - 2064 2049 /* find the write protect gpio for a given slot; or -1 if none specified */ 2065 2050 static int dw_mci_of_get_wp_gpio(struct device *dev, u8 slot) 2066 2051 { ··· 2093 2108 { 2094 2109 return 0; 2095 2110 } 2096 - static u32 dw_mci_of_get_bus_wd(struct device *dev, u8 slot) 2097 - { 2098 - return 1; 2099 - } 2100 2111 static struct device_node *dw_mci_of_find_slot_node(struct device *dev, u8 slot) 2101 2112 { 2102 2113 return NULL; ··· 2115 2134 const struct dw_mci_drv_data *drv_data = host->drv_data; 2116 2135 int ctrl_id, ret; 2117 2136 u32 freq[2]; 2118 - u8 bus_width; 2119 2137 2120 2138 mmc = mmc_alloc_host(sizeof(struct dw_mci_slot), host->dev); 2121 2139 if (!mmc) ··· 2169 2189 if (host->pdata->caps2) 2170 2190 mmc->caps2 = host->pdata->caps2; 2171 2191 2172 - if (host->pdata->get_bus_wd) 2173 - bus_width = host->pdata->get_bus_wd(slot->id); 2174 - else if (host->dev->of_node) 2175 - bus_width = dw_mci_of_get_bus_wd(host->dev, slot->id); 2176 - else 2177 - bus_width = 1; 2178 - 2179 - switch (bus_width) { 2180 - case 8: 2181 - mmc->caps |= MMC_CAP_8_BIT_DATA; 2182 - case 4: 2183 - mmc->caps |= MMC_CAP_4_BIT_DATA; 2184 - } 2192 + mmc_of_parse(mmc); 2185 2193 2186 2194 if (host->pdata->blk_settings) { 2187 2195 mmc->max_segs = host->pdata->blk_settings->max_segs; ··· 2367 2399 return ERR_PTR(ret); 2368 2400 } 2369 2401 2370 - if (of_find_property(np, "keep-power-in-suspend", NULL)) 2371 - pdata->pm_caps |= MMC_PM_KEEP_POWER; 2372 - 2373 - if (of_find_property(np, "enable-sdio-wakeup", NULL)) 2374 - pdata->pm_caps |= MMC_PM_WAKE_SDIO_IRQ; 2375 - 2376 2402 if (of_find_property(np, "supports-highspeed", NULL)) 2377 2403 pdata->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED; 2378 - 2379 - if (of_find_property(np, "caps2-mmc-hs200-1_8v", NULL)) 2380 - pdata->caps2 |= MMC_CAP2_HS200_1_8V_SDR; 2381 - 2382 - if (of_find_property(np, "caps2-mmc-hs200-1_2v", NULL)) 2383 - pdata->caps2 |= MMC_CAP2_HS200_1_2V_SDR; 2384 - 2385 - if (of_get_property(np, "cd-inverted", NULL)) 2386 - pdata->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH; 2387 2404 2388 2405 return pdata; 2389 2406 }