diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-26 14:00:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-26 14:00:41 -0500 |
commit | ccc039d65f24172eebab5e0160462d3417799af5 (patch) | |
tree | c02513223bebadd57da5b6648a497f99684111e2 /drivers/mmc/host/sh_mobile_sdhi.c | |
parent | 1c2948380b699dfdbb25a7de740392dd9e6f0613 (diff) | |
parent | 945be38caa287b177b8c17ffaae7754cab6a658f (diff) |
Merge tag 'mmc-updates-for-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc
Pull MMC updates from Chris Ball:
"MMC highlights for 3.14:
Core:
- Avoid get_cd() on cards marked nonremovable
Drivers:
- arasan: New driver for controllers found in e.g. Xilinx Zynq SoC
- dwmmc: Support Hisilicon K3 SoC controllers
- esdhc-imx: Support for HS200 mode, DDR modes on MX6, runtime PM
- sdhci-pci: Support O2Micro/BayHubTech controllers used in laptops
like Lenovo ThinkPad W540, Dell Latitude E5440, Dell Latitude E6540
- tegra: Support Tegra124 SoCs"
* tag 'mmc-updates-for-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (55 commits)
mmc: sdhci-pci: Fix possibility of chip->fixes being null
mmc: sdhci-pci: Fix BYT sd card getting stuck in runtime suspend
mmc: sdhci: Allow for long command timeouts
mmc: sdio: add a quirk for broken SDIO_CCCR_INTx polling
mmc: sdhci: fix lockdep error in tuning routine
mmc: dw_mmc: k3: remove clk_table
mmc: dw_mmc: fix dw_mci_get_cd
mmc: dw_mmc: fix sparse non static symbol warning
mmc: sdhci-esdhc-imx: fix warning during module remove function
mmc: sdhci-esdhc-imx: fix access hardirq-unsafe lock in atomic context
mmc: core: sd: implement proper support for sd3.0 au sizes
mmc: atmel-mci: add vmmc-supply support
mmc: sdhci-pci: add broken HS200 quirk for Intel Merrifield
mmc: sdhci: add quirk for broken HS200 support
mmc: arasan: Add driver for Arasan SDHCI
mmc: dw_mmc: add dw_mmc-k3 for k3 platform
mmc: dw_mmc: use slot-gpio to handle cd pin
mmc: sdhci-pci: add support of O2Micro/BayHubTech SD hosts
mmc: sdhci-pci: break out definitions to header file
mmc: tmio: fixup compile error
...
Conflicts:
MAINTAINERS
Diffstat (limited to 'drivers/mmc/host/sh_mobile_sdhi.c')
-rw-r--r-- | drivers/mmc/host/sh_mobile_sdhi.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c index f344659dceac..2d6ce257a273 100644 --- a/drivers/mmc/host/sh_mobile_sdhi.c +++ b/drivers/mmc/host/sh_mobile_sdhi.c | |||
@@ -33,6 +33,8 @@ | |||
33 | 33 | ||
34 | #include "tmio_mmc.h" | 34 | #include "tmio_mmc.h" |
35 | 35 | ||
36 | #define EXT_ACC 0xe4 | ||
37 | |||
36 | struct sh_mobile_sdhi_of_data { | 38 | struct sh_mobile_sdhi_of_data { |
37 | unsigned long tmio_flags; | 39 | unsigned long tmio_flags; |
38 | }; | 40 | }; |
@@ -54,7 +56,7 @@ static int sh_mobile_sdhi_clk_enable(struct platform_device *pdev, unsigned int | |||
54 | struct mmc_host *mmc = platform_get_drvdata(pdev); | 56 | struct mmc_host *mmc = platform_get_drvdata(pdev); |
55 | struct tmio_mmc_host *host = mmc_priv(mmc); | 57 | struct tmio_mmc_host *host = mmc_priv(mmc); |
56 | struct sh_mobile_sdhi *priv = container_of(host->pdata, struct sh_mobile_sdhi, mmc_data); | 58 | struct sh_mobile_sdhi *priv = container_of(host->pdata, struct sh_mobile_sdhi, mmc_data); |
57 | int ret = clk_enable(priv->clk); | 59 | int ret = clk_prepare_enable(priv->clk); |
58 | if (ret < 0) | 60 | if (ret < 0) |
59 | return ret; | 61 | return ret; |
60 | 62 | ||
@@ -67,7 +69,7 @@ static void sh_mobile_sdhi_clk_disable(struct platform_device *pdev) | |||
67 | struct mmc_host *mmc = platform_get_drvdata(pdev); | 69 | struct mmc_host *mmc = platform_get_drvdata(pdev); |
68 | struct tmio_mmc_host *host = mmc_priv(mmc); | 70 | struct tmio_mmc_host *host = mmc_priv(mmc); |
69 | struct sh_mobile_sdhi *priv = container_of(host->pdata, struct sh_mobile_sdhi, mmc_data); | 71 | struct sh_mobile_sdhi *priv = container_of(host->pdata, struct sh_mobile_sdhi, mmc_data); |
70 | clk_disable(priv->clk); | 72 | clk_disable_unprepare(priv->clk); |
71 | } | 73 | } |
72 | 74 | ||
73 | static int sh_mobile_sdhi_wait_idle(struct tmio_mmc_host *host) | 75 | static int sh_mobile_sdhi_wait_idle(struct tmio_mmc_host *host) |
@@ -133,9 +135,15 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) | |||
133 | struct tmio_mmc_data *mmc_data; | 135 | struct tmio_mmc_data *mmc_data; |
134 | struct sh_mobile_sdhi_info *p = pdev->dev.platform_data; | 136 | struct sh_mobile_sdhi_info *p = pdev->dev.platform_data; |
135 | struct tmio_mmc_host *host; | 137 | struct tmio_mmc_host *host; |
138 | struct resource *res; | ||
136 | int irq, ret, i = 0; | 139 | int irq, ret, i = 0; |
137 | bool multiplexed_isr = true; | 140 | bool multiplexed_isr = true; |
138 | struct tmio_mmc_dma *dma_priv; | 141 | struct tmio_mmc_dma *dma_priv; |
142 | u16 ver; | ||
143 | |||
144 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
145 | if (!res) | ||
146 | return -EINVAL; | ||
139 | 147 | ||
140 | priv = devm_kzalloc(&pdev->dev, sizeof(struct sh_mobile_sdhi), GFP_KERNEL); | 148 | priv = devm_kzalloc(&pdev->dev, sizeof(struct sh_mobile_sdhi), GFP_KERNEL); |
141 | if (priv == NULL) { | 149 | if (priv == NULL) { |
@@ -206,11 +214,22 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) | |||
206 | mmc_data->flags |= of_data->tmio_flags; | 214 | mmc_data->flags |= of_data->tmio_flags; |
207 | } | 215 | } |
208 | 216 | ||
217 | /* SD control register space size is 0x100, 0x200 for bus_shift=1 */ | ||
218 | mmc_data->bus_shift = resource_size(res) >> 9; | ||
219 | |||
209 | ret = tmio_mmc_host_probe(&host, pdev, mmc_data); | 220 | ret = tmio_mmc_host_probe(&host, pdev, mmc_data); |
210 | if (ret < 0) | 221 | if (ret < 0) |
211 | goto eprobe; | 222 | goto eprobe; |
212 | 223 | ||
213 | /* | 224 | /* |
225 | * FIXME: | ||
226 | * this Workaround can be more clever method | ||
227 | */ | ||
228 | ver = sd_ctrl_read16(host, CTL_VERSION); | ||
229 | if (ver == 0xCB0D) | ||
230 | sd_ctrl_write16(host, EXT_ACC, 1); | ||
231 | |||
232 | /* | ||
214 | * Allow one or more specific (named) ISRs or | 233 | * Allow one or more specific (named) ISRs or |
215 | * one or more multiplexed (un-named) ISRs. | 234 | * one or more multiplexed (un-named) ISRs. |
216 | */ | 235 | */ |