
Hi,
On 20 July 2016 at 22:16, Jaehoon Chung jh80.chung@samsung.com wrote:
Hi Wenyuo,
On 07/20/2016 07:04 PM, Wenyou Yang wrote:
Convert the driver to the driver model while retaining the existing legacy code. This allows the driver to support boards that have converted to driver model as well as those that have not.
Signed-off-by: Wenyou Yang wenyou.yang@atmel.com Reviewed-by: Simon Glass sjg@chromium.org
Changes in v7:
- Add support for using driver model for block devices and MMC operations.
- Change clk_client.h -> clk.h to adapt to clk API conversion.
Changes in v6:
- Remove unnecessary white space.
- Use sdhci_read(), instead of readl().
- Remove the local variables min_clk.
Changes in v5:
- Add Reviewed-by tag.
Changes in v4:
- Update the clk API based on [PATCH] clk: convert API to match reset/mailbox fstyle (http://patchwork.ozlabs.org/patch/625342/).
- Remove check on dev_get_parent() return.
- Fixed the return value, such as -ENODEV->-EINVAL.
Changes in v3:
- Remove the redundant log print.
Changes in v2:
- Add clock support, include enabling peripheral clock and generated clock.
- Retain the existing legacy code to support boards which have not converted to driver model.
drivers/mmc/Kconfig | 10 ++++ drivers/mmc/atmel_sdhci.c | 125 ++++++++++++++++++++++++++++++++++++++++++++++ include/sdhci.h | 2 + 3 files changed, 137 insertions(+)
diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig index 79cf18f..49b325e 100644 --- a/drivers/mmc/Kconfig +++ b/drivers/mmc/Kconfig @@ -34,6 +34,16 @@ config MSM_SDHCI SD 3.0 specifications. Both SD and eMMC devices are supported. Card-detect gpios are not supported.
+config ATMEL_SDHCI
bool "Atmel SDHCI controller support"
depends on DM_MMC && BLK && DM_MMC_OPS && ARCH_AT91
help
This enables support for the Atmel SDHCI controller, which supports
the embedded MultiMedia Card (e.MMC) Specification V4.51, the SD
Memory Card Specification V3.0, and the SDIO V3.0 specification.
It is compliant with the SD Host Controller Standard V3.0
specification.
config ROCKCHIP_DWMMC bool "Rockchip SD/MMC controller support" depends on DM_MMC && OF_CONTROL diff --git a/drivers/mmc/atmel_sdhci.c b/drivers/mmc/atmel_sdhci.c index 24b68b6..977f6ef 100644 --- a/drivers/mmc/atmel_sdhci.c +++ b/drivers/mmc/atmel_sdhci.c @@ -6,12 +6,15 @@ */
#include <common.h> +#include <clk.h> +#include <dm.h>
If it doesn't use DM_MMC, then doesn't it need to include dm.h?
Please don't put #idefs around header files, particularly this one. It just clutters the code. We can put logic in header files if needed. Eventually most files will include dm.h.
#include <malloc.h> #include <sdhci.h> #include <asm/arch/clk.h>
#define ATMEL_SDHC_MIN_FREQ 400000
Regards, Simon