diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-11 13:09:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-11 13:09:45 -0400 |
commit | 7cc4e87f912bbefa440a51856b8d076e5d1f554a (patch) | |
tree | 1b8df8683f3de37d2e8211ffa8d151f60d59af62 /arch/arm/mach-pxa/gumstix.c | |
parent | 5ba2f67afb02c5302b2898949ed6fc3b3d37dcf1 (diff) | |
parent | 69fc7eed5f56bce15b239e5110de2575a6970df4 (diff) |
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (236 commits)
[ARM] 5300/1: fixup spitz reset during boot
[ARM] 5295/1: make ZONE_DMA optional
[ARM] 5239/1: Palm Zire 72 power management support
[ARM] 5298/1: Drop desc_handle_irq()
[ARM] 5297/1: [KS8695] Fix two compile-time warnings
[ARM] 5296/1: [KS8695] Replace macro's with trailing underscores.
[ARM] pxa: allow multi-machine PCMCIA builds
[ARM] pxa: add preliminary CPUFREQ support for PXA3xx
[ARM] pxa: add missing ACCR bit definitions to pxa3xx-regs.h
[ARM] pxa: rename cpu-pxa.c to cpufreq-pxa2xx.c
[ARM] pxa/zylonite: add support for USB OHCI
[ARM] ohci-pxa27x: use ioremap() and offset for register access
[ARM] ohci-pxa27x: introduce pxa27x_clear_otgph()
[ARM] ohci-pxa27x: use platform_get_{irq,resource} for the resource
[ARM] ohci-pxa27x: move OHCI controller specific registers into the driver
[ARM] ohci-pxa27x: introduce flags to avoid direct access to OHCI registers
[ARM] pxa: move I2S register and bit definitions into pxa2xx-i2s.c
[ARM] pxa: simplify DMA register definitions
[ARM] pxa: make additional DCSR bits valid for PXA3xx
[ARM] pxa: move i2c register and bit definitions into i2c-pxa.c
...
Fixed up conflicts in
arch/arm/mach-versatile/core.c
sound/soc/pxa/pxa2xx-ac97.c
sound/soc/pxa/pxa2xx-i2s.c
manually.
Diffstat (limited to 'arch/arm/mach-pxa/gumstix.c')
-rw-r--r-- | arch/arm/mach-pxa/gumstix.c | 100 |
1 files changed, 83 insertions, 17 deletions
diff --git a/arch/arm/mach-pxa/gumstix.c b/arch/arm/mach-pxa/gumstix.c index c0092472fa58..d8962a0fb98d 100644 --- a/arch/arm/mach-pxa/gumstix.c +++ b/arch/arm/mach-pxa/gumstix.c | |||
@@ -20,8 +20,12 @@ | |||
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
21 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
22 | #include <linux/interrupt.h> | 22 | #include <linux/interrupt.h> |
23 | #include <linux/delay.h> | ||
23 | #include <linux/mtd/mtd.h> | 24 | #include <linux/mtd/mtd.h> |
24 | #include <linux/mtd/partitions.h> | 25 | #include <linux/mtd/partitions.h> |
26 | #include <linux/gpio.h> | ||
27 | #include <linux/err.h> | ||
28 | #include <linux/clk.h> | ||
25 | 29 | ||
26 | #include <asm/setup.h> | 30 | #include <asm/setup.h> |
27 | #include <asm/memory.h> | 31 | #include <asm/memory.h> |
@@ -40,7 +44,7 @@ | |||
40 | 44 | ||
41 | #include <mach/pxa-regs.h> | 45 | #include <mach/pxa-regs.h> |
42 | #include <mach/pxa2xx-regs.h> | 46 | #include <mach/pxa2xx-regs.h> |
43 | #include <mach/pxa2xx-gpio.h> | 47 | #include <mach/mfp-pxa25x.h> |
44 | 48 | ||
45 | #include "generic.h" | 49 | #include "generic.h" |
46 | 50 | ||
@@ -85,21 +89,8 @@ static struct platform_device *devices[] __initdata = { | |||
85 | }; | 89 | }; |
86 | 90 | ||
87 | #ifdef CONFIG_MMC_PXA | 91 | #ifdef CONFIG_MMC_PXA |
88 | static struct pxamci_platform_data gumstix_mci_platform_data; | ||
89 | |||
90 | static int gumstix_mci_init(struct device *dev, irq_handler_t detect_int, | ||
91 | void *data) | ||
92 | { | ||
93 | pxa_gpio_mode(GPIO6_MMCCLK_MD); | ||
94 | pxa_gpio_mode(GPIO53_MMCCLK_MD); | ||
95 | pxa_gpio_mode(GPIO8_MMCCS0_MD); | ||
96 | |||
97 | return 0; | ||
98 | } | ||
99 | |||
100 | static struct pxamci_platform_data gumstix_mci_platform_data = { | 92 | static struct pxamci_platform_data gumstix_mci_platform_data = { |
101 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | 93 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
102 | .init = gumstix_mci_init, | ||
103 | }; | 94 | }; |
104 | 95 | ||
105 | static void __init gumstix_mmc_init(void) | 96 | static void __init gumstix_mmc_init(void) |
@@ -109,11 +100,11 @@ static void __init gumstix_mmc_init(void) | |||
109 | #else | 100 | #else |
110 | static void __init gumstix_mmc_init(void) | 101 | static void __init gumstix_mmc_init(void) |
111 | { | 102 | { |
112 | printk(KERN_INFO "Gumstix mmc disabled\n"); | 103 | pr_debug("Gumstix mmc disabled\n"); |
113 | } | 104 | } |
114 | #endif | 105 | #endif |
115 | 106 | ||
116 | #ifdef CONFIG_USB_GADGET_PXA2XX | 107 | #ifdef CONFIG_USB_GADGET_PXA25X |
117 | static struct pxa2xx_udc_mach_info gumstix_udc_info __initdata = { | 108 | static struct pxa2xx_udc_mach_info gumstix_udc_info __initdata = { |
118 | .gpio_vbus = GPIO_GUMSTIX_USB_GPIOn, | 109 | .gpio_vbus = GPIO_GUMSTIX_USB_GPIOn, |
119 | .gpio_pullup = GPIO_GUMSTIX_USB_GPIOx, | 110 | .gpio_pullup = GPIO_GUMSTIX_USB_GPIOx, |
@@ -126,12 +117,87 @@ static void __init gumstix_udc_init(void) | |||
126 | #else | 117 | #else |
127 | static void gumstix_udc_init(void) | 118 | static void gumstix_udc_init(void) |
128 | { | 119 | { |
129 | printk(KERN_INFO "Gumstix udc is disabled\n"); | 120 | pr_debug("Gumstix udc is disabled\n"); |
130 | } | 121 | } |
131 | #endif | 122 | #endif |
132 | 123 | ||
124 | #ifdef CONFIG_BT | ||
125 | /* Normally, the bootloader would have enabled this 32kHz clock but many | ||
126 | ** boards still have u-boot 1.1.4 so we check if it has been turned on and | ||
127 | ** if not, we turn it on with a warning message. */ | ||
128 | static void gumstix_setup_bt_clock(void) | ||
129 | { | ||
130 | int timeout = 500; | ||
131 | |||
132 | if (!(OSCC & OSCC_OOK)) | ||
133 | pr_warning("32kHz clock was not on. Bootloader may need to " | ||
134 | "be updated\n"); | ||
135 | else | ||
136 | return; | ||
137 | |||
138 | OSCC |= OSCC_OON; | ||
139 | do { | ||
140 | if (OSCC & OSCC_OOK) | ||
141 | break; | ||
142 | udelay(1); | ||
143 | } while (--timeout); | ||
144 | if (!timeout) | ||
145 | pr_err("Failed to start 32kHz clock\n"); | ||
146 | } | ||
147 | |||
148 | static void __init gumstix_bluetooth_init(void) | ||
149 | { | ||
150 | int err; | ||
151 | |||
152 | gumstix_setup_bt_clock(); | ||
153 | |||
154 | err = gpio_request(GPIO_GUMSTIX_BTRESET, "BTRST"); | ||
155 | if (err) { | ||
156 | pr_err("gumstix: failed request gpio for bluetooth reset\n"); | ||
157 | return; | ||
158 | } | ||
159 | |||
160 | err = gpio_direction_output(GPIO_GUMSTIX_BTRESET, 1); | ||
161 | if (err) { | ||
162 | pr_err("gumstix: can't reset bluetooth\n"); | ||
163 | return; | ||
164 | } | ||
165 | gpio_set_value(GPIO_GUMSTIX_BTRESET, 0); | ||
166 | udelay(100); | ||
167 | gpio_set_value(GPIO_GUMSTIX_BTRESET, 1); | ||
168 | } | ||
169 | #else | ||
170 | static void gumstix_bluetooth_init(void) | ||
171 | { | ||
172 | pr_debug("Gumstix Bluetooth is disabled\n"); | ||
173 | } | ||
174 | #endif | ||
175 | |||
176 | static unsigned long gumstix_pin_config[] __initdata = { | ||
177 | GPIO12_32KHz, | ||
178 | /* BTUART */ | ||
179 | GPIO42_HWUART_RXD, | ||
180 | GPIO43_HWUART_TXD, | ||
181 | GPIO44_HWUART_CTS, | ||
182 | GPIO45_HWUART_RTS, | ||
183 | /* MMC */ | ||
184 | GPIO6_MMC_CLK, | ||
185 | GPIO53_MMC_CLK, | ||
186 | GPIO8_MMC_CS0, | ||
187 | /* these are used by AM200EPD */ | ||
188 | GPIO51_GPIO, | ||
189 | GPIO49_GPIO, | ||
190 | GPIO48_GPIO, | ||
191 | GPIO32_GPIO, | ||
192 | GPIO17_GPIO, | ||
193 | GPIO16_GPIO, | ||
194 | }; | ||
195 | |||
133 | static void __init gumstix_init(void) | 196 | static void __init gumstix_init(void) |
134 | { | 197 | { |
198 | pxa2xx_mfp_config(ARRAY_AND_SIZE(gumstix_pin_config)); | ||
199 | |||
200 | gumstix_bluetooth_init(); | ||
135 | gumstix_udc_init(); | 201 | gumstix_udc_init(); |
136 | gumstix_mmc_init(); | 202 | gumstix_mmc_init(); |
137 | (void) platform_add_devices(devices, ARRAY_SIZE(devices)); | 203 | (void) platform_add_devices(devices, ARRAY_SIZE(devices)); |