Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 65643
b: refs/heads/master
c: faf39ed
h: refs/heads/master
i:
  65641: 9589a13
  65639: 62a8af8
v: v3
  • Loading branch information
Pavel Pisa authored and Pierre Ossman committed Sep 24, 2007
1 parent 9b5c07d commit ffa9650
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 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: af8350c756cb48a738474738f7bf8c0e572fa057
refs/heads/master: faf39ede5e6325d3e91b6e4e0017d27fbecb6022
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-imx/mx1ads.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ static struct platform_device *devices[] __initdata = {
};

#ifdef CONFIG_MMC_IMX
static int mx1ads_mmc_card_present(void)
static int mx1ads_mmc_card_present(struct device *dev)
{
/* MMC/SD Card Detect is PB 20 on MX1ADS V1.0.7 */
return (SSR(1) & (1 << 20) ? 0 : 1);
Expand Down
16 changes: 14 additions & 2 deletions trunk/drivers/mmc/host/imxmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -884,9 +884,21 @@ static void imxmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
}
}

static int imxmci_get_ro(struct mmc_host *mmc)
{
struct imxmci_host *host = mmc_priv(mmc);

if (host->pdata && host->pdata->get_ro)
return host->pdata->get_ro(mmc_dev(mmc));
/* Host doesn't support read only detection so assume writeable */
return 0;
}


static const struct mmc_host_ops imxmci_ops = {
.request = imxmci_request,
.set_ios = imxmci_set_ios,
.get_ro = imxmci_get_ro,
};

static struct resource *platform_device_resource(struct platform_device *dev, unsigned int mask, int nr)
Expand All @@ -913,7 +925,7 @@ static void imxmci_check_status(unsigned long data)
{
struct imxmci_host *host = (struct imxmci_host *)data;

if( host->pdata->card_present() != host->present ) {
if( host->pdata->card_present(mmc_dev(host->mmc)) != host->present ) {
host->present ^= 1;
dev_info(mmc_dev(host->mmc), "card %s\n",
host->present ? "inserted" : "removed");
Expand Down Expand Up @@ -1022,7 +1034,7 @@ static int imxmci_probe(struct platform_device *pdev)
if (ret)
goto out;

host->present = host->pdata->card_present();
host->present = host->pdata->card_present(mmc_dev(mmc));
init_timer(&host->timer);
host->timer.data = (unsigned long)host;
host->timer.function = imxmci_check_status;
Expand Down
5 changes: 4 additions & 1 deletion trunk/include/asm-arm/arch-imx/mmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@

#include <linux/mmc/host.h>

struct device;

struct imxmmc_platform_data {
int (*card_present)(void);
int (*card_present)(struct device *);
int (*get_ro)(struct device *);
};

extern void imx_set_mmc_info(struct imxmmc_platform_data *info);
Expand Down

0 comments on commit ffa9650

Please sign in to comment.