Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272561
b: refs/heads/master
c: 5e8e0a1
h: refs/heads/master
i:
  272559: 1279e57
v: v3
  • Loading branch information
Banajit Goswami authored and Kukjin Kim committed Sep 16, 2011
1 parent c5761ee commit 8cce18e
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 73 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3e461977d1aff9b4d1785815f4eb2098657a0500
refs/heads/master: 5e8e0a109e3c1b08c1407c615684bb9981aca28f
19 changes: 1 addition & 18 deletions trunk/arch/arm/plat-samsung/dev-hsmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,5 @@ struct platform_device s3c_device_hsmmc0 = {

void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd)
{
struct s3c_sdhci_platdata *set = &s3c_hsmmc0_def_platdata;

set->cd_type = pd->cd_type;
set->ext_cd_init = pd->ext_cd_init;
set->ext_cd_cleanup = pd->ext_cd_cleanup;
set->ext_cd_gpio = pd->ext_cd_gpio;
set->ext_cd_gpio_invert = pd->ext_cd_gpio_invert;

if (pd->max_width)
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)
set->clk_type = pd->clk_type;
s3c_sdhci_set_platdata(pd, &s3c_hsmmc0_def_platdata);
}
19 changes: 1 addition & 18 deletions trunk/arch/arm/plat-samsung/dev-hsmmc1.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,5 @@ struct platform_device s3c_device_hsmmc1 = {

void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd)
{
struct s3c_sdhci_platdata *set = &s3c_hsmmc1_def_platdata;

set->cd_type = pd->cd_type;
set->ext_cd_init = pd->ext_cd_init;
set->ext_cd_cleanup = pd->ext_cd_cleanup;
set->ext_cd_gpio = pd->ext_cd_gpio;
set->ext_cd_gpio_invert = pd->ext_cd_gpio_invert;

if (pd->max_width)
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)
set->clk_type = pd->clk_type;
s3c_sdhci_set_platdata(pd, &s3c_hsmmc1_def_platdata);
}
19 changes: 1 addition & 18 deletions trunk/arch/arm/plat-samsung/dev-hsmmc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,5 @@ struct platform_device s3c_device_hsmmc2 = {

void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd)
{
struct s3c_sdhci_platdata *set = &s3c_hsmmc2_def_platdata;

set->cd_type = pd->cd_type;
set->ext_cd_init = pd->ext_cd_init;
set->ext_cd_cleanup = pd->ext_cd_cleanup;
set->ext_cd_gpio = pd->ext_cd_gpio;
set->ext_cd_gpio_invert = pd->ext_cd_gpio_invert;

if (pd->max_width)
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)
set->clk_type = pd->clk_type;
s3c_sdhci_set_platdata(pd, &s3c_hsmmc2_def_platdata);
}
19 changes: 1 addition & 18 deletions trunk/arch/arm/plat-samsung/dev-hsmmc3.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,5 @@ struct platform_device s3c_device_hsmmc3 = {

void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd)
{
struct s3c_sdhci_platdata *set = &s3c_hsmmc3_def_platdata;

set->cd_type = pd->cd_type;
set->ext_cd_init = pd->ext_cd_init;
set->ext_cd_cleanup = pd->ext_cd_cleanup;
set->ext_cd_gpio = pd->ext_cd_gpio;
set->ext_cd_gpio_invert = pd->ext_cd_gpio_invert;

if (pd->max_width)
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)
set->clk_type = pd->clk_type;
s3c_sdhci_set_platdata(pd, &s3c_hsmmc3_def_platdata);
}
7 changes: 7 additions & 0 deletions trunk/arch/arm/plat-samsung/include/plat/sdhci.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ struct s3c_sdhci_platdata {
struct mmc_card *card);
};

/* s3c_sdhci_set_platdata() - common helper for setting SDHCI platform data
* @pd: The default platform data for this device.
* @set: Pointer to the platform data to fill in.
*/
extern void s3c_sdhci_set_platdata(struct s3c_sdhci_platdata *pd,
struct s3c_sdhci_platdata *set);

/**
* s3c_sdhci0_set_platdata - Set platform data for S3C SDHCI device.
* @pd: Platform data to register to device.
Expand Down
22 changes: 22 additions & 0 deletions trunk/arch/arm/plat-samsung/platformdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/platform_device.h>

#include <plat/devs.h>
#include <plat/sdhci.h>

void __init *s3c_set_platdata(void *pd, size_t pdsize,
struct platform_device *pdev)
Expand All @@ -35,3 +36,24 @@ void __init *s3c_set_platdata(void *pd, size_t pdsize,
pdev->dev.platform_data = npd;
return npd;
}

void s3c_sdhci_set_platdata(struct s3c_sdhci_platdata *pd,
struct s3c_sdhci_platdata *set)
{
set->cd_type = pd->cd_type;
set->ext_cd_init = pd->ext_cd_init;
set->ext_cd_cleanup = pd->ext_cd_cleanup;
set->ext_cd_gpio = pd->ext_cd_gpio;
set->ext_cd_gpio_invert = pd->ext_cd_gpio_invert;

if (pd->max_width)
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)
set->clk_type = pd->clk_type;
}

0 comments on commit 8cce18e

Please sign in to comment.