From: Seungwon Jeon <tgih.jun@samsung.com>
To: 'Jaehoon Chung' <jh80.chung@samsung.com>,
'linux-mmc' <linux-mmc@vger.kernel.org>
Cc: 'Chris Ball' <cjb@laptop.org>,
'Kyungmin Park' <kyungmin.park@samsung.com>,
'Will Newton' <will.newton@imgtec.com>,
'James Hogan' <james.hogan@imgtec.com>
Subject: RE: [PATCH 4/5] mmc: dw-mmc: add the header file for exynos specific code.
Date: Fri, 24 Aug 2012 12:57:07 +0900 [thread overview]
Message-ID: <00ad01cd81ac$87e285e0$97a791a0$%jun@samsung.com> (raw)
In-Reply-To: <503614A7.3050004@samsung.com>
On Thursday, August 23, 2012, Jaehoon Chung <jh80.chung@samsung.com> wrote:
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> include/linux/mmc/exynos-dw_mmc.h | 55 +++++++++++++++++++++++++++++++++++++
> 1 files changed, 55 insertions(+), 0 deletions(-)
> create mode 100644 include/linux/mmc/exynos-dw_mmc.h
>
> diff --git a/include/linux/mmc/exynos-dw_mmc.h b/include/linux/mmc/exynos-dw_mmc.h
> new file mode 100644
> index 0000000..03444c2
> --- /dev/null
> +++ b/include/linux/mmc/exynos-dw_mmc.h
> @@ -0,0 +1,55 @@
> +/*
> + * Synopsys DesignWare Multimedia Card Interface driver
> + *
> + * Copyright (c) 2012 Samsung Electronics Co., Ltd.
> + * http://www.samsung.com
> + *
> + * Header file for Exynos specific register
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#ifndef _EXYNOS_DW_MMC_H
> +#define _EXYNOS_DW_MMC_H
> +#include <linux/mmc/dw_mmc.h>
> +#include <linux/mmc/host.h>
> +
> +#define SDMMC_EXYNOS_CLKSEL 0x09C
> +
> +#define SDMMC_GET_CLK_DRV(x) ((x) >> 16 & 0x7)
> +#define SDMMC_GET_CLK_SAMPLE(x) ((x) & 0x7)
> +#define SDMMC_CLK_RESET_DRV_SAMPLE (0x00070007);
Could you check the width of register field?
There is some difference between ExynosX.
It should cover all.
> +
> +#define mci_readl(dev, reg) \
> + __raw_readl((dev)->regs + SDMMC_##reg)
> +#define mci_writel(dev, reg, value) \
> + __raw_writel((value), (dev)->regs + SDMMC_##reg)
> +
> +static inline int exynos_get_clk_drv(struct dw_mci *host)
> +{
> + return SDMMC_GET_CLK_DRV(mci_readl(host, EXYNOS_CLKSEL));
> +}
> +
> +static inline int exynos_get_clk_sample(struct dw_mci *host)
> +{
> + return SDMMC_GET_CLK_DRV(mci_readl(host, EXYNOS_CLKSEL));
> +}
> +
> +static inline void exynos_set_clk_drv_sample(struct dw_mci *host,
> + struct mmc_ios *ios)
> +{
> + u32 regs;
> +
> + regs = mci_readl(host, EXYNOS_CLKSEL);
> + regs &= ~SDMMC_CLK_RESET_DRV_SAMPLE;
> + if (ios->timing == MMC_TIMING_UHS_DDR50)
> + regs |= host->pdata->ddr_timing;
> + else
> + regs |= host->pdata->sdr_timing;
> +
> + mci_writel(host, EXYNOS_CLKSEL, regs);
> +}
> +
> +#endif /* _EXYNOS_DW_MMC_H */
> --
> 1.7.4.1
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2012-08-24 3:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-23 11:31 [PATCH 4/5] mmc: dw-mmc: add the header file for exynos specific code Jaehoon Chung
2012-08-24 3:57 ` Seungwon Jeon [this message]
2012-08-24 4:58 ` Jaehoon Chung
2012-08-27 1:28 ` Seungwon Jeon
2012-08-27 1:47 ` Jaehoon Chung
2012-08-24 9:29 ` Will Newton
2012-08-24 9:35 ` Jaehoon Chung
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='00ad01cd81ac$87e285e0$97a791a0$%jun@samsung.com' \
--to=tgih.jun@samsung.com \
--cc=cjb@laptop.org \
--cc=james.hogan@imgtec.com \
--cc=jh80.chung@samsung.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-mmc@vger.kernel.org \
--cc=will.newton@imgtec.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).