aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r--arch/arm/mach-pxa/Kconfig691
-rw-r--r--arch/arm/mach-pxa/Makefile96
-rw-r--r--arch/arm/mach-pxa/am300epd.c2
-rw-r--r--arch/arm/mach-pxa/balloon3.c37
-rw-r--r--arch/arm/mach-pxa/capc7117.c158
-rw-r--r--arch/arm/mach-pxa/clock.c8
-rw-r--r--arch/arm/mach-pxa/clock.h4
-rw-r--r--arch/arm/mach-pxa/cm-x255.c21
-rw-r--r--arch/arm/mach-pxa/cm-x270.c83
-rw-r--r--arch/arm/mach-pxa/cm-x2xx-pci.c2
-rw-r--r--arch/arm/mach-pxa/cm-x2xx.c4
-rw-r--r--arch/arm/mach-pxa/cm-x300.c260
-rw-r--r--arch/arm/mach-pxa/colibri-pxa270.c3
-rw-r--r--arch/arm/mach-pxa/colibri-pxa300.c4
-rw-r--r--arch/arm/mach-pxa/colibri-pxa320.c4
-rw-r--r--arch/arm/mach-pxa/colibri-pxa3xx.c2
-rw-r--r--arch/arm/mach-pxa/corgi.c5
-rw-r--r--arch/arm/mach-pxa/corgi_pm.c4
-rw-r--r--arch/arm/mach-pxa/corgi_ssp.c3
-rw-r--r--arch/arm/mach-pxa/cpufreq-pxa3xx.c1
-rw-r--r--arch/arm/mach-pxa/csb726.c3
-rw-r--r--arch/arm/mach-pxa/devices.c30
-rw-r--r--arch/arm/mach-pxa/e330.c3
-rw-r--r--arch/arm/mach-pxa/e350.c3
-rw-r--r--arch/arm/mach-pxa/e400.c3
-rw-r--r--arch/arm/mach-pxa/e740.c9
-rw-r--r--arch/arm/mach-pxa/e750.c9
-rw-r--r--arch/arm/mach-pxa/e800.c12
-rw-r--r--arch/arm/mach-pxa/em-x270.c45
-rw-r--r--arch/arm/mach-pxa/eseries.c2
-rw-r--r--arch/arm/mach-pxa/ezx.c251
-rw-r--r--arch/arm/mach-pxa/generic.h5
-rw-r--r--arch/arm/mach-pxa/gumstix.c5
-rw-r--r--arch/arm/mach-pxa/h5000.c3
-rw-r--r--arch/arm/mach-pxa/himalaya.c3
-rw-r--r--arch/arm/mach-pxa/hx4700.c5
-rw-r--r--arch/arm/mach-pxa/icontrol.c202
-rw-r--r--arch/arm/mach-pxa/idp.c23
-rw-r--r--arch/arm/mach-pxa/imote2.c11
-rw-r--r--arch/arm/mach-pxa/include/mach/arcom-pcmcia.h11
-rw-r--r--arch/arm/mach-pxa/include/mach/balloon3.h10
-rw-r--r--arch/arm/mach-pxa/include/mach/camera.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/colibri.h1
-rw-r--r--arch/arm/mach-pxa/include/mach/debug-macro.S2
-rw-r--r--arch/arm/mach-pxa/include/mach/hardware.h19
-rw-r--r--arch/arm/mach-pxa/include/mach/irqs.h153
-rw-r--r--arch/arm/mach-pxa/include/mach/lpd270.h4
-rw-r--r--arch/arm/mach-pxa/include/mach/lubbock.h11
-rw-r--r--arch/arm/mach-pxa/include/mach/mainstone.h17
-rw-r--r--arch/arm/mach-pxa/include/mach/mfp-pxa25x.h38
-rw-r--r--arch/arm/mach-pxa/include/mach/mfp-pxa27x.h27
-rw-r--r--arch/arm/mach-pxa/include/mach/mxm8x10.h21
-rw-r--r--arch/arm/mach-pxa/include/mach/palmld.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/palmt5.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/palmtc.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/palmte2.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/palmtreo.h67
-rw-r--r--arch/arm/mach-pxa/include/mach/palmtx.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/palmz72.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/pcm027.h7
-rw-r--r--arch/arm/mach-pxa/include/mach/pxa3xx_nand.h63
-rw-r--r--arch/arm/mach-pxa/include/mach/pxafb.h3
-rw-r--r--arch/arm/mach-pxa/include/mach/regs-u2d.h200
-rw-r--r--arch/arm/mach-pxa/include/mach/ssp.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/treo680.h49
-rw-r--r--arch/arm/mach-pxa/include/mach/uncompress.h46
-rw-r--r--arch/arm/mach-pxa/include/mach/viper.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/zeus.h83
-rw-r--r--arch/arm/mach-pxa/include/mach/zylonite.h7
-rw-r--r--arch/arm/mach-pxa/irq.c14
-rw-r--r--arch/arm/mach-pxa/littleton.c14
-rw-r--r--arch/arm/mach-pxa/lpd270.c10
-rw-r--r--arch/arm/mach-pxa/lubbock.c39
-rw-r--r--arch/arm/mach-pxa/magician.c27
-rw-r--r--arch/arm/mach-pxa/mainstone.c31
-rw-r--r--arch/arm/mach-pxa/mioa701.c28
-rw-r--r--arch/arm/mach-pxa/mp900.c3
-rw-r--r--arch/arm/mach-pxa/mxm8x10.c474
-rw-r--r--arch/arm/mach-pxa/palmld.c27
-rw-r--r--arch/arm/mach-pxa/palmt5.c27
-rw-r--r--arch/arm/mach-pxa/palmtc.c28
-rw-r--r--arch/arm/mach-pxa/palmte2.c27
-rw-r--r--arch/arm/mach-pxa/palmtreo.c (renamed from arch/arm/mach-pxa/treo680.c)385
-rw-r--r--arch/arm/mach-pxa/palmtx.c27
-rw-r--r--arch/arm/mach-pxa/palmz72.c28
-rw-r--r--arch/arm/mach-pxa/pcm027.c4
-rw-r--r--arch/arm/mach-pxa/pcm990-baseboard.c17
-rw-r--r--arch/arm/mach-pxa/pm.c1
-rw-r--r--arch/arm/mach-pxa/poodle.c34
-rw-r--r--arch/arm/mach-pxa/pxa25x.c11
-rw-r--r--arch/arm/mach-pxa/pxa27x.c24
-rw-r--r--arch/arm/mach-pxa/pxa300.c4
-rw-r--r--arch/arm/mach-pxa/pxa320.c2
-rw-r--r--arch/arm/mach-pxa/pxa3xx.c49
-rw-r--r--arch/arm/mach-pxa/raumfeld.c1105
-rw-r--r--arch/arm/mach-pxa/saar.c105
-rw-r--r--arch/arm/mach-pxa/sharpsl.h4
-rw-r--r--arch/arm/mach-pxa/sharpsl_pm.c114
-rw-r--r--arch/arm/mach-pxa/spitz.c30
-rw-r--r--arch/arm/mach-pxa/spitz_pm.c14
-rw-r--r--arch/arm/mach-pxa/ssp.c78
-rw-r--r--arch/arm/mach-pxa/stargate2.c7
-rw-r--r--arch/arm/mach-pxa/tavorevb.c4
-rw-r--r--arch/arm/mach-pxa/time.c10
-rw-r--r--arch/arm/mach-pxa/tosa.c122
-rw-r--r--arch/arm/mach-pxa/trizeps4.c31
-rw-r--r--arch/arm/mach-pxa/viper.c51
-rw-r--r--arch/arm/mach-pxa/xcep.c5
-rw-r--r--arch/arm/mach-pxa/zeus.c913
-rw-r--r--arch/arm/mach-pxa/zylonite.c93
-rw-r--r--arch/arm/mach-pxa/zylonite_pxa300.c12
-rw-r--r--arch/arm/mach-pxa/zylonite_pxa320.c4
113 files changed, 5428 insertions, 1487 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index a6f8eab14ba5..5b6ee46fa7f6 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -2,87 +2,78 @@ if ARCH_PXA
2 2
3menu "Intel PXA2xx/PXA3xx Implementations" 3menu "Intel PXA2xx/PXA3xx Implementations"
4 4
5if PXA3xx 5comment "Intel/Marvell Dev Platforms (sorted by hardware release time)"
6 6
7menu "Supported PXA3xx Processor Variants" 7config ARCH_LUBBOCK
8 bool "Intel DBPXA250 Development Platform (aka Lubbock)"
9 select PXA25x
10 select SA1111
11 select PXA_HAVE_BOARD_IRQS
8 12
9config CPU_PXA300 13config MACH_MAINSTONE
10 bool "PXA300 (codename Monahans-L)" 14 bool "Intel HCDDBBVA0 Development Platform (aka Mainstone)"
15 select PXA27x
16 select HAVE_PWM
17 select PXA_HAVE_BOARD_IRQS
11 18
12config CPU_PXA310 19config MACH_ZYLONITE
13 bool "PXA310 (codename Monahans-LV)" 20 bool
21 select PXA3xx
22 select PXA_SSP
23 select HAVE_PWM
24 select PXA_HAVE_BOARD_IRQS
25
26config MACH_ZYLONITE300
27 bool "PXA3xx Development Platform (aka Zylonite) PXA300/310"
14 select CPU_PXA300 28 select CPU_PXA300
29 select CPU_PXA310
30 select MACH_ZYLONITE
15 31
16config CPU_PXA320 32config MACH_ZYLONITE320
17 bool "PXA320 (codename Monahans-P)" 33 bool "PXA3xx Development Platform (aka Zylonite) PXA320"
34 select CPU_PXA320
35 select MACH_ZYLONITE
18 36
19config CPU_PXA930 37config MACH_LITTLETON
20 bool "PXA930 (codename Tavor-P)" 38 bool "PXA3xx Form Factor Platform (aka Littleton)"
39 select PXA3xx
40 select CPU_PXA300
41 select CPU_PXA310
42 select PXA_SSP
21 43
22config CPU_PXA935 44config MACH_TAVOREVB
23 bool "PXA935 (codename Tavor-P65)" 45 bool "PXA930 Evaluation Board (aka TavorEVB)"
46 select PXA3xx
24 select CPU_PXA930 47 select CPU_PXA930
25 48
26config CPU_PXA950 49config MACH_SAAR
27 bool "PXA950 (codename Tavor-PV2)" 50 bool "PXA930 Handheld Platform (aka SAAR)"
51 select PXA3xx
28 select CPU_PXA930 52 select CPU_PXA930
29 53
30endmenu 54comment "Third Party Dev Platforms (sorted by vendor name)"
31 55
32endif 56config ARCH_PXA_IDP
33 57 bool "Accelent Xscale IDP"
34config ARCH_GUMSTIX
35 bool "Gumstix XScale 255 boards"
36 select PXA25x 58 select PXA25x
37 help
38 Say Y here if you intend to run this kernel on
39 Basix, Connex, ws-200ax, ws-400ax systems
40
41choice
42 prompt "Gumstix Carrier/Expansion Board"
43 depends on ARCH_GUMSTIX
44
45config GUMSTIX_AM200EPD
46 bool "Enable AM200EPD board support"
47
48config GUMSTIX_AM300EPD
49 bool "Enable AM300EPD board support"
50
51endchoice
52 59
53config MACH_INTELMOTE2 60config ARCH_VIPER
54 bool "Intel Mote 2 Platform" 61 bool "Arcom/Eurotech VIPER SBC"
55 select PXA27x
56 select IWMMXT
57 select PXA_HAVE_BOARD_IRQS
58
59config MACH_STARGATE2
60 bool "Intel Stargate 2 Platform"
61 select PXA27x
62 select IWMMXT
63 select PXA_HAVE_BOARD_IRQS
64
65config ARCH_LUBBOCK
66 bool "Intel DBPXA250 Development Platform"
67 select PXA25x 62 select PXA25x
68 select SA1111 63 select ISA
69 select PXA_HAVE_BOARD_IRQS 64 select I2C_GPIO
70
71config MACH_LOGICPD_PXA270
72 bool "LogicPD PXA270 Card Engine Development Platform"
73 select PXA27x
74 select HAVE_PWM 65 select HAVE_PWM
75 select PXA_HAVE_BOARD_IRQS 66 select PXA_HAVE_BOARD_IRQS
67 select PXA_HAVE_ISA_IRQS
68 select ARCOM_PCMCIA
76 69
77config MACH_MAINSTONE 70config MACH_ARCOM_ZEUS
78 bool "Intel HCDDBBVA0 Development Platform" 71 bool "Arcom/Eurotech ZEUS SBC"
79 select PXA27x 72 select PXA27x
80 select HAVE_PWM 73 select ISA
81 select PXA_HAVE_BOARD_IRQS 74 select PXA_HAVE_BOARD_IRQS
82 75 select PXA_HAVE_ISA_IRQS
83config MACH_MP900C 76 select ARCOM_PCMCIA
84 bool "Nec Mobilepro 900/c"
85 select PXA25x
86 77
87config MACH_BALLOON3 78config MACH_BALLOON3
88 bool "Balloon 3 board" 79 bool "Balloon 3 board"
@@ -90,157 +81,94 @@ config MACH_BALLOON3
90 select IWMMXT 81 select IWMMXT
91 select PXA_HAVE_BOARD_IRQS 82 select PXA_HAVE_BOARD_IRQS
92 83
93config ARCH_PXA_IDP 84config MACH_CSB726
94 bool "Accelent Xscale IDP" 85 bool "Enable Cogent CSB726 System On a Module"
95 select PXA25x 86 select PXA27x
96 87 select IWMMXT
97config PXA_SHARPSL
98 bool "SHARP Zaurus SL-5600, SL-C7xx and SL-Cxx00 Models"
99 select SHARP_SCOOP
100 select SHARP_PARAM
101 help 88 help
102 Say Y here if you intend to run this kernel on a 89 Say Y here if you intend to run this kernel on a Cogent
103 Sharp Zaurus SL-5600 (Poodle), SL-C700 (Corgi), 90 CSB726 System On Module.
104 SL-C750 (Shepherd), SL-C760 (Husky), SL-C1000 (Akita),
105 SL-C3000 (Spitz), SL-C3100 (Borzoi) or SL-C6000x (Tosa)
106 handheld computer.
107
108config SHARPSL_PM
109 bool
110 select APM_EMULATION
111 91
112config CORGI_SSP_DEPRECATED 92config CSB726_CSB701
113 bool 93 bool "Enable support for CSB701 baseboard"
114 select PXA_SSP 94 depends on MACH_CSB726
115 help
116 This option will include corgi_ssp.c and corgi_lcd.c
117 that corgi_ts.c and other legacy drivers (corgi_bl.c
118 and sharpsl_pm.c) may depend on.
119 95
120config MACH_POODLE 96config MACH_ARMCORE
121 bool "Enable Sharp SL-5600 (Poodle) Support" 97 bool "CompuLab CM-X255/CM-X270 modules"
122 depends on PXA_SHARPSL 98 select PXA27x
99 select IWMMXT
123 select PXA25x 100 select PXA25x
124 select SHARP_LOCOMO
125 select PXA_SSP 101 select PXA_SSP
126 102
127config MACH_CORGI 103config MACH_EM_X270
128 bool "Enable Sharp SL-C700 (Corgi) Support" 104 bool "CompuLab EM-x270 platform"
129 depends on PXA_SHARPSL
130 select PXA25x
131 select PXA_SHARP_C7xx
132
133config MACH_SHEPHERD
134 bool "Enable Sharp SL-C750 (Shepherd) Support"
135 depends on PXA_SHARPSL
136 select PXA25x
137 select PXA_SHARP_C7xx
138
139config MACH_HUSKY
140 bool "Enable Sharp SL-C760 (Husky) Support"
141 depends on PXA_SHARPSL
142 select PXA25x
143 select PXA_SHARP_C7xx
144
145config MACH_AKITA
146 bool "Enable Sharp SL-1000 (Akita) Support"
147 depends on PXA_SHARPSL
148 select PXA27x 105 select PXA27x
149 select PXA_SHARP_Cxx00
150 select MACH_SPITZ
151 select I2C
152 select I2C_PXA
153 106
154config MACH_SPITZ 107config MACH_EXEDA
155 bool "Enable Sharp Zaurus SL-3000 (Spitz) Support" 108 bool "CompuLab eXeda platform"
156 depends on PXA_SHARPSL
157 select PXA27x 109 select PXA27x
158 select PXA_SHARP_Cxx00
159 110
160config MACH_BORZOI 111config MACH_CM_X300
161 bool "Enable Sharp Zaurus SL-3100 (Borzoi) Support" 112 bool "CompuLab CM-X300 modules"
162 depends on PXA_SHARPSL 113 select PXA3xx
163 select PXA27x 114 select CPU_PXA300
164 select PXA_SHARP_Cxx00 115 select CPU_PXA310
116 select HAVE_PWM
165 117
166config MACH_TOSA 118config MACH_CAPC7117
167 bool "Enable Sharp SL-6000x (Tosa) Support" 119 bool "Embedian CAPC-7117 evaluation kit based on the MXM-8x10 CoM"
168 depends on PXA_SHARPSL 120 select CPU_PXA320
169 select PXA25x 121 select PXA3xx
170 select PXA_HAVE_BOARD_IRQS
171 122
172config ARCH_VIPER 123config ARCH_GUMSTIX
173 bool "Arcom/Eurotech VIPER SBC" 124 bool "Gumstix XScale 255 boards"
174 select PXA25x 125 select PXA25x
175 select ISA 126 help
176 select I2C_GPIO 127 Say Y here if you intend to run this kernel on
177 select HAVE_PWM 128 Basix, Connex, ws-200ax, ws-400ax systems
178 select PXA_HAVE_BOARD_IRQS
179 select PXA_HAVE_ISA_IRQS
180 129
181config ARCH_PXA_ESERIES 130choice
182 bool "PXA based Toshiba e-series PDAs" 131 prompt "Gumstix Carrier/Expansion Board"
183 select PXA25x 132 depends on ARCH_GUMSTIX
184 select PXA_HAVE_BOARD_IRQS
185 133
186config MACH_E330 134config GUMSTIX_AM200EPD
187 bool "Toshiba e330" 135 bool "Enable AM200EPD board support"
188 default y
189 depends on ARCH_PXA_ESERIES
190 help
191 Say Y here if you intend to run this kernel on a Toshiba
192 e330 family PDA.
193 136
194config MACH_E350 137config GUMSTIX_AM300EPD
195 bool "Toshiba e350" 138 bool "Enable AM300EPD board support"
196 default y
197 depends on ARCH_PXA_ESERIES
198 help
199 Say Y here if you intend to run this kernel on a Toshiba
200 e350 family PDA.
201 139
202config MACH_E740 140endchoice
203 bool "Toshiba e740"
204 default y
205 depends on ARCH_PXA_ESERIES
206 select FB_W100
207 help
208 Say Y here if you intend to run this kernel on a Toshiba
209 e740 family PDA.
210 141
211config MACH_E750 142config MACH_INTELMOTE2
212 bool "Toshiba e750" 143 bool "Intel Mote 2 Platform"
213 default y 144 select PXA27x
214 depends on ARCH_PXA_ESERIES 145 select IWMMXT
215 select FB_W100 146 select PXA_HAVE_BOARD_IRQS
216 help
217 Say Y here if you intend to run this kernel on a Toshiba
218 e750 family PDA.
219 147
220config MACH_E400 148config MACH_STARGATE2
221 bool "Toshiba e400" 149 bool "Intel Stargate 2 Platform"
222 default y 150 select PXA27x
223 depends on ARCH_PXA_ESERIES 151 select IWMMXT
224 help 152 select PXA_HAVE_BOARD_IRQS
225 Say Y here if you intend to run this kernel on a Toshiba
226 e400 family PDA.
227 153
228config MACH_E800 154config MACH_XCEP
229 bool "Toshiba e800" 155 bool "Iskratel Electronics XCEP"
230 default y 156 select PXA25x
231 depends on ARCH_PXA_ESERIES 157 select MTD
232 select FB_W100 158 select MTD_PARTITIONS
159 select MTD_PHYSMAP
160 select MTD_CFI_INTELEXT
161 select MTD_CFI
162 select MTD_CHAR
163 select SMC91X
164 select PXA_SSP
233 help 165 help
234 Say Y here if you intend to run this kernel on a Toshiba 166 PXA255 based Single Board Computer with SMC 91C111 ethernet chip and 64 MB of flash.
235 e800 family PDA. 167 Tuned for usage in Libera instruments for particle accelerators.
236 168
237config TRIZEPS_PXA 169config TRIZEPS_PXA
238 bool "PXA based Keith und Koep Trizeps DIMM-Modules" 170 bool "PXA based Keith und Koep Trizeps DIMM-Modules"
239 171
240config MACH_H5000
241 bool "HP iPAQ h5000"
242 select PXA25x
243
244config MACH_TRIZEPS4 172config MACH_TRIZEPS4
245 bool "Keith und Koep Trizeps4 DIMM-Module" 173 bool "Keith und Koep Trizeps4 DIMM-Module"
246 depends on TRIZEPS_PXA 174 depends on TRIZEPS_PXA
@@ -269,18 +197,48 @@ config MACH_TRIZEPS_ANY
269 197
270endchoice 198endchoice
271 199
200config ARCOM_PCMCIA
201 bool
202 help
203 Generic option for Arcom Viper/Zeus PCMCIA
204
272config TRIZEPS_PCMCIA 205config TRIZEPS_PCMCIA
273 bool 206 bool
274 help 207 help
275 Enable PCMCIA support for Trizeps modules 208 Enable PCMCIA support for Trizeps modules
276 209
277config MACH_EM_X270 210config MACH_LOGICPD_PXA270
278 bool "CompuLab EM-x270 platform" 211 bool "LogicPD PXA270 Card Engine Development Platform"
279 select PXA27x 212 select PXA27x
213 select HAVE_PWM
214 select PXA_HAVE_BOARD_IRQS
280 215
281config MACH_EXEDA 216config MACH_PCM027
282 bool "CompuLab eXeda platform" 217 bool "Phytec phyCORE-PXA270 CPU module (PCM-027)"
283 select PXA27x 218 select PXA27x
219 select IWMMXT
220 select PXA_SSP
221 select PXA_HAVE_BOARD_IRQS
222
223config MACH_PCM990_BASEBOARD
224 bool "PHYTEC PCM-990 development board"
225 select HAVE_PWM
226 depends on MACH_PCM027
227
228choice
229 prompt "display on pcm990"
230 depends on MACH_PCM990_BASEBOARD
231
232config PCM990_DISPLAY_SHARP
233 bool "sharp lq084v1dg21 stn display"
234
235config PCM990_DISPLAY_NEC
236 bool "nec nl6448bc20_18d tft display"
237
238config PCM990_DISPLAY_NONE
239 bool "no display"
240
241endchoice
284 242
285config MACH_COLIBRI 243config MACH_COLIBRI
286 bool "Toradex Colibri PXA270" 244 bool "Toradex Colibri PXA270"
@@ -290,45 +248,14 @@ config MACH_COLIBRI300
290 bool "Toradex Colibri PXA300/310" 248 bool "Toradex Colibri PXA300/310"
291 select PXA3xx 249 select PXA3xx
292 select CPU_PXA300 250 select CPU_PXA300
251 select CPU_PXA310
293 252
294config MACH_COLIBRI320 253config MACH_COLIBRI320
295 bool "Toradex Colibri PXA320" 254 bool "Toradex Colibri PXA320"
296 select PXA3xx 255 select PXA3xx
297 select CPU_PXA320 256 select CPU_PXA320
298 257
299config MACH_ZYLONITE 258comment "End-user Products (sorted by vendor name)"
300 bool "PXA3xx Development Platform (aka Zylonite)"
301 select PXA3xx
302 select PXA_SSP
303 select HAVE_PWM
304 select PXA_HAVE_BOARD_IRQS
305
306config MACH_LITTLETON
307 bool "PXA3xx Form Factor Platform (aka Littleton)"
308 select PXA3xx
309 select PXA_SSP
310
311config MACH_TAVOREVB
312 bool "PXA930 Evaluation Board (aka TavorEVB)"
313 select PXA3xx
314 select CPU_PXA930
315
316config MACH_SAAR
317 bool "PXA930 Handheld Platform (aka SAAR)"
318 select PXA3xx
319 select CPU_PXA930
320
321config MACH_ARMCORE
322 bool "CompuLab CM-X255/CM-X270 modules"
323 select PXA27x
324 select IWMMXT
325 select PXA25x
326 select PXA_SSP
327
328config MACH_CM_X300
329 bool "CompuLab CM-X300 modules"
330 select PXA3xx
331 select CPU_PXA300
332 259
333config MACH_H4700 260config MACH_H4700
334 bool "HP iPAQ hx4700" 261 bool "HP iPAQ hx4700"
@@ -338,6 +265,14 @@ config MACH_H4700
338 select HAVE_PWM 265 select HAVE_PWM
339 select PXA_HAVE_BOARD_IRQS 266 select PXA_HAVE_BOARD_IRQS
340 267
268config MACH_H5000
269 bool "HP iPAQ h5000"
270 select PXA25x
271
272config MACH_HIMALAYA
273 bool "HTC Himalaya Support"
274 select CPU_PXA26x
275
341config MACH_MAGICIAN 276config MACH_MAGICIAN
342 bool "Enable HTC Magician Support" 277 bool "Enable HTC Magician Support"
343 select PXA27x 278 select PXA27x
@@ -346,11 +281,6 @@ config MACH_MAGICIAN
346 select HAVE_PWM 281 select HAVE_PWM
347 select PXA_HAVE_BOARD_IRQS 282 select PXA_HAVE_BOARD_IRQS
348 283
349config MACH_HIMALAYA
350 bool "HTC Himalaya Support"
351 select CPU_PXA26x
352 select FB_W100
353
354config MACH_MIOA701 284config MACH_MIOA701
355 bool "Mitac Mio A701 Support" 285 bool "Mitac Mio A701 Support"
356 select PXA27x 286 select PXA27x
@@ -362,13 +292,47 @@ config MACH_MIOA701
362 MIO A701. Currently there is only basic support 292 MIO A701. Currently there is only basic support
363 for this PDA. 293 for this PDA.
364 294
365config MACH_PCM027 295config PXA_EZX
366 bool "Phytec phyCORE-PXA270 CPU module (PCM-027)" 296 bool "Motorola EZX Platform"
367 select PXA27x 297 select PXA27x
368 select IWMMXT 298 select IWMMXT
369 select PXA_SSP 299 select HAVE_PWM
370 select PXA_HAVE_BOARD_IRQS 300 select PXA_HAVE_BOARD_IRQS
371 301
302config MACH_EZX_A780
303 bool "Motorola EZX A780"
304 default y
305 depends on PXA_EZX
306
307config MACH_EZX_E680
308 bool "Motorola EZX E680"
309 default y
310 depends on PXA_EZX
311
312config MACH_EZX_A1200
313 bool "Motorola EZX A1200"
314 default y
315 depends on PXA_EZX
316
317config MACH_EZX_A910
318 bool "Motorola EZX A910"
319 default y
320 depends on PXA_EZX
321
322config MACH_EZX_E6
323 bool "Motorola EZX E6"
324 default y
325 depends on PXA_EZX
326
327config MACH_EZX_E2
328 bool "Motorola EZX E2"
329 default y
330 depends on PXA_EZX
331
332config MACH_MP900C
333 bool "Nec Mobilepro 900/c"
334 select PXA25x
335
372config ARCH_PXA_PALM 336config ARCH_PXA_PALM
373 bool "PXA based Palm PDAs" 337 bool "PXA based Palm PDAs"
374 select HAVE_PWM 338 select HAVE_PWM
@@ -421,109 +385,201 @@ config MACH_PALMZ72
421 Say Y here if you intend to run this kernel on Palm Zire 72 385 Say Y here if you intend to run this kernel on Palm Zire 72
422 handheld computer. 386 handheld computer.
423 387
424config MACH_TREO680 388config MACH_PALMLD
425 bool "Palm Treo 680" 389 bool "Palm LifeDrive"
426 default y 390 default y
427 depends on ARCH_PXA_PALM 391 depends on ARCH_PXA_PALM
428 select PXA27x 392 select PXA27x
429 select IWMMXT 393 select IWMMXT
430 help 394 help
431 Say Y here if you intend to run this kernel on Palm Treo 680 395 Say Y here if you intend to run this kernel on a Palm LifeDrive
396 handheld computer.
397
398config PALM_TREO
399 bool
400 depends on ARCH_PXA_PALM
401
402config MACH_CENTRO
403 bool "Palm Centro 685 (GSM)"
404 default y
405 depends on ARCH_PXA_PALM
406 select PXA27x
407 select IWMMXT
408 select PALM_TREO
409 help
410 Say Y here if you intend to run this kernel on Palm Centro 685 (GSM)
432 smartphone. 411 smartphone.
433 412
434config MACH_PALMLD 413config MACH_TREO680
435 bool "Palm LifeDrive" 414 bool "Palm Treo 680"
436 default y 415 default y
437 depends on ARCH_PXA_PALM 416 depends on ARCH_PXA_PALM
438 select PXA27x 417 select PXA27x
439 select IWMMXT 418 select IWMMXT
419 select PALM_TREO
440 help 420 help
441 Say Y here if you intend to run this kernel on a Palm LifeDrive 421 Say Y here if you intend to run this kernel on Palm Treo 680
442 handheld computer. 422 smartphone.
443 423
444config MACH_PCM990_BASEBOARD 424config MACH_RAUMFELD_RC
445 bool "PHYTEC PCM-990 development board" 425 bool "Raumfeld Controller"
426 select PXA3xx
427 select CPU_PXA300
446 select HAVE_PWM 428 select HAVE_PWM
447 depends on MACH_PCM027
448 429
449choice 430config MACH_RAUMFELD_CONNECTOR
450 prompt "display on pcm990" 431 bool "Raumfeld Connector"
451 depends on MACH_PCM990_BASEBOARD 432 select PXA3xx
433 select CPU_PXA300
434 select PXA_SSP
452 435
453config PCM990_DISPLAY_SHARP 436config MACH_RAUMFELD_SPEAKER
454 bool "sharp lq084v1dg21 stn display" 437 bool "Raumfeld Speaker"
438 select PXA3xx
439 select CPU_PXA300
440 select PXA_SSP
455 441
456config PCM990_DISPLAY_NEC 442config PXA_SHARPSL
457 bool "nec nl6448bc20_18d tft display" 443 bool "SHARP Zaurus SL-5600, SL-C7xx and SL-Cxx00 Models"
444 select SHARP_SCOOP
445 select SHARP_PARAM
446 help
447 Say Y here if you intend to run this kernel on a
448 Sharp Zaurus SL-5600 (Poodle), SL-C700 (Corgi),
449 SL-C750 (Shepherd), SL-C760 (Husky), SL-C1000 (Akita),
450 SL-C3000 (Spitz), SL-C3100 (Borzoi) or SL-C6000x (Tosa)
451 handheld computer.
458 452
459config PCM990_DISPLAY_NONE 453config SHARPSL_PM
460 bool "no display" 454 bool
455 select APM_EMULATION
456 select SHARPSL_PM_MAX1111
461 457
462endchoice 458config SHARPSL_PM_MAX1111
459 bool
460 depends on !CORGI_SSP_DEPRECATED
461 select HWMON
462 select SENSORS_MAX1111
463 463
464config MACH_CSB726 464config CORGI_SSP_DEPRECATED
465 bool "Enable Cogent CSB726 System On a Module" 465 bool
466 select PXA27x 466 select PXA_SSP
467 select IWMMXT 467 select PXA_SSP_LEGACY
468 help 468 help
469 Say Y here if you intend to run this kernel on a Cogent 469 This option will include corgi_ssp.c and corgi_lcd.c
470 CSB726 System On Module. 470 that corgi_ts.c and other legacy drivers (corgi_bl.c
471 and sharpsl_pm.c) may depend on.
471 472
472config CSB726_CSB701 473config MACH_POODLE
473 bool "Enable supprot for CSB701 baseboard" 474 bool "Enable Sharp SL-5600 (Poodle) Support"
474 depends on MACH_CSB726 475 depends on PXA_SHARPSL
476 select PXA25x
477 select SHARP_LOCOMO
478 select PXA_SSP
479 select PXA_HAVE_BOARD_IRQS
475 480
476config PXA_EZX 481config MACH_CORGI
477 bool "Motorola EZX Platform" 482 bool "Enable Sharp SL-C700 (Corgi) Support"
483 depends on PXA_SHARPSL
484 select PXA25x
485 select PXA_SHARP_C7xx
486
487config MACH_SHEPHERD
488 bool "Enable Sharp SL-C750 (Shepherd) Support"
489 depends on PXA_SHARPSL
490 select PXA25x
491 select PXA_SHARP_C7xx
492
493config MACH_HUSKY
494 bool "Enable Sharp SL-C760 (Husky) Support"
495 depends on PXA_SHARPSL
496 select PXA25x
497 select PXA_SHARP_C7xx
498
499config MACH_AKITA
500 bool "Enable Sharp SL-1000 (Akita) Support"
501 depends on PXA_SHARPSL
478 select PXA27x 502 select PXA27x
479 select IWMMXT 503 select PXA_SHARP_Cxx00
480 select HAVE_PWM 504 select MACH_SPITZ
505 select I2C
506 select I2C_PXA
507
508config MACH_SPITZ
509 bool "Enable Sharp Zaurus SL-3000 (Spitz) Support"
510 depends on PXA_SHARPSL
511 select PXA27x
512 select PXA_SHARP_Cxx00
513
514config MACH_BORZOI
515 bool "Enable Sharp Zaurus SL-3100 (Borzoi) Support"
516 depends on PXA_SHARPSL
517 select PXA27x
518 select PXA_SHARP_Cxx00
519
520config MACH_TOSA
521 bool "Enable Sharp SL-6000x (Tosa) Support"
522 depends on PXA_SHARPSL
523 select PXA25x
481 select PXA_HAVE_BOARD_IRQS 524 select PXA_HAVE_BOARD_IRQS
482 525
483config MACH_EZX_A780 526config MACH_ICONTROL
484 bool "Motorola EZX A780" 527 bool "TMT iControl/SafeTCam based on the MXM-8x10 CoM"
485 default y 528 select CPU_PXA320
486 depends on PXA_EZX 529 select PXA3xx
487 530
488config MACH_EZX_E680 531config ARCH_PXA_ESERIES
489 bool "Motorola EZX E680" 532 bool "PXA based Toshiba e-series PDAs"
533 select PXA25x
534 select PXA_HAVE_BOARD_IRQS
535
536config MACH_E330
537 bool "Toshiba e330"
490 default y 538 default y
491 depends on PXA_EZX 539 depends on ARCH_PXA_ESERIES
540 help
541 Say Y here if you intend to run this kernel on a Toshiba
542 e330 family PDA.
492 543
493config MACH_EZX_A1200 544config MACH_E350
494 bool "Motorola EZX A1200" 545 bool "Toshiba e350"
495 default y 546 default y
496 depends on PXA_EZX 547 depends on ARCH_PXA_ESERIES
548 help
549 Say Y here if you intend to run this kernel on a Toshiba
550 e350 family PDA.
497 551
498config MACH_EZX_A910 552config MACH_E740
499 bool "Motorola EZX A910" 553 bool "Toshiba e740"
500 default y 554 default y
501 depends on PXA_EZX 555 depends on ARCH_PXA_ESERIES
556 help
557 Say Y here if you intend to run this kernel on a Toshiba
558 e740 family PDA.
502 559
503config MACH_EZX_E6 560config MACH_E750
504 bool "Motorola EZX E6" 561 bool "Toshiba e750"
505 default y 562 default y
506 depends on PXA_EZX 563 depends on ARCH_PXA_ESERIES
564 help
565 Say Y here if you intend to run this kernel on a Toshiba
566 e750 family PDA.
507 567
508config MACH_EZX_E2 568config MACH_E400
509 bool "Motorola EZX E2" 569 bool "Toshiba e400"
510 default y 570 default y
511 depends on PXA_EZX 571 depends on ARCH_PXA_ESERIES
572 help
573 Say Y here if you intend to run this kernel on a Toshiba
574 e400 family PDA.
512 575
513config MACH_XCEP 576config MACH_E800
514 bool "Iskratel Electronics XCEP" 577 bool "Toshiba e800"
515 select PXA25x 578 default y
516 select MTD 579 depends on ARCH_PXA_ESERIES
517 select MTD_PARTITIONS
518 select MTD_PHYSMAP
519 select MTD_CFI_INTELEXT
520 select MTD_CFI
521 select MTD_CHAR
522 select SMC91X
523 select PXA_SSP
524 help 580 help
525 PXA255 based Single Board Computer with SMC 91C111 ethernet chip and 64 MB of flash. 581 Say Y here if you intend to run this kernel on a Toshiba
526 Tuned for usage in Libera instruments for particle accelerators. 582 e800 family PDA.
527 583
528endmenu 584endmenu
529 585
@@ -551,6 +607,42 @@ config PXA3xx
551 help 607 help
552 Select code specific to PXA3xx variants 608 Select code specific to PXA3xx variants
553 609
610config CPU_PXA300
611 bool
612 select PXA3xx
613 help
614 PXA300 (codename Monahans-L)
615
616config CPU_PXA310
617 bool
618 select CPU_PXA300
619 help
620 PXA310 (codename Monahans-LV)
621
622config CPU_PXA320
623 bool
624 select PXA3xx
625 help
626 PXA320 (codename Monahans-P)
627
628config CPU_PXA930
629 bool
630 select PXA3xx
631 help
632 PXA930 (codename Tavor-P)
633
634config CPU_PXA935
635 bool
636 select CPU_PXA930
637 help
638 PXA935 (codename Tavor-P65)
639
640config CPU_PXA950
641 bool
642 select CPU_PXA930
643 help
644 PXA950 (codename Tavor-PV2)
645
554config PXA_SHARP_C7xx 646config PXA_SHARP_C7xx
555 bool 647 bool
556 select PXA_SSP 648 select PXA_SSP
@@ -570,6 +662,11 @@ config PXA_SSP
570 help 662 help
571 Enable support for PXA2xx SSP ports 663 Enable support for PXA2xx SSP ports
572 664
665config PXA_SSP_LEGACY
666 bool
667 help
668 Support of legacy SSP API
669
573config TOSA_BT 670config TOSA_BT
574 tristate "Control the state of built-in bluetooth chip on Sharp SL-6000" 671 tristate "Control the state of built-in bluetooth chip on Sharp SL-6000"
575 depends on MACH_TOSA 672 depends on MACH_TOSA
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index f10e152bfc27..86bc87b7f2dd 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -24,33 +24,66 @@ obj-$(CONFIG_CPU_PXA300) += pxa300.o
24obj-$(CONFIG_CPU_PXA320) += pxa320.o 24obj-$(CONFIG_CPU_PXA320) += pxa320.o
25obj-$(CONFIG_CPU_PXA930) += pxa930.o 25obj-$(CONFIG_CPU_PXA930) += pxa930.o
26 26
27# Specific board support 27# NOTE: keep the order of boards in accordance to their order in Kconfig
28obj-$(CONFIG_ARCH_GUMSTIX) += gumstix.o 28
29obj-$(CONFIG_GUMSTIX_AM200EPD) += am200epd.o 29# Intel/Marvell Dev Platforms
30obj-$(CONFIG_GUMSTIX_AM300EPD) += am300epd.o
31obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o 30obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o
32obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o
33obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o 31obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o
34obj-$(CONFIG_MACH_BALLOON3) += balloon3.o 32obj-$(CONFIG_MACH_ZYLONITE300) += zylonite.o zylonite_pxa300.o
35obj-$(CONFIG_MACH_MP900C) += mp900.o 33obj-$(CONFIG_MACH_ZYLONITE320) += zylonite.o zylonite_pxa320.o
34obj-$(CONFIG_MACH_LITTLETON) += littleton.o
35obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o
36obj-$(CONFIG_MACH_SAAR) += saar.o
37
38# 3rd Party Dev Platforms
36obj-$(CONFIG_ARCH_PXA_IDP) += idp.o 39obj-$(CONFIG_ARCH_PXA_IDP) += idp.o
40obj-$(CONFIG_ARCH_VIPER) += viper.o
41obj-$(CONFIG_MACH_ARCOM_ZEUS) += zeus.o
42obj-$(CONFIG_MACH_BALLOON3) += balloon3.o
43obj-$(CONFIG_MACH_CSB726) += csb726.o
44obj-$(CONFIG_CSB726_CSB701) += csb701.o
45obj-$(CONFIG_MACH_ARMCORE) += cm-x2xx.o cm-x255.o cm-x270.o
46ifeq ($(CONFIG_PCI),y)
47obj-$(CONFIG_MACH_ARMCORE) += cm-x2xx-pci.o
48endif
49obj-$(CONFIG_MACH_EM_X270) += em-x270.o
50obj-$(CONFIG_MACH_CM_X300) += cm-x300.o
51obj-$(CONFIG_MACH_CAPC7117) += capc7117.o mxm8x10.o
52obj-$(CONFIG_ARCH_GUMSTIX) += gumstix.o
53obj-$(CONFIG_GUMSTIX_AM200EPD) += am200epd.o
54obj-$(CONFIG_GUMSTIX_AM300EPD) += am300epd.o
55obj-$(CONFIG_MACH_INTELMOTE2) += imote2.o
56obj-$(CONFIG_MACH_STARGATE2) += stargate2.o
57obj-$(CONFIG_MACH_XCEP) += xcep.o
37obj-$(CONFIG_MACH_TRIZEPS4) += trizeps4.o 58obj-$(CONFIG_MACH_TRIZEPS4) += trizeps4.o
59obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o
60obj-$(CONFIG_MACH_PCM027) += pcm027.o
61obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o
38obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o 62obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o
39obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o 63obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o
40obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o 64obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o
65
66# End-user Products
67obj-$(CONFIG_MACH_H4700) += hx4700.o
41obj-$(CONFIG_MACH_H5000) += h5000.o 68obj-$(CONFIG_MACH_H5000) += h5000.o
69obj-$(CONFIG_MACH_HIMALAYA) += himalaya.o
70obj-$(CONFIG_MACH_MAGICIAN) += magician.o
71obj-$(CONFIG_MACH_MIOA701) += mioa701.o mioa701_bootresume.o
72obj-$(CONFIG_PXA_EZX) += ezx.o
73obj-$(CONFIG_MACH_MP900C) += mp900.o
74obj-$(CONFIG_MACH_PALMTE2) += palmte2.o
75obj-$(CONFIG_MACH_PALMTC) += palmtc.o
76obj-$(CONFIG_MACH_PALMT5) += palmt5.o
77obj-$(CONFIG_MACH_PALMTX) += palmtx.o
78obj-$(CONFIG_MACH_PALMZ72) += palmz72.o
79obj-$(CONFIG_MACH_PALMLD) += palmld.o
80obj-$(CONFIG_PALM_TREO) += palmtreo.o
42obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o sharpsl_pm.o corgi_pm.o 81obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o sharpsl_pm.o corgi_pm.o
43obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o sharpsl_pm.o spitz_pm.o 82obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o sharpsl_pm.o spitz_pm.o
44obj-$(CONFIG_CORGI_SSP_DEPRECATED) += corgi_ssp.o corgi_lcd.o 83obj-$(CONFIG_CORGI_SSP_DEPRECATED) += corgi_ssp.o corgi_lcd.o
45obj-$(CONFIG_MACH_POODLE) += poodle.o 84obj-$(CONFIG_MACH_POODLE) += poodle.o
46obj-$(CONFIG_MACH_PCM027) += pcm027.o
47obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o
48obj-$(CONFIG_MACH_TOSA) += tosa.o 85obj-$(CONFIG_MACH_TOSA) += tosa.o
49obj-$(CONFIG_MACH_EM_X270) += em-x270.o 86obj-$(CONFIG_MACH_ICONTROL) += icontrol.o mxm8x10.o
50obj-$(CONFIG_MACH_H4700) += hx4700.o
51obj-$(CONFIG_MACH_MAGICIAN) += magician.o
52obj-$(CONFIG_MACH_HIMALAYA) += himalaya.o
53obj-$(CONFIG_MACH_MIOA701) += mioa701.o mioa701_bootresume.o
54obj-$(CONFIG_ARCH_PXA_ESERIES) += eseries.o 87obj-$(CONFIG_ARCH_PXA_ESERIES) += eseries.o
55obj-$(CONFIG_MACH_E330) += e330.o 88obj-$(CONFIG_MACH_E330) += e330.o
56obj-$(CONFIG_MACH_E350) += e350.o 89obj-$(CONFIG_MACH_E350) += e350.o
@@ -58,34 +91,9 @@ obj-$(CONFIG_MACH_E740) += e740.o
58obj-$(CONFIG_MACH_E750) += e750.o 91obj-$(CONFIG_MACH_E750) += e750.o
59obj-$(CONFIG_MACH_E400) += e400.o 92obj-$(CONFIG_MACH_E400) += e400.o
60obj-$(CONFIG_MACH_E800) += e800.o 93obj-$(CONFIG_MACH_E800) += e800.o
61obj-$(CONFIG_MACH_PALMTE2) += palmte2.o 94obj-$(CONFIG_MACH_RAUMFELD_RC) += raumfeld.o
62obj-$(CONFIG_MACH_PALMTC) += palmtc.o 95obj-$(CONFIG_MACH_RAUMFELD_CONNECTOR) += raumfeld.o
63obj-$(CONFIG_MACH_PALMT5) += palmt5.o 96obj-$(CONFIG_MACH_RAUMFELD_SPEAKER) += raumfeld.o
64obj-$(CONFIG_MACH_PALMTX) += palmtx.o
65obj-$(CONFIG_MACH_PALMLD) += palmld.o
66obj-$(CONFIG_MACH_PALMZ72) += palmz72.o
67obj-$(CONFIG_MACH_TREO680) += treo680.o
68obj-$(CONFIG_ARCH_VIPER) += viper.o
69
70ifeq ($(CONFIG_MACH_ZYLONITE),y)
71 obj-y += zylonite.o
72 obj-$(CONFIG_CPU_PXA300) += zylonite_pxa300.o
73 obj-$(CONFIG_CPU_PXA320) += zylonite_pxa320.o
74endif
75obj-$(CONFIG_MACH_LITTLETON) += littleton.o
76obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o
77obj-$(CONFIG_MACH_SAAR) += saar.o
78
79obj-$(CONFIG_MACH_ARMCORE) += cm-x2xx.o cm-x255.o cm-x270.o
80obj-$(CONFIG_MACH_CM_X300) += cm-x300.o
81obj-$(CONFIG_PXA_EZX) += ezx.o
82
83obj-$(CONFIG_MACH_XCEP) += xcep.o
84
85obj-$(CONFIG_MACH_INTELMOTE2) += imote2.o
86obj-$(CONFIG_MACH_STARGATE2) += stargate2.o
87obj-$(CONFIG_MACH_CSB726) += csb726.o
88obj-$(CONFIG_CSB726_CSB701) += csb701.o
89 97
90# Support for blinky lights 98# Support for blinky lights
91led-y := leds.o 99led-y := leds.o
@@ -95,8 +103,4 @@ led-$(CONFIG_ARCH_PXA_IDP) += leds-idp.o
95 103
96obj-$(CONFIG_LEDS) += $(led-y) 104obj-$(CONFIG_LEDS) += $(led-y)
97 105
98ifeq ($(CONFIG_PCI),y)
99obj-$(CONFIG_MACH_ARMCORE) += cm-x2xx-pci.o
100endif
101
102obj-$(CONFIG_TOSA_BT) += tosa-bt.o 106obj-$(CONFIG_TOSA_BT) += tosa-bt.o
diff --git a/arch/arm/mach-pxa/am300epd.c b/arch/arm/mach-pxa/am300epd.c
index 4bd10a17332e..993d75e66390 100644
--- a/arch/arm/mach-pxa/am300epd.c
+++ b/arch/arm/mach-pxa/am300epd.c
@@ -288,7 +288,7 @@ int __init am300_init(void)
288} 288}
289 289
290module_param(panel_type, uint, 0); 290module_param(panel_type, uint, 0);
291MODULE_PARM_DESC(panel_type, "Select the panel type: 6, 8, 97"); 291MODULE_PARM_DESC(panel_type, "Select the panel type: 37, 6, 97");
292 292
293MODULE_DESCRIPTION("board driver for am300 epd kit"); 293MODULE_DESCRIPTION("board driver for am300 epd kit");
294MODULE_AUTHOR("Jaya Kumar"); 294MODULE_AUTHOR("Jaya Kumar");
diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c
index f23138b8fca3..f3b5ace815e5 100644
--- a/arch/arm/mach-pxa/balloon3.c
+++ b/arch/arm/mach-pxa/balloon3.c
@@ -132,6 +132,14 @@ static void __init balloon3_init_irq(void)
132 "enabled\n", __func__, BALLOON3_AUX_NIRQ); 132 "enabled\n", __func__, BALLOON3_AUX_NIRQ);
133} 133}
134 134
135static unsigned long balloon3_ac97_pin_config[] = {
136 GPIO28_AC97_BITCLK,
137 GPIO29_AC97_SDATA_IN_0,
138 GPIO30_AC97_SDATA_OUT,
139 GPIO31_AC97_SYNC,
140 GPIO113_AC97_nRESET,
141};
142
135static void balloon3_backlight_power(int on) 143static void balloon3_backlight_power(int on)
136{ 144{
137 pr_debug("%s: power is %s\n", __func__, on ? "on" : "off"); 145 pr_debug("%s: power is %s\n", __func__, on ? "on" : "off");
@@ -140,26 +148,7 @@ static void balloon3_backlight_power(int on)
140 148
141static unsigned long balloon3_lcd_pin_config[] = { 149static unsigned long balloon3_lcd_pin_config[] = {
142 /* LCD - 16bpp Active TFT */ 150 /* LCD - 16bpp Active TFT */
143 GPIO58_LCD_LDD_0, 151 GPIOxx_LCD_TFT_16BPP,
144 GPIO59_LCD_LDD_1,
145 GPIO60_LCD_LDD_2,
146 GPIO61_LCD_LDD_3,
147 GPIO62_LCD_LDD_4,
148 GPIO63_LCD_LDD_5,
149 GPIO64_LCD_LDD_6,
150 GPIO65_LCD_LDD_7,
151 GPIO66_LCD_LDD_8,
152 GPIO67_LCD_LDD_9,
153 GPIO68_LCD_LDD_10,
154 GPIO69_LCD_LDD_11,
155 GPIO70_LCD_LDD_12,
156 GPIO71_LCD_LDD_13,
157 GPIO72_LCD_LDD_14,
158 GPIO73_LCD_LDD_15,
159 GPIO74_LCD_FCLK,
160 GPIO75_LCD_LCLK,
161 GPIO76_LCD_PCLK,
162 GPIO77_LCD_BIAS,
163 152
164 GPIO99_GPIO, /* Backlight */ 153 GPIO99_GPIO, /* Backlight */
165}; 154};
@@ -306,9 +295,15 @@ static void __init balloon3_init(void)
306 */ 295 */
307 ARB_CNTRL = ARB_CORE_PARK | 0x234; 296 ARB_CNTRL = ARB_CORE_PARK | 0x234;
308 297
298 pxa_set_ffuart_info(NULL);
299 pxa_set_btuart_info(NULL);
300 pxa_set_stuart_info(NULL);
301
309 pxa_set_i2c_info(NULL); 302 pxa_set_i2c_info(NULL);
310 if (balloon3_has(BALLOON3_FEATURE_AUDIO)) 303 if (balloon3_has(BALLOON3_FEATURE_AUDIO)) {
304 pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_ac97_pin_config));
311 pxa_set_ac97_info(NULL); 305 pxa_set_ac97_info(NULL);
306 }
312 307
313 if (balloon3_has(BALLOON3_FEATURE_TOPPOLY)) { 308 if (balloon3_has(BALLOON3_FEATURE_TOPPOLY)) {
314 pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_lcd_pin_config)); 309 pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_lcd_pin_config));
diff --git a/arch/arm/mach-pxa/capc7117.c b/arch/arm/mach-pxa/capc7117.c
new file mode 100644
index 000000000000..aae544631a8b
--- /dev/null
+++ b/arch/arm/mach-pxa/capc7117.c
@@ -0,0 +1,158 @@
1/*
2 * linux/arch/arm/mach-pxa/capc7117.c
3 *
4 * Support for the Embedian CAPC-7117 Evaluation Kit
5 * based on the Embedian MXM-8x10 Computer on Module
6 *
7 * Copyright (C) 2009 Embedian Inc.
8 * Copyright (C) 2009 TMT Services & Supplies (Pty) Ltd.
9 *
10 * 2007-09-04: eric miao <eric.y.miao@gmail.com>
11 * rewrite to align with latest kernel
12 *
13 * 2010-01-09: Edwin Peer <epeer@tmtservices.co.za>
14 * Hennie van der Merwe <hvdmerwe@tmtservices.co.za>
15 * rework for upstream merge
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License version 2 as
19 * published by the Free Software Foundation.
20 */
21
22#include <linux/irq.h>
23#include <linux/platform_device.h>
24#include <linux/ata_platform.h>
25#include <linux/serial_8250.h>
26#include <linux/gpio.h>
27
28#include <asm/mach-types.h>
29#include <asm/mach/arch.h>
30
31#include <mach/pxa320.h>
32#include <mach/mxm8x10.h>
33
34#include "generic.h"
35
36/* IDE (PATA) Support */
37static struct pata_platform_info pata_platform_data = {
38 .ioport_shift = 1
39};
40
41static struct resource capc7117_ide_resources[] = {
42 [0] = {
43 .start = 0x11000020,
44 .end = 0x1100003f,
45 .flags = IORESOURCE_MEM
46 },
47 [1] = {
48 .start = 0x1100001c,
49 .end = 0x1100001c,
50 .flags = IORESOURCE_MEM
51 },
52 [2] = {
53 .start = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO76)),
54 .end = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO76)),
55 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING
56 }
57};
58
59static struct platform_device capc7117_ide_device = {
60 .name = "pata_platform",
61 .num_resources = ARRAY_SIZE(capc7117_ide_resources),
62 .resource = capc7117_ide_resources,
63 .dev = {
64 .platform_data = &pata_platform_data,
65 .coherent_dma_mask = ~0 /* grumble */
66 }
67};
68
69static void __init capc7117_ide_init(void)
70{
71 platform_device_register(&capc7117_ide_device);
72}
73
74/* TI16C752 UART support */
75#define TI16C752_FLAGS (UPF_BOOT_AUTOCONF | \
76 UPF_IOREMAP | \
77 UPF_BUGGY_UART | \
78 UPF_SKIP_TEST)
79#define TI16C752_UARTCLK (22118400)
80static struct plat_serial8250_port ti16c752_platform_data[] = {
81 [0] = {
82 .mapbase = 0x14000000,
83 .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO78)),
84 .irqflags = IRQF_TRIGGER_RISING,
85 .flags = TI16C752_FLAGS,
86 .iotype = UPIO_MEM,
87 .regshift = 1,
88 .uartclk = TI16C752_UARTCLK
89 },
90 [1] = {
91 .mapbase = 0x14000040,
92 .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO79)),
93 .irqflags = IRQF_TRIGGER_RISING,
94 .flags = TI16C752_FLAGS,
95 .iotype = UPIO_MEM,
96 .regshift = 1,
97 .uartclk = TI16C752_UARTCLK
98 },
99 [2] = {
100 .mapbase = 0x14000080,
101 .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO80)),
102 .irqflags = IRQF_TRIGGER_RISING,
103 .flags = TI16C752_FLAGS,
104 .iotype = UPIO_MEM,
105 .regshift = 1,
106 .uartclk = TI16C752_UARTCLK
107 },
108 [3] = {
109 .mapbase = 0x140000c0,
110 .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO81)),
111 .irqflags = IRQF_TRIGGER_RISING,
112 .flags = TI16C752_FLAGS,
113 .iotype = UPIO_MEM,
114 .regshift = 1,
115 .uartclk = TI16C752_UARTCLK
116 },
117 [4] = {
118 /* end of array */
119 }
120};
121
122static struct platform_device ti16c752_device = {
123 .name = "serial8250",
124 .id = PLAT8250_DEV_PLATFORM,
125 .dev = {
126 .platform_data = ti16c752_platform_data
127 }
128};
129
130static void __init capc7117_uarts_init(void)
131{
132 platform_device_register(&ti16c752_device);
133}
134
135static void __init capc7117_init(void)
136{
137 /* Init CoM */
138 mxm_8x10_barebones_init();
139
140 /* Init evaluation board peripherals */
141 mxm_8x10_ac97_init();
142 mxm_8x10_usb_host_init();
143 mxm_8x10_mmc_init();
144
145 capc7117_uarts_init();
146 capc7117_ide_init();
147}
148
149MACHINE_START(CAPC7117,
150 "Embedian CAPC-7117 evaluation kit based on the MXM-8x10 CoM")
151 .phys_io = 0x40000000,
152 .boot_params = 0xa0000100,
153 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
154 .map_io = pxa_map_io,
155 .init_irq = pxa3xx_init_irq,
156 .timer = &pxa_timer,
157 .init_machine = capc7117_init
158MACHINE_END
diff --git a/arch/arm/mach-pxa/clock.c b/arch/arm/mach-pxa/clock.c
index 49ae38292310..abba0089a2ae 100644
--- a/arch/arm/mach-pxa/clock.c
+++ b/arch/arm/mach-pxa/clock.c
@@ -78,11 +78,3 @@ const struct clkops clk_cken_ops = {
78 .enable = clk_cken_enable, 78 .enable = clk_cken_enable,
79 .disable = clk_cken_disable, 79 .disable = clk_cken_disable,
80}; 80};
81
82void clks_register(struct clk_lookup *clks, size_t num)
83{
84 int i;
85
86 for (i = 0; i < num; i++)
87 clkdev_add(&clks[i]);
88}
diff --git a/arch/arm/mach-pxa/clock.h b/arch/arm/mach-pxa/clock.h
index 978a3667e90d..d8488742b807 100644
--- a/arch/arm/mach-pxa/clock.h
+++ b/arch/arm/mach-pxa/clock.h
@@ -67,7 +67,3 @@ extern void clk_pxa3xx_cken_enable(struct clk *);
67extern void clk_pxa3xx_cken_disable(struct clk *); 67extern void clk_pxa3xx_cken_disable(struct clk *);
68#endif 68#endif
69 69
70void clks_register(struct clk_lookup *clks, size_t num);
71int clk_add_alias(const char *alias, const char *alias_name, char *id,
72 struct device *dev);
73
diff --git a/arch/arm/mach-pxa/cm-x255.c b/arch/arm/mach-pxa/cm-x255.c
index 253fd76142d6..f1a7703d771b 100644
--- a/arch/arm/mach-pxa/cm-x255.c
+++ b/arch/arm/mach-pxa/cm-x255.c
@@ -50,26 +50,7 @@ static unsigned long cmx255_pin_config[] = {
50 GPIO47_STUART_TXD, 50 GPIO47_STUART_TXD,
51 51
52 /* LCD */ 52 /* LCD */
53 GPIO58_LCD_LDD_0, 53 GPIOxx_LCD_TFT_16BPP,
54 GPIO59_LCD_LDD_1,
55 GPIO60_LCD_LDD_2,
56 GPIO61_LCD_LDD_3,
57 GPIO62_LCD_LDD_4,
58 GPIO63_LCD_LDD_5,
59 GPIO64_LCD_LDD_6,
60 GPIO65_LCD_LDD_7,
61 GPIO66_LCD_LDD_8,
62 GPIO67_LCD_LDD_9,
63 GPIO68_LCD_LDD_10,
64 GPIO69_LCD_LDD_11,
65 GPIO70_LCD_LDD_12,
66 GPIO71_LCD_LDD_13,
67 GPIO72_LCD_LDD_14,
68 GPIO73_LCD_LDD_15,
69 GPIO74_LCD_FCLK,
70 GPIO75_LCD_LCLK,
71 GPIO76_LCD_PCLK,
72 GPIO77_LCD_BIAS,
73 54
74 /* SSP1 */ 55 /* SSP1 */
75 GPIO23_SSP1_SCLK, 56 GPIO23_SSP1_SCLK,
diff --git a/arch/arm/mach-pxa/cm-x270.c b/arch/arm/mach-pxa/cm-x270.c
index eea78b6c2bc5..a9926bb75922 100644
--- a/arch/arm/mach-pxa/cm-x270.c
+++ b/arch/arm/mach-pxa/cm-x270.c
@@ -71,26 +71,7 @@ static unsigned long cmx270_pin_config[] = {
71 GPIO111_MMC_DAT_3, 71 GPIO111_MMC_DAT_3,
72 72
73 /* LCD */ 73 /* LCD */
74 GPIO58_LCD_LDD_0, 74 GPIOxx_LCD_TFT_16BPP,
75 GPIO59_LCD_LDD_1,
76 GPIO60_LCD_LDD_2,
77 GPIO61_LCD_LDD_3,
78 GPIO62_LCD_LDD_4,
79 GPIO63_LCD_LDD_5,
80 GPIO64_LCD_LDD_6,
81 GPIO65_LCD_LDD_7,
82 GPIO66_LCD_LDD_8,
83 GPIO67_LCD_LDD_9,
84 GPIO68_LCD_LDD_10,
85 GPIO69_LCD_LDD_11,
86 GPIO70_LCD_LDD_12,
87 GPIO71_LCD_LDD_13,
88 GPIO72_LCD_LDD_14,
89 GPIO73_LCD_LDD_15,
90 GPIO74_LCD_FCLK,
91 GPIO75_LCD_LCLK,
92 GPIO76_LCD_PCLK,
93 GPIO77_LCD_BIAS,
94 75
95 /* I2C */ 76 /* I2C */
96 GPIO117_I2C_SCL, 77 GPIO117_I2C_SCL,
@@ -195,33 +176,57 @@ static struct resource cmx270_2700G_resource[] = {
195 }, 176 },
196}; 177};
197 178
198static unsigned long save_lcd_regs[10]; 179static unsigned long cmx270_marathon_on[] = {
180 GPIO58_GPIO,
181 GPIO59_GPIO,
182 GPIO60_GPIO,
183 GPIO61_GPIO,
184 GPIO62_GPIO,
185 GPIO63_GPIO,
186 GPIO64_GPIO,
187 GPIO65_GPIO,
188 GPIO66_GPIO,
189 GPIO67_GPIO,
190 GPIO68_GPIO,
191 GPIO69_GPIO,
192 GPIO70_GPIO,
193 GPIO71_GPIO,
194 GPIO72_GPIO,
195 GPIO73_GPIO,
196 GPIO74_GPIO,
197 GPIO75_GPIO,
198 GPIO76_GPIO,
199 GPIO77_GPIO,
200};
201
202static unsigned long cmx270_marathon_off[] = {
203 GPIOxx_LCD_TFT_16BPP,
204};
199 205
200static int cmx270_marathon_probe(struct fb_info *fb) 206static int cmx270_marathon_probe(struct fb_info *fb)
201{ 207{
202 /* save PXA-270 pin settings before enabling 2700G */ 208 int gpio, err;
203 save_lcd_regs[0] = GPDR1; 209
204 save_lcd_regs[1] = GPDR2; 210 for (gpio = 58; gpio <= 77; gpio++) {
205 save_lcd_regs[2] = GAFR1_U; 211 err = gpio_request(gpio, "LCD");
206 save_lcd_regs[3] = GAFR2_L; 212 if (err)
207 save_lcd_regs[4] = GAFR2_U; 213 return err;
208 214 gpio_direction_input(gpio);
209 /* Disable PXA-270 on-chip controller driving pins */ 215 }
210 GPDR1 &= ~(0xfc000000); 216
211 GPDR2 &= ~(0x00c03fff); 217 pxa2xx_mfp_config(ARRAY_AND_SIZE(cmx270_marathon_on));
212 GAFR1_U &= ~(0xfff00000);
213 GAFR2_L &= ~(0x0fffffff);
214 GAFR2_U &= ~(0x0000f000);
215 return 0; 218 return 0;
216} 219}
217 220
218static int cmx270_marathon_remove(struct fb_info *fb) 221static int cmx270_marathon_remove(struct fb_info *fb)
219{ 222{
220 GPDR1 = save_lcd_regs[0]; 223 int gpio;
221 GPDR2 = save_lcd_regs[1]; 224
222 GAFR1_U = save_lcd_regs[2]; 225 pxa2xx_mfp_config(ARRAY_AND_SIZE(cmx270_marathon_off));
223 GAFR2_L = save_lcd_regs[3]; 226
224 GAFR2_U = save_lcd_regs[4]; 227 for (gpio = 58; gpio <= 77; gpio++)
228 gpio_free(gpio);
229
225 return 0; 230 return 0;
226} 231}
227 232
diff --git a/arch/arm/mach-pxa/cm-x2xx-pci.c b/arch/arm/mach-pxa/cm-x2xx-pci.c
index 7873fa3d8fa4..161fc2d61207 100644
--- a/arch/arm/mach-pxa/cm-x2xx-pci.c
+++ b/arch/arm/mach-pxa/cm-x2xx-pci.c
@@ -59,7 +59,7 @@ void __init cmx2xx_pci_adjust_zones(int node, unsigned long *zone_size,
59static void cmx2xx_it8152_irq_demux(unsigned int irq, struct irq_desc *desc) 59static void cmx2xx_it8152_irq_demux(unsigned int irq, struct irq_desc *desc)
60{ 60{
61 /* clear our parent irq */ 61 /* clear our parent irq */
62 GEDR(cmx2xx_it8152_irq_gpio) = GPIO_bit(cmx2xx_it8152_irq_gpio); 62 desc->chip->ack(irq);
63 63
64 it8152_irq_demux(irq, desc); 64 it8152_irq_demux(irq, desc);
65} 65}
diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c
index b50ef39eabfc..bff6e78f033d 100644
--- a/arch/arm/mach-pxa/cm-x2xx.c
+++ b/arch/arm/mach-pxa/cm-x2xx.c
@@ -453,6 +453,10 @@ static inline void cmx2xx_init_ac97(void) {}
453 453
454static void __init cmx2xx_init(void) 454static void __init cmx2xx_init(void)
455{ 455{
456 pxa_set_ffuart_info(NULL);
457 pxa_set_btuart_info(NULL);
458 pxa_set_stuart_info(NULL);
459
456 cmx2xx_pm_init(); 460 cmx2xx_pm_init();
457 461
458 if (cpu_is_pxa25x()) 462 if (cpu_is_pxa25x())
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index 102916f1e465..d37cfa132a65 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -3,9 +3,10 @@
3 * 3 *
4 * Support for the CompuLab CM-X300 modules 4 * Support for the CompuLab CM-X300 modules
5 * 5 *
6 * Copyright (C) 2008 CompuLab Ltd. 6 * Copyright (C) 2008,2009 CompuLab Ltd.
7 * 7 *
8 * Mike Rapoport <mike@compulab.co.il> 8 * Mike Rapoport <mike@compulab.co.il>
9 * Igor Grinberg <grinberg@compulab.co.il>
9 * 10 *
10 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as 12 * it under the terms of the GNU General Public License version 2 as
@@ -16,30 +17,41 @@
16#include <linux/kernel.h> 17#include <linux/kernel.h>
17#include <linux/interrupt.h> 18#include <linux/interrupt.h>
18#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/delay.h>
19#include <linux/platform_device.h> 21#include <linux/platform_device.h>
20 22
21#include <linux/gpio.h> 23#include <linux/gpio.h>
22#include <linux/dm9000.h> 24#include <linux/dm9000.h>
23#include <linux/leds.h> 25#include <linux/leds.h>
24#include <linux/rtc-v3020.h> 26#include <linux/rtc-v3020.h>
27#include <linux/pwm_backlight.h>
25 28
26#include <linux/i2c.h> 29#include <linux/i2c.h>
27#include <linux/i2c/pca953x.h> 30#include <linux/i2c/pca953x.h>
28 31
32#include <linux/mfd/da903x.h>
33
34#include <linux/spi/spi.h>
35#include <linux/spi/spi_gpio.h>
36#include <linux/spi/tdo24m.h>
37
29#include <asm/mach-types.h> 38#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
31#include <asm/setup.h> 40#include <asm/setup.h>
32 41
33#include <mach/pxa300.h> 42#include <mach/pxa300.h>
43#include <mach/pxa27x-udc.h>
34#include <mach/pxafb.h> 44#include <mach/pxafb.h>
35#include <mach/mmc.h> 45#include <mach/mmc.h>
36#include <mach/ohci.h> 46#include <mach/ohci.h>
37#include <plat/i2c.h> 47#include <plat/i2c.h>
38#include <mach/pxa3xx_nand.h> 48#include <plat/pxa3xx_nand.h>
49#include <mach/audio.h>
39 50
40#include <asm/mach/map.h> 51#include <asm/mach/map.h>
41 52
42#include "generic.h" 53#include "generic.h"
54#include "devices.h"
43 55
44#define CM_X300_ETH_PHYS 0x08000010 56#define CM_X300_ETH_PHYS 0x08000010
45 57
@@ -53,7 +65,7 @@
53#define GPIO97_RTC_RD (97) 65#define GPIO97_RTC_RD (97)
54#define GPIO98_RTC_IO (98) 66#define GPIO98_RTC_IO (98)
55 67
56static mfp_cfg_t cm_x300_mfp_cfg[] __initdata = { 68static mfp_cfg_t cm_x3xx_mfp_cfg[] __initdata = {
57 /* LCD */ 69 /* LCD */
58 GPIO54_LCD_LDD_0, 70 GPIO54_LCD_LDD_0,
59 GPIO55_LCD_LDD_1, 71 GPIO55_LCD_LDD_1,
@@ -137,7 +149,6 @@ static mfp_cfg_t cm_x300_mfp_cfg[] __initdata = {
137 GPIO36_UART1_DTR, 149 GPIO36_UART1_DTR,
138 150
139 /* GPIOs */ 151 /* GPIOs */
140 GPIO79_GPIO, /* LED */
141 GPIO82_GPIO | MFP_PULL_HIGH, /* MMC CD */ 152 GPIO82_GPIO | MFP_PULL_HIGH, /* MMC CD */
142 GPIO85_GPIO, /* MMC WP */ 153 GPIO85_GPIO, /* MMC WP */
143 GPIO99_GPIO, /* Ethernet IRQ */ 154 GPIO99_GPIO, /* Ethernet IRQ */
@@ -151,6 +162,50 @@ static mfp_cfg_t cm_x300_mfp_cfg[] __initdata = {
151 /* Standard I2C */ 162 /* Standard I2C */
152 GPIO21_I2C_SCL, 163 GPIO21_I2C_SCL,
153 GPIO22_I2C_SDA, 164 GPIO22_I2C_SDA,
165
166 /* PWM Backlight */
167 GPIO19_PWM2_OUT,
168};
169
170static mfp_cfg_t cm_x3xx_rev_lt130_mfp_cfg[] __initdata = {
171 /* GPIOs */
172 GPIO79_GPIO, /* LED */
173 GPIO77_GPIO, /* WiFi reset */
174 GPIO78_GPIO, /* BT reset */
175};
176
177static mfp_cfg_t cm_x3xx_rev_ge130_mfp_cfg[] __initdata = {
178 /* GPIOs */
179 GPIO76_GPIO, /* LED */
180 GPIO71_GPIO, /* WiFi reset */
181 GPIO70_GPIO, /* BT reset */
182};
183
184static mfp_cfg_t cm_x310_mfp_cfg[] __initdata = {
185 /* USB PORT 2 */
186 ULPI_STP,
187 ULPI_NXT,
188 ULPI_DIR,
189 GPIO30_ULPI_DATA_OUT_0,
190 GPIO31_ULPI_DATA_OUT_1,
191 GPIO32_ULPI_DATA_OUT_2,
192 GPIO33_ULPI_DATA_OUT_3,
193 GPIO34_ULPI_DATA_OUT_4,
194 GPIO35_ULPI_DATA_OUT_5,
195 GPIO36_ULPI_DATA_OUT_6,
196 GPIO37_ULPI_DATA_OUT_7,
197 GPIO38_ULPI_CLK,
198 /* external PHY reset pin */
199 GPIO127_GPIO,
200
201 /* USB PORT 3 */
202 GPIO77_USB_P3_1,
203 GPIO78_USB_P3_2,
204 GPIO79_USB_P3_3,
205 GPIO80_USB_P3_4,
206 GPIO81_USB_P3_5,
207 GPIO82_USB_P3_6,
208 GPIO0_2_USBH_PEN,
154}; 209};
155 210
156#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) 211#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
@@ -195,17 +250,18 @@ static void __init cm_x300_init_dm9000(void)
195static inline void cm_x300_init_dm9000(void) {} 250static inline void cm_x300_init_dm9000(void) {}
196#endif 251#endif
197 252
253/* LCD */
198#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) 254#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
199static struct pxafb_mode_info cm_x300_lcd_modes[] = { 255static struct pxafb_mode_info cm_x300_lcd_modes[] = {
200 [0] = { 256 [0] = {
201 .pixclock = 38000, 257 .pixclock = 38250,
202 .bpp = 16, 258 .bpp = 16,
203 .xres = 480, 259 .xres = 480,
204 .yres = 640, 260 .yres = 640,
205 .hsync_len = 8, 261 .hsync_len = 8,
206 .vsync_len = 2, 262 .vsync_len = 2,
207 .left_margin = 8, 263 .left_margin = 8,
208 .upper_margin = 0, 264 .upper_margin = 2,
209 .right_margin = 24, 265 .right_margin = 24,
210 .lower_margin = 4, 266 .lower_margin = 4,
211 .cmap_greyscale = 0, 267 .cmap_greyscale = 0,
@@ -227,7 +283,7 @@ static struct pxafb_mode_info cm_x300_lcd_modes[] = {
227 283
228static struct pxafb_mach_info cm_x300_lcd = { 284static struct pxafb_mach_info cm_x300_lcd = {
229 .modes = cm_x300_lcd_modes, 285 .modes = cm_x300_lcd_modes,
230 .num_modes = 2, 286 .num_modes = ARRAY_SIZE(cm_x300_lcd_modes),
231 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, 287 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
232}; 288};
233 289
@@ -239,6 +295,87 @@ static void __init cm_x300_init_lcd(void)
239static inline void cm_x300_init_lcd(void) {} 295static inline void cm_x300_init_lcd(void) {}
240#endif 296#endif
241 297
298#if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE)
299static struct platform_pwm_backlight_data cm_x300_backlight_data = {
300 .pwm_id = 2,
301 .max_brightness = 100,
302 .dft_brightness = 100,
303 .pwm_period_ns = 10000,
304};
305
306static struct platform_device cm_x300_backlight_device = {
307 .name = "pwm-backlight",
308 .dev = {
309 .parent = &pxa27x_device_pwm0.dev,
310 .platform_data = &cm_x300_backlight_data,
311 },
312};
313
314static void cm_x300_init_bl(void)
315{
316 platform_device_register(&cm_x300_backlight_device);
317}
318#else
319static inline void cm_x300_init_bl(void) {}
320#endif
321
322#if defined(CONFIG_SPI_GPIO) || defined(CONFIG_SPI_GPIO_MODULE)
323#define GPIO_LCD_BASE (144)
324#define GPIO_LCD_DIN (GPIO_LCD_BASE + 8) /* aux_gpio3_0 */
325#define GPIO_LCD_DOUT (GPIO_LCD_BASE + 9) /* aux_gpio3_1 */
326#define GPIO_LCD_SCL (GPIO_LCD_BASE + 10) /* aux_gpio3_2 */
327#define GPIO_LCD_CS (GPIO_LCD_BASE + 11) /* aux_gpio3_3 */
328#define LCD_SPI_BUS_NUM (1)
329
330static struct spi_gpio_platform_data cm_x300_spi_gpio_pdata = {
331 .sck = GPIO_LCD_SCL,
332 .mosi = GPIO_LCD_DIN,
333 .miso = GPIO_LCD_DOUT,
334 .num_chipselect = 1,
335};
336
337static struct platform_device cm_x300_spi_gpio = {
338 .name = "spi_gpio",
339 .id = LCD_SPI_BUS_NUM,
340 .dev = {
341 .platform_data = &cm_x300_spi_gpio_pdata,
342 },
343};
344
345static struct tdo24m_platform_data cm_x300_tdo24m_pdata = {
346 .model = TDO35S,
347};
348
349static struct spi_board_info cm_x300_spi_devices[] __initdata = {
350 {
351 .modalias = "tdo24m",
352 .max_speed_hz = 1000000,
353 .bus_num = LCD_SPI_BUS_NUM,
354 .chip_select = 0,
355 .controller_data = (void *) GPIO_LCD_CS,
356 .platform_data = &cm_x300_tdo24m_pdata,
357 },
358};
359
360static void __init cm_x300_init_spi(void)
361{
362 spi_register_board_info(cm_x300_spi_devices,
363 ARRAY_SIZE(cm_x300_spi_devices));
364 platform_device_register(&cm_x300_spi_gpio);
365}
366#else
367static inline void cm_x300_init_spi(void) {}
368#endif
369
370#if defined(CONFIG_SND_PXA2XX_LIB_AC97)
371static void __init cm_x300_init_ac97(void)
372{
373 pxa_set_ac97_info(NULL);
374}
375#else
376static inline void cm_x300_init_ac97(void) {}
377#endif
378
242#if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE) 379#if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE)
243static struct mtd_partition cm_x300_nand_partitions[] = { 380static struct mtd_partition cm_x300_nand_partitions[] = {
244 [0] = { 381 [0] = {
@@ -333,9 +470,19 @@ static inline void cm_x300_init_mmc(void) {}
333#endif 470#endif
334 471
335#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) 472#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
473static int cm_x300_ohci_init(struct device *dev)
474{
475 if (cpu_is_pxa300())
476 UP2OCR = UP2OCR_HXS
477 | UP2OCR_HXOE | UP2OCR_DMPDE | UP2OCR_DPPDE;
478
479 return 0;
480}
481
336static struct pxaohci_platform_data cm_x300_ohci_platform_data = { 482static struct pxaohci_platform_data cm_x300_ohci_platform_data = {
337 .port_mode = PMM_PERPORT_MODE, 483 .port_mode = PMM_PERPORT_MODE,
338 .flags = ENABLE_PORT1 | ENABLE_PORT2 | POWER_CONTROL_LOW, 484 .flags = ENABLE_PORT_ALL | POWER_CONTROL_LOW,
485 .init = cm_x300_ohci_init,
339}; 486};
340 487
341static void __init cm_x300_init_ohci(void) 488static void __init cm_x300_init_ohci(void)
@@ -351,7 +498,6 @@ static struct gpio_led cm_x300_leds[] = {
351 [0] = { 498 [0] = {
352 .name = "cm-x300:green", 499 .name = "cm-x300:green",
353 .default_trigger = "heartbeat", 500 .default_trigger = "heartbeat",
354 .gpio = 79,
355 .active_low = 1, 501 .active_low = 1,
356 }, 502 },
357}; 503};
@@ -371,6 +517,11 @@ static struct platform_device cm_x300_led_device = {
371 517
372static void __init cm_x300_init_leds(void) 518static void __init cm_x300_init_leds(void)
373{ 519{
520 if (system_rev < 130)
521 cm_x300_leds[0].gpio = 79;
522 else
523 cm_x300_leds[0].gpio = 76;
524
374 platform_device_register(&cm_x300_led_device); 525 platform_device_register(&cm_x300_led_device);
375} 526}
376#else 527#else
@@ -433,11 +584,94 @@ static void __init cm_x300_init_rtc(void)
433static inline void cm_x300_init_rtc(void) {} 584static inline void cm_x300_init_rtc(void) {}
434#endif 585#endif
435 586
436static void __init cm_x300_init(void) 587/* DA9030 */
588struct da903x_subdev_info cm_x300_da9030_subdevs[] = {
589 {
590 .name = "da903x-backlight",
591 .id = DA9030_ID_WLED,
592 }
593};
594
595static struct da903x_platform_data cm_x300_da9030_info = {
596 .num_subdevs = ARRAY_SIZE(cm_x300_da9030_subdevs),
597 .subdevs = cm_x300_da9030_subdevs,
598};
599
600static struct i2c_board_info cm_x300_pmic_info = {
601 I2C_BOARD_INFO("da9030", 0x49),
602 .irq = IRQ_GPIO(0),
603 .platform_data = &cm_x300_da9030_info,
604};
605
606static struct i2c_pxa_platform_data cm_x300_pwr_i2c_info = {
607 .use_pio = 1,
608};
609
610static void __init cm_x300_init_da9030(void)
611{
612 pxa3xx_set_i2c_power_info(&cm_x300_pwr_i2c_info);
613 i2c_register_board_info(1, &cm_x300_pmic_info, 1);
614}
615
616static void __init cm_x300_init_wi2wi(void)
617{
618 int bt_reset, wlan_en;
619 int err;
620
621 if (system_rev < 130) {
622 wlan_en = 77;
623 bt_reset = 78;
624 } else {
625 wlan_en = 71;
626 bt_reset = 70;
627 }
628
629 /* Libertas and CSR reset */
630 err = gpio_request(wlan_en, "wlan en");
631 if (err) {
632 pr_err("CM-X300: failed to request wlan en gpio: %d\n", err);
633 } else {
634 gpio_direction_output(wlan_en, 1);
635 gpio_free(wlan_en);
636 }
637
638 err = gpio_request(bt_reset, "bt reset");
639 if (err) {
640 pr_err("CM-X300: failed to request bt reset gpio: %d\n", err);
641 } else {
642 gpio_direction_output(bt_reset, 1);
643 udelay(10);
644 gpio_set_value(bt_reset, 0);
645 udelay(10);
646 gpio_set_value(bt_reset, 1);
647 gpio_free(bt_reset);
648 }
649}
650
651/* MFP */
652static void __init cm_x300_init_mfp(void)
437{ 653{
438 /* board-processor specific GPIO initialization */ 654 /* board-processor specific GPIO initialization */
439 pxa3xx_mfp_config(ARRAY_AND_SIZE(cm_x300_mfp_cfg)); 655 pxa3xx_mfp_config(ARRAY_AND_SIZE(cm_x3xx_mfp_cfg));
656
657 if (system_rev < 130)
658 pxa3xx_mfp_config(ARRAY_AND_SIZE(cm_x3xx_rev_lt130_mfp_cfg));
659 else
660 pxa3xx_mfp_config(ARRAY_AND_SIZE(cm_x3xx_rev_ge130_mfp_cfg));
661
662 if (cpu_is_pxa310())
663 pxa3xx_mfp_config(ARRAY_AND_SIZE(cm_x310_mfp_cfg));
664}
665
666static void __init cm_x300_init(void)
667{
668 cm_x300_init_mfp();
669
670 pxa_set_ffuart_info(NULL);
671 pxa_set_btuart_info(NULL);
672 pxa_set_stuart_info(NULL);
440 673
674 cm_x300_init_da9030();
441 cm_x300_init_dm9000(); 675 cm_x300_init_dm9000();
442 cm_x300_init_lcd(); 676 cm_x300_init_lcd();
443 cm_x300_init_ohci(); 677 cm_x300_init_ohci();
@@ -445,7 +679,11 @@ static void __init cm_x300_init(void)
445 cm_x300_init_nand(); 679 cm_x300_init_nand();
446 cm_x300_init_leds(); 680 cm_x300_init_leds();
447 cm_x300_init_i2c(); 681 cm_x300_init_i2c();
682 cm_x300_init_spi();
448 cm_x300_init_rtc(); 683 cm_x300_init_rtc();
684 cm_x300_init_ac97();
685 cm_x300_init_wi2wi();
686 cm_x300_init_bl();
449} 687}
450 688
451static void __init cm_x300_fixup(struct machine_desc *mdesc, struct tag *tags, 689static void __init cm_x300_fixup(struct machine_desc *mdesc, struct tag *tags,
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
index 01bcfaae75bc..061c45316de8 100644
--- a/arch/arm/mach-pxa/colibri-pxa270.c
+++ b/arch/arm/mach-pxa/colibri-pxa270.c
@@ -130,6 +130,9 @@ static struct platform_device *colibri_pxa270_devices[] __initdata = {
130static void __init colibri_pxa270_init(void) 130static void __init colibri_pxa270_init(void)
131{ 131{
132 pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_pin_config)); 132 pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_pin_config));
133 pxa_set_ffuart_info(NULL);
134 pxa_set_btuart_info(NULL);
135 pxa_set_stuart_info(NULL);
133 platform_add_devices(ARRAY_AND_SIZE(colibri_pxa270_devices)); 136 platform_add_devices(ARRAY_AND_SIZE(colibri_pxa270_devices));
134} 137}
135 138
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c
index 37c239c56568..45c23fd6df31 100644
--- a/arch/arm/mach-pxa/colibri-pxa300.c
+++ b/arch/arm/mach-pxa/colibri-pxa300.c
@@ -170,6 +170,10 @@ static inline void colibri_pxa310_init_ac97(void) {}
170 170
171void __init colibri_pxa300_init(void) 171void __init colibri_pxa300_init(void)
172{ 172{
173 pxa_set_ffuart_info(NULL);
174 pxa_set_btuart_info(NULL);
175 pxa_set_stuart_info(NULL);
176
173 colibri_pxa300_init_eth(); 177 colibri_pxa300_init_eth();
174 colibri_pxa300_init_ohci(); 178 colibri_pxa300_init_ohci();
175 colibri_pxa3xx_init_nand(); 179 colibri_pxa3xx_init_nand();
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c
index ec0e14b96682..ae835fad7d10 100644
--- a/arch/arm/mach-pxa/colibri-pxa320.c
+++ b/arch/arm/mach-pxa/colibri-pxa320.c
@@ -199,6 +199,10 @@ static void __init colibri_pxa320_init_uart(void)
199 199
200void __init colibri_pxa320_init(void) 200void __init colibri_pxa320_init(void)
201{ 201{
202 pxa_set_ffuart_info(NULL);
203 pxa_set_btuart_info(NULL);
204 pxa_set_stuart_info(NULL);
205
202 colibri_pxa320_init_eth(); 206 colibri_pxa320_init_eth();
203 colibri_pxa320_init_ohci(); 207 colibri_pxa320_init_ohci();
204 colibri_pxa3xx_init_nand(); 208 colibri_pxa3xx_init_nand();
diff --git a/arch/arm/mach-pxa/colibri-pxa3xx.c b/arch/arm/mach-pxa/colibri-pxa3xx.c
index efebaf4d734d..e6c0a2287eb8 100644
--- a/arch/arm/mach-pxa/colibri-pxa3xx.c
+++ b/arch/arm/mach-pxa/colibri-pxa3xx.c
@@ -25,7 +25,7 @@
25#include <mach/colibri.h> 25#include <mach/colibri.h>
26#include <mach/mmc.h> 26#include <mach/mmc.h>
27#include <mach/pxafb.h> 27#include <mach/pxafb.h>
28#include <mach/pxa3xx_nand.h> 28#include <plat/pxa3xx_nand.h>
29 29
30#include "generic.h" 30#include "generic.h"
31#include "devices.h" 31#include "devices.h"
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index b536b5a5a10d..da3156d8690b 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -457,6 +457,7 @@ static struct pxaficp_platform_data corgi_ficp_platform_data = {
457 * USB Device Controller 457 * USB Device Controller
458 */ 458 */
459static struct pxa2xx_udc_mach_info udc_info __initdata = { 459static struct pxa2xx_udc_mach_info udc_info __initdata = {
460 .gpio_vbus = -1,
460 /* no connect GPIO; corgi can't tell connection status */ 461 /* no connect GPIO; corgi can't tell connection status */
461 .gpio_pullup = CORGI_GPIO_USB_PULLUP, 462 .gpio_pullup = CORGI_GPIO_USB_PULLUP,
462}; 463};
@@ -671,6 +672,10 @@ static void __init corgi_init(void)
671 672
672 pxa2xx_mfp_config(ARRAY_AND_SIZE(corgi_pin_config)); 673 pxa2xx_mfp_config(ARRAY_AND_SIZE(corgi_pin_config));
673 674
675 pxa_set_ffuart_info(NULL);
676 pxa_set_btuart_info(NULL);
677 pxa_set_stuart_info(NULL);
678
674 corgi_init_spi(); 679 corgi_init_spi();
675 680
676 pxa_set_udc_info(&udc_info); 681 pxa_set_udc_info(&udc_info);
diff --git a/arch/arm/mach-pxa/corgi_pm.c b/arch/arm/mach-pxa/corgi_pm.c
index a093282fe4db..d4a0733e905b 100644
--- a/arch/arm/mach-pxa/corgi_pm.c
+++ b/arch/arm/mach-pxa/corgi_pm.c
@@ -214,8 +214,8 @@ static struct sharpsl_charger_machinfo corgi_pm_machinfo = {
214 .fatal_acin_volt = SHARPSL_FATAL_ACIN_VOLT, 214 .fatal_acin_volt = SHARPSL_FATAL_ACIN_VOLT,
215 .fatal_noacin_volt= SHARPSL_FATAL_NOACIN_VOLT, 215 .fatal_noacin_volt= SHARPSL_FATAL_NOACIN_VOLT,
216 .bat_levels = 40, 216 .bat_levels = 40,
217 .bat_levels_noac = spitz_battery_levels_noac, 217 .bat_levels_noac = sharpsl_battery_levels_noac,
218 .bat_levels_acin = spitz_battery_levels_acin, 218 .bat_levels_acin = sharpsl_battery_levels_acin,
219 .status_high_acin = 188, 219 .status_high_acin = 188,
220 .status_low_acin = 178, 220 .status_low_acin = 178,
221 .status_high_noac = 185, 221 .status_high_noac = 185,
diff --git a/arch/arm/mach-pxa/corgi_ssp.c b/arch/arm/mach-pxa/corgi_ssp.c
index a5ee70735e04..9347254f8bcf 100644
--- a/arch/arm/mach-pxa/corgi_ssp.c
+++ b/arch/arm/mach-pxa/corgi_ssp.c
@@ -13,7 +13,6 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/sched.h> 15#include <linux/sched.h>
16#include <linux/slab.h>
17#include <linux/delay.h> 16#include <linux/delay.h>
18#include <linux/platform_device.h> 17#include <linux/platform_device.h>
19#include <mach/hardware.h> 18#include <mach/hardware.h>
@@ -204,7 +203,7 @@ void __init corgi_ssp_set_machinfo(struct corgissp_machinfo *machinfo)
204 ssp_machinfo = machinfo; 203 ssp_machinfo = machinfo;
205} 204}
206 205
207static int __init corgi_ssp_probe(struct platform_device *dev) 206static int __devinit corgi_ssp_probe(struct platform_device *dev)
208{ 207{
209 int ret; 208 int ret;
210 209
diff --git a/arch/arm/mach-pxa/cpufreq-pxa3xx.c b/arch/arm/mach-pxa/cpufreq-pxa3xx.c
index 149cdd9aee4d..27fa329d9a8b 100644
--- a/arch/arm/mach-pxa/cpufreq-pxa3xx.c
+++ b/arch/arm/mach-pxa/cpufreq-pxa3xx.c
@@ -14,6 +14,7 @@
14#include <linux/sched.h> 14#include <linux/sched.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/cpufreq.h> 16#include <linux/cpufreq.h>
17#include <linux/slab.h>
17 18
18#include <mach/pxa3xx-regs.h> 19#include <mach/pxa3xx-regs.h>
19 20
diff --git a/arch/arm/mach-pxa/csb726.c b/arch/arm/mach-pxa/csb726.c
index 965480eb4fe6..88575b87bd33 100644
--- a/arch/arm/mach-pxa/csb726.c
+++ b/arch/arm/mach-pxa/csb726.c
@@ -268,6 +268,9 @@ static void __init csb726_init(void)
268/* MSC2 = 0x06697ff4; *//* none/SM501 */ 268/* MSC2 = 0x06697ff4; *//* none/SM501 */
269 MSC2 = (MSC2 & ~0xffff) | 0x7ff4; /* SM501 */ 269 MSC2 = (MSC2 & ~0xffff) | 0x7ff4; /* SM501 */
270 270
271 pxa_set_ffuart_info(NULL);
272 pxa_set_btuart_info(NULL);
273 pxa_set_stuart_info(NULL);
271 pxa_set_i2c_info(NULL); 274 pxa_set_i2c_info(NULL);
272 pxa27x_set_i2c_power_info(NULL); 275 pxa27x_set_i2c_power_info(NULL);
273 pxa_set_mci_info(&csb726_mci); 276 pxa_set_mci_info(&csb726_mci);
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
index 46fabe1cca11..8e10db148f1b 100644
--- a/arch/arm/mach-pxa/devices.c
+++ b/arch/arm/mach-pxa/devices.c
@@ -8,13 +8,14 @@
8#include <mach/pxafb.h> 8#include <mach/pxafb.h>
9#include <mach/mmc.h> 9#include <mach/mmc.h>
10#include <mach/irda.h> 10#include <mach/irda.h>
11#include <plat/i2c.h>
12#include <mach/ohci.h> 11#include <mach/ohci.h>
13#include <mach/pxa27x_keypad.h> 12#include <mach/pxa27x_keypad.h>
14#include <mach/pxa2xx_spi.h> 13#include <mach/pxa2xx_spi.h>
15#include <mach/camera.h> 14#include <mach/camera.h>
16#include <mach/audio.h> 15#include <mach/audio.h>
17#include <mach/pxa3xx_nand.h> 16#include <mach/hardware.h>
17#include <plat/i2c.h>
18#include <plat/pxa3xx_nand.h>
18 19
19#include "devices.h" 20#include "devices.h"
20#include "generic.h" 21#include "generic.h"
@@ -167,13 +168,18 @@ static struct resource pxa_resource_ffuart[] = {
167 } 168 }
168}; 169};
169 170
170struct platform_device pxa_device_ffuart= { 171struct platform_device pxa_device_ffuart = {
171 .name = "pxa2xx-uart", 172 .name = "pxa2xx-uart",
172 .id = 0, 173 .id = 0,
173 .resource = pxa_resource_ffuart, 174 .resource = pxa_resource_ffuart,
174 .num_resources = ARRAY_SIZE(pxa_resource_ffuart), 175 .num_resources = ARRAY_SIZE(pxa_resource_ffuart),
175}; 176};
176 177
178void __init pxa_set_ffuart_info(void *info)
179{
180 pxa_register_device(&pxa_device_ffuart, info);
181}
182
177static struct resource pxa_resource_btuart[] = { 183static struct resource pxa_resource_btuart[] = {
178 { 184 {
179 .start = 0x40200000, 185 .start = 0x40200000,
@@ -193,6 +199,11 @@ struct platform_device pxa_device_btuart = {
193 .num_resources = ARRAY_SIZE(pxa_resource_btuart), 199 .num_resources = ARRAY_SIZE(pxa_resource_btuart),
194}; 200};
195 201
202void __init pxa_set_btuart_info(void *info)
203{
204 pxa_register_device(&pxa_device_btuart, info);
205}
206
196static struct resource pxa_resource_stuart[] = { 207static struct resource pxa_resource_stuart[] = {
197 { 208 {
198 .start = 0x40700000, 209 .start = 0x40700000,
@@ -212,6 +223,11 @@ struct platform_device pxa_device_stuart = {
212 .num_resources = ARRAY_SIZE(pxa_resource_stuart), 223 .num_resources = ARRAY_SIZE(pxa_resource_stuart),
213}; 224};
214 225
226void __init pxa_set_stuart_info(void *info)
227{
228 pxa_register_device(&pxa_device_stuart, info);
229}
230
215static struct resource pxa_resource_hwuart[] = { 231static struct resource pxa_resource_hwuart[] = {
216 { 232 {
217 .start = 0x41600000, 233 .start = 0x41600000,
@@ -231,6 +247,14 @@ struct platform_device pxa_device_hwuart = {
231 .num_resources = ARRAY_SIZE(pxa_resource_hwuart), 247 .num_resources = ARRAY_SIZE(pxa_resource_hwuart),
232}; 248};
233 249
250void __init pxa_set_hwuart_info(void *info)
251{
252 if (cpu_is_pxa255())
253 pxa_register_device(&pxa_device_hwuart, info);
254 else
255 pr_info("UART: Ignoring attempt to register HWUART on non-PXA255 hardware");
256}
257
234static struct resource pxai2c_resources[] = { 258static struct resource pxai2c_resources[] = {
235 { 259 {
236 .start = 0x40301680, 260 .start = 0x40301680,
diff --git a/arch/arm/mach-pxa/e330.c b/arch/arm/mach-pxa/e330.c
index 74d3f8987c5c..8fde3387279d 100644
--- a/arch/arm/mach-pxa/e330.c
+++ b/arch/arm/mach-pxa/e330.c
@@ -55,6 +55,9 @@ static struct platform_device *devices[] __initdata = {
55 55
56static void __init e330_init(void) 56static void __init e330_init(void)
57{ 57{
58 pxa_set_ffuart_info(NULL);
59 pxa_set_btuart_info(NULL);
60 pxa_set_stuart_info(NULL);
58 eseries_register_clks(); 61 eseries_register_clks();
59 eseries_get_tmio_gpios(); 62 eseries_get_tmio_gpios();
60 platform_add_devices(devices, ARRAY_SIZE(devices)); 63 platform_add_devices(devices, ARRAY_SIZE(devices));
diff --git a/arch/arm/mach-pxa/e350.c b/arch/arm/mach-pxa/e350.c
index 080036272131..f50f055f5720 100644
--- a/arch/arm/mach-pxa/e350.c
+++ b/arch/arm/mach-pxa/e350.c
@@ -56,6 +56,9 @@ static struct platform_device *devices[] __initdata = {
56 56
57static void __init e350_init(void) 57static void __init e350_init(void)
58{ 58{
59 pxa_set_ffuart_info(NULL);
60 pxa_set_btuart_info(NULL);
61 pxa_set_stuart_info(NULL);
59 eseries_register_clks(); 62 eseries_register_clks();
60 eseries_get_tmio_gpios(); 63 eseries_get_tmio_gpios();
61 platform_add_devices(devices, ARRAY_SIZE(devices)); 64 platform_add_devices(devices, ARRAY_SIZE(devices));
diff --git a/arch/arm/mach-pxa/e400.c b/arch/arm/mach-pxa/e400.c
index ed9c0c3f64a2..55b950f12844 100644
--- a/arch/arm/mach-pxa/e400.c
+++ b/arch/arm/mach-pxa/e400.c
@@ -130,6 +130,9 @@ static struct platform_device *devices[] __initdata = {
130static void __init e400_init(void) 130static void __init e400_init(void)
131{ 131{
132 pxa2xx_mfp_config(ARRAY_AND_SIZE(e400_pin_config)); 132 pxa2xx_mfp_config(ARRAY_AND_SIZE(e400_pin_config));
133 pxa_set_ffuart_info(NULL);
134 pxa_set_btuart_info(NULL);
135 pxa_set_stuart_info(NULL);
133 /* Fixme - e400 may have a switched clock */ 136 /* Fixme - e400 may have a switched clock */
134 eseries_register_clks(); 137 eseries_register_clks();
135 eseries_get_tmio_gpios(); 138 eseries_get_tmio_gpios();
diff --git a/arch/arm/mach-pxa/e740.c b/arch/arm/mach-pxa/e740.c
index 49acdfa6650d..d578021d1a10 100644
--- a/arch/arm/mach-pxa/e740.c
+++ b/arch/arm/mach-pxa/e740.c
@@ -134,6 +134,12 @@ static unsigned long e740_pin_config[] __initdata = {
134 /* IrDA */ 134 /* IrDA */
135 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH, 135 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
136 136
137 /* AC97 */
138 GPIO28_AC97_BITCLK,
139 GPIO29_AC97_SDATA_IN_0,
140 GPIO30_AC97_SDATA_OUT,
141 GPIO31_AC97_SYNC,
142
137 /* Audio power control */ 143 /* Audio power control */
138 GPIO16_GPIO, /* AC97 codec AVDD2 supply (analogue power) */ 144 GPIO16_GPIO, /* AC97 codec AVDD2 supply (analogue power) */
139 GPIO40_GPIO, /* Mic amp power */ 145 GPIO40_GPIO, /* Mic amp power */
@@ -192,6 +198,9 @@ static struct platform_device *devices[] __initdata = {
192static void __init e740_init(void) 198static void __init e740_init(void)
193{ 199{
194 pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config)); 200 pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config));
201 pxa_set_ffuart_info(NULL);
202 pxa_set_btuart_info(NULL);
203 pxa_set_stuart_info(NULL);
195 eseries_register_clks(); 204 eseries_register_clks();
196 clk_add_alias("CLK_CK48M", e740_t7l66xb_device.name, 205 clk_add_alias("CLK_CK48M", e740_t7l66xb_device.name,
197 "UDCCLK", &pxa25x_device_udc.dev), 206 "UDCCLK", &pxa25x_device_udc.dev),
diff --git a/arch/arm/mach-pxa/e750.c b/arch/arm/mach-pxa/e750.c
index 4052ece3ef49..af83caa52dd4 100644
--- a/arch/arm/mach-pxa/e750.c
+++ b/arch/arm/mach-pxa/e750.c
@@ -132,6 +132,12 @@ static unsigned long e750_pin_config[] __initdata = {
132 /* IrDA */ 132 /* IrDA */
133 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH, 133 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
134 134
135 /* AC97 */
136 GPIO28_AC97_BITCLK,
137 GPIO29_AC97_SDATA_IN_0,
138 GPIO30_AC97_SDATA_OUT,
139 GPIO31_AC97_SYNC,
140
135 /* Audio power control */ 141 /* Audio power control */
136 GPIO4_GPIO, /* Headphone amp power */ 142 GPIO4_GPIO, /* Headphone amp power */
137 GPIO7_GPIO, /* Speaker amp power */ 143 GPIO7_GPIO, /* Speaker amp power */
@@ -194,6 +200,9 @@ static struct platform_device *devices[] __initdata = {
194static void __init e750_init(void) 200static void __init e750_init(void)
195{ 201{
196 pxa2xx_mfp_config(ARRAY_AND_SIZE(e750_pin_config)); 202 pxa2xx_mfp_config(ARRAY_AND_SIZE(e750_pin_config));
203 pxa_set_ffuart_info(NULL);
204 pxa_set_btuart_info(NULL);
205 pxa_set_stuart_info(NULL);
197 clk_add_alias("CLK_CK3P6MI", e750_tc6393xb_device.name, 206 clk_add_alias("CLK_CK3P6MI", e750_tc6393xb_device.name,
198 "GPIO11_CLK", NULL), 207 "GPIO11_CLK", NULL),
199 eseries_get_tmio_gpios(); 208 eseries_get_tmio_gpios();
diff --git a/arch/arm/mach-pxa/e800.c b/arch/arm/mach-pxa/e800.c
index 9866c7b9e784..8ea97bf53fe1 100644
--- a/arch/arm/mach-pxa/e800.c
+++ b/arch/arm/mach-pxa/e800.c
@@ -35,6 +35,14 @@
35 35
36/* ------------------------ e800 LCD definitions ------------------------- */ 36/* ------------------------ e800 LCD definitions ------------------------- */
37 37
38static unsigned long e800_pin_config[] __initdata = {
39 /* AC97 */
40 GPIO28_AC97_BITCLK,
41 GPIO29_AC97_SDATA_IN_0,
42 GPIO30_AC97_SDATA_OUT,
43 GPIO31_AC97_SYNC,
44};
45
38static struct w100_gen_regs e800_lcd_regs = { 46static struct w100_gen_regs e800_lcd_regs = {
39 .lcd_format = 0x00008003, 47 .lcd_format = 0x00008003,
40 .lcdd_cntl1 = 0x02a00000, 48 .lcdd_cntl1 = 0x02a00000,
@@ -195,6 +203,10 @@ static struct platform_device *devices[] __initdata = {
195 203
196static void __init e800_init(void) 204static void __init e800_init(void)
197{ 205{
206 pxa2xx_mfp_config(ARRAY_AND_SIZE(e800_pin_config));
207 pxa_set_ffuart_info(NULL);
208 pxa_set_btuart_info(NULL);
209 pxa_set_stuart_info(NULL);
198 clk_add_alias("CLK_CK3P6MI", e800_tc6393xb_device.name, 210 clk_add_alias("CLK_CK3P6MI", e800_tc6393xb_device.name,
199 "GPIO11_CLK", NULL), 211 "GPIO11_CLK", NULL),
200 eseries_get_tmio_gpios(); 212 eseries_get_tmio_gpios();
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
index aec7f4214b14..aab04f33e49b 100644
--- a/arch/arm/mach-pxa/em-x270.c
+++ b/arch/arm/mach-pxa/em-x270.c
@@ -109,26 +109,7 @@ static unsigned long common_pin_config[] = {
109 GPIO111_MMC_DAT_3, 109 GPIO111_MMC_DAT_3,
110 110
111 /* LCD */ 111 /* LCD */
112 GPIO58_LCD_LDD_0, 112 GPIOxx_LCD_TFT_16BPP,
113 GPIO59_LCD_LDD_1,
114 GPIO60_LCD_LDD_2,
115 GPIO61_LCD_LDD_3,
116 GPIO62_LCD_LDD_4,
117 GPIO63_LCD_LDD_5,
118 GPIO64_LCD_LDD_6,
119 GPIO65_LCD_LDD_7,
120 GPIO66_LCD_LDD_8,
121 GPIO67_LCD_LDD_9,
122 GPIO68_LCD_LDD_10,
123 GPIO69_LCD_LDD_11,
124 GPIO70_LCD_LDD_12,
125 GPIO71_LCD_LDD_13,
126 GPIO72_LCD_LDD_14,
127 GPIO73_LCD_LDD_15,
128 GPIO74_LCD_FCLK,
129 GPIO75_LCD_LCLK,
130 GPIO76_LCD_PCLK,
131 GPIO77_LCD_BIAS,
132 113
133 /* QCI */ 114 /* QCI */
134 GPIO84_CIF_FV, 115 GPIO84_CIF_FV,
@@ -497,16 +478,15 @@ static int em_x270_usb_hub_init(void)
497 goto err_free_vbus_gpio; 478 goto err_free_vbus_gpio;
498 479
499 /* USB Hub power-on and reset */ 480 /* USB Hub power-on and reset */
500 gpio_direction_output(usb_hub_reset, 0); 481 gpio_direction_output(usb_hub_reset, 1);
482 gpio_direction_output(GPIO9_USB_VBUS_EN, 0);
501 regulator_enable(em_x270_usb_ldo); 483 regulator_enable(em_x270_usb_ldo);
502 gpio_set_value(usb_hub_reset, 1);
503 gpio_set_value(usb_hub_reset, 0); 484 gpio_set_value(usb_hub_reset, 0);
485 gpio_set_value(usb_hub_reset, 1);
504 regulator_disable(em_x270_usb_ldo); 486 regulator_disable(em_x270_usb_ldo);
505 regulator_enable(em_x270_usb_ldo); 487 regulator_enable(em_x270_usb_ldo);
506 gpio_set_value(usb_hub_reset, 1); 488 gpio_set_value(usb_hub_reset, 0);
507 489 gpio_set_value(GPIO9_USB_VBUS_EN, 1);
508 /* enable VBUS */
509 gpio_direction_output(GPIO9_USB_VBUS_EN, 1);
510 490
511 return 0; 491 return 0;
512 492
@@ -967,7 +947,7 @@ static inline void em_x270_init_gpio_keys(void) {}
967#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE) 947#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
968static struct regulator *em_x270_camera_ldo; 948static struct regulator *em_x270_camera_ldo;
969 949
970static int em_x270_sensor_init(struct device *dev) 950static int em_x270_sensor_init(void)
971{ 951{
972 int ret; 952 int ret;
973 953
@@ -996,7 +976,6 @@ static int em_x270_sensor_init(struct device *dev)
996} 976}
997 977
998struct pxacamera_platform_data em_x270_camera_platform_data = { 978struct pxacamera_platform_data em_x270_camera_platform_data = {
999 .init = em_x270_sensor_init,
1000 .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 | 979 .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
1001 PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN, 980 PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
1002 .mclk_10khz = 2600, 981 .mclk_10khz = 2600,
@@ -1049,8 +1028,10 @@ static struct platform_device em_x270_camera = {
1049 1028
1050static void __init em_x270_init_camera(void) 1029static void __init em_x270_init_camera(void)
1051{ 1030{
1052 pxa_set_camera_info(&em_x270_camera_platform_data); 1031 if (em_x270_sensor_init() == 0) {
1053 platform_device_register(&em_x270_camera); 1032 pxa_set_camera_info(&em_x270_camera_platform_data);
1033 platform_device_register(&em_x270_camera);
1034 }
1054} 1035}
1055#else 1036#else
1056static inline void em_x270_init_camera(void) {} 1037static inline void em_x270_init_camera(void) {}
@@ -1286,6 +1267,10 @@ static void __init em_x270_init(void)
1286{ 1267{
1287 pxa2xx_mfp_config(ARRAY_AND_SIZE(common_pin_config)); 1268 pxa2xx_mfp_config(ARRAY_AND_SIZE(common_pin_config));
1288 1269
1270 pxa_set_ffuart_info(NULL);
1271 pxa_set_btuart_info(NULL);
1272 pxa_set_stuart_info(NULL);
1273
1289#ifdef CONFIG_PM 1274#ifdef CONFIG_PM
1290 pxa27x_set_pwrmode(PWRMODE_DEEPSLEEP); 1275 pxa27x_set_pwrmode(PWRMODE_DEEPSLEEP);
1291#endif 1276#endif
diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c
index 91417f035069..96ed13081639 100644
--- a/arch/arm/mach-pxa/eseries.c
+++ b/arch/arm/mach-pxa/eseries.c
@@ -128,6 +128,6 @@ static struct clk_lookup eseries_clkregs[] = {
128 128
129void eseries_register_clks(void) 129void eseries_register_clks(void)
130{ 130{
131 clks_register(eseries_clkregs, ARRAY_SIZE(eseries_clkregs)); 131 clkdev_add_table(eseries_clkregs, ARRAY_SIZE(eseries_clkregs));
132} 132}
133 133
diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index 588b265e5755..626c82b13970 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -17,7 +17,11 @@
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/pwm_backlight.h> 18#include <linux/pwm_backlight.h>
19#include <linux/input.h> 19#include <linux/input.h>
20#include <linux/gpio.h>
20#include <linux/gpio_keys.h> 21#include <linux/gpio_keys.h>
22#include <linux/leds-lp3944.h>
23
24#include <media/soc_camera.h>
21 25
22#include <asm/setup.h> 26#include <asm/setup.h>
23#include <asm/mach-types.h> 27#include <asm/mach-types.h>
@@ -29,6 +33,7 @@
29#include <plat/i2c.h> 33#include <plat/i2c.h>
30#include <mach/hardware.h> 34#include <mach/hardware.h>
31#include <mach/pxa27x_keypad.h> 35#include <mach/pxa27x_keypad.h>
36#include <mach/camera.h>
32 37
33#include "devices.h" 38#include "devices.h"
34#include "generic.h" 39#include "generic.h"
@@ -38,6 +43,9 @@
38#define GPIO15_A910_FLIP_LID 15 43#define GPIO15_A910_FLIP_LID 15
39#define GPIO12_E680_LOCK_SWITCH 12 44#define GPIO12_E680_LOCK_SWITCH 12
40#define GPIO15_E6_LOCK_SWITCH 15 45#define GPIO15_E6_LOCK_SWITCH 15
46#define GPIO50_nCAM_EN 50
47#define GPIO19_GEN1_CAM_RST 19
48#define GPIO28_GEN2_CAM_RST 28
41 49
42static struct platform_pwm_backlight_data ezx_backlight_data = { 50static struct platform_pwm_backlight_data ezx_backlight_data = {
43 .pwm_id = 0, 51 .pwm_id = 0,
@@ -191,8 +199,8 @@ static unsigned long gen1_pin_config[] __initdata = {
191 GPIO94_CIF_DD_5, 199 GPIO94_CIF_DD_5,
192 GPIO17_CIF_DD_6, 200 GPIO17_CIF_DD_6,
193 GPIO108_CIF_DD_7, 201 GPIO108_CIF_DD_7,
194 GPIO50_GPIO, /* CAM_EN */ 202 GPIO50_GPIO | MFP_LPM_DRIVE_HIGH, /* CAM_EN */
195 GPIO19_GPIO, /* CAM_RST */ 203 GPIO19_GPIO | MFP_LPM_DRIVE_HIGH, /* CAM_RST */
196 204
197 /* EMU */ 205 /* EMU */
198 GPIO120_GPIO, /* EMU_MUX1 */ 206 GPIO120_GPIO, /* EMU_MUX1 */
@@ -248,8 +256,8 @@ static unsigned long gen2_pin_config[] __initdata = {
248 GPIO48_CIF_DD_5, 256 GPIO48_CIF_DD_5,
249 GPIO93_CIF_DD_6, 257 GPIO93_CIF_DD_6,
250 GPIO12_CIF_DD_7, 258 GPIO12_CIF_DD_7,
251 GPIO50_GPIO, /* CAM_EN */ 259 GPIO50_GPIO | MFP_LPM_DRIVE_HIGH, /* CAM_EN */
252 GPIO28_GPIO, /* CAM_RST */ 260 GPIO28_GPIO | MFP_LPM_DRIVE_HIGH, /* CAM_RST */
253 GPIO17_GPIO, /* CAM_FLASH */ 261 GPIO17_GPIO, /* CAM_FLASH */
254}; 262};
255#endif 263#endif
@@ -683,6 +691,81 @@ static struct platform_device a780_gpio_keys = {
683 }, 691 },
684}; 692};
685 693
694/* camera */
695static int a780_camera_init(void)
696{
697 int err;
698
699 /*
700 * GPIO50_nCAM_EN is active low
701 * GPIO19_GEN1_CAM_RST is active on rising edge
702 */
703 err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
704 if (err) {
705 pr_err("%s: Failed to request nCAM_EN\n", __func__);
706 goto fail;
707 }
708
709 err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
710 if (err) {
711 pr_err("%s: Failed to request CAM_RST\n", __func__);
712 goto fail_gpio_cam_rst;
713 }
714
715 gpio_direction_output(GPIO50_nCAM_EN, 1);
716 gpio_direction_output(GPIO19_GEN1_CAM_RST, 0);
717
718 return 0;
719
720fail_gpio_cam_rst:
721 gpio_free(GPIO50_nCAM_EN);
722fail:
723 return err;
724}
725
726static int a780_camera_power(struct device *dev, int on)
727{
728 gpio_set_value(GPIO50_nCAM_EN, !on);
729 return 0;
730}
731
732static int a780_camera_reset(struct device *dev)
733{
734 gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
735 msleep(10);
736 gpio_set_value(GPIO19_GEN1_CAM_RST, 1);
737
738 return 0;
739}
740
741struct pxacamera_platform_data a780_pxacamera_platform_data = {
742 .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
743 PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
744 .mclk_10khz = 5000,
745};
746
747static struct i2c_board_info a780_camera_i2c_board_info = {
748 I2C_BOARD_INFO("mt9m111", 0x5d),
749};
750
751static struct soc_camera_link a780_iclink = {
752 .bus_id = 0,
753 .flags = SOCAM_SENSOR_INVERT_PCLK,
754 .i2c_adapter_id = 0,
755 .board_info = &a780_camera_i2c_board_info,
756 .module_name = "mt9m111",
757 .power = a780_camera_power,
758 .reset = a780_camera_reset,
759};
760
761static struct platform_device a780_camera = {
762 .name = "soc-camera-pdrv",
763 .id = 0,
764 .dev = {
765 .platform_data = &a780_iclink,
766 },
767};
768
686static struct platform_device *a780_devices[] __initdata = { 769static struct platform_device *a780_devices[] __initdata = {
687 &a780_gpio_keys, 770 &a780_gpio_keys,
688}; 771};
@@ -693,12 +776,21 @@ static void __init a780_init(void)
693 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config)); 776 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config));
694 pxa2xx_mfp_config(ARRAY_AND_SIZE(a780_pin_config)); 777 pxa2xx_mfp_config(ARRAY_AND_SIZE(a780_pin_config));
695 778
779 pxa_set_ffuart_info(NULL);
780 pxa_set_btuart_info(NULL);
781 pxa_set_stuart_info(NULL);
782
696 pxa_set_i2c_info(NULL); 783 pxa_set_i2c_info(NULL);
697 784
698 set_pxa_fb_info(&ezx_fb_info_1); 785 set_pxa_fb_info(&ezx_fb_info_1);
699 786
700 pxa_set_keypad_info(&a780_keypad_platform_data); 787 pxa_set_keypad_info(&a780_keypad_platform_data);
701 788
789 if (a780_camera_init() == 0) {
790 pxa_set_camera_info(&a780_pxacamera_platform_data);
791 platform_device_register(&a780_camera);
792 }
793
702 platform_add_devices(ARRAY_AND_SIZE(ezx_devices)); 794 platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
703 platform_add_devices(ARRAY_AND_SIZE(a780_devices)); 795 platform_add_devices(ARRAY_AND_SIZE(a780_devices));
704} 796}
@@ -754,6 +846,10 @@ static void __init e680_init(void)
754 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config)); 846 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config));
755 pxa2xx_mfp_config(ARRAY_AND_SIZE(e680_pin_config)); 847 pxa2xx_mfp_config(ARRAY_AND_SIZE(e680_pin_config));
756 848
849 pxa_set_ffuart_info(NULL);
850 pxa_set_btuart_info(NULL);
851 pxa_set_stuart_info(NULL);
852
757 pxa_set_i2c_info(NULL); 853 pxa_set_i2c_info(NULL);
758 i2c_register_board_info(0, ARRAY_AND_SIZE(e680_i2c_board_info)); 854 i2c_register_board_info(0, ARRAY_AND_SIZE(e680_i2c_board_info));
759 855
@@ -816,6 +912,10 @@ static void __init a1200_init(void)
816 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config)); 912 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
817 pxa2xx_mfp_config(ARRAY_AND_SIZE(a1200_pin_config)); 913 pxa2xx_mfp_config(ARRAY_AND_SIZE(a1200_pin_config));
818 914
915 pxa_set_ffuart_info(NULL);
916 pxa_set_btuart_info(NULL);
917 pxa_set_stuart_info(NULL);
918
819 pxa_set_i2c_info(NULL); 919 pxa_set_i2c_info(NULL);
820 i2c_register_board_info(0, ARRAY_AND_SIZE(a1200_i2c_board_info)); 920 i2c_register_board_info(0, ARRAY_AND_SIZE(a1200_i2c_board_info));
821 921
@@ -864,6 +964,131 @@ static struct platform_device a910_gpio_keys = {
864 }, 964 },
865}; 965};
866 966
967/* camera */
968static int a910_camera_init(void)
969{
970 int err;
971
972 /*
973 * GPIO50_nCAM_EN is active low
974 * GPIO28_GEN2_CAM_RST is active on rising edge
975 */
976 err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
977 if (err) {
978 pr_err("%s: Failed to request nCAM_EN\n", __func__);
979 goto fail;
980 }
981
982 err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST");
983 if (err) {
984 pr_err("%s: Failed to request CAM_RST\n", __func__);
985 goto fail_gpio_cam_rst;
986 }
987
988 gpio_direction_output(GPIO50_nCAM_EN, 1);
989 gpio_direction_output(GPIO28_GEN2_CAM_RST, 0);
990
991 return 0;
992
993fail_gpio_cam_rst:
994 gpio_free(GPIO50_nCAM_EN);
995fail:
996 return err;
997}
998
999static int a910_camera_power(struct device *dev, int on)
1000{
1001 gpio_set_value(GPIO50_nCAM_EN, !on);
1002 return 0;
1003}
1004
1005static int a910_camera_reset(struct device *dev)
1006{
1007 gpio_set_value(GPIO28_GEN2_CAM_RST, 0);
1008 msleep(10);
1009 gpio_set_value(GPIO28_GEN2_CAM_RST, 1);
1010
1011 return 0;
1012}
1013
1014struct pxacamera_platform_data a910_pxacamera_platform_data = {
1015 .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
1016 PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
1017 .mclk_10khz = 5000,
1018};
1019
1020static struct i2c_board_info a910_camera_i2c_board_info = {
1021 I2C_BOARD_INFO("mt9m111", 0x5d),
1022};
1023
1024static struct soc_camera_link a910_iclink = {
1025 .bus_id = 0,
1026 .i2c_adapter_id = 0,
1027 .board_info = &a910_camera_i2c_board_info,
1028 .module_name = "mt9m111",
1029 .power = a910_camera_power,
1030 .reset = a910_camera_reset,
1031};
1032
1033static struct platform_device a910_camera = {
1034 .name = "soc-camera-pdrv",
1035 .id = 0,
1036 .dev = {
1037 .platform_data = &a910_iclink,
1038 },
1039};
1040
1041/* leds-lp3944 */
1042static struct lp3944_platform_data a910_lp3944_leds = {
1043 .leds_size = LP3944_LEDS_MAX,
1044 .leds = {
1045 [0] = {
1046 .name = "a910:red:",
1047 .status = LP3944_LED_STATUS_OFF,
1048 .type = LP3944_LED_TYPE_LED,
1049 },
1050 [1] = {
1051 .name = "a910:green:",
1052 .status = LP3944_LED_STATUS_OFF,
1053 .type = LP3944_LED_TYPE_LED,
1054 },
1055 [2] {
1056 .name = "a910:blue:",
1057 .status = LP3944_LED_STATUS_OFF,
1058 .type = LP3944_LED_TYPE_LED,
1059 },
1060 /* Leds 3 and 4 are used as display power switches */
1061 [3] = {
1062 .name = "a910::cli_display",
1063 .status = LP3944_LED_STATUS_OFF,
1064 .type = LP3944_LED_TYPE_LED_INVERTED
1065 },
1066 [4] = {
1067 .name = "a910::main_display",
1068 .status = LP3944_LED_STATUS_ON,
1069 .type = LP3944_LED_TYPE_LED_INVERTED
1070 },
1071 [5] = { .type = LP3944_LED_TYPE_NONE },
1072 [6] = {
1073 .name = "a910::torch",
1074 .status = LP3944_LED_STATUS_OFF,
1075 .type = LP3944_LED_TYPE_LED,
1076 },
1077 [7] = {
1078 .name = "a910::flash",
1079 .status = LP3944_LED_STATUS_OFF,
1080 .type = LP3944_LED_TYPE_LED_INVERTED,
1081 },
1082 },
1083};
1084
1085static struct i2c_board_info __initdata a910_i2c_board_info[] = {
1086 {
1087 I2C_BOARD_INFO("lp3944", 0x60),
1088 .platform_data = &a910_lp3944_leds,
1089 },
1090};
1091
867static struct platform_device *a910_devices[] __initdata = { 1092static struct platform_device *a910_devices[] __initdata = {
868 &a910_gpio_keys, 1093 &a910_gpio_keys,
869}; 1094};
@@ -874,12 +1099,22 @@ static void __init a910_init(void)
874 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config)); 1099 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
875 pxa2xx_mfp_config(ARRAY_AND_SIZE(a910_pin_config)); 1100 pxa2xx_mfp_config(ARRAY_AND_SIZE(a910_pin_config));
876 1101
1102 pxa_set_ffuart_info(NULL);
1103 pxa_set_btuart_info(NULL);
1104 pxa_set_stuart_info(NULL);
1105
877 pxa_set_i2c_info(NULL); 1106 pxa_set_i2c_info(NULL);
1107 i2c_register_board_info(0, ARRAY_AND_SIZE(a910_i2c_board_info));
878 1108
879 set_pxa_fb_info(&ezx_fb_info_2); 1109 set_pxa_fb_info(&ezx_fb_info_2);
880 1110
881 pxa_set_keypad_info(&a910_keypad_platform_data); 1111 pxa_set_keypad_info(&a910_keypad_platform_data);
882 1112
1113 if (a910_camera_init() == 0) {
1114 pxa_set_camera_info(&a910_pxacamera_platform_data);
1115 platform_device_register(&a910_camera);
1116 }
1117
883 platform_add_devices(ARRAY_AND_SIZE(ezx_devices)); 1118 platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
884 platform_add_devices(ARRAY_AND_SIZE(a910_devices)); 1119 platform_add_devices(ARRAY_AND_SIZE(a910_devices));
885} 1120}
@@ -935,6 +1170,10 @@ static void __init e6_init(void)
935 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config)); 1170 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
936 pxa2xx_mfp_config(ARRAY_AND_SIZE(e6_pin_config)); 1171 pxa2xx_mfp_config(ARRAY_AND_SIZE(e6_pin_config));
937 1172
1173 pxa_set_ffuart_info(NULL);
1174 pxa_set_btuart_info(NULL);
1175 pxa_set_stuart_info(NULL);
1176
938 pxa_set_i2c_info(NULL); 1177 pxa_set_i2c_info(NULL);
939 i2c_register_board_info(0, ARRAY_AND_SIZE(e6_i2c_board_info)); 1178 i2c_register_board_info(0, ARRAY_AND_SIZE(e6_i2c_board_info));
940 1179
@@ -971,6 +1210,10 @@ static void __init e2_init(void)
971 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config)); 1210 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
972 pxa2xx_mfp_config(ARRAY_AND_SIZE(e2_pin_config)); 1211 pxa2xx_mfp_config(ARRAY_AND_SIZE(e2_pin_config));
973 1212
1213 pxa_set_ffuart_info(NULL);
1214 pxa_set_btuart_info(NULL);
1215 pxa_set_stuart_info(NULL);
1216
974 pxa_set_i2c_info(NULL); 1217 pxa_set_i2c_info(NULL);
975 i2c_register_board_info(0, ARRAY_AND_SIZE(e2_i2c_board_info)); 1218 i2c_register_board_info(0, ARRAY_AND_SIZE(e2_i2c_board_info));
976 1219
diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h
index 485fede83d97..890fb90a672f 100644
--- a/arch/arm/mach-pxa/generic.h
+++ b/arch/arm/mach-pxa/generic.h
@@ -67,3 +67,8 @@ extern struct sysdev_class pxa_irq_sysclass;
67extern struct sysdev_class pxa_gpio_sysclass; 67extern struct sysdev_class pxa_gpio_sysclass;
68extern struct sysdev_class pxa2xx_mfp_sysclass; 68extern struct sysdev_class pxa2xx_mfp_sysclass;
69extern struct sysdev_class pxa3xx_mfp_sysclass; 69extern struct sysdev_class pxa3xx_mfp_sysclass;
70
71void __init pxa_set_ffuart_info(void *info);
72void __init pxa_set_btuart_info(void *info);
73void __init pxa_set_stuart_info(void *info);
74void __init pxa_set_hwuart_info(void *info);
diff --git a/arch/arm/mach-pxa/gumstix.c b/arch/arm/mach-pxa/gumstix.c
index 1708c0109844..96c345129135 100644
--- a/arch/arm/mach-pxa/gumstix.c
+++ b/arch/arm/mach-pxa/gumstix.c
@@ -211,6 +211,11 @@ static void __init gumstix_init(void)
211{ 211{
212 pxa2xx_mfp_config(ARRAY_AND_SIZE(gumstix_pin_config)); 212 pxa2xx_mfp_config(ARRAY_AND_SIZE(gumstix_pin_config));
213 213
214 pxa_set_ffuart_info(NULL);
215 pxa_set_btuart_info(NULL);
216 pxa_set_stuart_info(NULL);
217 pxa_set_hwuart_info(NULL);
218
214 gumstix_bluetooth_init(); 219 gumstix_bluetooth_init();
215 gumstix_udc_init(); 220 gumstix_udc_init();
216 gumstix_mmc_init(); 221 gumstix_mmc_init();
diff --git a/arch/arm/mach-pxa/h5000.c b/arch/arm/mach-pxa/h5000.c
index f3d220c32e07..c1cab0871c99 100644
--- a/arch/arm/mach-pxa/h5000.c
+++ b/arch/arm/mach-pxa/h5000.c
@@ -193,6 +193,9 @@ static void __init h5000_init(void)
193 fix_msc(); 193 fix_msc();
194 194
195 pxa2xx_mfp_config(ARRAY_AND_SIZE(h5000_pin_config)); 195 pxa2xx_mfp_config(ARRAY_AND_SIZE(h5000_pin_config));
196 pxa_set_ffuart_info(NULL);
197 pxa_set_btuart_info(NULL);
198 pxa_set_stuart_info(NULL);
196 pxa_set_udc_info(&h5000_udc_mach_info); 199 pxa_set_udc_info(&h5000_udc_mach_info);
197 platform_add_devices(ARRAY_AND_SIZE(devices)); 200 platform_add_devices(ARRAY_AND_SIZE(devices));
198} 201}
diff --git a/arch/arm/mach-pxa/himalaya.c b/arch/arm/mach-pxa/himalaya.c
index cea99fe65b97..f9a2e4b0f090 100644
--- a/arch/arm/mach-pxa/himalaya.c
+++ b/arch/arm/mach-pxa/himalaya.c
@@ -150,6 +150,9 @@ static void __init himalaya_lcd_init(void)
150 150
151static void __init himalaya_init(void) 151static void __init himalaya_init(void)
152{ 152{
153 pxa_set_ffuart_info(NULL);
154 pxa_set_btuart_info(NULL);
155 pxa_set_stuart_info(NULL);
153 himalaya_lcd_init(); 156 himalaya_lcd_init();
154 platform_add_devices(devices, ARRAY_SIZE(devices)); 157 platform_add_devices(devices, ARRAY_SIZE(devices));
155} 158}
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c
index 83bd3c6e3884..848c861dd23f 100644
--- a/arch/arm/mach-pxa/hx4700.c
+++ b/arch/arm/mach-pxa/hx4700.c
@@ -820,6 +820,7 @@ static struct platform_device *devices[] __initdata = {
820 &gpio_keys, 820 &gpio_keys,
821 &backlight, 821 &backlight,
822 &w3220, 822 &w3220,
823 &hx4700_lcd,
823 &egpio, 824 &egpio,
824 &bq24022, 825 &bq24022,
825 &gpio_vbus, 826 &gpio_vbus,
@@ -849,6 +850,10 @@ static void __init hx4700_init(void)
849 pxa2xx_mfp_config(ARRAY_AND_SIZE(hx4700_pin_config)); 850 pxa2xx_mfp_config(ARRAY_AND_SIZE(hx4700_pin_config));
850 hx4700_gpio_request(ARRAY_AND_SIZE(global_gpios)); 851 hx4700_gpio_request(ARRAY_AND_SIZE(global_gpios));
851 852
853 pxa_set_ffuart_info(NULL);
854 pxa_set_btuart_info(NULL);
855 pxa_set_stuart_info(NULL);
856
852 platform_add_devices(devices, ARRAY_SIZE(devices)); 857 platform_add_devices(devices, ARRAY_SIZE(devices));
853 858
854 pxa_set_ficp_info(&ficp_info); 859 pxa_set_ficp_info(&ficp_info);
diff --git a/arch/arm/mach-pxa/icontrol.c b/arch/arm/mach-pxa/icontrol.c
new file mode 100644
index 000000000000..771137fc1a82
--- /dev/null
+++ b/arch/arm/mach-pxa/icontrol.c
@@ -0,0 +1,202 @@
1/*
2 * linux/arch/arm/mach-pxa/icontrol.c
3 *
4 * Support for the iControl and SafeTcam platforms from TMT Services
5 * using the Embedian MXM-8x10 Computer on Module
6 *
7 * Copyright (C) 2009 TMT Services & Supplies (Pty) Ltd.
8 *
9 * 2010-01-21 Hennie van der Merve <hvdmerwe@tmtservies.co.za>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 */
15
16#include <linux/irq.h>
17#include <linux/platform_device.h>
18#include <linux/gpio.h>
19
20#include <asm/mach-types.h>
21#include <asm/mach/arch.h>
22
23#include <mach/pxa320.h>
24#include <mach/mxm8x10.h>
25
26#include <linux/spi/spi.h>
27#include <mach/pxa2xx_spi.h>
28#include <linux/can/platform/mcp251x.h>
29
30#include "generic.h"
31
32#define ICONTROL_MCP251x_nCS1 (15)
33#define ICONTROL_MCP251x_nCS2 (16)
34#define ICONTROL_MCP251x_nCS3 (17)
35#define ICONTROL_MCP251x_nCS4 (24)
36
37#define ICONTROL_MCP251x_nIRQ1 (74)
38#define ICONTROL_MCP251x_nIRQ2 (75)
39#define ICONTROL_MCP251x_nIRQ3 (76)
40#define ICONTROL_MCP251x_nIRQ4 (77)
41
42static struct pxa2xx_spi_chip mcp251x_chip_info1 = {
43 .tx_threshold = 8,
44 .rx_threshold = 128,
45 .dma_burst_size = 8,
46 .timeout = 235,
47 .gpio_cs = ICONTROL_MCP251x_nCS1
48};
49
50static struct pxa2xx_spi_chip mcp251x_chip_info2 = {
51 .tx_threshold = 8,
52 .rx_threshold = 128,
53 .dma_burst_size = 8,
54 .timeout = 235,
55 .gpio_cs = ICONTROL_MCP251x_nCS2
56};
57
58static struct pxa2xx_spi_chip mcp251x_chip_info3 = {
59 .tx_threshold = 8,
60 .rx_threshold = 128,
61 .dma_burst_size = 8,
62 .timeout = 235,
63 .gpio_cs = ICONTROL_MCP251x_nCS3
64};
65
66static struct pxa2xx_spi_chip mcp251x_chip_info4 = {
67 .tx_threshold = 8,
68 .rx_threshold = 128,
69 .dma_burst_size = 8,
70 .timeout = 235,
71 .gpio_cs = ICONTROL_MCP251x_nCS4
72};
73
74static struct mcp251x_platform_data mcp251x_info = {
75 .oscillator_frequency = 16E6,
76 .model = CAN_MCP251X_MCP2515,
77 .board_specific_setup = NULL,
78 .power_enable = NULL,
79 .transceiver_enable = NULL
80};
81
82static struct spi_board_info mcp251x_board_info[] = {
83 {
84 .modalias = "mcp251x",
85 .max_speed_hz = 6500000,
86 .bus_num = 3,
87 .chip_select = 0,
88 .platform_data = &mcp251x_info,
89 .controller_data = &mcp251x_chip_info1,
90 .irq = gpio_to_irq(ICONTROL_MCP251x_nIRQ1)
91 },
92 {
93 .modalias = "mcp251x",
94 .max_speed_hz = 6500000,
95 .bus_num = 3,
96 .chip_select = 1,
97 .platform_data = &mcp251x_info,
98 .controller_data = &mcp251x_chip_info2,
99 .irq = gpio_to_irq(ICONTROL_MCP251x_nIRQ2)
100 },
101 {
102 .modalias = "mcp251x",
103 .max_speed_hz = 6500000,
104 .bus_num = 4,
105 .chip_select = 0,
106 .platform_data = &mcp251x_info,
107 .controller_data = &mcp251x_chip_info3,
108 .irq = gpio_to_irq(ICONTROL_MCP251x_nIRQ3)
109 },
110 {
111 .modalias = "mcp251x",
112 .max_speed_hz = 6500000,
113 .bus_num = 4,
114 .chip_select = 1,
115 .platform_data = &mcp251x_info,
116 .controller_data = &mcp251x_chip_info4,
117 .irq = gpio_to_irq(ICONTROL_MCP251x_nIRQ4)
118 }
119};
120
121static struct pxa2xx_spi_master pxa_ssp3_spi_master_info = {
122 .clock_enable = CKEN_SSP3,
123 .num_chipselect = 2,
124 .enable_dma = 1
125};
126
127static struct pxa2xx_spi_master pxa_ssp4_spi_master_info = {
128 .clock_enable = CKEN_SSP4,
129 .num_chipselect = 2,
130 .enable_dma = 1
131};
132
133struct platform_device pxa_spi_ssp3 = {
134 .name = "pxa2xx-spi",
135 .id = 3,
136 .dev = {
137 .platform_data = &pxa_ssp3_spi_master_info,
138 }
139};
140
141struct platform_device pxa_spi_ssp4 = {
142 .name = "pxa2xx-spi",
143 .id = 4,
144 .dev = {
145 .platform_data = &pxa_ssp4_spi_master_info,
146 }
147};
148
149static struct platform_device *icontrol_spi_devices[] __initdata = {
150 &pxa_spi_ssp3,
151 &pxa_spi_ssp4,
152};
153
154static mfp_cfg_t mfp_can_cfg[] __initdata = {
155 /* CAN CS lines */
156 GPIO15_GPIO,
157 GPIO16_GPIO,
158 GPIO17_GPIO,
159 GPIO24_GPIO,
160
161 /* SPI (SSP3) lines */
162 GPIO89_SSP3_SCLK,
163 GPIO91_SSP3_TXD,
164 GPIO92_SSP3_RXD,
165
166 /* SPI (SSP4) lines */
167 GPIO93_SSP4_SCLK,
168 GPIO95_SSP4_TXD,
169 GPIO96_SSP4_RXD,
170
171 /* CAN nIRQ lines */
172 GPIO74_GPIO | MFP_LPM_EDGE_RISE,
173 GPIO75_GPIO | MFP_LPM_EDGE_RISE,
174 GPIO76_GPIO | MFP_LPM_EDGE_RISE,
175 GPIO77_GPIO | MFP_LPM_EDGE_RISE
176};
177
178static void __init icontrol_can_init(void)
179{
180 pxa3xx_mfp_config(ARRAY_AND_SIZE(mfp_can_cfg));
181 platform_add_devices(ARRAY_AND_SIZE(icontrol_spi_devices));
182 spi_register_board_info(ARRAY_AND_SIZE(mcp251x_board_info));
183}
184
185static void __init icontrol_init(void)
186{
187 mxm_8x10_barebones_init();
188 mxm_8x10_usb_host_init();
189 mxm_8x10_mmc_init();
190
191 icontrol_can_init();
192}
193
194MACHINE_START(ICONTROL, "iControl/SafeTcam boards using Embedian MXM-8x10 CoM")
195 .phys_io = 0x40000000,
196 .boot_params = 0xa0000100,
197 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
198 .map_io = pxa_map_io,
199 .init_irq = pxa3xx_init_irq,
200 .timer = &pxa_timer,
201 .init_machine = icontrol_init
202MACHINE_END
diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c
index b6486ef20b17..bc78c4dc0c66 100644
--- a/arch/arm/mach-pxa/idp.c
+++ b/arch/arm/mach-pxa/idp.c
@@ -47,25 +47,7 @@
47 47
48static unsigned long idp_pin_config[] __initdata = { 48static unsigned long idp_pin_config[] __initdata = {
49 /* LCD */ 49 /* LCD */
50 GPIO58_LCD_LDD_0, 50 GPIOxx_LCD_DSTN_16BPP,
51 GPIO59_LCD_LDD_1,
52 GPIO60_LCD_LDD_2,
53 GPIO61_LCD_LDD_3,
54 GPIO62_LCD_LDD_4,
55 GPIO63_LCD_LDD_5,
56 GPIO64_LCD_LDD_6,
57 GPIO65_LCD_LDD_7,
58 GPIO66_LCD_LDD_8,
59 GPIO67_LCD_LDD_9,
60 GPIO68_LCD_LDD_10,
61 GPIO69_LCD_LDD_11,
62 GPIO70_LCD_LDD_12,
63 GPIO71_LCD_LDD_13,
64 GPIO72_LCD_LDD_14,
65 GPIO73_LCD_LDD_15,
66 GPIO74_LCD_FCLK,
67 GPIO75_LCD_LCLK,
68 GPIO76_LCD_PCLK,
69 51
70 /* BTUART */ 52 /* BTUART */
71 GPIO42_BTUART_RXD, 53 GPIO42_BTUART_RXD,
@@ -179,6 +161,9 @@ static void __init idp_init(void)
179 printk("idp_init()\n"); 161 printk("idp_init()\n");
180 162
181 pxa2xx_mfp_config(ARRAY_AND_SIZE(idp_pin_config)); 163 pxa2xx_mfp_config(ARRAY_AND_SIZE(idp_pin_config));
164 pxa_set_ffuart_info(NULL);
165 pxa_set_btuart_info(NULL);
166 pxa_set_stuart_info(NULL);
182 167
183 platform_device_register(&smc91x_device); 168 platform_device_register(&smc91x_device);
184 //platform_device_register(&mst_audio_device); 169 //platform_device_register(&mst_audio_device);
diff --git a/arch/arm/mach-pxa/imote2.c b/arch/arm/mach-pxa/imote2.c
index 2a4945db31c5..5161dca8ccc0 100644
--- a/arch/arm/mach-pxa/imote2.c
+++ b/arch/arm/mach-pxa/imote2.c
@@ -64,7 +64,6 @@ static unsigned long imote2_pin_config[] __initdata = {
64 GPIO116_GPIO, /* CC_CCA */ 64 GPIO116_GPIO, /* CC_CCA */
65 GPIO0_GPIO, /* CC_FIFOP */ 65 GPIO0_GPIO, /* CC_FIFOP */
66 GPIO16_GPIO, /* CCSFD */ 66 GPIO16_GPIO, /* CCSFD */
67 GPIO39_GPIO, /* CSn */
68 GPIO115_GPIO, /* Power enable */ 67 GPIO115_GPIO, /* Power enable */
69 68
70 /* I2C */ 69 /* I2C */
@@ -72,7 +71,7 @@ static unsigned long imote2_pin_config[] __initdata = {
72 GPIO118_I2C_SDA, 71 GPIO118_I2C_SDA,
73 72
74 /* SSP 3 - 802.15.4 radio */ 73 /* SSP 3 - 802.15.4 radio */
75 GPIO39_GPIO, /* Chip Select */ 74 GPIO39_GPIO, /* Chip Select */
76 GPIO34_SSP3_SCLK, 75 GPIO34_SSP3_SCLK,
77 GPIO35_SSP3_TXD, 76 GPIO35_SSP3_TXD,
78 GPIO41_SSP3_RXD, 77 GPIO41_SSP3_RXD,
@@ -554,11 +553,11 @@ static struct i2c_pxa_platform_data i2c_pdata = {
554 553
555static void __init imote2_init(void) 554static void __init imote2_init(void)
556{ 555{
557
558 pxa2xx_mfp_config(ARRAY_AND_SIZE(imote2_pin_config)); 556 pxa2xx_mfp_config(ARRAY_AND_SIZE(imote2_pin_config));
559 /* SPI chip select directions - all other directions should 557
560 * be handled by drivers.*/ 558 pxa_set_ffuart_info(NULL);
561 gpio_direction_output(37, 0); 559 pxa_set_btuart_info(NULL);
560 pxa_set_stuart_info(NULL);
562 561
563 platform_add_devices(imote2_devices, ARRAY_SIZE(imote2_devices)); 562 platform_add_devices(imote2_devices, ARRAY_SIZE(imote2_devices));
564 563
diff --git a/arch/arm/mach-pxa/include/mach/arcom-pcmcia.h b/arch/arm/mach-pxa/include/mach/arcom-pcmcia.h
new file mode 100644
index 000000000000..d428be4db44c
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/arcom-pcmcia.h
@@ -0,0 +1,11 @@
1#ifndef __ARCOM_PCMCIA_H
2#define __ARCOM_PCMCIA_H
3
4struct arcom_pcmcia_pdata {
5 int cd_gpio;
6 int rdy_gpio;
7 int pwr_gpio;
8 void (*reset)(int state);
9};
10
11#endif
diff --git a/arch/arm/mach-pxa/include/mach/balloon3.h b/arch/arm/mach-pxa/include/mach/balloon3.h
index bfec09b1814b..1a741065045f 100644
--- a/arch/arm/mach-pxa/include/mach/balloon3.h
+++ b/arch/arm/mach-pxa/include/mach/balloon3.h
@@ -129,6 +129,16 @@ enum balloon3_features {
129#define CPLD_AROUTING_LOONR2INT_BIT 6 129#define CPLD_AROUTING_LOONR2INT_BIT 6
130#define CPLD_AROUTING_LOONR2EXT_BIT 7 130#define CPLD_AROUTING_LOONR2EXT_BIT 7
131 131
132/* Balloon3 Interrupts */
133#define BALLOON3_IRQ(x) (IRQ_BOARD_START + (x))
134
135#define BALLOON3_BP_CF_NRDY_IRQ BALLOON3_IRQ(0)
136#define BALLOON3_BP_NSTSCHG_IRQ BALLOON3_IRQ(1)
137
138#define BALLOON3_AUX_NIRQ IRQ_GPIO(BALLOON3_GPIO_AUX_NIRQ)
139#define BALLOON3_CODEC_IRQ IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ)
140#define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD)
141
132extern int balloon3_has(enum balloon3_features feature); 142extern int balloon3_has(enum balloon3_features feature);
133 143
134#endif 144#endif
diff --git a/arch/arm/mach-pxa/include/mach/camera.h b/arch/arm/mach-pxa/include/mach/camera.h
index 31abe6d514b8..6709b1cd7c77 100644
--- a/arch/arm/mach-pxa/include/mach/camera.h
+++ b/arch/arm/mach-pxa/include/mach/camera.h
@@ -35,8 +35,6 @@
35#define PXA_CAMERA_VSP 0x400 35#define PXA_CAMERA_VSP 0x400
36 36
37struct pxacamera_platform_data { 37struct pxacamera_platform_data {
38 int (*init)(struct device *);
39
40 unsigned long flags; 38 unsigned long flags;
41 unsigned long mclk_10khz; 39 unsigned long mclk_10khz;
42}; 40};
diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h
index 811743c56147..5f2ba8d9015c 100644
--- a/arch/arm/mach-pxa/include/mach/colibri.h
+++ b/arch/arm/mach-pxa/include/mach/colibri.h
@@ -2,6 +2,7 @@
2#define _COLIBRI_H_ 2#define _COLIBRI_H_
3 3
4#include <net/ax88796.h> 4#include <net/ax88796.h>
5#include <mach/mfp.h>
5 6
6/* 7/*
7 * common settings for all modules 8 * common settings for all modules
diff --git a/arch/arm/mach-pxa/include/mach/debug-macro.S b/arch/arm/mach-pxa/include/mach/debug-macro.S
index 55d6a175ab19..01cf81393fe2 100644
--- a/arch/arm/mach-pxa/include/mach/debug-macro.S
+++ b/arch/arm/mach-pxa/include/mach/debug-macro.S
@@ -13,7 +13,7 @@
13 13
14#include "hardware.h" 14#include "hardware.h"
15 15
16 .macro addruart,rx 16 .macro addruart, rx, tmp
17 mrc p15, 0, \rx, c1, c0 17 mrc p15, 0, \rx, c1, c0
18 tst \rx, #1 @ MMU enabled? 18 tst \rx, #1 @ MMU enabled?
19 moveq \rx, #0x40000000 @ physical 19 moveq \rx, #0x40000000 @ physical
diff --git a/arch/arm/mach-pxa/include/mach/hardware.h b/arch/arm/mach-pxa/include/mach/hardware.h
index aa3d9f70a08a..3d8d8cb09685 100644
--- a/arch/arm/mach-pxa/include/mach/hardware.h
+++ b/arch/arm/mach-pxa/include/mach/hardware.h
@@ -105,6 +105,7 @@
105 * 105 *
106 * PXA935 A0 0x56056931 0x1E653013 106 * PXA935 A0 0x56056931 0x1E653013
107 * PXA935 B0 0x56056936 0x6E653013 107 * PXA935 B0 0x56056936 0x6E653013
108 * PXA935 B1 0x56056938 0x8E653013
108 */ 109 */
109#ifdef CONFIG_PXA25x 110#ifdef CONFIG_PXA25x
110#define __cpu_is_pxa210(id) \ 111#define __cpu_is_pxa210(id) \
@@ -201,7 +202,7 @@
201#define __cpu_is_pxa950(id) \ 202#define __cpu_is_pxa950(id) \
202 ({ \ 203 ({ \
203 unsigned int _id = (id) >> 4 & 0xfff; \ 204 unsigned int _id = (id) >> 4 & 0xfff; \
204 id == 0x697; \ 205 _id == 0x697; \
205 }) 206 })
206#else 207#else
207#define __cpu_is_pxa950(id) (0) 208#define __cpu_is_pxa950(id) (0)
@@ -249,20 +250,17 @@
249 250
250#define cpu_is_pxa930() \ 251#define cpu_is_pxa930() \
251 ({ \ 252 ({ \
252 unsigned int id = read_cpuid(CPUID_ID); \ 253 __cpu_is_pxa930(read_cpuid_id()); \
253 __cpu_is_pxa930(id); \
254 }) 254 })
255 255
256#define cpu_is_pxa935() \ 256#define cpu_is_pxa935() \
257 ({ \ 257 ({ \
258 unsigned int id = read_cpuid(CPUID_ID); \ 258 __cpu_is_pxa935(read_cpuid_id()); \
259 __cpu_is_pxa935(id); \
260 }) 259 })
261 260
262#define cpu_is_pxa950() \ 261#define cpu_is_pxa950() \
263 ({ \ 262 ({ \
264 unsigned int id = read_cpuid(CPUID_ID); \ 263 __cpu_is_pxa950(read_cpuid_id()); \
265 __cpu_is_pxa950(id); \
266 }) 264 })
267 265
268 266
@@ -283,7 +281,7 @@
283 _id == 0x3; \ 281 _id == 0x3; \
284 }) 282 })
285 283
286#define __cpu_is_pxa9xx(id) \ 284#define __cpu_is_pxa93x(id) \
287 ({ \ 285 ({ \
288 unsigned int _id = (id) >> 4 & 0xfff; \ 286 unsigned int _id = (id) >> 4 & 0xfff; \
289 _id == 0x683 || _id == 0x693; \ 287 _id == 0x683 || _id == 0x693; \
@@ -299,9 +297,9 @@
299 __cpu_is_pxa3xx(read_cpuid_id()); \ 297 __cpu_is_pxa3xx(read_cpuid_id()); \
300 }) 298 })
301 299
302#define cpu_is_pxa9xx() \ 300#define cpu_is_pxa93x() \
303 ({ \ 301 ({ \
304 __cpu_is_pxa9xx(read_cpuid_id()); \ 302 __cpu_is_pxa93x(read_cpuid_id()); \
305 }) 303 })
306/* 304/*
307 * return current memory and LCD clock frequency in units of 10kHz 305 * return current memory and LCD clock frequency in units of 10kHz
@@ -316,7 +314,6 @@ extern unsigned long get_clock_tick_rate(void);
316#define PCIBIOS_MIN_IO 0 314#define PCIBIOS_MIN_IO 0
317#define PCIBIOS_MIN_MEM 0 315#define PCIBIOS_MIN_MEM 0
318#define pcibios_assign_all_busses() 1 316#define pcibios_assign_all_busses() 1
319#define HAVE_ARCH_PCI_SET_DMA_MASK 1
320#endif 317#endif
321 318
322 319
diff --git a/arch/arm/mach-pxa/include/mach/irqs.h b/arch/arm/mach-pxa/include/mach/irqs.h
index 3677a9af9c87..ffc8314520f2 100644
--- a/arch/arm/mach-pxa/include/mach/irqs.h
+++ b/arch/arm/mach-pxa/include/mach/irqs.h
@@ -135,82 +135,6 @@
135#define IRQ_BOARD_END (IRQ_BOARD_START + 16) 135#define IRQ_BOARD_END (IRQ_BOARD_START + 16)
136#endif 136#endif
137 137
138#define IRQ_SA1111_START (IRQ_BOARD_END)
139#define IRQ_GPAIN0 (IRQ_BOARD_END + 0)
140#define IRQ_GPAIN1 (IRQ_BOARD_END + 1)
141#define IRQ_GPAIN2 (IRQ_BOARD_END + 2)
142#define IRQ_GPAIN3 (IRQ_BOARD_END + 3)
143#define IRQ_GPBIN0 (IRQ_BOARD_END + 4)
144#define IRQ_GPBIN1 (IRQ_BOARD_END + 5)
145#define IRQ_GPBIN2 (IRQ_BOARD_END + 6)
146#define IRQ_GPBIN3 (IRQ_BOARD_END + 7)
147#define IRQ_GPBIN4 (IRQ_BOARD_END + 8)
148#define IRQ_GPBIN5 (IRQ_BOARD_END + 9)
149#define IRQ_GPCIN0 (IRQ_BOARD_END + 10)
150#define IRQ_GPCIN1 (IRQ_BOARD_END + 11)
151#define IRQ_GPCIN2 (IRQ_BOARD_END + 12)
152#define IRQ_GPCIN3 (IRQ_BOARD_END + 13)
153#define IRQ_GPCIN4 (IRQ_BOARD_END + 14)
154#define IRQ_GPCIN5 (IRQ_BOARD_END + 15)
155#define IRQ_GPCIN6 (IRQ_BOARD_END + 16)
156#define IRQ_GPCIN7 (IRQ_BOARD_END + 17)
157#define IRQ_MSTXINT (IRQ_BOARD_END + 18)
158#define IRQ_MSRXINT (IRQ_BOARD_END + 19)
159#define IRQ_MSSTOPERRINT (IRQ_BOARD_END + 20)
160#define IRQ_TPTXINT (IRQ_BOARD_END + 21)
161#define IRQ_TPRXINT (IRQ_BOARD_END + 22)
162#define IRQ_TPSTOPERRINT (IRQ_BOARD_END + 23)
163#define SSPXMTINT (IRQ_BOARD_END + 24)
164#define SSPRCVINT (IRQ_BOARD_END + 25)
165#define SSPROR (IRQ_BOARD_END + 26)
166#define AUDXMTDMADONEA (IRQ_BOARD_END + 32)
167#define AUDRCVDMADONEA (IRQ_BOARD_END + 33)
168#define AUDXMTDMADONEB (IRQ_BOARD_END + 34)
169#define AUDRCVDMADONEB (IRQ_BOARD_END + 35)
170#define AUDTFSR (IRQ_BOARD_END + 36)
171#define AUDRFSR (IRQ_BOARD_END + 37)
172#define AUDTUR (IRQ_BOARD_END + 38)
173#define AUDROR (IRQ_BOARD_END + 39)
174#define AUDDTS (IRQ_BOARD_END + 40)
175#define AUDRDD (IRQ_BOARD_END + 41)
176#define AUDSTO (IRQ_BOARD_END + 42)
177#define IRQ_USBPWR (IRQ_BOARD_END + 43)
178#define IRQ_HCIM (IRQ_BOARD_END + 44)
179#define IRQ_HCIBUFFACC (IRQ_BOARD_END + 45)
180#define IRQ_HCIRMTWKP (IRQ_BOARD_END + 46)
181#define IRQ_NHCIMFCIR (IRQ_BOARD_END + 47)
182#define IRQ_USB_PORT_RESUME (IRQ_BOARD_END + 48)
183#define IRQ_S0_READY_NINT (IRQ_BOARD_END + 49)
184#define IRQ_S1_READY_NINT (IRQ_BOARD_END + 50)
185#define IRQ_S0_CD_VALID (IRQ_BOARD_END + 51)
186#define IRQ_S1_CD_VALID (IRQ_BOARD_END + 52)
187#define IRQ_S0_BVD1_STSCHG (IRQ_BOARD_END + 53)
188#define IRQ_S1_BVD1_STSCHG (IRQ_BOARD_END + 54)
189
190#define IRQ_LOCOMO_START (IRQ_BOARD_END)
191#define IRQ_LOCOMO_KEY (IRQ_BOARD_END + 0)
192#define IRQ_LOCOMO_GPIO0 (IRQ_BOARD_END + 1)
193#define IRQ_LOCOMO_GPIO1 (IRQ_BOARD_END + 2)
194#define IRQ_LOCOMO_GPIO2 (IRQ_BOARD_END + 3)
195#define IRQ_LOCOMO_GPIO3 (IRQ_BOARD_END + 4)
196#define IRQ_LOCOMO_GPIO4 (IRQ_BOARD_END + 5)
197#define IRQ_LOCOMO_GPIO5 (IRQ_BOARD_END + 6)
198#define IRQ_LOCOMO_GPIO6 (IRQ_BOARD_END + 7)
199#define IRQ_LOCOMO_GPIO7 (IRQ_BOARD_END + 8)
200#define IRQ_LOCOMO_GPIO8 (IRQ_BOARD_END + 9)
201#define IRQ_LOCOMO_GPIO9 (IRQ_BOARD_END + 10)
202#define IRQ_LOCOMO_GPIO10 (IRQ_BOARD_END + 11)
203#define IRQ_LOCOMO_GPIO11 (IRQ_BOARD_END + 12)
204#define IRQ_LOCOMO_GPIO12 (IRQ_BOARD_END + 13)
205#define IRQ_LOCOMO_GPIO13 (IRQ_BOARD_END + 14)
206#define IRQ_LOCOMO_GPIO14 (IRQ_BOARD_END + 15)
207#define IRQ_LOCOMO_GPIO15 (IRQ_BOARD_END + 16)
208#define IRQ_LOCOMO_LT (IRQ_BOARD_END + 17)
209#define IRQ_LOCOMO_SPI_RFR (IRQ_BOARD_END + 18)
210#define IRQ_LOCOMO_SPI_RFW (IRQ_BOARD_END + 19)
211#define IRQ_LOCOMO_SPI_OVRN (IRQ_BOARD_END + 20)
212#define IRQ_LOCOMO_SPI_TEND (IRQ_BOARD_END + 21)
213
214/* 138/*
215 * Figure out the MAX IRQ number. 139 * Figure out the MAX IRQ number.
216 * 140 *
@@ -219,89 +143,16 @@
219 * Otherwise, we have the standard IRQs only. 143 * Otherwise, we have the standard IRQs only.
220 */ 144 */
221#ifdef CONFIG_SA1111 145#ifdef CONFIG_SA1111
222#define NR_IRQS (IRQ_S1_BVD1_STSCHG + 1) 146#define NR_IRQS (IRQ_BOARD_END + 55)
223#elif defined(CONFIG_SHARP_LOCOMO)
224#define NR_IRQS (IRQ_LOCOMO_SPI_TEND + 1)
225#elif defined(CONFIG_PXA_HAVE_BOARD_IRQS) 147#elif defined(CONFIG_PXA_HAVE_BOARD_IRQS)
226#define NR_IRQS (IRQ_BOARD_END) 148#define NR_IRQS (IRQ_BOARD_END)
227#else 149#else
228#define NR_IRQS (IRQ_BOARD_START) 150#define NR_IRQS (IRQ_BOARD_START)
229#endif 151#endif
230 152
231/*
232 * Board specific IRQs. Define them here.
233 * Do not surround them with ifdefs.
234 */
235#define LUBBOCK_IRQ(x) (IRQ_BOARD_START + (x))
236#define LUBBOCK_SD_IRQ LUBBOCK_IRQ(0)
237#define LUBBOCK_SA1111_IRQ LUBBOCK_IRQ(1)
238#define LUBBOCK_USB_IRQ LUBBOCK_IRQ(2) /* usb connect */
239#define LUBBOCK_ETH_IRQ LUBBOCK_IRQ(3)
240#define LUBBOCK_UCB1400_IRQ LUBBOCK_IRQ(4)
241#define LUBBOCK_BB_IRQ LUBBOCK_IRQ(5)
242#define LUBBOCK_USB_DISC_IRQ LUBBOCK_IRQ(6) /* usb disconnect */
243#define LUBBOCK_LAST_IRQ LUBBOCK_IRQ(6)
244
245#define LPD270_IRQ(x) (IRQ_BOARD_START + (x))
246#define LPD270_USBC_IRQ LPD270_IRQ(2)
247#define LPD270_ETHERNET_IRQ LPD270_IRQ(3)
248#define LPD270_AC97_IRQ LPD270_IRQ(4)
249
250#define MAINSTONE_IRQ(x) (IRQ_BOARD_START + (x))
251#define MAINSTONE_MMC_IRQ MAINSTONE_IRQ(0)
252#define MAINSTONE_USIM_IRQ MAINSTONE_IRQ(1)
253#define MAINSTONE_USBC_IRQ MAINSTONE_IRQ(2)
254#define MAINSTONE_ETHERNET_IRQ MAINSTONE_IRQ(3)
255#define MAINSTONE_AC97_IRQ MAINSTONE_IRQ(4)
256#define MAINSTONE_PEN_IRQ MAINSTONE_IRQ(5)
257#define MAINSTONE_MSINS_IRQ MAINSTONE_IRQ(6)
258#define MAINSTONE_EXBRD_IRQ MAINSTONE_IRQ(7)
259#define MAINSTONE_S0_CD_IRQ MAINSTONE_IRQ(9)
260#define MAINSTONE_S0_STSCHG_IRQ MAINSTONE_IRQ(10)
261#define MAINSTONE_S0_IRQ MAINSTONE_IRQ(11)
262#define MAINSTONE_S1_CD_IRQ MAINSTONE_IRQ(13)
263#define MAINSTONE_S1_STSCHG_IRQ MAINSTONE_IRQ(14)
264#define MAINSTONE_S1_IRQ MAINSTONE_IRQ(15)
265
266/* Balloon3 Interrupts */
267#define BALLOON3_IRQ(x) (IRQ_BOARD_START + (x))
268
269#define BALLOON3_BP_CF_NRDY_IRQ BALLOON3_IRQ(0)
270#define BALLOON3_BP_NSTSCHG_IRQ BALLOON3_IRQ(1)
271
272#define BALLOON3_AUX_NIRQ IRQ_GPIO(BALLOON3_GPIO_AUX_NIRQ)
273#define BALLOON3_CODEC_IRQ IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ)
274#define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD)
275
276/* LoCoMo Interrupts (CONFIG_SHARP_LOCOMO) */
277#define IRQ_LOCOMO_KEY_BASE (IRQ_BOARD_START + 0)
278#define IRQ_LOCOMO_GPIO_BASE (IRQ_BOARD_START + 1)
279#define IRQ_LOCOMO_LT_BASE (IRQ_BOARD_START + 2)
280#define IRQ_LOCOMO_SPI_BASE (IRQ_BOARD_START + 3)
281
282/* phyCORE-PXA270 (PCM027) Interrupts */
283#define PCM027_IRQ(x) (IRQ_BOARD_START + (x))
284#define PCM027_BTDET_IRQ PCM027_IRQ(0)
285#define PCM027_FF_RI_IRQ PCM027_IRQ(1)
286#define PCM027_MMCDET_IRQ PCM027_IRQ(2)
287#define PCM027_PM_5V_IRQ PCM027_IRQ(3)
288
289/* ITE8152 irqs */
290/* add IT8152 IRQs beyond BOARD_END */ 153/* add IT8152 IRQs beyond BOARD_END */
291#ifdef CONFIG_PCI_HOST_ITE8152 154#ifdef CONFIG_PCI_HOST_ITE8152
292#define IT8152_IRQ(x) (IRQ_BOARD_END + (x)) 155#define IT8152_LAST_IRQ (IRQ_BOARD_END + 40)
293
294/* IRQ-sources in 3 groups - local devices, LPC (serial), and external PCI */
295#define IT8152_LD_IRQ_COUNT 9
296#define IT8152_LP_IRQ_COUNT 16
297#define IT8152_PD_IRQ_COUNT 15
298
299/* Priorities: */
300#define IT8152_PD_IRQ(i) IT8152_IRQ(i)
301#define IT8152_LP_IRQ(i) (IT8152_IRQ(i) + IT8152_PD_IRQ_COUNT)
302#define IT8152_LD_IRQ(i) (IT8152_IRQ(i) + IT8152_PD_IRQ_COUNT + IT8152_LP_IRQ_COUNT)
303
304#define IT8152_LAST_IRQ IT8152_LD_IRQ(IT8152_LD_IRQ_COUNT - 1)
305 156
306#if NR_IRQS < (IT8152_LAST_IRQ+1) 157#if NR_IRQS < (IT8152_LAST_IRQ+1)
307#undef NR_IRQS 158#undef NR_IRQS
diff --git a/arch/arm/mach-pxa/include/mach/lpd270.h b/arch/arm/mach-pxa/include/mach/lpd270.h
index f89fb715266b..0e6440c81683 100644
--- a/arch/arm/mach-pxa/include/mach/lpd270.h
+++ b/arch/arm/mach-pxa/include/mach/lpd270.h
@@ -34,5 +34,9 @@
34#define LPD270_INT_ETHERNET (1 << 3) /* Ethernet controller IRQ */ 34#define LPD270_INT_ETHERNET (1 << 3) /* Ethernet controller IRQ */
35#define LPD270_INT_USBC (1 << 2) /* USB client cable detection IRQ */ 35#define LPD270_INT_USBC (1 << 2) /* USB client cable detection IRQ */
36 36
37#define LPD270_IRQ(x) (IRQ_BOARD_START + (x))
38#define LPD270_USBC_IRQ LPD270_IRQ(2)
39#define LPD270_ETHERNET_IRQ LPD270_IRQ(3)
40#define LPD270_AC97_IRQ LPD270_IRQ(4)
37 41
38#endif 42#endif
diff --git a/arch/arm/mach-pxa/include/mach/lubbock.h b/arch/arm/mach-pxa/include/mach/lubbock.h
index 751b74811d0f..a0d4247f08fc 100644
--- a/arch/arm/mach-pxa/include/mach/lubbock.h
+++ b/arch/arm/mach-pxa/include/mach/lubbock.h
@@ -34,6 +34,17 @@
34#define LUB_IRQ_SET_CLR __LUB_REG(LUBBOCK_FPGA_PHYS + 0x0d0) 34#define LUB_IRQ_SET_CLR __LUB_REG(LUBBOCK_FPGA_PHYS + 0x0d0)
35#define LUB_GP __LUB_REG(LUBBOCK_FPGA_PHYS + 0x100) 35#define LUB_GP __LUB_REG(LUBBOCK_FPGA_PHYS + 0x100)
36 36
37/* Board specific IRQs */
38#define LUBBOCK_IRQ(x) (IRQ_BOARD_START + (x))
39#define LUBBOCK_SD_IRQ LUBBOCK_IRQ(0)
40#define LUBBOCK_SA1111_IRQ LUBBOCK_IRQ(1)
41#define LUBBOCK_USB_IRQ LUBBOCK_IRQ(2) /* usb connect */
42#define LUBBOCK_ETH_IRQ LUBBOCK_IRQ(3)
43#define LUBBOCK_UCB1400_IRQ LUBBOCK_IRQ(4)
44#define LUBBOCK_BB_IRQ LUBBOCK_IRQ(5)
45#define LUBBOCK_USB_DISC_IRQ LUBBOCK_IRQ(6) /* usb disconnect */
46#define LUBBOCK_LAST_IRQ LUBBOCK_IRQ(6)
47
37#ifndef __ASSEMBLY__ 48#ifndef __ASSEMBLY__
38extern void lubbock_set_misc_wr(unsigned int mask, unsigned int set); 49extern void lubbock_set_misc_wr(unsigned int mask, unsigned int set);
39#endif 50#endif
diff --git a/arch/arm/mach-pxa/include/mach/mainstone.h b/arch/arm/mach-pxa/include/mach/mainstone.h
index 3461c4302ff4..86e623abd64d 100644
--- a/arch/arm/mach-pxa/include/mach/mainstone.h
+++ b/arch/arm/mach-pxa/include/mach/mainstone.h
@@ -117,4 +117,21 @@
117#define MST_PCMCIA_PWR_VCC_33 0x8 /* voltage VCC = 3.3V */ 117#define MST_PCMCIA_PWR_VCC_33 0x8 /* voltage VCC = 3.3V */
118#define MST_PCMCIA_PWR_VCC_50 0x4 /* voltage VCC = 5.0V */ 118#define MST_PCMCIA_PWR_VCC_50 0x4 /* voltage VCC = 5.0V */
119 119
120/* board specific IRQs */
121#define MAINSTONE_IRQ(x) (IRQ_BOARD_START + (x))
122#define MAINSTONE_MMC_IRQ MAINSTONE_IRQ(0)
123#define MAINSTONE_USIM_IRQ MAINSTONE_IRQ(1)
124#define MAINSTONE_USBC_IRQ MAINSTONE_IRQ(2)
125#define MAINSTONE_ETHERNET_IRQ MAINSTONE_IRQ(3)
126#define MAINSTONE_AC97_IRQ MAINSTONE_IRQ(4)
127#define MAINSTONE_PEN_IRQ MAINSTONE_IRQ(5)
128#define MAINSTONE_MSINS_IRQ MAINSTONE_IRQ(6)
129#define MAINSTONE_EXBRD_IRQ MAINSTONE_IRQ(7)
130#define MAINSTONE_S0_CD_IRQ MAINSTONE_IRQ(9)
131#define MAINSTONE_S0_STSCHG_IRQ MAINSTONE_IRQ(10)
132#define MAINSTONE_S0_IRQ MAINSTONE_IRQ(11)
133#define MAINSTONE_S1_CD_IRQ MAINSTONE_IRQ(13)
134#define MAINSTONE_S1_STSCHG_IRQ MAINSTONE_IRQ(14)
135#define MAINSTONE_S1_IRQ MAINSTONE_IRQ(15)
136
120#endif 137#endif
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa25x.h b/arch/arm/mach-pxa/include/mach/mfp-pxa25x.h
index b13dc0269a6d..cafadc33dfd8 100644
--- a/arch/arm/mach-pxa/include/mach/mfp-pxa25x.h
+++ b/arch/arm/mach-pxa/include/mach/mfp-pxa25x.h
@@ -169,7 +169,6 @@
169#define GPIO86_nSDCS2 MFP_CFG_OUT(GPIO86, AF0, DRIVE_HIGH) 169#define GPIO86_nSDCS2 MFP_CFG_OUT(GPIO86, AF0, DRIVE_HIGH)
170#define GPIO87_nSDCS3 MFP_CFG_OUT(GPIO87, AF0, DRIVE_HIGH) 170#define GPIO87_nSDCS3 MFP_CFG_OUT(GPIO87, AF0, DRIVE_HIGH)
171#define GPIO88_RDnWR MFP_CFG_OUT(GPIO88, AF0, DRIVE_HIGH) 171#define GPIO88_RDnWR MFP_CFG_OUT(GPIO88, AF0, DRIVE_HIGH)
172#define GPIO89_nACRESET MFP_CFG_OUT(GPIO89, AF0, DRIVE_HIGH)
173 172
174/* USB */ 173/* USB */
175#define GPIO9_USB_RCV MFP_CFG_IN(GPIO9, AF1) 174#define GPIO9_USB_RCV MFP_CFG_IN(GPIO9, AF1)
@@ -186,6 +185,41 @@
186#define GPIO30_ASSP_TXD MFP_CFG_OUT(GPIO30, AF3, DRIVE_LOW) 185#define GPIO30_ASSP_TXD MFP_CFG_OUT(GPIO30, AF3, DRIVE_LOW)
187#define GPIO31_ASSP_SFRM_IN MFP_CFG_IN(GPIO31, AF1) 186#define GPIO31_ASSP_SFRM_IN MFP_CFG_IN(GPIO31, AF1)
188#define GPIO31_ASSP_SFRM_OUT MFP_CFG_OUT(GPIO31, AF3, DRIVE_LOW) 187#define GPIO31_ASSP_SFRM_OUT MFP_CFG_OUT(GPIO31, AF3, DRIVE_LOW)
189#endif 188
189/* AC97 */
190#define GPIO89_AC97_nRESET MFP_CFG_OUT(GPIO89, AF0, DRIVE_HIGH)
191#endif /* CONFIG_CPU_PXA26x */
192
193/* commonly used pin configurations */
194#define GPIOxx_LCD_16BPP \
195 GPIO58_LCD_LDD_0, \
196 GPIO59_LCD_LDD_1, \
197 GPIO60_LCD_LDD_2, \
198 GPIO61_LCD_LDD_3, \
199 GPIO62_LCD_LDD_4, \
200 GPIO63_LCD_LDD_5, \
201 GPIO64_LCD_LDD_6, \
202 GPIO65_LCD_LDD_7, \
203 GPIO66_LCD_LDD_8, \
204 GPIO67_LCD_LDD_9, \
205 GPIO68_LCD_LDD_10, \
206 GPIO69_LCD_LDD_11, \
207 GPIO70_LCD_LDD_12, \
208 GPIO71_LCD_LDD_13, \
209 GPIO72_LCD_LDD_14, \
210 GPIO73_LCD_LDD_15
211
212#define GPIOxx_LCD_DSTN_16BPP \
213 GPIOxx_LCD_16BPP, \
214 GPIO74_LCD_FCLK, \
215 GPIO75_LCD_LCLK, \
216 GPIO76_LCD_PCLK
217
218#define GPIOxx_LCD_TFT_16BPP \
219 GPIOxx_LCD_16BPP, \
220 GPIO74_LCD_FCLK, \
221 GPIO75_LCD_LCLK, \
222 GPIO76_LCD_PCLK, \
223 GPIO77_LCD_BIAS
190 224
191#endif /* __ASM_ARCH_MFP_PXA25X_H */ 225#endif /* __ASM_ARCH_MFP_PXA25X_H */
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h b/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
index 6543c05f47ed..ec0f0b0b6744 100644
--- a/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
+++ b/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
@@ -434,5 +434,32 @@
434#define GPIO112_nMSINS MFP_CFG_IN(GPIO112, AF2) 434#define GPIO112_nMSINS MFP_CFG_IN(GPIO112, AF2)
435#define GPIO32_MSSCLK MFP_CFG_OUT(GPIO32, AF1, DRIVE_LOW) 435#define GPIO32_MSSCLK MFP_CFG_OUT(GPIO32, AF1, DRIVE_LOW)
436 436
437/* commonly used pin configurations */
438#define GPIOxx_LCD_16BPP \
439 GPIO58_LCD_LDD_0, \
440 GPIO59_LCD_LDD_1, \
441 GPIO60_LCD_LDD_2, \
442 GPIO61_LCD_LDD_3, \
443 GPIO62_LCD_LDD_4, \
444 GPIO63_LCD_LDD_5, \
445 GPIO64_LCD_LDD_6, \
446 GPIO65_LCD_LDD_7, \
447 GPIO66_LCD_LDD_8, \
448 GPIO67_LCD_LDD_9, \
449 GPIO68_LCD_LDD_10, \
450 GPIO69_LCD_LDD_11, \
451 GPIO70_LCD_LDD_12, \
452 GPIO71_LCD_LDD_13, \
453 GPIO72_LCD_LDD_14, \
454 GPIO73_LCD_LDD_15
455
456#define GPIOxx_LCD_TFT_16BPP \
457 GPIOxx_LCD_16BPP, \
458 GPIO74_LCD_FCLK, \
459 GPIO75_LCD_LCLK, \
460 GPIO76_LCD_PCLK, \
461 GPIO77_LCD_BIAS
462
463
437extern int keypad_set_wake(unsigned int on); 464extern int keypad_set_wake(unsigned int on);
438#endif /* __ASM_ARCH_MFP_PXA27X_H */ 465#endif /* __ASM_ARCH_MFP_PXA27X_H */
diff --git a/arch/arm/mach-pxa/include/mach/mxm8x10.h b/arch/arm/mach-pxa/include/mach/mxm8x10.h
new file mode 100644
index 000000000000..ffa15665a418
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/mxm8x10.h
@@ -0,0 +1,21 @@
1#ifndef __MACH_MXM_8X10_H
2#define __MACH_MXM_8X10_H
3
4#define MXM_8X10_ETH_PHYS 0x13000000
5
6#if defined(CONFIG_MMC)
7
8#define MXM_8X10_SD_nCD (72)
9#define MXM_8X10_SD_WP (84)
10
11extern void mxm_8x10_mmc_init(void);
12#else
13static inline void mxm_8x10_mmc_init(void) {}
14#endif
15
16extern void mxm_8x10_usb_host_init(void);
17extern void mxm_8x10_ac97_init(void);
18
19extern void mxm_8x10_barebones_init(void);
20
21#endif /* __MACH_MXM_8X10_H */
diff --git a/arch/arm/mach-pxa/include/mach/palmld.h b/arch/arm/mach-pxa/include/mach/palmld.h
index 8721b8010221..ae536e86d8e8 100644
--- a/arch/arm/mach-pxa/include/mach/palmld.h
+++ b/arch/arm/mach-pxa/include/mach/palmld.h
@@ -91,7 +91,7 @@
91/* BATTERY */ 91/* BATTERY */
92#define PALMLD_BAT_MAX_VOLTAGE 4000 /* 4.00V maximum voltage */ 92#define PALMLD_BAT_MAX_VOLTAGE 4000 /* 4.00V maximum voltage */
93#define PALMLD_BAT_MIN_VOLTAGE 3550 /* 3.55V critical voltage */ 93#define PALMLD_BAT_MIN_VOLTAGE 3550 /* 3.55V critical voltage */
94#define PALMLD_BAT_MAX_CURRENT 0 /* unknokn */ 94#define PALMLD_BAT_MAX_CURRENT 0 /* unknown */
95#define PALMLD_BAT_MIN_CURRENT 0 /* unknown */ 95#define PALMLD_BAT_MIN_CURRENT 0 /* unknown */
96#define PALMLD_BAT_MAX_CHARGE 1 /* unknown */ 96#define PALMLD_BAT_MAX_CHARGE 1 /* unknown */
97#define PALMLD_BAT_MIN_CHARGE 1 /* unknown */ 97#define PALMLD_BAT_MIN_CHARGE 1 /* unknown */
diff --git a/arch/arm/mach-pxa/include/mach/palmt5.h b/arch/arm/mach-pxa/include/mach/palmt5.h
index d15662aba008..6baf7469d4ec 100644
--- a/arch/arm/mach-pxa/include/mach/palmt5.h
+++ b/arch/arm/mach-pxa/include/mach/palmt5.h
@@ -66,7 +66,7 @@
66/* BATTERY */ 66/* BATTERY */
67#define PALMT5_BAT_MAX_VOLTAGE 4000 /* 4.00v current voltage */ 67#define PALMT5_BAT_MAX_VOLTAGE 4000 /* 4.00v current voltage */
68#define PALMT5_BAT_MIN_VOLTAGE 3550 /* 3.55v critical voltage */ 68#define PALMT5_BAT_MIN_VOLTAGE 3550 /* 3.55v critical voltage */
69#define PALMT5_BAT_MAX_CURRENT 0 /* unknokn */ 69#define PALMT5_BAT_MAX_CURRENT 0 /* unknown */
70#define PALMT5_BAT_MIN_CURRENT 0 /* unknown */ 70#define PALMT5_BAT_MIN_CURRENT 0 /* unknown */
71#define PALMT5_BAT_MAX_CHARGE 1 /* unknown */ 71#define PALMT5_BAT_MAX_CHARGE 1 /* unknown */
72#define PALMT5_BAT_MIN_CHARGE 1 /* unknown */ 72#define PALMT5_BAT_MIN_CHARGE 1 /* unknown */
diff --git a/arch/arm/mach-pxa/include/mach/palmtc.h b/arch/arm/mach-pxa/include/mach/palmtc.h
index 3dc9b074ab46..3f9dd3fd4638 100644
--- a/arch/arm/mach-pxa/include/mach/palmtc.h
+++ b/arch/arm/mach-pxa/include/mach/palmtc.h
@@ -68,7 +68,7 @@
68/* BATTERY */ 68/* BATTERY */
69#define PALMTC_BAT_MAX_VOLTAGE 4000 /* 4.00V maximum voltage */ 69#define PALMTC_BAT_MAX_VOLTAGE 4000 /* 4.00V maximum voltage */
70#define PALMTC_BAT_MIN_VOLTAGE 3550 /* 3.55V critical voltage */ 70#define PALMTC_BAT_MIN_VOLTAGE 3550 /* 3.55V critical voltage */
71#define PALMTC_BAT_MAX_CURRENT 0 /* unknokn */ 71#define PALMTC_BAT_MAX_CURRENT 0 /* unknown */
72#define PALMTC_BAT_MIN_CURRENT 0 /* unknown */ 72#define PALMTC_BAT_MIN_CURRENT 0 /* unknown */
73#define PALMTC_BAT_MAX_CHARGE 1 /* unknown */ 73#define PALMTC_BAT_MAX_CHARGE 1 /* unknown */
74#define PALMTC_BAT_MIN_CHARGE 1 /* unknown */ 74#define PALMTC_BAT_MIN_CHARGE 1 /* unknown */
diff --git a/arch/arm/mach-pxa/include/mach/palmte2.h b/arch/arm/mach-pxa/include/mach/palmte2.h
index 12361341f9d8..f89e989a7637 100644
--- a/arch/arm/mach-pxa/include/mach/palmte2.h
+++ b/arch/arm/mach-pxa/include/mach/palmte2.h
@@ -59,7 +59,7 @@
59/* BATTERY */ 59/* BATTERY */
60#define PALMTE2_BAT_MAX_VOLTAGE 4000 /* 4.00v current voltage */ 60#define PALMTE2_BAT_MAX_VOLTAGE 4000 /* 4.00v current voltage */
61#define PALMTE2_BAT_MIN_VOLTAGE 3550 /* 3.55v critical voltage */ 61#define PALMTE2_BAT_MIN_VOLTAGE 3550 /* 3.55v critical voltage */
62#define PALMTE2_BAT_MAX_CURRENT 0 /* unknokn */ 62#define PALMTE2_BAT_MAX_CURRENT 0 /* unknown */
63#define PALMTE2_BAT_MIN_CURRENT 0 /* unknown */ 63#define PALMTE2_BAT_MIN_CURRENT 0 /* unknown */
64#define PALMTE2_BAT_MAX_CHARGE 1 /* unknown */ 64#define PALMTE2_BAT_MAX_CHARGE 1 /* unknown */
65#define PALMTE2_BAT_MIN_CHARGE 1 /* unknown */ 65#define PALMTE2_BAT_MIN_CHARGE 1 /* unknown */
diff --git a/arch/arm/mach-pxa/include/mach/palmtreo.h b/arch/arm/mach-pxa/include/mach/palmtreo.h
new file mode 100644
index 000000000000..2d3f14e3be29
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/palmtreo.h
@@ -0,0 +1,67 @@
1/*
2 * GPIOs and interrupts for Palm Treo smartphones
3 *
4 * currently supported:
5 * Palm Treo 680 (GSM)
6 * Palm Centro 685 (GSM)
7 *
8 * Author: Tomas Cech <sleep_walker@suse.cz>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 * find more info at www.hackndev.com
15 *
16 */
17
18#ifndef _INCLUDE_TREO_H_
19#define _INCLUDE_TREO_H_
20
21/* GPIOs */
22#define GPIO_NR_TREO_POWER_DETECT 0
23#define GPIO_NR_TREO_AMP_EN 27
24#define GPIO_NR_TREO_GREEN_LED 20
25#define GPIO_NR_TREO_RED_LED 79
26#define GPIO_NR_TREO_SD_DETECT_N 113
27#define GPIO_NR_TREO_EP_DETECT_N 116
28#define GPIO_NR_TREO_USB_DETECT 1
29#define GPIO_NR_TREO_USB_PULLUP 114
30#define GPIO_NR_TREO_GSM_POWER 40
31#define GPIO_NR_TREO_GSM_RESET 87
32#define GPIO_NR_TREO_GSM_WAKE 57
33#define GPIO_NR_TREO_GSM_HOST_WAKE 14
34#define GPIO_NR_TREO_GSM_TRIGGER 10
35#define GPIO_NR_TREO_IR_EN 115
36#define GPIO_NR_TREO_IR_TXD 47
37#define GPIO_NR_TREO_BL_POWER 38
38#define GPIO_NR_TREO_LCD_POWER 25
39
40/* Treo680 specific GPIOs */
41#ifdef CONFIG_MACH_TREO680
42#define GPIO_NR_TREO680_SD_READONLY 33
43#define GPIO_NR_TREO680_SD_POWER 42
44#define GPIO_NR_TREO680_VIBRATE_EN 44
45#define GPIO_NR_TREO680_KEYB_BL 24
46#define GPIO_NR_TREO680_BT_EN 43
47#endif /* CONFIG_MACH_TREO680 */
48
49/* Centro685 specific GPIOs */
50#define GPIO_NR_CENTRO_SD_POWER 21
51#define GPIO_NR_CENTRO_VIBRATE_EN 22
52#define GPIO_NR_CENTRO_KEYB_BL 33
53#define GPIO_NR_CENTRO_BT_EN 80
54
55/* Various addresses */
56#define TREO_PHYS_RAM_START 0xa0000000
57#define TREO_PHYS_IO_START 0x40000000
58#define TREO_STR_BASE 0xa2000000
59
60/* BACKLIGHT */
61#define TREO_MAX_INTENSITY 254
62#define TREO_DEFAULT_INTENSITY 160
63#define TREO_LIMIT_MASK 0x7F
64#define TREO_PRESCALER 63
65#define TREO_PERIOD_NS 3500
66
67#endif
diff --git a/arch/arm/mach-pxa/include/mach/palmtx.h b/arch/arm/mach-pxa/include/mach/palmtx.h
index 1be0db6ed55e..10abc4f2e8e4 100644
--- a/arch/arm/mach-pxa/include/mach/palmtx.h
+++ b/arch/arm/mach-pxa/include/mach/palmtx.h
@@ -94,7 +94,7 @@
94/* BATTERY */ 94/* BATTERY */
95#define PALMTX_BAT_MAX_VOLTAGE 4000 /* 4.00v current voltage */ 95#define PALMTX_BAT_MAX_VOLTAGE 4000 /* 4.00v current voltage */
96#define PALMTX_BAT_MIN_VOLTAGE 3550 /* 3.55v critical voltage */ 96#define PALMTX_BAT_MIN_VOLTAGE 3550 /* 3.55v critical voltage */
97#define PALMTX_BAT_MAX_CURRENT 0 /* unknokn */ 97#define PALMTX_BAT_MAX_CURRENT 0 /* unknown */
98#define PALMTX_BAT_MIN_CURRENT 0 /* unknown */ 98#define PALMTX_BAT_MIN_CURRENT 0 /* unknown */
99#define PALMTX_BAT_MAX_CHARGE 1 /* unknown */ 99#define PALMTX_BAT_MAX_CHARGE 1 /* unknown */
100#define PALMTX_BAT_MIN_CHARGE 1 /* unknown */ 100#define PALMTX_BAT_MIN_CHARGE 1 /* unknown */
diff --git a/arch/arm/mach-pxa/include/mach/palmz72.h b/arch/arm/mach-pxa/include/mach/palmz72.h
index 2806ef69ba5a..2bbcf70dd935 100644
--- a/arch/arm/mach-pxa/include/mach/palmz72.h
+++ b/arch/arm/mach-pxa/include/mach/palmz72.h
@@ -49,7 +49,7 @@
49/* Battery */ 49/* Battery */
50#define PALMZ72_BAT_MAX_VOLTAGE 4000 /* 4.00v current voltage */ 50#define PALMZ72_BAT_MAX_VOLTAGE 4000 /* 4.00v current voltage */
51#define PALMZ72_BAT_MIN_VOLTAGE 3550 /* 3.55v critical voltage */ 51#define PALMZ72_BAT_MIN_VOLTAGE 3550 /* 3.55v critical voltage */
52#define PALMZ72_BAT_MAX_CURRENT 0 /* unknokn */ 52#define PALMZ72_BAT_MAX_CURRENT 0 /* unknown */
53#define PALMZ72_BAT_MIN_CURRENT 0 /* unknown */ 53#define PALMZ72_BAT_MIN_CURRENT 0 /* unknown */
54#define PALMZ72_BAT_MAX_CHARGE 1 /* unknown */ 54#define PALMZ72_BAT_MAX_CHARGE 1 /* unknown */
55#define PALMZ72_BAT_MIN_CHARGE 1 /* unknown */ 55#define PALMZ72_BAT_MIN_CHARGE 1 /* unknown */
diff --git a/arch/arm/mach-pxa/include/mach/pcm027.h b/arch/arm/mach-pxa/include/mach/pcm027.h
index 4dcd2e8baa61..04083263167e 100644
--- a/arch/arm/mach-pxa/include/mach/pcm027.h
+++ b/arch/arm/mach-pxa/include/mach/pcm027.h
@@ -23,6 +23,13 @@
23 * Definitions of CPU card resources only 23 * Definitions of CPU card resources only
24 */ 24 */
25 25
26/* phyCORE-PXA270 (PCM027) Interrupts */
27#define PCM027_IRQ(x) (IRQ_BOARD_START + (x))
28#define PCM027_BTDET_IRQ PCM027_IRQ(0)
29#define PCM027_FF_RI_IRQ PCM027_IRQ(1)
30#define PCM027_MMCDET_IRQ PCM027_IRQ(2)
31#define PCM027_PM_5V_IRQ PCM027_IRQ(3)
32
26/* I2C RTC */ 33/* I2C RTC */
27#define PCM027_RTC_IRQ_GPIO 0 34#define PCM027_RTC_IRQ_GPIO 0
28#define PCM027_RTC_IRQ IRQ_GPIO(PCM027_RTC_IRQ_GPIO) 35#define PCM027_RTC_IRQ IRQ_GPIO(PCM027_RTC_IRQ_GPIO)
diff --git a/arch/arm/mach-pxa/include/mach/pxa3xx_nand.h b/arch/arm/mach-pxa/include/mach/pxa3xx_nand.h
deleted file mode 100644
index 3478eae32d8a..000000000000
--- a/arch/arm/mach-pxa/include/mach/pxa3xx_nand.h
+++ /dev/null
@@ -1,63 +0,0 @@
1#ifndef __ASM_ARCH_PXA3XX_NAND_H
2#define __ASM_ARCH_PXA3XX_NAND_H
3
4#include <linux/mtd/mtd.h>
5#include <linux/mtd/partitions.h>
6
7struct pxa3xx_nand_timing {
8 unsigned int tCH; /* Enable signal hold time */
9 unsigned int tCS; /* Enable signal setup time */
10 unsigned int tWH; /* ND_nWE high duration */
11 unsigned int tWP; /* ND_nWE pulse time */
12 unsigned int tRH; /* ND_nRE high duration */
13 unsigned int tRP; /* ND_nRE pulse width */
14 unsigned int tR; /* ND_nWE high to ND_nRE low for read */
15 unsigned int tWHR; /* ND_nWE high to ND_nRE low for status read */
16 unsigned int tAR; /* ND_ALE low to ND_nRE low delay */
17};
18
19struct pxa3xx_nand_cmdset {
20 uint16_t read1;
21 uint16_t read2;
22 uint16_t program;
23 uint16_t read_status;
24 uint16_t read_id;
25 uint16_t erase;
26 uint16_t reset;
27 uint16_t lock;
28 uint16_t unlock;
29 uint16_t lock_status;
30};
31
32struct pxa3xx_nand_flash {
33 const struct pxa3xx_nand_timing *timing; /* NAND Flash timing */
34 const struct pxa3xx_nand_cmdset *cmdset;
35
36 uint32_t page_per_block;/* Pages per block (PG_PER_BLK) */
37 uint32_t page_size; /* Page size in bytes (PAGE_SZ) */
38 uint32_t flash_width; /* Width of Flash memory (DWIDTH_M) */
39 uint32_t dfc_width; /* Width of flash controller(DWIDTH_C) */
40 uint32_t num_blocks; /* Number of physical blocks in Flash */
41 uint32_t chip_id;
42};
43
44struct pxa3xx_nand_platform_data {
45
46 /* the data flash bus is shared between the Static Memory
47 * Controller and the Data Flash Controller, the arbiter
48 * controls the ownership of the bus
49 */
50 int enable_arbiter;
51
52 /* allow platform code to keep OBM/bootloader defined NFC config */
53 int keep_config;
54
55 const struct mtd_partition *parts;
56 unsigned int nr_parts;
57
58 const struct pxa3xx_nand_flash * flash;
59 size_t num_flash;
60};
61
62extern void pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info);
63#endif /* __ASM_ARCH_PXA3XX_NAND_H */
diff --git a/arch/arm/mach-pxa/include/mach/pxafb.h b/arch/arm/mach-pxa/include/mach/pxafb.h
index f73061c90b5e..160ec83f51a6 100644
--- a/arch/arm/mach-pxa/include/mach/pxafb.h
+++ b/arch/arm/mach-pxa/include/mach/pxafb.h
@@ -76,7 +76,8 @@ struct pxafb_mode_info {
76 u_char bpp; 76 u_char bpp;
77 u_int cmap_greyscale:1, 77 u_int cmap_greyscale:1,
78 depth:8, 78 depth:8,
79 unused:23; 79 transparency:1,
80 unused:22;
80 81
81 /* Parallel Mode Timing */ 82 /* Parallel Mode Timing */
82 u_char hsync_len; 83 u_char hsync_len;
diff --git a/arch/arm/mach-pxa/include/mach/regs-u2d.h b/arch/arm/mach-pxa/include/mach/regs-u2d.h
new file mode 100644
index 000000000000..c15c0c57de08
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/regs-u2d.h
@@ -0,0 +1,200 @@
1#ifndef __ASM_ARCH_PXA3xx_U2D_H
2#define __ASM_ARCH_PXA3xx_U2D_H
3
4#include <mach/bitfield.h>
5
6/*
7 * USB2 device controller registers and bits definitions
8 */
9#define U2DCR (0x0000) /* U2D Control Register */
10#define U2DCR_NDC (1 << 31) /* NAK During Config */
11#define U2DCR_HSTC (0x7 << 28) /* High Speed Timeout Calibration */
12#define U2DCR_SPEOREN (1 << 27) /* Short Packet EOR INTR generation Enable */
13#define U2DCR_FSTC (0x7 << 24) /* Full Speed Timeout Calibration */
14#define U2DCR_UCLKOVR (1 << 22) /* UTM Clock Override */
15#define U2DCR_ABP (1 << 21) /* Application Bus Power */
16#define U2DCR_ADD (1 << 20) /* Application Device Disconnect */
17#define U2DCR_CC (1 << 19) /* Configuration Change */
18#define U2DCR_HS (1 << 18) /* High Speed USB Detection */
19#define U2DCR_SMAC (1 << 17) /* Switch Endpoint Memory to Active Configuration */
20#define U2DCR_DWRE (1 << 16) /* Device Remote Wake-up Feature */
21#define U2DCR_ACN (0xf << 12) /* Active U2D Configuration Number */
22#define U2DCR_AIN (0xf << 8) /* Active U2D Interface Number */
23#define U2DCR_AAISN (0xf << 4) /* Active U2D Alternate Interface Setting Number */
24#define U2DCR_EMCE (1 << 3) /* Endpoint Memory Configuration Error */
25#define U2DCR_UDR (1 << 2) /* U2D Resume */
26#define U2DCR_UDA (1 << 1) /* U2D Active */
27#define U2DCR_UDE (1 << 0) /* U2D Enable */
28
29#define U2DICR (0x0004) /* U2D Interrupt Control Register */
30#define U2DISR (0x000C) /* U2D Interrupt Status Register */
31#define U2DINT_CC (1 << 31) /* Interrupt - Configuration Change */
32#define U2DINT_SOF (1 << 30) /* Interrupt - SOF */
33#define U2DINT_USOF (1 << 29) /* Interrupt - micro SOF */
34#define U2DINT_RU (1 << 28) /* Interrupt - Resume */
35#define U2DINT_SU (1 << 27) /* Interrupt - Suspend */
36#define U2DINT_RS (1 << 26) /* Interrupt - Reset */
37#define U2DINT_DPE (1 << 25) /* Interrupt - Data Packet Error */
38#define U2DINT_FIFOERR (0x4) /* Interrupt - endpoint FIFO error */
39#define U2DINT_PACKETCMP (0x2) /* Interrupt - endpoint packet complete */
40#define U2DINT_SPACKETCMP (0x1) /* Interrupt - endpoint short packet complete */
41
42#define U2DFNR (0x0014) /* U2D Frame Number Register */
43
44#define U2DINT(n, intr) (((intr) & 0x07) << (((n) & 0x07) * 3))
45#define U2DICR2 (0x0008) /* U2D Interrupt Control Register 2 */
46#define U2DISR2 (0x0010) /* U2D Interrupt Status Register 2 */
47
48#define U2DOTGCR (0x0020) /* U2D OTG Control Register */
49#define U2DOTGCR_OTGEN (1 << 31) /* On-The-Go Enable */
50#define U2DOTGCR_AALTHNP (1 << 30) /* A-device Alternate Host Negotiation Protocal Port Support */
51#define U2DOTGCR_AHNP (1 << 29) /* A-device Host Negotiation Protocal Support */
52#define U2DOTGCR_BHNP (1 << 28) /* B-device Host Negotiation Protocal Enable */
53
54#ifdef CONFIG_CPU_PXA930
55#define U2DOTGCR_LPA (1 << 15) /* ULPI low power mode active */
56#define U2DOTGCR_IESI (1 << 13) /* OTG interrupt Enable */
57#define U2DOTGCR_ISSI (1 << 12) /* OTG interrupt status */
58#endif
59
60#define U2DOTGCR_CKAF (1 << 5) /* Carkit Mode Alternate Function Select */
61#define U2DOTGCR_UTMID (1 << 4) /* UTMI Interface Disable */
62#define U2DOTGCR_ULAF (1 << 3) /* ULPI Mode Alternate Function Select */
63#define U2DOTGCR_SMAF (1 << 2) /* Serial Mode Alternate Function Select */
64#define U2DOTGCR_RTSM (1 << 1) /* Return to Synchronous Mode (ULPI Mode) */
65#define U2DOTGCR_ULE (1 << 0) /* ULPI Wrapper Enable */
66
67#define U2DOTGICR (0x0024) /* U2D OTG Interrupt Control Register */
68#define U2DOTGISR (0x0028) /* U2D OTG Interrupt Status Register */
69
70#define U2DOTGINT_SF (1 << 17) /* OTG Set Feature Command Received */
71#define U2DOTGINT_SI (1 << 16) /* OTG Interrupt */
72#define U2DOTGINT_RLS1 (1 << 14) /* RXCMD Linestate[1] Change Interrupt Rise */
73#define U2DOTGINT_RLS0 (1 << 13) /* RXCMD Linestate[0] Change Interrupt Rise */
74#define U2DOTGINT_RID (1 << 12) /* RXCMD OTG ID Change Interrupt Rise */
75#define U2DOTGINT_RSE (1 << 11) /* RXCMD OTG Session End Interrupt Rise */
76#define U2DOTGINT_RSV (1 << 10) /* RXCMD OTG Session Valid Interrupt Rise */
77#define U2DOTGINT_RVV (1 << 9) /* RXCMD OTG Vbus Valid Interrupt Rise */
78#define U2DOTGINT_RCK (1 << 8) /* RXCMD Carkit Interrupt Rise */
79#define U2DOTGINT_FLS1 (1 << 6) /* RXCMD Linestate[1] Change Interrupt Fall */
80#define U2DOTGINT_FLS0 (1 << 5) /* RXCMD Linestate[0] Change Interrupt Fall */
81#define U2DOTGINT_FID (1 << 4) /* RXCMD OTG ID Change Interrupt Fall */
82#define U2DOTGINT_FSE (1 << 3) /* RXCMD OTG Session End Interrupt Fall */
83#define U2DOTGINT_FSV (1 << 2) /* RXCMD OTG Session Valid Interrupt Fall */
84#define U2DOTGINT_FVV (1 << 1) /* RXCMD OTG Vbus Valid Interrupt Fall */
85#define U2DOTGINT_FCK (1 << 0) /* RXCMD Carkit Interrupt Fall */
86
87#define U2DOTGUSR (0x002C) /* U2D OTG ULPI Status Register */
88#define U2DOTGUSR_LPA (1 << 31) /* ULPI Low Power Mode Active */
89#define U2DOTGUSR_S6A (1 << 30) /* ULPI Serial Mode (6-pin) Active */
90#define U2DOTGUSR_S3A (1 << 29) /* ULPI Serial Mode (3-pin) Active */
91#define U2DOTGUSR_CKA (1 << 28) /* ULPI Car Kit Mode Active */
92#define U2DOTGUSR_LS1 (1 << 6) /* RXCMD Linestate 1 Status */
93#define U2DOTGUSR_LS0 (1 << 5) /* RXCMD Linestate 0 Status */
94#define U2DOTGUSR_ID (1 << 4) /* OTG IDGnd Status */
95#define U2DOTGUSR_SE (1 << 3) /* OTG Session End Status */
96#define U2DOTGUSR_SV (1 << 2) /* OTG Session Valid Status */
97#define U2DOTGUSR_VV (1 << 1) /* OTG Vbus Valid Status */
98#define U2DOTGUSR_CK (1 << 0) /* Carkit Interrupt Status */
99
100#define U2DOTGUCR (0x0030) /* U2D OTG ULPI Control Register */
101#define U2DOTGUCR_RUN (1 << 25) /* RUN */
102#define U2DOTGUCR_RNW (1 << 24) /* Read or Write operation */
103#define U2DOTGUCR_ADDR (0x3f << 16) /* Address of the ULPI PHY register */
104#define U2DOTGUCR_WDATA (0xff << 8) /* The data for a WRITE command */
105#define U2DOTGUCR_RDATA (0xff << 0) /* The data for a READ command */
106
107#define U2DP3CR (0x0034) /* U2D Port 3 Control Register */
108#define U2DP3CR_P2SS (0x3 << 8) /* Host Port 2 Serial Mode Select */
109#define U2DP3CR_P3SS (0x7 << 4) /* Host Port 3 Serial Mode Select */
110#define U2DP3CR_VPVMBEN (0x1 << 2) /* Host Port 3 Vp/Vm Block Enable */
111#define U2DP3CR_CFG (0x3 << 0) /* Host Port 3 Configuration */
112
113#define U2DCSR0 (0x0100) /* U2D Control/Status Register - Endpoint 0 */
114#define U2DCSR0_IPA (1 << 8) /* IN Packet Adjusted */
115#define U2DCSR0_SA (1 << 7) /* SETUP Active */
116#define U2DCSR0_RNE (1 << 6) /* Receive FIFO Not Empty */
117#define U2DCSR0_FST (1 << 5) /* Force Stall */
118#define U2DCSR0_SST (1 << 4) /* Send Stall */
119#define U2DCSR0_DME (1 << 3) /* DMA Enable */
120#define U2DCSR0_FTF (1 << 2) /* Flush Transmit FIFO */
121#define U2DCSR0_IPR (1 << 1) /* IN Packet Ready */
122#define U2DCSR0_OPC (1 << 0) /* OUT Packet Complete */
123
124#define U2DCSR(x) (0x0100 + ((x) << 2)) /* U2D Control/Status Register - Endpoint x */
125#define U2DCSR_BF (1 << 10) /* Buffer Full, for OUT eps */
126#define U2DCSR_BE (1 << 10) /* Buffer Empty, for IN eps */
127#define U2DCSR_DPE (1 << 9) /* Data Packet Error, for ISO eps only */
128#define U2DCSR_FEF (1 << 8) /* Flush Endpoint FIFO */
129#define U2DCSR_SP (1 << 7) /* Short Packet Control/Status, for OUT eps only, readonly */
130#define U2DCSR_BNE (1 << 6) /* Buffer Not Empty, for OUT eps */
131#define U2DCSR_BNF (1 << 6) /* Buffer Not Full, for IN eps */
132#define U2DCSR_FST (1 << 5) /* Force STALL, write 1 set */
133#define U2DCSR_SST (1 << 4) /* Sent STALL, write 1 clear */
134#define U2DCSR_DME (1 << 3) /* DMA Enable */
135#define U2DCSR_TRN (1 << 2) /* Tx/Rx NAK, write 1 clear */
136#define U2DCSR_PC (1 << 1) /* Packet Complete, write 1 clear */
137#define U2DCSR_FS (1 << 0) /* FIFO needs Service */
138
139#define U2DBCR0 (0x0200) /* U2D Byte Count Register - Endpoint 0 */
140#define U2DBCR(x) (0x0200 + ((x) << 2)) /* U2D Byte Count Register - Endpoint x */
141
142#define U2DDR0 (0x0300) /* U2D Data Register - Endpoint 0 */
143
144#define U2DEPCR(x) (0x0400 + ((x) << 2)) /* U2D Configuration Register - Endpoint x */
145#define U2DEPCR_EE (1 << 0) /* Endpoint Enable */
146#define U2DEPCR_BS_MASK (0x3FE) /* Buffer Size, BS*8=FIFO size, max 8184B = 8KB */
147
148#define U2DSCA (0x0500) /* U2D Setup Command Address */
149#define U2DSCA_VALUE (0x0120)
150
151#define U2DEN0 (0x0504) /* U2D Endpoint Information Register - Endpoint 0 */
152#define U2DEN(x) (0x0504 + ((x) << 2)) /* U2D Endpoint Information Register - Endpoint x */
153
154/* U2DMA registers */
155#define U2DMACSR0 (0x1000) /* U2DMA Control/Status Register - Channel 0 */
156#define U2DMACSR(x) (0x1000 + ((x) << 2)) /* U2DMA Control/Status Register - Channel x */
157#define U2DMACSR_RUN (1 << 31) /* Run Bit (read / write) */
158#define U2DMACSR_STOPIRQEN (1 << 29) /* Stop Interrupt Enable (read / write) */
159#define U2DMACSR_EORIRQEN (1 << 28) /* End of Receive Interrupt Enable (R/W) */
160#define U2DMACSR_EORJMPEN (1 << 27) /* Jump to next descriptor on EOR */
161#define U2DMACSR_EORSTOPEN (1 << 26) /* STOP on an EOR */
162#define U2DMACSR_RASIRQEN (1 << 23) /* Request After Cnannel Stopped Interrupt Enable */
163#define U2DMACSR_MASKRUN (1 << 22) /* Mask Run */
164#define U2DMACSR_SCEMC (3 << 18) /* System Bus Split Completion Error Message Class */
165#define U2DMACSR_SCEMI (0x1f << 13) /* System Bus Split Completion Error Message Index */
166#define U2DMACSR_BUSERRTYPE (7 << 10) /* PX Bus Error Type */
167#define U2DMACSR_EORINTR (1 << 9) /* End Of Receive */
168#define U2DMACSR_REQPEND (1 << 8) /* Request Pending */
169#define U2DMACSR_RASINTR (1 << 4) /* Request After Channel Stopped (read / write 1 clear) */
170#define U2DMACSR_STOPINTR (1 << 3) /* Stop Interrupt (read only) */
171#define U2DMACSR_ENDINTR (1 << 2) /* End Interrupt (read / write 1 clear) */
172#define U2DMACSR_STARTINTR (1 << 1) /* Start Interrupt (read / write 1 clear) */
173#define U2DMACSR_BUSERRINTR (1 << 0) /* Bus Error Interrupt (read / write 1 clear) */
174
175#define U2DMACR (0x1080) /* U2DMA Control Register */
176#define U2DMAINT (0x10F0) /* U2DMA Interrupt Register */
177
178#define U2DMABR0 (0x1100) /* U2DMA Branch Register - Channel 0 */
179#define U2DMABR(x) (0x1100 + (x) << 2) /* U2DMA Branch Register - Channel x */
180
181#define U2DMADADR0 (0x1200) /* U2DMA Descriptor Address Register - Channel 0 */
182#define U2DMADADR(x) (0x1200 + (x) * 0x10) /* U2DMA Descriptor Address Register - Channel x */
183
184#define U2DMADADR_STOP (1U << 0)
185
186#define U2DMASADR0 (0x1204) /* U2DMA Source Address Register - Channel 0 */
187#define U2DMASADR(x) (0x1204 + (x) * 0x10) /* U2DMA Source Address Register - Channel x */
188#define U2DMATADR0 (0x1208) /* U2DMA Target Address Register - Channel 0 */
189#define U2DMATADR(x) (0x1208 + (x) * 0x10) /* U2DMA Target Address Register - Channel x */
190
191#define U2DMACMDR0 (0x120C) /* U2DMA Command Address Register - Channel 0 */
192#define U2DMACMDR(x) (0x120C + (x) * 0x10) /* U2DMA Command Address Register - Channel x */
193
194#define U2DMACMDR_XFRDIS (1 << 31) /* Transfer Direction */
195#define U2DMACMDR_STARTIRQEN (1 << 22) /* Start Interrupt Enable */
196#define U2DMACMDR_ENDIRQEN (1 << 21) /* End Interrupt Enable */
197#define U2DMACMDR_PACKCOMP (1 << 13) /* Packet Complete */
198#define U2DMACMDR_LEN (0x07ff) /* length mask (max = 2K - 1) */
199
200#endif /* __ASM_ARCH_PXA3xx_U2D_H */
diff --git a/arch/arm/mach-pxa/include/mach/ssp.h b/arch/arm/mach-pxa/include/mach/ssp.h
index cb5cb766f0f1..be1be5b6db51 100644
--- a/arch/arm/mach-pxa/include/mach/ssp.h
+++ b/arch/arm/mach-pxa/include/mach/ssp.h
@@ -46,6 +46,7 @@ struct ssp_device {
46 int drcmr_tx; 46 int drcmr_tx;
47}; 47};
48 48
49#ifdef CONFIG_PXA_SSP_LEGACY
49/* 50/*
50 * SSP initialisation flags 51 * SSP initialisation flags
51 */ 52 */
@@ -78,6 +79,7 @@ void ssp_restore_state(struct ssp_dev *dev, struct ssp_state *ssp);
78int ssp_init(struct ssp_dev *dev, u32 port, u32 init_flags); 79int ssp_init(struct ssp_dev *dev, u32 port, u32 init_flags);
79int ssp_config(struct ssp_dev *dev, u32 mode, u32 flags, u32 psp_flags, u32 speed); 80int ssp_config(struct ssp_dev *dev, u32 mode, u32 flags, u32 psp_flags, u32 speed);
80void ssp_exit(struct ssp_dev *dev); 81void ssp_exit(struct ssp_dev *dev);
82#endif /* CONFIG_PXA_SSP_LEGACY */
81 83
82/** 84/**
83 * ssp_write_reg - Write to a SSP register 85 * ssp_write_reg - Write to a SSP register
diff --git a/arch/arm/mach-pxa/include/mach/treo680.h b/arch/arm/mach-pxa/include/mach/treo680.h
deleted file mode 100644
index af443b24d99a..000000000000
--- a/arch/arm/mach-pxa/include/mach/treo680.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 * GPIOs and interrupts for Palm Treo 680 smartphone
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 */
9
10#ifndef _INCLUDE_TREO680_H_
11#define _INCLUDE_TREO680_H_
12
13/* GPIOs */
14#define GPIO_NR_TREO680_POWER_DETECT 0
15#define GPIO_NR_TREO680_AMP_EN 27
16#define GPIO_NR_TREO680_KEYB_BL 24
17#define GPIO_NR_TREO680_VIBRATE_EN 44
18#define GPIO_NR_TREO680_GREEN_LED 20
19#define GPIO_NR_TREO680_RED_LED 79
20#define GPIO_NR_TREO680_SD_DETECT_N 113
21#define GPIO_NR_TREO680_SD_READONLY 33
22#define GPIO_NR_TREO680_EP_DETECT_N 116
23#define GPIO_NR_TREO680_SD_POWER 42
24#define GPIO_NR_TREO680_USB_DETECT 1
25#define GPIO_NR_TREO680_USB_PULLUP 114
26#define GPIO_NR_TREO680_GSM_POWER 40
27#define GPIO_NR_TREO680_GSM_RESET 87
28#define GPIO_NR_TREO680_GSM_WAKE 57
29#define GPIO_NR_TREO680_GSM_HOST_WAKE 14
30#define GPIO_NR_TREO680_GSM_TRIGGER 10
31#define GPIO_NR_TREO680_BT_EN 43
32#define GPIO_NR_TREO680_IR_EN 115
33#define GPIO_NR_TREO680_IR_TXD 47
34#define GPIO_NR_TREO680_BL_POWER 38
35#define GPIO_NR_TREO680_LCD_POWER 25
36
37/* Various addresses */
38#define TREO680_PHYS_RAM_START 0xa0000000
39#define TREO680_PHYS_IO_START 0x40000000
40#define TREO680_STR_BASE 0xa2000000
41
42/* BACKLIGHT */
43#define TREO680_MAX_INTENSITY 254
44#define TREO680_DEFAULT_INTENSITY 160
45#define TREO680_LIMIT_MASK 0x7F
46#define TREO680_PRESCALER 63
47#define TREO680_PERIOD_NS 3500
48
49#endif
diff --git a/arch/arm/mach-pxa/include/mach/uncompress.h b/arch/arm/mach-pxa/include/mach/uncompress.h
index 237734b5b1be..759b851ec985 100644
--- a/arch/arm/mach-pxa/include/mach/uncompress.h
+++ b/arch/arm/mach-pxa/include/mach/uncompress.h
@@ -10,20 +10,41 @@
10 */ 10 */
11 11
12#include <linux/serial_reg.h> 12#include <linux/serial_reg.h>
13#include <mach/regs-uart.h>
14#include <asm/mach-types.h> 13#include <asm/mach-types.h>
15 14
16#define __REG(x) ((volatile unsigned long *)x) 15#define FFUART_BASE (0x40100000)
16#define BTUART_BASE (0x40200000)
17#define STUART_BASE (0x40700000)
17 18
18static volatile unsigned long *UART = FFUART; 19static unsigned long uart_base;
20static unsigned int uart_shift;
21static unsigned int uart_is_pxa;
22
23static inline unsigned char uart_read(int offset)
24{
25 return *(volatile unsigned char *)(uart_base + (offset << uart_shift));
26}
27
28static inline void uart_write(unsigned char val, int offset)
29{
30 *(volatile unsigned char *)(uart_base + (offset << uart_shift)) = val;
31}
32
33static inline int uart_is_enabled(void)
34{
35 /* assume enabled by default for non-PXA uarts */
36 return uart_is_pxa ? uart_read(UART_IER) & UART_IER_UUE : 1;
37}
19 38
20static inline void putc(char c) 39static inline void putc(char c)
21{ 40{
22 if (!(UART[UART_IER] & IER_UUE)) 41 if (!uart_is_enabled())
23 return; 42 return;
24 while (!(UART[UART_LSR] & LSR_TDRQ)) 43
44 while (!(uart_read(UART_LSR) & UART_LSR_THRE))
25 barrier(); 45 barrier();
26 UART[UART_TX] = c; 46
47 uart_write(c, UART_TX);
27} 48}
28 49
29/* 50/*
@@ -35,10 +56,21 @@ static inline void flush(void)
35 56
36static inline void arch_decomp_setup(void) 57static inline void arch_decomp_setup(void)
37{ 58{
59 /* initialize to default */
60 uart_base = FFUART_BASE;
61 uart_shift = 2;
62 uart_is_pxa = 1;
63
38 if (machine_is_littleton() || machine_is_intelmote2() 64 if (machine_is_littleton() || machine_is_intelmote2()
39 || machine_is_csb726() || machine_is_stargate2() 65 || machine_is_csb726() || machine_is_stargate2()
40 || machine_is_cm_x300() || machine_is_balloon3()) 66 || machine_is_cm_x300() || machine_is_balloon3())
41 UART = STUART; 67 uart_base = STUART_BASE;
68
69 if (machine_is_arcom_zeus()) {
70 uart_base = 0x10000000; /* nCS4 */
71 uart_shift = 1;
72 uart_is_pxa = 0;
73 }
42} 74}
43 75
44/* 76/*
diff --git a/arch/arm/mach-pxa/include/mach/viper.h b/arch/arm/mach-pxa/include/mach/viper.h
index 10988c270ca3..5f5fbf1f6489 100644
--- a/arch/arm/mach-pxa/include/mach/viper.h
+++ b/arch/arm/mach-pxa/include/mach/viper.h
@@ -85,8 +85,6 @@
85/* Interrupt and Configuration Register (VIPER_ICR) */ 85/* Interrupt and Configuration Register (VIPER_ICR) */
86/* This is a write only register. Only CF_RST is used under Linux */ 86/* This is a write only register. Only CF_RST is used under Linux */
87 87
88extern void viper_cf_rst(int state);
89
90#define VIPER_ICR_RETRIG (1 << 0) 88#define VIPER_ICR_RETRIG (1 << 0)
91#define VIPER_ICR_AUTO_CLR (1 << 1) 89#define VIPER_ICR_AUTO_CLR (1 << 1)
92#define VIPER_ICR_R_DIS (1 << 2) 90#define VIPER_ICR_R_DIS (1 << 2)
diff --git a/arch/arm/mach-pxa/include/mach/vmalloc.h b/arch/arm/mach-pxa/include/mach/vmalloc.h
index e90c5eeb81dd..bfecfbf5f460 100644
--- a/arch/arm/mach-pxa/include/mach/vmalloc.h
+++ b/arch/arm/mach-pxa/include/mach/vmalloc.h
@@ -8,4 +8,4 @@
8 * it under the terms of the GNU General Public License version 2 as 8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11#define VMALLOC_END (0xe8000000) 11#define VMALLOC_END (0xe8000000UL)
diff --git a/arch/arm/mach-pxa/include/mach/zeus.h b/arch/arm/mach-pxa/include/mach/zeus.h
new file mode 100644
index 000000000000..6e119976003e
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/zeus.h
@@ -0,0 +1,83 @@
1/*
2 * arch/arm/mach-pxa/include/mach/zeus.h
3 *
4 * Author: David Vrabel
5 * Created: Sept 28, 2005
6 * Copyright: Arcom Control Systems Ltd.
7 *
8 * Maintained by: Marc Zyngier <maz@misterjones.org>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#ifndef _MACH_ZEUS_H
16#define _MACH_ZEUS_H
17
18/* Physical addresses */
19#define ZEUS_FLASH_PHYS PXA_CS0_PHYS
20#define ZEUS_ETH0_PHYS PXA_CS1_PHYS
21#define ZEUS_ETH1_PHYS PXA_CS2_PHYS
22#define ZEUS_CPLD_PHYS (PXA_CS4_PHYS+0x2000000)
23#define ZEUS_SRAM_PHYS PXA_CS5_PHYS
24#define ZEUS_PC104IO_PHYS (0x30000000)
25
26#define ZEUS_CPLD_VERSION_PHYS (ZEUS_CPLD_PHYS + 0x00000000)
27#define ZEUS_CPLD_ISA_IRQ_PHYS (ZEUS_CPLD_PHYS + 0x00800000)
28#define ZEUS_CPLD_CONTROL_PHYS (ZEUS_CPLD_PHYS + 0x01000000)
29#define ZEUS_CPLD_EXTWDOG_PHYS (ZEUS_CPLD_PHYS + 0x01800000)
30
31/* GPIOs */
32#define ZEUS_AC97_GPIO 0
33#define ZEUS_WAKEUP_GPIO 1
34#define ZEUS_UARTA_GPIO 9
35#define ZEUS_UARTB_GPIO 10
36#define ZEUS_UARTC_GPIO 12
37#define ZEUS_UARTD_GPIO 11
38#define ZEUS_ETH0_GPIO 14
39#define ZEUS_ISA_GPIO 17
40#define ZEUS_BKLEN_GPIO 19
41#define ZEUS_USB2_PWREN_GPIO 22
42#define ZEUS_PTT_GPIO 27
43#define ZEUS_CF_CD_GPIO 35
44#define ZEUS_MMC_WP_GPIO 52
45#define ZEUS_MMC_CD_GPIO 53
46#define ZEUS_EXTGPIO_GPIO 91
47#define ZEUS_CF_PWEN_GPIO 97
48#define ZEUS_CF_RDY_GPIO 99
49#define ZEUS_LCD_EN_GPIO 101
50#define ZEUS_ETH1_GPIO 113
51#define ZEUS_CAN_GPIO 116
52
53#define ZEUS_EXT0_GPIO_BASE 128
54#define ZEUS_EXT1_GPIO_BASE 160
55#define ZEUS_USER_GPIO_BASE 192
56
57#define ZEUS_EXT0_GPIO(x) (ZEUS_EXT0_GPIO_BASE + (x))
58#define ZEUS_EXT1_GPIO(x) (ZEUS_EXT1_GPIO_BASE + (x))
59#define ZEUS_USER_GPIO(x) (ZEUS_USER_GPIO_BASE + (x))
60
61#define ZEUS_CAN_SHDN_GPIO ZEUS_EXT1_GPIO(2)
62
63/*
64 * CPLD registers:
65 * Only 4 registers, but spreaded over a 32MB address space.
66 * Be gentle, and remap that over 32kB...
67 */
68
69#define ZEUS_CPLD (0xf0000000)
70#define ZEUS_CPLD_VERSION (ZEUS_CPLD + 0x0000)
71#define ZEUS_CPLD_ISA_IRQ (ZEUS_CPLD + 0x1000)
72#define ZEUS_CPLD_CONTROL (ZEUS_CPLD + 0x2000)
73
74/* CPLD register bits */
75#define ZEUS_CPLD_CONTROL_CF_RST 0x01
76
77#define ZEUS_PC104IO (0xf1000000)
78
79#define ZEUS_SRAM_SIZE (256 * 1024)
80
81#endif
82
83
diff --git a/arch/arm/mach-pxa/include/mach/zylonite.h b/arch/arm/mach-pxa/include/mach/zylonite.h
index bf6785adccf4..9edf645368d6 100644
--- a/arch/arm/mach-pxa/include/mach/zylonite.h
+++ b/arch/arm/mach-pxa/include/mach/zylonite.h
@@ -8,13 +8,6 @@
8/* the following variables are processor specific and initialized 8/* the following variables are processor specific and initialized
9 * by the corresponding zylonite_pxa3xx_init() 9 * by the corresponding zylonite_pxa3xx_init()
10 */ 10 */
11struct platform_mmc_slot {
12 int gpio_cd;
13 int gpio_wp;
14};
15
16extern struct platform_mmc_slot zylonite_mmc_slot[];
17
18extern int gpio_eth_irq; 11extern int gpio_eth_irq;
19extern int gpio_debug_led1; 12extern int gpio_debug_led1;
20extern int gpio_debug_led2; 13extern int gpio_debug_led2;
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index 6112af431fa4..1beb40f692fc 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c
@@ -164,8 +164,11 @@ static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state)
164 saved_icmr[i] = _ICMR(irq); 164 saved_icmr[i] = _ICMR(irq);
165 _ICMR(irq) = 0; 165 _ICMR(irq) = 0;
166 } 166 }
167 for (i = 0; i < pxa_internal_irq_nr; i++) 167
168 saved_ipr[i] = IPR(i); 168 if (cpu_is_pxa27x() || cpu_is_pxa3xx()) {
169 for (i = 0; i < pxa_internal_irq_nr; i++)
170 saved_ipr[i] = IPR(i);
171 }
169 172
170 return 0; 173 return 0;
171} 174}
@@ -174,12 +177,15 @@ static int pxa_irq_resume(struct sys_device *dev)
174{ 177{
175 int i, irq = PXA_IRQ(0); 178 int i, irq = PXA_IRQ(0);
176 179
180 if (cpu_is_pxa27x() || cpu_is_pxa3xx()) {
181 for (i = 0; i < pxa_internal_irq_nr; i++)
182 IPR(i) = saved_ipr[i];
183 }
184
177 for (i = 0; irq < PXA_IRQ(pxa_internal_irq_nr); i++, irq += 32) { 185 for (i = 0; irq < PXA_IRQ(pxa_internal_irq_nr); i++, irq += 32) {
178 _ICMR(irq) = saved_icmr[i]; 186 _ICMR(irq) = saved_icmr[i];
179 _ICLR(irq) = 0; 187 _ICLR(irq) = 0;
180 } 188 }
181 for (i = 0; i < pxa_internal_irq_nr; i++)
182 IPR(i) = saved_ipr[i];
183 189
184 ICCR = 1; 190 ICCR = 1;
185 return 0; 191 return 0;
diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c
index 13848955d133..fa527b258d61 100644
--- a/arch/arm/mach-pxa/littleton.c
+++ b/arch/arm/mach-pxa/littleton.c
@@ -44,10 +44,10 @@
44#include <mach/ssp.h> 44#include <mach/ssp.h>
45#include <mach/mmc.h> 45#include <mach/mmc.h>
46#include <mach/pxa2xx_spi.h> 46#include <mach/pxa2xx_spi.h>
47#include <plat/i2c.h>
48#include <mach/pxa27x_keypad.h> 47#include <mach/pxa27x_keypad.h>
49#include <mach/pxa3xx_nand.h>
50#include <mach/littleton.h> 48#include <mach/littleton.h>
49#include <plat/i2c.h>
50#include <plat/pxa3xx_nand.h>
51 51
52#include "generic.h" 52#include "generic.h"
53 53
@@ -110,6 +110,12 @@ static mfp_cfg_t littleton_mfp_cfg[] __initdata = {
110 GPIO7_MMC1_CLK, 110 GPIO7_MMC1_CLK,
111 GPIO8_MMC1_CMD, 111 GPIO8_MMC1_CMD,
112 GPIO15_GPIO, /* card detect */ 112 GPIO15_GPIO, /* card detect */
113
114 /* UART3 */
115 GPIO107_UART3_CTS,
116 GPIO108_UART3_RTS,
117 GPIO109_UART3_TXD,
118 GPIO110_UART3_RXD,
113}; 119};
114 120
115static struct resource smc91x_resources[] = { 121static struct resource smc91x_resources[] = {
@@ -413,6 +419,10 @@ static void __init littleton_init(void)
413 /* initialize MFP configurations */ 419 /* initialize MFP configurations */
414 pxa3xx_mfp_config(ARRAY_AND_SIZE(littleton_mfp_cfg)); 420 pxa3xx_mfp_config(ARRAY_AND_SIZE(littleton_mfp_cfg));
415 421
422 pxa_set_ffuart_info(NULL);
423 pxa_set_btuart_info(NULL);
424 pxa_set_stuart_info(NULL);
425
416 /* 426 /*
417 * Note: we depend bootloader set the correct 427 * Note: we depend bootloader set the correct
418 * value to MSC register for SMC91x. 428 * value to MSC register for SMC91x.
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
index d64395f26a3e..d279507fc748 100644
--- a/arch/arm/mach-pxa/lpd270.c
+++ b/arch/arm/mach-pxa/lpd270.c
@@ -83,6 +83,10 @@ static unsigned long lpd270_pin_config[] __initdata = {
83 GPIO89_USBH1_PEN, 83 GPIO89_USBH1_PEN,
84 84
85 /* AC97 */ 85 /* AC97 */
86 GPIO28_AC97_BITCLK,
87 GPIO29_AC97_SDATA_IN_0,
88 GPIO30_AC97_SDATA_OUT,
89 GPIO31_AC97_SYNC,
86 GPIO45_AC97_SYSCLK, 90 GPIO45_AC97_SYSCLK,
87 91
88 GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH, 92 GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH,
@@ -121,7 +125,7 @@ static void lpd270_irq_handler(unsigned int irq, struct irq_desc *desc)
121 125
122 pending = __raw_readw(LPD270_INT_STATUS) & lpd270_irq_enabled; 126 pending = __raw_readw(LPD270_INT_STATUS) & lpd270_irq_enabled;
123 do { 127 do {
124 GEDR(0) = GPIO_bit(0); /* clear useless edge notification */ 128 desc->chip->ack(irq); /* clear useless edge notification */
125 if (likely(pending)) { 129 if (likely(pending)) {
126 irq = LPD270_IRQ(0) + __ffs(pending); 130 irq = LPD270_IRQ(0) + __ffs(pending);
127 generic_handle_irq(irq); 131 generic_handle_irq(irq);
@@ -455,6 +459,10 @@ static void __init lpd270_init(void)
455{ 459{
456 pxa2xx_mfp_config(ARRAY_AND_SIZE(lpd270_pin_config)); 460 pxa2xx_mfp_config(ARRAY_AND_SIZE(lpd270_pin_config));
457 461
462 pxa_set_ffuart_info(NULL);
463 pxa_set_btuart_info(NULL);
464 pxa_set_stuart_info(NULL);
465
458 lpd270_flash_data[0].width = (BOOT_DEF & 1) ? 2 : 4; 466 lpd270_flash_data[0].width = (BOOT_DEF & 1) ? 2 : 4;
459 lpd270_flash_data[1].width = 4; 467 lpd270_flash_data[1].width = 4;
460 468
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index c6a94d3fdd61..63d65a2a0387 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -66,26 +66,14 @@ static unsigned long lubbock_pin_config[] __initdata = {
66 GPIO25_SSP1_TXD, 66 GPIO25_SSP1_TXD,
67 GPIO26_SSP1_RXD, 67 GPIO26_SSP1_RXD,
68 68
69 /* AC97 */
70 GPIO28_AC97_BITCLK,
71 GPIO29_AC97_SDATA_IN_0,
72 GPIO30_AC97_SDATA_OUT,
73 GPIO31_AC97_SYNC,
74
69 /* LCD - 16bpp DSTN */ 75 /* LCD - 16bpp DSTN */
70 GPIO58_LCD_LDD_0, 76 GPIOxx_LCD_DSTN_16BPP,
71 GPIO59_LCD_LDD_1,
72 GPIO60_LCD_LDD_2,
73 GPIO61_LCD_LDD_3,
74 GPIO62_LCD_LDD_4,
75 GPIO63_LCD_LDD_5,
76 GPIO64_LCD_LDD_6,
77 GPIO65_LCD_LDD_7,
78 GPIO66_LCD_LDD_8,
79 GPIO67_LCD_LDD_9,
80 GPIO68_LCD_LDD_10,
81 GPIO69_LCD_LDD_11,
82 GPIO70_LCD_LDD_12,
83 GPIO71_LCD_LDD_13,
84 GPIO72_LCD_LDD_14,
85 GPIO73_LCD_LDD_15,
86 GPIO74_LCD_FCLK,
87 GPIO75_LCD_LCLK,
88 GPIO76_LCD_PCLK,
89 77
90 /* BTUART */ 78 /* BTUART */
91 GPIO42_BTUART_RXD, 79 GPIO42_BTUART_RXD,
@@ -158,7 +146,7 @@ static void lubbock_irq_handler(unsigned int irq, struct irq_desc *desc)
158{ 146{
159 unsigned long pending = LUB_IRQ_SET_CLR & lubbock_irq_enabled; 147 unsigned long pending = LUB_IRQ_SET_CLR & lubbock_irq_enabled;
160 do { 148 do {
161 GEDR(0) = GPIO_bit(0); /* clear our parent irq */ 149 desc->chip->ack(irq); /* clear our parent irq */
162 if (likely(pending)) { 150 if (likely(pending)) {
163 irq = LUBBOCK_IRQ(0) + __ffs(pending); 151 irq = LUBBOCK_IRQ(0) + __ffs(pending);
164 generic_handle_irq(irq); 152 generic_handle_irq(irq);
@@ -240,11 +228,18 @@ static struct resource sa1111_resources[] = {
240 }, 228 },
241}; 229};
242 230
231static struct sa1111_platform_data sa1111_info = {
232 .irq_base = IRQ_BOARD_END,
233};
234
243static struct platform_device sa1111_device = { 235static struct platform_device sa1111_device = {
244 .name = "sa1111", 236 .name = "sa1111",
245 .id = -1, 237 .id = -1,
246 .num_resources = ARRAY_SIZE(sa1111_resources), 238 .num_resources = ARRAY_SIZE(sa1111_resources),
247 .resource = sa1111_resources, 239 .resource = sa1111_resources,
240 .dev = {
241 .platform_data = &sa1111_info,
242 },
248}; 243};
249 244
250/* ADS7846 is connected through SSP ... and if your board has J5 populated, 245/* ADS7846 is connected through SSP ... and if your board has J5 populated,
@@ -518,6 +513,10 @@ static void __init lubbock_init(void)
518 513
519 pxa2xx_mfp_config(ARRAY_AND_SIZE(lubbock_pin_config)); 514 pxa2xx_mfp_config(ARRAY_AND_SIZE(lubbock_pin_config));
520 515
516 pxa_set_ffuart_info(NULL);
517 pxa_set_btuart_info(NULL);
518 pxa_set_stuart_info(NULL);
519
521 clk_add_alias("SA1111_CLK", NULL, "GPIO11_CLK", NULL); 520 clk_add_alias("SA1111_CLK", NULL, "GPIO11_CLK", NULL);
522 pxa_set_udc_info(&udc_info); 521 pxa_set_udc_info(&udc_info);
523 set_pxa_fb_info(&sharp_lm8v31); 522 set_pxa_fb_info(&sharp_lm8v31);
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 5360c07f5138..e81dd0c8e40d 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -88,26 +88,7 @@ static unsigned long magician_pin_config[] __initdata = {
88 GPIO112_MMC_CMD, 88 GPIO112_MMC_CMD,
89 89
90 /* LCD */ 90 /* LCD */
91 GPIO58_LCD_LDD_0, 91 GPIOxx_LCD_TFT_16BPP,
92 GPIO59_LCD_LDD_1,
93 GPIO60_LCD_LDD_2,
94 GPIO61_LCD_LDD_3,
95 GPIO62_LCD_LDD_4,
96 GPIO63_LCD_LDD_5,
97 GPIO64_LCD_LDD_6,
98 GPIO65_LCD_LDD_7,
99 GPIO66_LCD_LDD_8,
100 GPIO67_LCD_LDD_9,
101 GPIO68_LCD_LDD_10,
102 GPIO69_LCD_LDD_11,
103 GPIO70_LCD_LDD_12,
104 GPIO71_LCD_LDD_13,
105 GPIO72_LCD_LDD_14,
106 GPIO73_LCD_LDD_15,
107 GPIO74_LCD_FCLK,
108 GPIO75_LCD_LCLK,
109 GPIO76_LCD_PCLK,
110 GPIO77_LCD_BIAS,
111 92
112 /* QCI */ 93 /* QCI */
113 GPIO12_CIF_DD_7, 94 GPIO12_CIF_DD_7,
@@ -381,7 +362,7 @@ err:
381 return ret; 362 return ret;
382} 363}
383 364
384static int magician_backlight_notify(int brightness) 365static int magician_backlight_notify(struct device *dev, int brightness)
385{ 366{
386 gpio_set_value(EGPIO_MAGICIAN_BL_POWER, brightness); 367 gpio_set_value(EGPIO_MAGICIAN_BL_POWER, brightness);
387 if (brightness >= 200) { 368 if (brightness >= 200) {
@@ -742,6 +723,10 @@ static void __init magician_init(void)
742 723
743 pxa2xx_mfp_config(ARRAY_AND_SIZE(magician_pin_config)); 724 pxa2xx_mfp_config(ARRAY_AND_SIZE(magician_pin_config));
744 725
726 pxa_set_ffuart_info(NULL);
727 pxa_set_btuart_info(NULL);
728 pxa_set_stuart_info(NULL);
729
745 platform_add_devices(ARRAY_AND_SIZE(devices)); 730 platform_add_devices(ARRAY_AND_SIZE(devices));
746 731
747 err = gpio_request(GPIO83_MAGICIAN_nIR_EN, "nIR_EN"); 732 err = gpio_request(GPIO83_MAGICIAN_nIR_EN, "nIR_EN");
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index a4eeae345e64..5543c64da9ef 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -60,26 +60,7 @@ static unsigned long mainstone_pin_config[] = {
60 GPIO15_nCS_1, 60 GPIO15_nCS_1,
61 61
62 /* LCD - 16bpp Active TFT */ 62 /* LCD - 16bpp Active TFT */
63 GPIO58_LCD_LDD_0, 63 GPIOxx_LCD_TFT_16BPP,
64 GPIO59_LCD_LDD_1,
65 GPIO60_LCD_LDD_2,
66 GPIO61_LCD_LDD_3,
67 GPIO62_LCD_LDD_4,
68 GPIO63_LCD_LDD_5,
69 GPIO64_LCD_LDD_6,
70 GPIO65_LCD_LDD_7,
71 GPIO66_LCD_LDD_8,
72 GPIO67_LCD_LDD_9,
73 GPIO68_LCD_LDD_10,
74 GPIO69_LCD_LDD_11,
75 GPIO70_LCD_LDD_12,
76 GPIO71_LCD_LDD_13,
77 GPIO72_LCD_LDD_14,
78 GPIO73_LCD_LDD_15,
79 GPIO74_LCD_FCLK,
80 GPIO75_LCD_LCLK,
81 GPIO76_LCD_PCLK,
82 GPIO77_LCD_BIAS,
83 GPIO16_PWM0_OUT, /* Backlight */ 64 GPIO16_PWM0_OUT, /* Backlight */
84 65
85 /* MMC */ 66 /* MMC */
@@ -107,6 +88,10 @@ static unsigned long mainstone_pin_config[] = {
107 GPIO57_nIOIS16, 88 GPIO57_nIOIS16,
108 89
109 /* AC97 */ 90 /* AC97 */
91 GPIO28_AC97_BITCLK,
92 GPIO29_AC97_SDATA_IN_0,
93 GPIO30_AC97_SDATA_OUT,
94 GPIO31_AC97_SYNC,
110 GPIO45_AC97_SYSCLK, 95 GPIO45_AC97_SYSCLK,
111 96
112 /* Keypad */ 97 /* Keypad */
@@ -162,7 +147,7 @@ static void mainstone_irq_handler(unsigned int irq, struct irq_desc *desc)
162{ 147{
163 unsigned long pending = MST_INTSETCLR & mainstone_irq_enabled; 148 unsigned long pending = MST_INTSETCLR & mainstone_irq_enabled;
164 do { 149 do {
165 GEDR(0) = GPIO_bit(0); /* clear useless edge notification */ 150 desc->chip->ack(irq); /* clear useless edge notification */
166 if (likely(pending)) { 151 if (likely(pending)) {
167 irq = MAINSTONE_IRQ(0) + __ffs(pending); 152 irq = MAINSTONE_IRQ(0) + __ffs(pending);
168 generic_handle_irq(irq); 153 generic_handle_irq(irq);
@@ -576,6 +561,10 @@ static void __init mainstone_init(void)
576 561
577 pxa2xx_mfp_config(ARRAY_AND_SIZE(mainstone_pin_config)); 562 pxa2xx_mfp_config(ARRAY_AND_SIZE(mainstone_pin_config));
578 563
564 pxa_set_ffuart_info(NULL);
565 pxa_set_btuart_info(NULL);
566 pxa_set_stuart_info(NULL);
567
579 mst_flash_data[0].width = (BOOT_DEF & 1) ? 2 : 4; 568 mst_flash_data[0].width = (BOOT_DEF & 1) ? 2 : 4;
580 mst_flash_data[1].width = 4; 569 mst_flash_data[1].width = 4;
581 570
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
index 3cab452e5567..7a50ed8fce94 100644
--- a/arch/arm/mach-pxa/mioa701.c
+++ b/arch/arm/mach-pxa/mioa701.c
@@ -38,6 +38,7 @@
38#include <linux/mtd/physmap.h> 38#include <linux/mtd/physmap.h>
39#include <linux/usb/gpio_vbus.h> 39#include <linux/usb/gpio_vbus.h>
40#include <linux/regulator/max1586.h> 40#include <linux/regulator/max1586.h>
41#include <linux/slab.h>
41 42
42#include <asm/mach-types.h> 43#include <asm/mach-types.h>
43#include <asm/mach/arch.h> 44#include <asm/mach/arch.h>
@@ -86,25 +87,7 @@ static unsigned long mioa701_pin_config[] = {
86 MIO_CFG_OUT(GPIO22_USB_ENABLE, AF0, DRIVE_LOW), 87 MIO_CFG_OUT(GPIO22_USB_ENABLE, AF0, DRIVE_LOW),
87 88
88 /* LCD */ 89 /* LCD */
89 GPIO58_LCD_LDD_0, 90 GPIOxx_LCD_TFT_16BPP,
90 GPIO59_LCD_LDD_1,
91 GPIO60_LCD_LDD_2,
92 GPIO61_LCD_LDD_3,
93 GPIO62_LCD_LDD_4,
94 GPIO63_LCD_LDD_5,
95 GPIO64_LCD_LDD_6,
96 GPIO65_LCD_LDD_7,
97 GPIO66_LCD_LDD_8,
98 GPIO67_LCD_LDD_9,
99 GPIO68_LCD_LDD_10,
100 GPIO69_LCD_LDD_11,
101 GPIO70_LCD_LDD_12,
102 GPIO71_LCD_LDD_13,
103 GPIO72_LCD_LDD_14,
104 GPIO73_LCD_LDD_15,
105 GPIO74_LCD_FCLK,
106 GPIO75_LCD_LCLK,
107 GPIO76_LCD_PCLK,
108 91
109 /* QCI */ 92 /* QCI */
110 GPIO12_CIF_DD_7, 93 GPIO12_CIF_DD_7,
@@ -155,6 +138,10 @@ static unsigned long mioa701_pin_config[] = {
155 GPIO41_FFUART_RTS, 138 GPIO41_FFUART_RTS,
156 139
157 /* Sound */ 140 /* Sound */
141 GPIO28_AC97_BITCLK,
142 GPIO29_AC97_SDATA_IN_0,
143 GPIO30_AC97_SDATA_OUT,
144 GPIO31_AC97_SYNC,
158 GPIO89_AC97_SYSCLK, 145 GPIO89_AC97_SYSCLK,
159 MIO_CFG_IN(GPIO12_HPJACK_INSERT, AF0), 146 MIO_CFG_IN(GPIO12_HPJACK_INSERT, AF0),
160 147
@@ -798,6 +785,9 @@ static void __init mioa701_machine_init(void)
798 UP2OCR = UP2OCR_HXOE; 785 UP2OCR = UP2OCR_HXOE;
799 786
800 pxa2xx_mfp_config(ARRAY_AND_SIZE(mioa701_pin_config)); 787 pxa2xx_mfp_config(ARRAY_AND_SIZE(mioa701_pin_config));
788 pxa_set_ffuart_info(NULL);
789 pxa_set_btuart_info(NULL);
790 pxa_set_stuart_info(NULL);
801 mio_gpio_request(ARRAY_AND_SIZE(global_gpios)); 791 mio_gpio_request(ARRAY_AND_SIZE(global_gpios));
802 bootstrap_init(); 792 bootstrap_init();
803 set_pxa_fb_info(&mioa701_pxafb_info); 793 set_pxa_fb_info(&mioa701_pxafb_info);
diff --git a/arch/arm/mach-pxa/mp900.c b/arch/arm/mach-pxa/mp900.c
index a65713ce019e..6d4503927a76 100644
--- a/arch/arm/mach-pxa/mp900.c
+++ b/arch/arm/mach-pxa/mp900.c
@@ -84,6 +84,9 @@ static struct platform_device *devices[] __initdata = {
84static void __init mp900c_init(void) 84static void __init mp900c_init(void)
85{ 85{
86 printk(KERN_INFO "MobilePro 900/C machine init\n"); 86 printk(KERN_INFO "MobilePro 900/C machine init\n");
87 pxa_set_ffuart_info(NULL);
88 pxa_set_btuart_info(NULL);
89 pxa_set_stuart_info(NULL);
87 platform_add_devices(devices, ARRAY_SIZE(devices)); 90 platform_add_devices(devices, ARRAY_SIZE(devices));
88} 91}
89 92
diff --git a/arch/arm/mach-pxa/mxm8x10.c b/arch/arm/mach-pxa/mxm8x10.c
new file mode 100644
index 000000000000..8c9c6f0d56bb
--- /dev/null
+++ b/arch/arm/mach-pxa/mxm8x10.c
@@ -0,0 +1,474 @@
1/*
2 * linux/arch/arm/mach-pxa/mxm8x10.c
3 *
4 * Support for the Embedian MXM-8x10 Computer on Module
5 *
6 * Copyright (C) 2006 Marvell International Ltd.
7 * Copyright (C) 2009 Embedian Inc.
8 * Copyright (C) 2009 TMT Services & Supplies (Pty) Ltd.
9 *
10 * 2007-09-04: eric miao <eric.y.miao@gmail.com>
11 * rewrite to align with latest kernel
12 *
13 * 2010-01-09: Edwin Peer <epeer@tmtservices.co.za>
14 * Hennie van der Merwe <hvdmerwe@tmtservices.co.za>
15 * rework for upstream merge
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License version 2 as
19 * published by the Free Software Foundation.
20 */
21
22#include <linux/serial_8250.h>
23#include <linux/dm9000.h>
24#include <linux/gpio.h>
25
26#include <plat/i2c.h>
27#include <plat/pxa3xx_nand.h>
28
29#include <mach/pxafb.h>
30#include <mach/mmc.h>
31#include <mach/ohci.h>
32#include <mach/pxa320.h>
33
34#include <mach/mxm8x10.h>
35
36#include "devices.h"
37#include "generic.h"
38
39/* GPIO pin definition
40
41External device stuff - Leave unconfigured for now...
42---------------------
43GPIO0 - DREQ (External DMA Request)
44GPIO3 - nGCS2 (External Chip Select) Where is nGCS0; nGCS1; nGCS4; nGCS5 ?
45GPIO4 - nGCS3
46GPIO15 - EXT_GPIO1
47GPIO16 - EXT_GPIO2
48GPIO17 - EXT_GPIO3
49GPIO24 - EXT_GPIO4
50GPIO25 - EXT_GPIO5
51GPIO26 - EXT_GPIO6
52GPIO27 - EXT_GPIO7
53GPIO28 - EXT_GPIO8
54GPIO29 - EXT_GPIO9
55GPIO30 - EXT_GPIO10
56GPIO31 - EXT_GPIO11
57GPIO57 - EXT_GPIO12
58GPIO74 - EXT_IRQ1
59GPIO75 - EXT_IRQ2
60GPIO76 - EXT_IRQ3
61GPIO77 - EXT_IRQ4
62GPIO78 - EXT_IRQ5
63GPIO79 - EXT_IRQ6
64GPIO80 - EXT_IRQ7
65GPIO81 - EXT_IRQ8
66GPIO87 - VCCIO_PWREN (External Device PWREN)
67
68Dallas 1-Wire - Leave unconfigured for now...
69-------------
70GPIO0_2 - DS - 1Wire
71
72Ethernet
73--------
74GPIO1 - DM9000 PWR
75GPIO9 - DM9K_nIRQ
76GPIO36 - DM9K_RESET
77
78Keypad - Leave unconfigured by for now...
79------
80GPIO1_2 - KP_DKIN0
81GPIO5_2 - KP_MKOUT7
82GPIO82 - KP_DKIN1
83GPIO85 - KP_DKIN2
84GPIO86 - KP_DKIN3
85GPIO113 - KP_MKIN0
86GPIO114 - KP_MKIN1
87GPIO115 - KP_MKIN2
88GPIO116 - KP_MKIN3
89GPIO117 - KP_MKIN4
90GPIO118 - KP_MKIN5
91GPIO119 - KP_MKIN6
92GPIO120 - KP_MKIN7
93GPIO121 - KP_MKOUT0
94GPIO122 - KP_MKOUT1
95GPIO122 - KP_MKOUT2
96GPIO123 - KP_MKOUT3
97GPIO124 - KP_MKOUT4
98GPIO125 - KP_MKOUT5
99GPIO127 - KP_MKOUT6
100
101Data Bus - Leave unconfigured for now...
102--------
103GPIO2 - nWait (Data Bus)
104
105USB Device
106----------
107GPIO4_2 - USBD_PULLUP
108GPIO10 - UTM_CLK (USB Device UTM Clk)
109GPIO49 - USB 2.0 Device UTM_DATA0
110GPIO50 - USB 2.0 Device UTM_DATA1
111GPIO51 - USB 2.0 Device UTM_DATA2
112GPIO52 - USB 2.0 Device UTM_DATA3
113GPIO53 - USB 2.0 Device UTM_DATA4
114GPIO54 - USB 2.0 Device UTM_DATA5
115GPIO55 - USB 2.0 Device UTM_DATA6
116GPIO56 - USB 2.0 Device UTM_DATA7
117GPIO58 - UTM_RXVALID (USB 2.0 Device)
118GPIO59 - UTM_RXACTIVE (USB 2.0 Device)
119GPIO60 - UTM_RXERROR
120GPIO61 - UTM_OPMODE0
121GPIO62 - UTM_OPMODE1
122GPIO71 - USBD_INT (USB Device?)
123GPIO73 - UTM_TXREADY (USB 2.0 Device)
124GPIO83 - UTM_TXVALID (USB 2.0 Device)
125GPIO98 - UTM_RESET (USB 2.0 device)
126GPIO99 - UTM_XCVR_SELECT
127GPIO100 - UTM_TERM_SELECT
128GPIO101 - UTM_SUSPENDM_X
129GPIO102 - UTM_LINESTATE0
130GPIO103 - UTM_LINESTATE1
131
132Card-Bus Interface - Leave unconfigured for now...
133------------------
134GPIO5 - nPIOR (I/O space output enable)
135GPIO6 - nPIOW (I/O space write enable)
136GPIO7 - nIOS16 (Input from I/O space telling size of data bus)
137GPIO8 - nPWAIT (Input for inserting wait states)
138
139LCD
140---
141GPIO6_2 - LDD0
142GPIO7_2 - LDD1
143GPIO8_2 - LDD2
144GPIO9_2 - LDD3
145GPIO11_2 - LDD5
146GPIO12_2 - LDD6
147GPIO13_2 - LDD7
148GPIO14_2 - VSYNC
149GPIO15_2 - HSYNC
150GPIO16_2 - VCLK
151GPIO17_2 - HCLK
152GPIO18_2 - VDEN
153GPIO63 - LDD8 (CPU LCD)
154GPIO64 - LDD9 (CPU LCD)
155GPIO65 - LDD10 (CPU LCD)
156GPIO66 - LDD11 (CPU LCD)
157GPIO67 - LDD12 (CPU LCD)
158GPIO68 - LDD13 (CPU LCD)
159GPIO69 - LDD14 (CPU LCD)
160GPIO70 - LDD15 (CPU LCD)
161GPIO88 - VCCLCD_PWREN (LCD Panel PWREN)
162GPIO97 - BACKLIGHT_EN
163GPIO104 - LCD_PWREN
164
165PWM - Leave unconfigured for now...
166---
167GPIO11 - PWM0
168GPIO12 - PWM1
169GPIO13 - PWM2
170GPIO14 - PWM3
171
172SD-CARD
173-------
174GPIO18 - SDDATA0
175GPIO19 - SDDATA1
176GPIO20 - SDDATA2
177GPIO21 - SDDATA3
178GPIO22 - SDCLK
179GPIO23 - SDCMD
180GPIO72 - SD_WP
181GPIO84 - SD_nIRQ_CD (SD-Card)
182
183I2C
184---
185GPIO32 - I2CSCL
186GPIO33 - I2CSDA
187
188AC97
189----
190GPIO35 - AC97_SDATA_IN
191GPIO37 - AC97_SDATA_OUT
192GPIO38 - AC97_SYNC
193GPIO39 - AC97_BITCLK
194GPIO40 - AC97_nRESET
195
196UART1
197-----
198GPIO41 - UART_RXD1
199GPIO42 - UART_TXD1
200GPIO43 - UART_CTS1
201GPIO44 - UART_DCD1
202GPIO45 - UART_DSR1
203GPIO46 - UART_nRI1
204GPIO47 - UART_DTR1
205GPIO48 - UART_RTS1
206
207UART2
208-----
209GPIO109 - RTS2
210GPIO110 - RXD2
211GPIO111 - TXD2
212GPIO112 - nCTS2
213
214UART3
215-----
216GPIO105 - nCTS3
217GPIO106 - nRTS3
218GPIO107 - TXD3
219GPIO108 - RXD3
220
221SSP3 - Leave unconfigured for now...
222----
223GPIO89 - SSP3_CLK
224GPIO90 - SSP3_SFRM
225GPIO91 - SSP3_TXD
226GPIO92 - SSP3_RXD
227
228SSP4
229GPIO93 - SSP4_CLK
230GPIO94 - SSP4_SFRM
231GPIO95 - SSP4_TXD
232GPIO96 - SSP4_RXD
233*/
234
235static mfp_cfg_t mfp_cfg[] __initdata = {
236 /* USB */
237 GPIO10_UTM_CLK,
238 GPIO49_U2D_PHYDATA_0,
239 GPIO50_U2D_PHYDATA_1,
240 GPIO51_U2D_PHYDATA_2,
241 GPIO52_U2D_PHYDATA_3,
242 GPIO53_U2D_PHYDATA_4,
243 GPIO54_U2D_PHYDATA_5,
244 GPIO55_U2D_PHYDATA_6,
245 GPIO56_U2D_PHYDATA_7,
246 GPIO58_UTM_RXVALID,
247 GPIO59_UTM_RXACTIVE,
248 GPIO60_U2D_RXERROR,
249 GPIO61_U2D_OPMODE0,
250 GPIO62_U2D_OPMODE1,
251 GPIO71_GPIO, /* USBD_INT */
252 GPIO73_UTM_TXREADY,
253 GPIO83_U2D_TXVALID,
254 GPIO98_U2D_RESET,
255 GPIO99_U2D_XCVR_SEL,
256 GPIO100_U2D_TERM_SEL,
257 GPIO101_U2D_SUSPEND,
258 GPIO102_UTM_LINESTATE_0,
259 GPIO103_UTM_LINESTATE_1,
260 GPIO4_2_GPIO | MFP_PULL_HIGH, /* UTM_PULLUP */
261
262 /* DM9000 */
263 GPIO1_GPIO,
264 GPIO9_GPIO,
265 GPIO36_GPIO,
266
267 /* AC97 */
268 GPIO35_AC97_SDATA_IN_0,
269 GPIO37_AC97_SDATA_OUT,
270 GPIO38_AC97_SYNC,
271 GPIO39_AC97_BITCLK,
272 GPIO40_AC97_nACRESET,
273
274 /* UARTS */
275 GPIO41_UART1_RXD,
276 GPIO42_UART1_TXD,
277 GPIO43_UART1_CTS,
278 GPIO44_UART1_DCD,
279 GPIO45_UART1_DSR,
280 GPIO46_UART1_RI,
281 GPIO47_UART1_DTR,
282 GPIO48_UART1_RTS,
283
284 GPIO109_UART2_RTS,
285 GPIO110_UART2_RXD,
286 GPIO111_UART2_TXD,
287 GPIO112_UART2_CTS,
288
289 GPIO105_UART3_CTS,
290 GPIO106_UART3_RTS,
291 GPIO107_UART3_TXD,
292 GPIO108_UART3_RXD,
293
294 GPIO78_GPIO,
295 GPIO79_GPIO,
296 GPIO80_GPIO,
297 GPIO81_GPIO,
298
299 /* I2C */
300 GPIO32_I2C_SCL,
301 GPIO33_I2C_SDA,
302
303 /* MMC */
304 GPIO18_MMC1_DAT0,
305 GPIO19_MMC1_DAT1,
306 GPIO20_MMC1_DAT2,
307 GPIO21_MMC1_DAT3,
308 GPIO22_MMC1_CLK,
309 GPIO23_MMC1_CMD,
310 GPIO72_GPIO | MFP_PULL_HIGH, /* Card Detect */
311 GPIO84_GPIO | MFP_PULL_LOW, /* Write Protect */
312
313 /* IRQ */
314 GPIO74_GPIO | MFP_LPM_EDGE_RISE, /* EXT_IRQ1 */
315 GPIO75_GPIO | MFP_LPM_EDGE_RISE, /* EXT_IRQ2 */
316 GPIO76_GPIO | MFP_LPM_EDGE_RISE, /* EXT_IRQ3 */
317 GPIO77_GPIO | MFP_LPM_EDGE_RISE, /* EXT_IRQ4 */
318 GPIO78_GPIO | MFP_LPM_EDGE_RISE, /* EXT_IRQ5 */
319 GPIO79_GPIO | MFP_LPM_EDGE_RISE, /* EXT_IRQ6 */
320 GPIO80_GPIO | MFP_LPM_EDGE_RISE, /* EXT_IRQ7 */
321 GPIO81_GPIO | MFP_LPM_EDGE_RISE /* EXT_IRQ8 */
322};
323
324/* MMC/MCI Support */
325#if defined(CONFIG_MMC)
326static struct pxamci_platform_data mxm_8x10_mci_platform_data = {
327 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
328 .detect_delay = 1,
329 .gpio_card_detect = MXM_8X10_SD_nCD,
330 .gpio_card_ro = MXM_8X10_SD_WP,
331 .gpio_power = -1
332};
333
334void __init mxm_8x10_mmc_init(void)
335{
336 pxa_set_mci_info(&mxm_8x10_mci_platform_data);
337}
338#endif
339
340/* USB Open Host Controler Interface */
341static struct pxaohci_platform_data mxm_8x10_ohci_platform_data = {
342 .port_mode = PMM_NPS_MODE,
343 .flags = ENABLE_PORT_ALL
344};
345
346void __init mxm_8x10_usb_host_init(void)
347{
348 pxa_set_ohci_info(&mxm_8x10_ohci_platform_data);
349}
350
351/* AC97 Sound Support */
352static struct platform_device mxm_8x10_ac97_device = {
353 .name = "pxa2xx-ac97"
354};
355
356void __init mxm_8x10_ac97_init(void)
357{
358 platform_device_register(&mxm_8x10_ac97_device);
359}
360
361/* NAND flash Support */
362#if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE)
363#define NAND_BLOCK_SIZE SZ_128K
364#define NB(x) (NAND_BLOCK_SIZE * (x))
365static struct mtd_partition mxm_8x10_nand_partitions[] = {
366 [0] = {
367 .name = "boot",
368 .size = NB(0x002),
369 .offset = NB(0x000),
370 .mask_flags = MTD_WRITEABLE
371 },
372 [1] = {
373 .name = "kernel",
374 .size = NB(0x010),
375 .offset = NB(0x002),
376 .mask_flags = MTD_WRITEABLE
377 },
378 [2] = {
379 .name = "root",
380 .size = NB(0x36c),
381 .offset = NB(0x012)
382 },
383 [3] = {
384 .name = "bbt",
385 .size = NB(0x082),
386 .offset = NB(0x37e),
387 .mask_flags = MTD_WRITEABLE
388 }
389};
390
391static struct pxa3xx_nand_platform_data mxm_8x10_nand_info = {
392 .enable_arbiter = 1,
393 .keep_config = 1,
394 .parts = mxm_8x10_nand_partitions,
395 .nr_parts = ARRAY_SIZE(mxm_8x10_nand_partitions)
396};
397
398static void __init mxm_8x10_nand_init(void)
399{
400 pxa3xx_set_nand_info(&mxm_8x10_nand_info);
401}
402#else
403static inline void mxm_8x10_nand_init(void) {}
404#endif /* CONFIG_MTD_NAND_PXA3xx || CONFIG_MTD_NAND_PXA3xx_MODULE */
405
406/* Ethernet support: Davicom DM9000 */
407static struct resource dm9k_resources[] = {
408 [0] = {
409 .start = MXM_8X10_ETH_PHYS + 0x300,
410 .end = MXM_8X10_ETH_PHYS + 0x300,
411 .flags = IORESOURCE_MEM
412 },
413 [1] = {
414 .start = MXM_8X10_ETH_PHYS + 0x308,
415 .end = MXM_8X10_ETH_PHYS + 0x308,
416 .flags = IORESOURCE_MEM
417 },
418 [2] = {
419 .start = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO9)),
420 .end = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO9)),
421 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE
422 }
423};
424
425static struct dm9000_plat_data dm9k_plat_data = {
426 .flags = DM9000_PLATF_16BITONLY
427};
428
429static struct platform_device dm9k_device = {
430 .name = "dm9000",
431 .id = 0,
432 .num_resources = ARRAY_SIZE(dm9k_resources),
433 .resource = dm9k_resources,
434 .dev = {
435 .platform_data = &dm9k_plat_data
436 }
437};
438
439static void __init mxm_8x10_ethernet_init(void)
440{
441 platform_device_register(&dm9k_device);
442}
443
444/* PXA UARTs */
445static void __init mxm_8x10_uarts_init(void)
446{
447 pxa_set_ffuart_info(NULL);
448 pxa_set_btuart_info(NULL);
449 pxa_set_stuart_info(NULL);
450}
451
452/* I2C and Real Time Clock */
453static struct i2c_board_info __initdata mxm_8x10_i2c_devices[] = {
454 {
455 I2C_BOARD_INFO("ds1337", 0x68)
456 }
457};
458
459static void __init mxm_8x10_i2c_init(void)
460{
461 i2c_register_board_info(0, mxm_8x10_i2c_devices,
462 ARRAY_SIZE(mxm_8x10_i2c_devices));
463 pxa_set_i2c_info(NULL);
464}
465
466void __init mxm_8x10_barebones_init(void)
467{
468 pxa3xx_mfp_config(ARRAY_AND_SIZE(mfp_cfg));
469
470 mxm_8x10_uarts_init();
471 mxm_8x10_nand_init();
472 mxm_8x10_i2c_init();
473 mxm_8x10_ethernet_init();
474}
diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c
index 1ad029dd4438..f70c75b38769 100644
--- a/arch/arm/mach-pxa/palmld.c
+++ b/arch/arm/mach-pxa/palmld.c
@@ -83,26 +83,7 @@ static unsigned long palmld_pin_config[] __initdata = {
83 GPIO105_KP_MKOUT_2, 83 GPIO105_KP_MKOUT_2,
84 84
85 /* LCD */ 85 /* LCD */
86 GPIO58_LCD_LDD_0, 86 GPIOxx_LCD_TFT_16BPP,
87 GPIO59_LCD_LDD_1,
88 GPIO60_LCD_LDD_2,
89 GPIO61_LCD_LDD_3,
90 GPIO62_LCD_LDD_4,
91 GPIO63_LCD_LDD_5,
92 GPIO64_LCD_LDD_6,
93 GPIO65_LCD_LDD_7,
94 GPIO66_LCD_LDD_8,
95 GPIO67_LCD_LDD_9,
96 GPIO68_LCD_LDD_10,
97 GPIO69_LCD_LDD_11,
98 GPIO70_LCD_LDD_12,
99 GPIO71_LCD_LDD_13,
100 GPIO72_LCD_LDD_14,
101 GPIO73_LCD_LDD_15,
102 GPIO74_LCD_FCLK,
103 GPIO75_LCD_LCLK,
104 GPIO76_LCD_PCLK,
105 GPIO77_LCD_BIAS,
106 87
107 /* PWM */ 88 /* PWM */
108 GPIO16_PWM0_OUT, 89 GPIO16_PWM0_OUT,
@@ -270,7 +251,7 @@ err:
270 return ret; 251 return ret;
271} 252}
272 253
273static int palmld_backlight_notify(int brightness) 254static int palmld_backlight_notify(struct device *dev, int brightness)
274{ 255{
275 gpio_set_value(GPIO_NR_PALMLD_BL_POWER, brightness); 256 gpio_set_value(GPIO_NR_PALMLD_BL_POWER, brightness);
276 gpio_set_value(GPIO_NR_PALMLD_LCD_POWER, brightness); 257 gpio_set_value(GPIO_NR_PALMLD_LCD_POWER, brightness);
@@ -530,6 +511,10 @@ static void __init palmld_init(void)
530{ 511{
531 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmld_pin_config)); 512 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmld_pin_config));
532 513
514 pxa_set_ffuart_info(NULL);
515 pxa_set_btuart_info(NULL);
516 pxa_set_stuart_info(NULL);
517
533 palmld_pm_init(); 518 palmld_pm_init();
534 set_pxa_fb_info(&palmld_lcd_screen); 519 set_pxa_fb_info(&palmld_lcd_screen);
535 pxa_set_mci_info(&palmld_mci_platform_data); 520 pxa_set_mci_info(&palmld_mci_platform_data);
diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c
index 2dd7ce28556b..d902a813aae3 100644
--- a/arch/arm/mach-pxa/palmt5.c
+++ b/arch/arm/mach-pxa/palmt5.c
@@ -87,26 +87,7 @@ static unsigned long palmt5_pin_config[] __initdata = {
87 GPIO105_KP_MKOUT_2, 87 GPIO105_KP_MKOUT_2,
88 88
89 /* LCD */ 89 /* LCD */
90 GPIO58_LCD_LDD_0, 90 GPIOxx_LCD_TFT_16BPP,
91 GPIO59_LCD_LDD_1,
92 GPIO60_LCD_LDD_2,
93 GPIO61_LCD_LDD_3,
94 GPIO62_LCD_LDD_4,
95 GPIO63_LCD_LDD_5,
96 GPIO64_LCD_LDD_6,
97 GPIO65_LCD_LDD_7,
98 GPIO66_LCD_LDD_8,
99 GPIO67_LCD_LDD_9,
100 GPIO68_LCD_LDD_10,
101 GPIO69_LCD_LDD_11,
102 GPIO70_LCD_LDD_12,
103 GPIO71_LCD_LDD_13,
104 GPIO72_LCD_LDD_14,
105 GPIO73_LCD_LDD_15,
106 GPIO74_LCD_FCLK,
107 GPIO75_LCD_LCLK,
108 GPIO76_LCD_PCLK,
109 GPIO77_LCD_BIAS,
110 91
111 /* PWM */ 92 /* PWM */
112 GPIO16_PWM0_OUT, 93 GPIO16_PWM0_OUT,
@@ -209,7 +190,7 @@ err:
209 return ret; 190 return ret;
210} 191}
211 192
212static int palmt5_backlight_notify(int brightness) 193static int palmt5_backlight_notify(struct device *dev, int brightness)
213{ 194{
214 gpio_set_value(GPIO_NR_PALMT5_BL_POWER, brightness); 195 gpio_set_value(GPIO_NR_PALMT5_BL_POWER, brightness);
215 gpio_set_value(GPIO_NR_PALMT5_LCD_POWER, brightness); 196 gpio_set_value(GPIO_NR_PALMT5_LCD_POWER, brightness);
@@ -419,6 +400,10 @@ static void __init palmt5_init(void)
419{ 400{
420 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmt5_pin_config)); 401 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmt5_pin_config));
421 402
403 pxa_set_ffuart_info(NULL);
404 pxa_set_btuart_info(NULL);
405 pxa_set_stuart_info(NULL);
406
422 palmt5_pm_init(); 407 palmt5_pm_init();
423 set_pxa_fb_info(&palmt5_lcd_screen); 408 set_pxa_fb_info(&palmt5_lcd_screen);
424 pxa_set_mci_info(&palmt5_mci_platform_data); 409 pxa_set_mci_info(&palmt5_mci_platform_data);
diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c
index 0b92291a58f6..717d7a638675 100644
--- a/arch/arm/mach-pxa/palmtc.c
+++ b/arch/arm/mach-pxa/palmtc.c
@@ -84,26 +84,7 @@ static unsigned long palmtc_pin_config[] __initdata = {
84 GPIO36_GPIO, /* pullup */ 84 GPIO36_GPIO, /* pullup */
85 85
86 /* LCD */ 86 /* LCD */
87 GPIO58_LCD_LDD_0, 87 GPIOxx_LCD_TFT_16BPP,
88 GPIO59_LCD_LDD_1,
89 GPIO60_LCD_LDD_2,
90 GPIO61_LCD_LDD_3,
91 GPIO62_LCD_LDD_4,
92 GPIO63_LCD_LDD_5,
93 GPIO64_LCD_LDD_6,
94 GPIO65_LCD_LDD_7,
95 GPIO66_LCD_LDD_8,
96 GPIO67_LCD_LDD_9,
97 GPIO68_LCD_LDD_10,
98 GPIO69_LCD_LDD_11,
99 GPIO70_LCD_LDD_12,
100 GPIO71_LCD_LDD_13,
101 GPIO72_LCD_LDD_14,
102 GPIO73_LCD_LDD_15,
103 GPIO74_LCD_FCLK,
104 GPIO75_LCD_LCLK,
105 GPIO76_LCD_PCLK,
106 GPIO77_LCD_BIAS,
107 88
108 /* MATRIX KEYPAD */ 89 /* MATRIX KEYPAD */
109 GPIO0_GPIO | WAKEUP_ON_EDGE_BOTH, /* in 0 */ 90 GPIO0_GPIO | WAKEUP_ON_EDGE_BOTH, /* in 0 */
@@ -185,7 +166,7 @@ err:
185 return ret; 166 return ret;
186} 167}
187 168
188static int palmtc_backlight_notify(int brightness) 169static int palmtc_backlight_notify(struct device *dev, int brightness)
189{ 170{
190 /* backlight is on when GPIO16 AF0 is high */ 171 /* backlight is on when GPIO16 AF0 is high */
191 gpio_set_value(GPIO_NR_PALMTC_BL_POWER, brightness); 172 gpio_set_value(GPIO_NR_PALMTC_BL_POWER, brightness);
@@ -416,6 +397,11 @@ static void __init palmtc_init(void)
416{ 397{
417 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtc_pin_config)); 398 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtc_pin_config));
418 399
400 pxa_set_ffuart_info(NULL);
401 pxa_set_btuart_info(NULL);
402 pxa_set_stuart_info(NULL);
403 pxa_set_hwuart_info(NULL);
404
419 set_pxa_fb_info(&palmtc_lcd_screen); 405 set_pxa_fb_info(&palmtc_lcd_screen);
420 pxa_set_mci_info(&palmtc_mci_platform_data); 406 pxa_set_mci_info(&palmtc_mci_platform_data);
421 pxa_set_udc_info(&palmtc_udc_info); 407 pxa_set_udc_info(&palmtc_udc_info);
diff --git a/arch/arm/mach-pxa/palmte2.c b/arch/arm/mach-pxa/palmte2.c
index 277c4062e3c6..3d284ff1a64e 100644
--- a/arch/arm/mach-pxa/palmte2.c
+++ b/arch/arm/mach-pxa/palmte2.c
@@ -73,26 +73,7 @@ static unsigned long palmte2_pin_config[] __initdata = {
73 GPIO47_FICP_TXD, 73 GPIO47_FICP_TXD,
74 74
75 /* LCD */ 75 /* LCD */
76 GPIO58_LCD_LDD_0, 76 GPIOxx_LCD_TFT_16BPP,
77 GPIO59_LCD_LDD_1,
78 GPIO60_LCD_LDD_2,
79 GPIO61_LCD_LDD_3,
80 GPIO62_LCD_LDD_4,
81 GPIO63_LCD_LDD_5,
82 GPIO64_LCD_LDD_6,
83 GPIO65_LCD_LDD_7,
84 GPIO66_LCD_LDD_8,
85 GPIO67_LCD_LDD_9,
86 GPIO68_LCD_LDD_10,
87 GPIO69_LCD_LDD_11,
88 GPIO70_LCD_LDD_12,
89 GPIO71_LCD_LDD_13,
90 GPIO72_LCD_LDD_14,
91 GPIO73_LCD_LDD_15,
92 GPIO74_LCD_FCLK,
93 GPIO75_LCD_LCLK,
94 GPIO76_LCD_PCLK,
95 GPIO77_LCD_BIAS,
96 77
97 /* GPIO KEYS */ 78 /* GPIO KEYS */
98 GPIO5_GPIO, /* notes */ 79 GPIO5_GPIO, /* notes */
@@ -181,7 +162,7 @@ err:
181 return ret; 162 return ret;
182} 163}
183 164
184static int palmte2_backlight_notify(int brightness) 165static int palmte2_backlight_notify(struct device *dev, int brightness)
185{ 166{
186 gpio_set_value(GPIO_NR_PALMTE2_BL_POWER, brightness); 167 gpio_set_value(GPIO_NR_PALMTE2_BL_POWER, brightness);
187 gpio_set_value(GPIO_NR_PALMTE2_LCD_POWER, brightness); 168 gpio_set_value(GPIO_NR_PALMTE2_LCD_POWER, brightness);
@@ -373,6 +354,10 @@ static void __init palmte2_init(void)
373{ 354{
374 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmte2_pin_config)); 355 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmte2_pin_config));
375 356
357 pxa_set_ffuart_info(NULL);
358 pxa_set_btuart_info(NULL);
359 pxa_set_stuart_info(NULL);
360
376 set_pxa_fb_info(&palmte2_lcd_screen); 361 set_pxa_fb_info(&palmte2_lcd_screen);
377 pxa_set_mci_info(&palmte2_mci_platform_data); 362 pxa_set_mci_info(&palmte2_mci_platform_data);
378 palmte2_udc_init(); 363 palmte2_udc_init();
diff --git a/arch/arm/mach-pxa/treo680.c b/arch/arm/mach-pxa/palmtreo.c
index fe085076fbf2..d8b4469607a1 100644
--- a/arch/arm/mach-pxa/treo680.c
+++ b/arch/arm/mach-pxa/palmtreo.c
@@ -1,5 +1,9 @@
1/* 1/*
2 * Hardware definitions for Palm Treo 680 2 * Hardware definitions for Palm Treo smartphones
3 *
4 * currently supported:
5 * Palm Treo 680 (GSM)
6 * Palm Centro 685 (GSM)
3 * 7 *
4 * Author: Tomas Cech <sleep_walker@suse.cz> 8 * Author: Tomas Cech <sleep_walker@suse.cz>
5 * 9 *
@@ -31,7 +35,7 @@
31#include <mach/pxa27x.h> 35#include <mach/pxa27x.h>
32#include <mach/pxa27x-udc.h> 36#include <mach/pxa27x-udc.h>
33#include <mach/audio.h> 37#include <mach/audio.h>
34#include <mach/treo680.h> 38#include <mach/palmtreo.h>
35#include <mach/mmc.h> 39#include <mach/mmc.h>
36#include <mach/pxafb.h> 40#include <mach/pxafb.h>
37#include <mach/irda.h> 41#include <mach/irda.h>
@@ -50,7 +54,7 @@
50/****************************************************************************** 54/******************************************************************************
51 * Pin configuration 55 * Pin configuration
52 ******************************************************************************/ 56 ******************************************************************************/
53static unsigned long treo680_pin_config[] __initdata = { 57static unsigned long treo_pin_config[] __initdata = {
54 /* MMC */ 58 /* MMC */
55 GPIO32_MMC_CLK, 59 GPIO32_MMC_CLK,
56 GPIO92_MMC_DAT_0, 60 GPIO92_MMC_DAT_0,
@@ -58,7 +62,6 @@ static unsigned long treo680_pin_config[] __initdata = {
58 GPIO110_MMC_DAT_2, 62 GPIO110_MMC_DAT_2,
59 GPIO111_MMC_DAT_3, 63 GPIO111_MMC_DAT_3,
60 GPIO112_MMC_CMD, 64 GPIO112_MMC_CMD,
61 GPIO33_GPIO, /* SD read only */
62 GPIO113_GPIO, /* SD detect */ 65 GPIO113_GPIO, /* SD detect */
63 66
64 /* AC97 */ 67 /* AC97 */
@@ -80,12 +83,10 @@ static unsigned long treo680_pin_config[] __initdata = {
80 GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH, /* usb detect */ 83 GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH, /* usb detect */
81 84
82 /* MATRIX KEYPAD */ 85 /* MATRIX KEYPAD */
83 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
84 GPIO101_KP_MKIN_1, 86 GPIO101_KP_MKIN_1,
85 GPIO102_KP_MKIN_2, 87 GPIO102_KP_MKIN_2,
86 GPIO97_KP_MKIN_3, 88 GPIO97_KP_MKIN_3,
87 GPIO98_KP_MKIN_4, 89 GPIO98_KP_MKIN_4,
88 GPIO99_KP_MKIN_5,
89 GPIO91_KP_MKIN_6, 90 GPIO91_KP_MKIN_6,
90 GPIO13_KP_MKIN_7, 91 GPIO13_KP_MKIN_7,
91 GPIO103_KP_MKOUT_0 | MFP_LPM_DRIVE_HIGH, 92 GPIO103_KP_MKOUT_0 | MFP_LPM_DRIVE_HIGH,
@@ -98,25 +99,7 @@ static unsigned long treo680_pin_config[] __initdata = {
98 GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH, /* Hotsync button */ 99 GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH, /* Hotsync button */
99 100
100 /* LCD */ 101 /* LCD */
101 GPIO58_LCD_LDD_0, 102 GPIOxx_LCD_TFT_16BPP,
102 GPIO59_LCD_LDD_1,
103 GPIO60_LCD_LDD_2,
104 GPIO61_LCD_LDD_3,
105 GPIO62_LCD_LDD_4,
106 GPIO63_LCD_LDD_5,
107 GPIO64_LCD_LDD_6,
108 GPIO65_LCD_LDD_7,
109 GPIO66_LCD_LDD_8,
110 GPIO67_LCD_LDD_9,
111 GPIO68_LCD_LDD_10,
112 GPIO69_LCD_LDD_11,
113 GPIO70_LCD_LDD_12,
114 GPIO71_LCD_LDD_13,
115 GPIO72_LCD_LDD_14,
116 GPIO73_LCD_LDD_15,
117 GPIO74_LCD_FCLK,
118 GPIO75_LCD_LCLK,
119 GPIO76_LCD_PCLK,
120 103
121 /* Quick Capture Interface */ 104 /* Quick Capture Interface */
122 GPIO84_CIF_FV, 105 GPIO84_CIF_FV,
@@ -150,19 +133,57 @@ static unsigned long treo680_pin_config[] __initdata = {
150 GPIO11_GPIO | WAKEUP_ON_EDGE_BOTH, /* bluetooth host wake up */ 133 GPIO11_GPIO | WAKEUP_ON_EDGE_BOTH, /* bluetooth host wake up */
151}; 134};
152 135
136#ifdef CONFIG_MACH_TREO680
137static unsigned long treo680_pin_config[] __initdata = {
138 GPIO33_GPIO, /* SD read only */
139
140 /* MATRIX KEYPAD - different wake up source */
141 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
142 GPIO99_KP_MKIN_5,
143};
144#endif /* CONFIG_MACH_TREO680 */
145
146#ifdef CONFIG_MACH_CENTRO
147static unsigned long centro685_pin_config[] __initdata = {
148 /* Bluetooth attached to BT UART*/
149 MFP_CFG_OUT(GPIO80, AF0, DRIVE_LOW), /* power: LOW = off */
150 GPIO42_BTUART_RXD,
151 GPIO43_BTUART_TXD,
152 GPIO44_BTUART_CTS,
153 GPIO45_BTUART_RTS,
154
155 /* MATRIX KEYPAD - different wake up source */
156 GPIO100_KP_MKIN_0,
157 GPIO99_KP_MKIN_5 | WAKEUP_ON_LEVEL_HIGH,
158};
159#endif /* CONFIG_MACH_CENTRO */
160
153/****************************************************************************** 161/******************************************************************************
154 * SD/MMC card controller 162 * SD/MMC card controller
155 ******************************************************************************/ 163 ******************************************************************************/
164#ifdef CONFIG_MACH_TREO680
156static struct pxamci_platform_data treo680_mci_platform_data = { 165static struct pxamci_platform_data treo680_mci_platform_data = {
157 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, 166 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
158 .gpio_card_detect = GPIO_NR_TREO680_SD_DETECT_N, 167 .gpio_card_detect = GPIO_NR_TREO_SD_DETECT_N,
159 .gpio_card_ro = GPIO_NR_TREO680_SD_READONLY, 168 .gpio_card_ro = GPIO_NR_TREO680_SD_READONLY,
160 .gpio_power = GPIO_NR_TREO680_SD_POWER, 169 .gpio_power = GPIO_NR_TREO680_SD_POWER,
161}; 170};
171#endif /* CONFIG_MACH_TREO680 */
172
173#ifdef CONFIG_MACH_CENTRO
174static struct pxamci_platform_data centro_mci_platform_data = {
175 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
176 .gpio_card_detect = GPIO_NR_TREO_SD_DETECT_N,
177 .gpio_card_ro = -1,
178 .gpio_power = GPIO_NR_CENTRO_SD_POWER,
179 .gpio_power_invert = 1,
180};
181#endif /* CONFIG_MACH_CENTRO */
162 182
163/****************************************************************************** 183/******************************************************************************
164 * GPIO keyboard 184 * GPIO keyboard
165 ******************************************************************************/ 185 ******************************************************************************/
186#ifdef CONFIG_MACH_TREO680
166static unsigned int treo680_matrix_keys[] = { 187static unsigned int treo680_matrix_keys[] = {
167 KEY(0, 0, KEY_F8), /* Red/Off/Power */ 188 KEY(0, 0, KEY_F8), /* Red/Off/Power */
168 KEY(0, 1, KEY_LEFT), 189 KEY(0, 1, KEY_LEFT),
@@ -232,92 +253,167 @@ static struct pxa27x_keypad_platform_data treo680_keypad_platform_data = {
232 253
233 .debounce_interval = 30, 254 .debounce_interval = 30,
234}; 255};
256#endif /* CONFIG_MACH_TREO680 */
257
258#ifdef CONFIG_MACH_CENTRO
259static unsigned int centro_matrix_keys[] = {
260 KEY(0, 0, KEY_F9), /* Home */
261 KEY(0, 1, KEY_LEFT),
262 KEY(0, 2, KEY_LEFTCTRL), /* Alternate */
263 KEY(0, 3, KEY_L),
264 KEY(0, 4, KEY_A),
265 KEY(0, 5, KEY_Q),
266 KEY(0, 6, KEY_P),
267
268 KEY(1, 0, KEY_RIGHTCTRL), /* Menu */
269 KEY(1, 1, KEY_RIGHT),
270 KEY(1, 2, KEY_LEFTSHIFT), /* Left shift */
271 KEY(1, 3, KEY_Z),
272 KEY(1, 4, KEY_S),
273 KEY(1, 5, KEY_W),
274
275 KEY(2, 0, KEY_F1), /* Phone */
276 KEY(2, 1, KEY_UP),
277 KEY(2, 2, KEY_0),
278 KEY(2, 3, KEY_X),
279 KEY(2, 4, KEY_D),
280 KEY(2, 5, KEY_E),
281
282 KEY(3, 0, KEY_F10), /* Calendar */
283 KEY(3, 1, KEY_DOWN),
284 KEY(3, 2, KEY_SPACE),
285 KEY(3, 3, KEY_C),
286 KEY(3, 4, KEY_F),
287 KEY(3, 5, KEY_R),
288
289 KEY(4, 0, KEY_F12), /* Mail */
290 KEY(4, 1, KEY_KPENTER),
291 KEY(4, 2, KEY_RIGHTALT), /* Alt */
292 KEY(4, 3, KEY_V),
293 KEY(4, 4, KEY_G),
294 KEY(4, 5, KEY_T),
295
296 KEY(5, 0, KEY_F8), /* Red/Off/Power */
297 KEY(5, 1, KEY_PAGEUP), /* Side up */
298 KEY(5, 2, KEY_DOT),
299 KEY(5, 3, KEY_B),
300 KEY(5, 4, KEY_H),
301 KEY(5, 5, KEY_Y),
302
303 KEY(6, 0, KEY_TAB), /* Side Activate */
304 KEY(6, 1, KEY_PAGEDOWN), /* Side down */
305 KEY(6, 2, KEY_ENTER),
306 KEY(6, 3, KEY_N),
307 KEY(6, 4, KEY_J),
308 KEY(6, 5, KEY_U),
309
310 KEY(7, 0, KEY_F6), /* Green/Call */
311 KEY(7, 1, KEY_O),
312 KEY(7, 2, KEY_BACKSPACE),
313 KEY(7, 3, KEY_M),
314 KEY(7, 4, KEY_K),
315 KEY(7, 5, KEY_I),
316};
317
318static struct pxa27x_keypad_platform_data centro_keypad_platform_data = {
319 .matrix_key_rows = 8,
320 .matrix_key_cols = 7,
321 .matrix_key_map = centro_matrix_keys,
322 .matrix_key_map_size = ARRAY_SIZE(centro_matrix_keys),
323 .direct_key_map = { KEY_CONNECT },
324 .direct_key_num = 1,
325
326 .debounce_interval = 30,
327};
328#endif /* CONFIG_MACH_CENTRO */
235 329
236/****************************************************************************** 330/******************************************************************************
237 * aSoC audio 331 * aSoC audio
238 ******************************************************************************/ 332 ******************************************************************************/
239 333
240static pxa2xx_audio_ops_t treo680_ac97_pdata = { 334static pxa2xx_audio_ops_t treo_ac97_pdata = {
241 .reset_gpio = 95, 335 .reset_gpio = 95,
242}; 336};
243 337
244/****************************************************************************** 338/******************************************************************************
245 * Backlight 339 * Backlight
246 ******************************************************************************/ 340 ******************************************************************************/
247static int treo680_backlight_init(struct device *dev) 341static int treo_backlight_init(struct device *dev)
248{ 342{
249 int ret; 343 int ret;
250 344
251 ret = gpio_request(GPIO_NR_TREO680_BL_POWER, "BL POWER"); 345 ret = gpio_request(GPIO_NR_TREO_BL_POWER, "BL POWER");
252 if (ret) 346 if (ret)
253 goto err; 347 goto err;
254 ret = gpio_direction_output(GPIO_NR_TREO680_BL_POWER, 0); 348 ret = gpio_direction_output(GPIO_NR_TREO_BL_POWER, 0);
255 if (ret) 349 if (ret)
256 goto err2; 350 goto err2;
257 351
258 return 0; 352 return 0;
259 353
260err2: 354err2:
261 gpio_free(GPIO_NR_TREO680_BL_POWER); 355 gpio_free(GPIO_NR_TREO_BL_POWER);
262err: 356err:
263 return ret; 357 return ret;
264} 358}
265 359
266static int treo680_backlight_notify(int brightness) 360static int treo_backlight_notify(struct device *dev, int brightness)
267{ 361{
268 gpio_set_value(GPIO_NR_TREO680_BL_POWER, brightness); 362 gpio_set_value(GPIO_NR_TREO_BL_POWER, brightness);
269 return TREO680_MAX_INTENSITY - brightness; 363 return TREO_MAX_INTENSITY - brightness;
270}; 364};
271 365
272static void treo680_backlight_exit(struct device *dev) 366static void treo_backlight_exit(struct device *dev)
273{ 367{
274 gpio_free(GPIO_NR_TREO680_BL_POWER); 368 gpio_free(GPIO_NR_TREO_BL_POWER);
275} 369}
276 370
277static struct platform_pwm_backlight_data treo680_backlight_data = { 371static struct platform_pwm_backlight_data treo_backlight_data = {
278 .pwm_id = 0, 372 .pwm_id = 0,
279 .max_brightness = TREO680_MAX_INTENSITY, 373 .max_brightness = TREO_MAX_INTENSITY,
280 .dft_brightness = TREO680_DEFAULT_INTENSITY, 374 .dft_brightness = TREO_DEFAULT_INTENSITY,
281 .pwm_period_ns = TREO680_PERIOD_NS, 375 .pwm_period_ns = TREO_PERIOD_NS,
282 .init = treo680_backlight_init, 376 .init = treo_backlight_init,
283 .notify = treo680_backlight_notify, 377 .notify = treo_backlight_notify,
284 .exit = treo680_backlight_exit, 378 .exit = treo_backlight_exit,
285}; 379};
286 380
287static struct platform_device treo680_backlight = { 381static struct platform_device treo_backlight = {
288 .name = "pwm-backlight", 382 .name = "pwm-backlight",
289 .dev = { 383 .dev = {
290 .parent = &pxa27x_device_pwm0.dev, 384 .parent = &pxa27x_device_pwm0.dev,
291 .platform_data = &treo680_backlight_data, 385 .platform_data = &treo_backlight_data,
292 }, 386 },
293}; 387};
294 388
295/****************************************************************************** 389/******************************************************************************
296 * IrDA 390 * IrDA
297 ******************************************************************************/ 391 ******************************************************************************/
298static struct pxaficp_platform_data treo680_ficp_info = { 392static struct pxaficp_platform_data treo_ficp_info = {
299 .gpio_pwdown = GPIO_NR_TREO680_IR_EN, 393 .gpio_pwdown = GPIO_NR_TREO_IR_EN,
300 .transceiver_cap = IR_SIRMODE | IR_OFF, 394 .transceiver_cap = IR_SIRMODE | IR_OFF,
301}; 395};
302 396
303/****************************************************************************** 397/******************************************************************************
304 * UDC 398 * UDC
305 ******************************************************************************/ 399 ******************************************************************************/
306static struct pxa2xx_udc_mach_info treo680_udc_info __initdata = { 400static struct pxa2xx_udc_mach_info treo_udc_info __initdata = {
307 .gpio_vbus = GPIO_NR_TREO680_USB_DETECT, 401 .gpio_vbus = GPIO_NR_TREO_USB_DETECT,
308 .gpio_vbus_inverted = 1, 402 .gpio_vbus_inverted = 1,
309 .gpio_pullup = GPIO_NR_TREO680_USB_PULLUP, 403 .gpio_pullup = GPIO_NR_TREO_USB_PULLUP,
310}; 404};
311 405
312 406
313/****************************************************************************** 407/******************************************************************************
314 * USB host 408 * USB host
315 ******************************************************************************/ 409 ******************************************************************************/
410#ifdef CONFIG_MACH_TREO680
316static struct pxaohci_platform_data treo680_ohci_info = { 411static struct pxaohci_platform_data treo680_ohci_info = {
317 .port_mode = PMM_PERPORT_MODE, 412 .port_mode = PMM_PERPORT_MODE,
318 .flags = ENABLE_PORT1 | ENABLE_PORT3, 413 .flags = ENABLE_PORT1 | ENABLE_PORT3,
319 .power_budget = 0, 414 .power_budget = 0,
320}; 415};
416#endif /* CONFIG_MACH_TREO680 */
321 417
322/****************************************************************************** 418/******************************************************************************
323 * Power supply 419 * Power supply
@@ -326,41 +422,41 @@ static int power_supply_init(struct device *dev)
326{ 422{
327 int ret; 423 int ret;
328 424
329 ret = gpio_request(GPIO_NR_TREO680_POWER_DETECT, "CABLE_STATE_AC"); 425 ret = gpio_request(GPIO_NR_TREO_POWER_DETECT, "CABLE_STATE_AC");
330 if (ret) 426 if (ret)
331 goto err1; 427 goto err1;
332 ret = gpio_direction_input(GPIO_NR_TREO680_POWER_DETECT); 428 ret = gpio_direction_input(GPIO_NR_TREO_POWER_DETECT);
333 if (ret) 429 if (ret)
334 goto err2; 430 goto err2;
335 431
336 return 0; 432 return 0;
337 433
338err2: 434err2:
339 gpio_free(GPIO_NR_TREO680_POWER_DETECT); 435 gpio_free(GPIO_NR_TREO_POWER_DETECT);
340err1: 436err1:
341 return ret; 437 return ret;
342} 438}
343 439
344static int treo680_is_ac_online(void) 440static int treo_is_ac_online(void)
345{ 441{
346 return gpio_get_value(GPIO_NR_TREO680_POWER_DETECT); 442 return gpio_get_value(GPIO_NR_TREO_POWER_DETECT);
347} 443}
348 444
349static void power_supply_exit(struct device *dev) 445static void power_supply_exit(struct device *dev)
350{ 446{
351 gpio_free(GPIO_NR_TREO680_POWER_DETECT); 447 gpio_free(GPIO_NR_TREO_POWER_DETECT);
352} 448}
353 449
354static char *treo680_supplicants[] = { 450static char *treo_supplicants[] = {
355 "main-battery", 451 "main-battery",
356}; 452};
357 453
358static struct pda_power_pdata power_supply_info = { 454static struct pda_power_pdata power_supply_info = {
359 .init = power_supply_init, 455 .init = power_supply_init,
360 .is_ac_online = treo680_is_ac_online, 456 .is_ac_online = treo_is_ac_online,
361 .exit = power_supply_exit, 457 .exit = power_supply_exit,
362 .supplied_to = treo680_supplicants, 458 .supplied_to = treo_supplicants,
363 .num_supplicants = ARRAY_SIZE(treo680_supplicants), 459 .num_supplicants = ARRAY_SIZE(treo_supplicants),
364}; 460};
365 461
366static struct platform_device power_supply = { 462static struct platform_device power_supply = {
@@ -374,7 +470,8 @@ static struct platform_device power_supply = {
374/****************************************************************************** 470/******************************************************************************
375 * Vibra and LEDs 471 * Vibra and LEDs
376 ******************************************************************************/ 472 ******************************************************************************/
377static struct gpio_led gpio_leds[] = { 473#ifdef CONFIG_MACH_TREO680
474static struct gpio_led treo680_gpio_leds[] = {
378 { 475 {
379 .name = "treo680:vibra:vibra", 476 .name = "treo680:vibra:vibra",
380 .default_trigger = "none", 477 .default_trigger = "none",
@@ -383,34 +480,68 @@ static struct gpio_led gpio_leds[] = {
383 { 480 {
384 .name = "treo680:green:led", 481 .name = "treo680:green:led",
385 .default_trigger = "mmc0", 482 .default_trigger = "mmc0",
386 .gpio = GPIO_NR_TREO680_GREEN_LED, 483 .gpio = GPIO_NR_TREO_GREEN_LED,
387 }, 484 },
388 { 485 {
389 .name = "treo680:keybbl:keybbl", 486 .name = "treo680:white:keybbl",
390 .default_trigger = "none", 487 .default_trigger = "none",
391 .gpio = GPIO_NR_TREO680_KEYB_BL, 488 .gpio = GPIO_NR_TREO680_KEYB_BL,
392 }, 489 },
393}; 490};
394 491
395static struct gpio_led_platform_data gpio_led_info = { 492static struct gpio_led_platform_data treo680_gpio_led_info = {
396 .leds = gpio_leds, 493 .leds = treo680_gpio_leds,
397 .num_leds = ARRAY_SIZE(gpio_leds), 494 .num_leds = ARRAY_SIZE(treo680_gpio_leds),
398}; 495};
399 496
400static struct platform_device treo680_leds = { 497static struct platform_device treo680_leds = {
401 .name = "leds-gpio", 498 .name = "leds-gpio",
402 .id = -1, 499 .id = -1,
403 .dev = { 500 .dev = {
404 .platform_data = &gpio_led_info, 501 .platform_data = &treo680_gpio_led_info,
405 } 502 }
406}; 503};
504#endif /* CONFIG_MACH_TREO680 */
407 505
506#ifdef CONFIG_MACH_CENTRO
507static struct gpio_led centro_gpio_leds[] = {
508 {
509 .name = "centro:vibra:vibra",
510 .default_trigger = "none",
511 .gpio = GPIO_NR_CENTRO_VIBRATE_EN,
512 },
513 {
514 .name = "centro:green:led",
515 .default_trigger = "mmc0",
516 .gpio = GPIO_NR_TREO_GREEN_LED,
517 },
518 {
519 .name = "centro:white:keybbl",
520 .default_trigger = "none",
521 .active_low = 1,
522 .gpio = GPIO_NR_CENTRO_KEYB_BL,
523 },
524};
525
526static struct gpio_led_platform_data centro_gpio_led_info = {
527 .leds = centro_gpio_leds,
528 .num_leds = ARRAY_SIZE(centro_gpio_leds),
529};
530
531static struct platform_device centro_leds = {
532 .name = "leds-gpio",
533 .id = -1,
534 .dev = {
535 .platform_data = &centro_gpio_led_info,
536 }
537};
538#endif /* CONFIG_MACH_CENTRO */
408 539
409/****************************************************************************** 540/******************************************************************************
410 * Framebuffer 541 * Framebuffer
411 ******************************************************************************/ 542 ******************************************************************************/
412/* TODO: add support for 324x324 */ 543/* TODO: add support for 324x324 */
413static struct pxafb_mode_info treo680_lcd_modes[] = { 544static struct pxafb_mode_info treo_lcd_modes[] = {
414{ 545{
415 .pixclock = 86538, 546 .pixclock = 86538,
416 .xres = 320, 547 .xres = 320,
@@ -427,21 +558,21 @@ static struct pxafb_mode_info treo680_lcd_modes[] = {
427}, 558},
428}; 559};
429 560
430static void treo680_lcd_power(int on, struct fb_var_screeninfo *info) 561static void treo_lcd_power(int on, struct fb_var_screeninfo *info)
431{ 562{
432 gpio_set_value(GPIO_NR_TREO680_BL_POWER, on); 563 gpio_set_value(GPIO_NR_TREO_BL_POWER, on);
433} 564}
434 565
435static struct pxafb_mach_info treo680_lcd_screen = { 566static struct pxafb_mach_info treo_lcd_screen = {
436 .modes = treo680_lcd_modes, 567 .modes = treo_lcd_modes,
437 .num_modes = ARRAY_SIZE(treo680_lcd_modes), 568 .num_modes = ARRAY_SIZE(treo_lcd_modes),
438 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, 569 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
439}; 570};
440 571
441/****************************************************************************** 572/******************************************************************************
442 * Power management - standby 573 * Power management - standby
443 ******************************************************************************/ 574 ******************************************************************************/
444static void __init treo680_pm_init(void) 575static void __init treo_pm_init(void)
445{ 576{
446 static u32 resume[] = { 577 static u32 resume[] = {
447 0xe3a00101, /* mov r0, #0x40000000 */ 578 0xe3a00101, /* mov r0, #0x40000000 */
@@ -450,70 +581,118 @@ static void __init treo680_pm_init(void)
450 }; 581 };
451 582
452 /* this is where the bootloader jumps */ 583 /* this is where the bootloader jumps */
453 memcpy(phys_to_virt(TREO680_STR_BASE), resume, sizeof(resume)); 584 memcpy(phys_to_virt(TREO_STR_BASE), resume, sizeof(resume));
454} 585}
455 586
456/****************************************************************************** 587/******************************************************************************
457 * Machine init 588 * Machine init
458 ******************************************************************************/ 589 ******************************************************************************/
459static struct platform_device *devices[] __initdata = { 590static struct platform_device *treo_devices[] __initdata = {
460 &treo680_backlight, 591 &treo_backlight,
461 &treo680_leds,
462 &power_supply, 592 &power_supply,
463}; 593};
464 594
595#ifdef CONFIG_MACH_TREO680
596static struct platform_device *treo680_devices[] __initdata = {
597 &treo680_leds,
598};
599#endif /* CONFIG_MACH_TREO680 */
600
601#ifdef CONFIG_MACH_CENTRO
602static struct platform_device *centro_devices[] __initdata = {
603 &centro_leds,
604};
605#endif /* CONFIG_MACH_CENTRO */
606
465/* setup udc GPIOs initial state */ 607/* setup udc GPIOs initial state */
466static void __init treo680_udc_init(void) 608static void __init treo_udc_init(void)
467{ 609{
468 if (!gpio_request(GPIO_NR_TREO680_USB_PULLUP, "UDC Vbus")) { 610 if (!gpio_request(GPIO_NR_TREO_USB_PULLUP, "UDC Vbus")) {
469 gpio_direction_output(GPIO_NR_TREO680_USB_PULLUP, 1); 611 gpio_direction_output(GPIO_NR_TREO_USB_PULLUP, 1);
470 gpio_free(GPIO_NR_TREO680_USB_PULLUP); 612 gpio_free(GPIO_NR_TREO_USB_PULLUP);
471 } 613 }
472} 614}
473 615
474static void __init treo680_lcd_power_init(void) 616static void __init treo_lcd_power_init(void)
475{ 617{
476 int ret; 618 int ret;
477 619
478 ret = gpio_request(GPIO_NR_TREO680_LCD_POWER, "LCD POWER"); 620 ret = gpio_request(GPIO_NR_TREO_LCD_POWER, "LCD POWER");
479 if (ret) { 621 if (ret) {
480 pr_err("Treo680: LCD power GPIO request failed!\n"); 622 pr_err("Treo680: LCD power GPIO request failed!\n");
481 return; 623 return;
482 } 624 }
483 625
484 ret = gpio_direction_output(GPIO_NR_TREO680_LCD_POWER, 0); 626 ret = gpio_direction_output(GPIO_NR_TREO_LCD_POWER, 0);
485 if (ret) { 627 if (ret) {
486 pr_err("Treo680: setting LCD power GPIO direction failed!\n"); 628 pr_err("Treo680: setting LCD power GPIO direction failed!\n");
487 gpio_free(GPIO_NR_TREO680_LCD_POWER); 629 gpio_free(GPIO_NR_TREO_LCD_POWER);
488 return; 630 return;
489 } 631 }
490 632
491 treo680_lcd_screen.pxafb_lcd_power = treo680_lcd_power; 633 treo_lcd_screen.pxafb_lcd_power = treo_lcd_power;
492} 634}
493 635
636static void __init treo_init(void)
637{
638 pxa_set_ffuart_info(NULL);
639 pxa_set_btuart_info(NULL);
640 pxa_set_stuart_info(NULL);
641
642 treo_pm_init();
643 pxa2xx_mfp_config(ARRAY_AND_SIZE(treo_pin_config));
644 treo_lcd_power_init();
645 set_pxa_fb_info(&treo_lcd_screen);
646 treo_udc_init();
647 pxa_set_udc_info(&treo_udc_info);
648 pxa_set_ac97_info(&treo_ac97_pdata);
649 pxa_set_ficp_info(&treo_ficp_info);
650
651 platform_add_devices(ARRAY_AND_SIZE(treo_devices));
652}
653
654#ifdef CONFIG_MACH_TREO680
494static void __init treo680_init(void) 655static void __init treo680_init(void)
495{ 656{
496 treo680_pm_init(); 657 treo_init();
497 pxa2xx_mfp_config(ARRAY_AND_SIZE(treo680_pin_config)); 658 pxa2xx_mfp_config(ARRAY_AND_SIZE(treo680_pin_config));
498 pxa_set_keypad_info(&treo680_keypad_platform_data);
499 treo680_lcd_power_init();
500 set_pxa_fb_info(&treo680_lcd_screen);
501 pxa_set_mci_info(&treo680_mci_platform_data); 659 pxa_set_mci_info(&treo680_mci_platform_data);
502 treo680_udc_init(); 660 pxa_set_keypad_info(&treo680_keypad_platform_data);
503 pxa_set_udc_info(&treo680_udc_info);
504 pxa_set_ac97_info(&treo680_ac97_pdata);
505 pxa_set_ficp_info(&treo680_ficp_info);
506 pxa_set_ohci_info(&treo680_ohci_info); 661 pxa_set_ohci_info(&treo680_ohci_info);
507 662
508 platform_add_devices(devices, ARRAY_SIZE(devices)); 663 platform_add_devices(ARRAY_AND_SIZE(treo680_devices));
509} 664}
510 665
511MACHINE_START(TREO680, "Palm Treo 680") 666MACHINE_START(TREO680, "Palm Treo 680")
512 .phys_io = TREO680_PHYS_IO_START, 667 .phys_io = TREO_PHYS_IO_START,
513 .io_pg_offst = io_p2v(0x40000000), 668 .io_pg_offst = io_p2v(0x40000000),
514 .boot_params = 0xa0000100, 669 .boot_params = 0xa0000100,
515 .map_io = pxa_map_io, 670 .map_io = pxa_map_io,
516 .init_irq = pxa27x_init_irq, 671 .init_irq = pxa27x_init_irq,
517 .timer = &pxa_timer, 672 .timer = &pxa_timer,
518 .init_machine = treo680_init, 673 .init_machine = treo680_init,
674MACHINE_END
675#endif /* CONFIG_MACH_TREO680 */
676
677#ifdef CONFIG_MACH_CENTRO
678static void __init centro_init(void)
679{
680 treo_init();
681 pxa2xx_mfp_config(ARRAY_AND_SIZE(centro685_pin_config));
682 pxa_set_mci_info(&centro_mci_platform_data);
683
684 pxa_set_keypad_info(&centro_keypad_platform_data);
685
686 platform_add_devices(ARRAY_AND_SIZE(centro_devices));
687}
688
689MACHINE_START(CENTRO, "Palm Centro 685")
690 .phys_io = TREO_PHYS_IO_START,
691 .io_pg_offst = io_p2v(0x40000000),
692 .boot_params = 0xa0000100,
693 .map_io = pxa_map_io,
694 .init_irq = pxa27x_init_irq,
695 .timer = &pxa_timer,
696 .init_machine = centro_init,
519MACHINE_END 697MACHINE_END
698#endif /* CONFIG_MACH_CENTRO */
diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c
index 76a2b37eaf30..007b58c11f8d 100644
--- a/arch/arm/mach-pxa/palmtx.c
+++ b/arch/arm/mach-pxa/palmtx.c
@@ -110,26 +110,7 @@ static unsigned long palmtx_pin_config[] __initdata = {
110 GPIO105_KP_MKOUT_2, 110 GPIO105_KP_MKOUT_2,
111 111
112 /* LCD */ 112 /* LCD */
113 GPIO58_LCD_LDD_0, 113 GPIOxx_LCD_TFT_16BPP,
114 GPIO59_LCD_LDD_1,
115 GPIO60_LCD_LDD_2,
116 GPIO61_LCD_LDD_3,
117 GPIO62_LCD_LDD_4,
118 GPIO63_LCD_LDD_5,
119 GPIO64_LCD_LDD_6,
120 GPIO65_LCD_LDD_7,
121 GPIO66_LCD_LDD_8,
122 GPIO67_LCD_LDD_9,
123 GPIO68_LCD_LDD_10,
124 GPIO69_LCD_LDD_11,
125 GPIO70_LCD_LDD_12,
126 GPIO71_LCD_LDD_13,
127 GPIO72_LCD_LDD_14,
128 GPIO73_LCD_LDD_15,
129 GPIO74_LCD_FCLK,
130 GPIO75_LCD_LCLK,
131 GPIO76_LCD_PCLK,
132 GPIO77_LCD_BIAS,
133 114
134 /* FFUART */ 115 /* FFUART */
135 GPIO34_FFUART_RXD, 116 GPIO34_FFUART_RXD,
@@ -269,7 +250,7 @@ err:
269 return ret; 250 return ret;
270} 251}
271 252
272static int palmtx_backlight_notify(int brightness) 253static int palmtx_backlight_notify(struct device *dev, int brightness)
273{ 254{
274 gpio_set_value(GPIO_NR_PALMTX_BL_POWER, brightness); 255 gpio_set_value(GPIO_NR_PALMTX_BL_POWER, brightness);
275 gpio_set_value(GPIO_NR_PALMTX_LCD_POWER, brightness); 256 gpio_set_value(GPIO_NR_PALMTX_LCD_POWER, brightness);
@@ -570,6 +551,10 @@ static void __init palmtx_init(void)
570{ 551{
571 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtx_pin_config)); 552 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtx_pin_config));
572 553
554 pxa_set_ffuart_info(NULL);
555 pxa_set_btuart_info(NULL);
556 pxa_set_stuart_info(NULL);
557
573 palmtx_pm_init(); 558 palmtx_pm_init();
574 set_pxa_fb_info(&palmtx_lcd_screen); 559 set_pxa_fb_info(&palmtx_lcd_screen);
575 pxa_set_mci_info(&palmtx_mci_platform_data); 560 pxa_set_mci_info(&palmtx_mci_platform_data);
diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c
index c2bf493c5f53..3a7925ca3944 100644
--- a/arch/arm/mach-pxa/palmz72.c
+++ b/arch/arm/mach-pxa/palmz72.c
@@ -95,26 +95,8 @@ static unsigned long palmz72_pin_config[] __initdata = {
95 GPIO105_KP_MKOUT_2, 95 GPIO105_KP_MKOUT_2,
96 96
97 /* LCD */ 97 /* LCD */
98 GPIO58_LCD_LDD_0, 98 GPIOxx_LCD_TFT_16BPP,
99 GPIO59_LCD_LDD_1, 99
100 GPIO60_LCD_LDD_2,
101 GPIO61_LCD_LDD_3,
102 GPIO62_LCD_LDD_4,
103 GPIO63_LCD_LDD_5,
104 GPIO64_LCD_LDD_6,
105 GPIO65_LCD_LDD_7,
106 GPIO66_LCD_LDD_8,
107 GPIO67_LCD_LDD_9,
108 GPIO68_LCD_LDD_10,
109 GPIO69_LCD_LDD_11,
110 GPIO70_LCD_LDD_12,
111 GPIO71_LCD_LDD_13,
112 GPIO72_LCD_LDD_14,
113 GPIO73_LCD_LDD_15,
114 GPIO74_LCD_FCLK,
115 GPIO75_LCD_LCLK,
116 GPIO76_LCD_PCLK,
117 GPIO77_LCD_BIAS,
118 GPIO20_GPIO, /* bl power */ 100 GPIO20_GPIO, /* bl power */
119 GPIO21_GPIO, /* LCD border switch */ 101 GPIO21_GPIO, /* LCD border switch */
120 GPIO22_GPIO, /* LCD border color */ 102 GPIO22_GPIO, /* LCD border color */
@@ -196,7 +178,7 @@ err:
196 return ret; 178 return ret;
197} 179}
198 180
199static int palmz72_backlight_notify(int brightness) 181static int palmz72_backlight_notify(struct device *dev, int brightness)
200{ 182{
201 gpio_set_value(GPIO_NR_PALMZ72_BL_POWER, brightness); 183 gpio_set_value(GPIO_NR_PALMZ72_BL_POWER, brightness);
202 gpio_set_value(GPIO_NR_PALMZ72_LCD_POWER, brightness); 184 gpio_set_value(GPIO_NR_PALMZ72_LCD_POWER, brightness);
@@ -491,6 +473,10 @@ static void __init palmz72_init(void)
491{ 473{
492 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmz72_pin_config)); 474 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmz72_pin_config));
493 475
476 pxa_set_ffuart_info(NULL);
477 pxa_set_btuart_info(NULL);
478 pxa_set_stuart_info(NULL);
479
494 set_pxa_fb_info(&palmz72_lcd_screen); 480 set_pxa_fb_info(&palmz72_lcd_screen);
495 pxa_set_mci_info(&palmz72_mci_platform_data); 481 pxa_set_mci_info(&palmz72_mci_platform_data);
496 palmz72_udc_init(); 482 palmz72_udc_init();
diff --git a/arch/arm/mach-pxa/pcm027.c b/arch/arm/mach-pxa/pcm027.c
index 6abfa2979c61..2190af066470 100644
--- a/arch/arm/mach-pxa/pcm027.c
+++ b/arch/arm/mach-pxa/pcm027.c
@@ -227,6 +227,10 @@ static void __init pcm027_init(void)
227 227
228 pxa2xx_mfp_config(pcm027_pin_config, ARRAY_SIZE(pcm027_pin_config)); 228 pxa2xx_mfp_config(pcm027_pin_config, ARRAY_SIZE(pcm027_pin_config));
229 229
230 pxa_set_ffuart_info(NULL);
231 pxa_set_btuart_info(NULL);
232 pxa_set_stuart_info(NULL);
233
230 platform_add_devices(devices, ARRAY_SIZE(devices)); 234 platform_add_devices(devices, ARRAY_SIZE(devices));
231 235
232 /* at last call the baseboard to initialize itself */ 236 /* at last call the baseboard to initialize itself */
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index bbda57078e0f..9d0ecea1760c 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -58,6 +58,12 @@ static unsigned long pcm990_pin_config[] __initdata = {
58 /* I2C */ 58 /* I2C */
59 GPIO117_I2C_SCL, 59 GPIO117_I2C_SCL,
60 GPIO118_I2C_SDA, 60 GPIO118_I2C_SDA,
61
62 /* AC97 */
63 GPIO28_AC97_BITCLK,
64 GPIO29_AC97_SDATA_IN_0,
65 GPIO30_AC97_SDATA_OUT,
66 GPIO31_AC97_SYNC,
61}; 67};
62 68
63/* 69/*
@@ -259,8 +265,7 @@ static void pcm990_irq_handler(unsigned int irq, struct irq_desc *desc)
259 unsigned long pending = (~PCM990_INTSETCLR) & pcm990_irq_enabled; 265 unsigned long pending = (~PCM990_INTSETCLR) & pcm990_irq_enabled;
260 266
261 do { 267 do {
262 GEDR(PCM990_CTRL_INT_IRQ_GPIO) = 268 desc->chip->ack(irq); /* clear our parent IRQ */
263 GPIO_bit(PCM990_CTRL_INT_IRQ_GPIO);
264 if (likely(pending)) { 269 if (likely(pending)) {
265 irq = PCM027_IRQ(0) + __ffs(pending); 270 irq = PCM027_IRQ(0) + __ffs(pending);
266 generic_handle_irq(irq); 271 generic_handle_irq(irq);
@@ -359,19 +364,12 @@ static unsigned long pcm990_camera_pin_config[] = {
359 GPIO44_CIF_LV, 364 GPIO44_CIF_LV,
360}; 365};
361 366
362static int pcm990_pxacamera_init(struct device *dev)
363{
364 pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_camera_pin_config));
365 return 0;
366}
367
368/* 367/*
369 * CICR4: PCLK_EN: Pixel clock is supplied by the sensor 368 * CICR4: PCLK_EN: Pixel clock is supplied by the sensor
370 * MCLK_EN: Master clock is generated by PXA 369 * MCLK_EN: Master clock is generated by PXA
371 * PCP: Data sampled on the falling edge of pixel clock 370 * PCP: Data sampled on the falling edge of pixel clock
372 */ 371 */
373struct pxacamera_platform_data pcm990_pxacamera_platform_data = { 372struct pxacamera_platform_data pcm990_pxacamera_platform_data = {
374 .init = pcm990_pxacamera_init,
375 .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 | PXA_CAMERA_DATAWIDTH_10 | 373 .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 | PXA_CAMERA_DATAWIDTH_10 |
376 PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN/* | PXA_CAMERA_PCP*/, 374 PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN/* | PXA_CAMERA_PCP*/,
377 .mclk_10khz = 1000, 375 .mclk_10khz = 1000,
@@ -532,6 +530,7 @@ void __init pcm990_baseboard_init(void)
532 pxa_set_ac97_info(NULL); 530 pxa_set_ac97_info(NULL);
533 531
534#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE) 532#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
533 pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_camera_pin_config));
535 pxa_set_camera_info(&pcm990_pxacamera_platform_data); 534 pxa_set_camera_info(&pcm990_pxacamera_platform_data);
536 535
537 i2c_register_board_info(0, ARRAY_AND_SIZE(pcm990_i2c_devices)); 536 i2c_register_board_info(0, ARRAY_AND_SIZE(pcm990_i2c_devices));
diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c
index 7693355ee637..166c15f62916 100644
--- a/arch/arm/mach-pxa/pm.c
+++ b/arch/arm/mach-pxa/pm.c
@@ -14,6 +14,7 @@
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/suspend.h> 15#include <linux/suspend.h>
16#include <linux/errno.h> 16#include <linux/errno.h>
17#include <linux/slab.h>
17 18
18#include <mach/pm.h> 19#include <mach/pm.h>
19 20
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index a186994f77fb..d58a52415d75 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -91,26 +91,7 @@ static unsigned long poodle_pin_config[] __initdata = {
91 GPIO35_FFUART_CTS, 91 GPIO35_FFUART_CTS,
92 92
93 /* LCD */ 93 /* LCD */
94 GPIO58_LCD_LDD_0, 94 GPIOxx_LCD_TFT_16BPP,
95 GPIO59_LCD_LDD_1,
96 GPIO60_LCD_LDD_2,
97 GPIO61_LCD_LDD_3,
98 GPIO62_LCD_LDD_4,
99 GPIO63_LCD_LDD_5,
100 GPIO64_LCD_LDD_6,
101 GPIO65_LCD_LDD_7,
102 GPIO66_LCD_LDD_8,
103 GPIO67_LCD_LDD_9,
104 GPIO68_LCD_LDD_10,
105 GPIO69_LCD_LDD_11,
106 GPIO70_LCD_LDD_12,
107 GPIO71_LCD_LDD_13,
108 GPIO72_LCD_LDD_14,
109 GPIO73_LCD_LDD_15,
110 GPIO74_LCD_FCLK,
111 GPIO75_LCD_LCLK,
112 GPIO76_LCD_PCLK,
113 GPIO77_LCD_BIAS,
114 95
115 /* PC Card */ 96 /* PC Card */
116 GPIO48_nPOE, 97 GPIO48_nPOE,
@@ -193,11 +174,18 @@ static struct resource locomo_resources[] = {
193 }, 174 },
194}; 175};
195 176
177static struct locomo_platform_data locomo_info = {
178 .irq_base = IRQ_BOARD_START,
179};
180
196struct platform_device poodle_locomo_device = { 181struct platform_device poodle_locomo_device = {
197 .name = "locomo", 182 .name = "locomo",
198 .id = 0, 183 .id = 0,
199 .num_resources = ARRAY_SIZE(locomo_resources), 184 .num_resources = ARRAY_SIZE(locomo_resources),
200 .resource = locomo_resources, 185 .resource = locomo_resources,
186 .dev = {
187 .platform_data = &locomo_info,
188 },
201}; 189};
202 190
203EXPORT_SYMBOL(poodle_locomo_device); 191EXPORT_SYMBOL(poodle_locomo_device);
@@ -293,7 +281,7 @@ static struct pxamci_platform_data poodle_mci_platform_data = {
293 .init = poodle_mci_init, 281 .init = poodle_mci_init,
294 .setpower = poodle_mci_setpower, 282 .setpower = poodle_mci_setpower,
295 .exit = poodle_mci_exit, 283 .exit = poodle_mci_exit,
296 .gpio_card_detect = POODLE_IRQ_GPIO_nSD_DETECT, 284 .gpio_card_detect = POODLE_GPIO_nSD_DETECT,
297 .gpio_card_ro = POODLE_GPIO_nSD_WP, 285 .gpio_card_ro = POODLE_GPIO_nSD_WP,
298 .gpio_power = -1, 286 .gpio_power = -1,
299}; 287};
@@ -449,6 +437,10 @@ static void __init poodle_init(void)
449 437
450 pxa2xx_mfp_config(ARRAY_AND_SIZE(poodle_pin_config)); 438 pxa2xx_mfp_config(ARRAY_AND_SIZE(poodle_pin_config));
451 439
440 pxa_set_ffuart_info(NULL);
441 pxa_set_btuart_info(NULL);
442 pxa_set_stuart_info(NULL);
443
452 platform_scoop_config = &poodle_pcmcia_config; 444 platform_scoop_config = &poodle_pcmcia_config;
453 445
454 ret = platform_add_devices(devices, ARRAY_SIZE(devices)); 446 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
index 77c2693cfeef..0b9ad30bfd51 100644
--- a/arch/arm/mach-pxa/pxa25x.c
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -322,9 +322,6 @@ void __init pxa26x_init_irq(void)
322 322
323static struct platform_device *pxa25x_devices[] __initdata = { 323static struct platform_device *pxa25x_devices[] __initdata = {
324 &pxa25x_device_udc, 324 &pxa25x_device_udc,
325 &pxa_device_ffuart,
326 &pxa_device_btuart,
327 &pxa_device_stuart,
328 &pxa_device_i2s, 325 &pxa_device_i2s,
329 &sa1100_device_rtc, 326 &sa1100_device_rtc,
330 &pxa25x_device_ssp, 327 &pxa25x_device_ssp,
@@ -352,7 +349,7 @@ static int __init pxa25x_init(void)
352 349
353 reset_status = RCSR; 350 reset_status = RCSR;
354 351
355 clks_register(pxa25x_clkregs, ARRAY_SIZE(pxa25x_clkregs)); 352 clkdev_add_table(pxa25x_clkregs, ARRAY_SIZE(pxa25x_clkregs));
356 353
357 if ((ret = pxa_init_dma(IRQ_DMA, 16))) 354 if ((ret = pxa_init_dma(IRQ_DMA, 16)))
358 return ret; 355 return ret;
@@ -372,10 +369,8 @@ static int __init pxa25x_init(void)
372 } 369 }
373 370
374 /* Only add HWUART for PXA255/26x; PXA210/250 do not have it. */ 371 /* Only add HWUART for PXA255/26x; PXA210/250 do not have it. */
375 if (cpu_is_pxa255()) { 372 if (cpu_is_pxa255())
376 clks_register(&pxa25x_hwuart_clkreg, 1); 373 clkdev_add(&pxa25x_hwuart_clkreg);
377 ret = platform_device_register(&pxa_device_hwuart);
378 }
379 374
380 return ret; 375 return ret;
381} 376}
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index ec68cc16b4e3..0af36177ff08 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -40,6 +40,25 @@ void pxa27x_clear_otgph(void)
40} 40}
41EXPORT_SYMBOL(pxa27x_clear_otgph); 41EXPORT_SYMBOL(pxa27x_clear_otgph);
42 42
43static unsigned long ac97_reset_config[] = {
44 GPIO95_AC97_nRESET,
45 GPIO95_GPIO,
46 GPIO113_AC97_nRESET,
47 GPIO113_GPIO,
48};
49
50void pxa27x_assert_ac97reset(int reset_gpio, int on)
51{
52 if (reset_gpio == 113)
53 pxa2xx_mfp_config(on ? &ac97_reset_config[0] :
54 &ac97_reset_config[1], 1);
55
56 if (reset_gpio == 95)
57 pxa2xx_mfp_config(on ? &ac97_reset_config[2] :
58 &ac97_reset_config[3], 1);
59}
60EXPORT_SYMBOL_GPL(pxa27x_assert_ac97reset);
61
43/* Crystal clock: 13MHz */ 62/* Crystal clock: 13MHz */
44#define BASE_CLK 13000000 63#define BASE_CLK 13000000
45 64
@@ -364,9 +383,6 @@ void __init pxa27x_set_i2c_power_info(struct i2c_pxa_platform_data *info)
364 383
365static struct platform_device *devices[] __initdata = { 384static struct platform_device *devices[] __initdata = {
366 &pxa27x_device_udc, 385 &pxa27x_device_udc,
367 &pxa_device_ffuart,
368 &pxa_device_btuart,
369 &pxa_device_stuart,
370 &pxa_device_i2s, 386 &pxa_device_i2s,
371 &sa1100_device_rtc, 387 &sa1100_device_rtc,
372 &pxa_device_rtc, 388 &pxa_device_rtc,
@@ -395,7 +411,7 @@ static int __init pxa27x_init(void)
395 411
396 reset_status = RCSR; 412 reset_status = RCSR;
397 413
398 clks_register(pxa27x_clkregs, ARRAY_SIZE(pxa27x_clkregs)); 414 clkdev_add_table(pxa27x_clkregs, ARRAY_SIZE(pxa27x_clkregs));
399 415
400 if ((ret = pxa_init_dma(IRQ_DMA, 32))) 416 if ((ret = pxa_init_dma(IRQ_DMA, 32)))
401 return ret; 417 return ret;
diff --git a/arch/arm/mach-pxa/pxa300.c b/arch/arm/mach-pxa/pxa300.c
index f4af6e2bef89..40bb16501d86 100644
--- a/arch/arm/mach-pxa/pxa300.c
+++ b/arch/arm/mach-pxa/pxa300.c
@@ -102,12 +102,12 @@ static int __init pxa300_init(void)
102 if (cpu_is_pxa300() || cpu_is_pxa310()) { 102 if (cpu_is_pxa300() || cpu_is_pxa310()) {
103 mfp_init_base(io_p2v(MFPR_BASE)); 103 mfp_init_base(io_p2v(MFPR_BASE));
104 mfp_init_addr(pxa300_mfp_addr_map); 104 mfp_init_addr(pxa300_mfp_addr_map);
105 clks_register(ARRAY_AND_SIZE(common_clkregs)); 105 clkdev_add_table(ARRAY_AND_SIZE(common_clkregs));
106 } 106 }
107 107
108 if (cpu_is_pxa310()) { 108 if (cpu_is_pxa310()) {
109 mfp_init_addr(pxa310_mfp_addr_map); 109 mfp_init_addr(pxa310_mfp_addr_map);
110 clks_register(ARRAY_AND_SIZE(pxa310_clkregs)); 110 clkdev_add_table(ARRAY_AND_SIZE(pxa310_clkregs));
111 } 111 }
112 112
113 return 0; 113 return 0;
diff --git a/arch/arm/mach-pxa/pxa320.c b/arch/arm/mach-pxa/pxa320.c
index c7373e74a109..8d614ecd8e99 100644
--- a/arch/arm/mach-pxa/pxa320.c
+++ b/arch/arm/mach-pxa/pxa320.c
@@ -90,7 +90,7 @@ static int __init pxa320_init(void)
90 if (cpu_is_pxa320()) { 90 if (cpu_is_pxa320()) {
91 mfp_init_base(io_p2v(MFPR_BASE)); 91 mfp_init_base(io_p2v(MFPR_BASE));
92 mfp_init_addr(pxa320_mfp_addr_map); 92 mfp_init_addr(pxa320_mfp_addr_map);
93 clks_register(ARRAY_AND_SIZE(pxa320_clkregs)); 93 clkdev_add_table(ARRAY_AND_SIZE(pxa320_clkregs));
94 } 94 }
95 95
96 return 0; 96 return 0;
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index 09b7b1a10cad..4d7c03e72504 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -30,6 +30,7 @@
30#include <mach/pm.h> 30#include <mach/pm.h>
31#include <mach/dma.h> 31#include <mach/dma.h>
32#include <mach/ssp.h> 32#include <mach/ssp.h>
33#include <mach/regs-intc.h>
33#include <plat/i2c.h> 34#include <plat/i2c.h>
34 35
35#include "generic.h" 36#include "generic.h"
@@ -45,6 +46,9 @@
45#define ACCR_D0CS (1 << 26) 46#define ACCR_D0CS (1 << 26)
46#define ACCR_PCCE (1 << 11) 47#define ACCR_PCCE (1 << 11)
47 48
49#define PECR_IE(n) ((1 << ((n) * 2)) << 28)
50#define PECR_IS(n) ((1 << ((n) * 2)) << 29)
51
48/* crystal frequency to static memory controller multiplier (SMCFS) */ 52/* crystal frequency to static memory controller multiplier (SMCFS) */
49static unsigned char smcfs_mult[8] = { 6, 0, 8, 0, 0, 16, }; 53static unsigned char smcfs_mult[8] = { 6, 0, 8, 0, 0, 16, };
50 54
@@ -237,6 +241,7 @@ static DEFINE_PXA3_CKEN(pxa3xx_stuart, STUART, 14857000, 1);
237static DEFINE_PXA3_CKEN(pxa3xx_i2c, I2C, 32842000, 0); 241static DEFINE_PXA3_CKEN(pxa3xx_i2c, I2C, 32842000, 0);
238static DEFINE_PXA3_CKEN(pxa3xx_udc, UDC, 48000000, 5); 242static DEFINE_PXA3_CKEN(pxa3xx_udc, UDC, 48000000, 5);
239static DEFINE_PXA3_CKEN(pxa3xx_usbh, USBH, 48000000, 0); 243static DEFINE_PXA3_CKEN(pxa3xx_usbh, USBH, 48000000, 0);
244static DEFINE_PXA3_CKEN(pxa3xx_u2d, USB2, 48000000, 0);
240static DEFINE_PXA3_CKEN(pxa3xx_keypad, KEYPAD, 32768, 0); 245static DEFINE_PXA3_CKEN(pxa3xx_keypad, KEYPAD, 32768, 0);
241static DEFINE_PXA3_CKEN(pxa3xx_ssp1, SSP1, 13000000, 0); 246static DEFINE_PXA3_CKEN(pxa3xx_ssp1, SSP1, 13000000, 0);
242static DEFINE_PXA3_CKEN(pxa3xx_ssp2, SSP2, 13000000, 0); 247static DEFINE_PXA3_CKEN(pxa3xx_ssp2, SSP2, 13000000, 0);
@@ -261,6 +266,7 @@ static struct clk_lookup pxa3xx_clkregs[] = {
261 INIT_CLKREG(&clk_pxa3xx_i2c, "pxa2xx-i2c.0", NULL), 266 INIT_CLKREG(&clk_pxa3xx_i2c, "pxa2xx-i2c.0", NULL),
262 INIT_CLKREG(&clk_pxa3xx_udc, "pxa27x-udc", NULL), 267 INIT_CLKREG(&clk_pxa3xx_udc, "pxa27x-udc", NULL),
263 INIT_CLKREG(&clk_pxa3xx_usbh, "pxa27x-ohci", NULL), 268 INIT_CLKREG(&clk_pxa3xx_usbh, "pxa27x-ohci", NULL),
269 INIT_CLKREG(&clk_pxa3xx_u2d, NULL, "U2DCLK"),
264 INIT_CLKREG(&clk_pxa3xx_keypad, "pxa27x-keypad", NULL), 270 INIT_CLKREG(&clk_pxa3xx_keypad, "pxa27x-keypad", NULL),
265 INIT_CLKREG(&clk_pxa3xx_ssp1, "pxa27x-ssp.0", NULL), 271 INIT_CLKREG(&clk_pxa3xx_ssp1, "pxa27x-ssp.0", NULL),
266 INIT_CLKREG(&clk_pxa3xx_ssp2, "pxa27x-ssp.1", NULL), 272 INIT_CLKREG(&clk_pxa3xx_ssp2, "pxa27x-ssp.1", NULL),
@@ -530,6 +536,43 @@ static inline void pxa3xx_init_pm(void) {}
530#define pxa3xx_set_wake NULL 536#define pxa3xx_set_wake NULL
531#endif 537#endif
532 538
539static void pxa_ack_ext_wakeup(unsigned int irq)
540{
541 PECR |= PECR_IS(irq - IRQ_WAKEUP0);
542}
543
544static void pxa_mask_ext_wakeup(unsigned int irq)
545{
546 ICMR2 &= ~(1 << ((irq - PXA_IRQ(0)) & 0x1f));
547 PECR &= ~PECR_IE(irq - IRQ_WAKEUP0);
548}
549
550static void pxa_unmask_ext_wakeup(unsigned int irq)
551{
552 ICMR2 |= 1 << ((irq - PXA_IRQ(0)) & 0x1f);
553 PECR |= PECR_IE(irq - IRQ_WAKEUP0);
554}
555
556static struct irq_chip pxa_ext_wakeup_chip = {
557 .name = "WAKEUP",
558 .ack = pxa_ack_ext_wakeup,
559 .mask = pxa_mask_ext_wakeup,
560 .unmask = pxa_unmask_ext_wakeup,
561};
562
563static void __init pxa_init_ext_wakeup_irq(set_wake_t fn)
564{
565 int irq;
566
567 for (irq = IRQ_WAKEUP0; irq <= IRQ_WAKEUP1; irq++) {
568 set_irq_chip(irq, &pxa_ext_wakeup_chip);
569 set_irq_handler(irq, handle_edge_irq);
570 set_irq_flags(irq, IRQF_VALID);
571 }
572
573 pxa_ext_wakeup_chip.set_wake = fn;
574}
575
533void __init pxa3xx_init_irq(void) 576void __init pxa3xx_init_irq(void)
534{ 577{
535 /* enable CP6 access */ 578 /* enable CP6 access */
@@ -539,6 +582,7 @@ void __init pxa3xx_init_irq(void)
539 __asm__ __volatile__("mcr p15, 0, %0, c15, c1, 0\n": :"r"(value)); 582 __asm__ __volatile__("mcr p15, 0, %0, c15, c1, 0\n": :"r"(value));
540 583
541 pxa_init_irq(56, pxa3xx_set_wake); 584 pxa_init_irq(56, pxa3xx_set_wake);
585 pxa_init_ext_wakeup_irq(pxa3xx_set_wake);
542 pxa_init_gpio(IRQ_GPIO_2_x, 2, 127, NULL); 586 pxa_init_gpio(IRQ_GPIO_2_x, 2, 127, NULL);
543} 587}
544 588
@@ -553,9 +597,6 @@ void __init pxa3xx_set_i2c_power_info(struct i2c_pxa_platform_data *info)
553 597
554static struct platform_device *devices[] __initdata = { 598static struct platform_device *devices[] __initdata = {
555 &pxa27x_device_udc, 599 &pxa27x_device_udc,
556 &pxa_device_ffuart,
557 &pxa_device_btuart,
558 &pxa_device_stuart,
559 &pxa_device_i2s, 600 &pxa_device_i2s,
560 &sa1100_device_rtc, 601 &sa1100_device_rtc,
561 &pxa_device_rtc, 602 &pxa_device_rtc,
@@ -593,7 +634,7 @@ static int __init pxa3xx_init(void)
593 */ 634 */
594 ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S); 635 ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S);
595 636
596 clks_register(pxa3xx_clkregs, ARRAY_SIZE(pxa3xx_clkregs)); 637 clkdev_add_table(pxa3xx_clkregs, ARRAY_SIZE(pxa3xx_clkregs));
597 638
598 if ((ret = pxa_init_dma(IRQ_DMA, 32))) 639 if ((ret = pxa_init_dma(IRQ_DMA, 32)))
599 return ret; 640 return ret;
diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c
new file mode 100644
index 000000000000..d12667bd9ebe
--- /dev/null
+++ b/arch/arm/mach-pxa/raumfeld.c
@@ -0,0 +1,1105 @@
1/*
2 * arch/arm/mach-pxa/raumfeld.c
3 *
4 * Support for the following Raumfeld devices:
5 *
6 * * Controller
7 * * Connector
8 * * Speaker S/M
9 *
10 * See http://www.raumfeld.com for details.
11 *
12 * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
17 */
18
19#include <linux/init.h>
20#include <linux/kernel.h>
21#include <linux/sysdev.h>
22#include <linux/platform_device.h>
23#include <linux/interrupt.h>
24#include <linux/gpio.h>
25#include <linux/smsc911x.h>
26#include <linux/input.h>
27#include <linux/rotary_encoder.h>
28#include <linux/gpio_keys.h>
29#include <linux/input/eeti_ts.h>
30#include <linux/leds.h>
31#include <linux/w1-gpio.h>
32#include <linux/sched.h>
33#include <linux/pwm_backlight.h>
34#include <linux/i2c.h>
35#include <linux/spi/spi.h>
36#include <linux/spi/spi_gpio.h>
37#include <linux/lis3lv02d.h>
38#include <linux/pda_power.h>
39#include <linux/power_supply.h>
40#include <linux/regulator/max8660.h>
41#include <linux/regulator/machine.h>
42#include <linux/regulator/fixed.h>
43#include <linux/regulator/consumer.h>
44#include <linux/delay.h>
45
46#include <asm/mach-types.h>
47#include <asm/mach/arch.h>
48
49#include <mach/hardware.h>
50#include <mach/pxa3xx-regs.h>
51#include <mach/mfp-pxa3xx.h>
52#include <mach/mfp-pxa300.h>
53#include <mach/ohci.h>
54#include <mach/pxafb.h>
55#include <mach/mmc.h>
56#include <plat/i2c.h>
57#include <plat/pxa3xx_nand.h>
58
59#include "generic.h"
60#include "devices.h"
61#include "clock.h"
62
63/* common GPIO definitions */
64
65/* inputs */
66#define GPIO_ON_OFF (14)
67#define GPIO_VOLENC_A (19)
68#define GPIO_VOLENC_B (20)
69#define GPIO_CHARGE_DONE (23)
70#define GPIO_CHARGE_IND (27)
71#define GPIO_TOUCH_IRQ (32)
72#define GPIO_ETH_IRQ (40)
73#define GPIO_SPI_MISO (98)
74#define GPIO_ACCEL_IRQ (104)
75#define GPIO_RESCUE_BOOT (115)
76#define GPIO_DOCK_DETECT (116)
77#define GPIO_KEY1 (117)
78#define GPIO_KEY2 (118)
79#define GPIO_KEY3 (119)
80#define GPIO_CHARGE_USB_OK (112)
81#define GPIO_CHARGE_DC_OK (101)
82#define GPIO_CHARGE_USB_SUSP (102)
83
84/* outputs */
85#define GPIO_SHUTDOWN_SUPPLY (16)
86#define GPIO_SHUTDOWN_BATT (18)
87#define GPIO_CHRG_PEN2 (31)
88#define GPIO_TFT_VA_EN (33)
89#define GPIO_SPDIF_CS (34)
90#define GPIO_LED2 (35)
91#define GPIO_LED1 (36)
92#define GPIO_SPDIF_RESET (38)
93#define GPIO_SPI_CLK (95)
94#define GPIO_MCLK_DAC_CS (96)
95#define GPIO_SPI_MOSI (97)
96#define GPIO_W1_PULLUP_ENABLE (105)
97#define GPIO_DISPLAY_ENABLE (106)
98#define GPIO_MCLK_RESET (111)
99#define GPIO_W2W_RESET (113)
100#define GPIO_W2W_PDN (114)
101#define GPIO_CODEC_RESET (120)
102#define GPIO_AUDIO_VA_ENABLE (124)
103#define GPIO_ACCEL_CS (125)
104#define GPIO_ONE_WIRE (126)
105
106/*
107 * GPIO configurations
108 */
109static mfp_cfg_t raumfeld_controller_pin_config[] __initdata = {
110 /* UART1 */
111 GPIO77_UART1_RXD,
112 GPIO78_UART1_TXD,
113 GPIO79_UART1_CTS,
114 GPIO81_UART1_DSR,
115 GPIO83_UART1_DTR,
116 GPIO84_UART1_RTS,
117
118 /* UART3 */
119 GPIO110_UART3_RXD,
120
121 /* USB Host */
122 GPIO0_2_USBH_PEN,
123 GPIO1_2_USBH_PWR,
124
125 /* I2C */
126 GPIO21_I2C_SCL | MFP_LPM_FLOAT | MFP_PULL_FLOAT,
127 GPIO22_I2C_SDA | MFP_LPM_FLOAT | MFP_PULL_FLOAT,
128
129 /* SPI */
130 GPIO34_GPIO, /* SPDIF_CS */
131 GPIO96_GPIO, /* MCLK_CS */
132 GPIO125_GPIO, /* ACCEL_CS */
133
134 /* MMC */
135 GPIO3_MMC1_DAT0,
136 GPIO4_MMC1_DAT1,
137 GPIO5_MMC1_DAT2,
138 GPIO6_MMC1_DAT3,
139 GPIO7_MMC1_CLK,
140 GPIO8_MMC1_CMD,
141
142 /* One-wire */
143 GPIO126_GPIO | MFP_LPM_FLOAT,
144 GPIO105_GPIO | MFP_PULL_LOW | MFP_LPM_PULL_LOW,
145
146 /* CHRG_USB_OK */
147 GPIO101_GPIO | MFP_PULL_HIGH,
148 /* CHRG_USB_OK */
149 GPIO112_GPIO | MFP_PULL_HIGH,
150 /* CHRG_USB_SUSP */
151 GPIO102_GPIO,
152 /* DISPLAY_ENABLE */
153 GPIO106_GPIO,
154 /* DOCK_DETECT */
155 GPIO116_GPIO | MFP_LPM_FLOAT | MFP_PULL_FLOAT,
156
157 /* LCD */
158 GPIO54_LCD_LDD_0,
159 GPIO55_LCD_LDD_1,
160 GPIO56_LCD_LDD_2,
161 GPIO57_LCD_LDD_3,
162 GPIO58_LCD_LDD_4,
163 GPIO59_LCD_LDD_5,
164 GPIO60_LCD_LDD_6,
165 GPIO61_LCD_LDD_7,
166 GPIO62_LCD_LDD_8,
167 GPIO63_LCD_LDD_9,
168 GPIO64_LCD_LDD_10,
169 GPIO65_LCD_LDD_11,
170 GPIO66_LCD_LDD_12,
171 GPIO67_LCD_LDD_13,
172 GPIO68_LCD_LDD_14,
173 GPIO69_LCD_LDD_15,
174 GPIO70_LCD_LDD_16,
175 GPIO71_LCD_LDD_17,
176 GPIO72_LCD_FCLK,
177 GPIO73_LCD_LCLK,
178 GPIO74_LCD_PCLK,
179 GPIO75_LCD_BIAS,
180};
181
182static mfp_cfg_t raumfeld_connector_pin_config[] __initdata = {
183 /* UART1 */
184 GPIO77_UART1_RXD,
185 GPIO78_UART1_TXD,
186 GPIO79_UART1_CTS,
187 GPIO81_UART1_DSR,
188 GPIO83_UART1_DTR,
189 GPIO84_UART1_RTS,
190
191 /* UART3 */
192 GPIO110_UART3_RXD,
193
194 /* USB Host */
195 GPIO0_2_USBH_PEN,
196 GPIO1_2_USBH_PWR,
197
198 /* I2C */
199 GPIO21_I2C_SCL | MFP_LPM_FLOAT | MFP_PULL_FLOAT,
200 GPIO22_I2C_SDA | MFP_LPM_FLOAT | MFP_PULL_FLOAT,
201
202 /* SPI */
203 GPIO34_GPIO, /* SPDIF_CS */
204 GPIO96_GPIO, /* MCLK_CS */
205 GPIO125_GPIO, /* ACCEL_CS */
206
207 /* MMC */
208 GPIO3_MMC1_DAT0,
209 GPIO4_MMC1_DAT1,
210 GPIO5_MMC1_DAT2,
211 GPIO6_MMC1_DAT3,
212 GPIO7_MMC1_CLK,
213 GPIO8_MMC1_CMD,
214
215 /* Ethernet */
216 GPIO1_nCS2, /* CS */
217 GPIO40_GPIO | MFP_PULL_HIGH, /* IRQ */
218
219 /* SSP for I2S */
220 GPIO85_SSP1_SCLK,
221 GPIO89_SSP1_EXTCLK,
222 GPIO86_SSP1_FRM,
223 GPIO87_SSP1_TXD,
224 GPIO88_SSP1_RXD,
225 GPIO90_SSP1_SYSCLK,
226
227 /* SSP2 for S/PDIF */
228 GPIO25_SSP2_SCLK,
229 GPIO26_SSP2_FRM,
230 GPIO27_SSP2_TXD,
231 GPIO29_SSP2_EXTCLK,
232
233 /* LEDs */
234 GPIO35_GPIO | MFP_LPM_PULL_LOW,
235 GPIO36_GPIO | MFP_LPM_DRIVE_HIGH,
236};
237
238static mfp_cfg_t raumfeld_speaker_pin_config[] __initdata = {
239 /* UART1 */
240 GPIO77_UART1_RXD,
241 GPIO78_UART1_TXD,
242 GPIO79_UART1_CTS,
243 GPIO81_UART1_DSR,
244 GPIO83_UART1_DTR,
245 GPIO84_UART1_RTS,
246
247 /* UART3 */
248 GPIO110_UART3_RXD,
249
250 /* USB Host */
251 GPIO0_2_USBH_PEN,
252 GPIO1_2_USBH_PWR,
253
254 /* I2C */
255 GPIO21_I2C_SCL | MFP_LPM_FLOAT | MFP_PULL_FLOAT,
256 GPIO22_I2C_SDA | MFP_LPM_FLOAT | MFP_PULL_FLOAT,
257
258 /* SPI */
259 GPIO34_GPIO, /* SPDIF_CS */
260 GPIO96_GPIO, /* MCLK_CS */
261 GPIO125_GPIO, /* ACCEL_CS */
262
263 /* MMC */
264 GPIO3_MMC1_DAT0,
265 GPIO4_MMC1_DAT1,
266 GPIO5_MMC1_DAT2,
267 GPIO6_MMC1_DAT3,
268 GPIO7_MMC1_CLK,
269 GPIO8_MMC1_CMD,
270
271 /* Ethernet */
272 GPIO1_nCS2, /* CS */
273 GPIO40_GPIO | MFP_PULL_HIGH, /* IRQ */
274
275 /* SSP for I2S */
276 GPIO85_SSP1_SCLK,
277 GPIO89_SSP1_EXTCLK,
278 GPIO86_SSP1_FRM,
279 GPIO87_SSP1_TXD,
280 GPIO88_SSP1_RXD,
281 GPIO90_SSP1_SYSCLK,
282
283 /* LEDs */
284 GPIO35_GPIO | MFP_LPM_PULL_LOW,
285 GPIO36_GPIO | MFP_LPM_DRIVE_HIGH,
286};
287
288/*
289 * SMSC LAN9220 Ethernet
290 */
291
292static struct resource smc91x_resources[] = {
293 {
294 .start = PXA3xx_CS2_PHYS,
295 .end = PXA3xx_CS2_PHYS + 0xfffff,
296 .flags = IORESOURCE_MEM,
297 },
298 {
299 .start = gpio_to_irq(GPIO_ETH_IRQ),
300 .end = gpio_to_irq(GPIO_ETH_IRQ),
301 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING,
302 }
303};
304
305static struct smsc911x_platform_config raumfeld_smsc911x_config = {
306 .phy_interface = PHY_INTERFACE_MODE_MII,
307 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
308 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
309 .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
310};
311
312static struct platform_device smc91x_device = {
313 .name = "smsc911x",
314 .id = -1,
315 .num_resources = ARRAY_SIZE(smc91x_resources),
316 .resource = smc91x_resources,
317 .dev = {
318 .platform_data = &raumfeld_smsc911x_config,
319 }
320};
321
322/**
323 * NAND
324 */
325
326static struct mtd_partition raumfeld_nand_partitions[] = {
327 {
328 .name = "Bootloader",
329 .offset = 0,
330 .size = 0xa0000,
331 .mask_flags = MTD_WRITEABLE, /* force read-only */
332 },
333 {
334 .name = "BootloaderEnvironment",
335 .offset = 0xa0000,
336 .size = 0x20000,
337 },
338 {
339 .name = "BootloaderSplashScreen",
340 .offset = 0xc0000,
341 .size = 0x60000,
342 },
343 {
344 .name = "UBI",
345 .offset = 0x120000,
346 .size = MTDPART_SIZ_FULL,
347 },
348};
349
350static struct pxa3xx_nand_platform_data raumfeld_nand_info = {
351 .enable_arbiter = 1,
352 .keep_config = 1,
353 .parts = raumfeld_nand_partitions,
354 .nr_parts = ARRAY_SIZE(raumfeld_nand_partitions),
355};
356
357/**
358 * USB (OHCI) support
359 */
360
361static struct pxaohci_platform_data raumfeld_ohci_info = {
362 .port_mode = PMM_GLOBAL_MODE,
363 .flags = ENABLE_PORT1,
364};
365
366/**
367 * Rotary encoder input device
368 */
369
370static struct rotary_encoder_platform_data raumfeld_rotary_encoder_info = {
371 .steps = 24,
372 .axis = REL_X,
373 .relative_axis = 1,
374 .gpio_a = GPIO_VOLENC_A,
375 .gpio_b = GPIO_VOLENC_B,
376 .inverted_a = 1,
377 .inverted_b = 0,
378};
379
380static struct platform_device rotary_encoder_device = {
381 .name = "rotary-encoder",
382 .id = 0,
383 .dev = {
384 .platform_data = &raumfeld_rotary_encoder_info,
385 }
386};
387
388/**
389 * GPIO buttons
390 */
391
392static struct gpio_keys_button gpio_keys_button[] = {
393 {
394 .code = KEY_F1,
395 .type = EV_KEY,
396 .gpio = GPIO_KEY1,
397 .active_low = 1,
398 .wakeup = 0,
399 .debounce_interval = 5, /* ms */
400 .desc = "Button 1",
401 },
402 {
403 .code = KEY_F2,
404 .type = EV_KEY,
405 .gpio = GPIO_KEY2,
406 .active_low = 1,
407 .wakeup = 0,
408 .debounce_interval = 5, /* ms */
409 .desc = "Button 2",
410 },
411 {
412 .code = KEY_F3,
413 .type = EV_KEY,
414 .gpio = GPIO_KEY3,
415 .active_low = 1,
416 .wakeup = 0,
417 .debounce_interval = 5, /* ms */
418 .desc = "Button 3",
419 },
420 {
421 .code = KEY_F4,
422 .type = EV_KEY,
423 .gpio = GPIO_RESCUE_BOOT,
424 .active_low = 0,
425 .wakeup = 0,
426 .debounce_interval = 5, /* ms */
427 .desc = "rescue boot button",
428 },
429 {
430 .code = KEY_F5,
431 .type = EV_KEY,
432 .gpio = GPIO_DOCK_DETECT,
433 .active_low = 1,
434 .wakeup = 0,
435 .debounce_interval = 5, /* ms */
436 .desc = "dock detect",
437 },
438 {
439 .code = KEY_F6,
440 .type = EV_KEY,
441 .gpio = GPIO_ON_OFF,
442 .active_low = 0,
443 .wakeup = 0,
444 .debounce_interval = 5, /* ms */
445 .desc = "on_off button",
446 },
447};
448
449static struct gpio_keys_platform_data gpio_keys_platform_data = {
450 .buttons = gpio_keys_button,
451 .nbuttons = ARRAY_SIZE(gpio_keys_button),
452 .rep = 0,
453};
454
455static struct platform_device raumfeld_gpio_keys_device = {
456 .name = "gpio-keys",
457 .id = -1,
458 .dev = {
459 .platform_data = &gpio_keys_platform_data,
460 }
461};
462
463/**
464 * GPIO LEDs
465 */
466
467static struct gpio_led raumfeld_leds[] = {
468 {
469 .name = "raumfeld:1",
470 .gpio = GPIO_LED1,
471 .active_low = 1,
472 .default_state = LEDS_GPIO_DEFSTATE_ON,
473 },
474 {
475 .name = "raumfeld:2",
476 .gpio = GPIO_LED2,
477 .active_low = 0,
478 .default_state = LEDS_GPIO_DEFSTATE_OFF,
479 }
480};
481
482static struct gpio_led_platform_data raumfeld_led_platform_data = {
483 .leds = raumfeld_leds,
484 .num_leds = ARRAY_SIZE(raumfeld_leds),
485};
486
487static struct platform_device raumfeld_led_device = {
488 .name = "leds-gpio",
489 .id = -1,
490 .dev = {
491 .platform_data = &raumfeld_led_platform_data,
492 },
493};
494
495/**
496 * One-wire (W1 bus) support
497 */
498
499static void w1_enable_external_pullup(int enable)
500{
501 gpio_set_value(GPIO_W1_PULLUP_ENABLE, enable);
502 msleep(100);
503}
504
505static struct w1_gpio_platform_data w1_gpio_platform_data = {
506 .pin = GPIO_ONE_WIRE,
507 .is_open_drain = 0,
508 .enable_external_pullup = w1_enable_external_pullup,
509};
510
511struct platform_device raumfeld_w1_gpio_device = {
512 .name = "w1-gpio",
513 .dev = {
514 .platform_data = &w1_gpio_platform_data
515 }
516};
517
518static void __init raumfeld_w1_init(void)
519{
520 int ret = gpio_request(GPIO_W1_PULLUP_ENABLE,
521 "W1 external pullup enable");
522
523 if (ret < 0)
524 pr_warning("Unable to request GPIO_W1_PULLUP_ENABLE\n");
525 else
526 gpio_direction_output(GPIO_W1_PULLUP_ENABLE, 0);
527
528 platform_device_register(&raumfeld_w1_gpio_device);
529}
530
531/**
532 * Framebuffer device
533 */
534
535/* PWM controlled backlight */
536static struct platform_pwm_backlight_data raumfeld_pwm_backlight_data = {
537 .pwm_id = 0,
538 .max_brightness = 100,
539 .dft_brightness = 100,
540 /* 10000 ns = 10 ms ^= 100 kHz */
541 .pwm_period_ns = 10000,
542};
543
544static struct platform_device raumfeld_pwm_backlight_device = {
545 .name = "pwm-backlight",
546 .dev = {
547 .parent = &pxa27x_device_pwm0.dev,
548 .platform_data = &raumfeld_pwm_backlight_data,
549 }
550};
551
552/* LT3593 controlled backlight */
553static struct gpio_led raumfeld_lt3593_led = {
554 .name = "backlight",
555 .gpio = mfp_to_gpio(MFP_PIN_GPIO17),
556 .default_state = LEDS_GPIO_DEFSTATE_ON,
557};
558
559static struct gpio_led_platform_data raumfeld_lt3593_platform_data = {
560 .leds = &raumfeld_lt3593_led,
561 .num_leds = 1,
562};
563
564static struct platform_device raumfeld_lt3593_device = {
565 .name = "leds-lt3593",
566 .id = -1,
567 .dev = {
568 .platform_data = &raumfeld_lt3593_platform_data,
569 },
570};
571
572static struct pxafb_mode_info sharp_lq043t3dx02_mode = {
573 .pixclock = 111000,
574 .xres = 480,
575 .yres = 272,
576 .bpp = 16,
577 .hsync_len = 4,
578 .left_margin = 2,
579 .right_margin = 1,
580 .vsync_len = 1,
581 .upper_margin = 3,
582 .lower_margin = 1,
583 .sync = 0,
584};
585
586static struct pxafb_mach_info raumfeld_sharp_lcd_info = {
587 .modes = &sharp_lq043t3dx02_mode,
588 .num_modes = 1,
589 .video_mem_size = 0x400000,
590 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
591};
592
593static void __init raumfeld_lcd_init(void)
594{
595 int ret;
596
597 set_pxa_fb_info(&raumfeld_sharp_lcd_info);
598
599 /* Earlier devices had the backlight regulator controlled
600 * via PWM, later versions use another controller for that */
601 if ((system_rev & 0xff) < 2) {
602 mfp_cfg_t raumfeld_pwm_pin_config = GPIO17_PWM0_OUT;
603 pxa3xx_mfp_config(&raumfeld_pwm_pin_config, 1);
604 platform_device_register(&raumfeld_pwm_backlight_device);
605 } else
606 platform_device_register(&raumfeld_lt3593_device);
607
608 ret = gpio_request(GPIO_TFT_VA_EN, "display VA enable");
609 if (ret < 0)
610 pr_warning("Unable to request GPIO_TFT_VA_EN\n");
611 else
612 gpio_direction_output(GPIO_TFT_VA_EN, 1);
613
614 ret = gpio_request(GPIO_DISPLAY_ENABLE, "display enable");
615 if (ret < 0)
616 pr_warning("Unable to request GPIO_DISPLAY_ENABLE\n");
617 else
618 gpio_direction_output(GPIO_DISPLAY_ENABLE, 1);
619}
620
621/**
622 * SPI devices
623 */
624
625struct spi_gpio_platform_data raumfeld_spi_platform_data = {
626 .sck = GPIO_SPI_CLK,
627 .mosi = GPIO_SPI_MOSI,
628 .miso = GPIO_SPI_MISO,
629 .num_chipselect = 3,
630};
631
632static struct platform_device raumfeld_spi_device = {
633 .name = "spi_gpio",
634 .id = 0,
635 .dev = {
636 .platform_data = &raumfeld_spi_platform_data,
637 }
638};
639
640static struct lis3lv02d_platform_data lis3_pdata = {
641 .click_flags = LIS3_CLICK_SINGLE_X |
642 LIS3_CLICK_SINGLE_Y |
643 LIS3_CLICK_SINGLE_Z,
644 .irq_cfg = LIS3_IRQ1_CLICK | LIS3_IRQ2_CLICK,
645 .wakeup_flags = LIS3_WAKEUP_X_LO | LIS3_WAKEUP_X_HI |
646 LIS3_WAKEUP_Y_LO | LIS3_WAKEUP_Y_HI |
647 LIS3_WAKEUP_Z_LO | LIS3_WAKEUP_Z_HI,
648 .wakeup_thresh = 10,
649 .click_thresh_x = 10,
650 .click_thresh_y = 10,
651 .click_thresh_z = 10,
652};
653
654#define SPI_AK4104 \
655{ \
656 .modalias = "ak4104", \
657 .max_speed_hz = 10000, \
658 .bus_num = 0, \
659 .chip_select = 0, \
660 .controller_data = (void *) GPIO_SPDIF_CS, \
661}
662
663#define SPI_LIS3 \
664{ \
665 .modalias = "lis3lv02d_spi", \
666 .max_speed_hz = 1000000, \
667 .bus_num = 0, \
668 .chip_select = 1, \
669 .controller_data = (void *) GPIO_ACCEL_CS, \
670 .platform_data = &lis3_pdata, \
671 .irq = gpio_to_irq(GPIO_ACCEL_IRQ), \
672}
673
674#define SPI_DAC7512 \
675{ \
676 .modalias = "dac7512", \
677 .max_speed_hz = 1000000, \
678 .bus_num = 0, \
679 .chip_select = 2, \
680 .controller_data = (void *) GPIO_MCLK_DAC_CS, \
681}
682
683static struct spi_board_info connector_spi_devices[] __initdata = {
684 SPI_AK4104,
685 SPI_DAC7512,
686};
687
688static struct spi_board_info speaker_spi_devices[] __initdata = {
689 SPI_DAC7512,
690};
691
692static struct spi_board_info controller_spi_devices[] __initdata = {
693 SPI_LIS3,
694};
695
696/**
697 * MMC for Marvell Libertas 8688 via SDIO
698 */
699
700static int raumfeld_mci_init(struct device *dev, irq_handler_t isr, void *data)
701{
702 gpio_set_value(GPIO_W2W_RESET, 1);
703 gpio_set_value(GPIO_W2W_PDN, 1);
704
705 return 0;
706}
707
708static void raumfeld_mci_exit(struct device *dev, void *data)
709{
710 gpio_set_value(GPIO_W2W_RESET, 0);
711 gpio_set_value(GPIO_W2W_PDN, 0);
712}
713
714static struct pxamci_platform_data raumfeld_mci_platform_data = {
715 .init = raumfeld_mci_init,
716 .exit = raumfeld_mci_exit,
717 .detect_delay = 20,
718 .gpio_card_detect = -1,
719 .gpio_card_ro = -1,
720 .gpio_power = -1,
721};
722
723/*
724 * External power / charge logic
725 */
726
727static int power_supply_init(struct device *dev)
728{
729 return 0;
730}
731
732static void power_supply_exit(struct device *dev)
733{
734}
735
736static int raumfeld_is_ac_online(void)
737{
738 return !gpio_get_value(GPIO_CHARGE_DC_OK);
739}
740
741static int raumfeld_is_usb_online(void)
742{
743 return 0;
744}
745
746static char *raumfeld_power_supplicants[] = { "ds2760-battery.0" };
747
748static struct pda_power_pdata power_supply_info = {
749 .init = power_supply_init,
750 .is_ac_online = raumfeld_is_ac_online,
751 .is_usb_online = raumfeld_is_usb_online,
752 .exit = power_supply_exit,
753 .supplied_to = raumfeld_power_supplicants,
754 .num_supplicants = ARRAY_SIZE(raumfeld_power_supplicants)
755};
756
757static struct resource power_supply_resources[] = {
758 {
759 .name = "ac",
760 .flags = IORESOURCE_IRQ |
761 IORESOURCE_IRQ_HIGHEDGE | IORESOURCE_IRQ_LOWEDGE,
762 .start = GPIO_CHARGE_DC_OK,
763 .end = GPIO_CHARGE_DC_OK,
764 },
765};
766
767static irqreturn_t charge_done_irq(int irq, void *dev_id)
768{
769 struct power_supply *psy;
770
771 psy = power_supply_get_by_name("ds2760-battery.0");
772
773 if (psy)
774 power_supply_set_battery_charged(psy);
775
776 return IRQ_HANDLED;
777}
778
779static struct platform_device raumfeld_power_supply = {
780 .name = "pda-power",
781 .id = -1,
782 .dev = {
783 .platform_data = &power_supply_info,
784 },
785 .resource = power_supply_resources,
786 .num_resources = ARRAY_SIZE(power_supply_resources),
787};
788
789static void __init raumfeld_power_init(void)
790{
791 int ret;
792
793 /* Set PEN2 high to enable maximum charge current */
794 ret = gpio_request(GPIO_CHRG_PEN2, "CHRG_PEN2");
795 if (ret < 0)
796 pr_warning("Unable to request GPIO_CHRG_PEN2\n");
797 else
798 gpio_direction_output(GPIO_CHRG_PEN2, 1);
799
800 ret = gpio_request(GPIO_CHARGE_DC_OK, "CABLE_DC_OK");
801 if (ret < 0)
802 pr_warning("Unable to request GPIO_CHARGE_DC_OK\n");
803
804 ret = gpio_request(GPIO_CHARGE_USB_SUSP, "CHARGE_USB_SUSP");
805 if (ret < 0)
806 pr_warning("Unable to request GPIO_CHARGE_USB_SUSP\n");
807 else
808 gpio_direction_output(GPIO_CHARGE_USB_SUSP, 0);
809
810 power_supply_resources[0].start = gpio_to_irq(GPIO_CHARGE_DC_OK);
811 power_supply_resources[0].end = gpio_to_irq(GPIO_CHARGE_DC_OK);
812
813 ret = request_irq(gpio_to_irq(GPIO_CHARGE_DONE),
814 &charge_done_irq, IORESOURCE_IRQ_LOWEDGE,
815 "charge_done", NULL);
816
817 if (ret < 0)
818 printk(KERN_ERR "%s: unable to register irq %d\n", __func__,
819 GPIO_CHARGE_DONE);
820 else
821 platform_device_register(&raumfeld_power_supply);
822}
823
824/* Fixed regulator for AUDIO_VA, 0-0048 maps to the cs4270 codec device */
825
826static struct regulator_consumer_supply audio_va_consumer_supply =
827 REGULATOR_SUPPLY("va", "0-0048");
828
829struct regulator_init_data audio_va_initdata = {
830 .consumer_supplies = &audio_va_consumer_supply,
831 .num_consumer_supplies = 1,
832 .constraints = {
833 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
834 },
835};
836
837static struct fixed_voltage_config audio_va_config = {
838 .supply_name = "audio_va",
839 .microvolts = 5000000,
840 .gpio = GPIO_AUDIO_VA_ENABLE,
841 .enable_high = 1,
842 .enabled_at_boot = 0,
843 .init_data = &audio_va_initdata,
844};
845
846static struct platform_device audio_va_device = {
847 .name = "reg-fixed-voltage",
848 .id = 0,
849 .dev = {
850 .platform_data = &audio_va_config,
851 },
852};
853
854/* Dummy supplies for Codec's VD/VLC */
855
856static struct regulator_consumer_supply audio_dummy_supplies[] = {
857 REGULATOR_SUPPLY("vd", "0-0048"),
858 REGULATOR_SUPPLY("vlc", "0-0048"),
859};
860
861struct regulator_init_data audio_dummy_initdata = {
862 .consumer_supplies = audio_dummy_supplies,
863 .num_consumer_supplies = ARRAY_SIZE(audio_dummy_supplies),
864 .constraints = {
865 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
866 },
867};
868
869static struct fixed_voltage_config audio_dummy_config = {
870 .supply_name = "audio_vd",
871 .microvolts = 3300000,
872 .gpio = -1,
873 .init_data = &audio_dummy_initdata,
874};
875
876static struct platform_device audio_supply_dummy_device = {
877 .name = "reg-fixed-voltage",
878 .id = 1,
879 .dev = {
880 .platform_data = &audio_dummy_config,
881 },
882};
883
884static struct platform_device *audio_regulator_devices[] = {
885 &audio_va_device,
886 &audio_supply_dummy_device,
887};
888
889/**
890 * Regulator support via MAX8660
891 */
892
893static struct regulator_consumer_supply vcc_mmc_supply =
894 REGULATOR_SUPPLY("vmmc", "pxa2xx-mci.0");
895
896static struct regulator_init_data vcc_mmc_init_data = {
897 .constraints = {
898 .min_uV = 3300000,
899 .max_uV = 3300000,
900 .valid_modes_mask = REGULATOR_MODE_NORMAL,
901 .valid_ops_mask = REGULATOR_CHANGE_STATUS |
902 REGULATOR_CHANGE_VOLTAGE |
903 REGULATOR_CHANGE_MODE,
904 },
905 .consumer_supplies = &vcc_mmc_supply,
906 .num_consumer_supplies = 1,
907};
908
909struct max8660_subdev_data max8660_v6_subdev_data = {
910 .id = MAX8660_V6,
911 .name = "vmmc",
912 .platform_data = &vcc_mmc_init_data,
913};
914
915static struct max8660_platform_data max8660_pdata = {
916 .subdevs = &max8660_v6_subdev_data,
917 .num_subdevs = 1,
918};
919
920/**
921 * I2C devices
922 */
923
924static struct i2c_board_info raumfeld_pwri2c_board_info = {
925 .type = "max8660",
926 .addr = 0x34,
927 .platform_data = &max8660_pdata,
928};
929
930static struct i2c_board_info raumfeld_connector_i2c_board_info __initdata = {
931 .type = "cs4270",
932 .addr = 0x48,
933};
934
935static struct eeti_ts_platform_data eeti_ts_pdata = {
936 .irq_active_high = 1,
937};
938
939static struct i2c_board_info raumfeld_controller_i2c_board_info __initdata = {
940 .type = "eeti_ts",
941 .addr = 0x0a,
942 .irq = gpio_to_irq(GPIO_TOUCH_IRQ),
943 .platform_data = &eeti_ts_pdata,
944};
945
946static struct platform_device *raumfeld_common_devices[] = {
947 &raumfeld_gpio_keys_device,
948 &raumfeld_led_device,
949 &raumfeld_spi_device,
950};
951
952static void __init raumfeld_audio_init(void)
953{
954 int ret;
955
956 ret = gpio_request(GPIO_CODEC_RESET, "cs4270 reset");
957 if (ret < 0)
958 pr_warning("unable to request GPIO_CODEC_RESET\n");
959 else
960 gpio_direction_output(GPIO_CODEC_RESET, 1);
961
962 ret = gpio_request(GPIO_SPDIF_RESET, "ak4104 s/pdif reset");
963 if (ret < 0)
964 pr_warning("unable to request GPIO_SPDIF_RESET\n");
965 else
966 gpio_direction_output(GPIO_SPDIF_RESET, 1);
967
968 ret = gpio_request(GPIO_MCLK_RESET, "MCLK reset");
969 if (ret < 0)
970 pr_warning("unable to request GPIO_MCLK_RESET\n");
971 else
972 gpio_direction_output(GPIO_MCLK_RESET, 1);
973
974 platform_add_devices(ARRAY_AND_SIZE(audio_regulator_devices));
975}
976
977static void __init raumfeld_common_init(void)
978{
979 int ret;
980
981 /* The on/off button polarity has changed after revision 1 */
982 if ((system_rev & 0xff) > 1) {
983 int i;
984
985 for (i = 0; i < ARRAY_SIZE(gpio_keys_button); i++)
986 if (!strcmp(gpio_keys_button[i].desc, "on_off button"))
987 gpio_keys_button[i].active_low = 1;
988 }
989
990 enable_irq_wake(IRQ_WAKEUP0);
991
992 pxa3xx_set_nand_info(&raumfeld_nand_info);
993 pxa3xx_set_i2c_power_info(NULL);
994 pxa_set_ohci_info(&raumfeld_ohci_info);
995 pxa_set_mci_info(&raumfeld_mci_platform_data);
996 pxa_set_i2c_info(NULL);
997 pxa_set_ffuart_info(NULL);
998
999 ret = gpio_request(GPIO_W2W_RESET, "Wi2Wi reset");
1000 if (ret < 0)
1001 pr_warning("Unable to request GPIO_W2W_RESET\n");
1002 else
1003 gpio_direction_output(GPIO_W2W_RESET, 0);
1004
1005 ret = gpio_request(GPIO_W2W_PDN, "Wi2Wi powerup");
1006 if (ret < 0)
1007 pr_warning("Unable to request GPIO_W2W_PDN\n");
1008 else
1009 gpio_direction_output(GPIO_W2W_PDN, 0);
1010
1011 /* this can be used to switch off the device */
1012 ret = gpio_request(GPIO_SHUTDOWN_SUPPLY, "supply shutdown");
1013 if (ret < 0)
1014 pr_warning("Unable to request GPIO_SHUTDOWN_SUPPLY\n");
1015 else
1016 gpio_direction_output(GPIO_SHUTDOWN_SUPPLY, 0);
1017
1018 platform_add_devices(ARRAY_AND_SIZE(raumfeld_common_devices));
1019 i2c_register_board_info(1, &raumfeld_pwri2c_board_info, 1);
1020}
1021
1022static void __init raumfeld_controller_init(void)
1023{
1024 int ret;
1025
1026 pxa3xx_mfp_config(ARRAY_AND_SIZE(raumfeld_controller_pin_config));
1027 platform_device_register(&rotary_encoder_device);
1028 spi_register_board_info(ARRAY_AND_SIZE(controller_spi_devices));
1029 i2c_register_board_info(0, &raumfeld_controller_i2c_board_info, 1);
1030
1031 ret = gpio_request(GPIO_SHUTDOWN_BATT, "battery shutdown");
1032 if (ret < 0)
1033 pr_warning("Unable to request GPIO_SHUTDOWN_BATT\n");
1034 else
1035 gpio_direction_output(GPIO_SHUTDOWN_BATT, 0);
1036
1037 raumfeld_common_init();
1038 raumfeld_power_init();
1039 raumfeld_lcd_init();
1040 raumfeld_w1_init();
1041}
1042
1043static void __init raumfeld_connector_init(void)
1044{
1045 pxa3xx_mfp_config(ARRAY_AND_SIZE(raumfeld_connector_pin_config));
1046 spi_register_board_info(ARRAY_AND_SIZE(connector_spi_devices));
1047 i2c_register_board_info(0, &raumfeld_connector_i2c_board_info, 1);
1048
1049 platform_device_register(&smc91x_device);
1050
1051 raumfeld_audio_init();
1052 raumfeld_common_init();
1053}
1054
1055static void __init raumfeld_speaker_init(void)
1056{
1057 pxa3xx_mfp_config(ARRAY_AND_SIZE(raumfeld_speaker_pin_config));
1058 spi_register_board_info(ARRAY_AND_SIZE(speaker_spi_devices));
1059 i2c_register_board_info(0, &raumfeld_connector_i2c_board_info, 1);
1060
1061 platform_device_register(&smc91x_device);
1062 platform_device_register(&rotary_encoder_device);
1063
1064 raumfeld_audio_init();
1065 raumfeld_common_init();
1066}
1067
1068/* physical memory regions */
1069#define RAUMFELD_SDRAM_BASE 0xa0000000 /* SDRAM region */
1070
1071#ifdef CONFIG_MACH_RAUMFELD_RC
1072MACHINE_START(RAUMFELD_RC, "Raumfeld Controller")
1073 .phys_io = 0x40000000,
1074 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
1075 .boot_params = RAUMFELD_SDRAM_BASE + 0x100,
1076 .init_machine = raumfeld_controller_init,
1077 .map_io = pxa_map_io,
1078 .init_irq = pxa3xx_init_irq,
1079 .timer = &pxa_timer,
1080MACHINE_END
1081#endif
1082
1083#ifdef CONFIG_MACH_RAUMFELD_CONNECTOR
1084MACHINE_START(RAUMFELD_CONNECTOR, "Raumfeld Connector")
1085 .phys_io = 0x40000000,
1086 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
1087 .boot_params = RAUMFELD_SDRAM_BASE + 0x100,
1088 .init_machine = raumfeld_connector_init,
1089 .map_io = pxa_map_io,
1090 .init_irq = pxa3xx_init_irq,
1091 .timer = &pxa_timer,
1092MACHINE_END
1093#endif
1094
1095#ifdef CONFIG_MACH_RAUMFELD_SPEAKER
1096MACHINE_START(RAUMFELD_SPEAKER, "Raumfeld Speaker")
1097 .phys_io = 0x40000000,
1098 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
1099 .boot_params = RAUMFELD_SDRAM_BASE + 0x100,
1100 .init_machine = raumfeld_speaker_init,
1101 .map_io = pxa_map_io,
1102 .init_irq = pxa3xx_init_irq,
1103 .timer = &pxa_timer,
1104MACHINE_END
1105#endif
diff --git a/arch/arm/mach-pxa/saar.c b/arch/arm/mach-pxa/saar.c
index 8241a63ea589..115b6f234bdd 100644
--- a/arch/arm/mach-pxa/saar.c
+++ b/arch/arm/mach-pxa/saar.c
@@ -22,9 +22,13 @@
22#include <linux/i2c.h> 22#include <linux/i2c.h>
23#include <linux/smc91x.h> 23#include <linux/smc91x.h>
24#include <linux/mfd/da903x.h> 24#include <linux/mfd/da903x.h>
25#include <linux/mtd/mtd.h>
26#include <linux/mtd/partitions.h>
27#include <linux/mtd/onenand.h>
25 28
26#include <asm/mach-types.h> 29#include <asm/mach-types.h>
27#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31#include <asm/mach/flash.h>
28 32
29#include <mach/pxa930.h> 33#include <mach/pxa930.h>
30#include <plat/i2c.h> 34#include <plat/i2c.h>
@@ -33,7 +37,7 @@
33#include "devices.h" 37#include "devices.h"
34#include "generic.h" 38#include "generic.h"
35 39
36#define GPIO_LCD_RESET (16) 40#define GPIO_LCD_RESET (16)
37 41
38/* SAAR MFP configurations */ 42/* SAAR MFP configurations */
39static mfp_cfg_t saar_mfp_cfg[] __initdata = { 43static mfp_cfg_t saar_mfp_cfg[] __initdata = {
@@ -56,6 +60,31 @@ static mfp_cfg_t saar_mfp_cfg[] __initdata = {
56 /* Ethernet */ 60 /* Ethernet */
57 DF_nCS1_nCS3, 61 DF_nCS1_nCS3,
58 GPIO97_GPIO, 62 GPIO97_GPIO,
63
64 /* DFI */
65 DF_INT_RnB_ND_INT_RnB,
66 DF_nRE_nOE_ND_nRE,
67 DF_nWE_ND_nWE,
68 DF_CLE_nOE_ND_CLE,
69 DF_nADV1_ALE_ND_ALE,
70 DF_nADV2_ALE_nCS3,
71 DF_nCS0_ND_nCS0,
72 DF_IO0_ND_IO0,
73 DF_IO1_ND_IO1,
74 DF_IO2_ND_IO2,
75 DF_IO3_ND_IO3,
76 DF_IO4_ND_IO4,
77 DF_IO5_ND_IO5,
78 DF_IO6_ND_IO6,
79 DF_IO7_ND_IO7,
80 DF_IO8_ND_IO8,
81 DF_IO9_ND_IO9,
82 DF_IO10_ND_IO10,
83 DF_IO11_ND_IO11,
84 DF_IO12_ND_IO12,
85 DF_IO13_ND_IO13,
86 DF_IO14_ND_IO14,
87 DF_IO15_ND_IO15,
59}; 88};
60 89
61#define SAAR_ETH_PHYS (0x14000000) 90#define SAAR_ETH_PHYS (0x14000000)
@@ -451,10 +480,15 @@ static inline void saar_init_lcd(void) {}
451#endif 480#endif
452 481
453#if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE) 482#if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE)
483static struct da9034_backlight_pdata saar_da9034_backlight = {
484 .output_current = 4, /* 4mA */
485};
486
454static struct da903x_subdev_info saar_da9034_subdevs[] = { 487static struct da903x_subdev_info saar_da9034_subdevs[] = {
455 [0] = { 488 [0] = {
456 .name = "da903x-backlight", 489 .name = "da903x-backlight",
457 .id = DA9034_ID_WLED, 490 .id = DA9034_ID_WLED,
491 .platform_data = &saar_da9034_backlight,
458 }, 492 },
459}; 493};
460 494
@@ -480,12 +514,81 @@ static void __init saar_init_i2c(void)
480#else 514#else
481static inline void saar_init_i2c(void) {} 515static inline void saar_init_i2c(void) {}
482#endif 516#endif
517
518#if defined(CONFIG_MTD_ONENAND) || defined(CONFIG_MTD_ONENAND_MODULE)
519static struct mtd_partition saar_onenand_partitions[] = {
520 {
521 .name = "bootloader",
522 .offset = 0,
523 .size = SZ_1M,
524 .mask_flags = MTD_WRITEABLE,
525 }, {
526 .name = "reserved",
527 .offset = MTDPART_OFS_APPEND,
528 .size = SZ_128K,
529 .mask_flags = MTD_WRITEABLE,
530 }, {
531 .name = "reserved",
532 .offset = MTDPART_OFS_APPEND,
533 .size = SZ_8M,
534 .mask_flags = MTD_WRITEABLE,
535 }, {
536 .name = "kernel",
537 .offset = MTDPART_OFS_APPEND,
538 .size = (SZ_2M + SZ_1M),
539 .mask_flags = 0,
540 }, {
541 .name = "filesystem",
542 .offset = MTDPART_OFS_APPEND,
543 .size = SZ_48M,
544 .mask_flags = 0,
545 }
546};
547
548static struct onenand_platform_data saar_onenand_info = {
549 .parts = saar_onenand_partitions,
550 .nr_parts = ARRAY_SIZE(saar_onenand_partitions),
551};
552
553#define SMC_CS0_PHYS_BASE (0x10000000)
554
555static struct resource saar_resource_onenand[] = {
556 [0] = {
557 .start = SMC_CS0_PHYS_BASE,
558 .end = SMC_CS0_PHYS_BASE + SZ_1M,
559 .flags = IORESOURCE_MEM,
560 },
561};
562
563static struct platform_device saar_device_onenand = {
564 .name = "onenand-flash",
565 .id = -1,
566 .dev = {
567 .platform_data = &saar_onenand_info,
568 },
569 .resource = saar_resource_onenand,
570 .num_resources = ARRAY_SIZE(saar_resource_onenand),
571};
572
573static void __init saar_init_onenand(void)
574{
575 platform_device_register(&saar_device_onenand);
576}
577#else
578static void __init saar_init_onenand(void) {}
579#endif
580
483static void __init saar_init(void) 581static void __init saar_init(void)
484{ 582{
485 /* initialize MFP configurations */ 583 /* initialize MFP configurations */
486 pxa3xx_mfp_config(ARRAY_AND_SIZE(saar_mfp_cfg)); 584 pxa3xx_mfp_config(ARRAY_AND_SIZE(saar_mfp_cfg));
487 585
586 pxa_set_ffuart_info(NULL);
587 pxa_set_btuart_info(NULL);
588 pxa_set_stuart_info(NULL);
589
488 platform_device_register(&smc91x_device); 590 platform_device_register(&smc91x_device);
591 saar_init_onenand();
489 592
490 saar_init_i2c(); 593 saar_init_i2c();
491 saar_init_lcd(); 594 saar_init_lcd();
diff --git a/arch/arm/mach-pxa/sharpsl.h b/arch/arm/mach-pxa/sharpsl.h
index 55259f4756c8..1439785d3979 100644
--- a/arch/arm/mach-pxa/sharpsl.h
+++ b/arch/arm/mach-pxa/sharpsl.h
@@ -42,8 +42,8 @@ void corgi_lcdtg_hw_init(int mode);
42#define MAX1111_BATT_TEMP 2u 42#define MAX1111_BATT_TEMP 2u
43#define MAX1111_ACIN_VOLT 6u 43#define MAX1111_ACIN_VOLT 6u
44 44
45extern struct battery_thresh spitz_battery_levels_acin[]; 45extern struct battery_thresh sharpsl_battery_levels_acin[];
46extern struct battery_thresh spitz_battery_levels_noac[]; 46extern struct battery_thresh sharpsl_battery_levels_noac[];
47int sharpsl_pm_pxa_read_max1111(int channel); 47int sharpsl_pm_pxa_read_max1111(int channel);
48 48
49 49
diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
index 629e05d1196e..463d874bb867 100644
--- a/arch/arm/mach-pxa/sharpsl_pm.c
+++ b/arch/arm/mach-pxa/sharpsl_pm.c
@@ -78,7 +78,7 @@ DEFINE_LED_TRIGGER(sharpsl_charge_led_trigger);
78 78
79 79
80 80
81struct battery_thresh spitz_battery_levels_acin[] = { 81struct battery_thresh sharpsl_battery_levels_acin[] = {
82 { 213, 100}, 82 { 213, 100},
83 { 212, 98}, 83 { 212, 98},
84 { 211, 95}, 84 { 211, 95},
@@ -121,7 +121,7 @@ struct battery_thresh spitz_battery_levels_acin[] = {
121 { 0, 0}, 121 { 0, 0},
122}; 122};
123 123
124struct battery_thresh spitz_battery_levels_noac[] = { 124struct battery_thresh sharpsl_battery_levels_noac[] = {
125 { 213, 100}, 125 { 213, 100},
126 { 212, 98}, 126 { 212, 98},
127 { 211, 95}, 127 { 211, 95},
@@ -165,19 +165,20 @@ struct battery_thresh spitz_battery_levels_noac[] = {
165}; 165};
166 166
167/* MAX1111 Commands */ 167/* MAX1111 Commands */
168#define MAXCTRL_PD0 1u << 0 168#define MAXCTRL_PD0 (1u << 0)
169#define MAXCTRL_PD1 1u << 1 169#define MAXCTRL_PD1 (1u << 1)
170#define MAXCTRL_SGL 1u << 2 170#define MAXCTRL_SGL (1u << 2)
171#define MAXCTRL_UNI 1u << 3 171#define MAXCTRL_UNI (1u << 3)
172#define MAXCTRL_SEL_SH 4 172#define MAXCTRL_SEL_SH 4
173#define MAXCTRL_STR 1u << 7 173#define MAXCTRL_STR (1u << 7)
174 174
175/* 175/*
176 * Read MAX1111 ADC 176 * Read MAX1111 ADC
177 */ 177 */
178int sharpsl_pm_pxa_read_max1111(int channel) 178int sharpsl_pm_pxa_read_max1111(int channel)
179{ 179{
180 if (machine_is_tosa()) // Ugly, better move this function into another module 180 /* Ugly, better move this function into another module */
181 if (machine_is_tosa())
181 return 0; 182 return 0;
182 183
183#ifdef CONFIG_CORGI_SSP_DEPRECATED 184#ifdef CONFIG_CORGI_SSP_DEPRECATED
@@ -238,7 +239,7 @@ EXPORT_SYMBOL(sharpsl_battery_kick);
238 239
239static void sharpsl_battery_thread(struct work_struct *private_) 240static void sharpsl_battery_thread(struct work_struct *private_)
240{ 241{
241 int voltage, percent, apm_status, i = 0; 242 int voltage, percent, apm_status, i;
242 243
243 if (!sharpsl_pm.machinfo) 244 if (!sharpsl_pm.machinfo)
244 return; 245 return;
@@ -250,15 +251,14 @@ static void sharpsl_battery_thread(struct work_struct *private_)
250 && time_after(jiffies, sharpsl_pm.charge_start_time + SHARPSL_CHARGE_ON_TIME_INTERVAL)) 251 && time_after(jiffies, sharpsl_pm.charge_start_time + SHARPSL_CHARGE_ON_TIME_INTERVAL))
251 schedule_delayed_work(&toggle_charger, 0); 252 schedule_delayed_work(&toggle_charger, 0);
252 253
253 while(1) { 254 for (i = 0; i < 5; i++) {
254 voltage = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT); 255 voltage = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT);
255 256 if (voltage > 0)
256 if (voltage > 0) break;
257 if (i++ > 5) {
258 voltage = sharpsl_pm.machinfo->bat_levels_noac[0].voltage;
259 dev_warn(sharpsl_pm.dev, "Warning: Cannot read main battery!\n");
260 break; 257 break;
261 } 258 }
259 if (voltage <= 0) {
260 voltage = sharpsl_pm.machinfo->bat_levels_noac[0].voltage;
261 dev_warn(sharpsl_pm.dev, "Warning: Cannot read main battery!\n");
262 } 262 }
263 263
264 voltage = sharpsl_average_value(voltage); 264 voltage = sharpsl_average_value(voltage);
@@ -266,8 +266,10 @@ static void sharpsl_battery_thread(struct work_struct *private_)
266 percent = get_percentage(voltage); 266 percent = get_percentage(voltage);
267 267
268 /* At low battery voltages, the voltage has a tendency to start 268 /* At low battery voltages, the voltage has a tendency to start
269 creeping back up so we try to avoid this here */ 269 creeping back up so we try to avoid this here */
270 if ((sharpsl_pm.battstat.ac_status == APM_AC_ONLINE) || (apm_status == APM_BATTERY_STATUS_HIGH) || percent <= sharpsl_pm.battstat.mainbat_percent) { 270 if ((sharpsl_pm.battstat.ac_status == APM_AC_ONLINE)
271 || (apm_status == APM_BATTERY_STATUS_HIGH)
272 || percent <= sharpsl_pm.battstat.mainbat_percent) {
271 sharpsl_pm.battstat.mainbat_voltage = voltage; 273 sharpsl_pm.battstat.mainbat_voltage = voltage;
272 sharpsl_pm.battstat.mainbat_status = apm_status; 274 sharpsl_pm.battstat.mainbat_status = apm_status;
273 sharpsl_pm.battstat.mainbat_percent = percent; 275 sharpsl_pm.battstat.mainbat_percent = percent;
@@ -279,8 +281,8 @@ static void sharpsl_battery_thread(struct work_struct *private_)
279#ifdef CONFIG_BACKLIGHT_CORGI 281#ifdef CONFIG_BACKLIGHT_CORGI
280 /* If battery is low. limit backlight intensity to save power. */ 282 /* If battery is low. limit backlight intensity to save power. */
281 if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE) 283 if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE)
282 && ((sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_LOW) || 284 && ((sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_LOW)
283 (sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_CRITICAL))) { 285 || (sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_CRITICAL))) {
284 if (!(sharpsl_pm.flags & SHARPSL_BL_LIMIT)) { 286 if (!(sharpsl_pm.flags & SHARPSL_BL_LIMIT)) {
285 sharpsl_pm.machinfo->backlight_limit(1); 287 sharpsl_pm.machinfo->backlight_limit(1);
286 sharpsl_pm.flags |= SHARPSL_BL_LIMIT; 288 sharpsl_pm.flags |= SHARPSL_BL_LIMIT;
@@ -293,8 +295,8 @@ static void sharpsl_battery_thread(struct work_struct *private_)
293 295
294 /* Suspend if critical battery level */ 296 /* Suspend if critical battery level */
295 if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE) 297 if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE)
296 && (sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_CRITICAL) 298 && (sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_CRITICAL)
297 && !(sharpsl_pm.flags & SHARPSL_APM_QUEUED)) { 299 && !(sharpsl_pm.flags & SHARPSL_APM_QUEUED)) {
298 sharpsl_pm.flags |= SHARPSL_APM_QUEUED; 300 sharpsl_pm.flags |= SHARPSL_APM_QUEUED;
299 dev_err(sharpsl_pm.dev, "Fatal Off\n"); 301 dev_err(sharpsl_pm.dev, "Fatal Off\n");
300 apm_queue_event(APM_CRITICAL_SUSPEND); 302 apm_queue_event(APM_CRITICAL_SUSPEND);
@@ -346,7 +348,7 @@ static void sharpsl_charge_error(void)
346 348
347static void sharpsl_charge_toggle(struct work_struct *private_) 349static void sharpsl_charge_toggle(struct work_struct *private_)
348{ 350{
349 dev_dbg(sharpsl_pm.dev, "Toogling Charger at time: %lx\n", jiffies); 351 dev_dbg(sharpsl_pm.dev, "Toggling Charger at time: %lx\n", jiffies);
350 352
351 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN)) { 353 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN)) {
352 sharpsl_charge_off(); 354 sharpsl_charge_off();
@@ -368,7 +370,7 @@ static void sharpsl_ac_timer(unsigned long data)
368{ 370{
369 int acin = sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN); 371 int acin = sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN);
370 372
371 dev_dbg(sharpsl_pm.dev, "AC Status: %d\n",acin); 373 dev_dbg(sharpsl_pm.dev, "AC Status: %d\n", acin);
372 374
373 sharpsl_average_clear(); 375 sharpsl_average_clear();
374 if (acin && (sharpsl_pm.charge_mode != CHRG_ON)) 376 if (acin && (sharpsl_pm.charge_mode != CHRG_ON))
@@ -472,14 +474,14 @@ static int sharpsl_average_value(int ad)
472 sharpsl_ad[sharpsl_ad_index] = ad; 474 sharpsl_ad[sharpsl_ad_index] = ad;
473 sharpsl_ad_index++; 475 sharpsl_ad_index++;
474 if (sharpsl_ad_index >= SHARPSL_CNV_VALUE_NUM) { 476 if (sharpsl_ad_index >= SHARPSL_CNV_VALUE_NUM) {
475 for (i=0; i < (SHARPSL_CNV_VALUE_NUM-1); i++) 477 for (i = 0; i < (SHARPSL_CNV_VALUE_NUM-1); i++)
476 sharpsl_ad[i] = sharpsl_ad[i+1]; 478 sharpsl_ad[i] = sharpsl_ad[i+1];
477 sharpsl_ad_index = SHARPSL_CNV_VALUE_NUM - 1; 479 sharpsl_ad_index = SHARPSL_CNV_VALUE_NUM - 1;
478 } 480 }
479 for (i=0; i < sharpsl_ad_index; i++) 481 for (i = 0; i < sharpsl_ad_index; i++)
480 ad_val += sharpsl_ad[i]; 482 ad_val += sharpsl_ad[i];
481 483
482 return (ad_val / sharpsl_ad_index); 484 return ad_val / sharpsl_ad_index;
483} 485}
484 486
485/* 487/*
@@ -492,8 +494,8 @@ static int get_select_val(int *val)
492 494
493 /* Find MAX val */ 495 /* Find MAX val */
494 temp = val[0]; 496 temp = val[0];
495 j=0; 497 j = 0;
496 for (i=1; i<5; i++) { 498 for (i = 1; i < 5; i++) {
497 if (temp < val[i]) { 499 if (temp < val[i]) {
498 temp = val[i]; 500 temp = val[i];
499 j = i; 501 j = i;
@@ -502,21 +504,21 @@ static int get_select_val(int *val)
502 504
503 /* Find MIN val */ 505 /* Find MIN val */
504 temp = val[4]; 506 temp = val[4];
505 k=4; 507 k = 4;
506 for (i=3; i>=0; i--) { 508 for (i = 3; i >= 0; i--) {
507 if (temp > val[i]) { 509 if (temp > val[i]) {
508 temp = val[i]; 510 temp = val[i];
509 k = i; 511 k = i;
510 } 512 }
511 } 513 }
512 514
513 for (i=0; i<5; i++) 515 for (i = 0; i < 5; i++)
514 if (i != j && i != k ) 516 if (i != j && i != k)
515 sum += val[i]; 517 sum += val[i];
516 518
517 dev_dbg(sharpsl_pm.dev, "Average: %d from values: %d, %d, %d, %d, %d\n", sum/3, val[0], val[1], val[2], val[3], val[4]); 519 dev_dbg(sharpsl_pm.dev, "Average: %d from values: %d, %d, %d, %d, %d\n", sum/3, val[0], val[1], val[2], val[3], val[4]);
518 520
519 return (sum/3); 521 return sum/3;
520} 522}
521 523
522static int sharpsl_check_battery_temp(void) 524static int sharpsl_check_battery_temp(void)
@@ -524,7 +526,7 @@ static int sharpsl_check_battery_temp(void)
524 int val, i, buff[5]; 526 int val, i, buff[5];
525 527
526 /* Check battery temperature */ 528 /* Check battery temperature */
527 for (i=0; i<5; i++) { 529 for (i = 0; i < 5; i++) {
528 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_TEMP); 530 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_TEMP);
529 sharpsl_pm.machinfo->measure_temp(1); 531 sharpsl_pm.machinfo->measure_temp(1);
530 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_TEMP); 532 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_TEMP);
@@ -557,7 +559,7 @@ static int sharpsl_check_battery_voltage(void)
557 sharpsl_pm.machinfo->discharge1(1); 559 sharpsl_pm.machinfo->discharge1(1);
558 560
559 /* Check battery voltage */ 561 /* Check battery voltage */
560 for (i=0; i<5; i++) { 562 for (i = 0; i < 5; i++) {
561 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT); 563 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT);
562 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_VOLT); 564 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_VOLT);
563 } 565 }
@@ -581,16 +583,16 @@ static int sharpsl_ac_check(void)
581{ 583{
582 int temp, i, buff[5]; 584 int temp, i, buff[5];
583 585
584 for (i=0; i<5; i++) { 586 for (i = 0; i < 5; i++) {
585 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_ACIN_VOLT); 587 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_ACIN_VOLT);
586 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_ACIN); 588 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_ACIN);
587 } 589 }
588 590
589 temp = get_select_val(buff); 591 temp = get_select_val(buff);
590 dev_dbg(sharpsl_pm.dev, "AC Voltage: %d\n",temp); 592 dev_dbg(sharpsl_pm.dev, "AC Voltage: %d\n", temp);
591 593
592 if ((temp > sharpsl_pm.machinfo->charge_acin_high) || (temp < sharpsl_pm.machinfo->charge_acin_low)) { 594 if ((temp > sharpsl_pm.machinfo->charge_acin_high) || (temp < sharpsl_pm.machinfo->charge_acin_low)) {
593 dev_err(sharpsl_pm.dev, "Error: AC check failed.\n"); 595 dev_err(sharpsl_pm.dev, "Error: AC check failed: voltage %d.\n", temp);
594 return -1; 596 return -1;
595 } 597 }
596 598
@@ -624,9 +626,9 @@ static int sharpsl_pm_resume(struct platform_device *pdev)
624 626
625static void corgi_goto_sleep(unsigned long alarm_time, unsigned int alarm_enable, suspend_state_t state) 627static void corgi_goto_sleep(unsigned long alarm_time, unsigned int alarm_enable, suspend_state_t state)
626{ 628{
627 dev_dbg(sharpsl_pm.dev, "Time is: %08x\n",RCNR); 629 dev_dbg(sharpsl_pm.dev, "Time is: %08x\n", RCNR);
628 630
629 dev_dbg(sharpsl_pm.dev, "Offline Charge Activate = %d\n",sharpsl_pm.flags & SHARPSL_DO_OFFLINE_CHRG); 631 dev_dbg(sharpsl_pm.dev, "Offline Charge Activate = %d\n", sharpsl_pm.flags & SHARPSL_DO_OFFLINE_CHRG);
630 /* not charging and AC-IN! */ 632 /* not charging and AC-IN! */
631 633
632 if ((sharpsl_pm.flags & SHARPSL_DO_OFFLINE_CHRG) && (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN))) { 634 if ((sharpsl_pm.flags & SHARPSL_DO_OFFLINE_CHRG) && (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN))) {
@@ -644,12 +646,12 @@ static void corgi_goto_sleep(unsigned long alarm_time, unsigned int alarm_enable
644 if ((sharpsl_pm.charge_mode == CHRG_ON) && ((alarm_enable && ((alarm_time - RCNR) > (SHARPSL_BATCHK_TIME_SUSPEND + 30))) || !alarm_enable)) { 646 if ((sharpsl_pm.charge_mode == CHRG_ON) && ((alarm_enable && ((alarm_time - RCNR) > (SHARPSL_BATCHK_TIME_SUSPEND + 30))) || !alarm_enable)) {
645 RTSR &= RTSR_ALE; 647 RTSR &= RTSR_ALE;
646 RTAR = RCNR + SHARPSL_BATCHK_TIME_SUSPEND; 648 RTAR = RCNR + SHARPSL_BATCHK_TIME_SUSPEND;
647 dev_dbg(sharpsl_pm.dev, "Charging alarm at: %08x\n",RTAR); 649 dev_dbg(sharpsl_pm.dev, "Charging alarm at: %08x\n", RTAR);
648 sharpsl_pm.flags |= SHARPSL_ALARM_ACTIVE; 650 sharpsl_pm.flags |= SHARPSL_ALARM_ACTIVE;
649 } else if (alarm_enable) { 651 } else if (alarm_enable) {
650 RTSR &= RTSR_ALE; 652 RTSR &= RTSR_ALE;
651 RTAR = alarm_time; 653 RTAR = alarm_time;
652 dev_dbg(sharpsl_pm.dev, "User alarm at: %08x\n",RTAR); 654 dev_dbg(sharpsl_pm.dev, "User alarm at: %08x\n", RTAR);
653 } else { 655 } else {
654 dev_dbg(sharpsl_pm.dev, "No alarms set.\n"); 656 dev_dbg(sharpsl_pm.dev, "No alarms set.\n");
655 } 657 }
@@ -658,19 +660,18 @@ static void corgi_goto_sleep(unsigned long alarm_time, unsigned int alarm_enable
658 660
659 sharpsl_pm.machinfo->postsuspend(); 661 sharpsl_pm.machinfo->postsuspend();
660 662
661 dev_dbg(sharpsl_pm.dev, "Corgi woken up from suspend: %08x\n",PEDR); 663 dev_dbg(sharpsl_pm.dev, "Corgi woken up from suspend: %08x\n", PEDR);
662} 664}
663 665
664static int corgi_enter_suspend(unsigned long alarm_time, unsigned int alarm_enable, suspend_state_t state) 666static int corgi_enter_suspend(unsigned long alarm_time, unsigned int alarm_enable, suspend_state_t state)
665{ 667{
666 if (!sharpsl_pm.machinfo->should_wakeup(!(sharpsl_pm.flags & SHARPSL_ALARM_ACTIVE) && alarm_enable) ) 668 if (!sharpsl_pm.machinfo->should_wakeup(!(sharpsl_pm.flags & SHARPSL_ALARM_ACTIVE) && alarm_enable)) {
667 {
668 if (!(sharpsl_pm.flags & SHARPSL_ALARM_ACTIVE)) { 669 if (!(sharpsl_pm.flags & SHARPSL_ALARM_ACTIVE)) {
669 dev_dbg(sharpsl_pm.dev, "No user triggered wakeup events and not charging. Strange. Suspend.\n"); 670 dev_dbg(sharpsl_pm.dev, "No user triggered wakeup events and not charging. Strange. Suspend.\n");
670 corgi_goto_sleep(alarm_time, alarm_enable, state); 671 corgi_goto_sleep(alarm_time, alarm_enable, state);
671 return 1; 672 return 1;
672 } 673 }
673 if(sharpsl_off_charge_battery()) { 674 if (sharpsl_off_charge_battery()) {
674 dev_dbg(sharpsl_pm.dev, "Charging. Suspend...\n"); 675 dev_dbg(sharpsl_pm.dev, "Charging. Suspend...\n");
675 corgi_goto_sleep(alarm_time, alarm_enable, state); 676 corgi_goto_sleep(alarm_time, alarm_enable, state);
676 return 1; 677 return 1;
@@ -697,7 +698,7 @@ static int corgi_pxa_pm_enter(suspend_state_t state)
697 698
698 corgi_goto_sleep(alarm_time, alarm_status, state); 699 corgi_goto_sleep(alarm_time, alarm_status, state);
699 700
700 while (corgi_enter_suspend(alarm_time,alarm_status,state)) 701 while (corgi_enter_suspend(alarm_time, alarm_status, state))
701 {} 702 {}
702 703
703 if (sharpsl_pm.machinfo->earlyresume) 704 if (sharpsl_pm.machinfo->earlyresume)
@@ -732,7 +733,7 @@ static int sharpsl_fatal_check(void)
732 sharpsl_pm.machinfo->discharge1(1); 733 sharpsl_pm.machinfo->discharge1(1);
733 734
734 /* Check battery : check inserting battery ? */ 735 /* Check battery : check inserting battery ? */
735 for (i=0; i<5; i++) { 736 for (i = 0; i < 5; i++) {
736 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT); 737 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT);
737 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_VOLT); 738 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_VOLT);
738 } 739 }
@@ -812,7 +813,7 @@ static int sharpsl_off_charge_battery(void)
812 mdelay(SHARPSL_CHARGE_CO_CHECK_TIME); 813 mdelay(SHARPSL_CHARGE_CO_CHECK_TIME);
813 814
814 time = RCNR; 815 time = RCNR;
815 while(1) { 816 while (1) {
816 /* Check if any wakeup event had occurred */ 817 /* Check if any wakeup event had occurred */
817 if (sharpsl_pm.machinfo->charger_wakeup() != 0) 818 if (sharpsl_pm.machinfo->charger_wakeup() != 0)
818 return 0; 819 return 0;
@@ -835,9 +836,9 @@ static int sharpsl_off_charge_battery(void)
835 mdelay(SHARPSL_CHARGE_CO_CHECK_TIME); 836 mdelay(SHARPSL_CHARGE_CO_CHECK_TIME);
836 837
837 time = RCNR; 838 time = RCNR;
838 while(1) { 839 while (1) {
839 /* Check if any wakeup event had occurred */ 840 /* Check if any wakeup event had occurred */
840 if (sharpsl_pm.machinfo->charger_wakeup() != 0) 841 if (sharpsl_pm.machinfo->charger_wakeup())
841 return 0; 842 return 0;
842 /* Check for timeout */ 843 /* Check for timeout */
843 if ((RCNR-time) > SHARPSL_WAIT_CO_TIME) { 844 if ((RCNR-time) > SHARPSL_WAIT_CO_TIME) {
@@ -864,12 +865,12 @@ static int sharpsl_off_charge_battery(void)
864 865
865static ssize_t battery_percentage_show(struct device *dev, struct device_attribute *attr, char *buf) 866static ssize_t battery_percentage_show(struct device *dev, struct device_attribute *attr, char *buf)
866{ 867{
867 return sprintf(buf, "%d\n",sharpsl_pm.battstat.mainbat_percent); 868 return sprintf(buf, "%d\n", sharpsl_pm.battstat.mainbat_percent);
868} 869}
869 870
870static ssize_t battery_voltage_show(struct device *dev, struct device_attribute *attr, char *buf) 871static ssize_t battery_voltage_show(struct device *dev, struct device_attribute *attr, char *buf)
871{ 872{
872 return sprintf(buf, "%d\n",sharpsl_pm.battstat.mainbat_voltage); 873 return sprintf(buf, "%d\n", sharpsl_pm.battstat.mainbat_voltage);
873} 874}
874 875
875static DEVICE_ATTR(battery_percentage, 0444, battery_percentage_show, NULL); 876static DEVICE_ATTR(battery_percentage, 0444, battery_percentage_show, NULL);
@@ -899,7 +900,7 @@ static struct platform_suspend_ops sharpsl_pm_ops = {
899}; 900};
900#endif 901#endif
901 902
902static int __init sharpsl_pm_probe(struct platform_device *pdev) 903static int __devinit sharpsl_pm_probe(struct platform_device *pdev)
903{ 904{
904 int ret; 905 int ret;
905 906
@@ -943,8 +944,7 @@ static int __init sharpsl_pm_probe(struct platform_device *pdev)
943 } 944 }
944 } 945 }
945 946
946 if (sharpsl_pm.machinfo->batfull_irq) 947 if (sharpsl_pm.machinfo->batfull_irq) {
947 {
948 /* Register interrupt handler. */ 948 /* Register interrupt handler. */
949 if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING, "CO", sharpsl_chrg_full_isr)) { 949 if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING, "CO", sharpsl_chrg_full_isr)) {
950 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull)); 950 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull));
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index d98023f55503..01bdd7500df4 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -56,25 +56,7 @@ static unsigned long spitz_pin_config[] __initdata = {
56 GPIO80_nCS_4, /* SCOOP #1 */ 56 GPIO80_nCS_4, /* SCOOP #1 */
57 57
58 /* LCD - 16bpp Active TFT */ 58 /* LCD - 16bpp Active TFT */
59 GPIO58_LCD_LDD_0, 59 GPIOxx_LCD_TFT_16BPP,
60 GPIO59_LCD_LDD_1,
61 GPIO60_LCD_LDD_2,
62 GPIO61_LCD_LDD_3,
63 GPIO62_LCD_LDD_4,
64 GPIO63_LCD_LDD_5,
65 GPIO64_LCD_LDD_6,
66 GPIO65_LCD_LDD_7,
67 GPIO66_LCD_LDD_8,
68 GPIO67_LCD_LDD_9,
69 GPIO68_LCD_LDD_10,
70 GPIO69_LCD_LDD_11,
71 GPIO70_LCD_LDD_12,
72 GPIO71_LCD_LDD_13,
73 GPIO72_LCD_LDD_14,
74 GPIO73_LCD_LDD_15,
75 GPIO74_LCD_FCLK,
76 GPIO75_LCD_LCLK,
77 GPIO76_LCD_PCLK,
78 60
79 /* PC Card */ 61 /* PC Card */
80 GPIO48_nPOE, 62 GPIO48_nPOE,
@@ -381,7 +363,7 @@ static struct gpio_keys_button spitz_gpio_keys[] = {
381 .type = EV_PWR, 363 .type = EV_PWR,
382 .code = KEY_SUSPEND, 364 .code = KEY_SUSPEND,
383 .gpio = SPITZ_GPIO_ON_KEY, 365 .gpio = SPITZ_GPIO_ON_KEY,
384 .desc = "On/Off", 366 .desc = "On Off",
385 .wakeup = 1, 367 .wakeup = 1,
386 }, 368 },
387 /* Two buttons detecting the lid state */ 369 /* Two buttons detecting the lid state */
@@ -389,13 +371,13 @@ static struct gpio_keys_button spitz_gpio_keys[] = {
389 .type = EV_SW, 371 .type = EV_SW,
390 .code = 0, 372 .code = 0,
391 .gpio = SPITZ_GPIO_SWA, 373 .gpio = SPITZ_GPIO_SWA,
392 .desc = "Display Down", 374 .desc = "Display Down",
393 }, 375 },
394 { 376 {
395 .type = EV_SW, 377 .type = EV_SW,
396 .code = 1, 378 .code = 1,
397 .gpio = SPITZ_GPIO_SWB, 379 .gpio = SPITZ_GPIO_SWB,
398 .desc = "Lid Closed", 380 .desc = "Lid Closed",
399 }, 381 },
400}; 382};
401 383
@@ -768,6 +750,10 @@ static void __init common_init(void)
768 750
769 pxa2xx_mfp_config(ARRAY_AND_SIZE(spitz_pin_config)); 751 pxa2xx_mfp_config(ARRAY_AND_SIZE(spitz_pin_config));
770 752
753 pxa_set_ffuart_info(NULL);
754 pxa_set_btuart_info(NULL);
755 pxa_set_stuart_info(NULL);
756
771 spitz_init_spi(); 757 spitz_init_spi();
772 758
773 platform_add_devices(devices, ARRAY_SIZE(devices)); 759 platform_add_devices(devices, ARRAY_SIZE(devices));
diff --git a/arch/arm/mach-pxa/spitz_pm.c b/arch/arm/mach-pxa/spitz_pm.c
index 724ffb030317..fc5a70c40358 100644
--- a/arch/arm/mach-pxa/spitz_pm.c
+++ b/arch/arm/mach-pxa/spitz_pm.c
@@ -103,7 +103,7 @@ static void spitz_presuspend(void)
103 PFER = GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET); 103 PFER = GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET);
104 PWER = GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET) | PWER_RTC; 104 PWER = GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET) | PWER_RTC;
105 PKWR = GPIO_bit(SPITZ_GPIO_SYNC) | GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET); 105 PKWR = GPIO_bit(SPITZ_GPIO_SYNC) | GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET);
106 PKSR = 0xffffffff; // clear 106 PKSR = 0xffffffff; /* clear */
107 107
108 /* nRESET_OUT Disable */ 108 /* nRESET_OUT Disable */
109 PSLR |= PSLR_SL_ROD; 109 PSLR |= PSLR_SL_ROD;
@@ -149,7 +149,7 @@ static int spitz_should_wakeup(unsigned int resume_on_alarm)
149 if (resume_on_alarm && (PEDR & PWER_RTC)) 149 if (resume_on_alarm && (PEDR & PWER_RTC))
150 is_resume |= PWER_RTC; 150 is_resume |= PWER_RTC;
151 151
152 dev_dbg(sharpsl_pm.dev, "is_resume: %x\n",is_resume); 152 dev_dbg(sharpsl_pm.dev, "is_resume: %x\n", is_resume);
153 return is_resume; 153 return is_resume;
154} 154}
155 155
@@ -160,7 +160,7 @@ static unsigned long spitz_charger_wakeup(void)
160 160
161unsigned long spitzpm_read_devdata(int type) 161unsigned long spitzpm_read_devdata(int type)
162{ 162{
163 switch(type) { 163 switch (type) {
164 case SHARPSL_STATUS_ACIN: 164 case SHARPSL_STATUS_ACIN:
165 return (((~GPLR(SPITZ_GPIO_AC_IN)) & GPIO_bit(SPITZ_GPIO_AC_IN)) != 0); 165 return (((~GPLR(SPITZ_GPIO_AC_IN)) & GPIO_bit(SPITZ_GPIO_AC_IN)) != 0);
166 case SHARPSL_STATUS_LOCK: 166 case SHARPSL_STATUS_LOCK:
@@ -199,7 +199,7 @@ struct sharpsl_charger_machinfo spitz_pm_machinfo = {
199#if defined(CONFIG_LCD_CORGI) 199#if defined(CONFIG_LCD_CORGI)
200 .backlight_limit = corgi_lcd_limit_intensity, 200 .backlight_limit = corgi_lcd_limit_intensity,
201#elif defined(CONFIG_BACKLIGHT_CORGI) 201#elif defined(CONFIG_BACKLIGHT_CORGI)
202 .backlight_limit = corgibl_limit_intensity, 202 .backlight_limit = corgibl_limit_intensity,
203#endif 203#endif
204 .charge_on_volt = SHARPSL_CHARGE_ON_VOLT, 204 .charge_on_volt = SHARPSL_CHARGE_ON_VOLT,
205 .charge_on_temp = SHARPSL_CHARGE_ON_TEMP, 205 .charge_on_temp = SHARPSL_CHARGE_ON_TEMP,
@@ -208,8 +208,8 @@ struct sharpsl_charger_machinfo spitz_pm_machinfo = {
208 .fatal_acin_volt = SHARPSL_FATAL_ACIN_VOLT, 208 .fatal_acin_volt = SHARPSL_FATAL_ACIN_VOLT,
209 .fatal_noacin_volt= SHARPSL_FATAL_NOACIN_VOLT, 209 .fatal_noacin_volt= SHARPSL_FATAL_NOACIN_VOLT,
210 .bat_levels = 40, 210 .bat_levels = 40,
211 .bat_levels_noac = spitz_battery_levels_noac, 211 .bat_levels_noac = sharpsl_battery_levels_noac,
212 .bat_levels_acin = spitz_battery_levels_acin, 212 .bat_levels_acin = sharpsl_battery_levels_acin,
213 .status_high_acin = 188, 213 .status_high_acin = 188,
214 .status_low_acin = 178, 214 .status_low_acin = 178,
215 .status_high_noac = 185, 215 .status_high_noac = 185,
@@ -241,7 +241,7 @@ static int __devinit spitzpm_init(void)
241 241
242static void spitzpm_exit(void) 242static void spitzpm_exit(void)
243{ 243{
244 platform_device_unregister(spitzpm_device); 244 platform_device_unregister(spitzpm_device);
245} 245}
246 246
247module_init(spitzpm_init); 247module_init(spitzpm_init);
diff --git a/arch/arm/mach-pxa/ssp.c b/arch/arm/mach-pxa/ssp.c
index 965e38c6bafe..a81d6dbf662d 100644
--- a/arch/arm/mach-pxa/ssp.c
+++ b/arch/arm/mach-pxa/ssp.c
@@ -35,6 +35,8 @@
35#include <mach/ssp.h> 35#include <mach/ssp.h>
36#include <mach/regs-ssp.h> 36#include <mach/regs-ssp.h>
37 37
38#ifdef CONFIG_PXA_SSP_LEGACY
39
38#define TIMEOUT 100000 40#define TIMEOUT 100000
39 41
40static irqreturn_t ssp_interrupt(int irq, void *dev_id) 42static irqreturn_t ssp_interrupt(int irq, void *dev_id)
@@ -303,6 +305,7 @@ void ssp_exit(struct ssp_dev *dev)
303 clk_disable(ssp->clk); 305 clk_disable(ssp->clk);
304 ssp_free(ssp); 306 ssp_free(ssp);
305} 307}
308#endif /* CONFIG_PXA_SSP_LEGACY */
306 309
307static DEFINE_MUTEX(ssp_lock); 310static DEFINE_MUTEX(ssp_lock);
308static LIST_HEAD(ssp_list); 311static LIST_HEAD(ssp_list);
@@ -342,8 +345,9 @@ void ssp_free(struct ssp_device *ssp)
342} 345}
343EXPORT_SYMBOL(ssp_free); 346EXPORT_SYMBOL(ssp_free);
344 347
345static int __devinit ssp_probe(struct platform_device *pdev, int type) 348static int __devinit ssp_probe(struct platform_device *pdev)
346{ 349{
350 const struct platform_device_id *id = platform_get_device_id(pdev);
347 struct resource *res; 351 struct resource *res;
348 struct ssp_device *ssp; 352 struct ssp_device *ssp;
349 int ret = 0; 353 int ret = 0;
@@ -413,7 +417,7 @@ static int __devinit ssp_probe(struct platform_device *pdev, int type)
413 */ 417 */
414 ssp->port_id = pdev->id + 1; 418 ssp->port_id = pdev->id + 1;
415 ssp->use_count = 0; 419 ssp->use_count = 0;
416 ssp->type = type; 420 ssp->type = (int)id->driver_data;
417 421
418 mutex_lock(&ssp_lock); 422 mutex_lock(&ssp_lock);
419 list_add(&ssp->node, &ssp_list); 423 list_add(&ssp->node, &ssp_list);
@@ -457,80 +461,37 @@ static int __devexit ssp_remove(struct platform_device *pdev)
457 return 0; 461 return 0;
458} 462}
459 463
460static int __devinit pxa25x_ssp_probe(struct platform_device *pdev) 464static const struct platform_device_id ssp_id_table[] = {
461{ 465 { "pxa25x-ssp", PXA25x_SSP },
462 return ssp_probe(pdev, PXA25x_SSP); 466 { "pxa25x-nssp", PXA25x_NSSP },
463} 467 { "pxa27x-ssp", PXA27x_SSP },
464 468 { },
465static int __devinit pxa25x_nssp_probe(struct platform_device *pdev)
466{
467 return ssp_probe(pdev, PXA25x_NSSP);
468}
469
470static int __devinit pxa27x_ssp_probe(struct platform_device *pdev)
471{
472 return ssp_probe(pdev, PXA27x_SSP);
473}
474
475static struct platform_driver pxa25x_ssp_driver = {
476 .driver = {
477 .name = "pxa25x-ssp",
478 },
479 .probe = pxa25x_ssp_probe,
480 .remove = __devexit_p(ssp_remove),
481}; 469};
482 470
483static struct platform_driver pxa25x_nssp_driver = { 471static struct platform_driver ssp_driver = {
484 .driver = { 472 .probe = ssp_probe,
485 .name = "pxa25x-nssp",
486 },
487 .probe = pxa25x_nssp_probe,
488 .remove = __devexit_p(ssp_remove), 473 .remove = __devexit_p(ssp_remove),
489};
490
491static struct platform_driver pxa27x_ssp_driver = {
492 .driver = { 474 .driver = {
493 .name = "pxa27x-ssp", 475 .owner = THIS_MODULE,
476 .name = "pxa2xx-ssp",
494 }, 477 },
495 .probe = pxa27x_ssp_probe, 478 .id_table = ssp_id_table,
496 .remove = __devexit_p(ssp_remove),
497}; 479};
498 480
499static int __init pxa_ssp_init(void) 481static int __init pxa_ssp_init(void)
500{ 482{
501 int ret = 0; 483 return platform_driver_register(&ssp_driver);
502
503 ret = platform_driver_register(&pxa25x_ssp_driver);
504 if (ret) {
505 printk(KERN_ERR "failed to register pxa25x_ssp_driver");
506 return ret;
507 }
508
509 ret = platform_driver_register(&pxa25x_nssp_driver);
510 if (ret) {
511 printk(KERN_ERR "failed to register pxa25x_nssp_driver");
512 return ret;
513 }
514
515 ret = platform_driver_register(&pxa27x_ssp_driver);
516 if (ret) {
517 printk(KERN_ERR "failed to register pxa27x_ssp_driver");
518 return ret;
519 }
520
521 return ret;
522} 484}
523 485
524static void __exit pxa_ssp_exit(void) 486static void __exit pxa_ssp_exit(void)
525{ 487{
526 platform_driver_unregister(&pxa25x_ssp_driver); 488 platform_driver_unregister(&ssp_driver);
527 platform_driver_unregister(&pxa25x_nssp_driver);
528 platform_driver_unregister(&pxa27x_ssp_driver);
529} 489}
530 490
531arch_initcall(pxa_ssp_init); 491arch_initcall(pxa_ssp_init);
532module_exit(pxa_ssp_exit); 492module_exit(pxa_ssp_exit);
533 493
494#ifdef CONFIG_PXA_SSP_LEGACY
534EXPORT_SYMBOL(ssp_write_word); 495EXPORT_SYMBOL(ssp_write_word);
535EXPORT_SYMBOL(ssp_read_word); 496EXPORT_SYMBOL(ssp_read_word);
536EXPORT_SYMBOL(ssp_flush); 497EXPORT_SYMBOL(ssp_flush);
@@ -541,6 +502,7 @@ EXPORT_SYMBOL(ssp_restore_state);
541EXPORT_SYMBOL(ssp_init); 502EXPORT_SYMBOL(ssp_init);
542EXPORT_SYMBOL(ssp_exit); 503EXPORT_SYMBOL(ssp_exit);
543EXPORT_SYMBOL(ssp_config); 504EXPORT_SYMBOL(ssp_config);
505#endif
544 506
545MODULE_DESCRIPTION("PXA SSP driver"); 507MODULE_DESCRIPTION("PXA SSP driver");
546MODULE_AUTHOR("Liam Girdwood"); 508MODULE_AUTHOR("Liam Girdwood");
diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c
index 3b205b69f3fb..2041eb1d90ba 100644
--- a/arch/arm/mach-pxa/stargate2.c
+++ b/arch/arm/mach-pxa/stargate2.c
@@ -760,10 +760,9 @@ static void __init stargate2_init(void)
760 760
761 pxa2xx_mfp_config(ARRAY_AND_SIZE(stargate2_pin_config)); 761 pxa2xx_mfp_config(ARRAY_AND_SIZE(stargate2_pin_config));
762 762
763 /* spi chip selects */ 763 pxa_set_ffuart_info(NULL);
764 gpio_direction_output(37, 0); 764 pxa_set_btuart_info(NULL);
765 gpio_direction_output(24, 0); 765 pxa_set_stuart_info(NULL);
766 gpio_direction_output(39, 0);
767 766
768 platform_add_devices(ARRAY_AND_SIZE(stargate2_devices)); 767 platform_add_devices(ARRAY_AND_SIZE(stargate2_devices));
769 768
diff --git a/arch/arm/mach-pxa/tavorevb.c b/arch/arm/mach-pxa/tavorevb.c
index b75353a2ec75..f02dcb5b4e97 100644
--- a/arch/arm/mach-pxa/tavorevb.c
+++ b/arch/arm/mach-pxa/tavorevb.c
@@ -477,6 +477,10 @@ static void __init tavorevb_init(void)
477 /* initialize MFP configurations */ 477 /* initialize MFP configurations */
478 pxa3xx_mfp_config(ARRAY_AND_SIZE(tavorevb_mfp_cfg)); 478 pxa3xx_mfp_config(ARRAY_AND_SIZE(tavorevb_mfp_cfg));
479 479
480 pxa_set_ffuart_info(NULL);
481 pxa_set_btuart_info(NULL);
482 pxa_set_stuart_info(NULL);
483
480 platform_device_register(&smc91x_device); 484 platform_device_register(&smc91x_device);
481 485
482 tavorevb_init_lcd(); 486 tavorevb_init_lcd();
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c
index 750c448db672..293e40aeaf29 100644
--- a/arch/arm/mach-pxa/time.c
+++ b/arch/arm/mach-pxa/time.c
@@ -76,14 +76,12 @@ pxa_ost0_interrupt(int irq, void *dev_id)
76static int 76static int
77pxa_osmr0_set_next_event(unsigned long delta, struct clock_event_device *dev) 77pxa_osmr0_set_next_event(unsigned long delta, struct clock_event_device *dev)
78{ 78{
79 unsigned long flags, next, oscr; 79 unsigned long next, oscr;
80 80
81 raw_local_irq_save(flags);
82 OIER |= OIER_E0; 81 OIER |= OIER_E0;
83 next = OSCR + delta; 82 next = OSCR + delta;
84 OSMR0 = next; 83 OSMR0 = next;
85 oscr = OSCR; 84 oscr = OSCR;
86 raw_local_irq_restore(flags);
87 85
88 return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0; 86 return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0;
89} 87}
@@ -91,23 +89,17 @@ pxa_osmr0_set_next_event(unsigned long delta, struct clock_event_device *dev)
91static void 89static void
92pxa_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *dev) 90pxa_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *dev)
93{ 91{
94 unsigned long irqflags;
95
96 switch (mode) { 92 switch (mode) {
97 case CLOCK_EVT_MODE_ONESHOT: 93 case CLOCK_EVT_MODE_ONESHOT:
98 raw_local_irq_save(irqflags);
99 OIER &= ~OIER_E0; 94 OIER &= ~OIER_E0;
100 OSSR = OSSR_M0; 95 OSSR = OSSR_M0;
101 raw_local_irq_restore(irqflags);
102 break; 96 break;
103 97
104 case CLOCK_EVT_MODE_UNUSED: 98 case CLOCK_EVT_MODE_UNUSED:
105 case CLOCK_EVT_MODE_SHUTDOWN: 99 case CLOCK_EVT_MODE_SHUTDOWN:
106 /* initializing, released, or preparing for suspend */ 100 /* initializing, released, or preparing for suspend */
107 raw_local_irq_save(irqflags);
108 OIER &= ~OIER_E0; 101 OIER &= ~OIER_E0;
109 OSSR = OSSR_M0; 102 OSSR = OSSR_M0;
110 raw_local_irq_restore(irqflags);
111 break; 103 break;
112 104
113 case CLOCK_EVT_MODE_RESUME: 105 case CLOCK_EVT_MODE_RESUME:
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index e81a52673d49..ad552791c4ce 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -32,6 +32,7 @@
32#include <linux/gpio.h> 32#include <linux/gpio.h>
33#include <linux/pda_power.h> 33#include <linux/pda_power.h>
34#include <linux/spi/spi.h> 34#include <linux/spi/spi.h>
35#include <linux/input/matrix_keypad.h>
35 36
36#include <asm/setup.h> 37#include <asm/setup.h>
37#include <asm/mach-types.h> 38#include <asm/mach-types.h>
@@ -131,24 +132,24 @@ static unsigned long tosa_pin_config[] = {
131 GPIO45_BTUART_RTS, 132 GPIO45_BTUART_RTS,
132 133
133 /* Keybd */ 134 /* Keybd */
134 GPIO58_GPIO | MFP_LPM_DRIVE_LOW, 135 GPIO58_GPIO | MFP_LPM_DRIVE_LOW, /* Column 0 */
135 GPIO59_GPIO | MFP_LPM_DRIVE_LOW, 136 GPIO59_GPIO | MFP_LPM_DRIVE_LOW, /* Column 1 */
136 GPIO60_GPIO | MFP_LPM_DRIVE_LOW, 137 GPIO60_GPIO | MFP_LPM_DRIVE_LOW, /* Column 2 */
137 GPIO61_GPIO | MFP_LPM_DRIVE_LOW, 138 GPIO61_GPIO | MFP_LPM_DRIVE_LOW, /* Column 3 */
138 GPIO62_GPIO | MFP_LPM_DRIVE_LOW, 139 GPIO62_GPIO | MFP_LPM_DRIVE_LOW, /* Column 4 */
139 GPIO63_GPIO | MFP_LPM_DRIVE_LOW, 140 GPIO63_GPIO | MFP_LPM_DRIVE_LOW, /* Column 5 */
140 GPIO64_GPIO | MFP_LPM_DRIVE_LOW, 141 GPIO64_GPIO | MFP_LPM_DRIVE_LOW, /* Column 6 */
141 GPIO65_GPIO | MFP_LPM_DRIVE_LOW, 142 GPIO65_GPIO | MFP_LPM_DRIVE_LOW, /* Column 7 */
142 GPIO66_GPIO | MFP_LPM_DRIVE_LOW, 143 GPIO66_GPIO | MFP_LPM_DRIVE_LOW, /* Column 8 */
143 GPIO67_GPIO | MFP_LPM_DRIVE_LOW, 144 GPIO67_GPIO | MFP_LPM_DRIVE_LOW, /* Column 9 */
144 GPIO68_GPIO | MFP_LPM_DRIVE_LOW, 145 GPIO68_GPIO | MFP_LPM_DRIVE_LOW, /* Column 10 */
145 GPIO69_GPIO | MFP_LPM_DRIVE_LOW, 146 GPIO69_GPIO | MFP_LPM_DRIVE_LOW, /* Row 0 */
146 GPIO70_GPIO | MFP_LPM_DRIVE_LOW, 147 GPIO70_GPIO | MFP_LPM_DRIVE_LOW, /* Row 1 */
147 GPIO71_GPIO | MFP_LPM_DRIVE_LOW, 148 GPIO71_GPIO | MFP_LPM_DRIVE_LOW, /* Row 2 */
148 GPIO72_GPIO | MFP_LPM_DRIVE_LOW, 149 GPIO72_GPIO | MFP_LPM_DRIVE_LOW, /* Row 3 */
149 GPIO73_GPIO | MFP_LPM_DRIVE_LOW, 150 GPIO73_GPIO | MFP_LPM_DRIVE_LOW, /* Row 4 */
150 GPIO74_GPIO | MFP_LPM_DRIVE_LOW, 151 GPIO74_GPIO | MFP_LPM_DRIVE_LOW, /* Row 5 */
151 GPIO75_GPIO | MFP_LPM_DRIVE_LOW, 152 GPIO75_GPIO | MFP_LPM_DRIVE_LOW, /* Row 6 */
152 153
153 /* SPI */ 154 /* SPI */
154 GPIO81_SSP2_CLK_OUT, 155 GPIO81_SSP2_CLK_OUT,
@@ -411,9 +412,87 @@ static struct platform_device tosa_power_device = {
411/* 412/*
412 * Tosa Keyboard 413 * Tosa Keyboard
413 */ 414 */
415static const uint32_t tosakbd_keymap[] = {
416 KEY(0, 2, KEY_W),
417 KEY(0, 6, KEY_K),
418 KEY(0, 7, KEY_BACKSPACE),
419 KEY(0, 8, KEY_P),
420 KEY(1, 1, KEY_Q),
421 KEY(1, 2, KEY_E),
422 KEY(1, 3, KEY_T),
423 KEY(1, 4, KEY_Y),
424 KEY(1, 6, KEY_O),
425 KEY(1, 7, KEY_I),
426 KEY(1, 8, KEY_COMMA),
427 KEY(2, 1, KEY_A),
428 KEY(2, 2, KEY_D),
429 KEY(2, 3, KEY_G),
430 KEY(2, 4, KEY_U),
431 KEY(2, 6, KEY_L),
432 KEY(2, 7, KEY_ENTER),
433 KEY(2, 8, KEY_DOT),
434 KEY(3, 1, KEY_Z),
435 KEY(3, 2, KEY_C),
436 KEY(3, 3, KEY_V),
437 KEY(3, 4, KEY_J),
438 KEY(3, 5, TOSA_KEY_ADDRESSBOOK),
439 KEY(3, 6, TOSA_KEY_CANCEL),
440 KEY(3, 7, TOSA_KEY_CENTER),
441 KEY(3, 8, TOSA_KEY_OK),
442 KEY(3, 9, KEY_LEFTSHIFT),
443 KEY(4, 1, KEY_S),
444 KEY(4, 2, KEY_R),
445 KEY(4, 3, KEY_B),
446 KEY(4, 4, KEY_N),
447 KEY(4, 5, TOSA_KEY_CALENDAR),
448 KEY(4, 6, TOSA_KEY_HOMEPAGE),
449 KEY(4, 7, KEY_LEFTCTRL),
450 KEY(4, 8, TOSA_KEY_LIGHT),
451 KEY(4, 10, KEY_RIGHTSHIFT),
452 KEY(5, 1, KEY_TAB),
453 KEY(5, 2, KEY_SLASH),
454 KEY(5, 3, KEY_H),
455 KEY(5, 4, KEY_M),
456 KEY(5, 5, TOSA_KEY_MENU),
457 KEY(5, 7, KEY_UP),
458 KEY(5, 11, TOSA_KEY_FN),
459 KEY(6, 1, KEY_X),
460 KEY(6, 2, KEY_F),
461 KEY(6, 3, KEY_SPACE),
462 KEY(6, 4, KEY_APOSTROPHE),
463 KEY(6, 5, TOSA_KEY_MAIL),
464 KEY(6, 6, KEY_LEFT),
465 KEY(6, 7, KEY_DOWN),
466 KEY(6, 8, KEY_RIGHT),
467};
468
469static struct matrix_keymap_data tosakbd_keymap_data = {
470 .keymap = tosakbd_keymap,
471 .keymap_size = ARRAY_SIZE(tosakbd_keymap),
472};
473
474static const int tosakbd_col_gpios[] =
475 { 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68 };
476static const int tosakbd_row_gpios[] =
477 { 69, 70, 71, 72, 73, 74, 75 };
478
479static struct matrix_keypad_platform_data tosakbd_pdata = {
480 .keymap_data = &tosakbd_keymap_data,
481 .row_gpios = tosakbd_row_gpios,
482 .col_gpios = tosakbd_col_gpios,
483 .num_row_gpios = ARRAY_SIZE(tosakbd_row_gpios),
484 .num_col_gpios = ARRAY_SIZE(tosakbd_col_gpios),
485 .col_scan_delay_us = 10,
486 .debounce_ms = 10,
487 .wakeup = 1,
488};
489
414static struct platform_device tosakbd_device = { 490static struct platform_device tosakbd_device = {
415 .name = "tosa-keyboard", 491 .name = "matrix-keypad",
416 .id = -1, 492 .id = -1,
493 .dev = {
494 .platform_data = &tosakbd_pdata,
495 },
417}; 496};
418 497
419static struct gpio_keys_button tosa_gpio_keys[] = { 498static struct gpio_keys_button tosa_gpio_keys[] = {
@@ -825,6 +904,11 @@ static void __init tosa_init(void)
825 int dummy; 904 int dummy;
826 905
827 pxa2xx_mfp_config(ARRAY_AND_SIZE(tosa_pin_config)); 906 pxa2xx_mfp_config(ARRAY_AND_SIZE(tosa_pin_config));
907
908 pxa_set_ffuart_info(NULL);
909 pxa_set_btuart_info(NULL);
910 pxa_set_stuart_info(NULL);
911
828 gpio_set_wake(MFP_PIN_GPIO1, 1); 912 gpio_set_wake(MFP_PIN_GPIO1, 1);
829 /* We can't pass to gpio-keys since it will drop the Reset altfunc */ 913 /* We can't pass to gpio-keys since it will drop the Reset altfunc */
830 914
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c
index 3981e0356d12..797f2544d0ce 100644
--- a/arch/arm/mach-pxa/trizeps4.c
+++ b/arch/arm/mach-pxa/trizeps4.c
@@ -72,27 +72,14 @@ static unsigned long trizeps4_pin_config[] __initdata = {
72 GPIO79_nCS_3, /* Logic CS */ 72 GPIO79_nCS_3, /* Logic CS */
73 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE, /* Logic irq */ 73 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE, /* Logic irq */
74 74
75 /* AC97 */
76 GPIO28_AC97_BITCLK,
77 GPIO29_AC97_SDATA_IN_0,
78 GPIO30_AC97_SDATA_OUT,
79 GPIO31_AC97_SYNC,
80
75 /* LCD - 16bpp Active TFT */ 81 /* LCD - 16bpp Active TFT */
76 GPIO58_LCD_LDD_0, 82 GPIOxx_LCD_TFT_16BPP,
77 GPIO59_LCD_LDD_1,
78 GPIO60_LCD_LDD_2,
79 GPIO61_LCD_LDD_3,
80 GPIO62_LCD_LDD_4,
81 GPIO63_LCD_LDD_5,
82 GPIO64_LCD_LDD_6,
83 GPIO65_LCD_LDD_7,
84 GPIO66_LCD_LDD_8,
85 GPIO67_LCD_LDD_9,
86 GPIO68_LCD_LDD_10,
87 GPIO69_LCD_LDD_11,
88 GPIO70_LCD_LDD_12,
89 GPIO71_LCD_LDD_13,
90 GPIO72_LCD_LDD_14,
91 GPIO73_LCD_LDD_15,
92 GPIO74_LCD_FCLK,
93 GPIO75_LCD_LCLK,
94 GPIO76_LCD_PCLK,
95 GPIO77_LCD_BIAS,
96 83
97 /* UART */ 84 /* UART */
98 GPIO9_FFUART_CTS, 85 GPIO9_FFUART_CTS,
@@ -524,6 +511,10 @@ static void __init trizeps4_init(void)
524 ARRAY_SIZE(trizeps4_devices)); 511 ARRAY_SIZE(trizeps4_devices));
525 } 512 }
526 513
514 pxa_set_ffuart_info(NULL);
515 pxa_set_btuart_info(NULL);
516 pxa_set_stuart_info(NULL);
517
527 if (0) /* dont know how to determine LCD */ 518 if (0) /* dont know how to determine LCD */
528 set_pxa_fb_info(&sharp_lcd); 519 set_pxa_fb_info(&sharp_lcd);
529 else 520 else
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
index d33c232b686c..e90114a7e246 100644
--- a/arch/arm/mach-pxa/viper.c
+++ b/arch/arm/mach-pxa/viper.c
@@ -27,12 +27,14 @@
27#include <linux/delay.h> 27#include <linux/delay.h>
28#include <linux/fs.h> 28#include <linux/fs.h>
29#include <linux/init.h> 29#include <linux/init.h>
30#include <linux/slab.h>
30#include <linux/interrupt.h> 31#include <linux/interrupt.h>
31#include <linux/major.h> 32#include <linux/major.h>
32#include <linux/module.h> 33#include <linux/module.h>
33#include <linux/pm.h> 34#include <linux/pm.h>
34#include <linux/sched.h> 35#include <linux/sched.h>
35#include <linux/gpio.h> 36#include <linux/gpio.h>
37#include <linux/jiffies.h>
36#include <linux/i2c-gpio.h> 38#include <linux/i2c-gpio.h>
37#include <linux/serial_8250.h> 39#include <linux/serial_8250.h>
38#include <linux/smc91x.h> 40#include <linux/smc91x.h>
@@ -47,6 +49,7 @@
47#include <mach/pxafb.h> 49#include <mach/pxafb.h>
48#include <plat/i2c.h> 50#include <plat/i2c.h>
49#include <mach/regs-uart.h> 51#include <mach/regs-uart.h>
52#include <mach/arcom-pcmcia.h>
50#include <mach/viper.h> 53#include <mach/viper.h>
51 54
52#include <asm/setup.h> 55#include <asm/setup.h>
@@ -76,14 +79,28 @@ static void viper_icr_clear_bit(unsigned int bit)
76} 79}
77 80
78/* This function is used from the pcmcia module to reset the CF */ 81/* This function is used from the pcmcia module to reset the CF */
79void viper_cf_rst(int state) 82static void viper_cf_reset(int state)
80{ 83{
81 if (state) 84 if (state)
82 viper_icr_set_bit(VIPER_ICR_CF_RST); 85 viper_icr_set_bit(VIPER_ICR_CF_RST);
83 else 86 else
84 viper_icr_clear_bit(VIPER_ICR_CF_RST); 87 viper_icr_clear_bit(VIPER_ICR_CF_RST);
85} 88}
86EXPORT_SYMBOL(viper_cf_rst); 89
90static struct arcom_pcmcia_pdata viper_pcmcia_info = {
91 .cd_gpio = VIPER_CF_CD_GPIO,
92 .rdy_gpio = VIPER_CF_RDY_GPIO,
93 .pwr_gpio = VIPER_CF_POWER_GPIO,
94 .reset = viper_cf_reset,
95};
96
97static struct platform_device viper_pcmcia_device = {
98 .name = "viper-pcmcia",
99 .id = -1,
100 .dev = {
101 .platform_data = &viper_pcmcia_info,
102 },
103};
87 104
88/* 105/*
89 * The CPLD version register was not present on VIPER boards prior to 106 * The CPLD version register was not present on VIPER boards prior to
@@ -266,7 +283,7 @@ static void viper_irq_handler(unsigned int irq, struct irq_desc *desc)
266 do { 283 do {
267 /* we're in a chained irq handler, 284 /* we're in a chained irq handler,
268 * so ack the interrupt by hand */ 285 * so ack the interrupt by hand */
269 GEDR(VIPER_CPLD_GPIO) = GPIO_bit(VIPER_CPLD_GPIO); 286 desc->chip->ack(irq);
270 287
271 if (likely(pending)) { 288 if (likely(pending)) {
272 irq = viper_bit_to_irq(__ffs(pending)); 289 irq = viper_bit_to_irq(__ffs(pending));
@@ -301,15 +318,6 @@ static void __init viper_init_irq(void)
301 set_irq_chained_handler(gpio_to_irq(VIPER_CPLD_GPIO), 318 set_irq_chained_handler(gpio_to_irq(VIPER_CPLD_GPIO),
302 viper_irq_handler); 319 viper_irq_handler);
303 set_irq_type(gpio_to_irq(VIPER_CPLD_GPIO), IRQ_TYPE_EDGE_BOTH); 320 set_irq_type(gpio_to_irq(VIPER_CPLD_GPIO), IRQ_TYPE_EDGE_BOTH);
304
305#ifndef CONFIG_SERIAL_PXA
306 /*
307 * 8250 doesn't support IRQ_TYPE being passed as part
308 * of the plat_serial8250_port structure...
309 */
310 set_irq_type(gpio_to_irq(VIPER_UARTA_GPIO), IRQ_TYPE_EDGE_RISING);
311 set_irq_type(gpio_to_irq(VIPER_UARTB_GPIO), IRQ_TYPE_EDGE_RISING);
312#endif
313} 321}
314 322
315/* Flat Panel */ 323/* Flat Panel */
@@ -373,7 +381,7 @@ err_request_bckl:
373 return ret; 381 return ret;
374} 382}
375 383
376static int viper_backlight_notify(int brightness) 384static int viper_backlight_notify(struct device *dev, int brightness)
377{ 385{
378 gpio_set_value(VIPER_LCD_EN_GPIO, !!brightness); 386 gpio_set_value(VIPER_LCD_EN_GPIO, !!brightness);
379 gpio_set_value(VIPER_BCKLIGHT_EN_GPIO, !!brightness); 387 gpio_set_value(VIPER_BCKLIGHT_EN_GPIO, !!brightness);
@@ -447,7 +455,7 @@ static struct i2c_gpio_platform_data i2c_bus_data = {
447 .sda_pin = VIPER_RTC_I2C_SDA_GPIO, 455 .sda_pin = VIPER_RTC_I2C_SDA_GPIO,
448 .scl_pin = VIPER_RTC_I2C_SCL_GPIO, 456 .scl_pin = VIPER_RTC_I2C_SCL_GPIO,
449 .udelay = 10, 457 .udelay = 10,
450 .timeout = 100, 458 .timeout = HZ,
451}; 459};
452 460
453static struct platform_device i2c_bus_device = { 461static struct platform_device i2c_bus_device = {
@@ -539,6 +547,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
539 { 547 {
540 .mapbase = VIPER_UARTA_PHYS, 548 .mapbase = VIPER_UARTA_PHYS,
541 .irq = gpio_to_irq(VIPER_UARTA_GPIO), 549 .irq = gpio_to_irq(VIPER_UARTA_GPIO),
550 .irqflags = IRQF_TRIGGER_RISING,
542 .uartclk = 1843200, 551 .uartclk = 1843200,
543 .regshift = 1, 552 .regshift = 1,
544 .iotype = UPIO_MEM, 553 .iotype = UPIO_MEM,
@@ -548,6 +557,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
548 { 557 {
549 .mapbase = VIPER_UARTB_PHYS, 558 .mapbase = VIPER_UARTB_PHYS,
550 .irq = gpio_to_irq(VIPER_UARTB_GPIO), 559 .irq = gpio_to_irq(VIPER_UARTB_GPIO),
560 .irqflags = IRQF_TRIGGER_RISING,
551 .uartclk = 1843200, 561 .uartclk = 1843200,
552 .regshift = 1, 562 .regshift = 1,
553 .iotype = UPIO_MEM, 563 .iotype = UPIO_MEM,
@@ -692,6 +702,7 @@ static struct platform_device *viper_devs[] __initdata = {
692 &viper_mtd_devices[0], 702 &viper_mtd_devices[0],
693 &viper_mtd_devices[1], 703 &viper_mtd_devices[1],
694 &viper_backlight_device, 704 &viper_backlight_device,
705 &viper_pcmcia_device,
695}; 706};
696 707
697static mfp_cfg_t viper_pin_config[] __initdata = { 708static mfp_cfg_t viper_pin_config[] __initdata = {
@@ -702,6 +713,12 @@ static mfp_cfg_t viper_pin_config[] __initdata = {
702 GPIO80_nCS_4, 713 GPIO80_nCS_4,
703 GPIO33_nCS_5, 714 GPIO33_nCS_5,
704 715
716 /* AC97 */
717 GPIO28_AC97_BITCLK,
718 GPIO29_AC97_SDATA_IN_0,
719 GPIO30_AC97_SDATA_OUT,
720 GPIO31_AC97_SYNC,
721
705 /* FP Backlight */ 722 /* FP Backlight */
706 GPIO9_GPIO, /* VIPER_BCKLIGHT_EN_GPIO */ 723 GPIO9_GPIO, /* VIPER_BCKLIGHT_EN_GPIO */
707 GPIO10_GPIO, /* VIPER_LCD_EN_GPIO */ 724 GPIO10_GPIO, /* VIPER_LCD_EN_GPIO */
@@ -763,7 +780,7 @@ static void __init viper_tpm_init(void)
763 .sda_pin = VIPER_TPM_I2C_SDA_GPIO, 780 .sda_pin = VIPER_TPM_I2C_SDA_GPIO,
764 .scl_pin = VIPER_TPM_I2C_SCL_GPIO, 781 .scl_pin = VIPER_TPM_I2C_SCL_GPIO,
765 .udelay = 10, 782 .udelay = 10,
766 .timeout = 100, 783 .timeout = HZ,
767 }; 784 };
768 char *errstr; 785 char *errstr;
769 786
@@ -908,6 +925,10 @@ static void __init viper_init(void)
908 925
909 pxa2xx_mfp_config(ARRAY_AND_SIZE(viper_pin_config)); 926 pxa2xx_mfp_config(ARRAY_AND_SIZE(viper_pin_config));
910 927
928 pxa_set_ffuart_info(NULL);
929 pxa_set_btuart_info(NULL);
930 pxa_set_stuart_info(NULL);
931
911 /* Wake-up serial console */ 932 /* Wake-up serial console */
912 viper_init_serial_gpio(); 933 viper_init_serial_gpio();
913 934
diff --git a/arch/arm/mach-pxa/xcep.c b/arch/arm/mach-pxa/xcep.c
index 3fd79cbb36c8..d3b4e3f2e033 100644
--- a/arch/arm/mach-pxa/xcep.c
+++ b/arch/arm/mach-pxa/xcep.c
@@ -165,6 +165,11 @@ static void __init xcep_init(void)
165{ 165{
166 pxa2xx_mfp_config(ARRAY_AND_SIZE(xcep_pin_config)); 166 pxa2xx_mfp_config(ARRAY_AND_SIZE(xcep_pin_config));
167 167
168 pxa_set_ffuart_info(NULL);
169 pxa_set_btuart_info(NULL);
170 pxa_set_stuart_info(NULL);
171 pxa_set_hwuart_info(NULL);
172
168 /* See Intel XScale Developer's Guide for details */ 173 /* See Intel XScale Developer's Guide for details */
169 /* Set RDF and RDN to appropriate values (chip select 3 (smc91x)) */ 174 /* Set RDF and RDN to appropriate values (chip select 3 (smc91x)) */
170 MSC1 = (MSC1 & 0xffff) | 0xD5540000; 175 MSC1 = (MSC1 & 0xffff) | 0xD5540000;
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
new file mode 100644
index 000000000000..39896d883584
--- /dev/null
+++ b/arch/arm/mach-pxa/zeus.c
@@ -0,0 +1,913 @@
1/*
2 * Support for the Arcom ZEUS.
3 *
4 * Copyright (C) 2006 Arcom Control Systems Ltd.
5 *
6 * Loosely based on Arcom's 2.6.16.28.
7 * Maintained by Marc Zyngier <maz@misterjones.org>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/cpufreq.h>
15#include <linux/interrupt.h>
16#include <linux/irq.h>
17#include <linux/pm.h>
18#include <linux/gpio.h>
19#include <linux/serial_8250.h>
20#include <linux/dm9000.h>
21#include <linux/mmc/host.h>
22#include <linux/spi/spi.h>
23#include <linux/mtd/mtd.h>
24#include <linux/mtd/partitions.h>
25#include <linux/mtd/physmap.h>
26#include <linux/i2c.h>
27#include <linux/i2c/pca953x.h>
28#include <linux/apm-emulation.h>
29#include <linux/can/platform/mcp251x.h>
30
31#include <asm/mach-types.h>
32#include <asm/mach/arch.h>
33#include <asm/mach/map.h>
34
35#include <plat/i2c.h>
36
37#include <mach/pxa2xx-regs.h>
38#include <mach/regs-uart.h>
39#include <mach/ohci.h>
40#include <mach/mmc.h>
41#include <mach/pxa27x-udc.h>
42#include <mach/udc.h>
43#include <mach/pxafb.h>
44#include <mach/pxa2xx_spi.h>
45#include <mach/mfp-pxa27x.h>
46#include <mach/pm.h>
47#include <mach/audio.h>
48#include <mach/arcom-pcmcia.h>
49#include <mach/zeus.h>
50
51#include "generic.h"
52
53/*
54 * Interrupt handling
55 */
56
57static unsigned long zeus_irq_enabled_mask;
58static const int zeus_isa_irqs[] = { 3, 4, 5, 6, 7, 10, 11, 12, };
59static const int zeus_isa_irq_map[] = {
60 0, /* ISA irq #0, invalid */
61 0, /* ISA irq #1, invalid */
62 0, /* ISA irq #2, invalid */
63 1 << 0, /* ISA irq #3 */
64 1 << 1, /* ISA irq #4 */
65 1 << 2, /* ISA irq #5 */
66 1 << 3, /* ISA irq #6 */
67 1 << 4, /* ISA irq #7 */
68 0, /* ISA irq #8, invalid */
69 0, /* ISA irq #9, invalid */
70 1 << 5, /* ISA irq #10 */
71 1 << 6, /* ISA irq #11 */
72 1 << 7, /* ISA irq #12 */
73};
74
75static inline int zeus_irq_to_bitmask(unsigned int irq)
76{
77 return zeus_isa_irq_map[irq - PXA_ISA_IRQ(0)];
78}
79
80static inline int zeus_bit_to_irq(int bit)
81{
82 return zeus_isa_irqs[bit] + PXA_ISA_IRQ(0);
83}
84
85static void zeus_ack_irq(unsigned int irq)
86{
87 __raw_writew(zeus_irq_to_bitmask(irq), ZEUS_CPLD_ISA_IRQ);
88}
89
90static void zeus_mask_irq(unsigned int irq)
91{
92 zeus_irq_enabled_mask &= ~(zeus_irq_to_bitmask(irq));
93}
94
95static void zeus_unmask_irq(unsigned int irq)
96{
97 zeus_irq_enabled_mask |= zeus_irq_to_bitmask(irq);
98}
99
100static inline unsigned long zeus_irq_pending(void)
101{
102 return __raw_readw(ZEUS_CPLD_ISA_IRQ) & zeus_irq_enabled_mask;
103}
104
105static void zeus_irq_handler(unsigned int irq, struct irq_desc *desc)
106{
107 unsigned long pending;
108
109 pending = zeus_irq_pending();
110 do {
111 /* we're in a chained irq handler,
112 * so ack the interrupt by hand */
113 desc->chip->ack(gpio_to_irq(ZEUS_ISA_GPIO));
114
115 if (likely(pending)) {
116 irq = zeus_bit_to_irq(__ffs(pending));
117 generic_handle_irq(irq);
118 }
119 pending = zeus_irq_pending();
120 } while (pending);
121}
122
123static struct irq_chip zeus_irq_chip = {
124 .name = "ISA",
125 .ack = zeus_ack_irq,
126 .mask = zeus_mask_irq,
127 .unmask = zeus_unmask_irq,
128};
129
130static void __init zeus_init_irq(void)
131{
132 int level;
133 int isa_irq;
134
135 pxa27x_init_irq();
136
137 /* Peripheral IRQs. It would be nice to move those inside driver
138 configuration, but it is not supported at the moment. */
139 set_irq_type(gpio_to_irq(ZEUS_AC97_GPIO), IRQ_TYPE_EDGE_RISING);
140 set_irq_type(gpio_to_irq(ZEUS_WAKEUP_GPIO), IRQ_TYPE_EDGE_RISING);
141 set_irq_type(gpio_to_irq(ZEUS_PTT_GPIO), IRQ_TYPE_EDGE_RISING);
142 set_irq_type(gpio_to_irq(ZEUS_EXTGPIO_GPIO), IRQ_TYPE_EDGE_FALLING);
143 set_irq_type(gpio_to_irq(ZEUS_CAN_GPIO), IRQ_TYPE_EDGE_FALLING);
144
145 /* Setup ISA IRQs */
146 for (level = 0; level < ARRAY_SIZE(zeus_isa_irqs); level++) {
147 isa_irq = zeus_bit_to_irq(level);
148 set_irq_chip(isa_irq, &zeus_irq_chip);
149 set_irq_handler(isa_irq, handle_edge_irq);
150 set_irq_flags(isa_irq, IRQF_VALID | IRQF_PROBE);
151 }
152
153 set_irq_type(gpio_to_irq(ZEUS_ISA_GPIO), IRQ_TYPE_EDGE_RISING);
154 set_irq_chained_handler(gpio_to_irq(ZEUS_ISA_GPIO), zeus_irq_handler);
155}
156
157
158/*
159 * Platform devices
160 */
161
162/* Flash */
163static struct resource zeus_mtd_resources[] = {
164 [0] = { /* NOR Flash (up to 64MB) */
165 .start = ZEUS_FLASH_PHYS,
166 .end = ZEUS_FLASH_PHYS + SZ_64M - 1,
167 .flags = IORESOURCE_MEM,
168 },
169 [1] = { /* SRAM */
170 .start = ZEUS_SRAM_PHYS,
171 .end = ZEUS_SRAM_PHYS + SZ_512K - 1,
172 .flags = IORESOURCE_MEM,
173 },
174};
175
176static struct physmap_flash_data zeus_flash_data[] = {
177 [0] = {
178 .width = 2,
179 .parts = NULL,
180 .nr_parts = 0,
181 },
182};
183
184static struct platform_device zeus_mtd_devices[] = {
185 [0] = {
186 .name = "physmap-flash",
187 .id = 0,
188 .dev = {
189 .platform_data = &zeus_flash_data[0],
190 },
191 .resource = &zeus_mtd_resources[0],
192 .num_resources = 1,
193 },
194};
195
196/* Serial */
197static struct resource zeus_serial_resources[] = {
198 {
199 .start = 0x10000000,
200 .end = 0x1000000f,
201 .flags = IORESOURCE_MEM,
202 },
203 {
204 .start = 0x10800000,
205 .end = 0x1080000f,
206 .flags = IORESOURCE_MEM,
207 },
208 {
209 .start = 0x11000000,
210 .end = 0x1100000f,
211 .flags = IORESOURCE_MEM,
212 },
213 {
214 .start = 0x40100000,
215 .end = 0x4010001f,
216 .flags = IORESOURCE_MEM,
217 },
218 {
219 .start = 0x40200000,
220 .end = 0x4020001f,
221 .flags = IORESOURCE_MEM,
222 },
223 {
224 .start = 0x40700000,
225 .end = 0x4070001f,
226 .flags = IORESOURCE_MEM,
227 },
228};
229
230static struct plat_serial8250_port serial_platform_data[] = {
231 /* External UARTs */
232 /* FIXME: Shared IRQs on COM1-COM4 will not work properly on v1i1 hardware. */
233 { /* COM1 */
234 .mapbase = 0x10000000,
235 .irq = gpio_to_irq(ZEUS_UARTA_GPIO),
236 .irqflags = IRQF_TRIGGER_RISING,
237 .uartclk = 14745600,
238 .regshift = 1,
239 .flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
240 .iotype = UPIO_MEM,
241 },
242 { /* COM2 */
243 .mapbase = 0x10800000,
244 .irq = gpio_to_irq(ZEUS_UARTB_GPIO),
245 .irqflags = IRQF_TRIGGER_RISING,
246 .uartclk = 14745600,
247 .regshift = 1,
248 .flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
249 .iotype = UPIO_MEM,
250 },
251 { /* COM3 */
252 .mapbase = 0x11000000,
253 .irq = gpio_to_irq(ZEUS_UARTC_GPIO),
254 .irqflags = IRQF_TRIGGER_RISING,
255 .uartclk = 14745600,
256 .regshift = 1,
257 .flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
258 .iotype = UPIO_MEM,
259 },
260 { /* COM4 */
261 .mapbase = 0x11800000,
262 .irq = gpio_to_irq(ZEUS_UARTD_GPIO),
263 .irqflags = IRQF_TRIGGER_RISING,
264 .uartclk = 14745600,
265 .regshift = 1,
266 .flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
267 .iotype = UPIO_MEM,
268 },
269 /* Internal UARTs */
270 { /* FFUART */
271 .membase = (void *)&FFUART,
272 .mapbase = __PREG(FFUART),
273 .irq = IRQ_FFUART,
274 .uartclk = 921600 * 16,
275 .regshift = 2,
276 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
277 .iotype = UPIO_MEM,
278 },
279 { /* BTUART */
280 .membase = (void *)&BTUART,
281 .mapbase = __PREG(BTUART),
282 .irq = IRQ_BTUART,
283 .uartclk = 921600 * 16,
284 .regshift = 2,
285 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
286 .iotype = UPIO_MEM,
287 },
288 { /* STUART */
289 .membase = (void *)&STUART,
290 .mapbase = __PREG(STUART),
291 .irq = IRQ_STUART,
292 .uartclk = 921600 * 16,
293 .regshift = 2,
294 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
295 .iotype = UPIO_MEM,
296 },
297 { },
298};
299
300static struct platform_device zeus_serial_device = {
301 .name = "serial8250",
302 .id = PLAT8250_DEV_PLATFORM,
303 .dev = {
304 .platform_data = serial_platform_data,
305 },
306 .num_resources = ARRAY_SIZE(zeus_serial_resources),
307 .resource = zeus_serial_resources,
308};
309
310/* Ethernet */
311static struct resource zeus_dm9k0_resource[] = {
312 [0] = {
313 .start = ZEUS_ETH0_PHYS,
314 .end = ZEUS_ETH0_PHYS + 1,
315 .flags = IORESOURCE_MEM
316 },
317 [1] = {
318 .start = ZEUS_ETH0_PHYS + 2,
319 .end = ZEUS_ETH0_PHYS + 3,
320 .flags = IORESOURCE_MEM
321 },
322 [2] = {
323 .start = gpio_to_irq(ZEUS_ETH0_GPIO),
324 .end = gpio_to_irq(ZEUS_ETH0_GPIO),
325 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
326 },
327};
328
329static struct resource zeus_dm9k1_resource[] = {
330 [0] = {
331 .start = ZEUS_ETH1_PHYS,
332 .end = ZEUS_ETH1_PHYS + 1,
333 .flags = IORESOURCE_MEM
334 },
335 [1] = {
336 .start = ZEUS_ETH1_PHYS + 2,
337 .end = ZEUS_ETH1_PHYS + 3,
338 .flags = IORESOURCE_MEM,
339 },
340 [2] = {
341 .start = gpio_to_irq(ZEUS_ETH1_GPIO),
342 .end = gpio_to_irq(ZEUS_ETH1_GPIO),
343 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
344 },
345};
346
347static struct dm9000_plat_data zeus_dm9k_platdata = {
348 .flags = DM9000_PLATF_16BITONLY,
349};
350
351static struct platform_device zeus_dm9k0_device = {
352 .name = "dm9000",
353 .id = 0,
354 .num_resources = ARRAY_SIZE(zeus_dm9k0_resource),
355 .resource = zeus_dm9k0_resource,
356 .dev = {
357 .platform_data = &zeus_dm9k_platdata,
358 }
359};
360
361static struct platform_device zeus_dm9k1_device = {
362 .name = "dm9000",
363 .id = 1,
364 .num_resources = ARRAY_SIZE(zeus_dm9k1_resource),
365 .resource = zeus_dm9k1_resource,
366 .dev = {
367 .platform_data = &zeus_dm9k_platdata,
368 }
369};
370
371/* External SRAM */
372static struct resource zeus_sram_resource = {
373 .start = ZEUS_SRAM_PHYS,
374 .end = ZEUS_SRAM_PHYS + ZEUS_SRAM_SIZE * 2 - 1,
375 .flags = IORESOURCE_MEM,
376};
377
378static struct platform_device zeus_sram_device = {
379 .name = "pxa2xx-8bit-sram",
380 .id = 0,
381 .num_resources = 1,
382 .resource = &zeus_sram_resource,
383};
384
385/* SPI interface on SSP3 */
386static struct pxa2xx_spi_master pxa2xx_spi_ssp3_master_info = {
387 .num_chipselect = 1,
388 .enable_dma = 1,
389};
390
391/* CAN bus on SPI */
392static int zeus_mcp2515_setup(struct spi_device *sdev)
393{
394 int err;
395
396 err = gpio_request(ZEUS_CAN_SHDN_GPIO, "CAN shutdown");
397 if (err)
398 return err;
399
400 err = gpio_direction_output(ZEUS_CAN_SHDN_GPIO, 1);
401 if (err) {
402 gpio_free(ZEUS_CAN_SHDN_GPIO);
403 return err;
404 }
405
406 return 0;
407}
408
409static int zeus_mcp2515_transceiver_enable(int enable)
410{
411 gpio_set_value(ZEUS_CAN_SHDN_GPIO, !enable);
412 return 0;
413}
414
415static struct mcp251x_platform_data zeus_mcp2515_pdata = {
416 .oscillator_frequency = 16*1000*1000,
417 .model = CAN_MCP251X_MCP2515,
418 .board_specific_setup = zeus_mcp2515_setup,
419 .transceiver_enable = zeus_mcp2515_transceiver_enable,
420 .power_enable = zeus_mcp2515_transceiver_enable,
421};
422
423static struct spi_board_info zeus_spi_board_info[] = {
424 [0] = {
425 .modalias = "mcp251x",
426 .platform_data = &zeus_mcp2515_pdata,
427 .irq = gpio_to_irq(ZEUS_CAN_GPIO),
428 .max_speed_hz = 1*1000*1000,
429 .bus_num = 3,
430 .mode = SPI_MODE_0,
431 .chip_select = 0,
432 },
433};
434
435/* Leds */
436static struct gpio_led zeus_leds[] = {
437 [0] = {
438 .name = "zeus:yellow:1",
439 .default_trigger = "heartbeat",
440 .gpio = ZEUS_EXT0_GPIO(3),
441 .active_low = 1,
442 },
443 [1] = {
444 .name = "zeus:yellow:2",
445 .default_trigger = "default-on",
446 .gpio = ZEUS_EXT0_GPIO(4),
447 .active_low = 1,
448 },
449 [2] = {
450 .name = "zeus:yellow:3",
451 .default_trigger = "default-on",
452 .gpio = ZEUS_EXT0_GPIO(5),
453 .active_low = 1,
454 },
455};
456
457static struct gpio_led_platform_data zeus_leds_info = {
458 .leds = zeus_leds,
459 .num_leds = ARRAY_SIZE(zeus_leds),
460};
461
462static struct platform_device zeus_leds_device = {
463 .name = "leds-gpio",
464 .id = -1,
465 .dev = {
466 .platform_data = &zeus_leds_info,
467 },
468};
469
470static void zeus_cf_reset(int state)
471{
472 u16 cpld_state = __raw_readw(ZEUS_CPLD_CONTROL);
473
474 if (state)
475 cpld_state |= ZEUS_CPLD_CONTROL_CF_RST;
476 else
477 cpld_state &= ~ZEUS_CPLD_CONTROL_CF_RST;
478
479 __raw_writew(cpld_state, ZEUS_CPLD_CONTROL);
480}
481
482static struct arcom_pcmcia_pdata zeus_pcmcia_info = {
483 .cd_gpio = ZEUS_CF_CD_GPIO,
484 .rdy_gpio = ZEUS_CF_RDY_GPIO,
485 .pwr_gpio = ZEUS_CF_PWEN_GPIO,
486 .reset = zeus_cf_reset,
487};
488
489static struct platform_device zeus_pcmcia_device = {
490 .name = "zeus-pcmcia",
491 .id = -1,
492 .dev = {
493 .platform_data = &zeus_pcmcia_info,
494 },
495};
496
497static struct resource zeus_max6369_resource = {
498 .start = ZEUS_CPLD_EXTWDOG_PHYS,
499 .end = ZEUS_CPLD_EXTWDOG_PHYS,
500 .flags = IORESOURCE_MEM,
501};
502
503struct platform_device zeus_max6369_device = {
504 .name = "max6369_wdt",
505 .id = -1,
506 .resource = &zeus_max6369_resource,
507 .num_resources = 1,
508};
509
510static struct platform_device *zeus_devices[] __initdata = {
511 &zeus_serial_device,
512 &zeus_mtd_devices[0],
513 &zeus_dm9k0_device,
514 &zeus_dm9k1_device,
515 &zeus_sram_device,
516 &zeus_leds_device,
517 &zeus_pcmcia_device,
518 &zeus_max6369_device,
519};
520
521/* AC'97 */
522static pxa2xx_audio_ops_t zeus_ac97_info = {
523 .reset_gpio = 95,
524};
525
526
527/*
528 * USB host
529 */
530
531static int zeus_ohci_init(struct device *dev)
532{
533 int err;
534
535 /* Switch on port 2. */
536 if ((err = gpio_request(ZEUS_USB2_PWREN_GPIO, "USB2_PWREN"))) {
537 dev_err(dev, "Can't request USB2_PWREN\n");
538 return err;
539 }
540
541 if ((err = gpio_direction_output(ZEUS_USB2_PWREN_GPIO, 1))) {
542 gpio_free(ZEUS_USB2_PWREN_GPIO);
543 dev_err(dev, "Can't enable USB2_PWREN\n");
544 return err;
545 }
546
547 /* Port 2 is shared between host and client interface. */
548 UP2OCR = UP2OCR_HXOE | UP2OCR_HXS | UP2OCR_DMPDE | UP2OCR_DPPDE;
549
550 return 0;
551}
552
553static void zeus_ohci_exit(struct device *dev)
554{
555 /* Power-off port 2 */
556 gpio_direction_output(ZEUS_USB2_PWREN_GPIO, 0);
557 gpio_free(ZEUS_USB2_PWREN_GPIO);
558}
559
560static struct pxaohci_platform_data zeus_ohci_platform_data = {
561 .port_mode = PMM_NPS_MODE,
562 /* Clear Power Control Polarity Low and set Power Sense
563 * Polarity Low. Supply power to USB ports. */
564 .flags = ENABLE_PORT_ALL | POWER_SENSE_LOW,
565 .init = zeus_ohci_init,
566 .exit = zeus_ohci_exit,
567};
568
569/*
570 * Flat Panel
571 */
572
573static void zeus_lcd_power(int on, struct fb_var_screeninfo *si)
574{
575 gpio_set_value(ZEUS_LCD_EN_GPIO, on);
576}
577
578static void zeus_backlight_power(int on)
579{
580 gpio_set_value(ZEUS_BKLEN_GPIO, on);
581}
582
583static int zeus_setup_fb_gpios(void)
584{
585 int err;
586
587 if ((err = gpio_request(ZEUS_LCD_EN_GPIO, "LCD_EN")))
588 goto out_err;
589
590 if ((err = gpio_direction_output(ZEUS_LCD_EN_GPIO, 0)))
591 goto out_err_lcd;
592
593 if ((err = gpio_request(ZEUS_BKLEN_GPIO, "BKLEN")))
594 goto out_err_lcd;
595
596 if ((err = gpio_direction_output(ZEUS_BKLEN_GPIO, 0)))
597 goto out_err_bkl;
598
599 return 0;
600
601out_err_bkl:
602 gpio_free(ZEUS_BKLEN_GPIO);
603out_err_lcd:
604 gpio_free(ZEUS_LCD_EN_GPIO);
605out_err:
606 return err;
607}
608
609static struct pxafb_mode_info zeus_fb_mode_info[] = {
610 {
611 .pixclock = 39722,
612
613 .xres = 640,
614 .yres = 480,
615
616 .bpp = 16,
617
618 .hsync_len = 63,
619 .left_margin = 16,
620 .right_margin = 81,
621
622 .vsync_len = 2,
623 .upper_margin = 12,
624 .lower_margin = 31,
625
626 .sync = 0,
627 },
628};
629
630static struct pxafb_mach_info zeus_fb_info = {
631 .modes = zeus_fb_mode_info,
632 .num_modes = 1,
633 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
634 .pxafb_lcd_power = zeus_lcd_power,
635 .pxafb_backlight_power = zeus_backlight_power,
636};
637
638/*
639 * MMC/SD Device
640 *
641 * The card detect interrupt isn't debounced so we delay it by 250ms
642 * to give the card a chance to fully insert/eject.
643 */
644
645static struct pxamci_platform_data zeus_mci_platform_data = {
646 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
647 .detect_delay = HZ/4,
648 .gpio_card_detect = ZEUS_MMC_CD_GPIO,
649 .gpio_card_ro = ZEUS_MMC_WP_GPIO,
650 .gpio_card_ro_invert = 1,
651 .gpio_power = -1
652};
653
654/*
655 * USB Device Controller
656 */
657static void zeus_udc_command(int cmd)
658{
659 switch (cmd) {
660 case PXA2XX_UDC_CMD_DISCONNECT:
661 pr_info("zeus: disconnecting USB client\n");
662 UP2OCR = UP2OCR_HXOE | UP2OCR_HXS | UP2OCR_DMPDE | UP2OCR_DPPDE;
663 break;
664
665 case PXA2XX_UDC_CMD_CONNECT:
666 pr_info("zeus: connecting USB client\n");
667 UP2OCR = UP2OCR_HXOE | UP2OCR_DPPUE;
668 break;
669 }
670}
671
672static struct pxa2xx_udc_mach_info zeus_udc_info = {
673 .udc_command = zeus_udc_command,
674};
675
676#ifdef CONFIG_PM
677static void zeus_power_off(void)
678{
679 local_irq_disable();
680 pxa27x_cpu_suspend(PWRMODE_DEEPSLEEP);
681}
682#else
683#define zeus_power_off NULL
684#endif
685
686#ifdef CONFIG_APM_EMULATION
687static void zeus_get_power_status(struct apm_power_info *info)
688{
689 /* Power supply is always present */
690 info->ac_line_status = APM_AC_ONLINE;
691 info->battery_status = APM_BATTERY_STATUS_NOT_PRESENT;
692 info->battery_flag = APM_BATTERY_FLAG_NOT_PRESENT;
693}
694
695static inline void zeus_setup_apm(void)
696{
697 apm_get_power_status = zeus_get_power_status;
698}
699#else
700static inline void zeus_setup_apm(void)
701{
702}
703#endif
704
705static int zeus_get_pcb_info(struct i2c_client *client, unsigned gpio,
706 unsigned ngpio, void *context)
707{
708 int i;
709 u8 pcb_info = 0;
710
711 for (i = 0; i < 8; i++) {
712 int pcb_bit = gpio + i + 8;
713
714 if (gpio_request(pcb_bit, "pcb info")) {
715 dev_err(&client->dev, "Can't request pcb info %d\n", i);
716 continue;
717 }
718
719 if (gpio_direction_input(pcb_bit)) {
720 dev_err(&client->dev, "Can't read pcb info %d\n", i);
721 gpio_free(pcb_bit);
722 continue;
723 }
724
725 pcb_info |= !!gpio_get_value(pcb_bit) << i;
726
727 gpio_free(pcb_bit);
728 }
729
730 dev_info(&client->dev, "Zeus PCB version %d issue %d\n",
731 pcb_info >> 4, pcb_info & 0xf);
732
733 return 0;
734}
735
736static struct pca953x_platform_data zeus_pca953x_pdata[] = {
737 [0] = { .gpio_base = ZEUS_EXT0_GPIO_BASE, },
738 [1] = {
739 .gpio_base = ZEUS_EXT1_GPIO_BASE,
740 .setup = zeus_get_pcb_info,
741 },
742 [2] = { .gpio_base = ZEUS_USER_GPIO_BASE, },
743};
744
745static struct i2c_board_info __initdata zeus_i2c_devices[] = {
746 {
747 I2C_BOARD_INFO("pca9535", 0x21),
748 .platform_data = &zeus_pca953x_pdata[0],
749 },
750 {
751 I2C_BOARD_INFO("pca9535", 0x22),
752 .platform_data = &zeus_pca953x_pdata[1],
753 },
754 {
755 I2C_BOARD_INFO("pca9535", 0x20),
756 .platform_data = &zeus_pca953x_pdata[2],
757 .irq = gpio_to_irq(ZEUS_EXTGPIO_GPIO),
758 },
759 { I2C_BOARD_INFO("lm75a", 0x48) },
760 { I2C_BOARD_INFO("24c01", 0x50) },
761 { I2C_BOARD_INFO("isl1208", 0x6f) },
762};
763
764static mfp_cfg_t zeus_pin_config[] __initdata = {
765 /* AC97 */
766 GPIO28_AC97_BITCLK,
767 GPIO29_AC97_SDATA_IN_0,
768 GPIO30_AC97_SDATA_OUT,
769 GPIO31_AC97_SYNC,
770
771 GPIO15_nCS_1,
772 GPIO78_nCS_2,
773 GPIO80_nCS_4,
774 GPIO33_nCS_5,
775
776 GPIO22_GPIO,
777 GPIO32_MMC_CLK,
778 GPIO92_MMC_DAT_0,
779 GPIO109_MMC_DAT_1,
780 GPIO110_MMC_DAT_2,
781 GPIO111_MMC_DAT_3,
782 GPIO112_MMC_CMD,
783
784 GPIO88_USBH1_PWR,
785 GPIO89_USBH1_PEN,
786 GPIO119_USBH2_PWR,
787 GPIO120_USBH2_PEN,
788
789 GPIO86_LCD_LDD_16,
790 GPIO87_LCD_LDD_17,
791
792 GPIO102_GPIO,
793 GPIO104_CIF_DD_2,
794 GPIO105_CIF_DD_1,
795
796 GPIO81_SSP3_TXD,
797 GPIO82_SSP3_RXD,
798 GPIO83_SSP3_SFRM,
799 GPIO84_SSP3_SCLK,
800
801 GPIO48_nPOE,
802 GPIO49_nPWE,
803 GPIO50_nPIOR,
804 GPIO51_nPIOW,
805 GPIO85_nPCE_1,
806 GPIO54_nPCE_2,
807 GPIO79_PSKTSEL,
808 GPIO55_nPREG,
809 GPIO56_nPWAIT,
810 GPIO57_nIOIS16,
811 GPIO36_GPIO, /* CF CD */
812 GPIO97_GPIO, /* CF PWREN */
813 GPIO99_GPIO, /* CF RDY */
814};
815
816/*
817 * DM9k MSCx settings: SRAM, 16 bits
818 * 17 cycles delay first access
819 * 5 cycles delay next access
820 * 13 cycles recovery time
821 * faster device
822 */
823#define DM9K_MSC_VALUE 0xe4c9
824
825static void __init zeus_init(void)
826{
827 u16 dm9000_msc = DM9K_MSC_VALUE;
828
829 system_rev = __raw_readw(ZEUS_CPLD_VERSION);
830 pr_info("Zeus CPLD V%dI%d\n", (system_rev & 0xf0) >> 4, (system_rev & 0x0f));
831
832 /* Fix timings for dm9000s (CS1/CS2)*/
833 MSC0 = (MSC0 & 0xffff) | (dm9000_msc << 16);
834 MSC1 = (MSC1 & 0xffff0000) | dm9000_msc;
835
836 pm_power_off = zeus_power_off;
837 zeus_setup_apm();
838
839 pxa2xx_mfp_config(ARRAY_AND_SIZE(zeus_pin_config));
840
841 platform_add_devices(zeus_devices, ARRAY_SIZE(zeus_devices));
842
843 pxa_set_ohci_info(&zeus_ohci_platform_data);
844
845 if (zeus_setup_fb_gpios())
846 pr_err("Failed to setup fb gpios\n");
847 else
848 set_pxa_fb_info(&zeus_fb_info);
849
850 pxa_set_mci_info(&zeus_mci_platform_data);
851 pxa_set_udc_info(&zeus_udc_info);
852 pxa_set_ac97_info(&zeus_ac97_info);
853 pxa_set_i2c_info(NULL);
854 i2c_register_board_info(0, ARRAY_AND_SIZE(zeus_i2c_devices));
855 pxa2xx_set_spi_info(3, &pxa2xx_spi_ssp3_master_info);
856 spi_register_board_info(zeus_spi_board_info, ARRAY_SIZE(zeus_spi_board_info));
857}
858
859static struct map_desc zeus_io_desc[] __initdata = {
860 {
861 .virtual = ZEUS_CPLD_VERSION,
862 .pfn = __phys_to_pfn(ZEUS_CPLD_VERSION_PHYS),
863 .length = 0x1000,
864 .type = MT_DEVICE,
865 },
866 {
867 .virtual = ZEUS_CPLD_ISA_IRQ,
868 .pfn = __phys_to_pfn(ZEUS_CPLD_ISA_IRQ_PHYS),
869 .length = 0x1000,
870 .type = MT_DEVICE,
871 },
872 {
873 .virtual = ZEUS_CPLD_CONTROL,
874 .pfn = __phys_to_pfn(ZEUS_CPLD_CONTROL_PHYS),
875 .length = 0x1000,
876 .type = MT_DEVICE,
877 },
878 {
879 .virtual = ZEUS_PC104IO,
880 .pfn = __phys_to_pfn(ZEUS_PC104IO_PHYS),
881 .length = 0x00800000,
882 .type = MT_DEVICE,
883 },
884};
885
886static void __init zeus_map_io(void)
887{
888 pxa_map_io();
889
890 iotable_init(zeus_io_desc, ARRAY_SIZE(zeus_io_desc));
891
892 /* Clear PSPR to ensure a full restart on wake-up. */
893 PMCR = PSPR = 0;
894
895 /* enable internal 32.768Khz oscillator (ignore OSCC_OOK) */
896 OSCC |= OSCC_OON;
897
898 /* Some clock cycles later (from OSCC_ON), programme PCFR (OPDE...).
899 * float chip selects and PCMCIA */
900 PCFR = PCFR_OPDE | PCFR_DC_EN | PCFR_FS | PCFR_FP;
901}
902
903MACHINE_START(ARCOM_ZEUS, "Arcom/Eurotech ZEUS")
904 /* Maintainer: Marc Zyngier <maz@misterjones.org> */
905 .phys_io = 0x40000000,
906 .io_pg_offst = ((io_p2v(0x40000000) >> 18) & 0xfffc),
907 .boot_params = 0xa0000100,
908 .map_io = zeus_map_io,
909 .init_irq = zeus_init_irq,
910 .timer = &pxa_timer,
911 .init_machine = zeus_init,
912MACHINE_END
913
diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c
index 09784d3954e4..2b4043c04d0c 100644
--- a/arch/arm/mach-pxa/zylonite.c
+++ b/arch/arm/mach-pxa/zylonite.c
@@ -31,14 +31,11 @@
31#include <mach/mmc.h> 31#include <mach/mmc.h>
32#include <mach/ohci.h> 32#include <mach/ohci.h>
33#include <mach/pxa27x_keypad.h> 33#include <mach/pxa27x_keypad.h>
34#include <mach/pxa3xx_nand.h> 34#include <plat/pxa3xx_nand.h>
35 35
36#include "devices.h" 36#include "devices.h"
37#include "generic.h" 37#include "generic.h"
38 38
39#define MAX_SLOTS 3
40struct platform_mmc_slot zylonite_mmc_slot[MAX_SLOTS];
41
42int gpio_eth_irq; 39int gpio_eth_irq;
43int gpio_debug_led1; 40int gpio_debug_led1;
44int gpio_debug_led2; 41int gpio_debug_led2;
@@ -220,84 +217,28 @@ static inline void zylonite_init_lcd(void) {}
220#endif 217#endif
221 218
222#if defined(CONFIG_MMC) 219#if defined(CONFIG_MMC)
223static int zylonite_mci_ro(struct device *dev)
224{
225 struct platform_device *pdev = to_platform_device(dev);
226
227 return gpio_get_value(zylonite_mmc_slot[pdev->id].gpio_wp);
228}
229
230static int zylonite_mci_init(struct device *dev,
231 irq_handler_t zylonite_detect_int,
232 void *data)
233{
234 struct platform_device *pdev = to_platform_device(dev);
235 int err, cd_irq, gpio_cd, gpio_wp;
236
237 cd_irq = gpio_to_irq(zylonite_mmc_slot[pdev->id].gpio_cd);
238 gpio_cd = zylonite_mmc_slot[pdev->id].gpio_cd;
239 gpio_wp = zylonite_mmc_slot[pdev->id].gpio_wp;
240
241 /*
242 * setup GPIO for Zylonite MMC controller
243 */
244 err = gpio_request(gpio_cd, "mmc card detect");
245 if (err)
246 goto err_request_cd;
247 gpio_direction_input(gpio_cd);
248
249 err = gpio_request(gpio_wp, "mmc write protect");
250 if (err)
251 goto err_request_wp;
252 gpio_direction_input(gpio_wp);
253
254 err = request_irq(cd_irq, zylonite_detect_int,
255 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
256 "MMC card detect", data);
257 if (err) {
258 printk(KERN_ERR "%s: MMC/SD/SDIO: "
259 "can't request card detect IRQ\n", __func__);
260 goto err_request_irq;
261 }
262
263 return 0;
264
265err_request_irq:
266 gpio_free(gpio_wp);
267err_request_wp:
268 gpio_free(gpio_cd);
269err_request_cd:
270 return err;
271}
272
273static void zylonite_mci_exit(struct device *dev, void *data)
274{
275 struct platform_device *pdev = to_platform_device(dev);
276 int cd_irq, gpio_cd, gpio_wp;
277
278 cd_irq = gpio_to_irq(zylonite_mmc_slot[pdev->id].gpio_cd);
279 gpio_cd = zylonite_mmc_slot[pdev->id].gpio_cd;
280 gpio_wp = zylonite_mmc_slot[pdev->id].gpio_wp;
281
282 free_irq(cd_irq, data);
283 gpio_free(gpio_cd);
284 gpio_free(gpio_wp);
285}
286
287static struct pxamci_platform_data zylonite_mci_platform_data = { 220static struct pxamci_platform_data zylonite_mci_platform_data = {
288 .detect_delay = 20, 221 .detect_delay = 20,
289 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, 222 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
290 .init = zylonite_mci_init, 223 .gpio_card_detect = EXT_GPIO(0),
291 .exit = zylonite_mci_exit, 224 .gpio_card_ro = EXT_GPIO(2),
292 .get_ro = zylonite_mci_ro,
293 .gpio_card_detect = -1,
294 .gpio_card_ro = -1,
295 .gpio_power = -1, 225 .gpio_power = -1,
296}; 226};
297 227
298static struct pxamci_platform_data zylonite_mci2_platform_data = { 228static struct pxamci_platform_data zylonite_mci2_platform_data = {
299 .detect_delay = 20, 229 .detect_delay = 20,
300 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, 230 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
231 .gpio_card_detect = EXT_GPIO(1),
232 .gpio_card_ro = EXT_GPIO(3),
233 .gpio_power = -1,
234};
235
236static struct pxamci_platform_data zylonite_mci3_platform_data = {
237 .detect_delay = 20,
238 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
239 .gpio_card_detect = EXT_GPIO(30),
240 .gpio_card_ro = EXT_GPIO(31),
241 .gpio_power = -1,
301}; 242};
302 243
303static void __init zylonite_init_mmc(void) 244static void __init zylonite_init_mmc(void)
@@ -305,7 +246,7 @@ static void __init zylonite_init_mmc(void)
305 pxa_set_mci_info(&zylonite_mci_platform_data); 246 pxa_set_mci_info(&zylonite_mci_platform_data);
306 pxa3xx_set_mci2_info(&zylonite_mci2_platform_data); 247 pxa3xx_set_mci2_info(&zylonite_mci2_platform_data);
307 if (cpu_is_pxa310()) 248 if (cpu_is_pxa310())
308 pxa3xx_set_mci3_info(&zylonite_mci_platform_data); 249 pxa3xx_set_mci3_info(&zylonite_mci3_platform_data);
309} 250}
310#else 251#else
311static inline void zylonite_init_mmc(void) {} 252static inline void zylonite_init_mmc(void) {}
@@ -444,6 +385,10 @@ static inline void zylonite_init_ohci(void) {}
444 385
445static void __init zylonite_init(void) 386static void __init zylonite_init(void)
446{ 387{
388 pxa_set_ffuart_info(NULL);
389 pxa_set_btuart_info(NULL);
390 pxa_set_stuart_info(NULL);
391
447 /* board-processor specific initialization */ 392 /* board-processor specific initialization */
448 zylonite_pxa300_init(); 393 zylonite_pxa300_init();
449 zylonite_pxa320_init(); 394 zylonite_pxa320_init();
diff --git a/arch/arm/mach-pxa/zylonite_pxa300.c b/arch/arm/mach-pxa/zylonite_pxa300.c
index 84095440a878..3aa73b3e33f2 100644
--- a/arch/arm/mach-pxa/zylonite_pxa300.c
+++ b/arch/arm/mach-pxa/zylonite_pxa300.c
@@ -129,8 +129,8 @@ static mfp_cfg_t common_mfp_cfg[] __initdata = {
129 GPIO22_I2C_SDA, 129 GPIO22_I2C_SDA,
130 130
131 /* GPIO */ 131 /* GPIO */
132 GPIO18_GPIO, /* GPIO Expander #0 INT_N */ 132 GPIO18_GPIO | MFP_PULL_HIGH, /* GPIO Expander #0 INT_N */
133 GPIO19_GPIO, /* GPIO Expander #1 INT_N */ 133 GPIO19_GPIO | MFP_PULL_HIGH, /* GPIO Expander #1 INT_N */
134}; 134};
135 135
136static mfp_cfg_t pxa300_mfp_cfg[] __initdata = { 136static mfp_cfg_t pxa300_mfp_cfg[] __initdata = {
@@ -258,10 +258,6 @@ void __init zylonite_pxa300_init(void)
258 /* detect LCD panel */ 258 /* detect LCD panel */
259 zylonite_detect_lcd_panel(); 259 zylonite_detect_lcd_panel();
260 260
261 /* MMC card detect & write protect for controller 0 */
262 zylonite_mmc_slot[0].gpio_cd = EXT_GPIO(0);
263 zylonite_mmc_slot[0].gpio_wp = EXT_GPIO(2);
264
265 /* WM9713 IRQ */ 261 /* WM9713 IRQ */
266 wm9713_irq = mfp_to_gpio(MFP_PIN_GPIO26); 262 wm9713_irq = mfp_to_gpio(MFP_PIN_GPIO26);
267 263
@@ -276,10 +272,6 @@ void __init zylonite_pxa300_init(void)
276 if (cpu_is_pxa310()) { 272 if (cpu_is_pxa310()) {
277 pxa3xx_mfp_config(ARRAY_AND_SIZE(pxa310_mfp_cfg)); 273 pxa3xx_mfp_config(ARRAY_AND_SIZE(pxa310_mfp_cfg));
278 gpio_eth_irq = mfp_to_gpio(MFP_PIN_GPIO102); 274 gpio_eth_irq = mfp_to_gpio(MFP_PIN_GPIO102);
279
280 /* MMC card detect & write protect for controller 2 */
281 zylonite_mmc_slot[2].gpio_cd = EXT_GPIO(30);
282 zylonite_mmc_slot[2].gpio_wp = EXT_GPIO(31);
283 } 275 }
284 276
285 /* GPIOs for Debug LEDs */ 277 /* GPIOs for Debug LEDs */
diff --git a/arch/arm/mach-pxa/zylonite_pxa320.c b/arch/arm/mach-pxa/zylonite_pxa320.c
index 60d08f23f5e4..9942bac4cf7d 100644
--- a/arch/arm/mach-pxa/zylonite_pxa320.c
+++ b/arch/arm/mach-pxa/zylonite_pxa320.c
@@ -209,10 +209,6 @@ void __init zylonite_pxa320_init(void)
209 gpio_debug_led1 = mfp_to_gpio(MFP_PIN_GPIO1_2); 209 gpio_debug_led1 = mfp_to_gpio(MFP_PIN_GPIO1_2);
210 gpio_debug_led2 = mfp_to_gpio(MFP_PIN_GPIO4_2); 210 gpio_debug_led2 = mfp_to_gpio(MFP_PIN_GPIO4_2);
211 211
212 /* MMC card detect & write protect for controller 0 */
213 zylonite_mmc_slot[0].gpio_cd = mfp_to_gpio(MFP_PIN_GPIO1);
214 zylonite_mmc_slot[0].gpio_wp = mfp_to_gpio(MFP_PIN_GPIO5);
215
216 /* WM9713 IRQ */ 212 /* WM9713 IRQ */
217 wm9713_irq = mfp_to_gpio(MFP_PIN_GPIO15); 213 wm9713_irq = mfp_to_gpio(MFP_PIN_GPIO15);
218 } 214 }