From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jaehoon Chung Date: Fri, 22 Jul 2016 13:00:13 +0900 Subject: [U-Boot] [PATCH v7] mmc: atmel_sdhci: Convert to the driver model support In-Reply-To: References: <1469009090-13011-1-git-send-email-wenyou.yang@atmel.com> <57904CB6.6000309@samsung.com> Message-ID: <57919A4D.3070407@samsung.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 07/22/2016 12:21 PM, Simon Glass wrote: > Hi, > > On 20 July 2016 at 22:16, Jaehoon Chung 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 >>> Reviewed-by: Simon Glass >>> --- >>> >>> 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 >>> +#include >>> +#include >> >> 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. Agreed! Thanks for explanation. Best Regards, Jaehoon Chung > >> >>> #include >>> #include >>> #include >>> >>> #define ATMEL_SDHC_MIN_FREQ 400000 > > Regards, > Simon > > >