linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: khilman@deeprootsystems.com (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 03/34] davinci: da830/omap-l137 evm: add support for GPIO based MMC/SD card detection
Date: Thu,  6 May 2010 16:23:54 -0700	[thread overview]
Message-ID: <1273188265-12782-4-git-send-email-khilman@deeprootsystems.com> (raw)
In-Reply-To: <1273188265-12782-1-git-send-email-khilman@deeprootsystems.com>

From: Vipin Bhandari <vipin.bhandari@ti.com>

The DA830/OMAP-L137 EVM has GPIO based card detection logic, but the current
code does not use it.

Add support for GPIO based card detection to avoid reading the card to see
if a card is present or not.

Signed-off-by: Vipin Bhandari <vipin.bhandari@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
 arch/arm/mach-davinci/board-da830-evm.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c
index dc19870..8e67037 100644
--- a/arch/arm/mach-davinci/board-da830-evm.c
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -229,14 +229,21 @@ static const short da830_evm_mmc_sd_pins[] = {
 };
 
 #define DA830_MMCSD_WP_PIN		GPIO_TO_PIN(2, 1)
+#define DA830_MMCSD_CD_PIN		GPIO_TO_PIN(2, 2)
 
 static int da830_evm_mmc_get_ro(int index)
 {
 	return gpio_get_value(DA830_MMCSD_WP_PIN);
 }
 
+static int da830_evm_mmc_get_cd(int index)
+{
+	return !gpio_get_value(DA830_MMCSD_CD_PIN);
+}
+
 static struct davinci_mmc_config da830_evm_mmc_config = {
 	.get_ro			= da830_evm_mmc_get_ro,
+	.get_cd			= da830_evm_mmc_get_cd,
 	.wires			= 4,
 	.max_freq		= 50000000,
 	.caps			= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
@@ -262,6 +269,14 @@ static inline void da830_evm_init_mmc(void)
 	}
 	gpio_direction_input(DA830_MMCSD_WP_PIN);
 
+	ret = gpio_request(DA830_MMCSD_CD_PIN, "MMC CD\n");
+	if (ret) {
+		pr_warning("da830_evm_init: can not open GPIO %d\n",
+			   DA830_MMCSD_CD_PIN);
+		return;
+	}
+	gpio_direction_input(DA830_MMCSD_CD_PIN);
+
 	ret = da8xx_register_mmcsd0(&da830_evm_mmc_config);
 	if (ret) {
 		pr_warning("da830_evm_init: mmc/sd registration failed: %d\n",
-- 
1.7.0.2

  parent reply	other threads:[~2010-05-06 23:23 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-06 23:23 [PATCH 00/34] davinci updates for 2.6.35 Kevin Hilman
2010-05-06 23:23 ` [PATCH 01/34] davinci: misc cleanups from sparse Kevin Hilman
2010-05-06 23:23 ` [PATCH 02/34] davinci: sparse: gpio: void casting Kevin Hilman
2010-05-06 23:23 ` Kevin Hilman [this message]
2010-05-06 23:23 ` [PATCH 04/34] davinci: da830/omap-l137 evm: use 8-wire MMC/SD card support Kevin Hilman
2010-05-06 23:23 ` [PATCH 05/34] davinci: edma: clear interrupt status for interrupt enabled channels only Kevin Hilman
2010-05-06 23:23 ` [PATCH 06/34] RTC: DaVinci RTC driver Kevin Hilman
2010-05-13  9:15   ` Russell King - ARM Linux
2010-05-13 13:44     ` Kevin Hilman
2010-05-06 23:23 ` [PATCH 07/34] rtc: omap: let device wakeup capability be configured from chip init logic Kevin Hilman
2010-05-13  9:15   ` Russell King - ARM Linux
2010-05-06 23:23 ` [PATCH 08/34] Davinci: allow SOCs based on other ARM CPUs Kevin Hilman
2010-05-06 23:24 ` [PATCH 09/34] Davinci: enable timer clock before use Kevin Hilman
2010-05-06 23:24 ` [PATCH 10/34] Davinci: cpintc host map configuration Kevin Hilman
2010-05-06 23:24 ` [PATCH 11/34] Davinci: support LPSC SwRstDisable state Kevin Hilman
2010-05-06 23:24 ` [PATCH 12/34] Davinci: promote da8xx_pinmux_setup() Kevin Hilman
2010-05-06 23:24 ` [PATCH 13/34] Davinci: tnetv107x pin list Kevin Hilman
2010-05-06 23:24 ` [PATCH 14/34] Davinci: tnetv107x LPSC modules Kevin Hilman
2010-05-06 23:24 ` [PATCH 15/34] Davinci: tnetv107x IRQ definitions Kevin Hilman
2010-05-06 23:24 ` [PATCH 16/34] Davinci: tnetv107x cpu types Kevin Hilman
2010-05-06 23:24 ` [PATCH 17/34] DaVinci: move AEMIF #define's to the proper headers Kevin Hilman
2010-05-06 23:24 ` [PATCH 18/34] DA830 EVM: use DA8XX_AEMIF_*_BASE #define's Kevin Hilman
2010-05-06 23:24 ` [PATCH 19/34] davinci: DM365: Allow use of GPIO64_57 Kevin Hilman
2010-05-06 23:24 ` [PATCH 20/34] Davinci: configurable pll divider mask Kevin Hilman
2010-05-06 23:24 ` [PATCH 21/34] davinci: mach/common.h: add missing includes Kevin Hilman
2010-05-06 23:24 ` [PATCH 22/34] DaVinci: move IDE platform device to its proper place Kevin Hilman
2010-05-06 23:24 ` [PATCH 23/34] Davinci: gpio - minor cleanup Kevin Hilman
2010-05-06 23:24 ` [PATCH 24/34] Davinci: gpio - structs and functions renamed Kevin Hilman
2010-05-06 23:24 ` [PATCH 25/34] Davinci: gpio - register layout invariant inlines Kevin Hilman
2010-05-06 23:24 ` [PATCH 26/34] Davinci: gpio - controller type support Kevin Hilman
2010-05-06 23:24 ` [PATCH 27/34] Davinci: gpio - fine grained locking Kevin Hilman
2010-05-06 23:24 ` [PATCH 28/34] Davinci: eliminate pinmux offset verbosity Kevin Hilman
2010-05-06 23:24 ` [PATCH 29/34] Davinci: watchdog reset separation across socs Kevin Hilman
2010-05-06 23:24 ` [PATCH 30/34] Davinci: serial - remove unnecessary define Kevin Hilman
2010-05-06 23:24 ` [PATCH 31/34] Davinci: serial - use ioremap() Kevin Hilman
2010-05-06 23:24 ` [PATCH 32/34] Davinci: serial - conditional reset via pwremu Kevin Hilman
2010-05-06 23:24 ` [PATCH 33/34] davinci: edma: use a more intuitive name for edma_info Kevin Hilman
2010-05-06 23:24 ` [PATCH 34/34] davinci: edma: fix coding style issue related to usage of braces Kevin Hilman

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=1273188265-12782-4-git-send-email-khilman@deeprootsystems.com \
    --to=khilman@deeprootsystems.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).