r1637 - trunk/src/target/kernel/patches
laforge at sita.openmoko.org
laforge at sita.openmoko.org
Mon Apr 2 22:06:32 CEST 2007
Author: laforge
Date: 2007-04-02 22:06:31 +0200 (Mon, 02 Apr 2007)
New Revision: 1637
Modified:
trunk/src/target/kernel/patches/gta01-core.patch
trunk/src/target/kernel/patches/s3c_mci_platform.patch
Log:
extend the per-platform set_power() function of s3mci to also be able to send 'power off' events to the per-platform callback function.
Modified: trunk/src/target/kernel/patches/gta01-core.patch
===================================================================
--- trunk/src/target/kernel/patches/gta01-core.patch 2007-04-02 19:08:44 UTC (rev 1636)
+++ trunk/src/target/kernel/patches/gta01-core.patch 2007-04-02 20:06:31 UTC (rev 1637)
@@ -3,8 +3,8 @@
Index: linux-2.6.20.4/arch/arm/mach-s3c2410/Kconfig
===================================================================
---- linux-2.6.20.4.orig/arch/arm/mach-s3c2410/Kconfig 2007-04-01 10:27:56.000000000 +0200
-+++ linux-2.6.20.4/arch/arm/mach-s3c2410/Kconfig 2007-04-02 17:07:44.000000000 +0200
+--- linux-2.6.20.4.orig/arch/arm/mach-s3c2410/Kconfig 2007-04-02 20:55:06.000000000 +0200
++++ linux-2.6.20.4/arch/arm/mach-s3c2410/Kconfig 2007-04-02 20:56:34.000000000 +0200
@@ -86,6 +86,14 @@
help
Say Y here if you are using the Armzone QT2410
@@ -22,8 +22,8 @@
select CPU_S3C2440
Index: linux-2.6.20.4/arch/arm/mach-s3c2410/Makefile
===================================================================
---- linux-2.6.20.4.orig/arch/arm/mach-s3c2410/Makefile 2007-04-01 10:27:56.000000000 +0200
-+++ linux-2.6.20.4/arch/arm/mach-s3c2410/Makefile 2007-04-02 17:07:42.000000000 +0200
+--- linux-2.6.20.4.orig/arch/arm/mach-s3c2410/Makefile 2007-04-02 20:55:06.000000000 +0200
++++ linux-2.6.20.4/arch/arm/mach-s3c2410/Makefile 2007-04-02 20:56:33.000000000 +0200
@@ -89,5 +89,6 @@
obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o
obj-$(CONFIG_MACH_VSTMS) += mach-vstms.o
@@ -34,8 +34,8 @@
Index: linux-2.6.20.4/arch/arm/mach-s3c2410/mach-gta01.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.20.4/arch/arm/mach-s3c2410/mach-gta01.c 2007-04-02 17:08:27.000000000 +0200
-@@ -0,0 +1,707 @@
++++ linux-2.6.20.4/arch/arm/mach-s3c2410/mach-gta01.c 2007-04-02 20:57:23.000000000 +0200
+@@ -0,0 +1,735 @@
+/*
+ * linux/arch/arm/mach-s3c2410/mach-gta01.c
+ *
@@ -74,6 +74,7 @@
+#include <linux/spi/spi.h>
+#include <linux/spi/spi_bitbang.h>
+#include <linux/mmc/protocol.h>
++#include <linux/mmc/host.h>
+
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/nand.h>
@@ -451,15 +452,41 @@
+ [MMC_VDD_32_33] = 3300,
+};
+
-+static void gta01_mmc_set_power(unsigned short vdd)
++static void gta01_mmc_set_power(unsigned char power_mode, unsigned short vdd)
+{
-+ /* FIXME: set GTA01_GPIO_SDMMC_ON on GTA01v4 */
-+ //pcf50606_voltage_set(mmc_millivolts[vdd]);
++ printk(KERN_DEBUG "mmc_set_power(power_mode=%u, vdd=%u\n",
++ power_mode, vdd);
++
++ switch (system_rev) {
++ case GTA01v3_SYSTEM_REV:
++ /* FIXME */
++ break;
++ case GTA01v4_SYSTEM_REV:
++ /* FIXME: set GTA01_GPIO_SDMMC_ON on GTA01v4 */
++ //pcf50606_voltage_set(mmc_millivolts[vdd]);
++ break;
++ case GTA01Bv2_SYSTEM_REV:
++ case GTA01Bv3_SYSTEM_REV:
++ /* FIXME */
++ break;
++ case GTA01Bv4_SYSTEM_REV:
++ switch (power_mode) {
++ case MMC_POWER_OFF:
++ s3c2410_gpio_setpin(GTA01_GPIO_SDMMC_ON, 1);
++ break;
++ case MMC_POWER_ON:
++ s3c2410_gpio_setpin(GTA01_GPIO_SDMMC_ON, 0);
++ break;
++ }
++ break;
++ }
+}
+
+static struct s3c24xx_mci_pdata gta01_mmc_cfg = {
+ .gpio_detect = GTA01_GPIO_nSD_DETECT,
+ .set_power = >a01_mmc_set_power,
++ .ocr_avail = MMC_VDD_32_33, /* GTA01Bv2/3/4 */
++#if 0
+ .ocr_avail = MMC_VDD_145_150|MMC_VDD_150_155|MMC_VDD_155_160|
+ MMC_VDD_160_165| MMC_VDD_165_170|MMC_VDD_17_18|
+ MMC_VDD_18_19|MMC_VDD_19_20|MMC_VDD_20_21|
@@ -467,6 +494,7 @@
+ MMC_VDD_24_25|MMC_VDD_25_26|MMC_VDD_26_27|
+ MMC_VDD_27_28|MMC_VDD_28_29|MMC_VDD_29_30|
+ MMC_VDD_30_31|MMC_VDD_31_32|MMC_VDD_32_33,
++#endif
+};
+
+static void gta01_udc_command(enum s3c2410_udc_cmd_e cmd)
@@ -746,7 +774,7 @@
Index: linux-2.6.20.4/include/asm-arm/arch-s3c2410/gta01.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.20.4/include/asm-arm/arch-s3c2410/gta01.h 2007-04-01 10:29:43.000000000 +0200
++++ linux-2.6.20.4/include/asm-arm/arch-s3c2410/gta01.h 2007-04-02 20:55:32.000000000 +0200
@@ -0,0 +1,69 @@
+#ifndef _GTA01_H
+#define _GTA01_H
Modified: trunk/src/target/kernel/patches/s3c_mci_platform.patch
===================================================================
--- trunk/src/target/kernel/patches/s3c_mci_platform.patch 2007-04-02 19:08:44 UTC (rev 1636)
+++ trunk/src/target/kernel/patches/s3c_mci_platform.patch 2007-04-02 20:06:31 UTC (rev 1637)
@@ -1,10 +1,10 @@
This patch adds platform data support to the s3mci driver. This allows
flexible board-specific configuration of set_power, card detect and read only
pins.
-Index: linux-2.6.17.14-fic4.test/drivers/mmc/s3cmci.c
+Index: linux-2.6.20.4/drivers/mmc/s3cmci.c
===================================================================
---- linux-2.6.17.14-fic4.test.orig/drivers/mmc/s3cmci.c 2007-01-24 12:17:57.000000000 +0100
-+++ linux-2.6.17.14-fic4.test/drivers/mmc/s3cmci.c 2007-01-24 12:18:02.000000000 +0100
+--- linux-2.6.20.4.orig/drivers/mmc/s3cmci.c 2007-04-02 20:37:47.000000000 +0200
++++ linux-2.6.20.4/drivers/mmc/s3cmci.c 2007-04-02 20:55:02.000000000 +0200
@@ -22,6 +22,7 @@
#include <asm/io.h>
#include <asm/arch/regs-sdi.h>
@@ -18,12 +18,22 @@
s3c2410_gpio_cfgpin(S3C2410_GPE10, S3C2410_GPE10_SDDAT3);
+ if (host->pdata->set_power)
-+ host->pdata->set_power(ios->vdd);
++ host->pdata->set_power(ios->power_mode, ios->vdd);
+
if (!host->is2440)
mci_con|=S3C2410_SDICON_FIFORESET;
-@@ -1075,9 +1079,26 @@
+@@ -1022,6 +1026,9 @@
+ s3c2410_gpio_setpin(S3C2410_GPE5, 0);
+ s3c2410_gpio_cfgpin(S3C2410_GPE5, S3C2410_GPE5_OUTP);
+
++ if (host->pdata->set_power)
++ host->pdata->set_power(ios->power_mode, ios->vdd);
++
+ if (host->is2440)
+ mci_con|=S3C2440_SDICON_SDRESET;
+
+@@ -1075,9 +1082,26 @@
writel(con, host->base + S3C2410_SDICON);
}
@@ -50,7 +60,7 @@
};
static int s3cmci_probe(struct platform_device *pdev, int is2440)
-@@ -1097,6 +1118,12 @@
+@@ -1097,6 +1121,12 @@
host->mmc = mmc;
host->pdev = pdev;
@@ -63,7 +73,7 @@
spin_lock_init(&host->complete_lock);
tasklet_init(&host->pio_tasklet, pio_tasklet, (unsigned long) host);
if (is2440) {
-@@ -1115,7 +1142,8 @@
+@@ -1115,7 +1145,8 @@
host->pio_active = XFER_NONE;
host->dma = S3CMCI_DMA;
@@ -73,7 +83,7 @@
host->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!host->mem) {
-@@ -1157,7 +1185,7 @@
+@@ -1157,7 +1188,7 @@
disable_irq(host->irq);
@@ -82,7 +92,7 @@
set_irq_type(host->irq_cd, IRQT_BOTHEDGE);
if (request_irq(host->irq_cd, s3cmci_irq_cd, 0, DRIVER_NAME, host)) {
-@@ -1168,6 +1196,10 @@
+@@ -1168,6 +1199,10 @@
goto probe_free_irq;
}
@@ -93,7 +103,7 @@
if (s3c2410_dma_request(S3CMCI_DMA, &s3cmci_dma_client, NULL)) {
dev_err(&pdev->dev, "unable to get DMA channel.\n");
ret = -EBUSY;
-@@ -1190,7 +1222,7 @@
+@@ -1190,7 +1225,7 @@
host->clk_rate = clk_get_rate(host->clk);
mmc->ops = &s3cmci_ops;
@@ -102,10 +112,10 @@
mmc->caps = MMC_CAP_4_BIT_DATA;
mmc->f_min = host->clk_rate / (host->clk_div * 256);
mmc->f_max = host->clk_rate / host->clk_div;
-Index: linux-2.6.17.14-fic4.test/drivers/mmc/s3cmci.h
+Index: linux-2.6.20.4/drivers/mmc/s3cmci.h
===================================================================
---- linux-2.6.17.14-fic4.test.orig/drivers/mmc/s3cmci.h 2007-01-24 12:17:51.000000000 +0100
-+++ linux-2.6.17.14-fic4.test/drivers/mmc/s3cmci.h 2007-01-24 12:18:02.000000000 +0100
+--- linux-2.6.20.4.orig/drivers/mmc/s3cmci.h 2007-04-02 20:37:44.000000000 +0200
++++ linux-2.6.20.4/drivers/mmc/s3cmci.h 2007-04-02 20:37:48.000000000 +0200
@@ -22,6 +22,7 @@
struct s3cmci_host {
@@ -114,11 +124,11 @@
struct mmc_host *mmc;
struct resource *mem;
struct clk *clk;
-Index: linux-2.6.17.14-fic4.test/include/asm-arm/arch-s3c2410/mci.h
+Index: linux-2.6.20.4/include/asm-arm/arch-s3c2410/mci.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.17.14-fic4.test/include/asm-arm/arch-s3c2410/mci.h 2007-01-24 12:18:02.000000000 +0100
-@@ -0,0 +1,11 @@
++++ linux-2.6.20.4/include/asm-arm/arch-s3c2410/mci.h 2007-04-02 20:54:16.000000000 +0200
+@@ -0,0 +1,12 @@
+#ifndef _ARCH_MCI_H
+#define _ARCH_MCI_H
+
@@ -126,7 +136,8 @@
+ unsigned int gpio_detect;
+ unsigned int gpio_wprotect;
+ unsigned long ocr_avail;
-+ void (*set_power)(unsigned short vdd);
++ void (*set_power)(unsigned char power_mode,
++ unsigned short vdd);
+};
+
+#endif /* _ARCH_NCI_H */
More information about the commitlog
mailing list