* [PATCH 0/2] Move sdhci-s3c platform helper into driver
@ 2011-09-02 15:18 Thomas Abraham
2011-09-02 15:18 ` [PATCH 1/2] mmc: sdhci-s3c: add default controller configuration Thomas Abraham
0 siblings, 1 reply; 10+ messages in thread
From: Thomas Abraham @ 2011-09-02 15:18 UTC (permalink / raw)
To: linux-arm-kernel
The platform helper that sets up the default sdhci-s3c controller
configuration can be removed and moved into the sdhci-s3c driver.
This platform helper is removed for s3c2416, s3c64xx, s5pc100,
s5pv210 and Exynos4 platforms.
Since the platform helper function pointer was being passed in the
platform data of sdhci-s3c driver, the removal of this pointer from
the platform data is step closer to complete device tree support for
sdhci-s3c driver.
This patchset has been tested on the following platforms.
SMDK2416, SMDK6410, SMDKC100, SMDKV210 and SMDKV310.
Thomas Abraham (2):
mmc: sdhci-s3c: add default controller configuration
arm: samsung: remove sdhci default configuration setup platform helper
arch/arm/mach-exynos4/setup-sdhci.c | 47 -----------------------
arch/arm/mach-s3c2416/setup-sdhci.c | 37 ------------------
arch/arm/mach-s3c64xx/setup-sdhci.c | 48 -----------------------
arch/arm/mach-s5pc100/setup-sdhci.c | 42 --------------------
arch/arm/mach-s5pv210/setup-sdhci.c | 41 --------------------
arch/arm/plat-samsung/dev-hsmmc.c | 2 -
arch/arm/plat-samsung/dev-hsmmc1.c | 2 -
arch/arm/plat-samsung/dev-hsmmc2.c | 2 -
arch/arm/plat-samsung/dev-hsmmc3.c | 2 -
arch/arm/plat-samsung/include/plat/sdhci.h | 57 ----------------------------
drivers/mmc/host/sdhci-s3c.c | 28 ++++++++-----
11 files changed, 17 insertions(+), 291 deletions(-)
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/2] mmc: sdhci-s3c: add default controller configuration
2011-09-02 15:18 [PATCH 0/2] Move sdhci-s3c platform helper into driver Thomas Abraham
@ 2011-09-02 15:18 ` Thomas Abraham
2011-09-02 15:18 ` [PATCH 2/2] arm: samsung: remove sdhci default configuration setup platform helper Thomas Abraham
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Thomas Abraham @ 2011-09-02 15:18 UTC (permalink / raw)
To: linux-arm-kernel
The default controller configuration which was previously setup by
platform helper functions is moved into the driver.
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
---
drivers/mmc/host/sdhci-s3c.c | 28 +++++++++++++++++-----------
1 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 2bd7bf4..d891682 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -203,17 +203,23 @@ static void sdhci_s3c_set_clock(struct sdhci_host *host, unsigned int clock)
writel(ctrl, host->ioaddr + S3C_SDHCI_CONTROL2);
}
- /* reconfigure the hardware for new clock rate */
-
- {
- struct mmc_ios ios;
-
- ios.clock = clock;
-
- if (ourhost->pdata->cfg_card)
- (ourhost->pdata->cfg_card)(ourhost->pdev, host->ioaddr,
- &ios, NULL);
- }
+ /* reprogram default hardware configuration */
+ writel(S3C64XX_SDHCI_CONTROL4_DRIVE_9mA,
+ host->ioaddr + S3C64XX_SDHCI_CONTROL4);
+
+ ctrl = readl(host->ioaddr + S3C_SDHCI_CONTROL2);
+ ctrl |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
+ S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
+ S3C_SDHCI_CTRL2_ENFBCLKRX |
+ S3C_SDHCI_CTRL2_DFCNT_NONE |
+ S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
+ writel(ctrl, host->ioaddr + S3C_SDHCI_CONTROL2);
+
+ /* reconfigure the controller for new clock rate */
+ ctrl = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
+ if (clock < 25 * 1000000)
+ ctrl |= (S3C_SDHCI_CTRL3_FCSEL3 | S3C_SDHCI_CTRL3_FCSEL2);
+ writel(ctrl, host->ioaddr + S3C_SDHCI_CONTROL3);
}
/**
--
1.6.6.rc2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/2] arm: samsung: remove sdhci default configuration setup platform helper
2011-09-02 15:18 ` [PATCH 1/2] mmc: sdhci-s3c: add default controller configuration Thomas Abraham
@ 2011-09-02 15:18 ` Thomas Abraham
2011-09-05 5:16 ` Kukjin Kim
2011-09-05 1:31 ` [PATCH 1/2] mmc: sdhci-s3c: add default controller configuration Jaehoon Chung
2011-09-05 5:16 ` Kukjin Kim
2 siblings, 1 reply; 10+ messages in thread
From: Thomas Abraham @ 2011-09-02 15:18 UTC (permalink / raw)
To: linux-arm-kernel
The sdhci platform helper function that sets up the default controller
configuration is removed for all Samsung platforms since such default
controller configuration can be handled by the driver.
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
---
arch/arm/mach-exynos4/setup-sdhci.c | 47 -----------------------
arch/arm/mach-s3c2416/setup-sdhci.c | 37 ------------------
arch/arm/mach-s3c64xx/setup-sdhci.c | 48 -----------------------
arch/arm/mach-s5pc100/setup-sdhci.c | 42 --------------------
arch/arm/mach-s5pv210/setup-sdhci.c | 41 --------------------
arch/arm/plat-samsung/dev-hsmmc.c | 2 -
arch/arm/plat-samsung/dev-hsmmc1.c | 2 -
arch/arm/plat-samsung/dev-hsmmc2.c | 2 -
arch/arm/plat-samsung/dev-hsmmc3.c | 2 -
arch/arm/plat-samsung/include/plat/sdhci.h | 57 ----------------------------
10 files changed, 0 insertions(+), 280 deletions(-)
diff --git a/arch/arm/mach-exynos4/setup-sdhci.c b/arch/arm/mach-exynos4/setup-sdhci.c
index 1e83f8c..92937b4 100644
--- a/arch/arm/mach-exynos4/setup-sdhci.c
+++ b/arch/arm/mach-exynos4/setup-sdhci.c
@@ -10,16 +10,7 @@
* published by the Free Software Foundation.
*/
-#include <linux/kernel.h>
#include <linux/types.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-#include <linux/io.h>
-
-#include <linux/mmc/card.h>
-#include <linux/mmc/host.h>
-
-#include <plat/regs-sdhci.h>
/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
@@ -29,41 +20,3 @@ char *exynos4_hsmmc_clksrcs[4] = {
[2] = "sclk_mmc", /* mmc_bus */
[3] = NULL,
};
-
-void exynos4_setup_sdhci_cfg_card(struct platform_device *dev, void __iomem *r,
- struct mmc_ios *ios, struct mmc_card *card)
-{
- u32 ctrl2, ctrl3;
-
- /* don't need to alter anything according to card-type */
-
- ctrl2 = readl(r + S3C_SDHCI_CONTROL2);
-
- /* select base clock source to HCLK */
-
- ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
-
- /*
- * clear async mode, enable conflict mask, rx feedback ctrl, SD
- * clk hold and no use debounce count
- */
-
- ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
- S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
- S3C_SDHCI_CTRL2_ENFBCLKRX |
- S3C_SDHCI_CTRL2_DFCNT_NONE |
- S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
-
- /* Tx and Rx feedback clock delay control */
-
- if (ios->clock < 25 * 1000000)
- ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
- S3C_SDHCI_CTRL3_FCSEL2 |
- S3C_SDHCI_CTRL3_FCSEL1 |
- S3C_SDHCI_CTRL3_FCSEL0);
- else
- ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
-
- writel(ctrl2, r + S3C_SDHCI_CONTROL2);
- writel(ctrl3, r + S3C_SDHCI_CONTROL3);
-}
diff --git a/arch/arm/mach-s3c2416/setup-sdhci.c b/arch/arm/mach-s3c2416/setup-sdhci.c
index ed34fad..cee5395 100644
--- a/arch/arm/mach-s3c2416/setup-sdhci.c
+++ b/arch/arm/mach-s3c2416/setup-sdhci.c
@@ -12,17 +12,7 @@
* published by the Free Software Foundation.
*/
-#include <linux/kernel.h>
#include <linux/types.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-#include <linux/io.h>
-
-#include <linux/mmc/card.h>
-#include <linux/mmc/host.h>
-
-#include <plat/regs-sdhci.h>
-#include <plat/sdhci.h>
/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
@@ -32,30 +22,3 @@ char *s3c2416_hsmmc_clksrcs[4] = {
[2] = "hsmmc-if",
/* [3] = "48m", - note not successfully used yet */
};
-
-void s3c2416_setup_sdhci_cfg_card(struct platform_device *dev,
- void __iomem *r,
- struct mmc_ios *ios,
- struct mmc_card *card)
-{
- u32 ctrl2, ctrl3;
-
- ctrl2 = __raw_readl(r + S3C_SDHCI_CONTROL2);
- ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
- ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
- S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
- S3C_SDHCI_CTRL2_ENFBCLKRX |
- S3C_SDHCI_CTRL2_DFCNT_NONE |
- S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
-
- if (ios->clock < 25 * 1000000)
- ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
- S3C_SDHCI_CTRL3_FCSEL2 |
- S3C_SDHCI_CTRL3_FCSEL1 |
- S3C_SDHCI_CTRL3_FCSEL0);
- else
- ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
-
- __raw_writel(ctrl2, r + S3C_SDHCI_CONTROL2);
- __raw_writel(ctrl3, r + S3C_SDHCI_CONTROL3);
-}
diff --git a/arch/arm/mach-s3c64xx/setup-sdhci.c b/arch/arm/mach-s3c64xx/setup-sdhci.c
index f344a22..c75a71b 100644
--- a/arch/arm/mach-s3c64xx/setup-sdhci.c
+++ b/arch/arm/mach-s3c64xx/setup-sdhci.c
@@ -12,17 +12,7 @@
* published by the Free Software Foundation.
*/
-#include <linux/kernel.h>
#include <linux/types.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-#include <linux/io.h>
-
-#include <linux/mmc/card.h>
-#include <linux/mmc/host.h>
-
-#include <plat/regs-sdhci.h>
-#include <plat/sdhci.h>
/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
@@ -32,41 +22,3 @@ char *s3c64xx_hsmmc_clksrcs[4] = {
[2] = "mmc_bus",
/* [3] = "48m", - note not successfully used yet */
};
-
-void s3c6400_setup_sdhci_cfg_card(struct platform_device *dev,
- void __iomem *r,
- struct mmc_ios *ios,
- struct mmc_card *card)
-{
- u32 ctrl2, ctrl3;
-
- ctrl2 = readl(r + S3C_SDHCI_CONTROL2);
- ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
- ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
- S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
- S3C_SDHCI_CTRL2_ENFBCLKRX |
- S3C_SDHCI_CTRL2_DFCNT_NONE |
- S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
-
- if (ios->clock < 25 * 1000000)
- ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
- S3C_SDHCI_CTRL3_FCSEL2 |
- S3C_SDHCI_CTRL3_FCSEL1 |
- S3C_SDHCI_CTRL3_FCSEL0);
- else
- ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
-
- pr_debug("%s: CTRL 2=%08x, 3=%08x\n", __func__, ctrl2, ctrl3);
- writel(ctrl2, r + S3C_SDHCI_CONTROL2);
- writel(ctrl3, r + S3C_SDHCI_CONTROL3);
-}
-
-void s3c6410_setup_sdhci_cfg_card(struct platform_device *dev,
- void __iomem *r,
- struct mmc_ios *ios,
- struct mmc_card *card)
-{
- writel(S3C64XX_SDHCI_CONTROL4_DRIVE_9mA, r + S3C64XX_SDHCI_CONTROL4);
-
- s3c6400_setup_sdhci_cfg_card(dev, r, ios, card);
-}
diff --git a/arch/arm/mach-s5pc100/setup-sdhci.c b/arch/arm/mach-s5pc100/setup-sdhci.c
index be25879..6418c6e 100644
--- a/arch/arm/mach-s5pc100/setup-sdhci.c
+++ b/arch/arm/mach-s5pc100/setup-sdhci.c
@@ -11,17 +11,7 @@
* published by the Free Software Foundation.
*/
-#include <linux/kernel.h>
#include <linux/types.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-#include <linux/io.h>
-
-#include <linux/mmc/card.h>
-#include <linux/mmc/host.h>
-
-#include <plat/regs-sdhci.h>
-#include <plat/sdhci.h>
/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
@@ -31,35 +21,3 @@ char *s5pc100_hsmmc_clksrcs[4] = {
[2] = "sclk_mmc", /* mmc_bus */
/* [3] = "48m", - note not successfully used yet */
};
-
-
-void s5pc100_setup_sdhci0_cfg_card(struct platform_device *dev,
- void __iomem *r,
- struct mmc_ios *ios,
- struct mmc_card *card)
-{
- u32 ctrl2, ctrl3;
-
- /* don't need to alter anything according to card-type */
-
- writel(S3C64XX_SDHCI_CONTROL4_DRIVE_9mA, r + S3C64XX_SDHCI_CONTROL4);
-
- ctrl2 = readl(r + S3C_SDHCI_CONTROL2);
- ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
- ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
- S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
- S3C_SDHCI_CTRL2_ENFBCLKRX |
- S3C_SDHCI_CTRL2_DFCNT_NONE |
- S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
-
- if (ios->clock < 25 * 1000000)
- ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
- S3C_SDHCI_CTRL3_FCSEL2 |
- S3C_SDHCI_CTRL3_FCSEL1 |
- S3C_SDHCI_CTRL3_FCSEL0);
- else
- ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
-
- writel(ctrl2, r + S3C_SDHCI_CONTROL2);
- writel(ctrl3, r + S3C_SDHCI_CONTROL3);
-}
diff --git a/arch/arm/mach-s5pv210/setup-sdhci.c b/arch/arm/mach-s5pv210/setup-sdhci.c
index a83b6c9..6b8ccc4 100644
--- a/arch/arm/mach-s5pv210/setup-sdhci.c
+++ b/arch/arm/mach-s5pv210/setup-sdhci.c
@@ -10,17 +10,7 @@
* published by the Free Software Foundation.
*/
-#include <linux/kernel.h>
#include <linux/types.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-#include <linux/io.h>
-
-#include <linux/mmc/card.h>
-#include <linux/mmc/host.h>
-
-#include <plat/regs-sdhci.h>
-#include <plat/sdhci.h>
/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
@@ -30,34 +20,3 @@ char *s5pv210_hsmmc_clksrcs[4] = {
[2] = "sclk_mmc", /* mmc_bus */
/* [3] = NULL, - reserved */
};
-
-void s5pv210_setup_sdhci_cfg_card(struct platform_device *dev,
- void __iomem *r,
- struct mmc_ios *ios,
- struct mmc_card *card)
-{
- u32 ctrl2, ctrl3;
-
- /* don't need to alter anything according to card-type */
-
- writel(S3C64XX_SDHCI_CONTROL4_DRIVE_9mA, r + S3C64XX_SDHCI_CONTROL4);
-
- ctrl2 = readl(r + S3C_SDHCI_CONTROL2);
- ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
- ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
- S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
- S3C_SDHCI_CTRL2_ENFBCLKRX |
- S3C_SDHCI_CTRL2_DFCNT_NONE |
- S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
-
- if (ios->clock < 25 * 1000000)
- ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
- S3C_SDHCI_CTRL3_FCSEL2 |
- S3C_SDHCI_CTRL3_FCSEL1 |
- S3C_SDHCI_CTRL3_FCSEL0);
- else
- ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
-
- writel(ctrl2, r + S3C_SDHCI_CONTROL2);
- writel(ctrl3, r + S3C_SDHCI_CONTROL3);
-}
diff --git a/arch/arm/plat-samsung/dev-hsmmc.c b/arch/arm/plat-samsung/dev-hsmmc.c
index db7a65c..5f15bf7 100644
--- a/arch/arm/plat-samsung/dev-hsmmc.c
+++ b/arch/arm/plat-samsung/dev-hsmmc.c
@@ -70,8 +70,6 @@ void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd)
set->max_width = pd->max_width;
if (pd->cfg_gpio)
set->cfg_gpio = pd->cfg_gpio;
- if (pd->cfg_card)
- set->cfg_card = pd->cfg_card;
if (pd->host_caps)
set->host_caps |= pd->host_caps;
if (pd->clk_type)
diff --git a/arch/arm/plat-samsung/dev-hsmmc1.c b/arch/arm/plat-samsung/dev-hsmmc1.c
index 2497321..2249794 100644
--- a/arch/arm/plat-samsung/dev-hsmmc1.c
+++ b/arch/arm/plat-samsung/dev-hsmmc1.c
@@ -70,8 +70,6 @@ void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd)
set->max_width = pd->max_width;
if (pd->cfg_gpio)
set->cfg_gpio = pd->cfg_gpio;
- if (pd->cfg_card)
- set->cfg_card = pd->cfg_card;
if (pd->host_caps)
set->host_caps |= pd->host_caps;
if (pd->clk_type)
diff --git a/arch/arm/plat-samsung/dev-hsmmc2.c b/arch/arm/plat-samsung/dev-hsmmc2.c
index f60aedb..58af1eb 100644
--- a/arch/arm/plat-samsung/dev-hsmmc2.c
+++ b/arch/arm/plat-samsung/dev-hsmmc2.c
@@ -71,8 +71,6 @@ void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd)
set->max_width = pd->max_width;
if (pd->cfg_gpio)
set->cfg_gpio = pd->cfg_gpio;
- if (pd->cfg_card)
- set->cfg_card = pd->cfg_card;
if (pd->host_caps)
set->host_caps |= pd->host_caps;
if (pd->clk_type)
diff --git a/arch/arm/plat-samsung/dev-hsmmc3.c b/arch/arm/plat-samsung/dev-hsmmc3.c
index ede776f..bb44271 100644
--- a/arch/arm/plat-samsung/dev-hsmmc3.c
+++ b/arch/arm/plat-samsung/dev-hsmmc3.c
@@ -74,8 +74,6 @@ void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd)
set->max_width = pd->max_width;
if (pd->cfg_gpio)
set->cfg_gpio = pd->cfg_gpio;
- if (pd->cfg_card)
- set->cfg_card = pd->cfg_card;
if (pd->host_caps)
set->host_caps |= pd->host_caps;
if (pd->clk_type)
diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-samsung/include/plat/sdhci.h
index 058e096..7f57173 100644
--- a/arch/arm/plat-samsung/include/plat/sdhci.h
+++ b/arch/arm/plat-samsung/include/plat/sdhci.h
@@ -55,10 +55,6 @@ enum clk_types {
* cd_type == S3C_SDHCI_CD_GPIO
* @ext_cd_gpio_invert: invert values for external CD gpio line
* @cfg_gpio: Configure the GPIO for a specific card bit-width
- * @cfg_card: Configure the interface for a specific card and speed. This
- * is necessary the controllers and/or GPIO blocks require the
- * changing of driver-strength and other controls dependent on
- * the card and speed of operation.
*
* Initialisation data specific to either the machine or the platform
* for the device driver to use or call-back when configuring gpio or
@@ -80,10 +76,6 @@ struct s3c_sdhci_platdata {
int state));
void (*cfg_gpio)(struct platform_device *dev, int width);
- void (*cfg_card)(struct platform_device *dev,
- void __iomem *regbase,
- struct mmc_ios *ios,
- struct mmc_card *card);
};
/**
@@ -132,17 +124,11 @@ extern void exynos4_setup_sdhci3_cfg_gpio(struct platform_device *, int w);
#ifdef CONFIG_S3C2416_SETUP_SDHCI
extern char *s3c2416_hsmmc_clksrcs[4];
-extern void s3c2416_setup_sdhci_cfg_card(struct platform_device *dev,
- void __iomem *r,
- struct mmc_ios *ios,
- struct mmc_card *card);
-
static inline void s3c2416_default_sdhci0(void)
{
#ifdef CONFIG_S3C_DEV_HSMMC
s3c_hsmmc0_def_platdata.clocks = s3c2416_hsmmc_clksrcs;
s3c_hsmmc0_def_platdata.cfg_gpio = s3c2416_setup_sdhci0_cfg_gpio;
- s3c_hsmmc0_def_platdata.cfg_card = s3c2416_setup_sdhci_cfg_card;
#endif /* CONFIG_S3C_DEV_HSMMC */
}
@@ -151,7 +137,6 @@ static inline void s3c2416_default_sdhci1(void)
#ifdef CONFIG_S3C_DEV_HSMMC1
s3c_hsmmc1_def_platdata.clocks = s3c2416_hsmmc_clksrcs;
s3c_hsmmc1_def_platdata.cfg_gpio = s3c2416_setup_sdhci1_cfg_gpio;
- s3c_hsmmc1_def_platdata.cfg_card = s3c2416_setup_sdhci_cfg_card;
#endif /* CONFIG_S3C_DEV_HSMMC1 */
}
@@ -165,17 +150,11 @@ static inline void s3c2416_default_sdhci1(void) { }
#ifdef CONFIG_S3C64XX_SETUP_SDHCI
extern char *s3c64xx_hsmmc_clksrcs[4];
-extern void s3c6400_setup_sdhci_cfg_card(struct platform_device *dev,
- void __iomem *r,
- struct mmc_ios *ios,
- struct mmc_card *card);
-
static inline void s3c6400_default_sdhci0(void)
{
#ifdef CONFIG_S3C_DEV_HSMMC
s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
- s3c_hsmmc0_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card;
#endif
}
@@ -184,7 +163,6 @@ static inline void s3c6400_default_sdhci1(void)
#ifdef CONFIG_S3C_DEV_HSMMC1
s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
- s3c_hsmmc1_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card;
#endif
}
@@ -193,21 +171,14 @@ static inline void s3c6400_default_sdhci2(void)
#ifdef CONFIG_S3C_DEV_HSMMC2
s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
- s3c_hsmmc2_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card;
#endif
}
-extern void s3c6410_setup_sdhci_cfg_card(struct platform_device *dev,
- void __iomem *r,
- struct mmc_ios *ios,
- struct mmc_card *card);
-
static inline void s3c6410_default_sdhci0(void)
{
#ifdef CONFIG_S3C_DEV_HSMMC
s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
- s3c_hsmmc0_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card;
#endif
}
@@ -216,7 +187,6 @@ static inline void s3c6410_default_sdhci1(void)
#ifdef CONFIG_S3C_DEV_HSMMC1
s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
- s3c_hsmmc1_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card;
#endif
}
@@ -225,7 +195,6 @@ static inline void s3c6410_default_sdhci2(void)
#ifdef CONFIG_S3C_DEV_HSMMC2
s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
- s3c_hsmmc2_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card;
#endif
}
@@ -244,17 +213,11 @@ static inline void s3c6400_default_sdhci2(void) { }
#ifdef CONFIG_S5PC100_SETUP_SDHCI
extern char *s5pc100_hsmmc_clksrcs[4];
-extern void s5pc100_setup_sdhci0_cfg_card(struct platform_device *dev,
- void __iomem *r,
- struct mmc_ios *ios,
- struct mmc_card *card);
-
static inline void s5pc100_default_sdhci0(void)
{
#ifdef CONFIG_S3C_DEV_HSMMC
s3c_hsmmc0_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
s3c_hsmmc0_def_platdata.cfg_gpio = s5pc100_setup_sdhci0_cfg_gpio;
- s3c_hsmmc0_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card;
#endif
}
@@ -263,7 +226,6 @@ static inline void s5pc100_default_sdhci1(void)
#ifdef CONFIG_S3C_DEV_HSMMC1
s3c_hsmmc1_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
s3c_hsmmc1_def_platdata.cfg_gpio = s5pc100_setup_sdhci1_cfg_gpio;
- s3c_hsmmc1_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card;
#endif
}
@@ -272,7 +234,6 @@ static inline void s5pc100_default_sdhci2(void)
#ifdef CONFIG_S3C_DEV_HSMMC2
s3c_hsmmc2_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
s3c_hsmmc2_def_platdata.cfg_gpio = s5pc100_setup_sdhci2_cfg_gpio;
- s3c_hsmmc2_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card;
#endif
}
@@ -288,17 +249,11 @@ static inline void s5pc100_default_sdhci2(void) { }
#ifdef CONFIG_S5PV210_SETUP_SDHCI
extern char *s5pv210_hsmmc_clksrcs[4];
-extern void s5pv210_setup_sdhci_cfg_card(struct platform_device *dev,
- void __iomem *r,
- struct mmc_ios *ios,
- struct mmc_card *card);
-
static inline void s5pv210_default_sdhci0(void)
{
#ifdef CONFIG_S3C_DEV_HSMMC
s3c_hsmmc0_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
s3c_hsmmc0_def_platdata.cfg_gpio = s5pv210_setup_sdhci0_cfg_gpio;
- s3c_hsmmc0_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card;
#endif
}
@@ -307,7 +262,6 @@ static inline void s5pv210_default_sdhci1(void)
#ifdef CONFIG_S3C_DEV_HSMMC1
s3c_hsmmc1_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
s3c_hsmmc1_def_platdata.cfg_gpio = s5pv210_setup_sdhci1_cfg_gpio;
- s3c_hsmmc1_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card;
#endif
}
@@ -316,7 +270,6 @@ static inline void s5pv210_default_sdhci2(void)
#ifdef CONFIG_S3C_DEV_HSMMC2
s3c_hsmmc2_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
s3c_hsmmc2_def_platdata.cfg_gpio = s5pv210_setup_sdhci2_cfg_gpio;
- s3c_hsmmc2_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card;
#endif
}
@@ -325,7 +278,6 @@ static inline void s5pv210_default_sdhci3(void)
#ifdef CONFIG_S3C_DEV_HSMMC3
s3c_hsmmc3_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
s3c_hsmmc3_def_platdata.cfg_gpio = s5pv210_setup_sdhci3_cfg_gpio;
- s3c_hsmmc3_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card;
#endif
}
@@ -341,17 +293,11 @@ static inline void s5pv210_default_sdhci3(void) { }
#ifdef CONFIG_EXYNOS4_SETUP_SDHCI
extern char *exynos4_hsmmc_clksrcs[4];
-extern void exynos4_setup_sdhci_cfg_card(struct platform_device *dev,
- void __iomem *r,
- struct mmc_ios *ios,
- struct mmc_card *card);
-
static inline void exynos4_default_sdhci0(void)
{
#ifdef CONFIG_S3C_DEV_HSMMC
s3c_hsmmc0_def_platdata.clocks = exynos4_hsmmc_clksrcs;
s3c_hsmmc0_def_platdata.cfg_gpio = exynos4_setup_sdhci0_cfg_gpio;
- s3c_hsmmc0_def_platdata.cfg_card = exynos4_setup_sdhci_cfg_card;
#endif
}
@@ -360,7 +306,6 @@ static inline void exynos4_default_sdhci1(void)
#ifdef CONFIG_S3C_DEV_HSMMC1
s3c_hsmmc1_def_platdata.clocks = exynos4_hsmmc_clksrcs;
s3c_hsmmc1_def_platdata.cfg_gpio = exynos4_setup_sdhci1_cfg_gpio;
- s3c_hsmmc1_def_platdata.cfg_card = exynos4_setup_sdhci_cfg_card;
#endif
}
@@ -369,7 +314,6 @@ static inline void exynos4_default_sdhci2(void)
#ifdef CONFIG_S3C_DEV_HSMMC2
s3c_hsmmc2_def_platdata.clocks = exynos4_hsmmc_clksrcs;
s3c_hsmmc2_def_platdata.cfg_gpio = exynos4_setup_sdhci2_cfg_gpio;
- s3c_hsmmc2_def_platdata.cfg_card = exynos4_setup_sdhci_cfg_card;
#endif
}
@@ -378,7 +322,6 @@ static inline void exynos4_default_sdhci3(void)
#ifdef CONFIG_S3C_DEV_HSMMC3
s3c_hsmmc3_def_platdata.clocks = exynos4_hsmmc_clksrcs;
s3c_hsmmc3_def_platdata.cfg_gpio = exynos4_setup_sdhci3_cfg_gpio;
- s3c_hsmmc3_def_platdata.cfg_card = exynos4_setup_sdhci_cfg_card;
#endif
}
--
1.6.6.rc2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 1/2] mmc: sdhci-s3c: add default controller configuration
2011-09-02 15:18 ` [PATCH 1/2] mmc: sdhci-s3c: add default controller configuration Thomas Abraham
2011-09-02 15:18 ` [PATCH 2/2] arm: samsung: remove sdhci default configuration setup platform helper Thomas Abraham
@ 2011-09-05 1:31 ` Jaehoon Chung
2011-09-05 7:58 ` Thomas Abraham
2011-09-05 5:16 ` Kukjin Kim
2 siblings, 1 reply; 10+ messages in thread
From: Jaehoon Chung @ 2011-09-05 1:31 UTC (permalink / raw)
To: linux-arm-kernel
Hi Thomas.
I have some question. This patch looks good.
Some names are used S3C_SDHCI_xxxx. but some names are used S3C64XX_SDHCI_xxxx.
Do you know what differ them?
Thanks,
Jaehoon Chung
Thomas Abraham wrote:
> The default controller configuration which was previously setup by
> platform helper functions is moved into the driver.
>
> Cc: Ben Dooks <ben-linux@fluff.org>
> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
> ---
> drivers/mmc/host/sdhci-s3c.c | 28 +++++++++++++++++-----------
> 1 files changed, 17 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> index 2bd7bf4..d891682 100644
> --- a/drivers/mmc/host/sdhci-s3c.c
> +++ b/drivers/mmc/host/sdhci-s3c.c
> @@ -203,17 +203,23 @@ static void sdhci_s3c_set_clock(struct sdhci_host *host, unsigned int clock)
> writel(ctrl, host->ioaddr + S3C_SDHCI_CONTROL2);
> }
>
> - /* reconfigure the hardware for new clock rate */
> -
> - {
> - struct mmc_ios ios;
> -
> - ios.clock = clock;
> -
> - if (ourhost->pdata->cfg_card)
> - (ourhost->pdata->cfg_card)(ourhost->pdev, host->ioaddr,
> - &ios, NULL);
> - }
> + /* reprogram default hardware configuration */
> + writel(S3C64XX_SDHCI_CONTROL4_DRIVE_9mA,
> + host->ioaddr + S3C64XX_SDHCI_CONTROL4);
> +
> + ctrl = readl(host->ioaddr + S3C_SDHCI_CONTROL2);
> + ctrl |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
> + S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
> + S3C_SDHCI_CTRL2_ENFBCLKRX |
> + S3C_SDHCI_CTRL2_DFCNT_NONE |
> + S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
> + writel(ctrl, host->ioaddr + S3C_SDHCI_CONTROL2);
> +
> + /* reconfigure the controller for new clock rate */
> + ctrl = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
> + if (clock < 25 * 1000000)
> + ctrl |= (S3C_SDHCI_CTRL3_FCSEL3 | S3C_SDHCI_CTRL3_FCSEL2);
> + writel(ctrl, host->ioaddr + S3C_SDHCI_CONTROL3);
> }
>
> /**
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/2] mmc: sdhci-s3c: add default controller configuration
2011-09-02 15:18 ` [PATCH 1/2] mmc: sdhci-s3c: add default controller configuration Thomas Abraham
2011-09-02 15:18 ` [PATCH 2/2] arm: samsung: remove sdhci default configuration setup platform helper Thomas Abraham
2011-09-05 1:31 ` [PATCH 1/2] mmc: sdhci-s3c: add default controller configuration Jaehoon Chung
@ 2011-09-05 5:16 ` Kukjin Kim
2011-09-05 8:29 ` Thomas Abraham
2 siblings, 1 reply; 10+ messages in thread
From: Kukjin Kim @ 2011-09-05 5:16 UTC (permalink / raw)
To: linux-arm-kernel
Thomas Abraham wrote:
>
> The default controller configuration which was previously setup by
> platform helper functions is moved into the driver.
>
> Cc: Ben Dooks <ben-linux@fluff.org>
> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
> ---
> drivers/mmc/host/sdhci-s3c.c | 28 +++++++++++++++++-----------
> 1 files changed, 17 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> index 2bd7bf4..d891682 100644
> --- a/drivers/mmc/host/sdhci-s3c.c
> +++ b/drivers/mmc/host/sdhci-s3c.c
> @@ -203,17 +203,23 @@ static void sdhci_s3c_set_clock(struct sdhci_host
*host,
> unsigned int clock)
> writel(ctrl, host->ioaddr + S3C_SDHCI_CONTROL2);
> }
>
> - /* reconfigure the hardware for new clock rate */
> -
> - {
> - struct mmc_ios ios;
> -
> - ios.clock = clock;
> -
> - if (ourhost->pdata->cfg_card)
> - (ourhost->pdata->cfg_card)(ourhost->pdev, host-
> >ioaddr,
> - &ios, NULL);
> - }
> + /* reprogram default hardware configuration */
> + writel(S3C64XX_SDHCI_CONTROL4_DRIVE_9mA,
> + host->ioaddr + S3C64XX_SDHCI_CONTROL4);
Since there are above codes on only S5PC100 and S5PV210, I'm not sure above
is needed on other Samsung SoCs.
I need to sort out checking.
> +
> + ctrl = readl(host->ioaddr + S3C_SDHCI_CONTROL2);
+ ctrl &= S3C_SDHCI_CTRL2_SELBASECLK_MASK; ?
> + ctrl |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
> + S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
> + S3C_SDHCI_CTRL2_ENFBCLKRX |
> + S3C_SDHCI_CTRL2_DFCNT_NONE |
> + S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
> + writel(ctrl, host->ioaddr + S3C_SDHCI_CONTROL2);
> +
> + /* reconfigure the controller for new clock rate */
> + ctrl = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
> + if (clock < 25 * 1000000)
> + ctrl |= (S3C_SDHCI_CTRL3_FCSEL3 |
> S3C_SDHCI_CTRL3_FCSEL2);
> + writel(ctrl, host->ioaddr + S3C_SDHCI_CONTROL3);
> }
>
> /**
> --
Basically, it's good to move common codes and to remove that. But I'm not
sure we don't _really_ need to keep SoC specific control function such as
cfg_card().
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/2] arm: samsung: remove sdhci default configuration setup platform helper
2011-09-02 15:18 ` [PATCH 2/2] arm: samsung: remove sdhci default configuration setup platform helper Thomas Abraham
@ 2011-09-05 5:16 ` Kukjin Kim
2011-09-05 10:13 ` Thomas Abraham
0 siblings, 1 reply; 10+ messages in thread
From: Kukjin Kim @ 2011-09-05 5:16 UTC (permalink / raw)
To: linux-arm-kernel
Thomas Abraham wrote:
>
> The sdhci platform helper function that sets up the default controller
> configuration is removed for all Samsung platforms since such default
> controller configuration can be handled by the driver.
>
> Cc: Ben Dooks <ben-linux@fluff.org>
> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
> ---
> arch/arm/mach-exynos4/setup-sdhci.c | 47 -----------------------
> arch/arm/mach-s3c2416/setup-sdhci.c | 37 ------------------
> arch/arm/mach-s3c64xx/setup-sdhci.c | 48 -----------------------
> arch/arm/mach-s5pc100/setup-sdhci.c | 42 --------------------
> arch/arm/mach-s5pv210/setup-sdhci.c | 41 --------------------
> arch/arm/plat-samsung/dev-hsmmc.c | 2 -
> arch/arm/plat-samsung/dev-hsmmc1.c | 2 -
> arch/arm/plat-samsung/dev-hsmmc2.c | 2 -
> arch/arm/plat-samsung/dev-hsmmc3.c | 2 -
> arch/arm/plat-samsung/include/plat/sdhci.h | 57
----------------------------
> 10 files changed, 0 insertions(+), 280 deletions(-)
>
> diff --git a/arch/arm/mach-exynos4/setup-sdhci.c
b/arch/arm/mach-exynos4/setup-
> sdhci.c
> index 1e83f8c..92937b4 100644
> --- a/arch/arm/mach-exynos4/setup-sdhci.c
> +++ b/arch/arm/mach-exynos4/setup-sdhci.c
> @@ -10,16 +10,7 @@
> * published by the Free Software Foundation.
> */
>
> -#include <linux/kernel.h>
> #include <linux/types.h>
> -#include <linux/interrupt.h>
> -#include <linux/platform_device.h>
> -#include <linux/io.h>
> -
> -#include <linux/mmc/card.h>
> -#include <linux/mmc/host.h>
> -
> -#include <plat/regs-sdhci.h>
>
> /* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
>
> @@ -29,41 +20,3 @@ char *exynos4_hsmmc_clksrcs[4] = {
> [2] = "sclk_mmc", /* mmc_bus */
> [3] = NULL,
> };
> -
> -void exynos4_setup_sdhci_cfg_card(struct platform_device *dev, void
__iomem
> *r,
> - struct mmc_ios *ios, struct mmc_card
*card)
> -{
> - u32 ctrl2, ctrl3;
> -
> - /* don't need to alter anything according to card-type */
> -
> - ctrl2 = readl(r + S3C_SDHCI_CONTROL2);
> -
> - /* select base clock source to HCLK */
> -
> - ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
> -
> - /*
> - * clear async mode, enable conflict mask, rx feedback ctrl, SD
> - * clk hold and no use debounce count
> - */
> -
> - ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
> - S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
> - S3C_SDHCI_CTRL2_ENFBCLKRX |
> - S3C_SDHCI_CTRL2_DFCNT_NONE |
> - S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
> -
> - /* Tx and Rx feedback clock delay control */
> -
> - if (ios->clock < 25 * 1000000)
> - ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
> - S3C_SDHCI_CTRL3_FCSEL2 |
> - S3C_SDHCI_CTRL3_FCSEL1 |
> - S3C_SDHCI_CTRL3_FCSEL0);
> - else
> - ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 |
> S3C_SDHCI_CTRL3_FCSEL0);
> -
> - writel(ctrl2, r + S3C_SDHCI_CONTROL2);
> - writel(ctrl3, r + S3C_SDHCI_CONTROL3);
> -}
> diff --git a/arch/arm/mach-s3c2416/setup-sdhci.c
b/arch/arm/mach-s3c2416/setup-
> sdhci.c
> index ed34fad..cee5395 100644
> --- a/arch/arm/mach-s3c2416/setup-sdhci.c
> +++ b/arch/arm/mach-s3c2416/setup-sdhci.c
> @@ -12,17 +12,7 @@
> * published by the Free Software Foundation.
> */
>
> -#include <linux/kernel.h>
> #include <linux/types.h>
> -#include <linux/interrupt.h>
> -#include <linux/platform_device.h>
> -#include <linux/io.h>
> -
> -#include <linux/mmc/card.h>
> -#include <linux/mmc/host.h>
> -
> -#include <plat/regs-sdhci.h>
> -#include <plat/sdhci.h>
>
> /* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
>
> @@ -32,30 +22,3 @@ char *s3c2416_hsmmc_clksrcs[4] = {
> [2] = "hsmmc-if",
> /* [3] = "48m", - note not successfully used yet */
> };
> -
> -void s3c2416_setup_sdhci_cfg_card(struct platform_device *dev,
> - void __iomem *r,
> - struct mmc_ios *ios,
> - struct mmc_card *card)
> -{
> - u32 ctrl2, ctrl3;
> -
> - ctrl2 = __raw_readl(r + S3C_SDHCI_CONTROL2);
> - ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
> - ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
> - S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
> - S3C_SDHCI_CTRL2_ENFBCLKRX |
> - S3C_SDHCI_CTRL2_DFCNT_NONE |
> - S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
> -
> - if (ios->clock < 25 * 1000000)
> - ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
> - S3C_SDHCI_CTRL3_FCSEL2 |
> - S3C_SDHCI_CTRL3_FCSEL1 |
> - S3C_SDHCI_CTRL3_FCSEL0);
> - else
> - ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 |
> S3C_SDHCI_CTRL3_FCSEL0);
> -
> - __raw_writel(ctrl2, r + S3C_SDHCI_CONTROL2);
> - __raw_writel(ctrl3, r + S3C_SDHCI_CONTROL3);
> -}
> diff --git a/arch/arm/mach-s3c64xx/setup-sdhci.c
b/arch/arm/mach-s3c64xx/setup-
> sdhci.c
> index f344a22..c75a71b 100644
> --- a/arch/arm/mach-s3c64xx/setup-sdhci.c
> +++ b/arch/arm/mach-s3c64xx/setup-sdhci.c
> @@ -12,17 +12,7 @@
> * published by the Free Software Foundation.
> */
>
> -#include <linux/kernel.h>
> #include <linux/types.h>
> -#include <linux/interrupt.h>
> -#include <linux/platform_device.h>
> -#include <linux/io.h>
> -
> -#include <linux/mmc/card.h>
> -#include <linux/mmc/host.h>
> -
> -#include <plat/regs-sdhci.h>
> -#include <plat/sdhci.h>
>
> /* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
>
> @@ -32,41 +22,3 @@ char *s3c64xx_hsmmc_clksrcs[4] = {
> [2] = "mmc_bus",
> /* [3] = "48m", - note not successfully used yet */
> };
> -
> -void s3c6400_setup_sdhci_cfg_card(struct platform_device *dev,
> - void __iomem *r,
> - struct mmc_ios *ios,
> - struct mmc_card *card)
> -{
> - u32 ctrl2, ctrl3;
> -
> - ctrl2 = readl(r + S3C_SDHCI_CONTROL2);
> - ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
> - ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
> - S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
> - S3C_SDHCI_CTRL2_ENFBCLKRX |
> - S3C_SDHCI_CTRL2_DFCNT_NONE |
> - S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
> -
> - if (ios->clock < 25 * 1000000)
> - ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
> - S3C_SDHCI_CTRL3_FCSEL2 |
> - S3C_SDHCI_CTRL3_FCSEL1 |
> - S3C_SDHCI_CTRL3_FCSEL0);
> - else
> - ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 |
> S3C_SDHCI_CTRL3_FCSEL0);
> -
> - pr_debug("%s: CTRL 2=%08x, 3=%08x\n", __func__, ctrl2, ctrl3);
> - writel(ctrl2, r + S3C_SDHCI_CONTROL2);
> - writel(ctrl3, r + S3C_SDHCI_CONTROL3);
> -}
> -
> -void s3c6410_setup_sdhci_cfg_card(struct platform_device *dev,
> - void __iomem *r,
> - struct mmc_ios *ios,
> - struct mmc_card *card)
> -{
> - writel(S3C64XX_SDHCI_CONTROL4_DRIVE_9mA, r +
> S3C64XX_SDHCI_CONTROL4);
> -
> - s3c6400_setup_sdhci_cfg_card(dev, r, ios, card);
> -}
> diff --git a/arch/arm/mach-s5pc100/setup-sdhci.c
b/arch/arm/mach-s5pc100/setup-
> sdhci.c
> index be25879..6418c6e 100644
> --- a/arch/arm/mach-s5pc100/setup-sdhci.c
> +++ b/arch/arm/mach-s5pc100/setup-sdhci.c
> @@ -11,17 +11,7 @@
> * published by the Free Software Foundation.
> */
>
> -#include <linux/kernel.h>
> #include <linux/types.h>
> -#include <linux/interrupt.h>
> -#include <linux/platform_device.h>
> -#include <linux/io.h>
> -
> -#include <linux/mmc/card.h>
> -#include <linux/mmc/host.h>
> -
> -#include <plat/regs-sdhci.h>
> -#include <plat/sdhci.h>
>
> /* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
>
> @@ -31,35 +21,3 @@ char *s5pc100_hsmmc_clksrcs[4] = {
> [2] = "sclk_mmc", /* mmc_bus */
> /* [3] = "48m", - note not successfully used yet */
> };
> -
> -
> -void s5pc100_setup_sdhci0_cfg_card(struct platform_device *dev,
> - void __iomem *r,
> - struct mmc_ios *ios,
> - struct mmc_card *card)
> -{
> - u32 ctrl2, ctrl3;
> -
> - /* don't need to alter anything according to card-type */
> -
> - writel(S3C64XX_SDHCI_CONTROL4_DRIVE_9mA, r +
> S3C64XX_SDHCI_CONTROL4);
> -
> - ctrl2 = readl(r + S3C_SDHCI_CONTROL2);
> - ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
> - ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
> - S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
> - S3C_SDHCI_CTRL2_ENFBCLKRX |
> - S3C_SDHCI_CTRL2_DFCNT_NONE |
> - S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
> -
> - if (ios->clock < 25 * 1000000)
> - ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
> - S3C_SDHCI_CTRL3_FCSEL2 |
> - S3C_SDHCI_CTRL3_FCSEL1 |
> - S3C_SDHCI_CTRL3_FCSEL0);
> - else
> - ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 |
> S3C_SDHCI_CTRL3_FCSEL0);
> -
> - writel(ctrl2, r + S3C_SDHCI_CONTROL2);
> - writel(ctrl3, r + S3C_SDHCI_CONTROL3);
> -}
> diff --git a/arch/arm/mach-s5pv210/setup-sdhci.c
b/arch/arm/mach-s5pv210/setup-
> sdhci.c
> index a83b6c9..6b8ccc4 100644
> --- a/arch/arm/mach-s5pv210/setup-sdhci.c
> +++ b/arch/arm/mach-s5pv210/setup-sdhci.c
> @@ -10,17 +10,7 @@
> * published by the Free Software Foundation.
> */
>
> -#include <linux/kernel.h>
> #include <linux/types.h>
> -#include <linux/interrupt.h>
> -#include <linux/platform_device.h>
> -#include <linux/io.h>
> -
> -#include <linux/mmc/card.h>
> -#include <linux/mmc/host.h>
> -
> -#include <plat/regs-sdhci.h>
> -#include <plat/sdhci.h>
>
> /* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
>
> @@ -30,34 +20,3 @@ char *s5pv210_hsmmc_clksrcs[4] = {
> [2] = "sclk_mmc", /* mmc_bus */
> /* [3] = NULL, - reserved */
> };
> -
> -void s5pv210_setup_sdhci_cfg_card(struct platform_device *dev,
> - void __iomem *r,
> - struct mmc_ios *ios,
> - struct mmc_card *card)
> -{
> - u32 ctrl2, ctrl3;
> -
> - /* don't need to alter anything according to card-type */
> -
> - writel(S3C64XX_SDHCI_CONTROL4_DRIVE_9mA, r +
> S3C64XX_SDHCI_CONTROL4);
> -
> - ctrl2 = readl(r + S3C_SDHCI_CONTROL2);
> - ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
> - ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
> - S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
> - S3C_SDHCI_CTRL2_ENFBCLKRX |
> - S3C_SDHCI_CTRL2_DFCNT_NONE |
> - S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
> -
> - if (ios->clock < 25 * 1000000)
> - ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
> - S3C_SDHCI_CTRL3_FCSEL2 |
> - S3C_SDHCI_CTRL3_FCSEL1 |
> - S3C_SDHCI_CTRL3_FCSEL0);
> - else
> - ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 |
> S3C_SDHCI_CTRL3_FCSEL0);
> -
> - writel(ctrl2, r + S3C_SDHCI_CONTROL2);
> - writel(ctrl3, r + S3C_SDHCI_CONTROL3);
> -}
> diff --git a/arch/arm/plat-samsung/dev-hsmmc.c
b/arch/arm/plat-samsung/dev-
> hsmmc.c
> index db7a65c..5f15bf7 100644
> --- a/arch/arm/plat-samsung/dev-hsmmc.c
> +++ b/arch/arm/plat-samsung/dev-hsmmc.c
> @@ -70,8 +70,6 @@ void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata
*pd)
> set->max_width = pd->max_width;
> if (pd->cfg_gpio)
> set->cfg_gpio = pd->cfg_gpio;
> - if (pd->cfg_card)
> - set->cfg_card = pd->cfg_card;
> if (pd->host_caps)
> set->host_caps |= pd->host_caps;
> if (pd->clk_type)
> diff --git a/arch/arm/plat-samsung/dev-hsmmc1.c
b/arch/arm/plat-samsung/dev-
> hsmmc1.c
> index 2497321..2249794 100644
> --- a/arch/arm/plat-samsung/dev-hsmmc1.c
> +++ b/arch/arm/plat-samsung/dev-hsmmc1.c
> @@ -70,8 +70,6 @@ void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata
*pd)
> set->max_width = pd->max_width;
> if (pd->cfg_gpio)
> set->cfg_gpio = pd->cfg_gpio;
> - if (pd->cfg_card)
> - set->cfg_card = pd->cfg_card;
> if (pd->host_caps)
> set->host_caps |= pd->host_caps;
> if (pd->clk_type)
> diff --git a/arch/arm/plat-samsung/dev-hsmmc2.c
b/arch/arm/plat-samsung/dev-
> hsmmc2.c
> index f60aedb..58af1eb 100644
> --- a/arch/arm/plat-samsung/dev-hsmmc2.c
> +++ b/arch/arm/plat-samsung/dev-hsmmc2.c
> @@ -71,8 +71,6 @@ void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata
*pd)
> set->max_width = pd->max_width;
> if (pd->cfg_gpio)
> set->cfg_gpio = pd->cfg_gpio;
> - if (pd->cfg_card)
> - set->cfg_card = pd->cfg_card;
> if (pd->host_caps)
> set->host_caps |= pd->host_caps;
> if (pd->clk_type)
> diff --git a/arch/arm/plat-samsung/dev-hsmmc3.c
b/arch/arm/plat-samsung/dev-
> hsmmc3.c
> index ede776f..bb44271 100644
> --- a/arch/arm/plat-samsung/dev-hsmmc3.c
> +++ b/arch/arm/plat-samsung/dev-hsmmc3.c
> @@ -74,8 +74,6 @@ void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata
*pd)
> set->max_width = pd->max_width;
> if (pd->cfg_gpio)
> set->cfg_gpio = pd->cfg_gpio;
> - if (pd->cfg_card)
> - set->cfg_card = pd->cfg_card;
> if (pd->host_caps)
> set->host_caps |= pd->host_caps;
> if (pd->clk_type)
> diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-
> samsung/include/plat/sdhci.h
> index 058e096..7f57173 100644
> --- a/arch/arm/plat-samsung/include/plat/sdhci.h
> +++ b/arch/arm/plat-samsung/include/plat/sdhci.h
> @@ -55,10 +55,6 @@ enum clk_types {
> * cd_type == S3C_SDHCI_CD_GPIO
> * @ext_cd_gpio_invert: invert values for external CD gpio line
> * @cfg_gpio: Configure the GPIO for a specific card bit-width
> - * @cfg_card: Configure the interface for a specific card and speed. This
> - * is necessary the controllers and/or GPIO blocks require the
> - * changing of driver-strength and other controls dependent on
> - * the card and speed of operation.
> *
> * Initialisation data specific to either the machine or the platform
> * for the device driver to use or call-back when configuring gpio or
> @@ -80,10 +76,6 @@ struct s3c_sdhci_platdata {
> int state));
>
> void (*cfg_gpio)(struct platform_device *dev, int width);
> - void (*cfg_card)(struct platform_device *dev,
> - void __iomem *regbase,
> - struct mmc_ios *ios,
> - struct mmc_card *card);
> };
>
> /**
> @@ -132,17 +124,11 @@ extern void exynos4_setup_sdhci3_cfg_gpio(struct
> platform_device *, int w);
> #ifdef CONFIG_S3C2416_SETUP_SDHCI
> extern char *s3c2416_hsmmc_clksrcs[4];
>
> -extern void s3c2416_setup_sdhci_cfg_card(struct platform_device *dev,
> - void __iomem *r,
> - struct mmc_ios *ios,
> - struct mmc_card *card);
> -
> static inline void s3c2416_default_sdhci0(void)
> {
> #ifdef CONFIG_S3C_DEV_HSMMC
> s3c_hsmmc0_def_platdata.clocks = s3c2416_hsmmc_clksrcs;
> s3c_hsmmc0_def_platdata.cfg_gpio = s3c2416_setup_sdhci0_cfg_gpio;
> - s3c_hsmmc0_def_platdata.cfg_card = s3c2416_setup_sdhci_cfg_card;
> #endif /* CONFIG_S3C_DEV_HSMMC */
> }
>
> @@ -151,7 +137,6 @@ static inline void s3c2416_default_sdhci1(void)
> #ifdef CONFIG_S3C_DEV_HSMMC1
> s3c_hsmmc1_def_platdata.clocks = s3c2416_hsmmc_clksrcs;
> s3c_hsmmc1_def_platdata.cfg_gpio = s3c2416_setup_sdhci1_cfg_gpio;
> - s3c_hsmmc1_def_platdata.cfg_card = s3c2416_setup_sdhci_cfg_card;
> #endif /* CONFIG_S3C_DEV_HSMMC1 */
> }
>
> @@ -165,17 +150,11 @@ static inline void s3c2416_default_sdhci1(void) { }
> #ifdef CONFIG_S3C64XX_SETUP_SDHCI
> extern char *s3c64xx_hsmmc_clksrcs[4];
>
> -extern void s3c6400_setup_sdhci_cfg_card(struct platform_device *dev,
> - void __iomem *r,
> - struct mmc_ios *ios,
> - struct mmc_card *card);
> -
> static inline void s3c6400_default_sdhci0(void)
> {
> #ifdef CONFIG_S3C_DEV_HSMMC
> s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
> s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
> - s3c_hsmmc0_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card;
> #endif
> }
>
> @@ -184,7 +163,6 @@ static inline void s3c6400_default_sdhci1(void)
> #ifdef CONFIG_S3C_DEV_HSMMC1
> s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
> s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
> - s3c_hsmmc1_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card;
> #endif
> }
>
> @@ -193,21 +171,14 @@ static inline void s3c6400_default_sdhci2(void)
> #ifdef CONFIG_S3C_DEV_HSMMC2
> s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
> s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
> - s3c_hsmmc2_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card;
> #endif
> }
>
> -extern void s3c6410_setup_sdhci_cfg_card(struct platform_device *dev,
> - void __iomem *r,
> - struct mmc_ios *ios,
> - struct mmc_card *card);
> -
> static inline void s3c6410_default_sdhci0(void)
> {
> #ifdef CONFIG_S3C_DEV_HSMMC
> s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
> s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
> - s3c_hsmmc0_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card;
> #endif
> }
>
> @@ -216,7 +187,6 @@ static inline void s3c6410_default_sdhci1(void)
> #ifdef CONFIG_S3C_DEV_HSMMC1
> s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
> s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
> - s3c_hsmmc1_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card;
> #endif
> }
>
> @@ -225,7 +195,6 @@ static inline void s3c6410_default_sdhci2(void)
> #ifdef CONFIG_S3C_DEV_HSMMC2
> s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
> s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
> - s3c_hsmmc2_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card;
> #endif
> }
>
> @@ -244,17 +213,11 @@ static inline void s3c6400_default_sdhci2(void) { }
> #ifdef CONFIG_S5PC100_SETUP_SDHCI
> extern char *s5pc100_hsmmc_clksrcs[4];
>
> -extern void s5pc100_setup_sdhci0_cfg_card(struct platform_device *dev,
> - void __iomem *r,
> - struct mmc_ios *ios,
> - struct mmc_card *card);
> -
> static inline void s5pc100_default_sdhci0(void)
> {
> #ifdef CONFIG_S3C_DEV_HSMMC
> s3c_hsmmc0_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
> s3c_hsmmc0_def_platdata.cfg_gpio = s5pc100_setup_sdhci0_cfg_gpio;
> - s3c_hsmmc0_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card;
> #endif
> }
>
> @@ -263,7 +226,6 @@ static inline void s5pc100_default_sdhci1(void)
> #ifdef CONFIG_S3C_DEV_HSMMC1
> s3c_hsmmc1_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
> s3c_hsmmc1_def_platdata.cfg_gpio = s5pc100_setup_sdhci1_cfg_gpio;
> - s3c_hsmmc1_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card;
> #endif
> }
>
> @@ -272,7 +234,6 @@ static inline void s5pc100_default_sdhci2(void)
> #ifdef CONFIG_S3C_DEV_HSMMC2
> s3c_hsmmc2_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
> s3c_hsmmc2_def_platdata.cfg_gpio = s5pc100_setup_sdhci2_cfg_gpio;
> - s3c_hsmmc2_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card;
> #endif
> }
>
> @@ -288,17 +249,11 @@ static inline void s5pc100_default_sdhci2(void) { }
> #ifdef CONFIG_S5PV210_SETUP_SDHCI
> extern char *s5pv210_hsmmc_clksrcs[4];
>
> -extern void s5pv210_setup_sdhci_cfg_card(struct platform_device *dev,
> - void __iomem *r,
> - struct mmc_ios *ios,
> - struct mmc_card *card);
> -
> static inline void s5pv210_default_sdhci0(void)
> {
> #ifdef CONFIG_S3C_DEV_HSMMC
> s3c_hsmmc0_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
> s3c_hsmmc0_def_platdata.cfg_gpio = s5pv210_setup_sdhci0_cfg_gpio;
> - s3c_hsmmc0_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card;
> #endif
> }
>
> @@ -307,7 +262,6 @@ static inline void s5pv210_default_sdhci1(void)
> #ifdef CONFIG_S3C_DEV_HSMMC1
> s3c_hsmmc1_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
> s3c_hsmmc1_def_platdata.cfg_gpio = s5pv210_setup_sdhci1_cfg_gpio;
> - s3c_hsmmc1_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card;
> #endif
> }
>
> @@ -316,7 +270,6 @@ static inline void s5pv210_default_sdhci2(void)
> #ifdef CONFIG_S3C_DEV_HSMMC2
> s3c_hsmmc2_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
> s3c_hsmmc2_def_platdata.cfg_gpio = s5pv210_setup_sdhci2_cfg_gpio;
> - s3c_hsmmc2_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card;
> #endif
> }
>
> @@ -325,7 +278,6 @@ static inline void s5pv210_default_sdhci3(void)
> #ifdef CONFIG_S3C_DEV_HSMMC3
> s3c_hsmmc3_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
> s3c_hsmmc3_def_platdata.cfg_gpio = s5pv210_setup_sdhci3_cfg_gpio;
> - s3c_hsmmc3_def_platdata.cfg_card = s5pv210_setup_sdhci_cfg_card;
> #endif
> }
>
> @@ -341,17 +293,11 @@ static inline void s5pv210_default_sdhci3(void) { }
> #ifdef CONFIG_EXYNOS4_SETUP_SDHCI
> extern char *exynos4_hsmmc_clksrcs[4];
>
> -extern void exynos4_setup_sdhci_cfg_card(struct platform_device *dev,
> - void __iomem *r,
> - struct mmc_ios *ios,
> - struct mmc_card *card);
> -
> static inline void exynos4_default_sdhci0(void)
> {
> #ifdef CONFIG_S3C_DEV_HSMMC
> s3c_hsmmc0_def_platdata.clocks = exynos4_hsmmc_clksrcs;
> s3c_hsmmc0_def_platdata.cfg_gpio = exynos4_setup_sdhci0_cfg_gpio;
> - s3c_hsmmc0_def_platdata.cfg_card = exynos4_setup_sdhci_cfg_card;
> #endif
> }
>
> @@ -360,7 +306,6 @@ static inline void exynos4_default_sdhci1(void)
> #ifdef CONFIG_S3C_DEV_HSMMC1
> s3c_hsmmc1_def_platdata.clocks = exynos4_hsmmc_clksrcs;
> s3c_hsmmc1_def_platdata.cfg_gpio = exynos4_setup_sdhci1_cfg_gpio;
> - s3c_hsmmc1_def_platdata.cfg_card = exynos4_setup_sdhci_cfg_card;
> #endif
> }
>
> @@ -369,7 +314,6 @@ static inline void exynos4_default_sdhci2(void)
> #ifdef CONFIG_S3C_DEV_HSMMC2
> s3c_hsmmc2_def_platdata.clocks = exynos4_hsmmc_clksrcs;
> s3c_hsmmc2_def_platdata.cfg_gpio = exynos4_setup_sdhci2_cfg_gpio;
> - s3c_hsmmc2_def_platdata.cfg_card = exynos4_setup_sdhci_cfg_card;
> #endif
> }
>
> @@ -378,7 +322,6 @@ static inline void exynos4_default_sdhci3(void)
> #ifdef CONFIG_S3C_DEV_HSMMC3
> s3c_hsmmc3_def_platdata.clocks = exynos4_hsmmc_clksrcs;
> s3c_hsmmc3_def_platdata.cfg_gpio = exynos4_setup_sdhci3_cfg_gpio;
> - s3c_hsmmc3_def_platdata.cfg_card = exynos4_setup_sdhci_cfg_card;
> #endif
> }
>
> --
> 1.6.6.rc2
Hi Thomas,
The arch/arm/plat-samsung/dev-hsmmcX.c files have been changed due to commit
61e62fcb ("ARM: SAMSUNG: Consolidate common function to set SDHCI plat
data"). So if possible please make your patch based on latest my for-next :)
If any problems, please let me know.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/2] mmc: sdhci-s3c: add default controller configuration
2011-09-05 1:31 ` [PATCH 1/2] mmc: sdhci-s3c: add default controller configuration Jaehoon Chung
@ 2011-09-05 7:58 ` Thomas Abraham
0 siblings, 0 replies; 10+ messages in thread
From: Thomas Abraham @ 2011-09-05 7:58 UTC (permalink / raw)
To: linux-arm-kernel
Hi Jaehoon,
On 5 September 2011 07:01, Jaehoon Chung <jh80.chung@samsung.com> wrote:
> Hi Thomas.
>
> I have some question. This patch looks good.
> Some names are used S3C_SDHCI_xxxx. but some names are used S3C64XX_SDHCI_xxxx.
> Do you know what differ them?
I am not sure why there are S3C_SDHCI_xxx and S3C64XX_SDHCI_xxx
macros. This patch reused the existing macros from regs-sdhci.h file.
It should be possible to rename S3C64XX_SDHCI_xxx to S3C_SDHCI_xxx.
Thanks,
Thomas.
>
> Thanks,
> Jaehoon Chung
>
[...]
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/2] mmc: sdhci-s3c: add default controller configuration
2011-09-05 5:16 ` Kukjin Kim
@ 2011-09-05 8:29 ` Thomas Abraham
0 siblings, 0 replies; 10+ messages in thread
From: Thomas Abraham @ 2011-09-05 8:29 UTC (permalink / raw)
To: linux-arm-kernel
Dear Mr. Kim,
On 5 September 2011 10:46, Kukjin Kim <kgene.kim@samsung.com> wrote:
> Thomas Abraham wrote:
>>
>> The default controller configuration which was previously setup by
>> platform helper functions is moved into the driver.
>>
>> Cc: Ben Dooks <ben-linux@fluff.org>
>> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
>> ---
>> ?drivers/mmc/host/sdhci-s3c.c | ? 28 +++++++++++++++++-----------
>> ?1 files changed, 17 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
>> index 2bd7bf4..d891682 100644
>> --- a/drivers/mmc/host/sdhci-s3c.c
>> +++ b/drivers/mmc/host/sdhci-s3c.c
>> @@ -203,17 +203,23 @@ static void sdhci_s3c_set_clock(struct sdhci_host
> *host,
>> unsigned int clock)
>> ? ? ? ? ? ? ? writel(ctrl, host->ioaddr + S3C_SDHCI_CONTROL2);
>> ? ? ? }
>>
>> - ? ? /* reconfigure the hardware for new clock rate */
>> -
>> - ? ? {
>> - ? ? ? ? ? ? struct mmc_ios ios;
>> -
>> - ? ? ? ? ? ? ios.clock = clock;
>> -
>> - ? ? ? ? ? ? if (ourhost->pdata->cfg_card)
>> - ? ? ? ? ? ? ? ? ? ? (ourhost->pdata->cfg_card)(ourhost->pdev, host-
>> >ioaddr,
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?&ios, NULL);
>> - ? ? }
>> + ? ? /* reprogram default hardware configuration */
>> + ? ? writel(S3C64XX_SDHCI_CONTROL4_DRIVE_9mA,
>> + ? ? ? ? ? ? host->ioaddr + S3C64XX_SDHCI_CONTROL4);
>
> Since there are above codes on only S5PC100 and S5PV210, I'm not sure above
> is needed on other Samsung SoCs.
>
> I need to sort out checking.
s3c6410, s5p6440, s5p6450 and s5pc110 SoC's include support for clock
out pad driver strength. All other SoC's do not use and list the two
bits as reserved. I do not know if there is any problem writing to
these reserved bits. But I have tested this patch on all the boards
that do not support this feature and it did not break anything.
>
>> +
>> + ? ? ctrl = readl(host->ioaddr + S3C_SDHCI_CONTROL2);
>
> + ? ? ? ctrl &= S3C_SDHCI_CTRL2_SELBASECLK_MASK; ?
>
>> + ? ? ctrl |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
>> + ? ? ? ? ? ? ? S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
>> + ? ? ? ? ? ? ? S3C_SDHCI_CTRL2_ENFBCLKRX |
>> + ? ? ? ? ? ? ? S3C_SDHCI_CTRL2_DFCNT_NONE |
>> + ? ? ? ? ? ? ? S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
>> + ? ? writel(ctrl, host->ioaddr + S3C_SDHCI_CONTROL2);
>> +
>> + ? ? /* reconfigure the controller for new clock rate */
>> + ? ? ctrl = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
>> + ? ? if (clock < 25 * 1000000)
>> + ? ? ? ? ? ? ctrl |= (S3C_SDHCI_CTRL3_FCSEL3 |
>> S3C_SDHCI_CTRL3_FCSEL2);
>> + ? ? writel(ctrl, host->ioaddr + S3C_SDHCI_CONTROL3);
>> ?}
>>
>> ?/**
>> --
>
> Basically, it's good to move common codes and to remove that. But I'm not
> sure we don't _really_ need to keep SoC specific control function such as
> cfg_card().
The existing cfg_card callback functions have the same functionality
except for setting the clock out drive strength on those SoC's which
do not support this feature. If writing to those reserved bits does
not cause any issues, then the cfg_card function can be made common to
all Samsung SoC's.
Since the functionality of cfg_card callback is SoC specific and not
board specific, there is another way of doing this. The id_table
member could be added to the platform_driver structure in sdhci-s3c
driver. Each SoC platform code could set the name of the sdhci device
during initialization and there could be SoC specific cfg_card
functions included in the sdhci-s3c driver itself. This would be
required only if there is a problem by writing to the reserved bits in
control4 register. But testing does not show any issues writing to
these reserved bits.
The main intention of moving the cfg_card function from platform code
to driver code is to remove the callback function pointer from the
sdhci driver platform data which is very important to get full device
tree support for sdhci-s3c driver.
Thanks for your review and comments.
Regards,
Thomas.
>
> Thanks.
>
> Best regards,
> Kgene.
> --
> Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
> SW Solution Development Team, Samsung Electronics Co., Ltd.
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/2] arm: samsung: remove sdhci default configuration setup platform helper
2011-09-05 5:16 ` Kukjin Kim
@ 2011-09-05 10:13 ` Thomas Abraham
2011-09-21 10:44 ` Kukjin Kim
0 siblings, 1 reply; 10+ messages in thread
From: Thomas Abraham @ 2011-09-05 10:13 UTC (permalink / raw)
To: linux-arm-kernel
Dear Mr. Kim,
On 5 September 2011 10:46, Kukjin Kim <kgene.kim@samsung.com> wrote:
> Thomas Abraham wrote:
>>
>> The sdhci platform helper function that sets up the default controller
>> configuration is removed for all Samsung platforms since such default
>> controller configuration can be handled by the driver.
>>
>> Cc: Ben Dooks <ben-linux@fluff.org>
>> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
>> ---
>> ?arch/arm/mach-exynos4/setup-sdhci.c ? ? ? ?| ? 47 -----------------------
>> ?arch/arm/mach-s3c2416/setup-sdhci.c ? ? ? ?| ? 37 ------------------
>> ?arch/arm/mach-s3c64xx/setup-sdhci.c ? ? ? ?| ? 48 -----------------------
>> ?arch/arm/mach-s5pc100/setup-sdhci.c ? ? ? ?| ? 42 --------------------
>> ?arch/arm/mach-s5pv210/setup-sdhci.c ? ? ? ?| ? 41 --------------------
>> ?arch/arm/plat-samsung/dev-hsmmc.c ? ? ? ? ?| ? ?2 -
>> ?arch/arm/plat-samsung/dev-hsmmc1.c ? ? ? ? | ? ?2 -
>> ?arch/arm/plat-samsung/dev-hsmmc2.c ? ? ? ? | ? ?2 -
>> ?arch/arm/plat-samsung/dev-hsmmc3.c ? ? ? ? | ? ?2 -
>> ?arch/arm/plat-samsung/include/plat/sdhci.h | ? 57
> ----------------------------
>> ?10 files changed, 0 insertions(+), 280 deletions(-)
>>
[...]
>
> Hi Thomas,
>
> The arch/arm/plat-samsung/dev-hsmmcX.c files have been changed due to commit
> 61e62fcb ("ARM: SAMSUNG: Consolidate common function to set SDHCI plat
> data"). So if possible please make your patch based on latest my for-next :)
Sure. I will base these patches on your for-next, test and resubmit.
Thanks,
Thomas.
>
> If any problems, please let me know.
>
> Thanks.
>
> Best regards,
> Kgene.
> --
> Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
> SW Solution Development Team, Samsung Electronics Co., Ltd.
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/2] arm: samsung: remove sdhci default configuration setup platform helper
2011-09-05 10:13 ` Thomas Abraham
@ 2011-09-21 10:44 ` Kukjin Kim
0 siblings, 0 replies; 10+ messages in thread
From: Kukjin Kim @ 2011-09-21 10:44 UTC (permalink / raw)
To: linux-arm-kernel
Thomas Abraham wrote:
>
> Dear Mr. Kim,
>
> On 5 September 2011 10:46, Kukjin Kim <kgene.kim@samsung.com> wrote:
> > Thomas Abraham wrote:
> >>
> >> The sdhci platform helper function that sets up the default controller
> >> configuration is removed for all Samsung platforms since such default
> >> controller configuration can be handled by the driver.
> >>
> >> Cc: Ben Dooks <ben-linux@fluff.org>
> >> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
> >> ---
> >> ?arch/arm/mach-exynos4/setup-sdhci.c ? ? ? ?| ? 47
-----------------------
> >> ?arch/arm/mach-s3c2416/setup-sdhci.c ? ? ? ?| ? 37 ------------------
> >> ?arch/arm/mach-s3c64xx/setup-sdhci.c ? ? ? ?| ? 48
-----------------------
> >> ?arch/arm/mach-s5pc100/setup-sdhci.c ? ? ? ?| ? 42 --------------------
> >> ?arch/arm/mach-s5pv210/setup-sdhci.c ? ? ? ?| ? 41 --------------------
> >> ?arch/arm/plat-samsung/dev-hsmmc.c ? ? ? ? ?| ? ?2 -
> >> ?arch/arm/plat-samsung/dev-hsmmc1.c ? ? ? ? | ? ?2 -
> >> ?arch/arm/plat-samsung/dev-hsmmc2.c ? ? ? ? | ? ?2 -
> >> ?arch/arm/plat-samsung/dev-hsmmc3.c ? ? ? ? | ? ?2 -
> >> ?arch/arm/plat-samsung/include/plat/sdhci.h | ? 57
> > ----------------------------
> >> ?10 files changed, 0 insertions(+), 280 deletions(-)
> >>
>
> [...]
>
> >
> > Hi Thomas,
> >
> > The arch/arm/plat-samsung/dev-hsmmcX.c files have been changed due to
> commit
> > 61e62fcb ("ARM: SAMSUNG: Consolidate common function to set SDHCI plat
> > data"). So if possible please make your patch based on latest my
for-next :)
>
> Sure. I will base these patches on your for-next, test and resubmit.
>
Hi Thomas,
I missed? I didn't get your updated yet.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2011-09-21 10:44 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-02 15:18 [PATCH 0/2] Move sdhci-s3c platform helper into driver Thomas Abraham
2011-09-02 15:18 ` [PATCH 1/2] mmc: sdhci-s3c: add default controller configuration Thomas Abraham
2011-09-02 15:18 ` [PATCH 2/2] arm: samsung: remove sdhci default configuration setup platform helper Thomas Abraham
2011-09-05 5:16 ` Kukjin Kim
2011-09-05 10:13 ` Thomas Abraham
2011-09-21 10:44 ` Kukjin Kim
2011-09-05 1:31 ` [PATCH 1/2] mmc: sdhci-s3c: add default controller configuration Jaehoon Chung
2011-09-05 7:58 ` Thomas Abraham
2011-09-05 5:16 ` Kukjin Kim
2011-09-05 8:29 ` Thomas Abraham
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).