diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/host/dw_mmc-pltfm.c | 21 |
1 files changed, 20 insertions, 1 deletions
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 | ||
27 | static void dw_mci_rockchip_prepare_command(struct dw_mci *host, u32 *cmdr) | ||
28 | { | ||
29 | *cmdr |= SDMMC_CMD_USE_HOLD_REG; | ||
30 | } | ||
31 | |||
32 | static const struct dw_mci_drv_data rockchip_drv_data = { | ||
33 | .prepare_command = dw_mci_rockchip_prepare_command, | ||
34 | }; | ||
35 | |||
27 | int dw_mci_pltfm_register(struct platform_device *pdev, | 36 | int 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 | ||
88 | static const struct of_device_id dw_mci_pltfm_match[] = { | 97 | static 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 | }; |
92 | MODULE_DEVICE_TABLE(of, dw_mci_pltfm_match); | 103 | MODULE_DEVICE_TABLE(of, dw_mci_pltfm_match); |
93 | 104 | ||
94 | static int dw_mci_pltfm_probe(struct platform_device *pdev) | 105 | static 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 | ||
99 | int dw_mci_pltfm_remove(struct platform_device *pdev) | 118 | int dw_mci_pltfm_remove(struct platform_device *pdev) |