linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: anarsoul@gmail.com (Vasily Khoruzhick)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] h1940: implement mmc_power function
Date: Sat, 12 Jun 2010 15:46:03 +0300	[thread overview]
Message-ID: <1276346763-29309-1-git-send-email-anarsoul@gmail.com> (raw)

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
 arch/arm/mach-s3c2410/include/mach/h1940-latch.h |    7 +++----
 arch/arm/mach-s3c2410/mach-h1940.c               |   17 ++++++++++++++++-
 2 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-s3c2410/include/mach/h1940-latch.h b/arch/arm/mach-s3c2410/include/mach/h1940-latch.h
index d8a8327..a29bc1c 100644
--- a/arch/arm/mach-s3c2410/include/mach/h1940-latch.h
+++ b/arch/arm/mach-s3c2410/include/mach/h1940-latch.h
@@ -39,8 +39,8 @@
 #define H1940_LATCH_UDA_POWER		(1<<24)
 #define H1940_LATCH_AUDIO_POWER		(1<<25)
 #define H1940_LATCH_SM803_ENABLE	(1<<26)
-#define H1940_LATCH_LCD_P4		(1<<27)
-#define H1940_LATCH_CPUQ5		(1<<28)		/* untraced */
+#define H1940_LATCH_LCD_P4			(1<<27)
+#define H1940_LATCH_SD_POWER		(1<<28)
 #define H1940_LATCH_BLUETOOTH_POWER	(1<<29)		/* active high */
 #define H1940_LATCH_LED_GREEN		(1<<30)
 #define H1940_LATCH_LED_FLASH		(1<<31)
@@ -54,8 +54,7 @@
 	H1940_LATCH_LCD_P1		| \
 	H1940_LATCH_LCD_P2		| \
 	H1940_LATCH_LCD_P3		| \
-	H1940_LATCH_MAX1698_nSHUTDOWN   | \
-	H1940_LATCH_CPUQ5
+	H1940_LATCH_MAX1698_nSHUTDOWN
 
 /* control functions */
 
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index 779b45b..ddeedad 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -198,10 +198,25 @@ static struct platform_device h1940_device_bluetooth = {
 	.id               = -1,
 };
 
+static void h1940_set_mmc_power(unsigned char power_mode, unsigned short vdd)
+{
+	switch (power_mode) {
+	case MMC_POWER_OFF:
+		h1940_latch_control(H1940_LATCH_SD_POWER, 0);
+		break;
+	case MMC_POWER_UP:
+	case MMC_POWER_ON:
+		h1940_latch_control(0, H1940_LATCH_SD_POWER);
+		break;
+	default:
+		break;
+	}
+}
+
 static struct s3c24xx_mci_pdata h1940_mmc_cfg __initdata = {
 	.gpio_detect   = S3C2410_GPF(5),
 	.gpio_wprotect = S3C2410_GPH(8),
-	.set_power     = NULL,
+	.set_power     = h1940_set_mmc_power,
 	.ocr_avail     = MMC_VDD_32_33,
 };
 
-- 
1.7.1

             reply	other threads:[~2010-06-12 12:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-12 12:46 Vasily Khoruzhick [this message]
2010-06-21 14:21 ` [PATCH] h1940: implement mmc_power function Vasily Khoruzhick
2010-06-21 22:26   ` Arnaud Patard (Rtp)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1276346763-29309-1-git-send-email-anarsoul@gmail.com \
    --to=anarsoul@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).