aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Stübner <heiko@sntech.de>2013-06-27 11:55:35 -0400
committerChris Ball <cjb@laptop.org>2013-07-05 12:46:27 -0400
commitc73e41c898bb59aaf50098c2c672c7132a88fdbc (patch)
tree78fce5a649debb3cf64a4c551c9c2940a8855cfa
parentb177a530bbe4f7dd01617f542311f87208d21ec6 (diff)
mmc: dw_mmc-pltfm: add Rockchip variant
Cortex-A9 SoCs from Rockchip use a slightly modified variant of dw_mmc controllers that seems to require the SDMMC_CMD_USE_HOLD_REG bit to always be set. There also seem to be no other modifications (additional register etc) present, so to keep the footprint low, add this small variant to the pltfm driver. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Acked-by: Seungwon Jeon <tgih.jun@samsung.com> Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r--Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.txt23
-rw-r--r--drivers/mmc/host/dw_mmc-pltfm.c21
2 files changed, 43 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.txt b/Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.txt
new file mode 100644
index 000000000000..8a3d91d47b6a
--- /dev/null
+++ b/Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.txt
@@ -0,0 +1,23 @@
1* Rockchip specific extensions to the Synopsis Designware Mobile
2 Storage Host Controller
3
4The Synopsis designware mobile storage host controller is used to interface
5a SoC with storage medium such as eMMC or SD/MMC cards. This file documents
6differences between the core Synopsis dw mshc controller properties described
7by synopsis-dw-mshc.txt and the properties used by the Rockchip specific
8extensions to the Synopsis Designware Mobile Storage Host Controller.
9
10Required Properties:
11
12* compatible: should be
13 - "rockchip,rk2928-dw-mshc": for Rockchip RK2928 and following
14
15Example:
16
17 rkdwmmc0@12200000 {
18 compatible = "rockchip,rk2928-dw-mshc";
19 reg = <0x12200000 0x1000>;
20 interrupts = <0 75 0>;
21 #address-cells = <1>;
22 #size-cells = <0>;
23 };
diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c
index 54e6f061daa4..ee525565aa77 100644
--- a/drivers/mmc/host/dw_mmc-pltfm.c
+++ b/drivers/mmc/host/dw_mmc-pltfm.c
@@ -24,6 +24,15 @@
24 24
25#include "dw_mmc.h" 25#include "dw_mmc.h"
26 26
27static void dw_mci_rockchip_prepare_command(struct dw_mci *host, u32 *cmdr)
28{
29 *cmdr |= SDMMC_CMD_USE_HOLD_REG;
30}
31
32static const struct dw_mci_drv_data rockchip_drv_data = {
33 .prepare_command = dw_mci_rockchip_prepare_command,
34};
35
27int dw_mci_pltfm_register(struct platform_device *pdev, 36int dw_mci_pltfm_register(struct platform_device *pdev,
28 const struct dw_mci_drv_data *drv_data) 37 const struct dw_mci_drv_data *drv_data)
29{ 38{
@@ -87,13 +96,23 @@ EXPORT_SYMBOL_GPL(dw_mci_pltfm_pmops);
87 96
88static const struct of_device_id dw_mci_pltfm_match[] = { 97static const struct of_device_id dw_mci_pltfm_match[] = {
89 { .compatible = "snps,dw-mshc", }, 98 { .compatible = "snps,dw-mshc", },
99 { .compatible = "rockchip,rk2928-dw-mshc",
100 .data = &rockchip_drv_data },
90 {}, 101 {},
91}; 102};
92MODULE_DEVICE_TABLE(of, dw_mci_pltfm_match); 103MODULE_DEVICE_TABLE(of, dw_mci_pltfm_match);
93 104
94static int dw_mci_pltfm_probe(struct platform_device *pdev) 105static int dw_mci_pltfm_probe(struct platform_device *pdev)
95{ 106{
96 return dw_mci_pltfm_register(pdev, NULL); 107 const struct dw_mci_drv_data *drv_data = NULL;
108 const struct of_device_id *match;
109
110 if (pdev->dev.of_node) {
111 match = of_match_node(dw_mci_pltfm_match, pdev->dev.of_node);
112 drv_data = match->data;
113 }
114
115 return dw_mci_pltfm_register(pdev, drv_data);
97} 116}
98 117
99int dw_mci_pltfm_remove(struct platform_device *pdev) 118int dw_mci_pltfm_remove(struct platform_device *pdev)