lkml.org 
[lkml]   [2008]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch v2 08/16] MMC: S3C24XX: Add support to invert write protect line
Support for inverting the sense of the MMC driver's write
protect detection line.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>

Index: linux-2.6.26-rc5-q2/drivers/mmc/host/s3cmci.c
===================================================================
--- linux-2.6.26-rc5-q2.orig/drivers/mmc/host/s3cmci.c 2008-06-16 15:24:59.000000000 +0100
+++ linux-2.6.26-rc5-q2/drivers/mmc/host/s3cmci.c 2008-06-16 15:25:01.000000000 +0100
@@ -1076,11 +1076,18 @@ static void s3cmci_reset(struct s3cmci_h
static int s3cmci_get_ro(struct mmc_host *mmc)
{
struct s3cmci_host *host = mmc_priv(mmc);
+ struct s3c24xx_mci_pdata *pdata = host->pdata;
+ int ret;

- if (host->pdata->gpio_wprotect == 0)
+ if (pdata->gpio_wprotect == 0)
return 0;

- return s3c2410_gpio_getpin(host->pdata->gpio_wprotect);
+ ret = s3c2410_gpio_getpin(pdata->gpio_wprotect);
+
+ if (pdata->wprotect_invert)
+ ret = !ret;
+
+ return ret;
}

static struct mmc_host_ops s3cmci_ops = {
Index: linux-2.6.26-rc5-q2/include/asm-arm/arch-s3c2410/mci.h
===================================================================
--- linux-2.6.26-rc5-q2.orig/include/asm-arm/arch-s3c2410/mci.h 2008-06-16 15:24:59.000000000 +0100
+++ linux-2.6.26-rc5-q2/include/asm-arm/arch-s3c2410/mci.h 2008-06-16 15:25:01.000000000 +0100
@@ -2,6 +2,8 @@
#define _ARCH_MCI_H

struct s3c24xx_mci_pdata {
+ unsigned int wprotect_invert : 1;
+
unsigned int gpio_detect;
unsigned int gpio_wprotect;
unsigned long ocr_avail;
--
Ben (ben@fluff.org, http://www.fluff.org/)

'a smiley only costs 4 bytes'


\
 
 \ /
  Last update: 2008-06-16 16:43    [W:0.115 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site