ARM: SAMSUNG: Add clock types into platform data
authorJeongbae Seo <jeongbae.seo@samsung.com>
Fri, 8 Oct 2010 09:03:27 +0000 (18:03 +0900)
committerKukjin Kim <kgene.kim@samsung.com>
Mon, 25 Oct 2010 07:02:47 +0000 (16:02 +0900)
This patch adds clock types into platform data to support
external clock divider instead of internal clock divider.
It is defined that what kinds of clock type is used in machine.

Signed-off-by: Jeongbae Seo <jeongbae.seo@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
arch/arm/mach-s5pv310/mach-smdkc210.c
arch/arm/mach-s5pv310/mach-smdkv310.c
arch/arm/plat-samsung/dev-hsmmc.c
arch/arm/plat-samsung/dev-hsmmc1.c
arch/arm/plat-samsung/dev-hsmmc2.c
arch/arm/plat-samsung/dev-hsmmc3.c
arch/arm/plat-samsung/include/plat/sdhci.h

index da5e7e7788b1f14508db91a7186791c235b3361e..93d537b8dadf49b67fc42cf0c65826a3ef503647 100644 (file)
@@ -74,6 +74,7 @@ static struct s3c_sdhci_platdata smdkc210_hsmmc0_pdata __initdata = {
        .cd_type                = S3C_SDHCI_CD_GPIO,
        .ext_cd_gpio            = S5PV310_GPK0(2),
        .ext_cd_gpio_invert     = 1,
+       .clk_type               = S3C_SDHCI_CLK_DIV_EXTERNAL,
 #ifdef CONFIG_S5PV310_SDHCI_CH0_8BIT
        .max_width              = 8,
        .host_caps              = MMC_CAP_8_BIT_DATA,
@@ -84,12 +85,14 @@ static struct s3c_sdhci_platdata smdkc210_hsmmc1_pdata __initdata = {
        .cd_type                = S3C_SDHCI_CD_GPIO,
        .ext_cd_gpio            = S5PV310_GPK0(2),
        .ext_cd_gpio_invert     = 1,
+       .clk_type               = S3C_SDHCI_CLK_DIV_EXTERNAL,
 };
 
 static struct s3c_sdhci_platdata smdkc210_hsmmc2_pdata __initdata = {
        .cd_type                = S3C_SDHCI_CD_GPIO,
        .ext_cd_gpio            = S5PV310_GPK2(2),
        .ext_cd_gpio_invert     = 1,
+       .clk_type               = S3C_SDHCI_CLK_DIV_EXTERNAL,
 #ifdef CONFIG_S5PV310_SDHCI_CH2_8BIT
        .max_width              = 8,
        .host_caps              = MMC_CAP_8_BIT_DATA,
@@ -100,6 +103,7 @@ static struct s3c_sdhci_platdata smdkc210_hsmmc3_pdata __initdata = {
        .cd_type                = S3C_SDHCI_CD_GPIO,
        .ext_cd_gpio            = S5PV310_GPK2(2),
        .ext_cd_gpio_invert     = 1,
+       .clk_type               = S3C_SDHCI_CLK_DIV_EXTERNAL,
 };
 
 static struct platform_device *smdkc210_devices[] __initdata = {
index 6eff6ceac9125514cd2e13b489e3a6738a6e8bc9..10f80566516d356ed5941e66681a97bf88d25aff 100644 (file)
@@ -74,6 +74,7 @@ static struct s3c_sdhci_platdata smdkv310_hsmmc0_pdata __initdata = {
        .cd_type                = S3C_SDHCI_CD_GPIO,
        .ext_cd_gpio            = S5PV310_GPK0(2),
        .ext_cd_gpio_invert     = 1,
+       .clk_type               = S3C_SDHCI_CLK_DIV_EXTERNAL,
 #ifdef CONFIG_S5PV310_SDHCI_CH0_8BIT
        .max_width              = 8,
        .host_caps              = MMC_CAP_8_BIT_DATA,
@@ -84,12 +85,14 @@ static struct s3c_sdhci_platdata smdkv310_hsmmc1_pdata __initdata = {
        .cd_type                = S3C_SDHCI_CD_GPIO,
        .ext_cd_gpio            = S5PV310_GPK0(2),
        .ext_cd_gpio_invert     = 1,
+       .clk_type               = S3C_SDHCI_CLK_DIV_EXTERNAL,
 };
 
 static struct s3c_sdhci_platdata smdkv310_hsmmc2_pdata __initdata = {
        .cd_type                = S3C_SDHCI_CD_GPIO,
        .ext_cd_gpio            = S5PV310_GPK2(2),
        .ext_cd_gpio_invert     = 1,
+       .clk_type               = S3C_SDHCI_CLK_DIV_EXTERNAL,
 #ifdef CONFIG_S5PV310_SDHCI_CH2_8BIT
        .max_width              = 8,
        .host_caps              = MMC_CAP_8_BIT_DATA,
@@ -100,6 +103,7 @@ static struct s3c_sdhci_platdata smdkv310_hsmmc3_pdata __initdata = {
        .cd_type                = S3C_SDHCI_CD_GPIO,
        .ext_cd_gpio            = S5PV310_GPK2(2),
        .ext_cd_gpio_invert     = 1,
+       .clk_type               = S3C_SDHCI_CLK_DIV_EXTERNAL,
 };
 
 static struct platform_device *smdkv310_devices[] __initdata = {
index 5b8aacb5cbc60a9e00731ba3adaad64dc540080f..db7a65c7f127a62b93ee78ba450c6d3bbaec69a8 100644 (file)
@@ -41,6 +41,7 @@ struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata = {
        .max_width      = 4,
        .host_caps      = (MMC_CAP_4_BIT_DATA |
                           MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
+       .clk_type       = S3C_SDHCI_CLK_DIV_INTERNAL,
 };
 
 struct platform_device s3c_device_hsmmc0 = {
@@ -73,4 +74,6 @@ void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd)
                set->cfg_card = pd->cfg_card;
        if (pd->host_caps)
                set->host_caps |= pd->host_caps;
+       if (pd->clk_type)
+               set->clk_type = pd->clk_type;
 }
index 9b52828644d67da2a4c8f6bb04e0155e9aca5f15..2497321f08d7ddc3a17fb3e9eedb6293cbb6df97 100644 (file)
@@ -41,6 +41,7 @@ struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata = {
        .max_width      = 4,
        .host_caps      = (MMC_CAP_4_BIT_DATA |
                           MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
+       .clk_type       = S3C_SDHCI_CLK_DIV_INTERNAL,
 };
 
 struct platform_device s3c_device_hsmmc1 = {
@@ -73,4 +74,6 @@ void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd)
                set->cfg_card = pd->cfg_card;
        if (pd->host_caps)
                set->host_caps |= pd->host_caps;
+       if (pd->clk_type)
+               set->clk_type = pd->clk_type;
 }
index df9e36b54c0d3283160c4872c18db8028e7d9925..f60aedba417cdaea81c7d53763359a9bf0871660 100644 (file)
@@ -42,6 +42,7 @@ struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata = {
        .max_width      = 4,
        .host_caps      = (MMC_CAP_4_BIT_DATA |
                           MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
+       .clk_type       = S3C_SDHCI_CLK_DIV_INTERNAL,
 };
 
 struct platform_device s3c_device_hsmmc2 = {
@@ -74,4 +75,6 @@ void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd)
                set->cfg_card = pd->cfg_card;
        if (pd->host_caps)
                set->host_caps |= pd->host_caps;
+       if (pd->clk_type)
+               set->clk_type = pd->clk_type;
 }
index ca80897b0d7c75fd4c9d3cf5f45b5d820115f0ae..ede776f20e62eb6d42f29fe768f50db2c4b20202 100644 (file)
@@ -45,6 +45,7 @@ struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata = {
        .max_width      = 4,
        .host_caps      = (MMC_CAP_4_BIT_DATA |
                           MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
+       .clk_type       = S3C_SDHCI_CLK_DIV_INTERNAL,
 };
 
 struct platform_device s3c_device_hsmmc3 = {
@@ -77,4 +78,6 @@ void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd)
                set->cfg_card = pd->cfg_card;
        if (pd->host_caps)
                set->host_caps |= pd->host_caps;
+       if (pd->clk_type)
+               set->clk_type = pd->clk_type;
 }
index d92670ad9897efe6d0e84012515f8cdc428ded7a..85853f8c4c5dc9f1546ccd5318edd1784a47cd81 100644 (file)
@@ -28,11 +28,17 @@ enum cd_types {
        S3C_SDHCI_CD_PERMANENT, /* no CD line, card permanently wired to host */
 };
 
+enum clk_types {
+       S3C_SDHCI_CLK_DIV_INTERNAL,     /* use mmc internal clock divider */
+       S3C_SDHCI_CLK_DIV_EXTERNAL,     /* use external clock divider */
+};
+
 /**
  * struct s3c_sdhci_platdata() - Platform device data for Samsung SDHCI
  * @max_width: The maximum number of data bits supported.
  * @host_caps: Standard MMC host capabilities bit field.
  * @cd_type: Type of Card Detection method (see cd_types enum above)
+ * @clk_type: Type of clock divider method (see clk_types enum above)
  * @ext_cd_init: Initialize external card detect subsystem. Called on
  *              sdhci-s3c driver probe when cd_type == S3C_SDHCI_CD_EXTERNAL.
  *              notify_func argument is a callback to the sdhci-s3c driver
@@ -59,6 +65,7 @@ struct s3c_sdhci_platdata {
        unsigned int    max_width;
        unsigned int    host_caps;
        enum cd_types   cd_type;
+       enum clk_types  clk_type;
 
        char            **clocks;       /* set of clock sources */