public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ios for mmc chip select
@ 2005-08-29 11:13 Pierre Ossman
  2005-09-03 15:46 ` Russell King
  0 siblings, 1 reply; 2+ messages in thread
From: Pierre Ossman @ 2005-08-29 11:13 UTC (permalink / raw)
  To: Russell King, LKML

[-- Attachment #1: Type: text/plain, Size: 226 bytes --]

Adds a new ios for setting the chip select pin on MMC cards. Needed on
SD controllers which use this pin for other things and therefore cannot
have it pulled high at all times.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>

[-- Attachment #2: mmc-cs.patch --]
[-- Type: text/x-patch, Size: 1554 bytes --]

Index: linux/drivers/mmc/mmc.c
===================================================================
--- linux/drivers/mmc/mmc.c	(revision 151)
+++ linux/drivers/mmc/mmc.c	(working copy)
@@ -457,6 +457,11 @@
 {
 	struct mmc_command cmd;
 
+	host->ios.chip_select = MMC_CS_HIGH;
+	host->ops->set_ios(host, &host->ios);
+
+	mmc_delay(1);
+
 	cmd.opcode = MMC_GO_IDLE_STATE;
 	cmd.arg = 0;
 	cmd.flags = MMC_RSP_NONE;
@@ -464,6 +469,11 @@
 	mmc_wait_for_cmd(host, &cmd, 0);
 
 	mmc_delay(1);
+
+	host->ios.chip_select = MMC_CS_DONTCARE;
+	host->ops->set_ios(host, &host->ios);
+
+	mmc_delay(1);
 }
 
 /*
@@ -475,6 +485,7 @@
 
 	host->ios.vdd = bit;
 	host->ios.bus_mode = MMC_BUSMODE_OPENDRAIN;
+	host->ios.chip_select = MMC_CS_DONTCARE;
 	host->ios.power_mode = MMC_POWER_UP;
 	host->ops->set_ios(host, &host->ios);
 
@@ -492,6 +503,7 @@
 	host->ios.clock = 0;
 	host->ios.vdd = 0;
 	host->ios.bus_mode = MMC_BUSMODE_OPENDRAIN;
+	host->ios.chip_select = MMC_CS_DONTCARE;
 	host->ios.power_mode = MMC_POWER_OFF;
 	host->ops->set_ios(host, &host->ios);
 }
Index: linux/include/linux/mmc/host.h
===================================================================
--- linux/include/linux/mmc/host.h	(revision 151)
+++ linux/include/linux/mmc/host.h	(working copy)
@@ -46,6 +46,12 @@
 #define MMC_BUSMODE_OPENDRAIN	1
 #define MMC_BUSMODE_PUSHPULL	2
 
+	unsigned char	chip_select;		/* SPI chip select */
+
+#define MMC_CS_DONTCARE		0
+#define MMC_CS_HIGH		1
+#define MMC_CS_LOW		2
+
 	unsigned char	power_mode;		/* power supply mode */
 
 #define MMC_POWER_OFF		0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/2] ios for mmc chip select
  2005-08-29 11:13 [PATCH 1/2] ios for mmc chip select Pierre Ossman
@ 2005-09-03 15:46 ` Russell King
  0 siblings, 0 replies; 2+ messages in thread
From: Russell King @ 2005-09-03 15:46 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: LKML

On Mon, Aug 29, 2005 at 01:13:42PM +0200, Pierre Ossman wrote:
> Adds a new ios for setting the chip select pin on MMC cards. Needed on
> SD controllers which use this pin for other things and therefore cannot
> have it pulled high at all times.

Applied, thanks.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-09-03 15:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-29 11:13 [PATCH 1/2] ios for mmc chip select Pierre Ossman
2005-09-03 15:46 ` Russell King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox