[Armadeus-commitlog] SF.net SVN: armadeus:[1248] trunk/buildroot/target/device/armadeus/linux/ kern
Brought to you by:
sszy
Revision: 1248
http://armadeus.svn.sourceforge.net/armadeus/?rev=1248&view=rev
Author: artemys
Date: 2009-04-30 21:34:55 +0000 (Thu, 30 Apr 2009)
Log Message:
-----------
[LINUX] Makes imxmmc driver compiles again on 2.6.29
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/040-armadeus-imxmmc-add_controller_driven_card_detection.patch
Modified: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/040-armadeus-imxmmc-add_controller_driven_card_detection.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/040-armadeus-imxmmc-add_controller_driven_card_detection.patch 2009-04-30 16:09:17 UTC (rev 1247)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/040-armadeus-imxmmc-add_controller_driven_card_detection.patch 2009-04-30 21:34:55 UTC (rev 1248)
@@ -6,24 +6,31 @@
inserted. So chip's internal pull-down resistor is activated to have
this pin low by default (recommended by MMC specs in any case).
+Note: requires to replace IO_ADDRESS(IMX_MMC_BASE) with host->base
+ to be clean. (But how ?)
+
Signed-off-by: Julien Boibessot <jul...@ar...>
Signed-off-by: Eric Jarrige <jo...@ar...>
---- linux-org/drivers/mmc/host/imxmmc.c
-+++ linux-imx/drivers/mmc/host/imxmmc.c
-@@ -901,6 +901,27 @@
+Index: linux-2.6.29/drivers/mmc/host/imxmmc.c
+===================================================================
+--- linux-2.6.29.orig/drivers/mmc/host/imxmmc.c 2009-03-24 00:12:14.000000000 +0100
++++ linux-2.6.29/drivers/mmc/host/imxmmc.c 2009-04-30 23:12:36.000000000 +0200
+@@ -911,6 +911,29 @@
.get_ro = imxmci_get_ro,
};
+/* Controller built-in card detection */
-+static int imxmci_card_present(void)
++static int imxmci_card_present(struct device *dev)
+{
+ static int current_state = 1;
+ static int nb_trials = 3;
-+ int new_state = (MMC_STATUS & STATUS_CARD_PRESENCE) ? 1 : 0;
++ /* struct imxmci_host *host = how to get it from dev ?? */
++ u16 status = readw(IO_ADDRESS(IMX_MMC_BASE) + MMC_REG_STATUS);
++ int new_state = (status & STATUS_CARD_PRESENCE) ? 1 : 0;
+
+ /* Take state into account only if data are not being transmitted */
-+ if (!(MMC_STATUS & STATUS_CARD_BUS_CLK_RUN)
++ if (!(status & STATUS_CARD_BUS_CLK_RUN)
+ && (new_state != current_state)) {
+ if (0 == --nb_trials) {
+ current_state = new_state;
@@ -39,19 +46,21 @@
static void imxmci_check_status(unsigned long data)
{
struct imxmci_host *host = (struct imxmci_host *)data;
-@@ -1022,6 +1041,10 @@
- ret = request_irq(host->irq, imxmci_irq, 0, DRIVER_NAME, host);
+@@ -1043,6 +1066,10 @@
if (ret)
goto out;
-+
+
+ /* If no way of detecting card is given, use built-in method */
+ if (!host->pdata->card_present)
+ host->pdata->card_present = imxmci_card_present;
-
++
if (host->pdata && host->pdata->card_present)
host->present = host->pdata->card_present(mmc_dev(mmc));
---- linux-org/arch/arm/mach-imx/include/mach/imx-regs.h
-+++ linux-imx/arch/arm/mach-imx/include/mach/imx-regs.h
+ else /* if there is no way to detect assume that card is present */
+Index: linux-2.6.29/arch/arm/mach-imx/include/mach/imx-regs.h
+===================================================================
+--- linux-2.6.29.orig/arch/arm/mach-imx/include/mach/imx-regs.h 2009-04-30 23:09:11.000000000 +0200
++++ linux-2.6.29/arch/arm/mach-imx/include/mach/imx-regs.h 2009-04-30 23:11:18.000000000 +0200
@@ -172,7 +172,7 @@
#define PB9_AF_MS_PI1 ( GPIO_PORTB | GPIO_AF | 9 )
#define PB10_PF_SD_DAT2 ( GPIO_PORTB | GPIO_PF | GPIO_PUEN | 10 )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|