1 Index: linux-2.6.20.7/arch/arm/mach-pxa/ezx-mci.c
2 ===================================================================
3 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
4 +++ linux-2.6.20.7/arch/arm/mach-pxa/ezx-mci.c 2007-04-20 01:10:13.000000000 -0300
7 + * linux/arch/arm/mach-ezx/a780.c
9 + * Support for the Motorola Ezx A780 Development Platform.
11 + * Author: Zhuang Xiaofan
12 + * Created: Nov 25, 2003
13 + * Copyright: Motorola Inc.
15 + * This program is free software; you can redistribute it and/or modify
16 + * it under the terms of the GNU General Public License version 2 as
17 + * published by the Free Software Foundation.
20 +#include <linux/mmc/host.h>
21 +#include <linux/irq.h>
23 +#include <asm/arch/pxa-regs.h>
24 +#include <asm/arch/ezx-pcap.h>
25 +#include <asm/arch/mmc.h>
26 +#include <asm/arch/hardware.h>
28 +extern int ezx_pcap_mmcsd_power(int);
29 +extern void ezx_pcap_mmcsd_voltage(u_int32_t);
31 +static struct pxamci_platform_data ezx_mci_platform_data;
33 +static int ezx_mci_init(struct device *dev,
34 + irqreturn_t (*ezx_detect_int)(int, void *),
38 + printk("%s entered\n", __FUNCTION__);
40 + /* Setup GPIO for PXA27x MMC/SD controller */
41 + pxa_gpio_mode(GPIO32_MMCCLK_MD);
42 + pxa_gpio_mode(GPIO112_MMCCMD_MD);
43 + pxa_gpio_mode(GPIO92_MMCDAT0_MD);
44 + pxa_gpio_mode(GPIO109_MMCDAT1_MD);
45 + pxa_gpio_mode(GPIO110_MMCDAT2_MD);
46 + pxa_gpio_mode(GPIO111_MMCDAT3_MD);
48 + ezx_pcap_mmcsd_power(1);
50 + ezx_mci_platform_data.detect_delay = msecs_to_jiffies(250);
52 + err = request_irq(0x49, ezx_detect_int, SA_INTERRUPT,
53 + "MMC card detect", data);
55 + printk(KERN_ERR "ezx_mci_detect: MMC/SD: can't request "
56 + "MMC card detect IRQ\n");
60 + set_irq_type(0x0b, IRQT_BOTHEDGE);
65 +static int ezx_mci_get_ro(struct device *dev)
67 + printk("%s entered\n", __FUNCTION__);
68 +#if defined(CONFIG_PXA_EZX_E680)
69 + /* this is only e680, i guess */
70 + // return GPIO_is_high(96+4);
71 + return (GPLR3 & 0x800);
77 +#if defined(CONFIG_PXA_EZX_A780)
78 +static u_int8_t mmc_voltage[] = {
101 +#elif defined(CONFIG_PXA_EZX_E680)
102 +static u_int8_t mmc_voltage[] = {
127 +static void ezx_mci_setpower(struct device *dev, unsigned int vdd)
129 + printk("%s(vdd=%u) entered\n", __FUNCTION__, vdd);
130 + if (vdd <= MMC_VDD_360)
131 + ezx_pcap_mmcsd_voltage(mmc_voltage[vdd]);
133 + ezx_pcap_mmcsd_power(1);
136 +static void ezx_mci_exit(struct device *dev, void *data)
138 + printk("%s entered\n", __FUNCTION__);
139 + ezx_pcap_mmcsd_power(0);
140 + free_irq(0x49, data);
143 +static struct pxamci_platform_data ezx_mci_platform_data = {
144 +#if defined(CONFIG_PXA_EZX_E680)
145 + .ocr_mask = MMC_VDD_27_28,
146 +#elif defined(CONFIG_PXA_EZX_A780)
147 + .ocr_mask = MMC_VDD_160_165|MMC_VDD_18_19|MMC_VDD_20_21
148 + |MMC_VDD_22_23|MMC_VDD_24_25|MMC_VDD_26_27
149 + |MMC_VDD_28_29|MMC_VDD_30_31|MMC_VDD_32_33
150 + |MMC_VDD_34_35|MMC_VDD_35_36,
152 + .init = ezx_mci_init,
153 + .get_ro = ezx_mci_get_ro,
154 + .setpower = ezx_mci_setpower,
155 + .exit = ezx_mci_exit,
158 +int __init __ezx_mci_init (void)
160 + pxa_set_mci_info(&ezx_mci_platform_data);
164 +arch_initcall(__ezx_mci_init);
165 Index: linux-2.6.20.7/arch/arm/mach-pxa/Makefile
166 ===================================================================
167 --- linux-2.6.20.7.orig/arch/arm/mach-pxa/Makefile 2007-04-21 02:56:16.000000000 -0300
168 +++ linux-2.6.20.7/arch/arm/mach-pxa/Makefile 2007-04-21 03:00:03.000000000 -0300
170 obj-$(CONFIG_MACH_AKITA) += akita-ioexp.o
171 obj-$(CONFIG_MACH_POODLE) += poodle.o corgi_ssp.o
172 obj-$(CONFIG_MACH_TOSA) += tosa.o
173 -obj-$(CONFIG_PXA_EZX) += ezx.o ezx_lcd.o ezx_ssp.o ezx-pcap.o
174 +obj-$(CONFIG_PXA_EZX) += ezx.o ezx_lcd.o ezx_ssp.o ezx-pcap.o ezx-mci.o
176 # Support for blinky lights