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

mmc: mmci: Enforce DT for signal direction and feedback clock

Remove the option to provide signal direction configuration and
feeback clock as platform data, enforce it through DT.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

+26 -37
+15 -21
drivers/mmc/host/mmci.c
··· 1287 1287 * indicating signal direction for the signals in 1288 1288 * the SD/MMC bus and feedback-clock usage. 1289 1289 */ 1290 - pwr |= host->plat->sigdir; 1290 + pwr |= host->pwr_reg_add; 1291 1291 1292 1292 if (ios->bus_width == MMC_BUS_WIDTH_4) 1293 1293 pwr &= ~MCI_ST_DATA74DIREN; ··· 1386 1386 .start_signal_voltage_switch = mmci_sig_volt_switch, 1387 1387 }; 1388 1388 1389 - static void mmci_dt_populate_generic_pdata(struct device_node *np, 1390 - struct mmci_platform_data *pdata) 1391 - { 1392 - if (of_get_property(np, "st,sig-dir-dat0", NULL)) 1393 - pdata->sigdir |= MCI_ST_DATA0DIREN; 1394 - if (of_get_property(np, "st,sig-dir-dat2", NULL)) 1395 - pdata->sigdir |= MCI_ST_DATA2DIREN; 1396 - if (of_get_property(np, "st,sig-dir-dat31", NULL)) 1397 - pdata->sigdir |= MCI_ST_DATA31DIREN; 1398 - if (of_get_property(np, "st,sig-dir-dat74", NULL)) 1399 - pdata->sigdir |= MCI_ST_DATA74DIREN; 1400 - if (of_get_property(np, "st,sig-dir-cmd", NULL)) 1401 - pdata->sigdir |= MCI_ST_CMDDIREN; 1402 - if (of_get_property(np, "st,sig-pin-fbclk", NULL)) 1403 - pdata->sigdir |= MCI_ST_FBCLKEN; 1404 - } 1405 - 1406 1389 static int mmci_of_parse(struct device_node *np, struct mmc_host *mmc) 1407 1390 { 1391 + struct mmci_host *host = mmc_priv(mmc); 1408 1392 int ret = mmc_of_parse(mmc); 1409 1393 1410 1394 if (ret) 1411 1395 return ret; 1396 + 1397 + if (of_get_property(np, "st,sig-dir-dat0", NULL)) 1398 + host->pwr_reg_add |= MCI_ST_DATA0DIREN; 1399 + if (of_get_property(np, "st,sig-dir-dat2", NULL)) 1400 + host->pwr_reg_add |= MCI_ST_DATA2DIREN; 1401 + if (of_get_property(np, "st,sig-dir-dat31", NULL)) 1402 + host->pwr_reg_add |= MCI_ST_DATA31DIREN; 1403 + if (of_get_property(np, "st,sig-dir-dat74", NULL)) 1404 + host->pwr_reg_add |= MCI_ST_DATA74DIREN; 1405 + if (of_get_property(np, "st,sig-dir-cmd", NULL)) 1406 + host->pwr_reg_add |= MCI_ST_CMDDIREN; 1407 + if (of_get_property(np, "st,sig-pin-fbclk", NULL)) 1408 + host->pwr_reg_add |= MCI_ST_FBCLKEN; 1412 1409 1413 1410 if (of_get_property(np, "mmc-cap-mmc-highspeed", NULL)) 1414 1411 mmc->caps |= MMC_CAP_MMC_HIGHSPEED; ··· 1436 1439 if (!plat) 1437 1440 return -ENOMEM; 1438 1441 } 1439 - 1440 - if (np) 1441 - mmci_dt_populate_generic_pdata(np, plat); 1442 1442 1443 1443 mmc = mmc_alloc_host(sizeof(struct mmci_host), &dev->dev); 1444 1444 if (!mmc)
+11
drivers/mmc/host/mmci.h
··· 13 13 #define MCI_PWR_ON 0x03 14 14 #define MCI_OD (1 << 6) 15 15 #define MCI_ROD (1 << 7) 16 + /* 17 + * The ST Micro version does not have ROD and reuse the voltage registers for 18 + * direction settings. 19 + */ 20 + #define MCI_ST_DATA2DIREN (1 << 2) 21 + #define MCI_ST_CMDDIREN (1 << 3) 22 + #define MCI_ST_DATA0DIREN (1 << 4) 23 + #define MCI_ST_DATA31DIREN (1 << 5) 24 + #define MCI_ST_FBCLKEN (1 << 7) 25 + #define MCI_ST_DATA74DIREN (1 << 8) 16 26 17 27 #define MMCICLOCK 0x004 18 28 #define MCI_CLK_ENABLE (1 << 8) ··· 193 183 unsigned int mclk; 194 184 unsigned int cclk; 195 185 u32 pwr_reg; 186 + u32 pwr_reg_add; 196 187 u32 clk_reg; 197 188 u32 datactrl_reg; 198 189 u32 busy_status;
-16
include/linux/amba/mmci.h
··· 6 6 7 7 #include <linux/mmc/host.h> 8 8 9 - 10 - /* 11 - * These defines is places here due to access is needed from machine 12 - * configuration files. The ST Micro version does not have ROD and 13 - * reuse the voltage registers for direction settings. 14 - */ 15 - #define MCI_ST_DATA2DIREN (1 << 2) 16 - #define MCI_ST_CMDDIREN (1 << 3) 17 - #define MCI_ST_DATA0DIREN (1 << 4) 18 - #define MCI_ST_DATA31DIREN (1 << 5) 19 - #define MCI_ST_FBCLKEN (1 << 7) 20 - #define MCI_ST_DATA74DIREN (1 << 8) 21 - 22 9 /* Just some dummy forwarding */ 23 10 struct dma_chan; 24 11 ··· 32 45 * @capabilities: the capabilities of the block as implemented in 33 46 * this platform, signify anything MMC_CAP_* from mmc/host.h 34 47 * @capabilities2: more capabilities, MMC_CAP2_* from mmc/host.h 35 - * @sigdir: a bit field indicating for what bits in the MMC bus the host 36 - * should enable signal direction indication. 37 48 * @dma_filter: function used to select an appropriate RX and TX 38 49 * DMA channel to be used for DMA, if and only if you're deploying the 39 50 * generic DMA engine ··· 54 69 bool cd_invert; 55 70 unsigned long capabilities; 56 71 unsigned long capabilities2; 57 - u32 sigdir; 58 72 bool (*dma_filter)(struct dma_chan *chan, void *filter_param); 59 73 void *dma_rx_param; 60 74 void *dma_tx_param;