diff options
author | Thomas Abraham <thomas.abraham@linaro.org> | 2012-09-17 14:16:41 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2012-10-03 10:05:18 -0400 |
commit | 17403f235e94dcccf95b43138b197c4de2ab6816 (patch) | |
tree | ec54f858116e05aa134bf8d8d9f6cbeb82f405cf | |
parent | c91eab4b2564f2424268113ab348eacf9381c2d9 (diff) |
mmc: dw_mmc: prepare functions in dw_mmc-pltfm for reuse
Platform implementations of dw-mshc controller may choose to extend the
features of the standard dw-mshc controller such as adding additional
clocking options or modifying the bus interface. Support for such
implementation specific extensions can be incorporated into dw_mmc-pltfm,
but including multiple such platform specific implementations would
convolute the existing dw_mmc-pltfm code.
Instead, it would be better to create implementation specific platform
drivers to support implementation specific features. Such platforms
drivers can reuse the existing infrastructure in dw_mmc-pltfm for
resource identification and controller registration and provide support
for implementation specific features. So, allow the infrastructure in
dw_mmc-pltfm to be reused by other implementation specific platform
drivers.
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r-- | drivers/mmc/host/dw_mmc-pltfm.c | 12 | ||||
-rw-r--r-- | drivers/mmc/host/dw_mmc-pltfm.h | 19 |
2 files changed, 29 insertions, 2 deletions
diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c index 72059050540f..e17da912efff 100644 --- a/drivers/mmc/host/dw_mmc-pltfm.c +++ b/drivers/mmc/host/dw_mmc-pltfm.c | |||
@@ -23,7 +23,7 @@ | |||
23 | 23 | ||
24 | #include "dw_mmc.h" | 24 | #include "dw_mmc.h" |
25 | 25 | ||
26 | static int __devinit dw_mci_pltfm_probe(struct platform_device *pdev) | 26 | int dw_mci_pltfm_register(struct platform_device *pdev) |
27 | { | 27 | { |
28 | struct dw_mci *host; | 28 | struct dw_mci *host; |
29 | struct resource *regs; | 29 | struct resource *regs; |
@@ -52,6 +52,12 @@ static int __devinit dw_mci_pltfm_probe(struct platform_device *pdev) | |||
52 | ret = dw_mci_probe(host); | 52 | ret = dw_mci_probe(host); |
53 | return ret; | 53 | return ret; |
54 | } | 54 | } |
55 | EXPORT_SYMBOL_GPL(dw_mci_pltfm_register); | ||
56 | |||
57 | static int __devinit dw_mci_pltfm_probe(struct platform_device *pdev) | ||
58 | { | ||
59 | return dw_mci_pltfm_register(pdev); | ||
60 | } | ||
55 | 61 | ||
56 | static int __devexit dw_mci_pltfm_remove(struct platform_device *pdev) | 62 | static int __devexit dw_mci_pltfm_remove(struct platform_device *pdev) |
57 | { | 63 | { |
@@ -61,6 +67,7 @@ static int __devexit dw_mci_pltfm_remove(struct platform_device *pdev) | |||
61 | dw_mci_remove(host); | 67 | dw_mci_remove(host); |
62 | return 0; | 68 | return 0; |
63 | } | 69 | } |
70 | EXPORT_SYMBOL_GPL(dw_mci_pltfm_remove); | ||
64 | 71 | ||
65 | #ifdef CONFIG_PM_SLEEP | 72 | #ifdef CONFIG_PM_SLEEP |
66 | /* | 73 | /* |
@@ -94,7 +101,8 @@ static int dw_mci_pltfm_resume(struct device *dev) | |||
94 | #define dw_mci_pltfm_resume NULL | 101 | #define dw_mci_pltfm_resume NULL |
95 | #endif /* CONFIG_PM_SLEEP */ | 102 | #endif /* CONFIG_PM_SLEEP */ |
96 | 103 | ||
97 | static SIMPLE_DEV_PM_OPS(dw_mci_pltfm_pmops, dw_mci_pltfm_suspend, dw_mci_pltfm_resume); | 104 | SIMPLE_DEV_PM_OPS(dw_mci_pltfm_pmops, dw_mci_pltfm_suspend, dw_mci_pltfm_resume); |
105 | EXPORT_SYMBOL_GPL(dw_mci_pltfm_pmops); | ||
98 | 106 | ||
99 | static const struct of_device_id dw_mci_pltfm_match[] = { | 107 | static const struct of_device_id dw_mci_pltfm_match[] = { |
100 | { .compatible = "snps,dw-mshc", }, | 108 | { .compatible = "snps,dw-mshc", }, |
diff --git a/drivers/mmc/host/dw_mmc-pltfm.h b/drivers/mmc/host/dw_mmc-pltfm.h new file mode 100644 index 000000000000..6c065d9c2dd6 --- /dev/null +++ b/drivers/mmc/host/dw_mmc-pltfm.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * Synopsys DesignWare Multimedia Card Interface Platform driver | ||
3 | * | ||
4 | * Copyright (C) 2012, Samsung Electronics Co., Ltd. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef _DW_MMC_PLTFM_H_ | ||
13 | #define _DW_MMC_PLTFM_H_ | ||
14 | |||
15 | extern int dw_mci_pltfm_register(struct platform_device *pdev); | ||
16 | extern int __devexit dw_mci_pltfm_remove(struct platform_device *pdev); | ||
17 | extern const struct dev_pm_ops dw_mci_pltfm_pmops; | ||
18 | |||
19 | #endif /* _DW_MMC_PLTFM_H_ */ | ||