* [PATCH v4 0/3] mmc: dw_mmc: Add support for Rockchip variant
@ 2013-06-13 8:55 Heiko Stübner
2013-06-13 8:56 ` [PATCH v4 1/3] mmc: dw_mmc-pltfm: remove static from dw_mci_pltfm_remove Heiko Stübner
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Heiko Stübner @ 2013-06-13 8:55 UTC (permalink / raw)
To: Chris Ball
Cc: linux-mmc, Seungwon Jeon, Jaehoon Chung, Arnd Bergmann,
Olof Johansson, linux-arm-kernel@lists.infradead.org,
Andy Shevchenko
The driver support for the mmc host is not needed for the core SoC support
and in the same way the mmc support does not need the SoC code to function.
Therefore it can be submitted (and hopefully merged) on its own.
Changes since v3:
- submit mmc driver standalone
- add dt binding documentation
Changes since v2:
- split "mmc: dw_mmc-pltfm: add Rockchip variant" into move and feature parts
as suggested by Andy Shevchenko
Changes since v1:
none
Dependencies:
- "mmc: dw_mmc: Add support DW SD/MMC driver on SOCFPGA" from Dinh Nguyen that
moves the SDMMC_CMD_USE_HOLD_REG constant into the common header, which is
required on these Rockchip SoCs
Heiko Stuebner (3):
mmc: dw_mmc-pltfm: remove static from dw_mci_pltfm_remove
mmc: dw_mmc-pltfm: move probe and remove below dt match table
mmc: dw_mmc-pltfm: add Rockchip variant
.../devicetree/bindings/mmc/rockchip-dw-mshc.txt | 23 ++++++++++
drivers/mmc/host/dw_mmc-pltfm.c | 47 ++++++++++++++------
2 files changed, 56 insertions(+), 14 deletions(-)
create mode 100644 Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.txt
--
1.7.10.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v4 1/3] mmc: dw_mmc-pltfm: remove static from dw_mci_pltfm_remove
2013-06-13 8:55 [PATCH v4 0/3] mmc: dw_mmc: Add support for Rockchip variant Heiko Stübner
@ 2013-06-13 8:56 ` Heiko Stübner
2013-06-13 8:57 ` [PATCH v4 2/3] mmc: dw_mmc-pltfm: move probe and remove below dt match table Heiko Stübner
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Heiko Stübner @ 2013-06-13 8:56 UTC (permalink / raw)
To: Chris Ball
Cc: linux-mmc, Seungwon Jeon, Jaehoon Chung, Arnd Bergmann,
Olof Johansson, linux-arm-kernel@lists.infradead.org,
Andy Shevchenko
dw_mci_pltfm_remove gets exported and used by dw_mmc-exynos, so should
not be static.
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
---
drivers/mmc/host/dw_mmc-pltfm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c
index 37873f1..0048da8 100644
--- a/drivers/mmc/host/dw_mmc-pltfm.c
+++ b/drivers/mmc/host/dw_mmc-pltfm.c
@@ -68,7 +68,7 @@ static int dw_mci_pltfm_probe(struct platform_device *pdev)
return dw_mci_pltfm_register(pdev, NULL);
}
-static int dw_mci_pltfm_remove(struct platform_device *pdev)
+int dw_mci_pltfm_remove(struct platform_device *pdev)
{
struct dw_mci *host = platform_get_drvdata(pdev);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v4 2/3] mmc: dw_mmc-pltfm: move probe and remove below dt match table
2013-06-13 8:55 [PATCH v4 0/3] mmc: dw_mmc: Add support for Rockchip variant Heiko Stübner
2013-06-13 8:56 ` [PATCH v4 1/3] mmc: dw_mmc-pltfm: remove static from dw_mci_pltfm_remove Heiko Stübner
@ 2013-06-13 8:57 ` Heiko Stübner
2013-06-13 8:58 ` [PATCH v4 3/3] mmc: dw_mmc-pltfm: add Rockchip variant Heiko Stübner
2013-06-27 15:56 ` [PATCH v4 0/3] mmc: dw_mmc: Add support for " Chris Ball
3 siblings, 0 replies; 5+ messages in thread
From: Heiko Stübner @ 2013-06-13 8:57 UTC (permalink / raw)
To: Chris Ball
Cc: linux-mmc, Seungwon Jeon, Jaehoon Chung, Arnd Bergmann,
Olof Johansson, linux-arm-kernel@lists.infradead.org,
Andy Shevchenko
In a subsquent patch probe will need to do some handling of data from
the dt match table. So to prevent the need for forward declarations,
move probe and remove below the match table.
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
---
drivers/mmc/host/dw_mmc-pltfm.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c
index 0048da8..9b05381 100644
--- a/drivers/mmc/host/dw_mmc-pltfm.c
+++ b/drivers/mmc/host/dw_mmc-pltfm.c
@@ -63,20 +63,6 @@ int dw_mci_pltfm_register(struct platform_device *pdev,
}
EXPORT_SYMBOL_GPL(dw_mci_pltfm_register);
-static int dw_mci_pltfm_probe(struct platform_device *pdev)
-{
- return dw_mci_pltfm_register(pdev, NULL);
-}
-
-int dw_mci_pltfm_remove(struct platform_device *pdev)
-{
- struct dw_mci *host = platform_get_drvdata(pdev);
-
- dw_mci_remove(host);
- return 0;
-}
-EXPORT_SYMBOL_GPL(dw_mci_pltfm_remove);
-
#ifdef CONFIG_PM_SLEEP
/*
* TODO: we should probably disable the clock to the card in the suspend path.
@@ -118,6 +104,20 @@ static const struct of_device_id dw_mci_pltfm_match[] = {
};
MODULE_DEVICE_TABLE(of, dw_mci_pltfm_match);
+static int dw_mci_pltfm_probe(struct platform_device *pdev)
+{
+ return dw_mci_pltfm_register(pdev, NULL);
+}
+
+int dw_mci_pltfm_remove(struct platform_device *pdev)
+{
+ struct dw_mci *host = platform_get_drvdata(pdev);
+
+ dw_mci_remove(host);
+ return 0;
+}
+EXPORT_SYMBOL_GPL(dw_mci_pltfm_remove);
+
static struct platform_driver dw_mci_pltfm_driver = {
.probe = dw_mci_pltfm_probe,
.remove = dw_mci_pltfm_remove,
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v4 3/3] mmc: dw_mmc-pltfm: add Rockchip variant
2013-06-13 8:55 [PATCH v4 0/3] mmc: dw_mmc: Add support for Rockchip variant Heiko Stübner
2013-06-13 8:56 ` [PATCH v4 1/3] mmc: dw_mmc-pltfm: remove static from dw_mci_pltfm_remove Heiko Stübner
2013-06-13 8:57 ` [PATCH v4 2/3] mmc: dw_mmc-pltfm: move probe and remove below dt match table Heiko Stübner
@ 2013-06-13 8:58 ` Heiko Stübner
2013-06-27 15:56 ` [PATCH v4 0/3] mmc: dw_mmc: Add support for " Chris Ball
3 siblings, 0 replies; 5+ messages in thread
From: Heiko Stübner @ 2013-06-13 8:58 UTC (permalink / raw)
To: Chris Ball
Cc: linux-mmc, Seungwon Jeon, Jaehoon Chung, Arnd Bergmann,
Olof Johansson, linux-arm-kernel@lists.infradead.org,
Andy Shevchenko
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>
---
depends on "mmc: dw_mmc: Add support DW SD/MMC driver on SOCFPGA"
from Dinh Nguyen
.../devicetree/bindings/mmc/rockchip-dw-mshc.txt | 23 ++++++++++++++++++++
drivers/mmc/host/dw_mmc-pltfm.c | 21 +++++++++++++++++-
2 files changed, 43 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.txt
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 0000000..8a3d91d
--- /dev/null
+++ b/Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.txt
@@ -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>;
+ };
diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c
index 9b05381..3923ffd 100644
--- a/drivers/mmc/host/dw_mmc-pltfm.c
+++ b/drivers/mmc/host/dw_mmc-pltfm.c
@@ -24,6 +24,15 @@
#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,
const struct dw_mci_drv_data *drv_data)
{
@@ -100,13 +109,23 @@ EXPORT_SYMBOL_GPL(dw_mci_pltfm_pmops);
static const struct of_device_id dw_mci_pltfm_match[] = {
{ .compatible = "snps,dw-mshc", },
+ { .compatible = "rockchip,rk2928-dw-mshc",
+ .data = &rockchip_drv_data },
{},
};
MODULE_DEVICE_TABLE(of, dw_mci_pltfm_match);
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)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v4 0/3] mmc: dw_mmc: Add support for Rockchip variant
2013-06-13 8:55 [PATCH v4 0/3] mmc: dw_mmc: Add support for Rockchip variant Heiko Stübner
` (2 preceding siblings ...)
2013-06-13 8:58 ` [PATCH v4 3/3] mmc: dw_mmc-pltfm: add Rockchip variant Heiko Stübner
@ 2013-06-27 15:56 ` Chris Ball
3 siblings, 0 replies; 5+ messages in thread
From: Chris Ball @ 2013-06-27 15:56 UTC (permalink / raw)
To: Heiko Stübner
Cc: linux-mmc, Seungwon Jeon, Jaehoon Chung, Arnd Bergmann,
Olof Johansson, linux-arm-kernel@lists.infradead.org,
Andy Shevchenko
Hi Heiko,
On Thu, Jun 13 2013, Heiko Stübner wrote:
> The driver support for the mmc host is not needed for the core SoC support
> and in the same way the mmc support does not need the SoC code to function.
> Therefore it can be submitted (and hopefully merged) on its own.
>
>
> Changes since v3:
> - submit mmc driver standalone
> - add dt binding documentation
Thanks, all three patches pushed to mmc-next for 3.11.
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-06-27 15:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-13 8:55 [PATCH v4 0/3] mmc: dw_mmc: Add support for Rockchip variant Heiko Stübner
2013-06-13 8:56 ` [PATCH v4 1/3] mmc: dw_mmc-pltfm: remove static from dw_mci_pltfm_remove Heiko Stübner
2013-06-13 8:57 ` [PATCH v4 2/3] mmc: dw_mmc-pltfm: move probe and remove below dt match table Heiko Stübner
2013-06-13 8:58 ` [PATCH v4 3/3] mmc: dw_mmc-pltfm: add Rockchip variant Heiko Stübner
2013-06-27 15:56 ` [PATCH v4 0/3] mmc: dw_mmc: Add support for " Chris Ball
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox