aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/omap_hsmmc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/host/omap_hsmmc.c')
-rw-r--r--drivers/mmc/host/omap_hsmmc.c51
1 files changed, 32 insertions, 19 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 6e44025acf01..eccedc7d06a4 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -161,6 +161,7 @@ struct omap_hsmmc_host {
161 */ 161 */
162 struct regulator *vcc; 162 struct regulator *vcc;
163 struct regulator *vcc_aux; 163 struct regulator *vcc_aux;
164 int pbias_disable;
164 void __iomem *base; 165 void __iomem *base;
165 resource_size_t mapbase; 166 resource_size_t mapbase;
166 spinlock_t irq_lock; /* Prevent races with irq handler */ 167 spinlock_t irq_lock; /* Prevent races with irq handler */
@@ -255,11 +256,11 @@ static int omap_hsmmc_set_power(struct device *dev, int slot, int power_on,
255 if (!host->vcc) 256 if (!host->vcc)
256 return 0; 257 return 0;
257 /* 258 /*
258 * With DT, never turn OFF the regulator. This is because 259 * With DT, never turn OFF the regulator for MMC1. This is because
259 * the pbias cell programming support is still missing when 260 * the pbias cell programming support is still missing when
260 * booting with Device tree 261 * booting with Device tree
261 */ 262 */
262 if (dev->of_node && !vdd) 263 if (host->pbias_disable && !vdd)
263 return 0; 264 return 0;
264 265
265 if (mmc_slot(host).before_set_reg) 266 if (mmc_slot(host).before_set_reg)
@@ -1520,10 +1521,10 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
1520 (ios->vdd == DUAL_VOLT_OCR_BIT) && 1521 (ios->vdd == DUAL_VOLT_OCR_BIT) &&
1521 /* 1522 /*
1522 * With pbias cell programming missing, this 1523 * With pbias cell programming missing, this
1523 * can't be allowed when booting with device 1524 * can't be allowed on MMC1 when booting with device
1524 * tree. 1525 * tree.
1525 */ 1526 */
1526 !host->dev->of_node) { 1527 !host->pbias_disable) {
1527 /* 1528 /*
1528 * The mmc_select_voltage fn of the core does 1529 * The mmc_select_voltage fn of the core does
1529 * not seem to set the power_mode to 1530 * not seem to set the power_mode to
@@ -1871,6 +1872,10 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
1871 1872
1872 omap_hsmmc_context_save(host); 1873 omap_hsmmc_context_save(host);
1873 1874
1875 /* This can be removed once we support PBIAS with DT */
1876 if (host->dev->of_node && host->mapbase == 0x4809c000)
1877 host->pbias_disable = 1;
1878
1874 host->dbclk = clk_get(&pdev->dev, "mmchsdb_fck"); 1879 host->dbclk = clk_get(&pdev->dev, "mmchsdb_fck");
1875 /* 1880 /*
1876 * MMC can still work without debounce clock. 1881 * MMC can still work without debounce clock.
@@ -1906,33 +1911,41 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
1906 1911
1907 omap_hsmmc_conf_bus_power(host); 1912 omap_hsmmc_conf_bus_power(host);
1908 1913
1909 res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx"); 1914 if (!pdev->dev.of_node) {
1910 if (!res) { 1915 res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
1911 dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n"); 1916 if (!res) {
1912 ret = -ENXIO; 1917 dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n");
1913 goto err_irq; 1918 ret = -ENXIO;
1914 } 1919 goto err_irq;
1915 tx_req = res->start; 1920 }
1921 tx_req = res->start;
1916 1922
1917 res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx"); 1923 res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
1918 if (!res) { 1924 if (!res) {
1919 dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n"); 1925 dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n");
1920 ret = -ENXIO; 1926 ret = -ENXIO;
1921 goto err_irq; 1927 goto err_irq;
1928 }
1929 rx_req = res->start;
1922 } 1930 }
1923 rx_req = res->start;
1924 1931
1925 dma_cap_zero(mask); 1932 dma_cap_zero(mask);
1926 dma_cap_set(DMA_SLAVE, mask); 1933 dma_cap_set(DMA_SLAVE, mask);
1927 1934
1928 host->rx_chan = dma_request_channel(mask, omap_dma_filter_fn, &rx_req); 1935 host->rx_chan =
1936 dma_request_slave_channel_compat(mask, omap_dma_filter_fn,
1937 &rx_req, &pdev->dev, "rx");
1938
1929 if (!host->rx_chan) { 1939 if (!host->rx_chan) {
1930 dev_err(mmc_dev(host->mmc), "unable to obtain RX DMA engine channel %u\n", rx_req); 1940 dev_err(mmc_dev(host->mmc), "unable to obtain RX DMA engine channel %u\n", rx_req);
1931 ret = -ENXIO; 1941 ret = -ENXIO;
1932 goto err_irq; 1942 goto err_irq;
1933 } 1943 }
1934 1944
1935 host->tx_chan = dma_request_channel(mask, omap_dma_filter_fn, &tx_req); 1945 host->tx_chan =
1946 dma_request_slave_channel_compat(mask, omap_dma_filter_fn,
1947 &tx_req, &pdev->dev, "tx");
1948
1936 if (!host->tx_chan) { 1949 if (!host->tx_chan) {
1937 dev_err(mmc_dev(host->mmc), "unable to obtain TX DMA engine channel %u\n", tx_req); 1950 dev_err(mmc_dev(host->mmc), "unable to obtain TX DMA engine channel %u\n", tx_req);
1938 ret = -ENXIO; 1951 ret = -ENXIO;