mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-26 13:44:15 +08:00
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>
This commit is contained in:
parent
b177a530bb
commit
c73e41c898
23
Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.txt
Normal file
23
Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.txt
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
* Rockchip specific extensions to the Synopsis Designware Mobile
|
||||||
|
Storage Host Controller
|
||||||
|
|
||||||
|
The Synopsis designware mobile storage host controller is used to interface
|
||||||
|
a SoC with storage medium such as eMMC or SD/MMC cards. This file documents
|
||||||
|
differences between the core Synopsis dw mshc controller properties described
|
||||||
|
by synopsis-dw-mshc.txt and the properties used by the Rockchip specific
|
||||||
|
extensions to the Synopsis Designware Mobile Storage Host Controller.
|
||||||
|
|
||||||
|
Required Properties:
|
||||||
|
|
||||||
|
* compatible: should be
|
||||||
|
- "rockchip,rk2928-dw-mshc": for Rockchip RK2928 and following
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
rkdwmmc0@12200000 {
|
||||||
|
compatible = "rockchip,rk2928-dw-mshc";
|
||||||
|
reg = <0x12200000 0x1000>;
|
||||||
|
interrupts = <0 75 0>;
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <0>;
|
||||||
|
};
|
@ -24,6 +24,15 @@
|
|||||||
|
|
||||||
#include "dw_mmc.h"
|
#include "dw_mmc.h"
|
||||||
|
|
||||||
|
static void dw_mci_rockchip_prepare_command(struct dw_mci *host, u32 *cmdr)
|
||||||
|
{
|
||||||
|
*cmdr |= SDMMC_CMD_USE_HOLD_REG;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct dw_mci_drv_data rockchip_drv_data = {
|
||||||
|
.prepare_command = dw_mci_rockchip_prepare_command,
|
||||||
|
};
|
||||||
|
|
||||||
int dw_mci_pltfm_register(struct platform_device *pdev,
|
int dw_mci_pltfm_register(struct platform_device *pdev,
|
||||||
const struct dw_mci_drv_data *drv_data)
|
const struct dw_mci_drv_data *drv_data)
|
||||||
{
|
{
|
||||||
@ -87,13 +96,23 @@ EXPORT_SYMBOL_GPL(dw_mci_pltfm_pmops);
|
|||||||
|
|
||||||
static const struct of_device_id dw_mci_pltfm_match[] = {
|
static const struct of_device_id dw_mci_pltfm_match[] = {
|
||||||
{ .compatible = "snps,dw-mshc", },
|
{ .compatible = "snps,dw-mshc", },
|
||||||
|
{ .compatible = "rockchip,rk2928-dw-mshc",
|
||||||
|
.data = &rockchip_drv_data },
|
||||||
{},
|
{},
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(of, dw_mci_pltfm_match);
|
MODULE_DEVICE_TABLE(of, dw_mci_pltfm_match);
|
||||||
|
|
||||||
static int dw_mci_pltfm_probe(struct platform_device *pdev)
|
static int dw_mci_pltfm_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
return dw_mci_pltfm_register(pdev, NULL);
|
const struct dw_mci_drv_data *drv_data = NULL;
|
||||||
|
const struct of_device_id *match;
|
||||||
|
|
||||||
|
if (pdev->dev.of_node) {
|
||||||
|
match = of_match_node(dw_mci_pltfm_match, pdev->dev.of_node);
|
||||||
|
drv_data = match->data;
|
||||||
|
}
|
||||||
|
|
||||||
|
return dw_mci_pltfm_register(pdev, drv_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
int dw_mci_pltfm_remove(struct platform_device *pdev)
|
int dw_mci_pltfm_remove(struct platform_device *pdev)
|
||||||
|
Loading…
Reference in New Issue
Block a user