diff -Nru --exclude-from=/sunbeam/home/laforge/scripts/dontdiff linux-2.6.17.7-new/drivers/mmc/s3c2410mci.c linux-2.6.17.7-qt/drivers/mmc/s3c2410mci.c --- linux-2.6.17.7-new/drivers/mmc/s3c2410mci.c 2006-08-07 09:25:32.000000000 +0200 +++ linux-2.6.17.7-qt/drivers/mmc/s3c2410mci.c 2006-08-07 00:55:23.000000000 +0200 @@ -515,9 +518,19 @@ } +static int s3c2410sdi_get_ro(struct mmc_host *mmc) +{ + struct s3c2410sdi_host *host = mmc_priv(mmc); + if (s3c2410_gpio_getpin(host->pdata->gpio_wprotect) != 0) + return 1; + else + return 0; +} + static struct mmc_host_ops s3c2410sdi_ops = { .request = s3c2410sdi_request, .set_ios = s3c2410sdi_set_ios, + .get_ro = s3c2410sdi_get_ro, }; static void s3c2410_mmc_def_setpower(unsigned int to) @@ -565,6 +578,8 @@ host->irq_cd = s3c2410_gpio_getirq(pdata->gpio_detect); s3c2410_gpio_cfgpin(pdata->gpio_detect, S3C2410_GPIO_IRQ); + if (pdata->gpio_wprotect) + s3c2410_gpio_cfgpin(pdata->gpio_wprotect, S3C2410_GPIO_INPUT); host->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!host->mem) {