diff options
| author | Ulf Hansson <ulf.hansson@linaro.org> | 2014-03-21 05:13:05 -0400 |
|---|---|---|
| committer | Ulf Hansson <ulf.hansson@linaro.org> | 2014-05-12 06:52:45 -0400 |
| commit | 4593df29b94b31de931dc20d7da2e6c468c8d473 (patch) | |
| tree | e1574dd217822086ec3e92c1dc8d3a72289dc735 | |
| parent | 363b8b46da76a4b082a526db0155771aefef2f33 (diff) | |
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>
| -rw-r--r-- | drivers/mmc/host/mmci.c | 34 | ||||
| -rw-r--r-- | drivers/mmc/host/mmci.h | 11 | ||||
| -rw-r--r-- | include/linux/amba/mmci.h | 16 |
3 files changed, 25 insertions, 36 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 0d3ee08662a9..c0353f84d5be 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
| @@ -1287,7 +1287,7 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
| 1287 | * indicating signal direction for the signals in | 1287 | * indicating signal direction for the signals in |
| 1288 | * the SD/MMC bus and feedback-clock usage. | 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 | if (ios->bus_width == MMC_BUS_WIDTH_4) | 1292 | if (ios->bus_width == MMC_BUS_WIDTH_4) |
| 1293 | pwr &= ~MCI_ST_DATA74DIREN; | 1293 | pwr &= ~MCI_ST_DATA74DIREN; |
| @@ -1386,29 +1386,26 @@ static struct mmc_host_ops mmci_ops = { | |||
| 1386 | .start_signal_voltage_switch = mmci_sig_volt_switch, | 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, | 1389 | static int mmci_of_parse(struct device_node *np, struct mmc_host *mmc) |
| 1390 | struct mmci_platform_data *pdata) | ||
| 1391 | { | 1390 | { |
| 1391 | struct mmci_host *host = mmc_priv(mmc); | ||
| 1392 | int ret = mmc_of_parse(mmc); | ||
| 1393 | |||
| 1394 | if (ret) | ||
| 1395 | return ret; | ||
| 1396 | |||
| 1392 | if (of_get_property(np, "st,sig-dir-dat0", NULL)) | 1397 | if (of_get_property(np, "st,sig-dir-dat0", NULL)) |
| 1393 | pdata->sigdir |= MCI_ST_DATA0DIREN; | 1398 | host->pwr_reg_add |= MCI_ST_DATA0DIREN; |
| 1394 | if (of_get_property(np, "st,sig-dir-dat2", NULL)) | 1399 | if (of_get_property(np, "st,sig-dir-dat2", NULL)) |
| 1395 | pdata->sigdir |= MCI_ST_DATA2DIREN; | 1400 | host->pwr_reg_add |= MCI_ST_DATA2DIREN; |
| 1396 | if (of_get_property(np, "st,sig-dir-dat31", NULL)) | 1401 | if (of_get_property(np, "st,sig-dir-dat31", NULL)) |
| 1397 | pdata->sigdir |= MCI_ST_DATA31DIREN; | 1402 | host->pwr_reg_add |= MCI_ST_DATA31DIREN; |
| 1398 | if (of_get_property(np, "st,sig-dir-dat74", NULL)) | 1403 | if (of_get_property(np, "st,sig-dir-dat74", NULL)) |
| 1399 | pdata->sigdir |= MCI_ST_DATA74DIREN; | 1404 | host->pwr_reg_add |= MCI_ST_DATA74DIREN; |
| 1400 | if (of_get_property(np, "st,sig-dir-cmd", NULL)) | 1405 | if (of_get_property(np, "st,sig-dir-cmd", NULL)) |
| 1401 | pdata->sigdir |= MCI_ST_CMDDIREN; | 1406 | host->pwr_reg_add |= MCI_ST_CMDDIREN; |
| 1402 | if (of_get_property(np, "st,sig-pin-fbclk", NULL)) | 1407 | if (of_get_property(np, "st,sig-pin-fbclk", NULL)) |
| 1403 | pdata->sigdir |= MCI_ST_FBCLKEN; | 1408 | host->pwr_reg_add |= MCI_ST_FBCLKEN; |
| 1404 | } | ||
| 1405 | |||
| 1406 | static int mmci_of_parse(struct device_node *np, struct mmc_host *mmc) | ||
| 1407 | { | ||
| 1408 | int ret = mmc_of_parse(mmc); | ||
| 1409 | |||
| 1410 | if (ret) | ||
| 1411 | return ret; | ||
| 1412 | 1409 | ||
| 1413 | if (of_get_property(np, "mmc-cap-mmc-highspeed", NULL)) | 1410 | if (of_get_property(np, "mmc-cap-mmc-highspeed", NULL)) |
| 1414 | mmc->caps |= MMC_CAP_MMC_HIGHSPEED; | 1411 | mmc->caps |= MMC_CAP_MMC_HIGHSPEED; |
| @@ -1440,9 +1437,6 @@ static int mmci_probe(struct amba_device *dev, | |||
| 1440 | return -ENOMEM; | 1437 | return -ENOMEM; |
| 1441 | } | 1438 | } |
| 1442 | 1439 | ||
| 1443 | if (np) | ||
| 1444 | mmci_dt_populate_generic_pdata(np, plat); | ||
| 1445 | |||
| 1446 | mmc = mmc_alloc_host(sizeof(struct mmci_host), &dev->dev); | 1440 | mmc = mmc_alloc_host(sizeof(struct mmci_host), &dev->dev); |
| 1447 | if (!mmc) | 1441 | if (!mmc) |
| 1448 | return -ENOMEM; | 1442 | return -ENOMEM; |
diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h index 8fc5814f938a..347d942d740b 100644 --- a/drivers/mmc/host/mmci.h +++ b/drivers/mmc/host/mmci.h | |||
| @@ -13,6 +13,16 @@ | |||
| 13 | #define MCI_PWR_ON 0x03 | 13 | #define MCI_PWR_ON 0x03 |
| 14 | #define MCI_OD (1 << 6) | 14 | #define MCI_OD (1 << 6) |
| 15 | #define MCI_ROD (1 << 7) | 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 | #define MMCICLOCK 0x004 | 27 | #define MMCICLOCK 0x004 |
| 18 | #define MCI_CLK_ENABLE (1 << 8) | 28 | #define MCI_CLK_ENABLE (1 << 8) |
| @@ -183,6 +193,7 @@ struct mmci_host { | |||
| 183 | unsigned int mclk; | 193 | unsigned int mclk; |
| 184 | unsigned int cclk; | 194 | unsigned int cclk; |
| 185 | u32 pwr_reg; | 195 | u32 pwr_reg; |
| 196 | u32 pwr_reg_add; | ||
| 186 | u32 clk_reg; | 197 | u32 clk_reg; |
| 187 | u32 datactrl_reg; | 198 | u32 datactrl_reg; |
| 188 | u32 busy_status; | 199 | u32 busy_status; |
diff --git a/include/linux/amba/mmci.h b/include/linux/amba/mmci.h index 32a89cf5ec45..0d3ff95b3b4c 100644 --- a/include/linux/amba/mmci.h +++ b/include/linux/amba/mmci.h | |||
| @@ -6,19 +6,6 @@ | |||
| 6 | 6 | ||
| 7 | #include <linux/mmc/host.h> | 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 | /* Just some dummy forwarding */ | 9 | /* Just some dummy forwarding */ |
| 23 | struct dma_chan; | 10 | struct dma_chan; |
| 24 | 11 | ||
| @@ -45,8 +32,6 @@ struct dma_chan; | |||
| 45 | * @capabilities: the capabilities of the block as implemented in | 32 | * @capabilities: the capabilities of the block as implemented in |
| 46 | * this platform, signify anything MMC_CAP_* from mmc/host.h | 33 | * this platform, signify anything MMC_CAP_* from mmc/host.h |
| 47 | * @capabilities2: more capabilities, MMC_CAP2_* from mmc/host.h | 34 | * @capabilities2: more capabilities, MMC_CAP2_* from mmc/host.h |
| 48 | * @sigdir: a bit field indicating for what bits in the MMC bus the host | ||
| 49 | * should enable signal direction indication. | ||
| 50 | * @dma_filter: function used to select an appropriate RX and TX | 35 | * @dma_filter: function used to select an appropriate RX and TX |
| 51 | * DMA channel to be used for DMA, if and only if you're deploying the | 36 | * DMA channel to be used for DMA, if and only if you're deploying the |
| 52 | * generic DMA engine | 37 | * generic DMA engine |
| @@ -69,7 +54,6 @@ struct mmci_platform_data { | |||
| 69 | bool cd_invert; | 54 | bool cd_invert; |
| 70 | unsigned long capabilities; | 55 | unsigned long capabilities; |
| 71 | unsigned long capabilities2; | 56 | unsigned long capabilities2; |
| 72 | u32 sigdir; | ||
| 73 | bool (*dma_filter)(struct dma_chan *chan, void *filter_param); | 57 | bool (*dma_filter)(struct dma_chan *chan, void *filter_param); |
| 74 | void *dma_rx_param; | 58 | void *dma_rx_param; |
| 75 | void *dma_tx_param; | 59 | void *dma_tx_param; |
