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/Kconfig80
-rw-r--r--arch/arm/mach-pxa/Makefile13
-rw-r--r--arch/arm/mach-pxa/balloon3.c732
-rw-r--r--arch/arm/mach-pxa/cm-x300.c4
-rw-r--r--arch/arm/mach-pxa/colibri-pxa270-evalboard.c111
-rw-r--r--arch/arm/mach-pxa/colibri-pxa270-income.c272
-rw-r--r--arch/arm/mach-pxa/colibri-pxa270.c176
-rw-r--r--arch/arm/mach-pxa/colibri-pxa320.c40
-rw-r--r--arch/arm/mach-pxa/corgi.c5
-rw-r--r--arch/arm/mach-pxa/corgi_pm.c11
-rw-r--r--arch/arm/mach-pxa/devices.c14
-rw-r--r--arch/arm/mach-pxa/devices.h1
-rw-r--r--arch/arm/mach-pxa/e330.c78
-rw-r--r--arch/arm/mach-pxa/e350.c79
-rw-r--r--arch/arm/mach-pxa/e400.c155
-rw-r--r--arch/arm/mach-pxa/e740.c225
-rw-r--r--arch/arm/mach-pxa/e750.c226
-rw-r--r--arch/arm/mach-pxa/e800.c229
-rw-r--r--arch/arm/mach-pxa/eseries.c809
-rw-r--r--arch/arm/mach-pxa/imote2.c590
-rw-r--r--arch/arm/mach-pxa/include/mach/balloon3.h75
-rw-r--r--arch/arm/mach-pxa/include/mach/colibri.h32
-rw-r--r--arch/arm/mach-pxa/include/mach/corgi.h5
-rw-r--r--arch/arm/mach-pxa/include/mach/gumstix.h12
-rw-r--r--arch/arm/mach-pxa/include/mach/hardware.h5
-rw-r--r--arch/arm/mach-pxa/include/mach/palm27x.h81
-rw-r--r--arch/arm/mach-pxa/include/mach/pata_pxa.h33
-rw-r--r--arch/arm/mach-pxa/include/mach/sharpsl.h35
-rw-r--r--arch/arm/mach-pxa/include/mach/sharpsl_pm.h9
-rw-r--r--arch/arm/mach-pxa/include/mach/spitz.h2
-rw-r--r--arch/arm/mach-pxa/mioa701.c10
-rw-r--r--arch/arm/mach-pxa/palm27x.c477
-rw-r--r--arch/arm/mach-pxa/palmld.c292
-rw-r--r--arch/arm/mach-pxa/palmt5.c283
-rw-r--r--arch/arm/mach-pxa/palmte2.c20
-rw-r--r--arch/arm/mach-pxa/palmtreo.c354
-rw-r--r--arch/arm/mach-pxa/palmtx.c299
-rw-r--r--arch/arm/mach-pxa/palmz72.c264
-rw-r--r--arch/arm/mach-pxa/poodle.c2
-rw-r--r--arch/arm/mach-pxa/pxa25x.c1
-rw-r--r--arch/arm/mach-pxa/pxa27x.c1
-rw-r--r--arch/arm/mach-pxa/pxa3xx.c15
-rw-r--r--arch/arm/mach-pxa/raumfeld.c29
-rw-r--r--arch/arm/mach-pxa/sharpsl.h26
-rw-r--r--arch/arm/mach-pxa/sharpsl_pm.c23
-rw-r--r--arch/arm/mach-pxa/sleep.S7
-rw-r--r--arch/arm/mach-pxa/spitz.c727
-rw-r--r--arch/arm/mach-pxa/spitz_pm.c11
-rw-r--r--arch/arm/mach-pxa/stargate2.c679
-rw-r--r--arch/arm/mach-pxa/trizeps4.c6
-rw-r--r--arch/arm/mach-pxa/vpac270.c126
-rw-r--r--arch/arm/mach-pxa/z2.c118
52 files changed, 4090 insertions, 3819 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 3b51741a4810..7aefb9074852 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -238,6 +238,17 @@ config MACH_COLIBRI
238 bool "Toradex Colibri PXA270" 238 bool "Toradex Colibri PXA270"
239 select PXA27x 239 select PXA27x
240 240
241config MACH_COLIBRI_PXA270_EVALBOARD
242 bool "Toradex Colibri Evaluation Carrier Board support (PXA270)"
243 depends on MACH_COLIBRI
244
245config MACH_COLIBRI_PXA270_INCOME
246 bool "Income s.r.o. PXA270 SBC"
247 depends on MACH_COLIBRI
248 select PXA27x
249 select HAVE_PWM
250 select PXA_HAVE_BOARD_IRQS
251
241config MACH_COLIBRI300 252config MACH_COLIBRI300
242 bool "Toradex Colibri PXA300/310" 253 bool "Toradex Colibri PXA300/310"
243 select PXA3xx 254 select PXA3xx
@@ -336,6 +347,9 @@ config ARCH_PXA_PALM
336 bool "PXA based Palm PDAs" 347 bool "PXA based Palm PDAs"
337 select HAVE_PWM 348 select HAVE_PWM
338 349
350config MACH_PALM27X
351 bool
352
339config MACH_PALMTE2 353config MACH_PALMTE2
340 bool "Palm Tungsten|E2" 354 bool "Palm Tungsten|E2"
341 default y 355 default y
@@ -360,6 +374,7 @@ config MACH_PALMT5
360 depends on ARCH_PXA_PALM 374 depends on ARCH_PXA_PALM
361 select PXA27x 375 select PXA27x
362 select IWMMXT 376 select IWMMXT
377 select MACH_PALM27X
363 help 378 help
364 Say Y here if you intend to run this kernel on a Palm Tungsten|T5 379 Say Y here if you intend to run this kernel on a Palm Tungsten|T5
365 handheld computer. 380 handheld computer.
@@ -370,6 +385,7 @@ config MACH_PALMTX
370 depends on ARCH_PXA_PALM 385 depends on ARCH_PXA_PALM
371 select PXA27x 386 select PXA27x
372 select IWMMXT 387 select IWMMXT
388 select MACH_PALM27X
373 help 389 help
374 Say Y here if you intend to run this kernel on a Palm T|X 390 Say Y here if you intend to run this kernel on a Palm T|X
375 handheld computer. 391 handheld computer.
@@ -380,6 +396,7 @@ config MACH_PALMZ72
380 depends on ARCH_PXA_PALM 396 depends on ARCH_PXA_PALM
381 select PXA27x 397 select PXA27x
382 select IWMMXT 398 select IWMMXT
399 select MACH_PALM27X
383 help 400 help
384 Say Y here if you intend to run this kernel on Palm Zire 72 401 Say Y here if you intend to run this kernel on Palm Zire 72
385 handheld computer. 402 handheld computer.
@@ -390,6 +407,7 @@ config MACH_PALMLD
390 depends on ARCH_PXA_PALM 407 depends on ARCH_PXA_PALM
391 select PXA27x 408 select PXA27x
392 select IWMMXT 409 select IWMMXT
410 select MACH_PALM27X
393 help 411 help
394 Say Y here if you intend to run this kernel on a Palm LifeDrive 412 Say Y here if you intend to run this kernel on a Palm LifeDrive
395 handheld computer. 413 handheld computer.
@@ -447,16 +465,13 @@ config PXA_SHARPSL
447 SL-C3000 (Spitz), SL-C3100 (Borzoi) or SL-C6000x (Tosa) 465 SL-C3000 (Spitz), SL-C3100 (Borzoi) or SL-C6000x (Tosa)
448 handheld computer. 466 handheld computer.
449 467
450config SHARPSL_PM 468config PXA_SHARPSL_DETECT_MACH_ID
451 bool 469 bool "Detect machine ID at run-time in the decompressor"
452 select APM_EMULATION 470 depends on PXA_SHARPSL
453 select SHARPSL_PM_MAX1111 471 help
454 472 Say Y here if you want the zImage decompressor to detect
455config SHARPSL_PM_MAX1111 473 the Zaurus machine ID at run-time. For latest kexec-based
456 bool 474 boot loader, this is not necessary.
457 depends on !CORGI_SSP_DEPRECATED
458 select HWMON
459 select SENSORS_MAX1111
460 475
461config MACH_POODLE 476config MACH_POODLE
462 bool "Enable Sharp SL-5600 (Poodle) Support" 477 bool "Enable Sharp SL-5600 (Poodle) Support"
@@ -510,6 +525,25 @@ config MACH_TOSA
510 select PXA25x 525 select PXA25x
511 select PXA_HAVE_BOARD_IRQS 526 select PXA_HAVE_BOARD_IRQS
512 527
528config TOSA_BT
529 tristate "Control the state of built-in bluetooth chip on Sharp SL-6000"
530 depends on MACH_TOSA
531 select RFKILL
532 help
533 This is a simple driver that is able to control
534 the state of built in bluetooth chip on tosa.
535
536config TOSA_USE_EXT_KEYCODES
537 bool "Tosa keyboard: use extended keycodes"
538 depends on MACH_TOSA
539 default n
540 help
541 Say Y here to enable the tosa keyboard driver to generate extended
542 (>= 127) keycodes. Be aware, that they can't be correctly interpreted
543 by either console keyboard driver or by Kdrive keybd driver.
544
545 Say Y only if you know, what you are doing!
546
513config MACH_ICONTROL 547config MACH_ICONTROL
514 bool "TMT iControl/SafeTCam based on the MXM-8x10 CoM" 548 bool "TMT iControl/SafeTCam based on the MXM-8x10 CoM"
515 select CPU_PXA320 549 select CPU_PXA320
@@ -648,25 +682,15 @@ config PXA_SHARP_Cxx00
648 help 682 help
649 Enable common support for Sharp Cxx00 models 683 Enable common support for Sharp Cxx00 models
650 684
651config TOSA_BT 685config SHARPSL_PM
652 tristate "Control the state of built-in bluetooth chip on Sharp SL-6000" 686 bool
653 depends on MACH_TOSA 687 select APM_EMULATION
654 select RFKILL 688 select SHARPSL_PM_MAX1111
655 help
656 This is a simple driver that is able to control
657 the state of built in bluetooth chip on tosa.
658
659config TOSA_USE_EXT_KEYCODES
660 bool "Tosa keyboard: use extended keycodes"
661 depends on MACH_TOSA
662 default n
663 help
664 Say Y here to enable the tosa keyboard driver to generate extended
665 (>= 127) keycodes. Be aware, that they can't be correctly interpreted
666 by either console keyboard driver or by Kdrive keybd driver.
667
668 Say Y only if you know, what you are doing!
669 689
690config SHARPSL_PM_MAX1111
691 bool
692 select HWMON
693 select SENSORS_MAX1111
670 694
671config PXA_HAVE_BOARD_IRQS 695config PXA_HAVE_BOARD_IRQS
672 bool 696 bool
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index b8f1f4bc7ca7..85c7fb324dbb 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -51,14 +51,16 @@ obj-$(CONFIG_MACH_CAPC7117) += capc7117.o mxm8x10.o
51obj-$(CONFIG_ARCH_GUMSTIX) += gumstix.o 51obj-$(CONFIG_ARCH_GUMSTIX) += gumstix.o
52obj-$(CONFIG_GUMSTIX_AM200EPD) += am200epd.o 52obj-$(CONFIG_GUMSTIX_AM200EPD) += am200epd.o
53obj-$(CONFIG_GUMSTIX_AM300EPD) += am300epd.o 53obj-$(CONFIG_GUMSTIX_AM300EPD) += am300epd.o
54obj-$(CONFIG_MACH_INTELMOTE2) += imote2.o 54obj-$(CONFIG_MACH_INTELMOTE2) += stargate2.o
55obj-$(CONFIG_MACH_STARGATE2) += stargate2.o 55obj-$(CONFIG_MACH_STARGATE2) += stargate2.o
56obj-$(CONFIG_MACH_XCEP) += xcep.o 56obj-$(CONFIG_MACH_XCEP) += xcep.o
57obj-$(CONFIG_MACH_TRIZEPS4) += trizeps4.o 57obj-$(CONFIG_MACH_TRIZEPS4) += trizeps4.o
58obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o 58obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o
59obj-$(CONFIG_MACH_PCM027) += pcm027.o 59obj-$(CONFIG_MACH_PCM027) += pcm027.o
60obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o 60obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o
61obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o 61obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o
62obj-$(CONFIG_MACH_COLIBRI_PXA270_EVALBOARD) += colibri-pxa270-evalboard.o
63obj-$(CONFIG_MACH_COLIBRI_PXA270_INCOME) += colibri-pxa270-income.o
62obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o 64obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o
63obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o 65obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o
64obj-$(CONFIG_MACH_VPAC270) += vpac270.o 66obj-$(CONFIG_MACH_VPAC270) += vpac270.o
@@ -73,6 +75,7 @@ obj-$(CONFIG_PXA_EZX) += ezx.o
73obj-$(CONFIG_MACH_MP900C) += mp900.o 75obj-$(CONFIG_MACH_MP900C) += mp900.o
74obj-$(CONFIG_MACH_PALMTE2) += palmte2.o 76obj-$(CONFIG_MACH_PALMTE2) += palmte2.o
75obj-$(CONFIG_MACH_PALMTC) += palmtc.o 77obj-$(CONFIG_MACH_PALMTC) += palmtc.o
78obj-$(CONFIG_MACH_PALM27X) += palm27x.o
76obj-$(CONFIG_MACH_PALMT5) += palmt5.o 79obj-$(CONFIG_MACH_PALMT5) += palmt5.o
77obj-$(CONFIG_MACH_PALMTX) += palmtx.o 80obj-$(CONFIG_MACH_PALMTX) += palmtx.o
78obj-$(CONFIG_MACH_PALMZ72) += palmz72.o 81obj-$(CONFIG_MACH_PALMZ72) += palmz72.o
@@ -84,12 +87,6 @@ obj-$(CONFIG_MACH_POODLE) += poodle.o
84obj-$(CONFIG_MACH_TOSA) += tosa.o 87obj-$(CONFIG_MACH_TOSA) += tosa.o
85obj-$(CONFIG_MACH_ICONTROL) += icontrol.o mxm8x10.o 88obj-$(CONFIG_MACH_ICONTROL) += icontrol.o mxm8x10.o
86obj-$(CONFIG_ARCH_PXA_ESERIES) += eseries.o 89obj-$(CONFIG_ARCH_PXA_ESERIES) += eseries.o
87obj-$(CONFIG_MACH_E330) += e330.o
88obj-$(CONFIG_MACH_E350) += e350.o
89obj-$(CONFIG_MACH_E740) += e740.o
90obj-$(CONFIG_MACH_E750) += e750.o
91obj-$(CONFIG_MACH_E400) += e400.o
92obj-$(CONFIG_MACH_E800) += e800.o
93obj-$(CONFIG_MACH_RAUMFELD_RC) += raumfeld.o 90obj-$(CONFIG_MACH_RAUMFELD_RC) += raumfeld.o
94obj-$(CONFIG_MACH_RAUMFELD_CONNECTOR) += raumfeld.o 91obj-$(CONFIG_MACH_RAUMFELD_CONNECTOR) += raumfeld.o
95obj-$(CONFIG_MACH_RAUMFELD_SPEAKER) += raumfeld.o 92obj-$(CONFIG_MACH_RAUMFELD_SPEAKER) += raumfeld.o
diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c
index f3b5ace815e5..9041340fee1d 100644
--- a/arch/arm/mach-pxa/balloon3.c
+++ b/arch/arm/mach-pxa/balloon3.c
@@ -22,9 +22,14 @@
22#include <linux/fb.h> 22#include <linux/fb.h>
23#include <linux/gpio.h> 23#include <linux/gpio.h>
24#include <linux/ioport.h> 24#include <linux/ioport.h>
25#include <linux/ucb1400.h>
25#include <linux/mtd/mtd.h> 26#include <linux/mtd/mtd.h>
26#include <linux/mtd/partitions.h> 27#include <linux/mtd/partitions.h>
27#include <linux/types.h> 28#include <linux/types.h>
29#include <linux/i2c/pcf857x.h>
30#include <linux/mtd/nand.h>
31#include <linux/mtd/physmap.h>
32#include <linux/regulator/max1586.h>
28 33
29#include <asm/setup.h> 34#include <asm/setup.h>
30#include <asm/mach-types.h> 35#include <asm/mach-types.h>
@@ -51,6 +56,59 @@
51#include "generic.h" 56#include "generic.h"
52#include "devices.h" 57#include "devices.h"
53 58
59/******************************************************************************
60 * Pin configuration
61 ******************************************************************************/
62static unsigned long balloon3_pin_config[] __initdata = {
63 /* Select BTUART 'COM1/ttyS0' as IO option for pins 42/43/44/45 */
64 GPIO42_BTUART_RXD,
65 GPIO43_BTUART_TXD,
66 GPIO44_BTUART_CTS,
67 GPIO45_BTUART_RTS,
68
69 /* Reset, configured as GPIO wakeup source */
70 GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH,
71
72 /* LEDs */
73 GPIO9_GPIO, /* NAND activity LED */
74 GPIO10_GPIO, /* Heartbeat LED */
75
76 /* AC97 */
77 GPIO28_AC97_BITCLK,
78 GPIO29_AC97_SDATA_IN_0,
79 GPIO30_AC97_SDATA_OUT,
80 GPIO31_AC97_SYNC,
81 GPIO113_AC97_nRESET,
82 GPIO95_GPIO,
83
84 /* MMC */
85 GPIO32_MMC_CLK,
86 GPIO92_MMC_DAT_0,
87 GPIO109_MMC_DAT_1,
88 GPIO110_MMC_DAT_2,
89 GPIO111_MMC_DAT_3,
90 GPIO112_MMC_CMD,
91
92 /* USB Host */
93 GPIO88_USBH1_PWR,
94 GPIO89_USBH1_PEN,
95
96 /* PC Card */
97 GPIO48_nPOE,
98 GPIO49_nPWE,
99 GPIO50_nPIOR,
100 GPIO51_nPIOW,
101 GPIO85_nPCE_1,
102 GPIO54_nPCE_2,
103 GPIO79_PSKTSEL,
104 GPIO55_nPREG,
105 GPIO56_nPWAIT,
106 GPIO57_nIOIS16,
107};
108
109/******************************************************************************
110 * Compatibility: Parameter parsing
111 ******************************************************************************/
54static unsigned long balloon3_irq_enabled; 112static unsigned long balloon3_irq_enabled;
55 113
56static unsigned long balloon3_features_present = 114static unsigned long balloon3_features_present =
@@ -73,6 +131,321 @@ int __init parse_balloon3_features(char *arg)
73} 131}
74early_param("balloon3_features", parse_balloon3_features); 132early_param("balloon3_features", parse_balloon3_features);
75 133
134/******************************************************************************
135 * NOR Flash
136 ******************************************************************************/
137#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
138static struct mtd_partition balloon3_nor_partitions[] = {
139 {
140 .name = "Flash",
141 .offset = 0x00000000,
142 .size = MTDPART_SIZ_FULL,
143 }
144};
145
146static struct physmap_flash_data balloon3_flash_data[] = {
147 {
148 .width = 2, /* bankwidth in bytes */
149 .parts = balloon3_nor_partitions,
150 .nr_parts = ARRAY_SIZE(balloon3_nor_partitions)
151 }
152};
153
154static struct resource balloon3_flash_resource = {
155 .start = PXA_CS0_PHYS,
156 .end = PXA_CS0_PHYS + SZ_64M - 1,
157 .flags = IORESOURCE_MEM,
158};
159
160static struct platform_device balloon3_flash = {
161 .name = "physmap-flash",
162 .id = 0,
163 .resource = &balloon3_flash_resource,
164 .num_resources = 1,
165 .dev = {
166 .platform_data = balloon3_flash_data,
167 },
168};
169static void __init balloon3_nor_init(void)
170{
171 platform_device_register(&balloon3_flash);
172}
173#else
174static inline void balloon3_nor_init(void) {}
175#endif
176
177/******************************************************************************
178 * Audio and Touchscreen
179 ******************************************************************************/
180#if defined(CONFIG_TOUCHSCREEN_UCB1400) || \
181 defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE)
182static struct ucb1400_pdata vpac270_ucb1400_pdata = {
183 .irq = IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ),
184};
185
186
187static struct platform_device balloon3_ucb1400_device = {
188 .name = "ucb1400_core",
189 .id = -1,
190 .dev = {
191 .platform_data = &vpac270_ucb1400_pdata,
192 },
193};
194
195static void __init balloon3_ts_init(void)
196{
197 if (!balloon3_has(BALLOON3_FEATURE_AUDIO))
198 return;
199
200 pxa_set_ac97_info(NULL);
201 platform_device_register(&balloon3_ucb1400_device);
202}
203#else
204static inline void balloon3_ts_init(void) {}
205#endif
206
207/******************************************************************************
208 * Framebuffer
209 ******************************************************************************/
210#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
211static struct pxafb_mode_info balloon3_lcd_modes[] = {
212 {
213 .pixclock = 38000,
214 .xres = 480,
215 .yres = 640,
216 .bpp = 16,
217 .hsync_len = 8,
218 .left_margin = 8,
219 .right_margin = 8,
220 .vsync_len = 2,
221 .upper_margin = 4,
222 .lower_margin = 5,
223 .sync = 0,
224 },
225};
226
227static struct pxafb_mach_info balloon3_lcd_screen = {
228 .modes = balloon3_lcd_modes,
229 .num_modes = ARRAY_SIZE(balloon3_lcd_modes),
230 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
231};
232
233static void balloon3_backlight_power(int on)
234{
235 gpio_set_value(BALLOON3_GPIO_RUN_BACKLIGHT, on);
236}
237
238static void __init balloon3_lcd_init(void)
239{
240 int ret;
241
242 if (!balloon3_has(BALLOON3_FEATURE_TOPPOLY))
243 return;
244
245 ret = gpio_request(BALLOON3_GPIO_RUN_BACKLIGHT, "BKL-ON");
246 if (ret) {
247 pr_err("Requesting BKL-ON GPIO failed!\n");
248 goto err;
249 }
250
251 ret = gpio_direction_output(BALLOON3_GPIO_RUN_BACKLIGHT, 1);
252 if (ret) {
253 pr_err("Setting BKL-ON GPIO direction failed!\n");
254 goto err2;
255 }
256
257 balloon3_lcd_screen.pxafb_backlight_power = balloon3_backlight_power;
258 set_pxa_fb_info(&balloon3_lcd_screen);
259 return;
260
261err2:
262 gpio_free(BALLOON3_GPIO_RUN_BACKLIGHT);
263err:
264 return;
265}
266#else
267static inline void balloon3_lcd_init(void) {}
268#endif
269
270/******************************************************************************
271 * SD/MMC card controller
272 ******************************************************************************/
273#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
274static struct pxamci_platform_data balloon3_mci_platform_data = {
275 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
276 .gpio_card_detect = -1,
277 .gpio_card_ro = -1,
278 .gpio_power = -1,
279 .detect_delay_ms = 200,
280};
281
282static void __init balloon3_mmc_init(void)
283{
284 pxa_set_mci_info(&balloon3_mci_platform_data);
285}
286#else
287static inline void balloon3_mmc_init(void) {}
288#endif
289
290/******************************************************************************
291 * USB Gadget
292 ******************************************************************************/
293#if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE)
294static void balloon3_udc_command(int cmd)
295{
296 if (cmd == PXA2XX_UDC_CMD_CONNECT)
297 UP2OCR |= UP2OCR_DPPUE | UP2OCR_DPPUBE;
298 else if (cmd == PXA2XX_UDC_CMD_DISCONNECT)
299 UP2OCR &= ~UP2OCR_DPPUE;
300}
301
302static int balloon3_udc_is_connected(void)
303{
304 return 1;
305}
306
307static struct pxa2xx_udc_mach_info balloon3_udc_info __initdata = {
308 .udc_command = balloon3_udc_command,
309 .udc_is_connected = balloon3_udc_is_connected,
310 .gpio_pullup = -1,
311};
312
313static void __init balloon3_udc_init(void)
314{
315 pxa_set_udc_info(&balloon3_udc_info);
316 platform_device_register(&balloon3_gpio_vbus);
317}
318#else
319static inline void balloon3_udc_init(void) {}
320#endif
321
322/******************************************************************************
323 * IrDA
324 ******************************************************************************/
325#if defined(CONFIG_IRDA) || defined(CONFIG_IRDA_MODULE)
326static struct pxaficp_platform_data balloon3_ficp_platform_data = {
327 .transceiver_cap = IR_FIRMODE | IR_SIRMODE | IR_OFF,
328};
329
330static void __init balloon3_irda_init(void)
331{
332 pxa_set_ficp_info(&balloon3_ficp_platform_data);
333}
334#else
335static inline void balloon3_irda_init(void) {}
336#endif
337
338/******************************************************************************
339 * USB Host
340 ******************************************************************************/
341#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
342static struct pxaohci_platform_data balloon3_ohci_info = {
343 .port_mode = PMM_PERPORT_MODE,
344 .flags = ENABLE_PORT_ALL | POWER_CONTROL_LOW | POWER_SENSE_LOW,
345};
346
347static void __init balloon3_uhc_init(void)
348{
349 if (!balloon3_has(BALLOON3_FEATURE_OHCI))
350 return;
351 pxa_set_ohci_info(&balloon3_ohci_info);
352}
353#else
354static inline void balloon3_uhc_init(void) {}
355#endif
356
357/******************************************************************************
358 * LEDs
359 ******************************************************************************/
360#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
361struct gpio_led balloon3_gpio_leds[] = {
362 {
363 .name = "balloon3:green:idle",
364 .default_trigger = "heartbeat",
365 .gpio = BALLOON3_GPIO_LED_IDLE,
366 .active_low = 1,
367 }, {
368 .name = "balloon3:green:nand",
369 .default_trigger = "nand-disk",
370 .gpio = BALLOON3_GPIO_LED_NAND,
371 .active_low = 1,
372 },
373};
374
375static struct gpio_led_platform_data balloon3_gpio_led_info = {
376 .leds = balloon3_gpio_leds,
377 .num_leds = ARRAY_SIZE(balloon3_gpio_leds),
378};
379
380static struct platform_device balloon3_leds = {
381 .name = "leds-gpio",
382 .id = 0,
383 .dev = {
384 .platform_data = &balloon3_gpio_led_info,
385 }
386};
387
388struct gpio_led balloon3_pcf_gpio_leds[] = {
389 {
390 .name = "balloon3:green:led0",
391 .gpio = BALLOON3_PCF_GPIO_LED0,
392 .active_low = 1,
393 }, {
394 .name = "balloon3:green:led1",
395 .gpio = BALLOON3_PCF_GPIO_LED1,
396 .active_low = 1,
397 }, {
398 .name = "balloon3:orange:led2",
399 .gpio = BALLOON3_PCF_GPIO_LED2,
400 .active_low = 1,
401 }, {
402 .name = "balloon3:orange:led3",
403 .gpio = BALLOON3_PCF_GPIO_LED3,
404 .active_low = 1,
405 }, {
406 .name = "balloon3:orange:led4",
407 .gpio = BALLOON3_PCF_GPIO_LED4,
408 .active_low = 1,
409 }, {
410 .name = "balloon3:orange:led5",
411 .gpio = BALLOON3_PCF_GPIO_LED5,
412 .active_low = 1,
413 }, {
414 .name = "balloon3:red:led6",
415 .gpio = BALLOON3_PCF_GPIO_LED6,
416 .active_low = 1,
417 }, {
418 .name = "balloon3:red:led7",
419 .gpio = BALLOON3_PCF_GPIO_LED7,
420 .active_low = 1,
421 },
422};
423
424static struct gpio_led_platform_data balloon3_pcf_gpio_led_info = {
425 .leds = balloon3_pcf_gpio_leds,
426 .num_leds = ARRAY_SIZE(balloon3_pcf_gpio_leds),
427};
428
429static struct platform_device balloon3_pcf_leds = {
430 .name = "leds-gpio",
431 .id = 1,
432 .dev = {
433 .platform_data = &balloon3_pcf_gpio_led_info,
434 }
435};
436
437static void __init balloon3_leds_init(void)
438{
439 platform_device_register(&balloon3_leds);
440 platform_device_register(&balloon3_pcf_leds);
441}
442#else
443static inline void balloon3_leds_init(void) {}
444#endif
445
446/******************************************************************************
447 * FPGA IRQ
448 ******************************************************************************/
76static void balloon3_mask_irq(unsigned int irq) 449static void balloon3_mask_irq(unsigned int irq)
77{ 450{
78 int balloon3_irq = (irq - BALLOON3_IRQ(0)); 451 int balloon3_irq = (irq - BALLOON3_IRQ(0));
@@ -98,7 +471,6 @@ static void balloon3_irq_handler(unsigned int irq, struct irq_desc *desc)
98{ 471{
99 unsigned long pending = __raw_readl(BALLOON3_INT_CONTROL_REG) & 472 unsigned long pending = __raw_readl(BALLOON3_INT_CONTROL_REG) &
100 balloon3_irq_enabled; 473 balloon3_irq_enabled;
101
102 do { 474 do {
103 /* clear useless edge notification */ 475 /* clear useless edge notification */
104 if (desc->chip->ack) 476 if (desc->chip->ack)
@@ -132,201 +504,259 @@ static void __init balloon3_init_irq(void)
132 "enabled\n", __func__, BALLOON3_AUX_NIRQ); 504 "enabled\n", __func__, BALLOON3_AUX_NIRQ);
133} 505}
134 506
135static unsigned long balloon3_ac97_pin_config[] = { 507/******************************************************************************
136 GPIO28_AC97_BITCLK, 508 * GPIO expander
137 GPIO29_AC97_SDATA_IN_0, 509 ******************************************************************************/
138 GPIO30_AC97_SDATA_OUT, 510#if defined(CONFIG_GPIO_PCF857X) || defined(CONFIG_GPIO_PCF857X_MODULE)
139 GPIO31_AC97_SYNC, 511static struct pcf857x_platform_data balloon3_pcf857x_pdata = {
140 GPIO113_AC97_nRESET, 512 .gpio_base = BALLOON3_PCF_GPIO_BASE,
141}; 513 .n_latch = 0,
142 514 .setup = NULL,
143static void balloon3_backlight_power(int on) 515 .teardown = NULL,
144{ 516 .context = NULL,
145 pr_debug("%s: power is %s\n", __func__, on ? "on" : "off");
146 gpio_set_value(BALLOON3_GPIO_RUN_BACKLIGHT, on);
147}
148
149static unsigned long balloon3_lcd_pin_config[] = {
150 /* LCD - 16bpp Active TFT */
151 GPIOxx_LCD_TFT_16BPP,
152
153 GPIO99_GPIO, /* Backlight */
154}; 517};
155 518
156static struct pxafb_mode_info balloon3_lcd_modes[] = { 519static struct i2c_board_info __initdata balloon3_i2c_devs[] = {
157 { 520 {
158 .pixclock = 38000, 521 I2C_BOARD_INFO("pcf8574a", 0x38),
159 .xres = 480, 522 .platform_data = &balloon3_pcf857x_pdata,
160 .yres = 640,
161 .bpp = 16,
162 .hsync_len = 8,
163 .left_margin = 8,
164 .right_margin = 8,
165 .vsync_len = 2,
166 .upper_margin = 4,
167 .lower_margin = 5,
168 .sync = 0,
169 }, 523 },
170}; 524};
171 525
172static struct pxafb_mach_info balloon3_pxafb_info = { 526static void __init balloon3_i2c_init(void)
173 .modes = balloon3_lcd_modes, 527{
174 .num_modes = ARRAY_SIZE(balloon3_lcd_modes), 528 pxa_set_i2c_info(NULL);
175 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, 529 i2c_register_board_info(0, ARRAY_AND_SIZE(balloon3_i2c_devs));
176 .pxafb_backlight_power = balloon3_backlight_power, 530}
177}; 531#else
532static inline void balloon3_i2c_init(void) {}
533#endif
534
535/******************************************************************************
536 * NAND
537 ******************************************************************************/
538#if defined(CONFIG_MTD_NAND_PLATFORM)||defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
539static uint16_t balloon3_ctl =
540 BALLOON3_NAND_CONTROL_FLCE0 | BALLOON3_NAND_CONTROL_FLCE1 |
541 BALLOON3_NAND_CONTROL_FLCE2 | BALLOON3_NAND_CONTROL_FLCE3 |
542 BALLOON3_NAND_CONTROL_FLWP;
543
544static void balloon3_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
545{
546 struct nand_chip *this = mtd->priv;
178 547
179static unsigned long balloon3_mmc_pin_config[] = { 548 if (ctrl & NAND_CTRL_CHANGE) {
180 GPIO32_MMC_CLK, 549 if (ctrl & NAND_CLE)
181 GPIO92_MMC_DAT_0, 550 balloon3_ctl |= BALLOON3_NAND_CONTROL_FLCLE;
182 GPIO109_MMC_DAT_1, 551 else
183 GPIO110_MMC_DAT_2, 552 balloon3_ctl &= ~BALLOON3_NAND_CONTROL_FLCLE;
184 GPIO111_MMC_DAT_3,
185 GPIO112_MMC_CMD,
186};
187 553
188static void balloon3_mci_setpower(struct device *dev, unsigned int vdd) 554 if (ctrl & NAND_ALE)
189{ 555 balloon3_ctl |= BALLOON3_NAND_CONTROL_FLALE;
190 struct pxamci_platform_data *p_d = dev->platform_data; 556 else
191 557 balloon3_ctl &= ~BALLOON3_NAND_CONTROL_FLALE;
192 if ((1 << vdd) & p_d->ocr_mask) { 558
193 pr_debug("%s: on\n", __func__); 559 __raw_writel(balloon3_ctl, BALLOON3_NAND_CONTROL_REG);
194 /* FIXME something to prod here? */
195 } else {
196 pr_debug("%s: off\n", __func__);
197 /* FIXME something to prod here? */
198 } 560 }
561
562 if (cmd != NAND_CMD_NONE)
563 writeb(cmd, this->IO_ADDR_W);
199} 564}
200 565
201static struct pxamci_platform_data balloon3_mci_platform_data = { 566static void balloon3_nand_select_chip(struct mtd_info *mtd, int chip)
202 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, 567{
203 .setpower = balloon3_mci_setpower, 568 if (chip < 0 || chip > 3)
204}; 569 return;
205 570
206static int balloon3_udc_is_connected(void) 571 balloon3_ctl |= BALLOON3_NAND_CONTROL_FLCE0 |
572 BALLOON3_NAND_CONTROL_FLCE1 |
573 BALLOON3_NAND_CONTROL_FLCE2 |
574 BALLOON3_NAND_CONTROL_FLCE3;
575
576 /* Deassert correct nCE line */
577 balloon3_ctl &= ~(BALLOON3_NAND_CONTROL_FLCE0 << chip);
578
579 __raw_writew(balloon3_ctl, BALLOON3_NAND_CONTROL_REG);
580}
581
582static int balloon3_nand_probe(struct platform_device *pdev)
207{ 583{
208 pr_debug("%s: udc connected\n", __func__); 584 void __iomem *temp_map;
209 return 1; 585 uint16_t ver;
586 int ret;
587
588 __raw_writew(BALLOON3_NAND_CONTROL2_16BIT, BALLOON3_NAND_CONTROL2_REG);
589
590 ver = __raw_readw(BALLOON3_FPGA_VER);
591 if (ver > 0x0201)
592 pr_warn("The FPGA code, version 0x%04x, is newer than rel-0.3. "
593 "NAND support might be broken in this version!", ver);
594
595 /* Power up the NAND chips */
596 ret = gpio_request(BALLOON3_GPIO_RUN_NAND, "NAND");
597 if (ret)
598 goto err1;
599
600 ret = gpio_direction_output(BALLOON3_GPIO_RUN_NAND, 1);
601 if (ret)
602 goto err2;
603
604 gpio_set_value(BALLOON3_GPIO_RUN_NAND, 1);
605
606 /* Deassert all nCE lines and write protect line */
607 __raw_writel(balloon3_ctl, BALLOON3_NAND_CONTROL_REG);
608 return 0;
609
610err2:
611 gpio_free(BALLOON3_GPIO_RUN_NAND);
612err1:
613 return ret;
210} 614}
211 615
212static void balloon3_udc_command(int cmd) 616static void balloon3_nand_remove(struct platform_device *pdev)
213{ 617{
214 switch (cmd) { 618 /* Power down the NAND chips */
215 case PXA2XX_UDC_CMD_CONNECT: 619 gpio_set_value(BALLOON3_GPIO_RUN_NAND, 0);
216 UP2OCR |= (UP2OCR_DPPUE + UP2OCR_DPPUBE); 620 gpio_free(BALLOON3_GPIO_RUN_NAND);
217 pr_debug("%s: connect\n", __func__);
218 break;
219 case PXA2XX_UDC_CMD_DISCONNECT:
220 UP2OCR &= ~UP2OCR_DPPUE;
221 pr_debug("%s: disconnect\n", __func__);
222 break;
223 }
224} 621}
225 622
226static struct pxa2xx_udc_mach_info balloon3_udc_info = { 623static struct mtd_partition balloon3_partition_info[] = {
227 .udc_is_connected = balloon3_udc_is_connected, 624 [0] = {
228 .udc_command = balloon3_udc_command, 625 .name = "Boot",
626 .offset = 0,
627 .size = SZ_4M,
628 },
629 [1] = {
630 .name = "RootFS",
631 .offset = MTDPART_OFS_APPEND,
632 .size = MTDPART_SIZ_FULL
633 },
229}; 634};
230 635
231static struct pxaficp_platform_data balloon3_ficp_platform_data = { 636static const char *balloon3_part_probes[] = { "cmdlinepart", NULL };
232 .transceiver_cap = IR_SIRMODE | IR_FIRMODE | IR_OFF,
233};
234 637
235static unsigned long balloon3_ohci_pin_config[] = { 638struct platform_nand_data balloon3_nand_pdata = {
236 GPIO88_USBH1_PWR, 639 .chip = {
237 GPIO89_USBH1_PEN, 640 .nr_chips = 4,
641 .chip_offset = 0,
642 .nr_partitions = ARRAY_SIZE(balloon3_partition_info),
643 .partitions = balloon3_partition_info,
644 .chip_delay = 50,
645 .part_probe_types = balloon3_part_probes,
646 },
647 .ctrl = {
648 .hwcontrol = 0,
649 .dev_ready = 0,
650 .select_chip = balloon3_nand_select_chip,
651 .cmd_ctrl = balloon3_nand_cmd_ctl,
652 .probe = balloon3_nand_probe,
653 .remove = balloon3_nand_remove,
654 },
238}; 655};
239 656
240static struct pxaohci_platform_data balloon3_ohci_platform_data = { 657static struct resource balloon3_nand_resource[] = {
241 .port_mode = PMM_PERPORT_MODE, 658 [0] = {
242 .flags = ENABLE_PORT_ALL | POWER_CONTROL_LOW | POWER_SENSE_LOW, 659 .start = BALLOON3_NAND_BASE,
660 .end = BALLOON3_NAND_BASE + 0x4,
661 .flags = IORESOURCE_MEM,
662 },
243}; 663};
244 664
245static unsigned long balloon3_pin_config[] __initdata = { 665static struct platform_device balloon3_nand = {
246 /* Select BTUART 'COM1/ttyS0' as IO option for pins 42/43/44/45 */ 666 .name = "gen_nand",
247 GPIO42_BTUART_RXD, 667 .num_resources = ARRAY_SIZE(balloon3_nand_resource),
248 GPIO43_BTUART_TXD, 668 .resource = balloon3_nand_resource,
249 GPIO44_BTUART_CTS, 669 .id = -1,
250 GPIO45_BTUART_RTS, 670 .dev = {
251 671 .platform_data = &balloon3_nand_pdata,
252 /* Wakeup GPIO */ 672 }
253 GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH,
254
255 /* NAND & IDLE LED GPIOs */
256 GPIO9_GPIO,
257 GPIO10_GPIO,
258}; 673};
259 674
260static struct gpio_led balloon3_gpio_leds[] = { 675static void __init balloon3_nand_init(void)
676{
677 platform_device_register(&balloon3_nand);
678}
679#else
680static inline void balloon3_nand_init(void) {}
681#endif
682
683/******************************************************************************
684 * Core power regulator
685 ******************************************************************************/
686#if defined(CONFIG_REGULATOR_MAX1586) || \
687 defined(CONFIG_REGULATOR_MAX1586_MODULE)
688static struct regulator_consumer_supply balloon3_max1587a_consumers[] = {
261 { 689 {
262 .name = "balloon3:green:idle", 690 .supply = "vcc_core",
263 .default_trigger = "heartbeat", 691 }
264 .gpio = BALLOON3_GPIO_LED_IDLE, 692};
265 .active_low = 1, 693
694static struct regulator_init_data balloon3_max1587a_v3_info = {
695 .constraints = {
696 .name = "vcc_core range",
697 .min_uV = 900000,
698 .max_uV = 1705000,
699 .always_on = 1,
700 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
266 }, 701 },
702 .consumer_supplies = balloon3_max1587a_consumers,
703 .num_consumer_supplies = ARRAY_SIZE(balloon3_max1587a_consumers),
704};
705
706static struct max1586_subdev_data balloon3_max1587a_subdevs[] = {
267 { 707 {
268 .name = "balloon3:green:nand", 708 .name = "vcc_core",
269 .default_trigger = "nand-disk", 709 .id = MAX1586_V3,
270 .gpio = BALLOON3_GPIO_LED_NAND, 710 .platform_data = &balloon3_max1587a_v3_info,
271 .active_low = 1, 711 }
272 },
273}; 712};
274 713
275static struct gpio_led_platform_data balloon3_gpio_leds_platform_data = { 714static struct max1586_platform_data balloon3_max1587a_info = {
276 .leds = balloon3_gpio_leds, 715 .subdevs = balloon3_max1587a_subdevs,
277 .num_leds = ARRAY_SIZE(balloon3_gpio_leds), 716 .num_subdevs = ARRAY_SIZE(balloon3_max1587a_subdevs),
717 .v3_gain = MAX1586_GAIN_R24_3k32, /* 730..1550 mV */
278}; 718};
279 719
280static struct platform_device balloon3led_device = { 720static struct i2c_board_info __initdata balloon3_pi2c_board_info[] = {
281 .name = "leds-gpio", 721 {
282 .id = -1, 722 I2C_BOARD_INFO("max1586", 0x14),
283 .dev = { 723 .platform_data = &balloon3_max1587a_info,
284 .platform_data = &balloon3_gpio_leds_platform_data,
285 }, 724 },
286}; 725};
287 726
288static void __init balloon3_init(void) 727static void __init balloon3_pmic_init(void)
289{ 728{
290 pr_info("Initialising Balloon3\n"); 729 pxa27x_set_i2c_power_info(NULL);
730 i2c_register_board_info(1, ARRAY_AND_SIZE(balloon3_pi2c_board_info));
731}
732#else
733static inline void balloon3_pmic_init(void) {}
734#endif
291 735
292 /* system bus arbiter setting 736/******************************************************************************
293 * - Core_Park 737 * Machine init
294 * - LCD_wt:DMA_wt:CORE_Wt = 2:3:4 738 ******************************************************************************/
295 */ 739static void __init balloon3_init(void)
740{
296 ARB_CNTRL = ARB_CORE_PARK | 0x234; 741 ARB_CNTRL = ARB_CORE_PARK | 0x234;
297 742
743 pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_pin_config));
744
298 pxa_set_ffuart_info(NULL); 745 pxa_set_ffuart_info(NULL);
299 pxa_set_btuart_info(NULL); 746 pxa_set_btuart_info(NULL);
300 pxa_set_stuart_info(NULL); 747 pxa_set_stuart_info(NULL);
301 748
302 pxa_set_i2c_info(NULL); 749 balloon3_i2c_init();
303 if (balloon3_has(BALLOON3_FEATURE_AUDIO)) { 750 balloon3_irda_init();
304 pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_ac97_pin_config)); 751 balloon3_lcd_init();
305 pxa_set_ac97_info(NULL); 752 balloon3_leds_init();
306 } 753 balloon3_mmc_init();
307 754 balloon3_nand_init();
308 if (balloon3_has(BALLOON3_FEATURE_TOPPOLY)) { 755 balloon3_nor_init();
309 pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_lcd_pin_config)); 756 balloon3_pmic_init();
310 gpio_request(BALLOON3_GPIO_RUN_BACKLIGHT, 757 balloon3_ts_init();
311 "LCD Backlight Power"); 758 balloon3_udc_init();
312 gpio_direction_output(BALLOON3_GPIO_RUN_BACKLIGHT, 1); 759 balloon3_uhc_init();
313 set_pxa_fb_info(&balloon3_pxafb_info);
314 }
315
316 if (balloon3_has(BALLOON3_FEATURE_MMC)) {
317 pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_mmc_pin_config));
318 pxa_set_mci_info(&balloon3_mci_platform_data);
319 }
320 pxa_set_ficp_info(&balloon3_ficp_platform_data);
321 if (balloon3_has(BALLOON3_FEATURE_OHCI)) {
322 pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_ohci_pin_config));
323 pxa_set_ohci_info(&balloon3_ohci_platform_data);
324 }
325 pxa_set_udc_info(&balloon3_udc_info);
326
327 pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_pin_config));
328
329 platform_device_register(&balloon3led_device);
330} 760}
331 761
332static struct map_desc balloon3_io_desc[] __initdata = { 762static struct map_desc balloon3_io_desc[] __initdata = {
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index fdda6be6c391..c70e6c2f4e7c 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -689,6 +689,7 @@ static void __init cm_x300_init_da9030(void)
689{ 689{
690 pxa3xx_set_i2c_power_info(&cm_x300_pwr_i2c_info); 690 pxa3xx_set_i2c_power_info(&cm_x300_pwr_i2c_info);
691 i2c_register_board_info(1, &cm_x300_pmic_info, 1); 691 i2c_register_board_info(1, &cm_x300_pmic_info, 1);
692 set_irq_wake(IRQ_WAKEUP0, 1);
692} 693}
693 694
694static void __init cm_x300_init_wi2wi(void) 695static void __init cm_x300_init_wi2wi(void)
@@ -745,9 +746,10 @@ static void __init cm_x300_init(void)
745{ 746{
746 cm_x300_init_mfp(); 747 cm_x300_init_mfp();
747 748
748 pxa_set_ffuart_info(NULL);
749 pxa_set_btuart_info(NULL); 749 pxa_set_btuart_info(NULL);
750 pxa_set_stuart_info(NULL); 750 pxa_set_stuart_info(NULL);
751 if (cpu_is_pxa300())
752 pxa_set_ffuart_info(NULL);
751 753
752 cm_x300_init_da9030(); 754 cm_x300_init_da9030();
753 cm_x300_init_dm9000(); 755 cm_x300_init_dm9000();
diff --git a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
new file mode 100644
index 000000000000..0f3b632c3b14
--- /dev/null
+++ b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
@@ -0,0 +1,111 @@
1/*
2 * linux/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
3 *
4 * Support for Toradex PXA270 based Colibri Evaluation Carrier Board
5 * Daniel Mack <daniel@caiaq.de>
6 * Marek Vasut <marek.vasut@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/init.h>
14#include <linux/kernel.h>
15#include <linux/platform_device.h>
16#include <linux/sysdev.h>
17#include <linux/interrupt.h>
18#include <linux/gpio.h>
19#include <asm/mach-types.h>
20#include <mach/hardware.h>
21#include <asm/mach/arch.h>
22
23#include <mach/pxa27x.h>
24#include <mach/colibri.h>
25#include <mach/mmc.h>
26#include <mach/ohci.h>
27#include <mach/pxa27x-udc.h>
28
29#include "generic.h"
30#include "devices.h"
31
32/******************************************************************************
33 * Pin configuration
34 ******************************************************************************/
35static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {
36 /* MMC */
37 GPIO32_MMC_CLK,
38 GPIO92_MMC_DAT_0,
39 GPIO109_MMC_DAT_1,
40 GPIO110_MMC_DAT_2,
41 GPIO111_MMC_DAT_3,
42 GPIO112_MMC_CMD,
43 GPIO0_GPIO, /* SD detect */
44
45 /* FFUART */
46 GPIO39_FFUART_TXD,
47 GPIO34_FFUART_RXD,
48
49 /* UHC */
50 GPIO88_USBH1_PWR,
51 GPIO89_USBH1_PEN,
52 GPIO119_USBH2_PWR,
53 GPIO120_USBH2_PEN,
54};
55
56/******************************************************************************
57 * SD/MMC card controller
58 ******************************************************************************/
59#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
60static struct pxamci_platform_data colibri_pxa270_mci_platform_data = {
61 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
62 .gpio_power = -1,
63 .gpio_card_detect = GPIO0_COLIBRI_PXA270_SD_DETECT,
64 .gpio_card_ro = -1,
65 .detect_delay_ms = 200,
66};
67
68static void __init colibri_pxa270_mmc_init(void)
69{
70 pxa_set_mci_info(&colibri_pxa270_mci_platform_data);
71}
72#else
73static inline void colibri_pxa270_mmc_init(void) {}
74#endif
75
76/******************************************************************************
77 * USB Host
78 ******************************************************************************/
79#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
80static int colibri_pxa270_ohci_init(struct device *dev)
81{
82 UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
83 return 0;
84}
85
86static struct pxaohci_platform_data colibri_pxa270_ohci_info = {
87 .port_mode = PMM_PERPORT_MODE,
88 .flags = ENABLE_PORT1 | ENABLE_PORT2 |
89 POWER_CONTROL_LOW | POWER_SENSE_LOW,
90 .init = colibri_pxa270_ohci_init,
91};
92
93static void __init colibri_pxa270_uhc_init(void)
94{
95 pxa_set_ohci_info(&colibri_pxa270_ohci_info);
96}
97#else
98static inline void colibri_pxa270_uhc_init(void) {}
99#endif
100
101void __init colibri_pxa270_evalboard_init(void)
102{
103 pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_evalboard_pin_config));
104 pxa_set_ffuart_info(NULL);
105 pxa_set_btuart_info(NULL);
106 pxa_set_stuart_info(NULL);
107
108 colibri_pxa270_mmc_init();
109 colibri_pxa270_uhc_init();
110}
111
diff --git a/arch/arm/mach-pxa/colibri-pxa270-income.c b/arch/arm/mach-pxa/colibri-pxa270-income.c
new file mode 100644
index 000000000000..37f0f3ed7c61
--- /dev/null
+++ b/arch/arm/mach-pxa/colibri-pxa270-income.c
@@ -0,0 +1,272 @@
1/*
2 * linux/arch/arm/mach-pxa/income.c
3 *
4 * Support for Income s.r.o. SH-Dmaster PXA270 SBC
5 *
6 * Copyright (C) 2010
7 * Marek Vasut <marek.vasut@gmail.com>
8 * Pavel Revak <palo@bielyvlk.sk>
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#include <linux/bitops.h>
16#include <linux/delay.h>
17#include <linux/gpio.h>
18#include <linux/init.h>
19#include <linux/interrupt.h>
20#include <linux/ioport.h>
21#include <linux/kernel.h>
22#include <linux/platform_device.h>
23#include <linux/pwm_backlight.h>
24#include <linux/sysdev.h>
25
26#include <asm/irq.h>
27#include <asm/mach-types.h>
28
29#include <mach/hardware.h>
30#include <mach/mmc.h>
31#include <mach/ohci.h>
32#include <mach/pxa27x.h>
33#include <mach/pxa27x-udc.h>
34#include <mach/pxafb.h>
35
36#include <plat/i2c.h>
37
38#include "devices.h"
39#include "generic.h"
40
41#define GPIO114_INCOME_ETH_IRQ (114)
42#define GPIO0_INCOME_SD_DETECT (0)
43#define GPIO0_INCOME_SD_RO (1)
44#define GPIO54_INCOME_LED_A (54)
45#define GPIO55_INCOME_LED_B (55)
46#define GPIO113_INCOME_TS_IRQ (113)
47
48/******************************************************************************
49 * Pin configuration
50 ******************************************************************************/
51static mfp_cfg_t income_pin_config[] __initdata = {
52 /* MMC */
53 GPIO32_MMC_CLK,
54 GPIO92_MMC_DAT_0,
55 GPIO109_MMC_DAT_1,
56 GPIO110_MMC_DAT_2,
57 GPIO111_MMC_DAT_3,
58 GPIO112_MMC_CMD,
59 GPIO0_GPIO, /* SD detect */
60 GPIO1_GPIO, /* SD read-only */
61
62 /* FFUART */
63 GPIO39_FFUART_TXD,
64 GPIO34_FFUART_RXD,
65
66 /* BFUART */
67 GPIO42_BTUART_RXD,
68 GPIO43_BTUART_TXD,
69 GPIO45_BTUART_RTS,
70
71 /* STUART */
72 GPIO46_STUART_RXD,
73 GPIO47_STUART_TXD,
74
75 /* UHC */
76 GPIO88_USBH1_PWR,
77 GPIO89_USBH1_PEN,
78
79 /* LCD */
80 GPIOxx_LCD_TFT_16BPP,
81
82 /* PWM */
83 GPIO16_PWM0_OUT,
84
85 /* I2C */
86 GPIO117_I2C_SCL,
87 GPIO118_I2C_SDA,
88
89 /* LED */
90 GPIO54_GPIO, /* LED A */
91 GPIO55_GPIO, /* LED B */
92};
93
94/******************************************************************************
95 * SD/MMC card controller
96 ******************************************************************************/
97#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
98static struct pxamci_platform_data income_mci_platform_data = {
99 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
100 .gpio_power = -1,
101 .gpio_card_detect = GPIO0_INCOME_SD_DETECT,
102 .gpio_card_ro = GPIO0_INCOME_SD_RO,
103 .detect_delay_ms = 200,
104};
105
106static void __init income_mmc_init(void)
107{
108 pxa_set_mci_info(&income_mci_platform_data);
109}
110#else
111static inline void income_mmc_init(void) {}
112#endif
113
114/******************************************************************************
115 * USB Host
116 ******************************************************************************/
117#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
118static struct pxaohci_platform_data income_ohci_info = {
119 .port_mode = PMM_PERPORT_MODE,
120 .flags = ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW,
121};
122
123static void __init income_uhc_init(void)
124{
125 pxa_set_ohci_info(&income_ohci_info);
126}
127#else
128static inline void income_uhc_init(void) {}
129#endif
130
131/******************************************************************************
132 * LED
133 ******************************************************************************/
134#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
135struct gpio_led income_gpio_leds[] = {
136 {
137 .name = "income:green:leda",
138 .default_trigger = "none",
139 .gpio = GPIO54_INCOME_LED_A,
140 .active_low = 1,
141 },
142 {
143 .name = "income:green:ledb",
144 .default_trigger = "none",
145 .gpio = GPIO55_INCOME_LED_B,
146 .active_low = 1,
147 }
148};
149
150static struct gpio_led_platform_data income_gpio_led_info = {
151 .leds = income_gpio_leds,
152 .num_leds = ARRAY_SIZE(income_gpio_leds),
153};
154
155static struct platform_device income_leds = {
156 .name = "leds-gpio",
157 .id = -1,
158 .dev = {
159 .platform_data = &income_gpio_led_info,
160 }
161};
162
163static void __init income_led_init(void)
164{
165 platform_device_register(&income_leds);
166}
167#else
168static inline void income_led_init(void) {}
169#endif
170
171/******************************************************************************
172 * I2C
173 ******************************************************************************/
174#if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE)
175static struct i2c_board_info __initdata income_i2c_devs[] = {
176 {
177 I2C_BOARD_INFO("ds1340", 0x68),
178 }, {
179 I2C_BOARD_INFO("lm75", 0x4f),
180 },
181};
182
183static void __init income_i2c_init(void)
184{
185 pxa_set_i2c_info(NULL);
186 pxa27x_set_i2c_power_info(NULL);
187 i2c_register_board_info(0, ARRAY_AND_SIZE(income_i2c_devs));
188}
189#else
190static inline void income_i2c_init(void) {}
191#endif
192
193/******************************************************************************
194 * Framebuffer
195 ******************************************************************************/
196#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
197static struct pxafb_mode_info income_lcd_modes[] = {
198{
199 .pixclock = 144700,
200 .xres = 320,
201 .yres = 240,
202 .bpp = 32,
203 .depth = 18,
204
205 .left_margin = 10,
206 .right_margin = 10,
207 .upper_margin = 7,
208 .lower_margin = 8,
209
210 .hsync_len = 20,
211 .vsync_len = 2,
212
213 .sync = FB_SYNC_VERT_HIGH_ACT,
214},
215};
216
217static struct pxafb_mach_info income_lcd_screen = {
218 .modes = income_lcd_modes,
219 .num_modes = ARRAY_SIZE(income_lcd_modes),
220 .lcd_conn = LCD_COLOR_TFT_18BPP | LCD_PCLK_EDGE_FALL,
221};
222
223static void __init income_lcd_init(void)
224{
225 set_pxa_fb_info(&income_lcd_screen);
226}
227#else
228static inline void income_lcd_init(void) {}
229#endif
230
231/******************************************************************************
232 * Backlight
233 ******************************************************************************/
234#if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM__MODULE)
235static struct platform_pwm_backlight_data income_backlight_data = {
236 .pwm_id = 0,
237 .max_brightness = 0x3ff,
238 .dft_brightness = 0x1ff,
239 .pwm_period_ns = 1000000,
240};
241
242static struct platform_device income_backlight = {
243 .name = "pwm-backlight",
244 .dev = {
245 .parent = &pxa27x_device_pwm0.dev,
246 .platform_data = &income_backlight_data,
247 },
248};
249
250static void __init income_pwm_init(void)
251{
252 platform_device_register(&income_backlight);
253}
254#else
255static inline void income_pwm_init(void) {}
256#endif
257
258void __init colibri_pxa270_income_boardinit(void)
259{
260 pxa2xx_mfp_config(ARRAY_AND_SIZE(income_pin_config));
261 pxa_set_ffuart_info(NULL);
262 pxa_set_btuart_info(NULL);
263 pxa_set_stuart_info(NULL);
264
265 income_mmc_init();
266 income_uhc_init();
267 income_led_init();
268 income_i2c_init();
269 income_lcd_init();
270 income_pwm_init();
271}
272
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
index 061c45316de8..98673ac6efd0 100644
--- a/arch/arm/mach-pxa/colibri-pxa270.c
+++ b/arch/arm/mach-pxa/colibri-pxa270.c
@@ -3,6 +3,7 @@
3 * 3 *
4 * Support for Toradex PXA270 based Colibri module 4 * Support for Toradex PXA270 based Colibri module
5 * Daniel Mack <daniel@caiaq.de> 5 * Daniel Mack <daniel@caiaq.de>
6 * Marek Vasut <marek.vasut@gmail.com>
6 * 7 *
7 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -10,49 +11,55 @@
10 */ 11 */
11 12
12#include <linux/init.h> 13#include <linux/init.h>
13#include <linux/kernel.h>
14#include <linux/platform_device.h>
15#include <linux/sysdev.h>
16#include <linux/interrupt.h> 14#include <linux/interrupt.h>
17#include <linux/bitops.h> 15#include <linux/kernel.h>
18#include <linux/ioport.h>
19#include <linux/delay.h>
20#include <linux/mtd/mtd.h> 16#include <linux/mtd/mtd.h>
21#include <linux/mtd/partitions.h> 17#include <linux/mtd/partitions.h>
22#include <linux/mtd/physmap.h> 18#include <linux/mtd/physmap.h>
23#include <linux/gpio.h> 19#include <linux/platform_device.h>
24#include <asm/mach-types.h> 20#include <linux/sysdev.h>
25#include <mach/hardware.h> 21#include <linux/ucb1400.h>
26#include <asm/irq.h> 22
27#include <asm/sizes.h>
28#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
29#include <asm/mach/map.h>
30#include <asm/mach/irq.h>
31#include <asm/mach/flash.h> 24#include <asm/mach/flash.h>
25#include <asm/mach-types.h>
26#include <asm/sizes.h>
32 27
33#include <mach/pxa27x.h> 28#include <mach/audio.h>
34#include <mach/colibri.h> 29#include <mach/colibri.h>
30#include <mach/pxa27x.h>
35 31
36#include "generic.h"
37#include "devices.h" 32#include "devices.h"
33#include "generic.h"
38 34
39/* 35/******************************************************************************
40 * GPIO configuration 36 * Pin configuration
41 */ 37 ******************************************************************************/
42static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = { 38static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = {
39 /* Ethernet */
43 GPIO78_nCS_2, /* Ethernet CS */ 40 GPIO78_nCS_2, /* Ethernet CS */
44 GPIO114_GPIO, /* Ethernet IRQ */ 41 GPIO114_GPIO, /* Ethernet IRQ */
42
43 /* AC97 */
44 GPIO28_AC97_BITCLK,
45 GPIO29_AC97_SDATA_IN_0,
46 GPIO30_AC97_SDATA_OUT,
47 GPIO31_AC97_SYNC,
48 GPIO95_AC97_nRESET,
49 GPIO98_AC97_SYSCLK,
50 GPIO113_GPIO, /* Touchscreen IRQ */
45}; 51};
46 52
47/* 53/******************************************************************************
48 * NOR flash 54 * NOR Flash
49 */ 55 ******************************************************************************/
56#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
50static struct mtd_partition colibri_partitions[] = { 57static struct mtd_partition colibri_partitions[] = {
51 { 58 {
52 .name = "Bootloader", 59 .name = "Bootloader",
53 .offset = 0x00000000, 60 .offset = 0x00000000,
54 .size = 0x00040000, 61 .size = 0x00040000,
55 .mask_flags = MTD_WRITEABLE /* force read-only */ 62 .mask_flags = MTD_WRITEABLE /* force read-only */
56 }, { 63 }, {
57 .name = "Kernel", 64 .name = "Kernel",
58 .offset = 0x00040000, 65 .offset = 0x00040000,
@@ -90,50 +97,113 @@ static struct platform_device colibri_pxa270_flash_device = {
90 .num_resources = 1, 97 .num_resources = 1,
91}; 98};
92 99
93/* 100static void __init colibri_pxa270_nor_init(void)
94 * DM9000 Ethernet 101{
95 */ 102 platform_device_register(&colibri_pxa270_flash_device);
96#if defined(CONFIG_DM9000) 103}
97static struct resource dm9000_resources[] = { 104#else
98 [0] = { 105static inline void colibri_pxa270_nor_init(void) {}
99 .start = COLIBRI_PXA270_ETH_PHYS, 106#endif
100 .end = COLIBRI_PXA270_ETH_PHYS + 3, 107
108/******************************************************************************
109 * Ethernet
110 ******************************************************************************/
111#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
112static struct resource colibri_pxa270_dm9000_resources[] = {
113 {
114 .start = PXA_CS2_PHYS,
115 .end = PXA_CS2_PHYS + 3,
101 .flags = IORESOURCE_MEM, 116 .flags = IORESOURCE_MEM,
102 }, 117 },
103 [1] = { 118 {
104 .start = COLIBRI_PXA270_ETH_PHYS + 4, 119 .start = PXA_CS2_PHYS + 4,
105 .end = COLIBRI_PXA270_ETH_PHYS + 4 + 500, 120 .end = PXA_CS2_PHYS + 4 + 500,
106 .flags = IORESOURCE_MEM, 121 .flags = IORESOURCE_MEM,
107 }, 122 },
108 [2] = { 123 {
109 .start = COLIBRI_PXA270_ETH_IRQ, 124 .start = gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ),
110 .end = COLIBRI_PXA270_ETH_IRQ, 125 .end = gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ),
111 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING, 126 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING,
112 }, 127 },
113}; 128};
114 129
115static struct platform_device dm9000_device = { 130static struct platform_device colibri_pxa270_dm9000_device = {
116 .name = "dm9000", 131 .name = "dm9000",
117 .id = -1, 132 .id = -1,
118 .num_resources = ARRAY_SIZE(dm9000_resources), 133 .num_resources = ARRAY_SIZE(colibri_pxa270_dm9000_resources),
119 .resource = dm9000_resources, 134 .resource = colibri_pxa270_dm9000_resources,
120}; 135};
121#endif /* CONFIG_DM9000 */
122 136
123static struct platform_device *colibri_pxa270_devices[] __initdata = { 137static void __init colibri_pxa270_eth_init(void)
124 &colibri_pxa270_flash_device, 138{
125#if defined(CONFIG_DM9000) 139 platform_device_register(&colibri_pxa270_dm9000_device);
126 &dm9000_device, 140}
141#else
142static inline void colibri_pxa270_eth_init(void) {}
127#endif 143#endif
144
145/******************************************************************************
146 * Audio and Touchscreen
147 ******************************************************************************/
148#if defined(CONFIG_TOUCHSCREEN_UCB1400) || \
149 defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE)
150static pxa2xx_audio_ops_t colibri_pxa270_ac97_pdata = {
151 .reset_gpio = 95,
152};
153
154static struct ucb1400_pdata colibri_pxa270_ucb1400_pdata = {
155 .irq = gpio_to_irq(GPIO113_COLIBRI_PXA270_TS_IRQ),
156};
157
158static struct platform_device colibri_pxa270_ucb1400_device = {
159 .name = "ucb1400_core",
160 .id = -1,
161 .dev = {
162 .platform_data = &colibri_pxa270_ucb1400_pdata,
163 },
128}; 164};
129 165
166static void __init colibri_pxa270_tsc_init(void)
167{
168 pxa_set_ac97_info(&colibri_pxa270_ac97_pdata);
169 platform_device_register(&colibri_pxa270_ucb1400_device);
170}
171#else
172static inline void colibri_pxa270_tsc_init(void) {}
173#endif
174
175static int colibri_pxa270_baseboard;
176core_param(colibri_pxa270_baseboard, colibri_pxa270_baseboard, int, 0444);
177
130static void __init colibri_pxa270_init(void) 178static void __init colibri_pxa270_init(void)
131{ 179{
132 pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_pin_config)); 180 pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_pin_config));
133 pxa_set_ffuart_info(NULL); 181
134 pxa_set_btuart_info(NULL); 182 colibri_pxa270_nor_init();
135 pxa_set_stuart_info(NULL); 183 colibri_pxa270_eth_init();
136 platform_add_devices(ARRAY_AND_SIZE(colibri_pxa270_devices)); 184 colibri_pxa270_tsc_init();
185
186 switch (colibri_pxa270_baseboard) {
187 case COLIBRI_PXA270_EVALBOARD:
188 colibri_pxa270_evalboard_init();
189 break;
190 case COLIBRI_PXA270_INCOME:
191 colibri_pxa270_income_boardinit();
192 break;
193 default:
194 printk(KERN_ERR "Illegal colibri_pxa270_baseboard type %d\n",
195 colibri_pxa270_baseboard);
196 }
197}
198
199/* The "Income s.r.o. SH-Dmaster PXA270 SBC" board can be booted either
200 * with the INCOME mach type or with COLIBRI and the kernel parameter
201 * "colibri_pxa270_baseboard=1"
202 */
203static void __init colibri_pxa270_income_init(void)
204{
205 colibri_pxa270_baseboard = COLIBRI_PXA270_INCOME;
206 colibri_pxa270_init();
137} 207}
138 208
139MACHINE_START(COLIBRI, "Toradex Colibri PXA270") 209MACHINE_START(COLIBRI, "Toradex Colibri PXA270")
@@ -146,3 +216,13 @@ MACHINE_START(COLIBRI, "Toradex Colibri PXA270")
146 .timer = &pxa_timer, 216 .timer = &pxa_timer,
147MACHINE_END 217MACHINE_END
148 218
219MACHINE_START(INCOME, "Income s.r.o. SH-Dmaster PXA270 SBC")
220 .phys_io = 0x40000000,
221 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
222 .boot_params = 0xa0000100,
223 .init_machine = colibri_pxa270_income_init,
224 .map_io = pxa_map_io,
225 .init_irq = pxa27x_init_irq,
226 .timer = &pxa_timer,
227MACHINE_END
228
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c
index ae835fad7d10..99e850d84710 100644
--- a/arch/arm/mach-pxa/colibri-pxa320.c
+++ b/arch/arm/mach-pxa/colibri-pxa320.c
@@ -16,6 +16,7 @@
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/gpio.h> 17#include <linux/gpio.h>
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/usb/gpio_vbus.h>
19 20
20#include <asm/mach-types.h> 21#include <asm/mach-types.h>
21#include <asm/sizes.h> 22#include <asm/sizes.h>
@@ -28,6 +29,8 @@
28#include <mach/pxafb.h> 29#include <mach/pxafb.h>
29#include <mach/ohci.h> 30#include <mach/ohci.h>
30#include <mach/audio.h> 31#include <mach/audio.h>
32#include <mach/pxa27x-udc.h>
33#include <mach/udc.h>
31 34
32#include "generic.h" 35#include "generic.h"
33#include "devices.h" 36#include "devices.h"
@@ -101,6 +104,42 @@ void __init colibri_pxa320_init_ohci(void)
101static inline void colibri_pxa320_init_ohci(void) {} 104static inline void colibri_pxa320_init_ohci(void) {}
102#endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */ 105#endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */
103 106
107#if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE)
108static struct gpio_vbus_mach_info colibri_pxa320_gpio_vbus_info = {
109 .gpio_vbus = mfp_to_gpio(MFP_PIN_GPIO96),
110 .gpio_pullup = -1,
111};
112
113static struct platform_device colibri_pxa320_gpio_vbus = {
114 .name = "gpio-vbus",
115 .id = -1,
116 .dev = {
117 .platform_data = &colibri_pxa320_gpio_vbus_info,
118 },
119};
120
121static void colibri_pxa320_udc_command(int cmd)
122{
123 if (cmd == PXA2XX_UDC_CMD_CONNECT)
124 UP2OCR = UP2OCR_HXOE | UP2OCR_DPPUE;
125 else if (cmd == PXA2XX_UDC_CMD_DISCONNECT)
126 UP2OCR = UP2OCR_HXOE;
127}
128
129static struct pxa2xx_udc_mach_info colibri_pxa320_udc_info __initdata = {
130 .udc_command = colibri_pxa320_udc_command,
131 .gpio_pullup = -1,
132};
133
134static void __init colibri_pxa320_init_udc(void)
135{
136 pxa_set_udc_info(&colibri_pxa320_udc_info);
137 platform_device_register(&colibri_pxa320_gpio_vbus);
138}
139#else
140static inline void colibri_pxa320_init_udc(void) {}
141#endif
142
104static mfp_cfg_t colibri_pxa320_mmc_pin_config[] __initdata = { 143static mfp_cfg_t colibri_pxa320_mmc_pin_config[] __initdata = {
105 GPIO22_MMC1_CLK, 144 GPIO22_MMC1_CLK,
106 GPIO23_MMC1_CMD, 145 GPIO23_MMC1_CMD,
@@ -212,6 +251,7 @@ void __init colibri_pxa320_init(void)
212 colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa320_mmc_pin_config), 251 colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa320_mmc_pin_config),
213 mfp_to_gpio(MFP_PIN_GPIO28)); 252 mfp_to_gpio(MFP_PIN_GPIO28));
214 colibri_pxa320_init_uart(); 253 colibri_pxa320_init_uart();
254 colibri_pxa320_init_udc();
215} 255}
216 256
217MACHINE_START(COLIBRI320, "Toradex Colibri PXA320") 257MACHINE_START(COLIBRI320, "Toradex Colibri PXA320")
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index 461ba4080155..3fb0fc099080 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -50,14 +50,13 @@
50#include <mach/udc.h> 50#include <mach/udc.h>
51#include <mach/pxa2xx_spi.h> 51#include <mach/pxa2xx_spi.h>
52#include <mach/corgi.h> 52#include <mach/corgi.h>
53#include <mach/sharpsl.h> 53#include <mach/sharpsl_pm.h>
54 54
55#include <asm/mach/sharpsl_param.h> 55#include <asm/mach/sharpsl_param.h>
56#include <asm/hardware/scoop.h> 56#include <asm/hardware/scoop.h>
57 57
58#include "generic.h" 58#include "generic.h"
59#include "devices.h" 59#include "devices.h"
60#include "sharpsl.h"
61 60
62static unsigned long corgi_pin_config[] __initdata = { 61static unsigned long corgi_pin_config[] __initdata = {
63 /* Static Memory I/O */ 62 /* Static Memory I/O */
@@ -185,8 +184,6 @@ static struct scoop_pcmcia_config corgi_pcmcia_config = {
185 .num_devs = 1, 184 .num_devs = 1,
186}; 185};
187 186
188EXPORT_SYMBOL(corgiscoop_device);
189
190static struct w100_mem_info corgi_fb_mem = { 187static struct w100_mem_info corgi_fb_mem = {
191 .ext_cntl = 0x00040003, 188 .ext_cntl = 0x00040003,
192 .sdram_mode_reg = 0x00650021, 189 .sdram_mode_reg = 0x00650021,
diff --git a/arch/arm/mach-pxa/corgi_pm.c b/arch/arm/mach-pxa/corgi_pm.c
index 3f1dc74ac048..29034778bfda 100644
--- a/arch/arm/mach-pxa/corgi_pm.c
+++ b/arch/arm/mach-pxa/corgi_pm.c
@@ -23,12 +23,11 @@
23#include <asm/mach-types.h> 23#include <asm/mach-types.h>
24#include <mach/hardware.h> 24#include <mach/hardware.h>
25 25
26#include <mach/sharpsl.h>
27#include <mach/corgi.h> 26#include <mach/corgi.h>
28#include <mach/pxa2xx-regs.h> 27#include <mach/pxa2xx-regs.h>
28#include <mach/sharpsl_pm.h>
29 29
30#include "generic.h" 30#include "generic.h"
31#include "sharpsl.h"
32 31
33#define SHARPSL_CHARGE_ON_VOLT 0x99 /* 2.9V */ 32#define SHARPSL_CHARGE_ON_VOLT 0x99 /* 2.9V */
34#define SHARPSL_CHARGE_ON_TEMP 0xe0 /* 2.9V */ 33#define SHARPSL_CHARGE_ON_TEMP 0xe0 /* 2.9V */
@@ -134,11 +133,11 @@ unsigned long corgipm_read_devdata(int type)
134 case SHARPSL_STATUS_ACIN: 133 case SHARPSL_STATUS_ACIN:
135 return ((GPLR(CORGI_GPIO_AC_IN) & GPIO_bit(CORGI_GPIO_AC_IN)) != 0); 134 return ((GPLR(CORGI_GPIO_AC_IN) & GPIO_bit(CORGI_GPIO_AC_IN)) != 0);
136 case SHARPSL_STATUS_LOCK: 135 case SHARPSL_STATUS_LOCK:
137 return READ_GPIO_BIT(sharpsl_pm.machinfo->gpio_batlock); 136 return gpio_get_value(sharpsl_pm.machinfo->gpio_batlock);
138 case SHARPSL_STATUS_CHRGFULL: 137 case SHARPSL_STATUS_CHRGFULL:
139 return READ_GPIO_BIT(sharpsl_pm.machinfo->gpio_batfull); 138 return gpio_get_value(sharpsl_pm.machinfo->gpio_batfull);
140 case SHARPSL_STATUS_FATAL: 139 case SHARPSL_STATUS_FATAL:
141 return READ_GPIO_BIT(sharpsl_pm.machinfo->gpio_fatal); 140 return gpio_get_value(sharpsl_pm.machinfo->gpio_fatal);
142 case SHARPSL_ACIN_VOLT: 141 case SHARPSL_ACIN_VOLT:
143 return sharpsl_pm_pxa_read_max1111(MAX1111_ACIN_VOLT); 142 return sharpsl_pm_pxa_read_max1111(MAX1111_ACIN_VOLT);
144 case SHARPSL_BATT_TEMP: 143 case SHARPSL_BATT_TEMP:
@@ -165,8 +164,6 @@ static struct sharpsl_charger_machinfo corgi_pm_machinfo = {
165 .should_wakeup = corgi_should_wakeup, 164 .should_wakeup = corgi_should_wakeup,
166#if defined(CONFIG_LCD_CORGI) 165#if defined(CONFIG_LCD_CORGI)
167 .backlight_limit = corgi_lcd_limit_intensity, 166 .backlight_limit = corgi_lcd_limit_intensity,
168#elif defined(CONFIG_BACKLIGHT_CORGI)
169 .backlight_limit = corgibl_limit_intensity,
170#endif 167#endif
171 .charge_on_volt = SHARPSL_CHARGE_ON_VOLT, 168 .charge_on_volt = SHARPSL_CHARGE_ON_VOLT,
172 .charge_on_temp = SHARPSL_CHARGE_ON_TEMP, 169 .charge_on_temp = SHARPSL_CHARGE_ON_TEMP,
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
index 8e10db148f1b..65447dc736c2 100644
--- a/arch/arm/mach-pxa/devices.c
+++ b/arch/arm/mach-pxa/devices.c
@@ -4,6 +4,7 @@
4#include <linux/platform_device.h> 4#include <linux/platform_device.h>
5#include <linux/dma-mapping.h> 5#include <linux/dma-mapping.h>
6 6
7#include <asm/pmu.h>
7#include <mach/udc.h> 8#include <mach/udc.h>
8#include <mach/pxafb.h> 9#include <mach/pxafb.h>
9#include <mach/mmc.h> 10#include <mach/mmc.h>
@@ -31,6 +32,19 @@ void __init pxa_register_device(struct platform_device *dev, void *data)
31 dev_err(&dev->dev, "unable to register device: %d\n", ret); 32 dev_err(&dev->dev, "unable to register device: %d\n", ret);
32} 33}
33 34
35static struct resource pxa_resource_pmu = {
36 .start = IRQ_PMU,
37 .end = IRQ_PMU,
38 .flags = IORESOURCE_IRQ,
39};
40
41struct platform_device pxa_device_pmu = {
42 .name = "arm-pmu",
43 .id = ARM_PMU_DEVICE_CPU,
44 .resource = &pxa_resource_pmu,
45 .num_resources = 1,
46};
47
34static struct resource pxamci_resources[] = { 48static struct resource pxamci_resources[] = {
35 [0] = { 49 [0] = {
36 .start = 0x41100000, 50 .start = 0x41100000,
diff --git a/arch/arm/mach-pxa/devices.h b/arch/arm/mach-pxa/devices.h
index 93817d99761e..50353ea49ba4 100644
--- a/arch/arm/mach-pxa/devices.h
+++ b/arch/arm/mach-pxa/devices.h
@@ -1,3 +1,4 @@
1extern struct platform_device pxa_device_pmu;
1extern struct platform_device pxa_device_mci; 2extern struct platform_device pxa_device_mci;
2extern struct platform_device pxa3xx_device_mci2; 3extern struct platform_device pxa3xx_device_mci2;
3extern struct platform_device pxa3xx_device_mci3; 4extern struct platform_device pxa3xx_device_mci3;
diff --git a/arch/arm/mach-pxa/e330.c b/arch/arm/mach-pxa/e330.c
deleted file mode 100644
index 8fde3387279d..000000000000
--- a/arch/arm/mach-pxa/e330.c
+++ /dev/null
@@ -1,78 +0,0 @@
1/*
2 * Hardware definitions for the Toshiba e330 PDAs
3 *
4 * Copyright (c) 2003 Ian Molton <spyro@f2s.com>
5 *
6 * This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 *
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/clk.h>
16#include <linux/platform_device.h>
17#include <linux/mfd/tc6387xb.h>
18
19#include <asm/setup.h>
20#include <asm/mach/arch.h>
21#include <asm/mach-types.h>
22
23#include <mach/pxa25x.h>
24#include <mach/eseries-gpio.h>
25#include <mach/udc.h>
26
27#include "generic.h"
28#include "eseries.h"
29#include "clock.h"
30
31/* -------------------- e330 tc6387xb parameters -------------------- */
32
33static struct tc6387xb_platform_data e330_tc6387xb_info = {
34 .enable = &eseries_tmio_enable,
35 .disable = &eseries_tmio_disable,
36 .suspend = &eseries_tmio_suspend,
37 .resume = &eseries_tmio_resume,
38};
39
40static struct platform_device e330_tc6387xb_device = {
41 .name = "tc6387xb",
42 .id = -1,
43 .dev = {
44 .platform_data = &e330_tc6387xb_info,
45 },
46 .num_resources = 2,
47 .resource = eseries_tmio_resources,
48};
49
50/* --------------------------------------------------------------- */
51
52static struct platform_device *devices[] __initdata = {
53 &e330_tc6387xb_device,
54};
55
56static void __init e330_init(void)
57{
58 pxa_set_ffuart_info(NULL);
59 pxa_set_btuart_info(NULL);
60 pxa_set_stuart_info(NULL);
61 eseries_register_clks();
62 eseries_get_tmio_gpios();
63 platform_add_devices(devices, ARRAY_SIZE(devices));
64 pxa_set_udc_info(&e7xx_udc_mach_info);
65}
66
67MACHINE_START(E330, "Toshiba e330")
68 /* Maintainer: Ian Molton (spyro@f2s.com) */
69 .phys_io = 0x40000000,
70 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
71 .boot_params = 0xa0000100,
72 .map_io = pxa_map_io,
73 .init_irq = pxa25x_init_irq,
74 .fixup = eseries_fixup,
75 .init_machine = e330_init,
76 .timer = &pxa_timer,
77MACHINE_END
78
diff --git a/arch/arm/mach-pxa/e350.c b/arch/arm/mach-pxa/e350.c
deleted file mode 100644
index f50f055f5720..000000000000
--- a/arch/arm/mach-pxa/e350.c
+++ /dev/null
@@ -1,79 +0,0 @@
1/*
2 * Hardware definitions for the Toshiba e350 PDAs
3 *
4 * Copyright (c) 2003 Ian Molton <spyro@f2s.com>
5 *
6 * This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 *
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/clk.h>
16#include <linux/platform_device.h>
17#include <linux/mfd/t7l66xb.h>
18
19#include <asm/setup.h>
20#include <asm/mach/arch.h>
21#include <asm/mach-types.h>
22
23#include <mach/irqs.h>
24#include <mach/pxa25x.h>
25#include <mach/eseries-gpio.h>
26#include <mach/udc.h>
27
28#include "generic.h"
29#include "eseries.h"
30#include "clock.h"
31
32/* -------------------- e350 t7l66xb parameters -------------------- */
33
34static struct t7l66xb_platform_data e350_t7l66xb_info = {
35 .irq_base = IRQ_BOARD_START,
36 .enable = &eseries_tmio_enable,
37 .suspend = &eseries_tmio_suspend,
38 .resume = &eseries_tmio_resume,
39};
40
41static struct platform_device e350_t7l66xb_device = {
42 .name = "t7l66xb",
43 .id = -1,
44 .dev = {
45 .platform_data = &e350_t7l66xb_info,
46 },
47 .num_resources = 2,
48 .resource = eseries_tmio_resources,
49};
50
51/* ---------------------------------------------------------- */
52
53static struct platform_device *devices[] __initdata = {
54 &e350_t7l66xb_device,
55};
56
57static void __init e350_init(void)
58{
59 pxa_set_ffuart_info(NULL);
60 pxa_set_btuart_info(NULL);
61 pxa_set_stuart_info(NULL);
62 eseries_register_clks();
63 eseries_get_tmio_gpios();
64 platform_add_devices(devices, ARRAY_SIZE(devices));
65 pxa_set_udc_info(&e7xx_udc_mach_info);
66}
67
68MACHINE_START(E350, "Toshiba e350")
69 /* Maintainer: Ian Molton (spyro@f2s.com) */
70 .phys_io = 0x40000000,
71 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
72 .boot_params = 0xa0000100,
73 .map_io = pxa_map_io,
74 .init_irq = pxa25x_init_irq,
75 .fixup = eseries_fixup,
76 .init_machine = e350_init,
77 .timer = &pxa_timer,
78MACHINE_END
79
diff --git a/arch/arm/mach-pxa/e400.c b/arch/arm/mach-pxa/e400.c
deleted file mode 100644
index 55b950f12844..000000000000
--- a/arch/arm/mach-pxa/e400.c
+++ /dev/null
@@ -1,155 +0,0 @@
1/*
2 * Hardware definitions for the Toshiba eseries PDAs
3 *
4 * Copyright (c) 2003 Ian Molton <spyro@f2s.com>
5 *
6 * This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 *
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/clk.h>
16#include <linux/platform_device.h>
17#include <linux/mfd/t7l66xb.h>
18#include <linux/mtd/nand.h>
19#include <linux/mtd/partitions.h>
20
21#include <asm/setup.h>
22#include <asm/mach/arch.h>
23#include <asm/mach-types.h>
24
25#include <mach/pxa25x.h>
26#include <mach/eseries-gpio.h>
27#include <mach/pxafb.h>
28#include <mach/udc.h>
29#include <mach/irqs.h>
30
31#include "generic.h"
32#include "eseries.h"
33#include "clock.h"
34
35/* ------------------------ E400 LCD definitions ------------------------ */
36
37static struct pxafb_mode_info e400_pxafb_mode_info = {
38 .pixclock = 140703,
39 .xres = 240,
40 .yres = 320,
41 .bpp = 16,
42 .hsync_len = 4,
43 .left_margin = 28,
44 .right_margin = 8,
45 .vsync_len = 3,
46 .upper_margin = 5,
47 .lower_margin = 6,
48 .sync = 0,
49};
50
51static struct pxafb_mach_info e400_pxafb_mach_info = {
52 .modes = &e400_pxafb_mode_info,
53 .num_modes = 1,
54 .lcd_conn = LCD_COLOR_TFT_16BPP,
55 .lccr3 = 0,
56 .pxafb_backlight_power = NULL,
57};
58
59/* ------------------------ E400 MFP config ----------------------------- */
60
61static unsigned long e400_pin_config[] __initdata = {
62 /* Chip selects */
63 GPIO15_nCS_1, /* CS1 - Flash */
64 GPIO80_nCS_4, /* CS4 - TMIO */
65
66 /* Clocks */
67 GPIO12_32KHz,
68
69 /* BTUART */
70 GPIO42_BTUART_RXD,
71 GPIO43_BTUART_TXD,
72 GPIO44_BTUART_CTS,
73
74 /* TMIO controller */
75 GPIO19_GPIO, /* t7l66xb #PCLR */
76 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
77
78 /* wakeup */
79 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
80};
81
82/* ---------------------------------------------------------------------- */
83
84static struct mtd_partition partition_a = {
85 .name = "Internal NAND flash",
86 .offset = 0,
87 .size = MTDPART_SIZ_FULL,
88};
89
90static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
91
92static struct nand_bbt_descr e400_t7l66xb_nand_bbt = {
93 .options = 0,
94 .offs = 4,
95 .len = 2,
96 .pattern = scan_ff_pattern
97};
98
99static struct tmio_nand_data e400_t7l66xb_nand_config = {
100 .num_partitions = 1,
101 .partition = &partition_a,
102 .badblock_pattern = &e400_t7l66xb_nand_bbt,
103};
104
105static struct t7l66xb_platform_data e400_t7l66xb_info = {
106 .irq_base = IRQ_BOARD_START,
107 .enable = &eseries_tmio_enable,
108 .suspend = &eseries_tmio_suspend,
109 .resume = &eseries_tmio_resume,
110
111 .nand_data = &e400_t7l66xb_nand_config,
112};
113
114static struct platform_device e400_t7l66xb_device = {
115 .name = "t7l66xb",
116 .id = -1,
117 .dev = {
118 .platform_data = &e400_t7l66xb_info,
119 },
120 .num_resources = 2,
121 .resource = eseries_tmio_resources,
122};
123
124/* ---------------------------------------------------------- */
125
126static struct platform_device *devices[] __initdata = {
127 &e400_t7l66xb_device,
128};
129
130static void __init e400_init(void)
131{
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);
136 /* Fixme - e400 may have a switched clock */
137 eseries_register_clks();
138 eseries_get_tmio_gpios();
139 set_pxa_fb_info(&e400_pxafb_mach_info);
140 platform_add_devices(devices, ARRAY_SIZE(devices));
141 pxa_set_udc_info(&e7xx_udc_mach_info);
142}
143
144MACHINE_START(E400, "Toshiba e400")
145 /* Maintainer: Ian Molton (spyro@f2s.com) */
146 .phys_io = 0x40000000,
147 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
148 .boot_params = 0xa0000100,
149 .map_io = pxa_map_io,
150 .init_irq = pxa25x_init_irq,
151 .fixup = eseries_fixup,
152 .init_machine = e400_init,
153 .timer = &pxa_timer,
154MACHINE_END
155
diff --git a/arch/arm/mach-pxa/e740.c b/arch/arm/mach-pxa/e740.c
deleted file mode 100644
index d578021d1a10..000000000000
--- a/arch/arm/mach-pxa/e740.c
+++ /dev/null
@@ -1,225 +0,0 @@
1/*
2 * Hardware definitions for the Toshiba eseries PDAs
3 *
4 * Copyright (c) 2003 Ian Molton <spyro@f2s.com>
5 *
6 * This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 *
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/device.h>
16#include <linux/platform_device.h>
17#include <linux/fb.h>
18#include <linux/clk.h>
19#include <linux/mfd/t7l66xb.h>
20
21#include <video/w100fb.h>
22
23#include <asm/setup.h>
24#include <asm/mach/arch.h>
25#include <asm/mach-types.h>
26
27#include <mach/pxa25x.h>
28#include <mach/eseries-gpio.h>
29#include <mach/udc.h>
30#include <mach/irda.h>
31#include <mach/irqs.h>
32#include <mach/audio.h>
33
34#include "generic.h"
35#include "eseries.h"
36#include "clock.h"
37#include "devices.h"
38
39/* ------------------------ e740 video support --------------------------- */
40
41static struct w100_gen_regs e740_lcd_regs = {
42 .lcd_format = 0x00008023,
43 .lcdd_cntl1 = 0x0f000000,
44 .lcdd_cntl2 = 0x0003ffff,
45 .genlcd_cntl1 = 0x00ffff03,
46 .genlcd_cntl2 = 0x003c0f03,
47 .genlcd_cntl3 = 0x000143aa,
48};
49
50static struct w100_mode e740_lcd_mode = {
51 .xres = 240,
52 .yres = 320,
53 .left_margin = 20,
54 .right_margin = 28,
55 .upper_margin = 9,
56 .lower_margin = 8,
57 .crtc_ss = 0x80140013,
58 .crtc_ls = 0x81150110,
59 .crtc_gs = 0x80050005,
60 .crtc_vpos_gs = 0x000a0009,
61 .crtc_rev = 0x0040010a,
62 .crtc_dclk = 0xa906000a,
63 .crtc_gclk = 0x80050108,
64 .crtc_goe = 0x80050108,
65 .pll_freq = 57,
66 .pixclk_divider = 4,
67 .pixclk_divider_rotated = 4,
68 .pixclk_src = CLK_SRC_XTAL,
69 .sysclk_divider = 1,
70 .sysclk_src = CLK_SRC_PLL,
71 .crtc_ps1_active = 0x41060010,
72};
73
74static struct w100_gpio_regs e740_w100_gpio_info = {
75 .init_data1 = 0x21002103,
76 .gpio_dir1 = 0xffffdeff,
77 .gpio_oe1 = 0x03c00643,
78 .init_data2 = 0x003f003f,
79 .gpio_dir2 = 0xffffffff,
80 .gpio_oe2 = 0x000000ff,
81};
82
83static struct w100fb_mach_info e740_fb_info = {
84 .modelist = &e740_lcd_mode,
85 .num_modes = 1,
86 .regs = &e740_lcd_regs,
87 .gpio = &e740_w100_gpio_info,
88 .xtal_freq = 14318000,
89 .xtal_dbl = 1,
90};
91
92static struct resource e740_fb_resources[] = {
93 [0] = {
94 .start = 0x0c000000,
95 .end = 0x0cffffff,
96 .flags = IORESOURCE_MEM,
97 },
98};
99
100static struct platform_device e740_fb_device = {
101 .name = "w100fb",
102 .id = -1,
103 .dev = {
104 .platform_data = &e740_fb_info,
105 },
106 .num_resources = ARRAY_SIZE(e740_fb_resources),
107 .resource = e740_fb_resources,
108};
109
110/* --------------------------- MFP Pin config -------------------------- */
111
112static unsigned long e740_pin_config[] __initdata = {
113 /* Chip selects */
114 GPIO15_nCS_1, /* CS1 - Flash */
115 GPIO79_nCS_3, /* CS3 - IMAGEON */
116 GPIO80_nCS_4, /* CS4 - TMIO */
117
118 /* Clocks */
119 GPIO12_32KHz,
120
121 /* BTUART */
122 GPIO42_BTUART_RXD,
123 GPIO43_BTUART_TXD,
124 GPIO44_BTUART_CTS,
125
126 /* TMIO controller */
127 GPIO19_GPIO, /* t7l66xb #PCLR */
128 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
129
130 /* UDC */
131 GPIO13_GPIO,
132 GPIO3_GPIO,
133
134 /* IrDA */
135 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
136
137 /* AC97 */
138 GPIO28_AC97_BITCLK,
139 GPIO29_AC97_SDATA_IN_0,
140 GPIO30_AC97_SDATA_OUT,
141 GPIO31_AC97_SYNC,
142
143 /* Audio power control */
144 GPIO16_GPIO, /* AC97 codec AVDD2 supply (analogue power) */
145 GPIO40_GPIO, /* Mic amp power */
146 GPIO41_GPIO, /* Headphone amp power */
147
148 /* PC Card */
149 GPIO8_GPIO, /* CD0 */
150 GPIO44_GPIO, /* CD1 */
151 GPIO11_GPIO, /* IRQ0 */
152 GPIO6_GPIO, /* IRQ1 */
153 GPIO27_GPIO, /* RST0 */
154 GPIO24_GPIO, /* RST1 */
155 GPIO20_GPIO, /* PWR0 */
156 GPIO23_GPIO, /* PWR1 */
157 GPIO48_nPOE,
158 GPIO49_nPWE,
159 GPIO50_nPIOR,
160 GPIO51_nPIOW,
161 GPIO52_nPCE_1,
162 GPIO53_nPCE_2,
163 GPIO54_nPSKTSEL,
164 GPIO55_nPREG,
165 GPIO56_nPWAIT,
166 GPIO57_nIOIS16,
167
168 /* wakeup */
169 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
170};
171
172/* -------------------- e740 t7l66xb parameters -------------------- */
173
174static struct t7l66xb_platform_data e740_t7l66xb_info = {
175 .irq_base = IRQ_BOARD_START,
176 .enable = &eseries_tmio_enable,
177 .suspend = &eseries_tmio_suspend,
178 .resume = &eseries_tmio_resume,
179};
180
181static struct platform_device e740_t7l66xb_device = {
182 .name = "t7l66xb",
183 .id = -1,
184 .dev = {
185 .platform_data = &e740_t7l66xb_info,
186 },
187 .num_resources = 2,
188 .resource = eseries_tmio_resources,
189};
190
191/* ----------------------------------------------------------------------- */
192
193static struct platform_device *devices[] __initdata = {
194 &e740_fb_device,
195 &e740_t7l66xb_device,
196};
197
198static void __init e740_init(void)
199{
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);
204 eseries_register_clks();
205 clk_add_alias("CLK_CK48M", e740_t7l66xb_device.name,
206 "UDCCLK", &pxa25x_device_udc.dev),
207 eseries_get_tmio_gpios();
208 platform_add_devices(devices, ARRAY_SIZE(devices));
209 pxa_set_udc_info(&e7xx_udc_mach_info);
210 pxa_set_ac97_info(NULL);
211 pxa_set_ficp_info(&e7xx_ficp_platform_data);
212}
213
214MACHINE_START(E740, "Toshiba e740")
215 /* Maintainer: Ian Molton (spyro@f2s.com) */
216 .phys_io = 0x40000000,
217 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
218 .boot_params = 0xa0000100,
219 .map_io = pxa_map_io,
220 .init_irq = pxa25x_init_irq,
221 .fixup = eseries_fixup,
222 .init_machine = e740_init,
223 .timer = &pxa_timer,
224MACHINE_END
225
diff --git a/arch/arm/mach-pxa/e750.c b/arch/arm/mach-pxa/e750.c
deleted file mode 100644
index af83caa52dd4..000000000000
--- a/arch/arm/mach-pxa/e750.c
+++ /dev/null
@@ -1,226 +0,0 @@
1/*
2 * Hardware definitions for the Toshiba eseries PDAs
3 *
4 * Copyright (c) 2003 Ian Molton <spyro@f2s.com>
5 *
6 * This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 *
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/device.h>
16#include <linux/platform_device.h>
17#include <linux/fb.h>
18#include <linux/mfd/tc6393xb.h>
19
20#include <video/w100fb.h>
21
22#include <asm/setup.h>
23#include <asm/mach/arch.h>
24#include <asm/mach-types.h>
25
26#include <mach/pxa25x.h>
27#include <mach/eseries-gpio.h>
28#include <mach/udc.h>
29#include <mach/irda.h>
30#include <mach/irqs.h>
31#include <mach/audio.h>
32
33#include "generic.h"
34#include "eseries.h"
35#include "clock.h"
36
37/* ---------------------- E750 LCD definitions -------------------- */
38
39static struct w100_gen_regs e750_lcd_regs = {
40 .lcd_format = 0x00008003,
41 .lcdd_cntl1 = 0x00000000,
42 .lcdd_cntl2 = 0x0003ffff,
43 .genlcd_cntl1 = 0x00fff003,
44 .genlcd_cntl2 = 0x003c0f03,
45 .genlcd_cntl3 = 0x000143aa,
46};
47
48static struct w100_mode e750_lcd_mode = {
49 .xres = 240,
50 .yres = 320,
51 .left_margin = 21,
52 .right_margin = 22,
53 .upper_margin = 5,
54 .lower_margin = 4,
55 .crtc_ss = 0x80150014,
56 .crtc_ls = 0x8014000d,
57 .crtc_gs = 0xc1000005,
58 .crtc_vpos_gs = 0x00020147,
59 .crtc_rev = 0x0040010a,
60 .crtc_dclk = 0xa1700030,
61 .crtc_gclk = 0x80cc0015,
62 .crtc_goe = 0x80cc0015,
63 .crtc_ps1_active = 0x61060017,
64 .pll_freq = 57,
65 .pixclk_divider = 4,
66 .pixclk_divider_rotated = 4,
67 .pixclk_src = CLK_SRC_XTAL,
68 .sysclk_divider = 1,
69 .sysclk_src = CLK_SRC_PLL,
70};
71
72static struct w100_gpio_regs e750_w100_gpio_info = {
73 .init_data1 = 0x01192f1b,
74 .gpio_dir1 = 0xd5ffdeff,
75 .gpio_oe1 = 0x000020bf,
76 .init_data2 = 0x010f010f,
77 .gpio_dir2 = 0xffffffff,
78 .gpio_oe2 = 0x000001cf,
79};
80
81static struct w100fb_mach_info e750_fb_info = {
82 .modelist = &e750_lcd_mode,
83 .num_modes = 1,
84 .regs = &e750_lcd_regs,
85 .gpio = &e750_w100_gpio_info,
86 .xtal_freq = 14318000,
87 .xtal_dbl = 1,
88};
89
90static struct resource e750_fb_resources[] = {
91 [0] = {
92 .start = 0x0c000000,
93 .end = 0x0cffffff,
94 .flags = IORESOURCE_MEM,
95 },
96};
97
98static struct platform_device e750_fb_device = {
99 .name = "w100fb",
100 .id = -1,
101 .dev = {
102 .platform_data = &e750_fb_info,
103 },
104 .num_resources = ARRAY_SIZE(e750_fb_resources),
105 .resource = e750_fb_resources,
106};
107
108/* -------------------- e750 MFP parameters -------------------- */
109
110static unsigned long e750_pin_config[] __initdata = {
111 /* Chip selects */
112 GPIO15_nCS_1, /* CS1 - Flash */
113 GPIO79_nCS_3, /* CS3 - IMAGEON */
114 GPIO80_nCS_4, /* CS4 - TMIO */
115
116 /* Clocks */
117 GPIO11_3_6MHz,
118
119 /* BTUART */
120 GPIO42_BTUART_RXD,
121 GPIO43_BTUART_TXD,
122 GPIO44_BTUART_CTS,
123
124 /* TMIO controller */
125 GPIO19_GPIO, /* t7l66xb #PCLR */
126 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
127
128 /* UDC */
129 GPIO13_GPIO,
130 GPIO3_GPIO,
131
132 /* IrDA */
133 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
134
135 /* AC97 */
136 GPIO28_AC97_BITCLK,
137 GPIO29_AC97_SDATA_IN_0,
138 GPIO30_AC97_SDATA_OUT,
139 GPIO31_AC97_SYNC,
140
141 /* Audio power control */
142 GPIO4_GPIO, /* Headphone amp power */
143 GPIO7_GPIO, /* Speaker amp power */
144 GPIO37_GPIO, /* Headphone detect */
145
146 /* PC Card */
147 GPIO8_GPIO, /* CD0 */
148 GPIO44_GPIO, /* CD1 */
149 GPIO11_GPIO, /* IRQ0 */
150 GPIO6_GPIO, /* IRQ1 */
151 GPIO27_GPIO, /* RST0 */
152 GPIO24_GPIO, /* RST1 */
153 GPIO20_GPIO, /* PWR0 */
154 GPIO23_GPIO, /* PWR1 */
155 GPIO48_nPOE,
156 GPIO49_nPWE,
157 GPIO50_nPIOR,
158 GPIO51_nPIOW,
159 GPIO52_nPCE_1,
160 GPIO53_nPCE_2,
161 GPIO54_nPSKTSEL,
162 GPIO55_nPREG,
163 GPIO56_nPWAIT,
164 GPIO57_nIOIS16,
165
166 /* wakeup */
167 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
168};
169
170/* ----------------- e750 tc6393xb parameters ------------------ */
171
172static struct tc6393xb_platform_data e750_tc6393xb_info = {
173 .irq_base = IRQ_BOARD_START,
174 .scr_pll2cr = 0x0cc1,
175 .scr_gper = 0,
176 .gpio_base = -1,
177 .suspend = &eseries_tmio_suspend,
178 .resume = &eseries_tmio_resume,
179 .enable = &eseries_tmio_enable,
180 .disable = &eseries_tmio_disable,
181};
182
183static struct platform_device e750_tc6393xb_device = {
184 .name = "tc6393xb",
185 .id = -1,
186 .dev = {
187 .platform_data = &e750_tc6393xb_info,
188 },
189 .num_resources = 2,
190 .resource = eseries_tmio_resources,
191};
192
193/* ------------------------------------------------------------- */
194
195static struct platform_device *devices[] __initdata = {
196 &e750_fb_device,
197 &e750_tc6393xb_device,
198};
199
200static void __init e750_init(void)
201{
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);
206 clk_add_alias("CLK_CK3P6MI", e750_tc6393xb_device.name,
207 "GPIO11_CLK", NULL),
208 eseries_get_tmio_gpios();
209 platform_add_devices(devices, ARRAY_SIZE(devices));
210 pxa_set_udc_info(&e7xx_udc_mach_info);
211 pxa_set_ac97_info(NULL);
212 pxa_set_ficp_info(&e7xx_ficp_platform_data);
213}
214
215MACHINE_START(E750, "Toshiba e750")
216 /* Maintainer: Ian Molton (spyro@f2s.com) */
217 .phys_io = 0x40000000,
218 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
219 .boot_params = 0xa0000100,
220 .map_io = pxa_map_io,
221 .init_irq = pxa25x_init_irq,
222 .fixup = eseries_fixup,
223 .init_machine = e750_init,
224 .timer = &pxa_timer,
225MACHINE_END
226
diff --git a/arch/arm/mach-pxa/e800.c b/arch/arm/mach-pxa/e800.c
deleted file mode 100644
index 8ea97bf53fe1..000000000000
--- a/arch/arm/mach-pxa/e800.c
+++ /dev/null
@@ -1,229 +0,0 @@
1/*
2 * Hardware definitions for the Toshiba eseries PDAs
3 *
4 * Copyright (c) 2003 Ian Molton <spyro@f2s.com>
5 *
6 * This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 *
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/device.h>
16#include <linux/platform_device.h>
17#include <linux/fb.h>
18#include <linux/mfd/tc6393xb.h>
19
20#include <video/w100fb.h>
21
22#include <asm/setup.h>
23#include <asm/mach/arch.h>
24#include <asm/mach-types.h>
25
26#include <mach/pxa25x.h>
27#include <mach/eseries-gpio.h>
28#include <mach/udc.h>
29#include <mach/irqs.h>
30#include <mach/audio.h>
31
32#include "generic.h"
33#include "eseries.h"
34#include "clock.h"
35
36/* ------------------------ e800 LCD definitions ------------------------- */
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
46static struct w100_gen_regs e800_lcd_regs = {
47 .lcd_format = 0x00008003,
48 .lcdd_cntl1 = 0x02a00000,
49 .lcdd_cntl2 = 0x0003ffff,
50 .genlcd_cntl1 = 0x000ff2a3,
51 .genlcd_cntl2 = 0x000002a3,
52 .genlcd_cntl3 = 0x000102aa,
53};
54
55static struct w100_mode e800_lcd_mode[2] = {
56 [0] = {
57 .xres = 480,
58 .yres = 640,
59 .left_margin = 52,
60 .right_margin = 148,
61 .upper_margin = 2,
62 .lower_margin = 6,
63 .crtc_ss = 0x80350034,
64 .crtc_ls = 0x802b0026,
65 .crtc_gs = 0x80160016,
66 .crtc_vpos_gs = 0x00020003,
67 .crtc_rev = 0x0040001d,
68 .crtc_dclk = 0xe0000000,
69 .crtc_gclk = 0x82a50049,
70 .crtc_goe = 0x80ee001c,
71 .crtc_ps1_active = 0x00000000,
72 .pll_freq = 128,
73 .pixclk_divider = 4,
74 .pixclk_divider_rotated = 6,
75 .pixclk_src = CLK_SRC_PLL,
76 .sysclk_divider = 0,
77 .sysclk_src = CLK_SRC_PLL,
78 },
79 [1] = {
80 .xres = 240,
81 .yres = 320,
82 .left_margin = 15,
83 .right_margin = 88,
84 .upper_margin = 0,
85 .lower_margin = 7,
86 .crtc_ss = 0xd010000f,
87 .crtc_ls = 0x80070003,
88 .crtc_gs = 0x80000000,
89 .crtc_vpos_gs = 0x01460147,
90 .crtc_rev = 0x00400003,
91 .crtc_dclk = 0xa1700030,
92 .crtc_gclk = 0x814b0008,
93 .crtc_goe = 0x80cc0015,
94 .crtc_ps1_active = 0x00000000,
95 .pll_freq = 100,
96 .pixclk_divider = 6, /* Wince uses 14 which gives a */
97 .pixclk_divider_rotated = 6, /* 7MHz Pclk. We use a 14MHz one */
98 .pixclk_src = CLK_SRC_PLL,
99 .sysclk_divider = 0,
100 .sysclk_src = CLK_SRC_PLL,
101 }
102};
103
104
105static struct w100_gpio_regs e800_w100_gpio_info = {
106 .init_data1 = 0xc13fc019,
107 .gpio_dir1 = 0x3e40df7f,
108 .gpio_oe1 = 0x003c3000,
109 .init_data2 = 0x00000000,
110 .gpio_dir2 = 0x00000000,
111 .gpio_oe2 = 0x00000000,
112};
113
114static struct w100_mem_info e800_w100_mem_info = {
115 .ext_cntl = 0x09640011,
116 .sdram_mode_reg = 0x00600021,
117 .ext_timing_cntl = 0x10001545,
118 .io_cntl = 0x7ddd7333,
119 .size = 0x1fffff,
120};
121
122static void e800_tg_change(struct w100fb_par *par)
123{
124 unsigned long tmp;
125
126 tmp = w100fb_gpio_read(W100_GPIO_PORT_A);
127 if (par->mode->xres == 480)
128 tmp |= 0x100;
129 else
130 tmp &= ~0x100;
131 w100fb_gpio_write(W100_GPIO_PORT_A, tmp);
132}
133
134static struct w100_tg_info e800_tg_info = {
135 .change = e800_tg_change,
136};
137
138static struct w100fb_mach_info e800_fb_info = {
139 .modelist = e800_lcd_mode,
140 .num_modes = 2,
141 .regs = &e800_lcd_regs,
142 .gpio = &e800_w100_gpio_info,
143 .mem = &e800_w100_mem_info,
144 .tg = &e800_tg_info,
145 .xtal_freq = 16000000,
146};
147
148static struct resource e800_fb_resources[] = {
149 [0] = {
150 .start = 0x0c000000,
151 .end = 0x0cffffff,
152 .flags = IORESOURCE_MEM,
153 },
154};
155
156static struct platform_device e800_fb_device = {
157 .name = "w100fb",
158 .id = -1,
159 .dev = {
160 .platform_data = &e800_fb_info,
161 },
162 .num_resources = ARRAY_SIZE(e800_fb_resources),
163 .resource = e800_fb_resources,
164};
165
166/* --------------------------- UDC definitions --------------------------- */
167
168static struct pxa2xx_udc_mach_info e800_udc_mach_info = {
169 .gpio_vbus = GPIO_E800_USB_DISC,
170 .gpio_pullup = GPIO_E800_USB_PULLUP,
171 .gpio_pullup_inverted = 1
172};
173
174/* ----------------- e800 tc6393xb parameters ------------------ */
175
176static struct tc6393xb_platform_data e800_tc6393xb_info = {
177 .irq_base = IRQ_BOARD_START,
178 .scr_pll2cr = 0x0cc1,
179 .scr_gper = 0,
180 .gpio_base = -1,
181 .suspend = &eseries_tmio_suspend,
182 .resume = &eseries_tmio_resume,
183 .enable = &eseries_tmio_enable,
184 .disable = &eseries_tmio_disable,
185};
186
187static struct platform_device e800_tc6393xb_device = {
188 .name = "tc6393xb",
189 .id = -1,
190 .dev = {
191 .platform_data = &e800_tc6393xb_info,
192 },
193 .num_resources = 2,
194 .resource = eseries_tmio_resources,
195};
196
197/* ----------------------------------------------------------------------- */
198
199static struct platform_device *devices[] __initdata = {
200 &e800_fb_device,
201 &e800_tc6393xb_device,
202};
203
204static void __init e800_init(void)
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);
210 clk_add_alias("CLK_CK3P6MI", e800_tc6393xb_device.name,
211 "GPIO11_CLK", NULL),
212 eseries_get_tmio_gpios();
213 platform_add_devices(devices, ARRAY_SIZE(devices));
214 pxa_set_udc_info(&e800_udc_mach_info);
215 pxa_set_ac97_info(NULL);
216}
217
218MACHINE_START(E800, "Toshiba e800")
219 /* Maintainer: Ian Molton (spyro@f2s.com) */
220 .phys_io = 0x40000000,
221 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
222 .boot_params = 0xa0000100,
223 .map_io = pxa_map_io,
224 .init_irq = pxa25x_init_irq,
225 .fixup = eseries_fixup,
226 .init_machine = e800_init,
227 .timer = &pxa_timer,
228MACHINE_END
229
diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c
index a0ab3082a000..349212a1cbd3 100644
--- a/arch/arm/mach-pxa/eseries.c
+++ b/arch/arm/mach-pxa/eseries.c
@@ -15,6 +15,13 @@
15#include <linux/gpio.h> 15#include <linux/gpio.h>
16#include <linux/delay.h> 16#include <linux/delay.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/mfd/tc6387xb.h>
19#include <linux/mfd/tc6393xb.h>
20#include <linux/mfd/t7l66xb.h>
21#include <linux/mtd/nand.h>
22#include <linux/mtd/partitions.h>
23
24#include <video/w100fb.h>
18 25
19#include <asm/setup.h> 26#include <asm/setup.h>
20#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
@@ -22,9 +29,12 @@
22 29
23#include <mach/pxa25x.h> 30#include <mach/pxa25x.h>
24#include <mach/eseries-gpio.h> 31#include <mach/eseries-gpio.h>
32#include <mach/audio.h>
33#include <mach/pxafb.h>
25#include <mach/udc.h> 34#include <mach/udc.h>
26#include <mach/irda.h> 35#include <mach/irda.h>
27 36
37#include "devices.h"
28#include "generic.h" 38#include "generic.h"
29#include "clock.h" 39#include "clock.h"
30 40
@@ -130,3 +140,802 @@ void eseries_register_clks(void)
130 clkdev_add_table(eseries_clkregs, ARRAY_SIZE(eseries_clkregs)); 140 clkdev_add_table(eseries_clkregs, ARRAY_SIZE(eseries_clkregs));
131} 141}
132 142
143#ifdef CONFIG_MACH_E330
144/* -------------------- e330 tc6387xb parameters -------------------- */
145
146static struct tc6387xb_platform_data e330_tc6387xb_info = {
147 .enable = &eseries_tmio_enable,
148 .disable = &eseries_tmio_disable,
149 .suspend = &eseries_tmio_suspend,
150 .resume = &eseries_tmio_resume,
151};
152
153static struct platform_device e330_tc6387xb_device = {
154 .name = "tc6387xb",
155 .id = -1,
156 .dev = {
157 .platform_data = &e330_tc6387xb_info,
158 },
159 .num_resources = 2,
160 .resource = eseries_tmio_resources,
161};
162
163/* --------------------------------------------------------------- */
164
165static struct platform_device *e330_devices[] __initdata = {
166 &e330_tc6387xb_device,
167};
168
169static void __init e330_init(void)
170{
171 pxa_set_ffuart_info(NULL);
172 pxa_set_btuart_info(NULL);
173 pxa_set_stuart_info(NULL);
174 eseries_register_clks();
175 eseries_get_tmio_gpios();
176 platform_add_devices(ARRAY_AND_SIZE(e330_devices));
177 pxa_set_udc_info(&e7xx_udc_mach_info);
178}
179
180MACHINE_START(E330, "Toshiba e330")
181 /* Maintainer: Ian Molton (spyro@f2s.com) */
182 .phys_io = 0x40000000,
183 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
184 .boot_params = 0xa0000100,
185 .map_io = pxa_map_io,
186 .init_irq = pxa25x_init_irq,
187 .fixup = eseries_fixup,
188 .init_machine = e330_init,
189 .timer = &pxa_timer,
190MACHINE_END
191#endif
192
193#ifdef CONFIG_MACH_E350
194/* -------------------- e350 t7l66xb parameters -------------------- */
195
196static struct t7l66xb_platform_data e350_t7l66xb_info = {
197 .irq_base = IRQ_BOARD_START,
198 .enable = &eseries_tmio_enable,
199 .suspend = &eseries_tmio_suspend,
200 .resume = &eseries_tmio_resume,
201};
202
203static struct platform_device e350_t7l66xb_device = {
204 .name = "t7l66xb",
205 .id = -1,
206 .dev = {
207 .platform_data = &e350_t7l66xb_info,
208 },
209 .num_resources = 2,
210 .resource = eseries_tmio_resources,
211};
212
213/* ---------------------------------------------------------- */
214
215static struct platform_device *e350_devices[] __initdata = {
216 &e350_t7l66xb_device,
217};
218
219static void __init e350_init(void)
220{
221 pxa_set_ffuart_info(NULL);
222 pxa_set_btuart_info(NULL);
223 pxa_set_stuart_info(NULL);
224 eseries_register_clks();
225 eseries_get_tmio_gpios();
226 platform_add_devices(ARRAY_AND_SIZE(e350_devices));
227 pxa_set_udc_info(&e7xx_udc_mach_info);
228}
229
230MACHINE_START(E350, "Toshiba e350")
231 /* Maintainer: Ian Molton (spyro@f2s.com) */
232 .phys_io = 0x40000000,
233 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
234 .boot_params = 0xa0000100,
235 .map_io = pxa_map_io,
236 .init_irq = pxa25x_init_irq,
237 .fixup = eseries_fixup,
238 .init_machine = e350_init,
239 .timer = &pxa_timer,
240MACHINE_END
241#endif
242
243#ifdef CONFIG_MACH_E400
244/* ------------------------ E400 LCD definitions ------------------------ */
245
246static struct pxafb_mode_info e400_pxafb_mode_info = {
247 .pixclock = 140703,
248 .xres = 240,
249 .yres = 320,
250 .bpp = 16,
251 .hsync_len = 4,
252 .left_margin = 28,
253 .right_margin = 8,
254 .vsync_len = 3,
255 .upper_margin = 5,
256 .lower_margin = 6,
257 .sync = 0,
258};
259
260static struct pxafb_mach_info e400_pxafb_mach_info = {
261 .modes = &e400_pxafb_mode_info,
262 .num_modes = 1,
263 .lcd_conn = LCD_COLOR_TFT_16BPP,
264 .lccr3 = 0,
265 .pxafb_backlight_power = NULL,
266};
267
268/* ------------------------ E400 MFP config ----------------------------- */
269
270static unsigned long e400_pin_config[] __initdata = {
271 /* Chip selects */
272 GPIO15_nCS_1, /* CS1 - Flash */
273 GPIO80_nCS_4, /* CS4 - TMIO */
274
275 /* Clocks */
276 GPIO12_32KHz,
277
278 /* BTUART */
279 GPIO42_BTUART_RXD,
280 GPIO43_BTUART_TXD,
281 GPIO44_BTUART_CTS,
282
283 /* TMIO controller */
284 GPIO19_GPIO, /* t7l66xb #PCLR */
285 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
286
287 /* wakeup */
288 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
289};
290
291/* ---------------------------------------------------------------------- */
292
293static struct mtd_partition partition_a = {
294 .name = "Internal NAND flash",
295 .offset = 0,
296 .size = MTDPART_SIZ_FULL,
297};
298
299static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
300
301static struct nand_bbt_descr e400_t7l66xb_nand_bbt = {
302 .options = 0,
303 .offs = 4,
304 .len = 2,
305 .pattern = scan_ff_pattern
306};
307
308static struct tmio_nand_data e400_t7l66xb_nand_config = {
309 .num_partitions = 1,
310 .partition = &partition_a,
311 .badblock_pattern = &e400_t7l66xb_nand_bbt,
312};
313
314static struct t7l66xb_platform_data e400_t7l66xb_info = {
315 .irq_base = IRQ_BOARD_START,
316 .enable = &eseries_tmio_enable,
317 .suspend = &eseries_tmio_suspend,
318 .resume = &eseries_tmio_resume,
319
320 .nand_data = &e400_t7l66xb_nand_config,
321};
322
323static struct platform_device e400_t7l66xb_device = {
324 .name = "t7l66xb",
325 .id = -1,
326 .dev = {
327 .platform_data = &e400_t7l66xb_info,
328 },
329 .num_resources = 2,
330 .resource = eseries_tmio_resources,
331};
332
333/* ---------------------------------------------------------- */
334
335static struct platform_device *e400_devices[] __initdata = {
336 &e400_t7l66xb_device,
337};
338
339static void __init e400_init(void)
340{
341 pxa2xx_mfp_config(ARRAY_AND_SIZE(e400_pin_config));
342 pxa_set_ffuart_info(NULL);
343 pxa_set_btuart_info(NULL);
344 pxa_set_stuart_info(NULL);
345 /* Fixme - e400 may have a switched clock */
346 eseries_register_clks();
347 eseries_get_tmio_gpios();
348 set_pxa_fb_info(&e400_pxafb_mach_info);
349 platform_add_devices(ARRAY_AND_SIZE(e400_devices));
350 pxa_set_udc_info(&e7xx_udc_mach_info);
351}
352
353MACHINE_START(E400, "Toshiba e400")
354 /* Maintainer: Ian Molton (spyro@f2s.com) */
355 .phys_io = 0x40000000,
356 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
357 .boot_params = 0xa0000100,
358 .map_io = pxa_map_io,
359 .init_irq = pxa25x_init_irq,
360 .fixup = eseries_fixup,
361 .init_machine = e400_init,
362 .timer = &pxa_timer,
363MACHINE_END
364#endif
365
366#ifdef CONFIG_MACH_E740
367/* ------------------------ e740 video support --------------------------- */
368
369static struct w100_gen_regs e740_lcd_regs = {
370 .lcd_format = 0x00008023,
371 .lcdd_cntl1 = 0x0f000000,
372 .lcdd_cntl2 = 0x0003ffff,
373 .genlcd_cntl1 = 0x00ffff03,
374 .genlcd_cntl2 = 0x003c0f03,
375 .genlcd_cntl3 = 0x000143aa,
376};
377
378static struct w100_mode e740_lcd_mode = {
379 .xres = 240,
380 .yres = 320,
381 .left_margin = 20,
382 .right_margin = 28,
383 .upper_margin = 9,
384 .lower_margin = 8,
385 .crtc_ss = 0x80140013,
386 .crtc_ls = 0x81150110,
387 .crtc_gs = 0x80050005,
388 .crtc_vpos_gs = 0x000a0009,
389 .crtc_rev = 0x0040010a,
390 .crtc_dclk = 0xa906000a,
391 .crtc_gclk = 0x80050108,
392 .crtc_goe = 0x80050108,
393 .pll_freq = 57,
394 .pixclk_divider = 4,
395 .pixclk_divider_rotated = 4,
396 .pixclk_src = CLK_SRC_XTAL,
397 .sysclk_divider = 1,
398 .sysclk_src = CLK_SRC_PLL,
399 .crtc_ps1_active = 0x41060010,
400};
401
402static struct w100_gpio_regs e740_w100_gpio_info = {
403 .init_data1 = 0x21002103,
404 .gpio_dir1 = 0xffffdeff,
405 .gpio_oe1 = 0x03c00643,
406 .init_data2 = 0x003f003f,
407 .gpio_dir2 = 0xffffffff,
408 .gpio_oe2 = 0x000000ff,
409};
410
411static struct w100fb_mach_info e740_fb_info = {
412 .modelist = &e740_lcd_mode,
413 .num_modes = 1,
414 .regs = &e740_lcd_regs,
415 .gpio = &e740_w100_gpio_info,
416 .xtal_freq = 14318000,
417 .xtal_dbl = 1,
418};
419
420static struct resource e740_fb_resources[] = {
421 [0] = {
422 .start = 0x0c000000,
423 .end = 0x0cffffff,
424 .flags = IORESOURCE_MEM,
425 },
426};
427
428static struct platform_device e740_fb_device = {
429 .name = "w100fb",
430 .id = -1,
431 .dev = {
432 .platform_data = &e740_fb_info,
433 },
434 .num_resources = ARRAY_SIZE(e740_fb_resources),
435 .resource = e740_fb_resources,
436};
437
438/* --------------------------- MFP Pin config -------------------------- */
439
440static unsigned long e740_pin_config[] __initdata = {
441 /* Chip selects */
442 GPIO15_nCS_1, /* CS1 - Flash */
443 GPIO79_nCS_3, /* CS3 - IMAGEON */
444 GPIO80_nCS_4, /* CS4 - TMIO */
445
446 /* Clocks */
447 GPIO12_32KHz,
448
449 /* BTUART */
450 GPIO42_BTUART_RXD,
451 GPIO43_BTUART_TXD,
452 GPIO44_BTUART_CTS,
453
454 /* TMIO controller */
455 GPIO19_GPIO, /* t7l66xb #PCLR */
456 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
457
458 /* UDC */
459 GPIO13_GPIO,
460 GPIO3_GPIO,
461
462 /* IrDA */
463 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
464
465 /* AC97 */
466 GPIO28_AC97_BITCLK,
467 GPIO29_AC97_SDATA_IN_0,
468 GPIO30_AC97_SDATA_OUT,
469 GPIO31_AC97_SYNC,
470
471 /* Audio power control */
472 GPIO16_GPIO, /* AC97 codec AVDD2 supply (analogue power) */
473 GPIO40_GPIO, /* Mic amp power */
474 GPIO41_GPIO, /* Headphone amp power */
475
476 /* PC Card */
477 GPIO8_GPIO, /* CD0 */
478 GPIO44_GPIO, /* CD1 */
479 GPIO11_GPIO, /* IRQ0 */
480 GPIO6_GPIO, /* IRQ1 */
481 GPIO27_GPIO, /* RST0 */
482 GPIO24_GPIO, /* RST1 */
483 GPIO20_GPIO, /* PWR0 */
484 GPIO23_GPIO, /* PWR1 */
485 GPIO48_nPOE,
486 GPIO49_nPWE,
487 GPIO50_nPIOR,
488 GPIO51_nPIOW,
489 GPIO52_nPCE_1,
490 GPIO53_nPCE_2,
491 GPIO54_nPSKTSEL,
492 GPIO55_nPREG,
493 GPIO56_nPWAIT,
494 GPIO57_nIOIS16,
495
496 /* wakeup */
497 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
498};
499
500/* -------------------- e740 t7l66xb parameters -------------------- */
501
502static struct t7l66xb_platform_data e740_t7l66xb_info = {
503 .irq_base = IRQ_BOARD_START,
504 .enable = &eseries_tmio_enable,
505 .suspend = &eseries_tmio_suspend,
506 .resume = &eseries_tmio_resume,
507};
508
509static struct platform_device e740_t7l66xb_device = {
510 .name = "t7l66xb",
511 .id = -1,
512 .dev = {
513 .platform_data = &e740_t7l66xb_info,
514 },
515 .num_resources = 2,
516 .resource = eseries_tmio_resources,
517};
518
519/* ----------------------------------------------------------------------- */
520
521static struct platform_device *e740_devices[] __initdata = {
522 &e740_fb_device,
523 &e740_t7l66xb_device,
524};
525
526static void __init e740_init(void)
527{
528 pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config));
529 pxa_set_ffuart_info(NULL);
530 pxa_set_btuart_info(NULL);
531 pxa_set_stuart_info(NULL);
532 eseries_register_clks();
533 clk_add_alias("CLK_CK48M", e740_t7l66xb_device.name,
534 "UDCCLK", &pxa25x_device_udc.dev),
535 eseries_get_tmio_gpios();
536 platform_add_devices(ARRAY_AND_SIZE(e740_devices));
537 pxa_set_udc_info(&e7xx_udc_mach_info);
538 pxa_set_ac97_info(NULL);
539 pxa_set_ficp_info(&e7xx_ficp_platform_data);
540}
541
542MACHINE_START(E740, "Toshiba e740")
543 /* Maintainer: Ian Molton (spyro@f2s.com) */
544 .phys_io = 0x40000000,
545 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
546 .boot_params = 0xa0000100,
547 .map_io = pxa_map_io,
548 .init_irq = pxa25x_init_irq,
549 .fixup = eseries_fixup,
550 .init_machine = e740_init,
551 .timer = &pxa_timer,
552MACHINE_END
553#endif
554
555#ifdef CONFIG_MACH_E750
556/* ---------------------- E750 LCD definitions -------------------- */
557
558static struct w100_gen_regs e750_lcd_regs = {
559 .lcd_format = 0x00008003,
560 .lcdd_cntl1 = 0x00000000,
561 .lcdd_cntl2 = 0x0003ffff,
562 .genlcd_cntl1 = 0x00fff003,
563 .genlcd_cntl2 = 0x003c0f03,
564 .genlcd_cntl3 = 0x000143aa,
565};
566
567static struct w100_mode e750_lcd_mode = {
568 .xres = 240,
569 .yres = 320,
570 .left_margin = 21,
571 .right_margin = 22,
572 .upper_margin = 5,
573 .lower_margin = 4,
574 .crtc_ss = 0x80150014,
575 .crtc_ls = 0x8014000d,
576 .crtc_gs = 0xc1000005,
577 .crtc_vpos_gs = 0x00020147,
578 .crtc_rev = 0x0040010a,
579 .crtc_dclk = 0xa1700030,
580 .crtc_gclk = 0x80cc0015,
581 .crtc_goe = 0x80cc0015,
582 .crtc_ps1_active = 0x61060017,
583 .pll_freq = 57,
584 .pixclk_divider = 4,
585 .pixclk_divider_rotated = 4,
586 .pixclk_src = CLK_SRC_XTAL,
587 .sysclk_divider = 1,
588 .sysclk_src = CLK_SRC_PLL,
589};
590
591static struct w100_gpio_regs e750_w100_gpio_info = {
592 .init_data1 = 0x01192f1b,
593 .gpio_dir1 = 0xd5ffdeff,
594 .gpio_oe1 = 0x000020bf,
595 .init_data2 = 0x010f010f,
596 .gpio_dir2 = 0xffffffff,
597 .gpio_oe2 = 0x000001cf,
598};
599
600static struct w100fb_mach_info e750_fb_info = {
601 .modelist = &e750_lcd_mode,
602 .num_modes = 1,
603 .regs = &e750_lcd_regs,
604 .gpio = &e750_w100_gpio_info,
605 .xtal_freq = 14318000,
606 .xtal_dbl = 1,
607};
608
609static struct resource e750_fb_resources[] = {
610 [0] = {
611 .start = 0x0c000000,
612 .end = 0x0cffffff,
613 .flags = IORESOURCE_MEM,
614 },
615};
616
617static struct platform_device e750_fb_device = {
618 .name = "w100fb",
619 .id = -1,
620 .dev = {
621 .platform_data = &e750_fb_info,
622 },
623 .num_resources = ARRAY_SIZE(e750_fb_resources),
624 .resource = e750_fb_resources,
625};
626
627/* -------------------- e750 MFP parameters -------------------- */
628
629static unsigned long e750_pin_config[] __initdata = {
630 /* Chip selects */
631 GPIO15_nCS_1, /* CS1 - Flash */
632 GPIO79_nCS_3, /* CS3 - IMAGEON */
633 GPIO80_nCS_4, /* CS4 - TMIO */
634
635 /* Clocks */
636 GPIO11_3_6MHz,
637
638 /* BTUART */
639 GPIO42_BTUART_RXD,
640 GPIO43_BTUART_TXD,
641 GPIO44_BTUART_CTS,
642
643 /* TMIO controller */
644 GPIO19_GPIO, /* t7l66xb #PCLR */
645 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
646
647 /* UDC */
648 GPIO13_GPIO,
649 GPIO3_GPIO,
650
651 /* IrDA */
652 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
653
654 /* AC97 */
655 GPIO28_AC97_BITCLK,
656 GPIO29_AC97_SDATA_IN_0,
657 GPIO30_AC97_SDATA_OUT,
658 GPIO31_AC97_SYNC,
659
660 /* Audio power control */
661 GPIO4_GPIO, /* Headphone amp power */
662 GPIO7_GPIO, /* Speaker amp power */
663 GPIO37_GPIO, /* Headphone detect */
664
665 /* PC Card */
666 GPIO8_GPIO, /* CD0 */
667 GPIO44_GPIO, /* CD1 */
668 GPIO11_GPIO, /* IRQ0 */
669 GPIO6_GPIO, /* IRQ1 */
670 GPIO27_GPIO, /* RST0 */
671 GPIO24_GPIO, /* RST1 */
672 GPIO20_GPIO, /* PWR0 */
673 GPIO23_GPIO, /* PWR1 */
674 GPIO48_nPOE,
675 GPIO49_nPWE,
676 GPIO50_nPIOR,
677 GPIO51_nPIOW,
678 GPIO52_nPCE_1,
679 GPIO53_nPCE_2,
680 GPIO54_nPSKTSEL,
681 GPIO55_nPREG,
682 GPIO56_nPWAIT,
683 GPIO57_nIOIS16,
684
685 /* wakeup */
686 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
687};
688
689/* ----------------- e750 tc6393xb parameters ------------------ */
690
691static struct tc6393xb_platform_data e750_tc6393xb_info = {
692 .irq_base = IRQ_BOARD_START,
693 .scr_pll2cr = 0x0cc1,
694 .scr_gper = 0,
695 .gpio_base = -1,
696 .suspend = &eseries_tmio_suspend,
697 .resume = &eseries_tmio_resume,
698 .enable = &eseries_tmio_enable,
699 .disable = &eseries_tmio_disable,
700};
701
702static struct platform_device e750_tc6393xb_device = {
703 .name = "tc6393xb",
704 .id = -1,
705 .dev = {
706 .platform_data = &e750_tc6393xb_info,
707 },
708 .num_resources = 2,
709 .resource = eseries_tmio_resources,
710};
711
712/* ------------------------------------------------------------- */
713
714static struct platform_device *e750_devices[] __initdata = {
715 &e750_fb_device,
716 &e750_tc6393xb_device,
717};
718
719static void __init e750_init(void)
720{
721 pxa2xx_mfp_config(ARRAY_AND_SIZE(e750_pin_config));
722 pxa_set_ffuart_info(NULL);
723 pxa_set_btuart_info(NULL);
724 pxa_set_stuart_info(NULL);
725 clk_add_alias("CLK_CK3P6MI", e750_tc6393xb_device.name,
726 "GPIO11_CLK", NULL),
727 eseries_get_tmio_gpios();
728 platform_add_devices(ARRAY_AND_SIZE(e750_devices));
729 pxa_set_udc_info(&e7xx_udc_mach_info);
730 pxa_set_ac97_info(NULL);
731 pxa_set_ficp_info(&e7xx_ficp_platform_data);
732}
733
734MACHINE_START(E750, "Toshiba e750")
735 /* Maintainer: Ian Molton (spyro@f2s.com) */
736 .phys_io = 0x40000000,
737 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
738 .boot_params = 0xa0000100,
739 .map_io = pxa_map_io,
740 .init_irq = pxa25x_init_irq,
741 .fixup = eseries_fixup,
742 .init_machine = e750_init,
743 .timer = &pxa_timer,
744MACHINE_END
745#endif
746
747#ifdef CONFIG_MACH_E800
748/* ------------------------ e800 LCD definitions ------------------------- */
749
750static unsigned long e800_pin_config[] __initdata = {
751 /* AC97 */
752 GPIO28_AC97_BITCLK,
753 GPIO29_AC97_SDATA_IN_0,
754 GPIO30_AC97_SDATA_OUT,
755 GPIO31_AC97_SYNC,
756};
757
758static struct w100_gen_regs e800_lcd_regs = {
759 .lcd_format = 0x00008003,
760 .lcdd_cntl1 = 0x02a00000,
761 .lcdd_cntl2 = 0x0003ffff,
762 .genlcd_cntl1 = 0x000ff2a3,
763 .genlcd_cntl2 = 0x000002a3,
764 .genlcd_cntl3 = 0x000102aa,
765};
766
767static struct w100_mode e800_lcd_mode[2] = {
768 [0] = {
769 .xres = 480,
770 .yres = 640,
771 .left_margin = 52,
772 .right_margin = 148,
773 .upper_margin = 2,
774 .lower_margin = 6,
775 .crtc_ss = 0x80350034,
776 .crtc_ls = 0x802b0026,
777 .crtc_gs = 0x80160016,
778 .crtc_vpos_gs = 0x00020003,
779 .crtc_rev = 0x0040001d,
780 .crtc_dclk = 0xe0000000,
781 .crtc_gclk = 0x82a50049,
782 .crtc_goe = 0x80ee001c,
783 .crtc_ps1_active = 0x00000000,
784 .pll_freq = 128,
785 .pixclk_divider = 4,
786 .pixclk_divider_rotated = 6,
787 .pixclk_src = CLK_SRC_PLL,
788 .sysclk_divider = 0,
789 .sysclk_src = CLK_SRC_PLL,
790 },
791 [1] = {
792 .xres = 240,
793 .yres = 320,
794 .left_margin = 15,
795 .right_margin = 88,
796 .upper_margin = 0,
797 .lower_margin = 7,
798 .crtc_ss = 0xd010000f,
799 .crtc_ls = 0x80070003,
800 .crtc_gs = 0x80000000,
801 .crtc_vpos_gs = 0x01460147,
802 .crtc_rev = 0x00400003,
803 .crtc_dclk = 0xa1700030,
804 .crtc_gclk = 0x814b0008,
805 .crtc_goe = 0x80cc0015,
806 .crtc_ps1_active = 0x00000000,
807 .pll_freq = 100,
808 .pixclk_divider = 6, /* Wince uses 14 which gives a */
809 .pixclk_divider_rotated = 6, /* 7MHz Pclk. We use a 14MHz one */
810 .pixclk_src = CLK_SRC_PLL,
811 .sysclk_divider = 0,
812 .sysclk_src = CLK_SRC_PLL,
813 }
814};
815
816
817static struct w100_gpio_regs e800_w100_gpio_info = {
818 .init_data1 = 0xc13fc019,
819 .gpio_dir1 = 0x3e40df7f,
820 .gpio_oe1 = 0x003c3000,
821 .init_data2 = 0x00000000,
822 .gpio_dir2 = 0x00000000,
823 .gpio_oe2 = 0x00000000,
824};
825
826static struct w100_mem_info e800_w100_mem_info = {
827 .ext_cntl = 0x09640011,
828 .sdram_mode_reg = 0x00600021,
829 .ext_timing_cntl = 0x10001545,
830 .io_cntl = 0x7ddd7333,
831 .size = 0x1fffff,
832};
833
834static void e800_tg_change(struct w100fb_par *par)
835{
836 unsigned long tmp;
837
838 tmp = w100fb_gpio_read(W100_GPIO_PORT_A);
839 if (par->mode->xres == 480)
840 tmp |= 0x100;
841 else
842 tmp &= ~0x100;
843 w100fb_gpio_write(W100_GPIO_PORT_A, tmp);
844}
845
846static struct w100_tg_info e800_tg_info = {
847 .change = e800_tg_change,
848};
849
850static struct w100fb_mach_info e800_fb_info = {
851 .modelist = e800_lcd_mode,
852 .num_modes = 2,
853 .regs = &e800_lcd_regs,
854 .gpio = &e800_w100_gpio_info,
855 .mem = &e800_w100_mem_info,
856 .tg = &e800_tg_info,
857 .xtal_freq = 16000000,
858};
859
860static struct resource e800_fb_resources[] = {
861 [0] = {
862 .start = 0x0c000000,
863 .end = 0x0cffffff,
864 .flags = IORESOURCE_MEM,
865 },
866};
867
868static struct platform_device e800_fb_device = {
869 .name = "w100fb",
870 .id = -1,
871 .dev = {
872 .platform_data = &e800_fb_info,
873 },
874 .num_resources = ARRAY_SIZE(e800_fb_resources),
875 .resource = e800_fb_resources,
876};
877
878/* --------------------------- UDC definitions --------------------------- */
879
880static struct pxa2xx_udc_mach_info e800_udc_mach_info = {
881 .gpio_vbus = GPIO_E800_USB_DISC,
882 .gpio_pullup = GPIO_E800_USB_PULLUP,
883 .gpio_pullup_inverted = 1
884};
885
886/* ----------------- e800 tc6393xb parameters ------------------ */
887
888static struct tc6393xb_platform_data e800_tc6393xb_info = {
889 .irq_base = IRQ_BOARD_START,
890 .scr_pll2cr = 0x0cc1,
891 .scr_gper = 0,
892 .gpio_base = -1,
893 .suspend = &eseries_tmio_suspend,
894 .resume = &eseries_tmio_resume,
895 .enable = &eseries_tmio_enable,
896 .disable = &eseries_tmio_disable,
897};
898
899static struct platform_device e800_tc6393xb_device = {
900 .name = "tc6393xb",
901 .id = -1,
902 .dev = {
903 .platform_data = &e800_tc6393xb_info,
904 },
905 .num_resources = 2,
906 .resource = eseries_tmio_resources,
907};
908
909/* ----------------------------------------------------------------------- */
910
911static struct platform_device *e800_devices[] __initdata = {
912 &e800_fb_device,
913 &e800_tc6393xb_device,
914};
915
916static void __init e800_init(void)
917{
918 pxa2xx_mfp_config(ARRAY_AND_SIZE(e800_pin_config));
919 pxa_set_ffuart_info(NULL);
920 pxa_set_btuart_info(NULL);
921 pxa_set_stuart_info(NULL);
922 clk_add_alias("CLK_CK3P6MI", e800_tc6393xb_device.name,
923 "GPIO11_CLK", NULL),
924 eseries_get_tmio_gpios();
925 platform_add_devices(ARRAY_AND_SIZE(e800_devices));
926 pxa_set_udc_info(&e800_udc_mach_info);
927 pxa_set_ac97_info(NULL);
928}
929
930MACHINE_START(E800, "Toshiba e800")
931 /* Maintainer: Ian Molton (spyro@f2s.com) */
932 .phys_io = 0x40000000,
933 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
934 .boot_params = 0xa0000100,
935 .map_io = pxa_map_io,
936 .init_irq = pxa25x_init_irq,
937 .fixup = eseries_fixup,
938 .init_machine = e800_init,
939 .timer = &pxa_timer,
940MACHINE_END
941#endif
diff --git a/arch/arm/mach-pxa/imote2.c b/arch/arm/mach-pxa/imote2.c
deleted file mode 100644
index 5161dca8ccc0..000000000000
--- a/arch/arm/mach-pxa/imote2.c
+++ /dev/null
@@ -1,590 +0,0 @@
1/*
2 * linux/arch/arm/mach-pxa/imote2.c
3 *
4 * Author: Ed C. Epp
5 * Created: Nov 05, 2002
6 * Copyright: Intel Corp.
7 *
8 * Modified 2008: Jonathan Cameron
9 *
10 * The Imote2 is a wireless sensor node platform sold
11 * by Crossbow (www.xbow.com).
12 */
13
14#include <linux/init.h>
15#include <linux/device.h>
16#include <linux/mtd/mtd.h>
17#include <linux/mtd/partitions.h>
18#include <linux/platform_device.h>
19#include <linux/regulator/machine.h>
20#include <linux/gpio.h>
21#include <linux/leds.h>
22#include <linux/spi/spi.h>
23#include <linux/i2c.h>
24#include <linux/mfd/da903x.h>
25#include <linux/sht15.h>
26
27#include <asm/mach-types.h>
28#include <asm/mach/arch.h>
29#include <asm/mach/map.h>
30#include <asm/mach/flash.h>
31
32#include <mach/pxa27x.h>
33#include <plat/i2c.h>
34#include <mach/udc.h>
35#include <mach/mmc.h>
36#include <mach/pxa2xx_spi.h>
37#include <mach/pxa27x-udc.h>
38
39#include "devices.h"
40#include "generic.h"
41
42static unsigned long imote2_pin_config[] __initdata = {
43
44 /* Device Identification for wakeup*/
45 GPIO102_GPIO,
46
47 /* Button */
48 GPIO91_GPIO,
49
50 /* DA9030 */
51 GPIO1_GPIO,
52
53 /* MMC */
54 GPIO32_MMC_CLK,
55 GPIO112_MMC_CMD,
56 GPIO92_MMC_DAT_0,
57 GPIO109_MMC_DAT_1,
58 GPIO110_MMC_DAT_2,
59 GPIO111_MMC_DAT_3,
60
61 /* 802.15.4 radio - driver out of mainline */
62 GPIO22_GPIO, /* CC_RSTN */
63 GPIO114_GPIO, /* CC_FIFO */
64 GPIO116_GPIO, /* CC_CCA */
65 GPIO0_GPIO, /* CC_FIFOP */
66 GPIO16_GPIO, /* CCSFD */
67 GPIO115_GPIO, /* Power enable */
68
69 /* I2C */
70 GPIO117_I2C_SCL,
71 GPIO118_I2C_SDA,
72
73 /* SSP 3 - 802.15.4 radio */
74 GPIO39_GPIO, /* Chip Select */
75 GPIO34_SSP3_SCLK,
76 GPIO35_SSP3_TXD,
77 GPIO41_SSP3_RXD,
78
79 /* SSP 2 - to daughter boards */
80 GPIO37_GPIO, /* Chip Select */
81 GPIO36_SSP2_SCLK,
82 GPIO38_SSP2_TXD,
83 GPIO11_SSP2_RXD,
84
85 /* SSP 1 - to daughter boards */
86 GPIO24_GPIO, /* Chip Select */
87 GPIO23_SSP1_SCLK,
88 GPIO25_SSP1_TXD,
89 GPIO26_SSP1_RXD,
90
91 /* BTUART Basic Connector*/
92 GPIO42_BTUART_RXD,
93 GPIO43_BTUART_TXD,
94 GPIO44_BTUART_CTS,
95 GPIO45_BTUART_RTS,
96
97 /* STUART Serial console via debug board*/
98 GPIO46_STUART_RXD,
99 GPIO47_STUART_TXD,
100
101 /* Basic sensor board */
102 GPIO96_GPIO, /* accelerometer interrupt */
103 GPIO99_GPIO, /* ADC interrupt */
104
105 /* SHT15 */
106 GPIO100_GPIO,
107 GPIO98_GPIO,
108
109 /* Connector pins specified as gpios */
110 GPIO94_GPIO, /* large basic connector pin 14 */
111 GPIO10_GPIO, /* large basic connector pin 23 */
112
113 /* LEDS */
114 GPIO103_GPIO, /* red led */
115 GPIO104_GPIO, /* green led */
116 GPIO105_GPIO, /* blue led */
117};
118
119static struct sht15_platform_data platform_data_sht15 = {
120 .gpio_data = 100,
121 .gpio_sck = 98,
122};
123
124static struct platform_device sht15 = {
125 .name = "sht15",
126 .id = -1,
127 .dev = {
128 .platform_data = &platform_data_sht15,
129 },
130};
131
132static struct regulator_consumer_supply imote2_sensor_3_con[] = {
133 {
134 .dev = &sht15.dev,
135 .supply = "vcc",
136 },
137};
138
139static struct gpio_led imote2_led_pins[] = {
140 {
141 .name = "imote2:red",
142 .gpio = 103,
143 .active_low = 1,
144 }, {
145 .name = "imote2:green",
146 .gpio = 104,
147 .active_low = 1,
148 }, {
149 .name = "imote2:blue",
150 .gpio = 105,
151 .active_low = 1,
152 },
153};
154
155static struct gpio_led_platform_data imote2_led_data = {
156 .num_leds = ARRAY_SIZE(imote2_led_pins),
157 .leds = imote2_led_pins,
158};
159
160static struct platform_device imote2_leds = {
161 .name = "leds-gpio",
162 .id = -1,
163 .dev = {
164 .platform_data = &imote2_led_data,
165 },
166};
167
168/* Reverse engineered partly from Platformx drivers */
169enum imote2_ldos{
170 vcc_vref,
171 vcc_cc2420,
172 vcc_mica,
173 vcc_bt,
174 /* The two voltages available to sensor boards */
175 vcc_sensor_1_8,
176 vcc_sensor_3,
177
178 vcc_sram_ext, /* directly connected to the pxa271 */
179 vcc_pxa_pll,
180 vcc_pxa_usim, /* Reference voltage for certain gpios */
181 vcc_pxa_mem,
182 vcc_pxa_flash,
183 vcc_pxa_core, /*Dc-Dc buck not yet supported */
184 vcc_lcd,
185 vcc_bb,
186 vcc_bbio,
187 vcc_io, /* cc2420 802.15.4 radio and pxa vcc_io ?*/
188};
189
190/* The values of the various regulator constraints are obviously dependent
191 * on exactly what is wired to each ldo. Unfortunately this information is
192 * not generally available. More information has been requested from Xbow
193 * but as of yet they haven't been forthcoming.
194 *
195 * Some of these are clearly Stargate 2 related (no way of plugging
196 * in an lcd on the IM2 for example!).
197 */
198static struct regulator_init_data imote2_ldo_init_data[] = {
199 [vcc_bbio] = {
200 .constraints = { /* board default 1.8V */
201 .name = "vcc_bbio",
202 .min_uV = 1800000,
203 .max_uV = 1800000,
204 },
205 },
206 [vcc_bb] = {
207 .constraints = { /* board default 2.8V */
208 .name = "vcc_bb",
209 .min_uV = 2700000,
210 .max_uV = 3000000,
211 },
212 },
213 [vcc_pxa_flash] = {
214 .constraints = {/* default is 1.8V */
215 .name = "vcc_pxa_flash",
216 .min_uV = 1800000,
217 .max_uV = 1800000,
218 },
219 },
220 [vcc_cc2420] = { /* also vcc_io */
221 .constraints = {
222 /* board default is 2.8V */
223 .name = "vcc_cc2420",
224 .min_uV = 2700000,
225 .max_uV = 3300000,
226 },
227 },
228 [vcc_vref] = { /* Reference for what? */
229 .constraints = { /* default 1.8V */
230 .name = "vcc_vref",
231 .min_uV = 1800000,
232 .max_uV = 1800000,
233 },
234 },
235 [vcc_sram_ext] = {
236 .constraints = { /* default 2.8V */
237 .name = "vcc_sram_ext",
238 .min_uV = 2800000,
239 .max_uV = 2800000,
240 },
241 },
242 [vcc_mica] = {
243 .constraints = { /* default 2.8V */
244 .name = "vcc_mica",
245 .min_uV = 2800000,
246 .max_uV = 2800000,
247 },
248 },
249 [vcc_bt] = {
250 .constraints = { /* default 2.8V */
251 .name = "vcc_bt",
252 .min_uV = 2800000,
253 .max_uV = 2800000,
254 },
255 },
256 [vcc_lcd] = {
257 .constraints = { /* default 2.8V */
258 .name = "vcc_lcd",
259 .min_uV = 2700000,
260 .max_uV = 3300000,
261 },
262 },
263 [vcc_io] = { /* Same or higher than everything
264 * bar vccbat and vccusb */
265 .constraints = { /* default 2.8V */
266 .name = "vcc_io",
267 .min_uV = 2692000,
268 .max_uV = 3300000,
269 },
270 },
271 [vcc_sensor_1_8] = {
272 .constraints = { /* default 1.8V */
273 .name = "vcc_sensor_1_8",
274 .min_uV = 1800000,
275 .max_uV = 1800000,
276 },
277 },
278 [vcc_sensor_3] = { /* curiously default 2.8V */
279 .constraints = {
280 .name = "vcc_sensor_3",
281 .min_uV = 2800000,
282 .max_uV = 3000000,
283 },
284 .num_consumer_supplies = ARRAY_SIZE(imote2_sensor_3_con),
285 .consumer_supplies = imote2_sensor_3_con,
286 },
287 [vcc_pxa_pll] = { /* 1.17V - 1.43V, default 1.3V*/
288 .constraints = {
289 .name = "vcc_pxa_pll",
290 .min_uV = 1170000,
291 .max_uV = 1430000,
292 },
293 },
294 [vcc_pxa_usim] = {
295 .constraints = { /* default 1.8V */
296 .name = "vcc_pxa_usim",
297 .min_uV = 1710000,
298 .max_uV = 2160000,
299 },
300 },
301 [vcc_pxa_mem] = {
302 .constraints = { /* default 1.8V */
303 .name = "vcc_pxa_mem",
304 .min_uV = 1800000,
305 .max_uV = 1800000,
306 },
307 },
308};
309
310static struct da903x_subdev_info imote2_da9030_subdevs[] = {
311 {
312 .name = "da903x-regulator",
313 .id = DA9030_ID_LDO2,
314 .platform_data = &imote2_ldo_init_data[vcc_bbio],
315 }, {
316 .name = "da903x-regulator",
317 .id = DA9030_ID_LDO3,
318 .platform_data = &imote2_ldo_init_data[vcc_bb],
319 }, {
320 .name = "da903x-regulator",
321 .id = DA9030_ID_LDO4,
322 .platform_data = &imote2_ldo_init_data[vcc_pxa_flash],
323 }, {
324 .name = "da903x-regulator",
325 .id = DA9030_ID_LDO5,
326 .platform_data = &imote2_ldo_init_data[vcc_cc2420],
327 }, {
328 .name = "da903x-regulator",
329 .id = DA9030_ID_LDO6,
330 .platform_data = &imote2_ldo_init_data[vcc_vref],
331 }, {
332 .name = "da903x-regulator",
333 .id = DA9030_ID_LDO7,
334 .platform_data = &imote2_ldo_init_data[vcc_sram_ext],
335 }, {
336 .name = "da903x-regulator",
337 .id = DA9030_ID_LDO8,
338 .platform_data = &imote2_ldo_init_data[vcc_mica],
339 }, {
340 .name = "da903x-regulator",
341 .id = DA9030_ID_LDO9,
342 .platform_data = &imote2_ldo_init_data[vcc_bt],
343 }, {
344 .name = "da903x-regulator",
345 .id = DA9030_ID_LDO10,
346 .platform_data = &imote2_ldo_init_data[vcc_sensor_1_8],
347 }, {
348 .name = "da903x-regulator",
349 .id = DA9030_ID_LDO11,
350 .platform_data = &imote2_ldo_init_data[vcc_sensor_3],
351 }, {
352 .name = "da903x-regulator",
353 .id = DA9030_ID_LDO12,
354 .platform_data = &imote2_ldo_init_data[vcc_lcd],
355 }, {
356 .name = "da903x-regulator",
357 .id = DA9030_ID_LDO15,
358 .platform_data = &imote2_ldo_init_data[vcc_pxa_pll],
359 }, {
360 .name = "da903x-regulator",
361 .id = DA9030_ID_LDO17,
362 .platform_data = &imote2_ldo_init_data[vcc_pxa_usim],
363 }, {
364 .name = "da903x-regulator",
365 .id = DA9030_ID_LDO18,
366 .platform_data = &imote2_ldo_init_data[vcc_io],
367 }, {
368 .name = "da903x-regulator",
369 .id = DA9030_ID_LDO19,
370 .platform_data = &imote2_ldo_init_data[vcc_pxa_mem],
371 },
372};
373
374static struct da903x_platform_data imote2_da9030_pdata = {
375 .num_subdevs = ARRAY_SIZE(imote2_da9030_subdevs),
376 .subdevs = imote2_da9030_subdevs,
377};
378
379/* As the the imote2 doesn't currently have a conventional SD slot
380 * there is no option to hotplug cards, making all this rather simple
381 */
382static int imote2_mci_get_ro(struct device *dev)
383{
384 return 0;
385}
386
387/* Rather simple case as hotplugging not possible */
388static struct pxamci_platform_data imote2_mci_platform_data = {
389 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, /* default anyway */
390 .get_ro = imote2_mci_get_ro,
391 .gpio_card_detect = -1,
392 .gpio_card_ro = -1,
393 .gpio_power = -1,
394};
395
396static struct mtd_partition imote2flash_partitions[] = {
397 {
398 .name = "Bootloader",
399 .size = 0x00040000,
400 .offset = 0,
401 .mask_flags = MTD_WRITEABLE,
402 }, {
403 .name = "Kernel",
404 .size = 0x00200000,
405 .offset = 0x00040000,
406 .mask_flags = 0,
407 }, {
408 .name = "Filesystem",
409 .size = 0x01DC0000,
410 .offset = 0x00240000,
411 .mask_flags = 0,
412 },
413};
414
415static struct resource flash_resources = {
416 .start = PXA_CS0_PHYS,
417 .end = PXA_CS0_PHYS + SZ_32M - 1,
418 .flags = IORESOURCE_MEM,
419};
420
421static struct flash_platform_data imote2_flash_data = {
422 .map_name = "cfi_probe",
423 .parts = imote2flash_partitions,
424 .nr_parts = ARRAY_SIZE(imote2flash_partitions),
425 .name = "PXA27xOnChipROM",
426 .width = 2,
427};
428
429static struct platform_device imote2_flash_device = {
430 .name = "pxa2xx-flash",
431 .id = 0,
432 .dev = {
433 .platform_data = &imote2_flash_data,
434 },
435 .resource = &flash_resources,
436 .num_resources = 1,
437};
438
439/* Some of the drivers here are out of kernel at the moment (parts of IIO)
440 * and it may be a while before they are in the mainline.
441 */
442static struct i2c_board_info __initdata imote2_i2c_board_info[] = {
443 { /* UCAM sensor board */
444 .type = "max1239",
445 .addr = 0x35,
446 }, { /* ITS400 Sensor board only */
447 .type = "max1363",
448 .addr = 0x34,
449 /* Through a nand gate - Also beware, on V2 sensor board the
450 * pull up resistors are missing.
451 */
452 .irq = IRQ_GPIO(99),
453 }, { /* ITS400 Sensor board only */
454 .type = "tsl2561",
455 .addr = 0x49,
456 /* Through a nand gate - Also beware, on V2 sensor board the
457 * pull up resistors are missing.
458 */
459 .irq = IRQ_GPIO(99),
460 }, { /* ITS400 Sensor board only */
461 .type = "tmp175",
462 .addr = 0x4A,
463 .irq = IRQ_GPIO(96),
464 }, { /* IMB400 Multimedia board */
465 .type = "wm8940",
466 .addr = 0x1A,
467 },
468};
469
470static struct i2c_board_info __initdata imote2_pwr_i2c_board_info[] = {
471 {
472 .type = "da9030",
473 .addr = 0x49,
474 .platform_data = &imote2_da9030_pdata,
475 .irq = gpio_to_irq(1),
476 },
477};
478
479static struct pxa2xx_spi_master pxa_ssp_master_0_info = {
480 .num_chipselect = 1,
481};
482
483static struct pxa2xx_spi_master pxa_ssp_master_1_info = {
484 .num_chipselect = 1,
485};
486
487static struct pxa2xx_spi_master pxa_ssp_master_2_info = {
488 .num_chipselect = 1,
489};
490
491static struct pxa2xx_spi_chip staccel_chip_info = {
492 .tx_threshold = 8,
493 .rx_threshold = 8,
494 .dma_burst_size = 8,
495 .timeout = 235,
496 .gpio_cs = 24,
497};
498
499static struct pxa2xx_spi_chip cc2420_info = {
500 .tx_threshold = 8,
501 .rx_threshold = 8,
502 .dma_burst_size = 8,
503 .timeout = 235,
504 .gpio_cs = 39,
505};
506
507static struct spi_board_info spi_board_info[] __initdata = {
508 { /* Driver in IIO */
509 .modalias = "lis3l02dq",
510 .max_speed_hz = 8000000,/* 8MHz max spi frequency at 3V */
511 .bus_num = 1,
512 .chip_select = 0,
513 .controller_data = &staccel_chip_info,
514 .irq = IRQ_GPIO(96),
515 }, { /* Driver out of kernel as it needs considerable rewriting */
516 .modalias = "cc2420",
517 .max_speed_hz = 6500000,
518 .bus_num = 3,
519 .chip_select = 0,
520 .controller_data = &cc2420_info,
521 },
522};
523
524static void im2_udc_command(int cmd)
525{
526 switch (cmd) {
527 case PXA2XX_UDC_CMD_CONNECT:
528 UP2OCR |= UP2OCR_HXOE | UP2OCR_DPPUE | UP2OCR_DPPUBE;
529 break;
530 case PXA2XX_UDC_CMD_DISCONNECT:
531 UP2OCR &= ~(UP2OCR_HXOE | UP2OCR_DPPUE | UP2OCR_DPPUBE);
532 break;
533 }
534}
535
536static struct pxa2xx_udc_mach_info imote2_udc_info __initdata = {
537 .udc_command = im2_udc_command,
538};
539
540static struct platform_device *imote2_devices[] = {
541 &imote2_flash_device,
542 &imote2_leds,
543 &sht15,
544};
545
546static struct i2c_pxa_platform_data i2c_pwr_pdata = {
547 .fast_mode = 1,
548};
549
550static struct i2c_pxa_platform_data i2c_pdata = {
551 .fast_mode = 1,
552};
553
554static void __init imote2_init(void)
555{
556 pxa2xx_mfp_config(ARRAY_AND_SIZE(imote2_pin_config));
557
558 pxa_set_ffuart_info(NULL);
559 pxa_set_btuart_info(NULL);
560 pxa_set_stuart_info(NULL);
561
562 platform_add_devices(imote2_devices, ARRAY_SIZE(imote2_devices));
563
564 pxa2xx_set_spi_info(1, &pxa_ssp_master_0_info);
565 pxa2xx_set_spi_info(2, &pxa_ssp_master_1_info);
566 pxa2xx_set_spi_info(3, &pxa_ssp_master_2_info);
567
568 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
569
570 i2c_register_board_info(0, imote2_i2c_board_info,
571 ARRAY_SIZE(imote2_i2c_board_info));
572 i2c_register_board_info(1, imote2_pwr_i2c_board_info,
573 ARRAY_SIZE(imote2_pwr_i2c_board_info));
574
575 pxa27x_set_i2c_power_info(&i2c_pwr_pdata);
576 pxa_set_i2c_info(&i2c_pdata);
577
578 pxa_set_mci_info(&imote2_mci_platform_data);
579 pxa_set_udc_info(&imote2_udc_info);
580}
581
582MACHINE_START(INTELMOTE2, "IMOTE 2")
583 .phys_io = 0x40000000,
584 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
585 .map_io = pxa_map_io,
586 .init_irq = pxa27x_init_irq,
587 .timer = &pxa_timer,
588 .init_machine = imote2_init,
589 .boot_params = 0xA0000100,
590MACHINE_END
diff --git a/arch/arm/mach-pxa/include/mach/balloon3.h b/arch/arm/mach-pxa/include/mach/balloon3.h
index 1a741065045f..eec92e6fd7cf 100644
--- a/arch/arm/mach-pxa/include/mach/balloon3.h
+++ b/arch/arm/mach-pxa/include/mach/balloon3.h
@@ -26,21 +26,55 @@ enum balloon3_features {
26#define BALLOON3_FPGA_VIRT (0xf1000000) /* as per balloon2 */ 26#define BALLOON3_FPGA_VIRT (0xf1000000) /* as per balloon2 */
27#define BALLOON3_FPGA_LENGTH 0x01000000 27#define BALLOON3_FPGA_LENGTH 0x01000000
28 28
29/* FPGA/CPLD registers */ 29/* FPGA / CPLD registers for CF socket */
30#define BALLOON3_PCMCIA0_REG (BALLOON3_FPGA_VIRT + 0x00e00008) 30#define BALLOON3_CF_STATUS_REG (BALLOON3_FPGA_VIRT + 0x00e00008)
31/* fixme - same for now */ 31#define BALLOON3_CF_CONTROL_REG (BALLOON3_FPGA_VIRT + 0x00e00008)
32#define BALLOON3_PCMCIA1_REG (BALLOON3_FPGA_VIRT + 0x00e00008) 32/* FPGA / CPLD version register */
33#define BALLOON3_NANDIO_IO_REG (BALLOON3_FPGA_VIRT + 0x00e00000) 33#define BALLOON3_FPGA_VER (BALLOON3_FPGA_VIRT + 0x00e0001c)
34/* FPGA / CPLD registers for NAND flash */
35#define BALLOON3_NAND_BASE (PXA_CS4_PHYS + 0x00e00000)
36#define BALLOON3_NAND_IO_REG (BALLOON3_FPGA_VIRT + 0x00e00000)
37#define BALLOON3_NAND_CONTROL2_REG (BALLOON3_FPGA_VIRT + 0x00e00010)
38#define BALLOON3_NAND_STAT_REG (BALLOON3_FPGA_VIRT + 0x00e00010)
39#define BALLOON3_NAND_CONTROL_REG (BALLOON3_FPGA_VIRT + 0x00e00014)
40
34/* fpga/cpld interrupt control register */ 41/* fpga/cpld interrupt control register */
35#define BALLOON3_INT_CONTROL_REG (BALLOON3_FPGA_VIRT + 0x00e0000C) 42#define BALLOON3_INT_CONTROL_REG (BALLOON3_FPGA_VIRT + 0x00e0000C)
36#define BALLOON3_NANDIO_CTL2_REG (BALLOON3_FPGA_VIRT + 0x00e00010)
37#define BALLOON3_NANDIO_CTL_REG (BALLOON3_FPGA_VIRT + 0x00e00014)
38#define BALLOON3_VERSION_REG (BALLOON3_FPGA_VIRT + 0x00e0001c) 43#define BALLOON3_VERSION_REG (BALLOON3_FPGA_VIRT + 0x00e0001c)
39 44
40#define BALLOON3_SAMOSA_ADDR_REG (BALLOON3_FPGA_VIRT + 0x00c00000) 45#define BALLOON3_SAMOSA_ADDR_REG (BALLOON3_FPGA_VIRT + 0x00c00000)
41#define BALLOON3_SAMOSA_DATA_REG (BALLOON3_FPGA_VIRT + 0x00c00004) 46#define BALLOON3_SAMOSA_DATA_REG (BALLOON3_FPGA_VIRT + 0x00c00004)
42#define BALLOON3_SAMOSA_STATUS_REG (BALLOON3_FPGA_VIRT + 0x00c0001c) 47#define BALLOON3_SAMOSA_STATUS_REG (BALLOON3_FPGA_VIRT + 0x00c0001c)
43 48
49/* CF Status Register bits (read-only) bits */
50#define BALLOON3_CF_nIRQ (1 << 0)
51#define BALLOON3_CF_nSTSCHG_BVD1 (1 << 1)
52
53/* CF Control Set Register bits / CF Control Clear Register bits (write-only) */
54#define BALLOON3_CF_RESET (1 << 0)
55#define BALLOON3_CF_ENABLE (1 << 1)
56#define BALLOON3_CF_ADD_ENABLE (1 << 2)
57
58/* CF Interrupt sources */
59#define BALLOON3_BP_CF_NRDY_IRQ BALLOON3_IRQ(0)
60#define BALLOON3_BP_NSTSCHG_IRQ BALLOON3_IRQ(1)
61
62/* NAND Control register */
63#define BALLOON3_NAND_CONTROL_FLWP (1 << 7)
64#define BALLOON3_NAND_CONTROL_FLSE (1 << 6)
65#define BALLOON3_NAND_CONTROL_FLCE3 (1 << 5)
66#define BALLOON3_NAND_CONTROL_FLCE2 (1 << 4)
67#define BALLOON3_NAND_CONTROL_FLCE1 (1 << 3)
68#define BALLOON3_NAND_CONTROL_FLCE0 (1 << 2)
69#define BALLOON3_NAND_CONTROL_FLALE (1 << 1)
70#define BALLOON3_NAND_CONTROL_FLCLE (1 << 0)
71
72/* NAND Status register */
73#define BALLOON3_NAND_STAT_RNB (1 << 0)
74
75/* NAND Control2 register */
76#define BALLOON3_NAND_CONTROL2_16BIT (1 << 0)
77
44/* GPIOs for irqs */ 78/* GPIOs for irqs */
45#define BALLOON3_GPIO_AUX_NIRQ (94) 79#define BALLOON3_GPIO_AUX_NIRQ (94)
46#define BALLOON3_GPIO_CODEC_IRQ (95) 80#define BALLOON3_GPIO_CODEC_IRQ (95)
@@ -54,20 +88,24 @@ enum balloon3_features {
54 88
55#define BALLOON3_GPIO_S0_CD (105) 89#define BALLOON3_GPIO_S0_CD (105)
56 90
91/* NAND */
92#define BALLOON3_GPIO_RUN_NAND (102)
93
94/* PCF8574A Leds */
95#define BALLOON3_PCF_GPIO_BASE 160
96#define BALLOON3_PCF_GPIO_LED0 (BALLOON3_PCF_GPIO_BASE + 0)
97#define BALLOON3_PCF_GPIO_LED1 (BALLOON3_PCF_GPIO_BASE + 1)
98#define BALLOON3_PCF_GPIO_LED2 (BALLOON3_PCF_GPIO_BASE + 2)
99#define BALLOON3_PCF_GPIO_LED3 (BALLOON3_PCF_GPIO_BASE + 3)
100#define BALLOON3_PCF_GPIO_LED4 (BALLOON3_PCF_GPIO_BASE + 4)
101#define BALLOON3_PCF_GPIO_LED5 (BALLOON3_PCF_GPIO_BASE + 5)
102#define BALLOON3_PCF_GPIO_LED6 (BALLOON3_PCF_GPIO_BASE + 6)
103#define BALLOON3_PCF_GPIO_LED7 (BALLOON3_PCF_GPIO_BASE + 7)
104
57/* FPGA Interrupt Mask/Acknowledge Register */ 105/* FPGA Interrupt Mask/Acknowledge Register */
58#define BALLOON3_INT_S0_IRQ (1 << 0) /* PCMCIA 0 IRQ */ 106#define BALLOON3_INT_S0_IRQ (1 << 0) /* PCMCIA 0 IRQ */
59#define BALLOON3_INT_S0_STSCHG (1 << 1) /* PCMCIA 0 status changed */ 107#define BALLOON3_INT_S0_STSCHG (1 << 1) /* PCMCIA 0 status changed */
60 108
61/* CF Status Register */
62#define BALLOON3_PCMCIA_nIRQ (1 << 0) /* IRQ / ready signal */
63#define BALLOON3_PCMCIA_nSTSCHG_BVD1 (1 << 1)
64 /* VDD sense / card status changed */
65
66/* CF control register (write) */
67#define BALLOON3_PCMCIA_RESET (1 << 0) /* Card reset signal */
68#define BALLOON3_PCMCIA_ENABLE (1 << 1)
69#define BALLOON3_PCMCIA_ADD_ENABLE (1 << 2)
70
71/* CPLD (and FPGA) interface definitions */ 109/* CPLD (and FPGA) interface definitions */
72#define CPLD_LCD0_DATA_SET 0x00 110#define CPLD_LCD0_DATA_SET 0x00
73#define CPLD_LCD0_DATA_CLR 0x10 111#define CPLD_LCD0_DATA_CLR 0x10
@@ -132,9 +170,6 @@ enum balloon3_features {
132/* Balloon3 Interrupts */ 170/* Balloon3 Interrupts */
133#define BALLOON3_IRQ(x) (IRQ_BOARD_START + (x)) 171#define BALLOON3_IRQ(x) (IRQ_BOARD_START + (x))
134 172
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) 173#define BALLOON3_AUX_NIRQ IRQ_GPIO(BALLOON3_GPIO_AUX_NIRQ)
139#define BALLOON3_CODEC_IRQ IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ) 174#define BALLOON3_CODEC_IRQ IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ)
140#define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD) 175#define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD)
diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h
index 5f2ba8d9015c..58dada11054f 100644
--- a/arch/arm/mach-pxa/include/mach/colibri.h
+++ b/arch/arm/mach-pxa/include/mach/colibri.h
@@ -5,6 +5,27 @@
5#include <mach/mfp.h> 5#include <mach/mfp.h>
6 6
7/* 7/*
8 * base board glue for PXA270 module
9 */
10
11enum {
12 COLIBRI_PXA270_EVALBOARD = 0,
13 COLIBRI_PXA270_INCOME,
14};
15
16#if defined(CONFIG_MACH_COLIBRI_PXA270_EVALBOARD)
17extern void colibri_pxa270_evalboard_init(void);
18#else
19static inline void colibri_pxa270_evalboard_init(void) {}
20#endif
21
22#if defined(CONFIG_MACH_COLIBRI_PXA270_INCOME)
23extern void colibri_pxa270_income_boardinit(void);
24#else
25static inline void colibri_pxa270_income_boardinit(void) {}
26#endif
27
28/*
8 * common settings for all modules 29 * common settings for all modules
9 */ 30 */
10 31
@@ -33,13 +54,10 @@ static inline void colibri_pxa3xx_init_nand(void) {}
33/* physical memory regions */ 54/* physical memory regions */
34#define COLIBRI_SDRAM_BASE 0xa0000000 /* SDRAM region */ 55#define COLIBRI_SDRAM_BASE 0xa0000000 /* SDRAM region */
35 56
36/* definitions for Colibri PXA270 */ 57/* GPIO definitions for Colibri PXA270 */
37 58#define GPIO114_COLIBRI_PXA270_ETH_IRQ 114
38#define COLIBRI_PXA270_FLASH_PHYS (PXA_CS0_PHYS) /* Flash region */ 59#define GPIO0_COLIBRI_PXA270_SD_DETECT 0
39#define COLIBRI_PXA270_ETH_PHYS (PXA_CS2_PHYS) /* Ethernet */ 60#define GPIO113_COLIBRI_PXA270_TS_IRQ 113
40#define COLIBRI_PXA270_ETH_IRQ_GPIO 114
41#define COLIBRI_PXA270_ETH_IRQ \
42 gpio_to_irq(mfp_to_gpio(COLIBRI_PXA270_ETH_IRQ_GPIO))
43 61
44#endif /* _COLIBRI_H_ */ 62#endif /* _COLIBRI_H_ */
45 63
diff --git a/arch/arm/mach-pxa/include/mach/corgi.h b/arch/arm/mach-pxa/include/mach/corgi.h
index 585970ef08ce..0011055bc3f9 100644
--- a/arch/arm/mach-pxa/include/mach/corgi.h
+++ b/arch/arm/mach-pxa/include/mach/corgi.h
@@ -109,10 +109,5 @@
109#define CORGI_GPIO_BACKLIGHT_CONT (CORGI_SCOOP_GPIO_BASE + 7) 109#define CORGI_GPIO_BACKLIGHT_CONT (CORGI_SCOOP_GPIO_BASE + 7)
110#define CORGI_GPIO_MIC_BIAS (CORGI_SCOOP_GPIO_BASE + 8) 110#define CORGI_GPIO_MIC_BIAS (CORGI_SCOOP_GPIO_BASE + 8)
111 111
112/*
113 * Shared data structures
114 */
115extern struct platform_device corgiscoop_device;
116
117#endif /* __ASM_ARCH_CORGI_H */ 112#endif /* __ASM_ARCH_CORGI_H */
118 113
diff --git a/arch/arm/mach-pxa/include/mach/gumstix.h b/arch/arm/mach-pxa/include/mach/gumstix.h
index 06abd4160607..9b898680b206 100644
--- a/arch/arm/mach-pxa/include/mach/gumstix.h
+++ b/arch/arm/mach-pxa/include/mach/gumstix.h
@@ -14,25 +14,15 @@
14 14
15/* 15/*
16GPIOn - Input from MAX823 (or equiv), normalizing USB +5V into a clean 16GPIOn - Input from MAX823 (or equiv), normalizing USB +5V into a clean
17interrupt signal for determining cable presence. On the original gumstix, 17interrupt signal for determining cable presence. On the gumstix F,
18this is GPIO81, and GPIO83 needs to be defined as well. On the gumstix F,
19this moves to GPIO17 and GPIO37. */ 18this moves to GPIO17 and GPIO37. */
20 19
21/* GPIOx - Connects to USB D+ and used as a pull-up after GPIOn 20/* GPIOx - Connects to USB D+ and used as a pull-up after GPIOn
22has detected a cable insertion; driven low otherwise. */ 21has detected a cable insertion; driven low otherwise. */
23 22
24#ifdef CONFIG_ARCH_GUMSTIX_ORIG
25
26#define GPIO_GUMSTIX_USB_GPIOn 81
27#define GPIO_GUMSTIX_USB_GPIOx 83
28
29#else
30
31#define GPIO_GUMSTIX_USB_GPIOn 35 23#define GPIO_GUMSTIX_USB_GPIOn 35
32#define GPIO_GUMSTIX_USB_GPIOx 41 24#define GPIO_GUMSTIX_USB_GPIOx 41
33 25
34#endif
35
36/* usb state change */ 26/* usb state change */
37#define GUMSTIX_USB_INTR_IRQ IRQ_GPIO(GPIO_GUMSTIX_USB_GPIOn) 27#define GUMSTIX_USB_INTR_IRQ IRQ_GPIO(GPIO_GUMSTIX_USB_GPIOn)
38 28
diff --git a/arch/arm/mach-pxa/include/mach/hardware.h b/arch/arm/mach-pxa/include/mach/hardware.h
index 3d8d8cb09685..7f64d24cd564 100644
--- a/arch/arm/mach-pxa/include/mach/hardware.h
+++ b/arch/arm/mach-pxa/include/mach/hardware.h
@@ -14,11 +14,6 @@
14#define __ASM_ARCH_HARDWARE_H 14#define __ASM_ARCH_HARDWARE_H
15 15
16/* 16/*
17 * We requires absolute addresses.
18 */
19#define PCIO_BASE 0
20
21/*
22 * Workarounds for at least 2 errata so far require this. 17 * Workarounds for at least 2 errata so far require this.
23 * The mapping is set in mach-pxa/generic.c. 18 * The mapping is set in mach-pxa/generic.c.
24 */ 19 */
diff --git a/arch/arm/mach-pxa/include/mach/palm27x.h b/arch/arm/mach-pxa/include/mach/palm27x.h
new file mode 100644
index 000000000000..0a5e5eadebf5
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/palm27x.h
@@ -0,0 +1,81 @@
1/*
2 * Common functions for Palm LD, T5, TX, Z72
3 *
4 * Copyright (C) 2010
5 * Marek Vasut <marek.vasut@gmail.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12#ifndef __INCLUDE_MACH_PALM27X__
13#define __INCLUDE_MACH_PALM27X__
14
15#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
16extern void __init palm27x_mmc_init(int detect, int ro, int power,
17 int power_inverted);
18#else
19static inline void palm27x_mmc_init(int detect, int ro, int power,
20 int power_inverted)
21{}
22#endif
23
24#if defined(CONFIG_SUSPEND)
25extern void __init palm27x_pm_init(unsigned long str_base);
26#else
27static inline void palm27x_pm_init(unsigned long str_base) {}
28#endif
29
30#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
31extern struct pxafb_mode_info palm_320x480_lcd_mode;
32extern struct pxafb_mode_info palm_320x320_lcd_mode;
33extern struct pxafb_mode_info palm_320x320_new_lcd_mode;
34extern void __init palm27x_lcd_init(int power,
35 struct pxafb_mode_info *mode);
36#else
37static inline void palm27x_lcd_init(int power, struct pxafb_mode_info *mode) {}
38#endif
39
40#if defined(CONFIG_USB_GADGET_PXA27X) || \
41 defined(CONFIG_USB_GADGET_PXA27X_MODULE)
42extern void __init palm27x_udc_init(int vbus, int pullup,
43 int vbus_inverted);
44#else
45static inline void palm27x_udc_init(int vbus, int pullup, int vbus_inverted) {}
46#endif
47
48#if defined(CONFIG_IRDA) || defined(CONFIG_IRDA_MODULE)
49extern void __init palm27x_irda_init(int pwdn);
50#else
51static inline void palm27x_irda_init(int pwdn) {}
52#endif
53
54#if defined(CONFIG_TOUCHSCREEN_WM97XX) || \
55 defined(CONFIG_TOUCHSCREEN_WM97XX_MODULE)
56extern void __init palm27x_ac97_init(int minv, int maxv, int jack,
57 int reset);
58#else
59static inline void palm27x_ac97_init(int minv, int maxv, int jack, int reset) {}
60#endif
61
62#if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE)
63extern void __init palm27x_pwm_init(int bl, int lcd);
64#else
65static inline void palm27x_pwm_init(int bl, int lcd) {}
66#endif
67
68#if defined(CONFIG_PDA_POWER) || defined(CONFIG_PDA_POWER_MODULE)
69extern void __init palm27x_power_init(int ac, int usb);
70#else
71static inline void palm27x_power_init(int ac, int usb) {}
72#endif
73
74#if defined(CONFIG_REGULATOR_MAX1586) || \
75 defined(CONFIG_REGULATOR_MAX1586_MODULE)
76extern void __init palm27x_pmic_init(void);
77#else
78static inline void palm27x_pmic_init(void) {}
79#endif
80
81#endif /* __INCLUDE_MACH_PALM27X__ */
diff --git a/arch/arm/mach-pxa/include/mach/pata_pxa.h b/arch/arm/mach-pxa/include/mach/pata_pxa.h
new file mode 100644
index 000000000000..6cf7df1d5830
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/pata_pxa.h
@@ -0,0 +1,33 @@
1/*
2 * Generic PXA PATA driver
3 *
4 * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; see the file COPYING. If not, write to
18 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21#ifndef __MACH_PATA_PXA_H__
22#define __MACH_PATA_PXA_H__
23
24struct pata_pxa_pdata {
25 /* PXA DMA DREQ<0:2> pin */
26 uint32_t dma_dreq;
27 /* Register shift */
28 uint32_t reg_shift;
29 /* IRQ flags */
30 uint32_t irq_flags;
31};
32
33#endif /* __MACH_PATA_PXA_H__ */
diff --git a/arch/arm/mach-pxa/include/mach/sharpsl.h b/arch/arm/mach-pxa/include/mach/sharpsl.h
deleted file mode 100644
index 8242e14a44fa..000000000000
--- a/arch/arm/mach-pxa/include/mach/sharpsl.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * SharpSL SSP Driver
3 */
4
5unsigned long corgi_ssp_ads7846_putget(unsigned long);
6unsigned long corgi_ssp_ads7846_get(void);
7void corgi_ssp_ads7846_put(unsigned long data);
8void corgi_ssp_ads7846_lock(void);
9void corgi_ssp_ads7846_unlock(void);
10void corgi_ssp_lcdtg_send (unsigned char adrs, unsigned char data);
11void corgi_ssp_blduty_set(int duty);
12int corgi_ssp_max1111_get(unsigned long data);
13
14/*
15 * SharpSL Touchscreen Driver
16 */
17
18struct corgits_machinfo {
19 unsigned long (*get_hsync_invperiod)(void);
20 void (*put_hsync)(void);
21 void (*wait_hsync)(void);
22};
23
24
25/*
26 * SharpSL Backlight
27 */
28extern void corgibl_limit_intensity(int limit);
29extern void corgi_lcd_limit_intensity(int limit);
30
31
32/*
33 * SharpSL Battery/PM Driver
34 */
35extern void sharpsl_battery_kick(void);
diff --git a/arch/arm/mach-pxa/include/mach/sharpsl_pm.h b/arch/arm/mach-pxa/include/mach/sharpsl_pm.h
index 1920dc6b05dc..905be6755f04 100644
--- a/arch/arm/mach-pxa/include/mach/sharpsl_pm.h
+++ b/arch/arm/mach-pxa/include/mach/sharpsl_pm.h
@@ -93,6 +93,8 @@ struct sharpsl_pm_status {
93 93
94extern struct sharpsl_pm_status sharpsl_pm; 94extern struct sharpsl_pm_status sharpsl_pm;
95 95
96extern struct battery_thresh sharpsl_battery_levels_acin[];
97extern struct battery_thresh sharpsl_battery_levels_noac[];
96 98
97#define SHARPSL_LED_ERROR 2 99#define SHARPSL_LED_ERROR 2
98#define SHARPSL_LED_ON 1 100#define SHARPSL_LED_ON 1
@@ -101,4 +103,11 @@ extern struct sharpsl_pm_status sharpsl_pm;
101void sharpsl_battery_kick(void); 103void sharpsl_battery_kick(void);
102void sharpsl_pm_led(int val); 104void sharpsl_pm_led(int val);
103 105
106/* MAX1111 Channel Definitions */
107#define MAX1111_BATT_VOLT 4u
108#define MAX1111_BATT_TEMP 2u
109#define MAX1111_ACIN_VOLT 6u
110int sharpsl_pm_pxa_read_max1111(int channel);
111
112void corgi_lcd_limit_intensity(int limit);
104#endif 113#endif
diff --git a/arch/arm/mach-pxa/include/mach/spitz.h b/arch/arm/mach-pxa/include/mach/spitz.h
index fa1998caa78e..685749a51c42 100644
--- a/arch/arm/mach-pxa/include/mach/spitz.h
+++ b/arch/arm/mach-pxa/include/mach/spitz.h
@@ -185,7 +185,5 @@
185/* 185/*
186 * Shared data structures 186 * Shared data structures
187 */ 187 */
188extern struct platform_device spitzscoop_device;
189extern struct platform_device spitzscoop2_device;
190extern struct platform_device spitzssp_device; 188extern struct platform_device spitzssp_device;
191extern struct sharpsl_charger_machinfo spitz_pm_machinfo; 189extern struct sharpsl_charger_machinfo spitz_pm_machinfo;
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
index fa6a708b4099..dc66942ef9ab 100644
--- a/arch/arm/mach-pxa/mioa701.c
+++ b/arch/arm/mach-pxa/mioa701.c
@@ -34,7 +34,7 @@
34#include <linux/irq.h> 34#include <linux/irq.h>
35#include <linux/pda_power.h> 35#include <linux/pda_power.h>
36#include <linux/power_supply.h> 36#include <linux/power_supply.h>
37#include <linux/wm97xx_batt.h> 37#include <linux/wm97xx.h>
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>
@@ -636,7 +636,7 @@ static struct platform_device power_dev = {
636 }, 636 },
637}; 637};
638 638
639static struct wm97xx_batt_info mioa701_battery_data = { 639static struct wm97xx_batt_pdata mioa701_battery_data = {
640 .batt_aux = WM97XX_AUX_ID1, 640 .batt_aux = WM97XX_AUX_ID1,
641 .temp_aux = -1, 641 .temp_aux = -1,
642 .charge_gpio = -1, 642 .charge_gpio = -1,
@@ -648,6 +648,10 @@ static struct wm97xx_batt_info mioa701_battery_data = {
648 .batt_name = "mioa701_battery", 648 .batt_name = "mioa701_battery",
649}; 649};
650 650
651static struct wm97xx_pdata mioa701_wm97xx_pdata = {
652 .batt_pdata = &mioa701_battery_data,
653};
654
651/* 655/*
652 * Voltage regulation 656 * Voltage regulation
653 */ 657 */
@@ -716,6 +720,7 @@ struct i2c_pxa_platform_data i2c_pdata = {
716 720
717static pxa2xx_audio_ops_t mioa701_ac97_info = { 721static pxa2xx_audio_ops_t mioa701_ac97_info = {
718 .reset_gpio = 95, 722 .reset_gpio = 95,
723 .codec_pdata = { &mioa701_wm97xx_pdata, },
719}; 724};
720 725
721/* 726/*
@@ -794,7 +799,6 @@ static void __init mioa701_machine_init(void)
794 set_pxa_fb_info(&mioa701_pxafb_info); 799 set_pxa_fb_info(&mioa701_pxafb_info);
795 pxa_set_mci_info(&mioa701_mci_info); 800 pxa_set_mci_info(&mioa701_mci_info);
796 pxa_set_keypad_info(&mioa701_keypad_info); 801 pxa_set_keypad_info(&mioa701_keypad_info);
797 wm97xx_bat_set_pdata(&mioa701_battery_data);
798 pxa_set_udc_info(&mioa701_udc_info); 802 pxa_set_udc_info(&mioa701_udc_info);
799 pxa_set_ac97_info(&mioa701_ac97_info); 803 pxa_set_ac97_info(&mioa701_ac97_info);
800 pm_power_off = mioa701_poweroff; 804 pm_power_off = mioa701_poweroff;
diff --git a/arch/arm/mach-pxa/palm27x.c b/arch/arm/mach-pxa/palm27x.c
new file mode 100644
index 000000000000..77ad6d34ab5b
--- /dev/null
+++ b/arch/arm/mach-pxa/palm27x.c
@@ -0,0 +1,477 @@
1/*
2 * Common code for Palm LD, T5, TX, Z72
3 *
4 * Copyright (C) 2010
5 * Marek Vasut <marek.vasut@gmail.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12
13#include <linux/platform_device.h>
14#include <linux/delay.h>
15#include <linux/irq.h>
16#include <linux/gpio_keys.h>
17#include <linux/input.h>
18#include <linux/pda_power.h>
19#include <linux/pwm_backlight.h>
20#include <linux/gpio.h>
21#include <linux/wm97xx.h>
22#include <linux/power_supply.h>
23#include <linux/usb/gpio_vbus.h>
24#include <linux/regulator/max1586.h>
25
26#include <asm/mach-types.h>
27#include <asm/mach/arch.h>
28#include <asm/mach/map.h>
29
30#include <mach/pxa27x.h>
31#include <mach/audio.h>
32#include <mach/mmc.h>
33#include <mach/pxafb.h>
34#include <mach/irda.h>
35#include <mach/udc.h>
36#include <mach/palmasoc.h>
37#include <mach/palm27x.h>
38
39#include <plat/i2c.h>
40
41#include "generic.h"
42#include "devices.h"
43
44/******************************************************************************
45 * SD/MMC card controller
46 ******************************************************************************/
47#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
48static struct pxamci_platform_data palm27x_mci_platform_data = {
49 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
50 .detect_delay_ms = 200,
51};
52
53void __init palm27x_mmc_init(int detect, int ro, int power,
54 int power_inverted)
55{
56 palm27x_mci_platform_data.gpio_card_detect = detect;
57 palm27x_mci_platform_data.gpio_card_ro = ro;
58 palm27x_mci_platform_data.gpio_power = power;
59 palm27x_mci_platform_data.gpio_power_invert = power_inverted;
60
61 pxa_set_mci_info(&palm27x_mci_platform_data);
62}
63#endif
64
65/******************************************************************************
66 * Power management - standby
67 ******************************************************************************/
68#if defined(CONFIG_SUSPEND)
69void __init palm27x_pm_init(unsigned long str_base)
70{
71 static const unsigned long resume[] = {
72 0xe3a00101, /* mov r0, #0x40000000 */
73 0xe380060f, /* orr r0, r0, #0x00f00000 */
74 0xe590f008, /* ldr pc, [r0, #0x08] */
75 };
76
77 /*
78 * Copy the bootloader.
79 * NOTE: PalmZ72 uses a different wakeup method!
80 */
81 memcpy(phys_to_virt(str_base), resume, sizeof(resume));
82}
83#endif
84
85/******************************************************************************
86 * Framebuffer
87 ******************************************************************************/
88#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
89struct pxafb_mode_info palm_320x480_lcd_mode = {
90 .pixclock = 57692,
91 .xres = 320,
92 .yres = 480,
93 .bpp = 16,
94
95 .left_margin = 32,
96 .right_margin = 1,
97 .upper_margin = 7,
98 .lower_margin = 1,
99
100 .hsync_len = 4,
101 .vsync_len = 1,
102};
103
104struct pxafb_mode_info palm_320x320_lcd_mode = {
105 .pixclock = 115384,
106 .xres = 320,
107 .yres = 320,
108 .bpp = 16,
109
110 .left_margin = 27,
111 .right_margin = 7,
112 .upper_margin = 7,
113 .lower_margin = 8,
114
115 .hsync_len = 6,
116 .vsync_len = 1,
117};
118
119struct pxafb_mode_info palm_320x320_new_lcd_mode = {
120 .pixclock = 86538,
121 .xres = 320,
122 .yres = 320,
123 .bpp = 16,
124
125 .left_margin = 20,
126 .right_margin = 8,
127 .upper_margin = 8,
128 .lower_margin = 5,
129
130 .hsync_len = 4,
131 .vsync_len = 1,
132};
133
134static struct pxafb_mach_info palm27x_lcd_screen = {
135 .num_modes = 1,
136 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
137};
138
139static int palm27x_lcd_power;
140static void palm27x_lcd_ctl(int on, struct fb_var_screeninfo *info)
141{
142 gpio_set_value(palm27x_lcd_power, on);
143}
144
145void __init palm27x_lcd_init(int power, struct pxafb_mode_info *mode)
146{
147 palm27x_lcd_screen.modes = mode;
148
149 if (gpio_is_valid(power)) {
150 if (!gpio_request(power, "LCD power")) {
151 pr_err("Palm27x: failed to claim lcd power gpio!\n");
152 return;
153 }
154 if (!gpio_direction_output(power, 1)) {
155 pr_err("Palm27x: lcd power configuration failed!\n");
156 return;
157 }
158 palm27x_lcd_power = power;
159 palm27x_lcd_screen.pxafb_lcd_power = palm27x_lcd_ctl;
160 }
161
162 set_pxa_fb_info(&palm27x_lcd_screen);
163}
164#endif
165
166/******************************************************************************
167 * USB Gadget
168 ******************************************************************************/
169#if defined(CONFIG_USB_GADGET_PXA27X) || \
170 defined(CONFIG_USB_GADGET_PXA27X_MODULE)
171static struct gpio_vbus_mach_info palm27x_udc_info = {
172 .gpio_vbus_inverted = 1,
173};
174
175static struct platform_device palm27x_gpio_vbus = {
176 .name = "gpio-vbus",
177 .id = -1,
178 .dev = {
179 .platform_data = &palm27x_udc_info,
180 },
181};
182
183void __init palm27x_udc_init(int vbus, int pullup, int vbus_inverted)
184{
185 palm27x_udc_info.gpio_vbus = vbus;
186 palm27x_udc_info.gpio_pullup = pullup;
187
188 palm27x_udc_info.gpio_vbus_inverted = vbus_inverted;
189
190 if (!gpio_request(pullup, "USB Pullup")) {
191 gpio_direction_output(pullup,
192 palm27x_udc_info.gpio_vbus_inverted);
193 gpio_free(pullup);
194 } else
195 return;
196
197 platform_device_register(&palm27x_gpio_vbus);
198}
199#endif
200
201/******************************************************************************
202 * IrDA
203 ******************************************************************************/
204#if defined(CONFIG_IRDA) || defined(CONFIG_IRDA_MODULE)
205static struct pxaficp_platform_data palm27x_ficp_platform_data = {
206 .transceiver_cap = IR_SIRMODE | IR_OFF,
207};
208
209void __init palm27x_irda_init(int pwdn)
210{
211 palm27x_ficp_platform_data.gpio_pwdown = pwdn;
212 pxa_set_ficp_info(&palm27x_ficp_platform_data);
213}
214#endif
215
216/******************************************************************************
217 * WM97xx audio, battery
218 ******************************************************************************/
219#if defined(CONFIG_TOUCHSCREEN_WM97XX) || \
220 defined(CONFIG_TOUCHSCREEN_WM97XX_MODULE)
221static struct wm97xx_batt_pdata palm27x_batt_pdata = {
222 .batt_aux = WM97XX_AUX_ID3,
223 .temp_aux = WM97XX_AUX_ID2,
224 .charge_gpio = -1,
225 .batt_mult = 1000,
226 .batt_div = 414,
227 .temp_mult = 1,
228 .temp_div = 1,
229 .batt_tech = POWER_SUPPLY_TECHNOLOGY_LIPO,
230 .batt_name = "main-batt",
231};
232
233static struct wm97xx_pdata palm27x_wm97xx_pdata = {
234 .batt_pdata = &palm27x_batt_pdata,
235};
236
237static pxa2xx_audio_ops_t palm27x_ac97_pdata = {
238 .codec_pdata = { &palm27x_wm97xx_pdata, },
239};
240
241static struct palm27x_asoc_info palm27x_asoc_pdata = {
242 .jack_gpio = -1,
243};
244
245static struct platform_device palm27x_asoc = {
246 .name = "palm27x-asoc",
247 .id = -1,
248 .dev = {
249 .platform_data = &palm27x_asoc_pdata,
250 },
251};
252
253void __init palm27x_ac97_init(int minv, int maxv, int jack, int reset)
254{
255 palm27x_ac97_pdata.reset_gpio = reset;
256 palm27x_asoc_pdata.jack_gpio = jack;
257
258 if (minv < 0 || maxv < 0) {
259 palm27x_ac97_pdata.codec_pdata[0] = NULL;
260 pxa_set_ac97_info(&palm27x_ac97_pdata);
261 } else {
262 palm27x_batt_pdata.min_voltage = minv,
263 palm27x_batt_pdata.max_voltage = maxv,
264
265 pxa_set_ac97_info(&palm27x_ac97_pdata);
266 platform_device_register(&palm27x_asoc);
267 }
268}
269#endif
270
271/******************************************************************************
272 * Backlight
273 ******************************************************************************/
274#if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE)
275static int palm_bl_power;
276static int palm_lcd_power;
277
278static int palm27x_backlight_init(struct device *dev)
279{
280 int ret;
281
282 ret = gpio_request(palm_bl_power, "BL POWER");
283 if (ret)
284 goto err;
285 ret = gpio_direction_output(palm_bl_power, 0);
286 if (ret)
287 goto err2;
288
289 if (gpio_is_valid(palm_lcd_power)) {
290 ret = gpio_request(palm_lcd_power, "LCD POWER");
291 if (ret)
292 goto err2;
293 ret = gpio_direction_output(palm_lcd_power, 0);
294 if (ret)
295 goto err3;
296 }
297
298 return 0;
299err3:
300 gpio_free(palm_lcd_power);
301err2:
302 gpio_free(palm_bl_power);
303err:
304 return ret;
305}
306
307static int palm27x_backlight_notify(struct device *dev, int brightness)
308{
309 gpio_set_value(palm_bl_power, brightness);
310 if (gpio_is_valid(palm_lcd_power))
311 gpio_set_value(palm_lcd_power, brightness);
312 return brightness;
313}
314
315static void palm27x_backlight_exit(struct device *dev)
316{
317 gpio_free(palm_bl_power);
318 if (gpio_is_valid(palm_lcd_power))
319 gpio_free(palm_lcd_power);
320}
321
322static struct platform_pwm_backlight_data palm27x_backlight_data = {
323 .pwm_id = 0,
324 .max_brightness = 0xfe,
325 .dft_brightness = 0x7e,
326 .pwm_period_ns = 3500,
327 .init = palm27x_backlight_init,
328 .notify = palm27x_backlight_notify,
329 .exit = palm27x_backlight_exit,
330};
331
332static struct platform_device palm27x_backlight = {
333 .name = "pwm-backlight",
334 .dev = {
335 .parent = &pxa27x_device_pwm0.dev,
336 .platform_data = &palm27x_backlight_data,
337 },
338};
339
340void __init palm27x_pwm_init(int bl, int lcd)
341{
342 palm_bl_power = bl;
343 palm_lcd_power = lcd;
344 platform_device_register(&palm27x_backlight);
345}
346#endif
347
348/******************************************************************************
349 * Power supply
350 ******************************************************************************/
351#if defined(CONFIG_PDA_POWER) || defined(CONFIG_PDA_POWER_MODULE)
352static int palm_ac_state;
353static int palm_usb_state;
354
355static int palm27x_power_supply_init(struct device *dev)
356{
357 int ret;
358
359 ret = gpio_request(palm_ac_state, "AC state");
360 if (ret)
361 goto err1;
362 ret = gpio_direction_input(palm_ac_state);
363 if (ret)
364 goto err2;
365
366 if (gpio_is_valid(palm_usb_state)) {
367 ret = gpio_request(palm_usb_state, "USB state");
368 if (ret)
369 goto err2;
370 ret = gpio_direction_input(palm_usb_state);
371 if (ret)
372 goto err3;
373 }
374
375 return 0;
376err3:
377 gpio_free(palm_usb_state);
378err2:
379 gpio_free(palm_ac_state);
380err1:
381 return ret;
382}
383
384static void palm27x_power_supply_exit(struct device *dev)
385{
386 gpio_free(palm_usb_state);
387 gpio_free(palm_ac_state);
388}
389
390static int palm27x_is_ac_online(void)
391{
392 return gpio_get_value(palm_ac_state);
393}
394
395static int palm27x_is_usb_online(void)
396{
397 return !gpio_get_value(palm_usb_state);
398}
399static char *palm27x_supplicants[] = {
400 "main-battery",
401};
402
403static struct pda_power_pdata palm27x_ps_info = {
404 .init = palm27x_power_supply_init,
405 .exit = palm27x_power_supply_exit,
406 .is_ac_online = palm27x_is_ac_online,
407 .is_usb_online = palm27x_is_usb_online,
408 .supplied_to = palm27x_supplicants,
409 .num_supplicants = ARRAY_SIZE(palm27x_supplicants),
410};
411
412static struct platform_device palm27x_power_supply = {
413 .name = "pda-power",
414 .id = -1,
415 .dev = {
416 .platform_data = &palm27x_ps_info,
417 },
418};
419
420void __init palm27x_power_init(int ac, int usb)
421{
422 palm_ac_state = ac;
423 palm_usb_state = usb;
424 platform_device_register(&palm27x_power_supply);
425}
426#endif
427
428/******************************************************************************
429 * Core power regulator
430 ******************************************************************************/
431#if defined(CONFIG_REGULATOR_MAX1586) || \
432 defined(CONFIG_REGULATOR_MAX1586_MODULE)
433static struct regulator_consumer_supply palm27x_max1587a_consumers[] = {
434 {
435 .supply = "vcc_core",
436 }
437};
438
439static struct regulator_init_data palm27x_max1587a_v3_info = {
440 .constraints = {
441 .name = "vcc_core range",
442 .min_uV = 900000,
443 .max_uV = 1705000,
444 .always_on = 1,
445 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
446 },
447 .consumer_supplies = palm27x_max1587a_consumers,
448 .num_consumer_supplies = ARRAY_SIZE(palm27x_max1587a_consumers),
449};
450
451static struct max1586_subdev_data palm27x_max1587a_subdevs[] = {
452 {
453 .name = "vcc_core",
454 .id = MAX1586_V3,
455 .platform_data = &palm27x_max1587a_v3_info,
456 }
457};
458
459static struct max1586_platform_data palm27x_max1587a_info = {
460 .subdevs = palm27x_max1587a_subdevs,
461 .num_subdevs = ARRAY_SIZE(palm27x_max1587a_subdevs),
462 .v3_gain = MAX1586_GAIN_R24_3k32, /* 730..1550 mV */
463};
464
465static struct i2c_board_info __initdata palm27x_pi2c_board_info[] = {
466 {
467 I2C_BOARD_INFO("max1586", 0x14),
468 .platform_data = &palm27x_max1587a_info,
469 },
470};
471
472void __init palm27x_pmic_init(void)
473{
474 i2c_register_board_info(1, ARRAY_AND_SIZE(palm27x_pi2c_board_info));
475 pxa27x_set_i2c_power_info(NULL);
476}
477#endif
diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c
index 1963819dba98..91038eeafe44 100644
--- a/arch/arm/mach-pxa/palmld.c
+++ b/arch/arm/mach-pxa/palmld.c
@@ -22,7 +22,7 @@
22#include <linux/pda_power.h> 22#include <linux/pda_power.h>
23#include <linux/pwm_backlight.h> 23#include <linux/pwm_backlight.h>
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/wm97xx_batt.h> 25#include <linux/wm97xx.h>
26#include <linux/power_supply.h> 26#include <linux/power_supply.h>
27#include <linux/sysdev.h> 27#include <linux/sysdev.h>
28#include <linux/mtd/mtd.h> 28#include <linux/mtd/mtd.h>
@@ -41,6 +41,7 @@
41#include <mach/irda.h> 41#include <mach/irda.h>
42#include <mach/pxa27x_keypad.h> 42#include <mach/pxa27x_keypad.h>
43#include <mach/palmasoc.h> 43#include <mach/palmasoc.h>
44#include <mach/palm27x.h>
44 45
45#include "generic.h" 46#include "generic.h"
46#include "devices.h" 47#include "devices.h"
@@ -127,6 +128,7 @@ static unsigned long palmld_pin_config[] __initdata = {
127/****************************************************************************** 128/******************************************************************************
128 * NOR Flash 129 * NOR Flash
129 ******************************************************************************/ 130 ******************************************************************************/
131#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
130static struct mtd_partition palmld_partitions[] = { 132static struct mtd_partition palmld_partitions[] = {
131 { 133 {
132 .name = "Flash", 134 .name = "Flash",
@@ -160,20 +162,18 @@ static struct platform_device palmld_flash = {
160 }, 162 },
161}; 163};
162 164
163/****************************************************************************** 165static void __init palmld_nor_init(void)
164 * SD/MMC card controller 166{
165 ******************************************************************************/ 167 platform_device_register(&palmld_flash);
166static struct pxamci_platform_data palmld_mci_platform_data = { 168}
167 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, 169#else
168 .gpio_card_detect = GPIO_NR_PALMLD_SD_DETECT_N, 170static inline void palmld_nor_init(void) {}
169 .gpio_card_ro = GPIO_NR_PALMLD_SD_READONLY, 171#endif
170 .gpio_power = GPIO_NR_PALMLD_SD_POWER,
171 .detect_delay_ms = 200,
172};
173 172
174/****************************************************************************** 173/******************************************************************************
175 * GPIO keyboard 174 * GPIO keyboard
176 ******************************************************************************/ 175 ******************************************************************************/
176#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE)
177static unsigned int palmld_matrix_keys[] = { 177static unsigned int palmld_matrix_keys[] = {
178 KEY(0, 1, KEY_F2), 178 KEY(0, 1, KEY_F2),
179 KEY(0, 2, KEY_UP), 179 KEY(0, 2, KEY_UP),
@@ -200,9 +200,18 @@ static struct pxa27x_keypad_platform_data palmld_keypad_platform_data = {
200 .debounce_interval = 30, 200 .debounce_interval = 30,
201}; 201};
202 202
203static void __init palmld_kpc_init(void)
204{
205 pxa_set_keypad_info(&palmld_keypad_platform_data);
206}
207#else
208static inline void palmld_kpc_init(void) {}
209#endif
210
203/****************************************************************************** 211/******************************************************************************
204 * GPIO keys 212 * GPIO keys
205 ******************************************************************************/ 213 ******************************************************************************/
214#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
206static struct gpio_keys_button palmld_pxa_buttons[] = { 215static struct gpio_keys_button palmld_pxa_buttons[] = {
207 {KEY_F8, GPIO_NR_PALMLD_HOTSYNC_BUTTON_N, 1, "HotSync Button" }, 216 {KEY_F8, GPIO_NR_PALMLD_HOTSYNC_BUTTON_N, 1, "HotSync Button" },
208 {KEY_F9, GPIO_NR_PALMLD_LOCK_SWITCH, 0, "Lock Switch" }, 217 {KEY_F9, GPIO_NR_PALMLD_LOCK_SWITCH, 0, "Lock Switch" },
@@ -222,77 +231,18 @@ static struct platform_device palmld_pxa_keys = {
222 }, 231 },
223}; 232};
224 233
225/****************************************************************************** 234static void __init palmld_keys_init(void)
226 * Backlight
227 ******************************************************************************/
228static int palmld_backlight_init(struct device *dev)
229{
230 int ret;
231
232 ret = gpio_request(GPIO_NR_PALMLD_BL_POWER, "BL POWER");
233 if (ret)
234 goto err;
235 ret = gpio_direction_output(GPIO_NR_PALMLD_BL_POWER, 0);
236 if (ret)
237 goto err2;
238 ret = gpio_request(GPIO_NR_PALMLD_LCD_POWER, "LCD POWER");
239 if (ret)
240 goto err2;
241 ret = gpio_direction_output(GPIO_NR_PALMLD_LCD_POWER, 0);
242 if (ret)
243 goto err3;
244
245 return 0;
246err3:
247 gpio_free(GPIO_NR_PALMLD_LCD_POWER);
248err2:
249 gpio_free(GPIO_NR_PALMLD_BL_POWER);
250err:
251 return ret;
252}
253
254static int palmld_backlight_notify(struct device *dev, int brightness)
255{ 235{
256 gpio_set_value(GPIO_NR_PALMLD_BL_POWER, brightness); 236 platform_device_register(&palmld_pxa_keys);
257 gpio_set_value(GPIO_NR_PALMLD_LCD_POWER, brightness);
258 return brightness;
259} 237}
260 238#else
261static void palmld_backlight_exit(struct device *dev) 239static inline void palmld_keys_init(void) {}
262{ 240#endif
263 gpio_free(GPIO_NR_PALMLD_BL_POWER);
264 gpio_free(GPIO_NR_PALMLD_LCD_POWER);
265}
266
267static struct platform_pwm_backlight_data palmld_backlight_data = {
268 .pwm_id = 0,
269 .max_brightness = PALMLD_MAX_INTENSITY,
270 .dft_brightness = PALMLD_MAX_INTENSITY,
271 .pwm_period_ns = PALMLD_PERIOD_NS,
272 .init = palmld_backlight_init,
273 .notify = palmld_backlight_notify,
274 .exit = palmld_backlight_exit,
275};
276
277static struct platform_device palmld_backlight = {
278 .name = "pwm-backlight",
279 .dev = {
280 .parent = &pxa27x_device_pwm0.dev,
281 .platform_data = &palmld_backlight_data,
282 },
283};
284
285/******************************************************************************
286 * IrDA
287 ******************************************************************************/
288static struct pxaficp_platform_data palmld_ficp_platform_data = {
289 .gpio_pwdown = GPIO_NR_PALMLD_IR_DISABLE,
290 .transceiver_cap = IR_SIRMODE | IR_OFF,
291};
292 241
293/****************************************************************************** 242/******************************************************************************
294 * LEDs 243 * LEDs
295 ******************************************************************************/ 244 ******************************************************************************/
245#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
296struct gpio_led gpio_leds[] = { 246struct gpio_led gpio_leds[] = {
297{ 247{
298 .name = "palmld:green:led", 248 .name = "palmld:green:led",
@@ -318,174 +268,34 @@ static struct platform_device palmld_leds = {
318 } 268 }
319}; 269};
320 270
321/****************************************************************************** 271static void __init palmld_leds_init(void)
322 * Power supply
323 ******************************************************************************/
324static int power_supply_init(struct device *dev)
325{
326 int ret;
327
328 ret = gpio_request(GPIO_NR_PALMLD_POWER_DETECT, "CABLE_STATE_AC");
329 if (ret)
330 goto err1;
331 ret = gpio_direction_input(GPIO_NR_PALMLD_POWER_DETECT);
332 if (ret)
333 goto err2;
334
335 ret = gpio_request(GPIO_NR_PALMLD_USB_DETECT_N, "CABLE_STATE_USB");
336 if (ret)
337 goto err2;
338 ret = gpio_direction_input(GPIO_NR_PALMLD_USB_DETECT_N);
339 if (ret)
340 goto err3;
341
342 return 0;
343
344err3:
345 gpio_free(GPIO_NR_PALMLD_USB_DETECT_N);
346err2:
347 gpio_free(GPIO_NR_PALMLD_POWER_DETECT);
348err1:
349 return ret;
350}
351
352static int palmld_is_ac_online(void)
353{ 272{
354 return gpio_get_value(GPIO_NR_PALMLD_POWER_DETECT); 273 platform_device_register(&palmld_leds);
355} 274}
356 275#else
357static int palmld_is_usb_online(void) 276static inline void palmld_leds_init(void) {}
358{ 277#endif
359 return !gpio_get_value(GPIO_NR_PALMLD_USB_DETECT_N);
360}
361
362static void power_supply_exit(struct device *dev)
363{
364 gpio_free(GPIO_NR_PALMLD_USB_DETECT_N);
365 gpio_free(GPIO_NR_PALMLD_POWER_DETECT);
366}
367
368static char *palmld_supplicants[] = {
369 "main-battery",
370};
371
372static struct pda_power_pdata power_supply_info = {
373 .init = power_supply_init,
374 .is_ac_online = palmld_is_ac_online,
375 .is_usb_online = palmld_is_usb_online,
376 .exit = power_supply_exit,
377 .supplied_to = palmld_supplicants,
378 .num_supplicants = ARRAY_SIZE(palmld_supplicants),
379};
380
381static struct platform_device power_supply = {
382 .name = "pda-power",
383 .id = -1,
384 .dev = {
385 .platform_data = &power_supply_info,
386 },
387};
388
389/******************************************************************************
390 * WM97xx battery
391 ******************************************************************************/
392static struct wm97xx_batt_info wm97xx_batt_pdata = {
393 .batt_aux = WM97XX_AUX_ID3,
394 .temp_aux = WM97XX_AUX_ID2,
395 .charge_gpio = -1,
396 .max_voltage = PALMLD_BAT_MAX_VOLTAGE,
397 .min_voltage = PALMLD_BAT_MIN_VOLTAGE,
398 .batt_mult = 1000,
399 .batt_div = 414,
400 .temp_mult = 1,
401 .temp_div = 1,
402 .batt_tech = POWER_SUPPLY_TECHNOLOGY_LIPO,
403 .batt_name = "main-batt",
404};
405
406/******************************************************************************
407 * aSoC audio
408 ******************************************************************************/
409static struct palm27x_asoc_info palmld_asoc_pdata = {
410 .jack_gpio = GPIO_NR_PALMLD_EARPHONE_DETECT,
411};
412
413static pxa2xx_audio_ops_t palmld_ac97_pdata = {
414 .reset_gpio = 95,
415};
416
417static struct platform_device palmld_asoc = {
418 .name = "palm27x-asoc",
419 .id = -1,
420 .dev = {
421 .platform_data = &palmld_asoc_pdata,
422 },
423};
424 278
425/****************************************************************************** 279/******************************************************************************
426 * HDD 280 * HDD
427 ******************************************************************************/ 281 ******************************************************************************/
428static struct platform_device palmld_hdd = { 282#if defined(CONFIG_PATA_PALMLD) || defined(CONFIG_PATA_PALMLD_MODULE)
283static struct platform_device palmld_ide_device = {
429 .name = "pata_palmld", 284 .name = "pata_palmld",
430 .id = -1, 285 .id = -1,
431}; 286};
432 287
433/****************************************************************************** 288static void __init palmld_ide_init(void)
434 * Framebuffer
435 ******************************************************************************/
436static struct pxafb_mode_info palmld_lcd_modes[] = {
437{
438 .pixclock = 57692,
439 .xres = 320,
440 .yres = 480,
441 .bpp = 16,
442
443 .left_margin = 32,
444 .right_margin = 1,
445 .upper_margin = 7,
446 .lower_margin = 1,
447
448 .hsync_len = 4,
449 .vsync_len = 1,
450},
451};
452
453static struct pxafb_mach_info palmld_lcd_screen = {
454 .modes = palmld_lcd_modes,
455 .num_modes = ARRAY_SIZE(palmld_lcd_modes),
456 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
457};
458
459/******************************************************************************
460 * Power management - standby
461 ******************************************************************************/
462static void __init palmld_pm_init(void)
463{ 289{
464 static u32 resume[] = { 290 platform_device_register(&palmld_ide_device);
465 0xe3a00101, /* mov r0, #0x40000000 */
466 0xe380060f, /* orr r0, r0, #0x00f00000 */
467 0xe590f008, /* ldr pc, [r0, #0x08] */
468 };
469
470 /* copy the bootloader */
471 memcpy(phys_to_virt(PALMLD_STR_BASE), resume, sizeof(resume));
472} 291}
292#else
293static inline void palmld_ide_init(void) {}
294#endif
473 295
474/****************************************************************************** 296/******************************************************************************
475 * Machine init 297 * Machine init
476 ******************************************************************************/ 298 ******************************************************************************/
477static struct platform_device *devices[] __initdata = {
478#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
479 &palmld_pxa_keys,
480#endif
481 &palmld_backlight,
482 &palmld_leds,
483 &power_supply,
484 &palmld_asoc,
485 &palmld_hdd,
486 &palmld_flash,
487};
488
489static struct map_desc palmld_io_desc[] __initdata = { 299static struct map_desc palmld_io_desc[] __initdata = {
490{ 300{
491 .virtual = PALMLD_IDE_VIRT, 301 .virtual = PALMLD_IDE_VIRT,
@@ -510,20 +320,26 @@ static void __init palmld_map_io(void)
510static void __init palmld_init(void) 320static void __init palmld_init(void)
511{ 321{
512 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmld_pin_config)); 322 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmld_pin_config));
513
514 pxa_set_ffuart_info(NULL); 323 pxa_set_ffuart_info(NULL);
515 pxa_set_btuart_info(NULL); 324 pxa_set_btuart_info(NULL);
516 pxa_set_stuart_info(NULL); 325 pxa_set_stuart_info(NULL);
517 326
518 palmld_pm_init(); 327 palm27x_mmc_init(GPIO_NR_PALMLD_SD_DETECT_N, GPIO_NR_PALMLD_SD_READONLY,
519 set_pxa_fb_info(&palmld_lcd_screen); 328 GPIO_NR_PALMLD_SD_POWER, 0);
520 pxa_set_mci_info(&palmld_mci_platform_data); 329 palm27x_pm_init(PALMLD_STR_BASE);
521 pxa_set_ac97_info(&palmld_ac97_pdata); 330 palm27x_lcd_init(-1, &palm_320x480_lcd_mode);
522 pxa_set_ficp_info(&palmld_ficp_platform_data); 331 palm27x_irda_init(GPIO_NR_PALMLD_IR_DISABLE);
523 pxa_set_keypad_info(&palmld_keypad_platform_data); 332 palm27x_ac97_init(PALMLD_BAT_MIN_VOLTAGE, PALMLD_BAT_MAX_VOLTAGE,
524 wm97xx_bat_set_pdata(&wm97xx_batt_pdata); 333 GPIO_NR_PALMLD_EARPHONE_DETECT, 95);
525 334 palm27x_pwm_init(GPIO_NR_PALMLD_BL_POWER, GPIO_NR_PALMLD_LCD_POWER);
526 platform_add_devices(devices, ARRAY_SIZE(devices)); 335 palm27x_power_init(GPIO_NR_PALMLD_POWER_DETECT,
336 GPIO_NR_PALMLD_USB_DETECT_N);
337 palm27x_pmic_init();
338 palmld_kpc_init();
339 palmld_keys_init();
340 palmld_nor_init();
341 palmld_leds_init();
342 palmld_ide_init();
527} 343}
528 344
529MACHINE_START(PALMLD, "Palm LifeDrive") 345MACHINE_START(PALMLD, "Palm LifeDrive")
diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c
index 5e92d84fe50d..1c281995f658 100644
--- a/arch/arm/mach-pxa/palmt5.c
+++ b/arch/arm/mach-pxa/palmt5.c
@@ -25,7 +25,7 @@
25#include <linux/pda_power.h> 25#include <linux/pda_power.h>
26#include <linux/pwm_backlight.h> 26#include <linux/pwm_backlight.h>
27#include <linux/gpio.h> 27#include <linux/gpio.h>
28#include <linux/wm97xx_batt.h> 28#include <linux/wm97xx.h>
29#include <linux/power_supply.h> 29#include <linux/power_supply.h>
30#include <linux/usb/gpio_vbus.h> 30#include <linux/usb/gpio_vbus.h>
31 31
@@ -42,6 +42,7 @@
42#include <mach/pxa27x_keypad.h> 42#include <mach/pxa27x_keypad.h>
43#include <mach/udc.h> 43#include <mach/udc.h>
44#include <mach/palmasoc.h> 44#include <mach/palmasoc.h>
45#include <mach/palm27x.h>
45 46
46#include "generic.h" 47#include "generic.h"
47#include "devices.h" 48#include "devices.h"
@@ -104,19 +105,9 @@ static unsigned long palmt5_pin_config[] __initdata = {
104}; 105};
105 106
106/****************************************************************************** 107/******************************************************************************
107 * SD/MMC card controller
108 ******************************************************************************/
109static struct pxamci_platform_data palmt5_mci_platform_data = {
110 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
111 .gpio_card_detect = GPIO_NR_PALMT5_SD_DETECT_N,
112 .gpio_card_ro = GPIO_NR_PALMT5_SD_READONLY,
113 .gpio_power = GPIO_NR_PALMT5_SD_POWER,
114 .detect_delay_ms = 200,
115};
116
117/******************************************************************************
118 * GPIO keyboard 108 * GPIO keyboard
119 ******************************************************************************/ 109 ******************************************************************************/
110#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE)
120static unsigned int palmt5_matrix_keys[] = { 111static unsigned int palmt5_matrix_keys[] = {
121 KEY(0, 0, KEY_POWER), 112 KEY(0, 0, KEY_POWER),
122 KEY(0, 1, KEY_F1), 113 KEY(0, 1, KEY_F1),
@@ -142,9 +133,18 @@ static struct pxa27x_keypad_platform_data palmt5_keypad_platform_data = {
142 .debounce_interval = 30, 133 .debounce_interval = 30,
143}; 134};
144 135
136static void __init palmt5_kpc_init(void)
137{
138 pxa_set_keypad_info(&palmt5_keypad_platform_data);
139}
140#else
141static inline void palmt5_kpc_init(void) {}
142#endif
143
145/****************************************************************************** 144/******************************************************************************
146 * GPIO keys 145 * GPIO keys
147 ******************************************************************************/ 146 ******************************************************************************/
147#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
148static struct gpio_keys_button palmt5_pxa_buttons[] = { 148static struct gpio_keys_button palmt5_pxa_buttons[] = {
149 {KEY_F8, GPIO_NR_PALMT5_HOTSYNC_BUTTON_N, 1, "HotSync Button" }, 149 {KEY_F8, GPIO_NR_PALMT5_HOTSYNC_BUTTON_N, 1, "HotSync Button" },
150}; 150};
@@ -162,241 +162,17 @@ static struct platform_device palmt5_pxa_keys = {
162 }, 162 },
163}; 163};
164 164
165/****************************************************************************** 165static void __init palmt5_keys_init(void)
166 * Backlight
167 ******************************************************************************/
168static int palmt5_backlight_init(struct device *dev)
169{
170 int ret;
171
172 ret = gpio_request(GPIO_NR_PALMT5_BL_POWER, "BL POWER");
173 if (ret)
174 goto err;
175 ret = gpio_direction_output(GPIO_NR_PALMT5_BL_POWER, 0);
176 if (ret)
177 goto err2;
178 ret = gpio_request(GPIO_NR_PALMT5_LCD_POWER, "LCD POWER");
179 if (ret)
180 goto err2;
181 ret = gpio_direction_output(GPIO_NR_PALMT5_LCD_POWER, 0);
182 if (ret)
183 goto err3;
184
185 return 0;
186err3:
187 gpio_free(GPIO_NR_PALMT5_LCD_POWER);
188err2:
189 gpio_free(GPIO_NR_PALMT5_BL_POWER);
190err:
191 return ret;
192}
193
194static int palmt5_backlight_notify(struct device *dev, int brightness)
195{
196 gpio_set_value(GPIO_NR_PALMT5_BL_POWER, brightness);
197 gpio_set_value(GPIO_NR_PALMT5_LCD_POWER, brightness);
198 return brightness;
199}
200
201static void palmt5_backlight_exit(struct device *dev)
202{
203 gpio_free(GPIO_NR_PALMT5_BL_POWER);
204 gpio_free(GPIO_NR_PALMT5_LCD_POWER);
205}
206
207static struct platform_pwm_backlight_data palmt5_backlight_data = {
208 .pwm_id = 0,
209 .max_brightness = PALMT5_MAX_INTENSITY,
210 .dft_brightness = PALMT5_MAX_INTENSITY,
211 .pwm_period_ns = PALMT5_PERIOD_NS,
212 .init = palmt5_backlight_init,
213 .notify = palmt5_backlight_notify,
214 .exit = palmt5_backlight_exit,
215};
216
217static struct platform_device palmt5_backlight = {
218 .name = "pwm-backlight",
219 .dev = {
220 .parent = &pxa27x_device_pwm0.dev,
221 .platform_data = &palmt5_backlight_data,
222 },
223};
224
225/******************************************************************************
226 * IrDA
227 ******************************************************************************/
228static struct pxaficp_platform_data palmt5_ficp_platform_data = {
229 .gpio_pwdown = GPIO_NR_PALMT5_IR_DISABLE,
230 .transceiver_cap = IR_SIRMODE | IR_OFF,
231};
232
233/******************************************************************************
234 * UDC
235 ******************************************************************************/
236static struct gpio_vbus_mach_info palmt5_udc_info = {
237 .gpio_vbus = GPIO_NR_PALMT5_USB_DETECT_N,
238 .gpio_vbus_inverted = 1,
239 .gpio_pullup = GPIO_NR_PALMT5_USB_PULLUP,
240};
241
242static struct platform_device palmt5_gpio_vbus = {
243 .name = "gpio-vbus",
244 .id = -1,
245 .dev = {
246 .platform_data = &palmt5_udc_info,
247 },
248};
249
250/******************************************************************************
251 * Power supply
252 ******************************************************************************/
253static int power_supply_init(struct device *dev)
254{
255 int ret;
256
257 ret = gpio_request(GPIO_NR_PALMT5_POWER_DETECT, "CABLE_STATE_AC");
258 if (ret)
259 goto err1;
260 ret = gpio_direction_input(GPIO_NR_PALMT5_POWER_DETECT);
261 if (ret)
262 goto err2;
263
264 return 0;
265err2:
266 gpio_free(GPIO_NR_PALMT5_POWER_DETECT);
267err1:
268 return ret;
269}
270
271static int palmt5_is_ac_online(void)
272{
273 return gpio_get_value(GPIO_NR_PALMT5_POWER_DETECT);
274}
275
276static void power_supply_exit(struct device *dev)
277{
278 gpio_free(GPIO_NR_PALMT5_POWER_DETECT);
279}
280
281static char *palmt5_supplicants[] = {
282 "main-battery",
283};
284
285static struct pda_power_pdata power_supply_info = {
286 .init = power_supply_init,
287 .is_ac_online = palmt5_is_ac_online,
288 .exit = power_supply_exit,
289 .supplied_to = palmt5_supplicants,
290 .num_supplicants = ARRAY_SIZE(palmt5_supplicants),
291};
292
293static struct platform_device power_supply = {
294 .name = "pda-power",
295 .id = -1,
296 .dev = {
297 .platform_data = &power_supply_info,
298 },
299};
300
301/******************************************************************************
302 * WM97xx battery
303 ******************************************************************************/
304static struct wm97xx_batt_info wm97xx_batt_pdata = {
305 .batt_aux = WM97XX_AUX_ID3,
306 .temp_aux = WM97XX_AUX_ID2,
307 .charge_gpio = -1,
308 .max_voltage = PALMT5_BAT_MAX_VOLTAGE,
309 .min_voltage = PALMT5_BAT_MIN_VOLTAGE,
310 .batt_mult = 1000,
311 .batt_div = 414,
312 .temp_mult = 1,
313 .temp_div = 1,
314 .batt_tech = POWER_SUPPLY_TECHNOLOGY_LIPO,
315 .batt_name = "main-batt",
316};
317
318/******************************************************************************
319 * aSoC audio
320 ******************************************************************************/
321static struct palm27x_asoc_info palmt5_asoc_pdata = {
322 .jack_gpio = GPIO_NR_PALMT5_EARPHONE_DETECT,
323};
324
325static pxa2xx_audio_ops_t palmt5_ac97_pdata = {
326 .reset_gpio = 95,
327};
328
329static struct platform_device palmt5_asoc = {
330 .name = "palm27x-asoc",
331 .id = -1,
332 .dev = {
333 .platform_data = &palmt5_asoc_pdata,
334 },
335};
336
337/******************************************************************************
338 * Framebuffer
339 ******************************************************************************/
340static struct pxafb_mode_info palmt5_lcd_modes[] = {
341{
342 .pixclock = 57692,
343 .xres = 320,
344 .yres = 480,
345 .bpp = 16,
346
347 .left_margin = 32,
348 .right_margin = 1,
349 .upper_margin = 7,
350 .lower_margin = 1,
351
352 .hsync_len = 4,
353 .vsync_len = 1,
354},
355};
356
357static struct pxafb_mach_info palmt5_lcd_screen = {
358 .modes = palmt5_lcd_modes,
359 .num_modes = ARRAY_SIZE(palmt5_lcd_modes),
360 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
361};
362
363/******************************************************************************
364 * Power management - standby
365 ******************************************************************************/
366static void __init palmt5_pm_init(void)
367{ 166{
368 static u32 resume[] = { 167 platform_device_register(&palmt5_pxa_keys);
369 0xe3a00101, /* mov r0, #0x40000000 */
370 0xe380060f, /* orr r0, r0, #0x00f00000 */
371 0xe590f008, /* ldr pc, [r0, #0x08] */
372 };
373
374 /* copy the bootloader */
375 memcpy(phys_to_virt(PALMT5_STR_BASE), resume, sizeof(resume));
376} 168}
169#else
170static inline void palmt5_keys_init(void) {}
171#endif
377 172
378/****************************************************************************** 173/******************************************************************************
379 * Machine init 174 * Machine init
380 ******************************************************************************/ 175 ******************************************************************************/
381static struct platform_device *devices[] __initdata = {
382#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
383 &palmt5_pxa_keys,
384#endif
385 &palmt5_backlight,
386 &power_supply,
387 &palmt5_asoc,
388 &palmt5_gpio_vbus,
389};
390
391/* setup udc GPIOs initial state */
392static void __init palmt5_udc_init(void)
393{
394 if (!gpio_request(GPIO_NR_PALMT5_USB_PULLUP, "UDC Vbus")) {
395 gpio_direction_output(GPIO_NR_PALMT5_USB_PULLUP, 1);
396 gpio_free(GPIO_NR_PALMT5_USB_PULLUP);
397 }
398}
399
400static void __init palmt5_reserve(void) 176static void __init palmt5_reserve(void)
401{ 177{
402 memblock_reserve(0xa0200000, 0x1000); 178 memblock_reserve(0xa0200000, 0x1000);
@@ -405,21 +181,24 @@ static void __init palmt5_reserve(void)
405static void __init palmt5_init(void) 181static void __init palmt5_init(void)
406{ 182{
407 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmt5_pin_config)); 183 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmt5_pin_config));
408
409 pxa_set_ffuart_info(NULL); 184 pxa_set_ffuart_info(NULL);
410 pxa_set_btuart_info(NULL); 185 pxa_set_btuart_info(NULL);
411 pxa_set_stuart_info(NULL); 186 pxa_set_stuart_info(NULL);
412 187
413 palmt5_pm_init(); 188 palm27x_mmc_init(GPIO_NR_PALMT5_SD_DETECT_N, GPIO_NR_PALMT5_SD_READONLY,
414 set_pxa_fb_info(&palmt5_lcd_screen); 189 GPIO_NR_PALMT5_SD_POWER, 0);
415 pxa_set_mci_info(&palmt5_mci_platform_data); 190 palm27x_pm_init(PALMT5_STR_BASE);
416 palmt5_udc_init(); 191 palm27x_lcd_init(-1, &palm_320x480_lcd_mode);
417 pxa_set_ac97_info(&palmt5_ac97_pdata); 192 palm27x_udc_init(GPIO_NR_PALMT5_USB_DETECT_N,
418 pxa_set_ficp_info(&palmt5_ficp_platform_data); 193 GPIO_NR_PALMT5_USB_PULLUP, 1);
419 pxa_set_keypad_info(&palmt5_keypad_platform_data); 194 palm27x_irda_init(GPIO_NR_PALMT5_IR_DISABLE);
420 wm97xx_bat_set_pdata(&wm97xx_batt_pdata); 195 palm27x_ac97_init(PALMT5_BAT_MIN_VOLTAGE, PALMT5_BAT_MAX_VOLTAGE,
421 196 GPIO_NR_PALMT5_EARPHONE_DETECT, 95);
422 platform_add_devices(devices, ARRAY_SIZE(devices)); 197 palm27x_pwm_init(GPIO_NR_PALMT5_BL_POWER, GPIO_NR_PALMT5_LCD_POWER);
198 palm27x_power_init(GPIO_NR_PALMT5_POWER_DETECT, -1);
199 palm27x_pmic_init();
200 palmt5_kpc_init();
201 palmt5_keys_init();
423} 202}
424 203
425MACHINE_START(PALMT5, "Palm Tungsten|T5") 204MACHINE_START(PALMT5, "Palm Tungsten|T5")
diff --git a/arch/arm/mach-pxa/palmte2.c b/arch/arm/mach-pxa/palmte2.c
index 3d284ff1a64e..93c11a0438d5 100644
--- a/arch/arm/mach-pxa/palmte2.c
+++ b/arch/arm/mach-pxa/palmte2.c
@@ -23,7 +23,7 @@
23#include <linux/pda_power.h> 23#include <linux/pda_power.h>
24#include <linux/pwm_backlight.h> 24#include <linux/pwm_backlight.h>
25#include <linux/gpio.h> 25#include <linux/gpio.h>
26#include <linux/wm97xx_batt.h> 26#include <linux/wm97xx.h>
27#include <linux/power_supply.h> 27#include <linux/power_supply.h>
28#include <linux/usb/gpio_vbus.h> 28#include <linux/usb/gpio_vbus.h>
29 29
@@ -271,9 +271,9 @@ static struct platform_device power_supply = {
271}; 271};
272 272
273/****************************************************************************** 273/******************************************************************************
274 * WM97xx battery 274 * WM97xx audio, battery
275 ******************************************************************************/ 275 ******************************************************************************/
276static struct wm97xx_batt_info wm97xx_batt_pdata = { 276static struct wm97xx_batt_pdata palmte2_batt_pdata = {
277 .batt_aux = WM97XX_AUX_ID3, 277 .batt_aux = WM97XX_AUX_ID3,
278 .temp_aux = WM97XX_AUX_ID2, 278 .temp_aux = WM97XX_AUX_ID2,
279 .charge_gpio = -1, 279 .charge_gpio = -1,
@@ -287,9 +287,14 @@ static struct wm97xx_batt_info wm97xx_batt_pdata = {
287 .batt_name = "main-batt", 287 .batt_name = "main-batt",
288}; 288};
289 289
290/****************************************************************************** 290static struct wm97xx_pdata palmte2_wm97xx_pdata = {
291 * aSoC audio 291 .batt_pdata = &palmte2_batt_pdata,
292 ******************************************************************************/ 292};
293
294static pxa2xx_audio_ops_t palmte2_ac97_pdata = {
295 .codec_pdata = { &palmte2_wm97xx_pdata, },
296};
297
293static struct palm27x_asoc_info palmte2_asoc_pdata = { 298static struct palm27x_asoc_info palmte2_asoc_pdata = {
294 .jack_gpio = GPIO_NR_PALMTE2_EARPHONE_DETECT, 299 .jack_gpio = GPIO_NR_PALMTE2_EARPHONE_DETECT,
295}; 300};
@@ -361,9 +366,8 @@ static void __init palmte2_init(void)
361 set_pxa_fb_info(&palmte2_lcd_screen); 366 set_pxa_fb_info(&palmte2_lcd_screen);
362 pxa_set_mci_info(&palmte2_mci_platform_data); 367 pxa_set_mci_info(&palmte2_mci_platform_data);
363 palmte2_udc_init(); 368 palmte2_udc_init();
364 pxa_set_ac97_info(NULL); 369 pxa_set_ac97_info(&palmte2_ac97_pdata);
365 pxa_set_ficp_info(&palmte2_ficp_platform_data); 370 pxa_set_ficp_info(&palmte2_ficp_platform_data);
366 wm97xx_bat_set_pdata(&wm97xx_batt_pdata);
367 371
368 platform_add_devices(devices, ARRAY_SIZE(devices)); 372 platform_add_devices(devices, ARRAY_SIZE(devices));
369} 373}
diff --git a/arch/arm/mach-pxa/palmtreo.c b/arch/arm/mach-pxa/palmtreo.c
index 3d0c9cc2a406..52defd5e42e5 100644
--- a/arch/arm/mach-pxa/palmtreo.c
+++ b/arch/arm/mach-pxa/palmtreo.c
@@ -24,7 +24,6 @@
24#include <linux/pda_power.h> 24#include <linux/pda_power.h>
25#include <linux/pwm_backlight.h> 25#include <linux/pwm_backlight.h>
26#include <linux/gpio.h> 26#include <linux/gpio.h>
27#include <linux/wm97xx_batt.h>
28#include <linux/power_supply.h> 27#include <linux/power_supply.h>
29#include <linux/sysdev.h> 28#include <linux/sysdev.h>
30#include <linux/w1-gpio.h> 29#include <linux/w1-gpio.h>
@@ -46,6 +45,7 @@
46#include <mach/pxa2xx-regs.h> 45#include <mach/pxa2xx-regs.h>
47#include <mach/palmasoc.h> 46#include <mach/palmasoc.h>
48#include <mach/camera.h> 47#include <mach/camera.h>
48#include <mach/palm27x.h>
49 49
50#include <sound/pxa2xx-lib.h> 50#include <sound/pxa2xx-lib.h>
51 51
@@ -160,31 +160,9 @@ static unsigned long centro685_pin_config[] __initdata = {
160#endif /* CONFIG_MACH_CENTRO */ 160#endif /* CONFIG_MACH_CENTRO */
161 161
162/****************************************************************************** 162/******************************************************************************
163 * SD/MMC card controller
164 ******************************************************************************/
165#ifdef CONFIG_MACH_TREO680
166static struct pxamci_platform_data treo680_mci_platform_data = {
167 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
168 .gpio_card_detect = GPIO_NR_TREO_SD_DETECT_N,
169 .gpio_card_ro = GPIO_NR_TREO680_SD_READONLY,
170 .gpio_power = GPIO_NR_TREO680_SD_POWER,
171};
172#endif /* CONFIG_MACH_TREO680 */
173
174#ifdef CONFIG_MACH_CENTRO
175static struct pxamci_platform_data centro_mci_platform_data = {
176 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
177 .gpio_card_detect = GPIO_NR_TREO_SD_DETECT_N,
178 .gpio_card_ro = -1,
179 .gpio_power = GPIO_NR_CENTRO_SD_POWER,
180 .gpio_power_invert = 1,
181};
182#endif /* CONFIG_MACH_CENTRO */
183
184/******************************************************************************
185 * GPIO keyboard 163 * GPIO keyboard
186 ******************************************************************************/ 164 ******************************************************************************/
187#ifdef CONFIG_MACH_TREO680 165#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE)
188static unsigned int treo680_matrix_keys[] = { 166static unsigned int treo680_matrix_keys[] = {
189 KEY(0, 0, KEY_F8), /* Red/Off/Power */ 167 KEY(0, 0, KEY_F8), /* Red/Off/Power */
190 KEY(0, 1, KEY_LEFT), 168 KEY(0, 1, KEY_LEFT),
@@ -244,19 +222,6 @@ static unsigned int treo680_matrix_keys[] = {
244 KEY(7, 5, KEY_I), 222 KEY(7, 5, KEY_I),
245}; 223};
246 224
247static struct pxa27x_keypad_platform_data treo680_keypad_platform_data = {
248 .matrix_key_rows = 8,
249 .matrix_key_cols = 7,
250 .matrix_key_map = treo680_matrix_keys,
251 .matrix_key_map_size = ARRAY_SIZE(treo680_matrix_keys),
252 .direct_key_map = { KEY_CONNECT },
253 .direct_key_num = 1,
254
255 .debounce_interval = 30,
256};
257#endif /* CONFIG_MACH_TREO680 */
258
259#ifdef CONFIG_MACH_CENTRO
260static unsigned int centro_matrix_keys[] = { 225static unsigned int centro_matrix_keys[] = {
261 KEY(0, 0, KEY_F9), /* Home */ 226 KEY(0, 0, KEY_F9), /* Home */
262 KEY(0, 1, KEY_LEFT), 227 KEY(0, 1, KEY_LEFT),
@@ -316,157 +281,50 @@ static unsigned int centro_matrix_keys[] = {
316 KEY(7, 5, KEY_I), 281 KEY(7, 5, KEY_I),
317}; 282};
318 283
319static struct pxa27x_keypad_platform_data centro_keypad_platform_data = { 284static struct pxa27x_keypad_platform_data treo680_keypad_pdata = {
320 .matrix_key_rows = 8, 285 .matrix_key_rows = 8,
321 .matrix_key_cols = 7, 286 .matrix_key_cols = 7,
322 .matrix_key_map = centro_matrix_keys, 287 .matrix_key_map = treo680_matrix_keys,
323 .matrix_key_map_size = ARRAY_SIZE(centro_matrix_keys), 288 .matrix_key_map_size = ARRAY_SIZE(treo680_matrix_keys),
324 .direct_key_map = { KEY_CONNECT }, 289 .direct_key_map = { KEY_CONNECT },
325 .direct_key_num = 1, 290 .direct_key_num = 1,
326 291
327 .debounce_interval = 30, 292 .debounce_interval = 30,
328}; 293};
329#endif /* CONFIG_MACH_CENTRO */
330 294
331/****************************************************************************** 295static void __init palmtreo_kpc_init(void)
332 * aSoC audio
333 ******************************************************************************/
334
335static pxa2xx_audio_ops_t treo_ac97_pdata = {
336 .reset_gpio = 95,
337};
338
339/******************************************************************************
340 * Backlight
341 ******************************************************************************/
342static int treo_backlight_init(struct device *dev)
343{ 296{
344 int ret; 297 static struct pxa27x_keypad_platform_data *data = &treo680_keypad_pdata;
345
346 ret = gpio_request(GPIO_NR_TREO_BL_POWER, "BL POWER");
347 if (ret)
348 goto err;
349 ret = gpio_direction_output(GPIO_NR_TREO_BL_POWER, 0);
350 if (ret)
351 goto err2;
352
353 return 0;
354 298
355err2: 299 if (machine_is_centro()) {
356 gpio_free(GPIO_NR_TREO_BL_POWER); 300 data->matrix_key_map = centro_matrix_keys;
357err: 301 data->matrix_key_map_size = ARRAY_SIZE(centro_matrix_keys);
358 return ret; 302 }
359}
360
361static int treo_backlight_notify(struct device *dev, int brightness)
362{
363 gpio_set_value(GPIO_NR_TREO_BL_POWER, brightness);
364 return TREO_MAX_INTENSITY - brightness;
365};
366 303
367static void treo_backlight_exit(struct device *dev) 304 pxa_set_keypad_info(&treo680_keypad_pdata);
368{
369 gpio_free(GPIO_NR_TREO_BL_POWER);
370} 305}
371 306#else
372static struct platform_pwm_backlight_data treo_backlight_data = { 307static inline void palmtreo_kpc_init(void) {}
373 .pwm_id = 0, 308#endif
374 .max_brightness = TREO_MAX_INTENSITY,
375 .dft_brightness = TREO_DEFAULT_INTENSITY,
376 .pwm_period_ns = TREO_PERIOD_NS,
377 .init = treo_backlight_init,
378 .notify = treo_backlight_notify,
379 .exit = treo_backlight_exit,
380};
381
382static struct platform_device treo_backlight = {
383 .name = "pwm-backlight",
384 .dev = {
385 .parent = &pxa27x_device_pwm0.dev,
386 .platform_data = &treo_backlight_data,
387 },
388};
389
390/******************************************************************************
391 * IrDA
392 ******************************************************************************/
393static struct pxaficp_platform_data treo_ficp_info = {
394 .gpio_pwdown = GPIO_NR_TREO_IR_EN,
395 .transceiver_cap = IR_SIRMODE | IR_OFF,
396};
397
398/******************************************************************************
399 * UDC
400 ******************************************************************************/
401static struct pxa2xx_udc_mach_info treo_udc_info __initdata = {
402 .gpio_vbus = GPIO_NR_TREO_USB_DETECT,
403 .gpio_vbus_inverted = 1,
404 .gpio_pullup = GPIO_NR_TREO_USB_PULLUP,
405};
406
407 309
408/****************************************************************************** 310/******************************************************************************
409 * USB host 311 * USB host
410 ******************************************************************************/ 312 ******************************************************************************/
411#ifdef CONFIG_MACH_TREO680 313#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
412static struct pxaohci_platform_data treo680_ohci_info = { 314static struct pxaohci_platform_data treo680_ohci_info = {
413 .port_mode = PMM_PERPORT_MODE, 315 .port_mode = PMM_PERPORT_MODE,
414 .flags = ENABLE_PORT1 | ENABLE_PORT3, 316 .flags = ENABLE_PORT1 | ENABLE_PORT3,
415 .power_budget = 0, 317 .power_budget = 0,
416}; 318};
417#endif /* CONFIG_MACH_TREO680 */
418 319
419/****************************************************************************** 320static void __init palmtreo_uhc_init(void)
420 * Power supply
421 ******************************************************************************/
422static int power_supply_init(struct device *dev)
423{ 321{
424 int ret; 322 if (machine_is_treo680())
425 323 pxa_set_ohci_info(&treo680_ohci_info);
426 ret = gpio_request(GPIO_NR_TREO_POWER_DETECT, "CABLE_STATE_AC");
427 if (ret)
428 goto err1;
429 ret = gpio_direction_input(GPIO_NR_TREO_POWER_DETECT);
430 if (ret)
431 goto err2;
432
433 return 0;
434
435err2:
436 gpio_free(GPIO_NR_TREO_POWER_DETECT);
437err1:
438 return ret;
439}
440
441static int treo_is_ac_online(void)
442{
443 return gpio_get_value(GPIO_NR_TREO_POWER_DETECT);
444} 324}
445 325#else
446static void power_supply_exit(struct device *dev) 326static inline void palmtreo_uhc_init(void) {}
447{ 327#endif
448 gpio_free(GPIO_NR_TREO_POWER_DETECT);
449}
450
451static char *treo_supplicants[] = {
452 "main-battery",
453};
454
455static struct pda_power_pdata power_supply_info = {
456 .init = power_supply_init,
457 .is_ac_online = treo_is_ac_online,
458 .exit = power_supply_exit,
459 .supplied_to = treo_supplicants,
460 .num_supplicants = ARRAY_SIZE(treo_supplicants),
461};
462
463static struct platform_device power_supply = {
464 .name = "pda-power",
465 .id = -1,
466 .dev = {
467 .platform_data = &power_supply_info,
468 },
469};
470 328
471/****************************************************************************** 329/******************************************************************************
472 * Vibra and LEDs 330 * Vibra and LEDs
@@ -495,16 +353,6 @@ static struct gpio_led_platform_data treo680_gpio_led_info = {
495 .num_leds = ARRAY_SIZE(treo680_gpio_leds), 353 .num_leds = ARRAY_SIZE(treo680_gpio_leds),
496}; 354};
497 355
498static struct platform_device treo680_leds = {
499 .name = "leds-gpio",
500 .id = -1,
501 .dev = {
502 .platform_data = &treo680_gpio_led_info,
503 }
504};
505#endif /* CONFIG_MACH_TREO680 */
506
507#ifdef CONFIG_MACH_CENTRO
508static struct gpio_led centro_gpio_leds[] = { 356static struct gpio_led centro_gpio_leds[] = {
509 { 357 {
510 .name = "centro:vibra:vibra", 358 .name = "centro:vibra:vibra",
@@ -529,145 +377,67 @@ static struct gpio_led_platform_data centro_gpio_led_info = {
529 .num_leds = ARRAY_SIZE(centro_gpio_leds), 377 .num_leds = ARRAY_SIZE(centro_gpio_leds),
530}; 378};
531 379
532static struct platform_device centro_leds = { 380static struct platform_device palmtreo_leds = {
533 .name = "leds-gpio", 381 .name = "leds-gpio",
534 .id = -1, 382 .id = -1,
535 .dev = { 383 .dev = {
536 .platform_data = &centro_gpio_led_info, 384 .platform_data = &treo680_gpio_led_info,
537 } 385 }
538}; 386};
539#endif /* CONFIG_MACH_CENTRO */
540
541/******************************************************************************
542 * Framebuffer
543 ******************************************************************************/
544/* TODO: add support for 324x324 */
545static struct pxafb_mode_info treo_lcd_modes[] = {
546{
547 .pixclock = 86538,
548 .xres = 320,
549 .yres = 320,
550 .bpp = 16,
551
552 .left_margin = 20,
553 .right_margin = 8,
554 .upper_margin = 8,
555 .lower_margin = 5,
556
557 .hsync_len = 4,
558 .vsync_len = 1,
559},
560};
561 387
562static void treo_lcd_power(int on, struct fb_var_screeninfo *info) 388static void __init palmtreo_leds_init(void)
563{ 389{
564 gpio_set_value(GPIO_NR_TREO_BL_POWER, on); 390 if (machine_is_centro())
565} 391 palmtreo_leds.dev.platform_data = &centro_gpio_led_info;
566
567static struct pxafb_mach_info treo_lcd_screen = {
568 .modes = treo_lcd_modes,
569 .num_modes = ARRAY_SIZE(treo_lcd_modes),
570 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
571};
572 392
573/****************************************************************************** 393 platform_device_register(&palmtreo_leds);
574 * Power management - standby
575 ******************************************************************************/
576static void __init treo_pm_init(void)
577{
578 static u32 resume[] = {
579 0xe3a00101, /* mov r0, #0x40000000 */
580 0xe380060f, /* orr r0, r0, #0x00f00000 */
581 0xe590f008, /* ldr pc, [r0, #0x08] */
582 };
583
584 /* this is where the bootloader jumps */
585 memcpy(phys_to_virt(TREO_STR_BASE), resume, sizeof(resume));
586} 394}
395#else
396static inline void palmtreo_leds_init(void) {}
397#endif
587 398
588/****************************************************************************** 399/******************************************************************************
589 * Machine init 400 * Machine init
590 ******************************************************************************/ 401 ******************************************************************************/
591static struct platform_device *treo_devices[] __initdata = {
592 &treo_backlight,
593 &power_supply,
594};
595
596#ifdef CONFIG_MACH_TREO680
597static struct platform_device *treo680_devices[] __initdata = {
598 &treo680_leds,
599};
600#endif /* CONFIG_MACH_TREO680 */
601
602#ifdef CONFIG_MACH_CENTRO
603static struct platform_device *centro_devices[] __initdata = {
604 &centro_leds,
605};
606#endif /* CONFIG_MACH_CENTRO */
607
608/* setup udc GPIOs initial state */
609static void __init treo_udc_init(void)
610{
611 if (!gpio_request(GPIO_NR_TREO_USB_PULLUP, "UDC Vbus")) {
612 gpio_direction_output(GPIO_NR_TREO_USB_PULLUP, 1);
613 gpio_free(GPIO_NR_TREO_USB_PULLUP);
614 }
615}
616
617static void __init treo_lcd_power_init(void)
618{
619 int ret;
620
621 ret = gpio_request(GPIO_NR_TREO_LCD_POWER, "LCD POWER");
622 if (ret) {
623 pr_err("Treo680: LCD power GPIO request failed!\n");
624 return;
625 }
626
627 ret = gpio_direction_output(GPIO_NR_TREO_LCD_POWER, 0);
628 if (ret) {
629 pr_err("Treo680: setting LCD power GPIO direction failed!\n");
630 gpio_free(GPIO_NR_TREO_LCD_POWER);
631 return;
632 }
633
634 treo_lcd_screen.pxafb_lcd_power = treo_lcd_power;
635}
636
637static void __init treo_reserve(void) 402static void __init treo_reserve(void)
638{ 403{
639 memblock_reserve(0xa0000000, 0x1000); 404 memblock_reserve(0xa0000000, 0x1000);
640 memblock_reserve(0xa2000000, 0x1000); 405 memblock_reserve(0xa2000000, 0x1000);
641} 406}
642 407
643static void __init treo_init(void) 408static void __init palmphone_common_init(void)
644{ 409{
410 pxa2xx_mfp_config(ARRAY_AND_SIZE(treo_pin_config));
645 pxa_set_ffuart_info(NULL); 411 pxa_set_ffuart_info(NULL);
646 pxa_set_btuart_info(NULL); 412 pxa_set_btuart_info(NULL);
647 pxa_set_stuart_info(NULL); 413 pxa_set_stuart_info(NULL);
648 414 palm27x_pm_init(TREO_STR_BASE);
649 treo_pm_init(); 415 palm27x_lcd_init(GPIO_NR_TREO_BL_POWER, &palm_320x320_new_lcd_mode);
650 pxa2xx_mfp_config(ARRAY_AND_SIZE(treo_pin_config)); 416 palm27x_udc_init(GPIO_NR_TREO_USB_DETECT, GPIO_NR_TREO_USB_PULLUP, 1);
651 treo_lcd_power_init(); 417 palm27x_irda_init(GPIO_NR_TREO_IR_EN);
652 set_pxa_fb_info(&treo_lcd_screen); 418 palm27x_ac97_init(-1, -1, -1, 95);
653 treo_udc_init(); 419 palm27x_pwm_init(GPIO_NR_TREO_BL_POWER, -1);
654 pxa_set_udc_info(&treo_udc_info); 420 palm27x_power_init(GPIO_NR_TREO_POWER_DETECT, -1);
655 pxa_set_ac97_info(&treo_ac97_pdata); 421 palm27x_pmic_init();
656 pxa_set_ficp_info(&treo_ficp_info); 422 palmtreo_kpc_init();
657 423 palmtreo_uhc_init();
658 platform_add_devices(ARRAY_AND_SIZE(treo_devices)); 424 palmtreo_leds_init();
659} 425}
660 426
661#ifdef CONFIG_MACH_TREO680
662static void __init treo680_init(void) 427static void __init treo680_init(void)
663{ 428{
664 treo_init();
665 pxa2xx_mfp_config(ARRAY_AND_SIZE(treo680_pin_config)); 429 pxa2xx_mfp_config(ARRAY_AND_SIZE(treo680_pin_config));
666 pxa_set_mci_info(&treo680_mci_platform_data); 430 palmphone_common_init();
667 pxa_set_keypad_info(&treo680_keypad_platform_data); 431 palm27x_mmc_init(GPIO_NR_TREO_SD_DETECT_N, GPIO_NR_TREO680_SD_READONLY,
668 pxa_set_ohci_info(&treo680_ohci_info); 432 GPIO_NR_TREO680_SD_POWER, 0);
433}
669 434
670 platform_add_devices(ARRAY_AND_SIZE(treo680_devices)); 435static void __init centro_init(void)
436{
437 pxa2xx_mfp_config(ARRAY_AND_SIZE(centro685_pin_config));
438 palmphone_common_init();
439 palm27x_mmc_init(GPIO_NR_TREO_SD_DETECT_N, -1,
440 GPIO_NR_CENTRO_SD_POWER, 1);
671} 441}
672 442
673MACHINE_START(TREO680, "Palm Treo 680") 443MACHINE_START(TREO680, "Palm Treo 680")
@@ -680,19 +450,6 @@ MACHINE_START(TREO680, "Palm Treo 680")
680 .timer = &pxa_timer, 450 .timer = &pxa_timer,
681 .init_machine = treo680_init, 451 .init_machine = treo680_init,
682MACHINE_END 452MACHINE_END
683#endif /* CONFIG_MACH_TREO680 */
684
685#ifdef CONFIG_MACH_CENTRO
686static void __init centro_init(void)
687{
688 treo_init();
689 pxa2xx_mfp_config(ARRAY_AND_SIZE(centro685_pin_config));
690 pxa_set_mci_info(&centro_mci_platform_data);
691
692 pxa_set_keypad_info(&centro_keypad_platform_data);
693
694 platform_add_devices(ARRAY_AND_SIZE(centro_devices));
695}
696 453
697MACHINE_START(CENTRO, "Palm Centro 685") 454MACHINE_START(CENTRO, "Palm Centro 685")
698 .phys_io = TREO_PHYS_IO_START, 455 .phys_io = TREO_PHYS_IO_START,
@@ -702,6 +459,5 @@ MACHINE_START(CENTRO, "Palm Centro 685")
702 .reserve = treo_reserve, 459 .reserve = treo_reserve,
703 .init_irq = pxa27x_init_irq, 460 .init_irq = pxa27x_init_irq,
704 .timer = &pxa_timer, 461 .timer = &pxa_timer,
705 .init_machine = centro_init, 462 .init_machine = centro_init,
706MACHINE_END 463MACHINE_END
707#endif /* CONFIG_MACH_CENTRO */
diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c
index ecc1a401598e..144dc2b6911f 100644
--- a/arch/arm/mach-pxa/palmtx.c
+++ b/arch/arm/mach-pxa/palmtx.c
@@ -25,7 +25,7 @@
25#include <linux/pda_power.h> 25#include <linux/pda_power.h>
26#include <linux/pwm_backlight.h> 26#include <linux/pwm_backlight.h>
27#include <linux/gpio.h> 27#include <linux/gpio.h>
28#include <linux/wm97xx_batt.h> 28#include <linux/wm97xx.h>
29#include <linux/power_supply.h> 29#include <linux/power_supply.h>
30#include <linux/usb/gpio_vbus.h> 30#include <linux/usb/gpio_vbus.h>
31#include <linux/mtd/nand.h> 31#include <linux/mtd/nand.h>
@@ -46,6 +46,7 @@
46#include <mach/pxa27x_keypad.h> 46#include <mach/pxa27x_keypad.h>
47#include <mach/udc.h> 47#include <mach/udc.h>
48#include <mach/palmasoc.h> 48#include <mach/palmasoc.h>
49#include <mach/palm27x.h>
49 50
50#include "generic.h" 51#include "generic.h"
51#include "devices.h" 52#include "devices.h"
@@ -129,6 +130,7 @@ static unsigned long palmtx_pin_config[] __initdata = {
129/****************************************************************************** 130/******************************************************************************
130 * NOR Flash 131 * NOR Flash
131 ******************************************************************************/ 132 ******************************************************************************/
133#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
132static struct mtd_partition palmtx_partitions[] = { 134static struct mtd_partition palmtx_partitions[] = {
133 { 135 {
134 .name = "Flash", 136 .name = "Flash",
@@ -162,20 +164,18 @@ static struct platform_device palmtx_flash = {
162 }, 164 },
163}; 165};
164 166
165/****************************************************************************** 167static void __init palmtx_nor_init(void)
166 * SD/MMC card controller 168{
167 ******************************************************************************/ 169 platform_device_register(&palmtx_flash);
168static struct pxamci_platform_data palmtx_mci_platform_data = { 170}
169 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, 171#else
170 .gpio_card_detect = GPIO_NR_PALMTX_SD_DETECT_N, 172static inline void palmtx_nor_init(void) {}
171 .gpio_card_ro = GPIO_NR_PALMTX_SD_READONLY, 173#endif
172 .gpio_power = GPIO_NR_PALMTX_SD_POWER,
173 .detect_delay_ms = 200,
174};
175 174
176/****************************************************************************** 175/******************************************************************************
177 * GPIO keyboard 176 * GPIO keyboard
178 ******************************************************************************/ 177 ******************************************************************************/
178#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE)
179static unsigned int palmtx_matrix_keys[] = { 179static unsigned int palmtx_matrix_keys[] = {
180 KEY(0, 0, KEY_POWER), 180 KEY(0, 0, KEY_POWER),
181 KEY(0, 1, KEY_F1), 181 KEY(0, 1, KEY_F1),
@@ -201,9 +201,18 @@ static struct pxa27x_keypad_platform_data palmtx_keypad_platform_data = {
201 .debounce_interval = 30, 201 .debounce_interval = 30,
202}; 202};
203 203
204static void __init palmtx_kpc_init(void)
205{
206 pxa_set_keypad_info(&palmtx_keypad_platform_data);
207}
208#else
209static inline void palmtx_kpc_init(void) {}
210#endif
211
204/****************************************************************************** 212/******************************************************************************
205 * GPIO keys 213 * GPIO keys
206 ******************************************************************************/ 214 ******************************************************************************/
215#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
207static struct gpio_keys_button palmtx_pxa_buttons[] = { 216static struct gpio_keys_button palmtx_pxa_buttons[] = {
208 {KEY_F8, GPIO_NR_PALMTX_HOTSYNC_BUTTON_N, 1, "HotSync Button" }, 217 {KEY_F8, GPIO_NR_PALMTX_HOTSYNC_BUTTON_N, 1, "HotSync Button" },
209}; 218};
@@ -221,208 +230,18 @@ static struct platform_device palmtx_pxa_keys = {
221 }, 230 },
222}; 231};
223 232
224/****************************************************************************** 233static void __init palmtx_keys_init(void)
225 * Backlight
226 ******************************************************************************/
227static int palmtx_backlight_init(struct device *dev)
228{
229 int ret;
230
231 ret = gpio_request(GPIO_NR_PALMTX_BL_POWER, "BL POWER");
232 if (ret)
233 goto err;
234 ret = gpio_direction_output(GPIO_NR_PALMTX_BL_POWER, 0);
235 if (ret)
236 goto err2;
237 ret = gpio_request(GPIO_NR_PALMTX_LCD_POWER, "LCD POWER");
238 if (ret)
239 goto err2;
240 ret = gpio_direction_output(GPIO_NR_PALMTX_LCD_POWER, 0);
241 if (ret)
242 goto err3;
243
244 return 0;
245err3:
246 gpio_free(GPIO_NR_PALMTX_LCD_POWER);
247err2:
248 gpio_free(GPIO_NR_PALMTX_BL_POWER);
249err:
250 return ret;
251}
252
253static int palmtx_backlight_notify(struct device *dev, int brightness)
254{
255 gpio_set_value(GPIO_NR_PALMTX_BL_POWER, brightness);
256 gpio_set_value(GPIO_NR_PALMTX_LCD_POWER, brightness);
257 return brightness;
258}
259
260static void palmtx_backlight_exit(struct device *dev)
261{
262 gpio_free(GPIO_NR_PALMTX_BL_POWER);
263 gpio_free(GPIO_NR_PALMTX_LCD_POWER);
264}
265
266static struct platform_pwm_backlight_data palmtx_backlight_data = {
267 .pwm_id = 0,
268 .max_brightness = PALMTX_MAX_INTENSITY,
269 .dft_brightness = PALMTX_MAX_INTENSITY,
270 .pwm_period_ns = PALMTX_PERIOD_NS,
271 .init = palmtx_backlight_init,
272 .notify = palmtx_backlight_notify,
273 .exit = palmtx_backlight_exit,
274};
275
276static struct platform_device palmtx_backlight = {
277 .name = "pwm-backlight",
278 .dev = {
279 .parent = &pxa27x_device_pwm0.dev,
280 .platform_data = &palmtx_backlight_data,
281 },
282};
283
284/******************************************************************************
285 * IrDA
286 ******************************************************************************/
287static struct pxaficp_platform_data palmtx_ficp_platform_data = {
288 .gpio_pwdown = GPIO_NR_PALMTX_IR_DISABLE,
289 .transceiver_cap = IR_SIRMODE | IR_OFF,
290};
291
292/******************************************************************************
293 * UDC
294 ******************************************************************************/
295static struct gpio_vbus_mach_info palmtx_udc_info = {
296 .gpio_vbus = GPIO_NR_PALMTX_USB_DETECT_N,
297 .gpio_vbus_inverted = 1,
298 .gpio_pullup = GPIO_NR_PALMTX_USB_PULLUP,
299};
300
301static struct platform_device palmtx_gpio_vbus = {
302 .name = "gpio-vbus",
303 .id = -1,
304 .dev = {
305 .platform_data = &palmtx_udc_info,
306 },
307};
308
309/******************************************************************************
310 * Power supply
311 ******************************************************************************/
312static int power_supply_init(struct device *dev)
313{
314 int ret;
315
316 ret = gpio_request(GPIO_NR_PALMTX_POWER_DETECT, "CABLE_STATE_AC");
317 if (ret)
318 goto err1;
319 ret = gpio_direction_input(GPIO_NR_PALMTX_POWER_DETECT);
320 if (ret)
321 goto err2;
322
323 return 0;
324
325err2:
326 gpio_free(GPIO_NR_PALMTX_POWER_DETECT);
327err1:
328 return ret;
329}
330
331static int palmtx_is_ac_online(void)
332{
333 return gpio_get_value(GPIO_NR_PALMTX_POWER_DETECT);
334}
335
336static void power_supply_exit(struct device *dev)
337{ 234{
338 gpio_free(GPIO_NR_PALMTX_POWER_DETECT); 235 platform_device_register(&palmtx_pxa_keys);
339} 236}
340 237#else
341static char *palmtx_supplicants[] = { 238static inline void palmtx_keys_init(void) {}
342 "main-battery", 239#endif
343};
344
345static struct pda_power_pdata power_supply_info = {
346 .init = power_supply_init,
347 .is_ac_online = palmtx_is_ac_online,
348 .exit = power_supply_exit,
349 .supplied_to = palmtx_supplicants,
350 .num_supplicants = ARRAY_SIZE(palmtx_supplicants),
351};
352
353static struct platform_device power_supply = {
354 .name = "pda-power",
355 .id = -1,
356 .dev = {
357 .platform_data = &power_supply_info,
358 },
359};
360
361/******************************************************************************
362 * WM97xx battery
363 ******************************************************************************/
364static struct wm97xx_batt_info wm97xx_batt_pdata = {
365 .batt_aux = WM97XX_AUX_ID3,
366 .temp_aux = WM97XX_AUX_ID2,
367 .charge_gpio = -1,
368 .max_voltage = PALMTX_BAT_MAX_VOLTAGE,
369 .min_voltage = PALMTX_BAT_MIN_VOLTAGE,
370 .batt_mult = 1000,
371 .batt_div = 414,
372 .temp_mult = 1,
373 .temp_div = 1,
374 .batt_tech = POWER_SUPPLY_TECHNOLOGY_LIPO,
375 .batt_name = "main-batt",
376};
377
378/******************************************************************************
379 * aSoC audio
380 ******************************************************************************/
381static struct palm27x_asoc_info palmtx_asoc_pdata = {
382 .jack_gpio = GPIO_NR_PALMTX_EARPHONE_DETECT,
383};
384
385static pxa2xx_audio_ops_t palmtx_ac97_pdata = {
386 .reset_gpio = 95,
387};
388
389static struct platform_device palmtx_asoc = {
390 .name = "palm27x-asoc",
391 .id = -1,
392 .dev = {
393 .platform_data = &palmtx_asoc_pdata,
394 },
395};
396
397/******************************************************************************
398 * Framebuffer
399 ******************************************************************************/
400static struct pxafb_mode_info palmtx_lcd_modes[] = {
401{
402 .pixclock = 57692,
403 .xres = 320,
404 .yres = 480,
405 .bpp = 16,
406
407 .left_margin = 32,
408 .right_margin = 1,
409 .upper_margin = 7,
410 .lower_margin = 1,
411
412 .hsync_len = 4,
413 .vsync_len = 1,
414},
415};
416
417static struct pxafb_mach_info palmtx_lcd_screen = {
418 .modes = palmtx_lcd_modes,
419 .num_modes = ARRAY_SIZE(palmtx_lcd_modes),
420 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
421};
422 240
423/****************************************************************************** 241/******************************************************************************
424 * NAND Flash 242 * NAND Flash
425 ******************************************************************************/ 243 ******************************************************************************/
244#if defined(CONFIG_MTD_NAND_GPIO) || defined(CONFIG_MTD_NAND_GPIO_MODULE)
426static void palmtx_nand_cmd_ctl(struct mtd_info *mtd, int cmd, 245static void palmtx_nand_cmd_ctl(struct mtd_info *mtd, int cmd,
427 unsigned int ctrl) 246 unsigned int ctrl)
428{ 247{
@@ -482,36 +301,17 @@ static struct platform_device palmtx_nand = {
482 } 301 }
483}; 302};
484 303
485/****************************************************************************** 304static void __init palmtx_nand_init(void)
486 * Power management - standby
487 ******************************************************************************/
488static void __init palmtx_pm_init(void)
489{ 305{
490 static u32 resume[] = { 306 platform_device_register(&palmtx_nand);
491 0xe3a00101, /* mov r0, #0x40000000 */
492 0xe380060f, /* orr r0, r0, #0x00f00000 */
493 0xe590f008, /* ldr pc, [r0, #0x08] */
494 };
495
496 /* copy the bootloader */
497 memcpy(phys_to_virt(PALMTX_STR_BASE), resume, sizeof(resume));
498} 307}
308#else
309static inline void palmtx_nand_init(void) {}
310#endif
499 311
500/****************************************************************************** 312/******************************************************************************
501 * Machine init 313 * Machine init
502 ******************************************************************************/ 314 ******************************************************************************/
503static struct platform_device *devices[] __initdata = {
504#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
505 &palmtx_pxa_keys,
506#endif
507 &palmtx_backlight,
508 &power_supply,
509 &palmtx_asoc,
510 &palmtx_gpio_vbus,
511 &palmtx_flash,
512 &palmtx_nand,
513};
514
515static struct map_desc palmtx_io_desc[] __initdata = { 315static struct map_desc palmtx_io_desc[] __initdata = {
516{ 316{
517 .virtual = PALMTX_PCMCIA_VIRT, 317 .virtual = PALMTX_PCMCIA_VIRT,
@@ -537,34 +337,29 @@ static void __init palmtx_map_io(void)
537 iotable_init(palmtx_io_desc, ARRAY_SIZE(palmtx_io_desc)); 337 iotable_init(palmtx_io_desc, ARRAY_SIZE(palmtx_io_desc));
538} 338}
539 339
540/* setup udc GPIOs initial state */
541static void __init palmtx_udc_init(void)
542{
543 if (!gpio_request(GPIO_NR_PALMTX_USB_PULLUP, "UDC Vbus")) {
544 gpio_direction_output(GPIO_NR_PALMTX_USB_PULLUP, 1);
545 gpio_free(GPIO_NR_PALMTX_USB_PULLUP);
546 }
547}
548
549
550static void __init palmtx_init(void) 340static void __init palmtx_init(void)
551{ 341{
552 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtx_pin_config)); 342 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtx_pin_config));
553
554 pxa_set_ffuart_info(NULL); 343 pxa_set_ffuart_info(NULL);
555 pxa_set_btuart_info(NULL); 344 pxa_set_btuart_info(NULL);
556 pxa_set_stuart_info(NULL); 345 pxa_set_stuart_info(NULL);
557 346
558 palmtx_pm_init(); 347 palm27x_mmc_init(GPIO_NR_PALMTX_SD_DETECT_N, GPIO_NR_PALMTX_SD_READONLY,
559 set_pxa_fb_info(&palmtx_lcd_screen); 348 GPIO_NR_PALMTX_SD_POWER, 0);
560 pxa_set_mci_info(&palmtx_mci_platform_data); 349 palm27x_pm_init(PALMTX_STR_BASE);
561 palmtx_udc_init(); 350 palm27x_lcd_init(-1, &palm_320x480_lcd_mode);
562 pxa_set_ac97_info(&palmtx_ac97_pdata); 351 palm27x_udc_init(GPIO_NR_PALMTX_USB_DETECT_N,
563 pxa_set_ficp_info(&palmtx_ficp_platform_data); 352 GPIO_NR_PALMTX_USB_PULLUP, 1);
564 pxa_set_keypad_info(&palmtx_keypad_platform_data); 353 palm27x_irda_init(GPIO_NR_PALMTX_IR_DISABLE);
565 wm97xx_bat_set_pdata(&wm97xx_batt_pdata); 354 palm27x_ac97_init(PALMTX_BAT_MIN_VOLTAGE, PALMTX_BAT_MAX_VOLTAGE,
566 355 GPIO_NR_PALMTX_EARPHONE_DETECT, 95);
567 platform_add_devices(devices, ARRAY_SIZE(devices)); 356 palm27x_pwm_init(GPIO_NR_PALMTX_BL_POWER, GPIO_NR_PALMTX_LCD_POWER);
357 palm27x_power_init(GPIO_NR_PALMTX_POWER_DETECT, -1);
358 palm27x_pmic_init();
359 palmtx_kpc_init();
360 palmtx_keys_init();
361 palmtx_nor_init();
362 palmtx_nand_init();
568} 363}
569 364
570MACHINE_START(PALMTX, "Palm T|X") 365MACHINE_START(PALMTX, "Palm T|X")
diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c
index 3a7925ca3944..87e4b1044e0b 100644
--- a/arch/arm/mach-pxa/palmz72.c
+++ b/arch/arm/mach-pxa/palmz72.c
@@ -27,7 +27,7 @@
27#include <linux/pda_power.h> 27#include <linux/pda_power.h>
28#include <linux/pwm_backlight.h> 28#include <linux/pwm_backlight.h>
29#include <linux/gpio.h> 29#include <linux/gpio.h>
30#include <linux/wm97xx_batt.h> 30#include <linux/wm97xx.h>
31#include <linux/power_supply.h> 31#include <linux/power_supply.h>
32#include <linux/usb/gpio_vbus.h> 32#include <linux/usb/gpio_vbus.h>
33 33
@@ -44,6 +44,7 @@
44#include <mach/pxa27x_keypad.h> 44#include <mach/pxa27x_keypad.h>
45#include <mach/udc.h> 45#include <mach/udc.h>
46#include <mach/palmasoc.h> 46#include <mach/palmasoc.h>
47#include <mach/palm27x.h>
47 48
48#include <mach/pm.h> 49#include <mach/pm.h>
49 50
@@ -109,21 +110,9 @@ static unsigned long palmz72_pin_config[] __initdata = {
109}; 110};
110 111
111/****************************************************************************** 112/******************************************************************************
112 * SD/MMC card controller
113 ******************************************************************************/
114/* SD_POWER is not actually power, but it is more like chip
115 * select, i.e. it is inverted */
116static struct pxamci_platform_data palmz72_mci_platform_data = {
117 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
118 .gpio_card_detect = GPIO_NR_PALMZ72_SD_DETECT_N,
119 .gpio_card_ro = GPIO_NR_PALMZ72_SD_RO,
120 .gpio_power = GPIO_NR_PALMZ72_SD_POWER_N,
121 .gpio_power_invert = 1,
122};
123
124/******************************************************************************
125 * GPIO keyboard 113 * GPIO keyboard
126 ******************************************************************************/ 114 ******************************************************************************/
115#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE)
127static unsigned int palmz72_matrix_keys[] = { 116static unsigned int palmz72_matrix_keys[] = {
128 KEY(0, 0, KEY_POWER), 117 KEY(0, 0, KEY_POWER),
129 KEY(0, 1, KEY_F1), 118 KEY(0, 1, KEY_F1),
@@ -149,77 +138,18 @@ static struct pxa27x_keypad_platform_data palmz72_keypad_platform_data = {
149 .debounce_interval = 30, 138 .debounce_interval = 30,
150}; 139};
151 140
152/****************************************************************************** 141static void __init palmz72_kpc_init(void)
153 * Backlight
154 ******************************************************************************/
155static int palmz72_backlight_init(struct device *dev)
156{ 142{
157 int ret; 143 pxa_set_keypad_info(&palmz72_keypad_platform_data);
158
159 ret = gpio_request(GPIO_NR_PALMZ72_BL_POWER, "BL POWER");
160 if (ret)
161 goto err;
162 ret = gpio_direction_output(GPIO_NR_PALMZ72_BL_POWER, 0);
163 if (ret)
164 goto err2;
165 ret = gpio_request(GPIO_NR_PALMZ72_LCD_POWER, "LCD POWER");
166 if (ret)
167 goto err2;
168 ret = gpio_direction_output(GPIO_NR_PALMZ72_LCD_POWER, 0);
169 if (ret)
170 goto err3;
171
172 return 0;
173err3:
174 gpio_free(GPIO_NR_PALMZ72_LCD_POWER);
175err2:
176 gpio_free(GPIO_NR_PALMZ72_BL_POWER);
177err:
178 return ret;
179}
180
181static int palmz72_backlight_notify(struct device *dev, int brightness)
182{
183 gpio_set_value(GPIO_NR_PALMZ72_BL_POWER, brightness);
184 gpio_set_value(GPIO_NR_PALMZ72_LCD_POWER, brightness);
185 return brightness;
186}
187
188static void palmz72_backlight_exit(struct device *dev)
189{
190 gpio_free(GPIO_NR_PALMZ72_BL_POWER);
191 gpio_free(GPIO_NR_PALMZ72_LCD_POWER);
192} 144}
193 145#else
194static struct platform_pwm_backlight_data palmz72_backlight_data = { 146static inline void palmz72_kpc_init(void) {}
195 .pwm_id = 0, 147#endif
196 .max_brightness = PALMZ72_MAX_INTENSITY,
197 .dft_brightness = PALMZ72_MAX_INTENSITY,
198 .pwm_period_ns = PALMZ72_PERIOD_NS,
199 .init = palmz72_backlight_init,
200 .notify = palmz72_backlight_notify,
201 .exit = palmz72_backlight_exit,
202};
203
204static struct platform_device palmz72_backlight = {
205 .name = "pwm-backlight",
206 .dev = {
207 .parent = &pxa27x_device_pwm0.dev,
208 .platform_data = &palmz72_backlight_data,
209 },
210};
211
212/******************************************************************************
213 * IrDA
214 ******************************************************************************/
215static struct pxaficp_platform_data palmz72_ficp_platform_data = {
216 .gpio_pwdown = GPIO_NR_PALMZ72_IR_DISABLE,
217 .transceiver_cap = IR_SIRMODE | IR_OFF,
218};
219 148
220/****************************************************************************** 149/******************************************************************************
221 * LEDs 150 * LEDs
222 ******************************************************************************/ 151 ******************************************************************************/
152#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
223static struct gpio_led gpio_leds[] = { 153static struct gpio_led gpio_leds[] = {
224 { 154 {
225 .name = "palmz72:green:led", 155 .name = "palmz72:green:led",
@@ -241,139 +171,13 @@ static struct platform_device palmz72_leds = {
241 } 171 }
242}; 172};
243 173
244/****************************************************************************** 174static void __init palmz72_leds_init(void)
245 * UDC
246 ******************************************************************************/
247static struct gpio_vbus_mach_info palmz72_udc_info = {
248 .gpio_vbus = GPIO_NR_PALMZ72_USB_DETECT_N,
249 .gpio_pullup = GPIO_NR_PALMZ72_USB_PULLUP,
250};
251
252static struct platform_device palmz72_gpio_vbus = {
253 .name = "gpio-vbus",
254 .id = -1,
255 .dev = {
256 .platform_data = &palmz72_udc_info,
257 },
258};
259
260/******************************************************************************
261 * Power supply
262 ******************************************************************************/
263static int power_supply_init(struct device *dev)
264{
265 int ret;
266
267 ret = gpio_request(GPIO_NR_PALMZ72_POWER_DETECT, "CABLE_STATE_AC");
268 if (ret)
269 goto err1;
270 ret = gpio_direction_input(GPIO_NR_PALMZ72_POWER_DETECT);
271 if (ret)
272 goto err2;
273
274 ret = gpio_request(GPIO_NR_PALMZ72_USB_DETECT_N, "CABLE_STATE_USB");
275 if (ret)
276 goto err2;
277 ret = gpio_direction_input(GPIO_NR_PALMZ72_USB_DETECT_N);
278 if (ret)
279 goto err3;
280
281 return 0;
282err3:
283 gpio_free(GPIO_NR_PALMZ72_USB_DETECT_N);
284err2:
285 gpio_free(GPIO_NR_PALMZ72_POWER_DETECT);
286err1:
287 return ret;
288}
289
290static int palmz72_is_ac_online(void)
291{
292 return gpio_get_value(GPIO_NR_PALMZ72_POWER_DETECT);
293}
294
295static int palmz72_is_usb_online(void)
296{ 175{
297 return !gpio_get_value(GPIO_NR_PALMZ72_USB_DETECT_N); 176 platform_device_register(&palmz72_leds);
298} 177}
299 178#else
300static void power_supply_exit(struct device *dev) 179static inline void palmz72_leds_init(void) {}
301{ 180#endif
302 gpio_free(GPIO_NR_PALMZ72_USB_DETECT_N);
303 gpio_free(GPIO_NR_PALMZ72_POWER_DETECT);
304}
305
306static char *palmz72_supplicants[] = {
307 "main-battery",
308};
309
310static struct pda_power_pdata power_supply_info = {
311 .init = power_supply_init,
312 .is_ac_online = palmz72_is_ac_online,
313 .is_usb_online = palmz72_is_usb_online,
314 .exit = power_supply_exit,
315 .supplied_to = palmz72_supplicants,
316 .num_supplicants = ARRAY_SIZE(palmz72_supplicants),
317};
318
319static struct platform_device power_supply = {
320 .name = "pda-power",
321 .id = -1,
322 .dev = {
323 .platform_data = &power_supply_info,
324 },
325};
326
327/******************************************************************************
328 * WM97xx battery
329 ******************************************************************************/
330static struct wm97xx_batt_info wm97xx_batt_pdata = {
331 .batt_aux = WM97XX_AUX_ID3,
332 .temp_aux = WM97XX_AUX_ID2,
333 .charge_gpio = -1,
334 .max_voltage = PALMZ72_BAT_MAX_VOLTAGE,
335 .min_voltage = PALMZ72_BAT_MIN_VOLTAGE,
336 .batt_mult = 1000,
337 .batt_div = 414,
338 .temp_mult = 1,
339 .temp_div = 1,
340 .batt_tech = POWER_SUPPLY_TECHNOLOGY_LIPO,
341 .batt_name = "main-batt",
342};
343
344/******************************************************************************
345 * aSoC audio
346 ******************************************************************************/
347static struct platform_device palmz72_asoc = {
348 .name = "palm27x-asoc",
349 .id = -1,
350};
351
352/******************************************************************************
353 * Framebuffer
354 ******************************************************************************/
355static struct pxafb_mode_info palmz72_lcd_modes[] = {
356{
357 .pixclock = 115384,
358 .xres = 320,
359 .yres = 320,
360 .bpp = 16,
361
362 .left_margin = 27,
363 .right_margin = 7,
364 .upper_margin = 7,
365 .lower_margin = 8,
366
367 .hsync_len = 6,
368 .vsync_len = 1,
369},
370};
371
372static struct pxafb_mach_info palmz72_lcd_screen = {
373 .modes = palmz72_lcd_modes,
374 .num_modes = ARRAY_SIZE(palmz72_lcd_modes),
375 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
376};
377 181
378#ifdef CONFIG_PM 182#ifdef CONFIG_PM
379 183
@@ -452,40 +256,26 @@ device_initcall(palmz72_pm_init);
452/****************************************************************************** 256/******************************************************************************
453 * Machine init 257 * Machine init
454 ******************************************************************************/ 258 ******************************************************************************/
455static struct platform_device *devices[] __initdata = {
456 &palmz72_backlight,
457 &palmz72_leds,
458 &palmz72_asoc,
459 &power_supply,
460 &palmz72_gpio_vbus,
461};
462
463/* setup udc GPIOs initial state */
464static void __init palmz72_udc_init(void)
465{
466 if (!gpio_request(GPIO_NR_PALMZ72_USB_PULLUP, "USB Pullup")) {
467 gpio_direction_output(GPIO_NR_PALMZ72_USB_PULLUP, 0);
468 gpio_free(GPIO_NR_PALMZ72_USB_PULLUP);
469 }
470}
471
472static void __init palmz72_init(void) 259static void __init palmz72_init(void)
473{ 260{
474 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmz72_pin_config)); 261 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmz72_pin_config));
475
476 pxa_set_ffuart_info(NULL); 262 pxa_set_ffuart_info(NULL);
477 pxa_set_btuart_info(NULL); 263 pxa_set_btuart_info(NULL);
478 pxa_set_stuart_info(NULL); 264 pxa_set_stuart_info(NULL);
479 265
480 set_pxa_fb_info(&palmz72_lcd_screen); 266 palm27x_mmc_init(GPIO_NR_PALMZ72_SD_DETECT_N, GPIO_NR_PALMZ72_SD_RO,
481 pxa_set_mci_info(&palmz72_mci_platform_data); 267 GPIO_NR_PALMZ72_SD_POWER_N, 1);
482 palmz72_udc_init(); 268 palm27x_lcd_init(-1, &palm_320x320_lcd_mode);
483 pxa_set_ac97_info(NULL); 269 palm27x_udc_init(GPIO_NR_PALMZ72_USB_DETECT_N,
484 pxa_set_ficp_info(&palmz72_ficp_platform_data); 270 GPIO_NR_PALMZ72_USB_PULLUP, 0);
485 pxa_set_keypad_info(&palmz72_keypad_platform_data); 271 palm27x_irda_init(GPIO_NR_PALMZ72_IR_DISABLE);
486 wm97xx_bat_set_pdata(&wm97xx_batt_pdata); 272 palm27x_ac97_init(PALMZ72_BAT_MIN_VOLTAGE, PALMZ72_BAT_MAX_VOLTAGE,
487 273 -1, 113);
488 platform_add_devices(devices, ARRAY_SIZE(devices)); 274 palm27x_pwm_init(-1, -1);
275 palm27x_power_init(-1, -1);
276 palm27x_pmic_init();
277 palmz72_kpc_init();
278 palmz72_leds_init();
489} 279}
490 280
491MACHINE_START(PALMZ72, "Palm Zire72") 281MACHINE_START(PALMZ72, "Palm Zire72")
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index bc2758b54446..55e8fcde0141 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -43,7 +43,6 @@
43#include <mach/irda.h> 43#include <mach/irda.h>
44#include <mach/poodle.h> 44#include <mach/poodle.h>
45#include <mach/pxafb.h> 45#include <mach/pxafb.h>
46#include <mach/sharpsl.h>
47#include <mach/pxa2xx_spi.h> 46#include <mach/pxa2xx_spi.h>
48#include <plat/i2c.h> 47#include <plat/i2c.h>
49 48
@@ -53,7 +52,6 @@
53 52
54#include "generic.h" 53#include "generic.h"
55#include "devices.h" 54#include "devices.h"
56#include "sharpsl.h"
57 55
58static unsigned long poodle_pin_config[] __initdata = { 56static unsigned long poodle_pin_config[] __initdata = {
59 /* I/O */ 57 /* I/O */
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
index 0b9ad30bfd51..de53f2e4aa39 100644
--- a/arch/arm/mach-pxa/pxa25x.c
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -322,6 +322,7 @@ 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_pmu,
325 &pxa_device_i2s, 326 &pxa_device_i2s,
326 &sa1100_device_rtc, 327 &sa1100_device_rtc,
327 &pxa25x_device_ssp, 328 &pxa25x_device_ssp,
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index c059dac02b61..12e5b9f01e6f 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -383,6 +383,7 @@ void __init pxa27x_set_i2c_power_info(struct i2c_pxa_platform_data *info)
383 383
384static struct platform_device *devices[] __initdata = { 384static struct platform_device *devices[] __initdata = {
385 &pxa27x_device_udc, 385 &pxa27x_device_udc,
386 &pxa_device_pmu,
386 &pxa_device_i2s, 387 &pxa_device_i2s,
387 &sa1100_device_rtc, 388 &sa1100_device_rtc,
388 &pxa_device_rtc, 389 &pxa_device_rtc,
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index f544e58e1536..fa0014847c71 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -52,7 +52,7 @@
52static unsigned char smcfs_mult[8] = { 6, 0, 8, 0, 0, 16, }; 52static unsigned char smcfs_mult[8] = { 6, 0, 8, 0, 0, 16, };
53 53
54/* crystal frequency to HSIO bus frequency multiplier (HSS) */ 54/* crystal frequency to HSIO bus frequency multiplier (HSS) */
55static unsigned char hss_mult[4] = { 8, 12, 16, 0 }; 55static unsigned char hss_mult[4] = { 8, 12, 16, 24 };
56 56
57/* 57/*
58 * Get the clock frequency as reflected by CCSR and the turbo flag. 58 * Get the clock frequency as reflected by CCSR and the turbo flag.
@@ -552,11 +552,23 @@ static void pxa_unmask_ext_wakeup(unsigned int irq)
552 PECR |= PECR_IE(irq - IRQ_WAKEUP0); 552 PECR |= PECR_IE(irq - IRQ_WAKEUP0);
553} 553}
554 554
555static int pxa_set_ext_wakeup_type(unsigned int irq, unsigned int flow_type)
556{
557 if (flow_type & IRQ_TYPE_EDGE_RISING)
558 PWER |= 1 << (irq - IRQ_WAKEUP0);
559
560 if (flow_type & IRQ_TYPE_EDGE_FALLING)
561 PWER |= 1 << (irq - IRQ_WAKEUP0 + 2);
562
563 return 0;
564}
565
555static struct irq_chip pxa_ext_wakeup_chip = { 566static struct irq_chip pxa_ext_wakeup_chip = {
556 .name = "WAKEUP", 567 .name = "WAKEUP",
557 .ack = pxa_ack_ext_wakeup, 568 .ack = pxa_ack_ext_wakeup,
558 .mask = pxa_mask_ext_wakeup, 569 .mask = pxa_mask_ext_wakeup,
559 .unmask = pxa_unmask_ext_wakeup, 570 .unmask = pxa_unmask_ext_wakeup,
571 .set_type = pxa_set_ext_wakeup_type,
560}; 572};
561 573
562static void __init pxa_init_ext_wakeup_irq(set_wake_t fn) 574static void __init pxa_init_ext_wakeup_irq(set_wake_t fn)
@@ -596,6 +608,7 @@ void __init pxa3xx_set_i2c_power_info(struct i2c_pxa_platform_data *info)
596 608
597static struct platform_device *devices[] __initdata = { 609static struct platform_device *devices[] __initdata = {
598 &pxa27x_device_udc, 610 &pxa27x_device_udc,
611 &pxa_device_pmu,
599 &pxa_device_i2s, 612 &pxa_device_i2s,
600 &sa1100_device_rtc, 613 &sa1100_device_rtc,
601 &pxa_device_rtc, 614 &pxa_device_rtc,
diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c
index d4b61b3f08f3..67e04f4e07c1 100644
--- a/arch/arm/mach-pxa/raumfeld.c
+++ b/arch/arm/mach-pxa/raumfeld.c
@@ -745,13 +745,32 @@ static int raumfeld_is_usb_online(void)
745 745
746static char *raumfeld_power_supplicants[] = { "ds2760-battery.0" }; 746static char *raumfeld_power_supplicants[] = { "ds2760-battery.0" };
747 747
748static void raumfeld_power_signal_charged(void)
749{
750 struct power_supply *psy =
751 power_supply_get_by_name(raumfeld_power_supplicants[0]);
752
753 if (psy)
754 power_supply_set_battery_charged(psy);
755}
756
757static int raumfeld_power_resume(void)
758{
759 /* check if GPIO_CHARGE_DONE went low while we were sleeping */
760 if (!gpio_get_value(GPIO_CHARGE_DONE))
761 raumfeld_power_signal_charged();
762
763 return 0;
764}
765
748static struct pda_power_pdata power_supply_info = { 766static struct pda_power_pdata power_supply_info = {
749 .init = power_supply_init, 767 .init = power_supply_init,
750 .is_ac_online = raumfeld_is_ac_online, 768 .is_ac_online = raumfeld_is_ac_online,
751 .is_usb_online = raumfeld_is_usb_online, 769 .is_usb_online = raumfeld_is_usb_online,
752 .exit = power_supply_exit, 770 .exit = power_supply_exit,
753 .supplied_to = raumfeld_power_supplicants, 771 .supplied_to = raumfeld_power_supplicants,
754 .num_supplicants = ARRAY_SIZE(raumfeld_power_supplicants) 772 .num_supplicants = ARRAY_SIZE(raumfeld_power_supplicants),
773 .resume = raumfeld_power_resume,
755}; 774};
756 775
757static struct resource power_supply_resources[] = { 776static struct resource power_supply_resources[] = {
@@ -766,13 +785,7 @@ static struct resource power_supply_resources[] = {
766 785
767static irqreturn_t charge_done_irq(int irq, void *dev_id) 786static irqreturn_t charge_done_irq(int irq, void *dev_id)
768{ 787{
769 struct power_supply *psy; 788 raumfeld_power_signal_charged();
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; 789 return IRQ_HANDLED;
777} 790}
778 791
diff --git a/arch/arm/mach-pxa/sharpsl.h b/arch/arm/mach-pxa/sharpsl.h
deleted file mode 100644
index 0cc1203c5bef..000000000000
--- a/arch/arm/mach-pxa/sharpsl.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * Copyright (c) 2004-2005 Richard Purdie
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#include <mach/sharpsl_pm.h>
11
12/*
13 * SharpSL Battery/PM Driver
14 */
15#define READ_GPIO_BIT(x) (GPLR(x) & GPIO_bit(x))
16
17/* MAX1111 Channel Definitions */
18#define MAX1111_BATT_VOLT 4u
19#define MAX1111_BATT_TEMP 2u
20#define MAX1111_ACIN_VOLT 6u
21
22extern struct battery_thresh sharpsl_battery_levels_acin[];
23extern struct battery_thresh sharpsl_battery_levels_noac[];
24int sharpsl_pm_pxa_read_max1111(int channel);
25
26
diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
index cb4767251f3c..8fed027b12dc 100644
--- a/arch/arm/mach-pxa/sharpsl_pm.c
+++ b/arch/arm/mach-pxa/sharpsl_pm.c
@@ -29,11 +29,8 @@
29#include <mach/pm.h> 29#include <mach/pm.h>
30#include <mach/pxa2xx-regs.h> 30#include <mach/pxa2xx-regs.h>
31#include <mach/regs-rtc.h> 31#include <mach/regs-rtc.h>
32#include <mach/sharpsl.h>
33#include <mach/sharpsl_pm.h> 32#include <mach/sharpsl_pm.h>
34 33
35#include "sharpsl.h"
36
37/* 34/*
38 * Constants 35 * Constants
39 */ 36 */
@@ -180,17 +177,12 @@ int sharpsl_pm_pxa_read_max1111(int channel)
180 if (machine_is_tosa()) 177 if (machine_is_tosa())
181 return 0; 178 return 0;
182 179
183#ifdef CONFIG_CORGI_SSP_DEPRECATED
184 return corgi_ssp_max1111_get((channel << MAXCTRL_SEL_SH) | MAXCTRL_PD0 | MAXCTRL_PD1
185 | MAXCTRL_SGL | MAXCTRL_UNI | MAXCTRL_STR);
186#else
187 extern int max1111_read_channel(int); 180 extern int max1111_read_channel(int);
188 181
189 /* max1111 accepts channels from 0-3, however, 182 /* max1111 accepts channels from 0-3, however,
190 * it is encoded from 0-7 here in the code. 183 * it is encoded from 0-7 here in the code.
191 */ 184 */
192 return max1111_read_channel(channel >> 1); 185 return max1111_read_channel(channel >> 1);
193#endif
194} 186}
195 187
196static int get_percentage(int voltage) 188static int get_percentage(int voltage)
@@ -277,21 +269,6 @@ static void sharpsl_battery_thread(struct work_struct *private_)
277 dev_dbg(sharpsl_pm.dev, "Battery: voltage: %d, status: %d, percentage: %d, time: %ld\n", voltage, 269 dev_dbg(sharpsl_pm.dev, "Battery: voltage: %d, status: %d, percentage: %d, time: %ld\n", voltage,
278 sharpsl_pm.battstat.mainbat_status, sharpsl_pm.battstat.mainbat_percent, jiffies); 270 sharpsl_pm.battstat.mainbat_status, sharpsl_pm.battstat.mainbat_percent, jiffies);
279 271
280#ifdef CONFIG_BACKLIGHT_CORGI
281 /* If battery is low. limit backlight intensity to save power. */
282 if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE)
283 && ((sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_LOW)
284 || (sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_CRITICAL))) {
285 if (!(sharpsl_pm.flags & SHARPSL_BL_LIMIT)) {
286 sharpsl_pm.machinfo->backlight_limit(1);
287 sharpsl_pm.flags |= SHARPSL_BL_LIMIT;
288 }
289 } else if (sharpsl_pm.flags & SHARPSL_BL_LIMIT) {
290 sharpsl_pm.machinfo->backlight_limit(0);
291 sharpsl_pm.flags &= ~SHARPSL_BL_LIMIT;
292 }
293#endif
294
295 /* Suspend if critical battery level */ 272 /* Suspend if critical battery level */
296 if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE) 273 if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE)
297 && (sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_CRITICAL) 274 && (sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_CRITICAL)
diff --git a/arch/arm/mach-pxa/sleep.S b/arch/arm/mach-pxa/sleep.S
index 2ed95f369cfc..52c30b01a671 100644
--- a/arch/arm/mach-pxa/sleep.S
+++ b/arch/arm/mach-pxa/sleep.S
@@ -339,10 +339,6 @@ ENTRY(pxa_cpu_resume)
339 mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs 339 mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs
340 mcr p15, 0, r1, c7, c7, 0 @ invalidate I & D caches, BTB 340 mcr p15, 0, r1, c7, c7, 0 @ invalidate I & D caches, BTB
341 341
342#ifdef CONFIG_XSCALE_CACHE_ERRATA
343 bic r9, r9, #0x0004 @ see cpu_xscale_proc_init
344#endif
345
346 mcr p14, 0, r3, c6, c0, 0 @ clock configuration, turbo mode. 342 mcr p14, 0, r3, c6, c0, 0 @ clock configuration, turbo mode.
347 mcr p15, 0, r4, c15, c1, 0 @ CP access reg 343 mcr p15, 0, r4, c15, c1, 0 @ CP access reg
348 mcr p15, 0, r5, c13, c0, 0 @ PID 344 mcr p15, 0, r5, c13, c0, 0 @ PID
@@ -368,9 +364,6 @@ sleep_save_sp:
368 364
369 .text 365 .text
370resume_after_mmu: 366resume_after_mmu:
371#ifdef CONFIG_XSCALE_CACHE_ERRATA
372 bl cpu_xscale_proc_init
373#endif
374 ldmfd sp!, {r2, r3} 367 ldmfd sp!, {r2, r3}
375#ifndef CONFIG_IWMMXT 368#ifndef CONFIG_IWMMXT
376 mar acc0, r2, r3 369 mar acc0, r2, r3
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 51756c723557..1cd99cb87bb1 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -18,14 +18,15 @@
18#include <linux/gpio_keys.h> 18#include <linux/gpio_keys.h>
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/leds.h> 20#include <linux/leds.h>
21#include <linux/mtd/physmap.h>
22#include <linux/i2c.h> 21#include <linux/i2c.h>
23#include <linux/i2c/pca953x.h> 22#include <linux/i2c/pca953x.h>
24#include <linux/spi/spi.h> 23#include <linux/spi/spi.h>
25#include <linux/spi/ads7846.h> 24#include <linux/spi/ads7846.h>
26#include <linux/spi/corgi_lcd.h> 25#include <linux/spi/corgi_lcd.h>
26#include <linux/mtd/physmap.h>
27#include <linux/mtd/sharpsl.h> 27#include <linux/mtd/sharpsl.h>
28#include <linux/input/matrix_keypad.h> 28#include <linux/input/matrix_keypad.h>
29#include <linux/regulator/machine.h>
29 30
30#include <asm/setup.h> 31#include <asm/setup.h>
31#include <asm/mach-types.h> 32#include <asm/mach-types.h>
@@ -33,22 +34,25 @@
33#include <asm/mach/sharpsl_param.h> 34#include <asm/mach/sharpsl_param.h>
34#include <asm/hardware/scoop.h> 35#include <asm/hardware/scoop.h>
35 36
36
37#include <mach/pxa27x.h> 37#include <mach/pxa27x.h>
38#include <mach/pxa27x-udc.h> 38#include <mach/pxa27x-udc.h>
39#include <mach/reset.h> 39#include <mach/reset.h>
40#include <plat/i2c.h>
41#include <mach/irda.h> 40#include <mach/irda.h>
42#include <mach/mmc.h> 41#include <mach/mmc.h>
43#include <mach/ohci.h> 42#include <mach/ohci.h>
44#include <mach/pxafb.h> 43#include <mach/pxafb.h>
45#include <mach/pxa2xx_spi.h> 44#include <mach/pxa2xx_spi.h>
46#include <mach/spitz.h> 45#include <mach/spitz.h>
46#include <mach/sharpsl_pm.h>
47
48#include <plat/i2c.h>
47 49
48#include "generic.h" 50#include "generic.h"
49#include "devices.h" 51#include "devices.h"
50#include "sharpsl.h"
51 52
53/******************************************************************************
54 * Pin configuration
55 ******************************************************************************/
52static unsigned long spitz_pin_config[] __initdata = { 56static unsigned long spitz_pin_config[] __initdata = {
53 /* Chip Selects */ 57 /* Chip Selects */
54 GPIO78_nCS_2, /* SCOOP #2 */ 58 GPIO78_nCS_2, /* SCOOP #2 */
@@ -124,10 +128,13 @@ static unsigned long spitz_pin_config[] __initdata = {
124 GPIO1_GPIO | WAKEUP_ON_EDGE_FALL, /* SPITZ_GPIO_RESET */ 128 GPIO1_GPIO | WAKEUP_ON_EDGE_FALL, /* SPITZ_GPIO_RESET */
125}; 129};
126 130
127/* 131
128 * Spitz SCOOP Device #1 132/******************************************************************************
129 */ 133 * Scoop GPIO expander
130static struct resource spitz_scoop_resources[] = { 134 ******************************************************************************/
135#if defined(CONFIG_SHARP_SCOOP) || defined(CONFIG_SHARP_SCOOP_MODULE)
136/* SCOOP Device #1 */
137static struct resource spitz_scoop_1_resources[] = {
131 [0] = { 138 [0] = {
132 .start = 0x10800000, 139 .start = 0x10800000,
133 .end = 0x10800fff, 140 .end = 0x10800fff,
@@ -135,7 +142,7 @@ static struct resource spitz_scoop_resources[] = {
135 }, 142 },
136}; 143};
137 144
138static struct scoop_config spitz_scoop_setup = { 145static struct scoop_config spitz_scoop_1_setup = {
139 .io_dir = SPITZ_SCP_IO_DIR, 146 .io_dir = SPITZ_SCP_IO_DIR,
140 .io_out = SPITZ_SCP_IO_OUT, 147 .io_out = SPITZ_SCP_IO_OUT,
141 .suspend_clr = SPITZ_SCP_SUS_CLR, 148 .suspend_clr = SPITZ_SCP_SUS_CLR,
@@ -143,20 +150,18 @@ static struct scoop_config spitz_scoop_setup = {
143 .gpio_base = SPITZ_SCP_GPIO_BASE, 150 .gpio_base = SPITZ_SCP_GPIO_BASE,
144}; 151};
145 152
146struct platform_device spitzscoop_device = { 153struct platform_device spitz_scoop_1_device = {
147 .name = "sharp-scoop", 154 .name = "sharp-scoop",
148 .id = 0, 155 .id = 0,
149 .dev = { 156 .dev = {
150 .platform_data = &spitz_scoop_setup, 157 .platform_data = &spitz_scoop_1_setup,
151 }, 158 },
152 .num_resources = ARRAY_SIZE(spitz_scoop_resources), 159 .num_resources = ARRAY_SIZE(spitz_scoop_1_resources),
153 .resource = spitz_scoop_resources, 160 .resource = spitz_scoop_1_resources,
154}; 161};
155 162
156/* 163/* SCOOP Device #2 */
157 * Spitz SCOOP Device #2 164static struct resource spitz_scoop_2_resources[] = {
158 */
159static struct resource spitz_scoop2_resources[] = {
160 [0] = { 165 [0] = {
161 .start = 0x08800040, 166 .start = 0x08800040,
162 .end = 0x08800fff, 167 .end = 0x08800fff,
@@ -164,7 +169,7 @@ static struct resource spitz_scoop2_resources[] = {
164 }, 169 },
165}; 170};
166 171
167static struct scoop_config spitz_scoop2_setup = { 172static struct scoop_config spitz_scoop_2_setup = {
168 .io_dir = SPITZ_SCP2_IO_DIR, 173 .io_dir = SPITZ_SCP2_IO_DIR,
169 .io_out = SPITZ_SCP2_IO_OUT, 174 .io_out = SPITZ_SCP2_IO_OUT,
170 .suspend_clr = SPITZ_SCP2_SUS_CLR, 175 .suspend_clr = SPITZ_SCP2_SUS_CLR,
@@ -172,82 +177,110 @@ static struct scoop_config spitz_scoop2_setup = {
172 .gpio_base = SPITZ_SCP2_GPIO_BASE, 177 .gpio_base = SPITZ_SCP2_GPIO_BASE,
173}; 178};
174 179
175struct platform_device spitzscoop2_device = { 180struct platform_device spitz_scoop_2_device = {
176 .name = "sharp-scoop", 181 .name = "sharp-scoop",
177 .id = 1, 182 .id = 1,
178 .dev = { 183 .dev = {
179 .platform_data = &spitz_scoop2_setup, 184 .platform_data = &spitz_scoop_2_setup,
180 }, 185 },
181 .num_resources = ARRAY_SIZE(spitz_scoop2_resources), 186 .num_resources = ARRAY_SIZE(spitz_scoop_2_resources),
182 .resource = spitz_scoop2_resources, 187 .resource = spitz_scoop_2_resources,
183}; 188};
184 189
185#define SPITZ_PWR_SD 0x01 190static void __init spitz_scoop_init(void)
186#define SPITZ_PWR_CF 0x02 191{
192 platform_device_register(&spitz_scoop_1_device);
193
194 /* Akita doesn't have the second SCOOP chip */
195 if (!machine_is_akita())
196 platform_device_register(&spitz_scoop_2_device);
197}
187 198
188/* Power control is shared with between one of the CF slots and SD */ 199/* Power control is shared with between one of the CF slots and SD */
189static void spitz_card_pwr_ctrl(int device, unsigned short new_cpr) 200static void spitz_card_pwr_ctrl(uint8_t enable, uint8_t new_cpr)
190{ 201{
191 unsigned short cpr = read_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR); 202 unsigned short cpr;
203 unsigned long flags;
192 204
193 if (new_cpr & 0x0007) { 205 if (new_cpr & 0x7) {
194 gpio_set_value(SPITZ_GPIO_CF_POWER, 1); 206 gpio_set_value(SPITZ_GPIO_CF_POWER, 1);
195 if (!(cpr & 0x0002) && !(cpr & 0x0004)) 207 mdelay(5);
196 mdelay(5); 208 }
197 if (device == SPITZ_PWR_CF) 209
198 cpr |= 0x0002; 210 local_irq_save(flags);
199 if (device == SPITZ_PWR_SD) 211
200 cpr |= 0x0004; 212 cpr = read_scoop_reg(&spitz_scoop_1_device.dev, SCOOP_CPR);
201 write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, cpr | new_cpr); 213
202 } else { 214 if (enable & new_cpr)
203 if (device == SPITZ_PWR_CF) 215 cpr |= new_cpr;
204 cpr &= ~0x0002; 216 else
205 if (device == SPITZ_PWR_SD) 217 cpr &= ~enable;
206 cpr &= ~0x0004; 218
207 if (!(cpr & 0x0002) && !(cpr & 0x0004)) { 219 write_scoop_reg(&spitz_scoop_1_device.dev, SCOOP_CPR, cpr);
208 write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, 0x0000); 220
209 mdelay(1); 221 local_irq_restore(flags);
210 gpio_set_value(SPITZ_GPIO_CF_POWER, 0); 222
211 } else { 223 if (!(cpr & 0x7)) {
212 write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, cpr | new_cpr); 224 mdelay(1);
213 } 225 gpio_set_value(SPITZ_GPIO_CF_POWER, 0);
214 } 226 }
215} 227}
216 228
217static void spitz_pcmcia_pwr(struct device *scoop, unsigned short cpr, int nr) 229#else
230static inline void spitz_scoop_init(void) {}
231static inline void spitz_card_pwr_ctrl(uint8_t enable, uint8_t new_cpr) {}
232#endif
233
234/******************************************************************************
235 * PCMCIA
236 ******************************************************************************/
237#if defined(CONFIG_PCMCIA_PXA2XX) || defined(CONFIG_PCMCIA_PXA2XX_MODULE)
238static void spitz_pcmcia_pwr(struct device *scoop, uint16_t cpr, int nr)
218{ 239{
219 /* Only need to override behaviour for slot 0 */ 240 /* Only need to override behaviour for slot 0 */
220 if (nr == 0) 241 if (nr == 0)
221 spitz_card_pwr_ctrl(SPITZ_PWR_CF, cpr); 242 spitz_card_pwr_ctrl(
243 cpr & (SCOOP_CPR_CF_3V | SCOOP_CPR_CF_XV), cpr);
222 else 244 else
223 write_scoop_reg(scoop, SCOOP_CPR, cpr); 245 write_scoop_reg(scoop, SCOOP_CPR, cpr);
224} 246}
225 247
226static struct scoop_pcmcia_dev spitz_pcmcia_scoop[] = { 248static struct scoop_pcmcia_dev spitz_pcmcia_scoop[] = {
227{ 249 {
228 .dev = &spitzscoop_device.dev, 250 .dev = &spitz_scoop_1_device.dev,
229 .irq = SPITZ_IRQ_GPIO_CF_IRQ, 251 .irq = SPITZ_IRQ_GPIO_CF_IRQ,
230 .cd_irq = SPITZ_IRQ_GPIO_CF_CD, 252 .cd_irq = SPITZ_IRQ_GPIO_CF_CD,
231 .cd_irq_str = "PCMCIA0 CD", 253 .cd_irq_str = "PCMCIA0 CD",
232},{ 254 }, {
233 .dev = &spitzscoop2_device.dev, 255 .dev = &spitz_scoop_2_device.dev,
234 .irq = SPITZ_IRQ_GPIO_CF2_IRQ, 256 .irq = SPITZ_IRQ_GPIO_CF2_IRQ,
235 .cd_irq = -1, 257 .cd_irq = -1,
236}, 258 },
237}; 259};
238 260
239static struct scoop_pcmcia_config spitz_pcmcia_config = { 261static struct scoop_pcmcia_config spitz_pcmcia_config = {
240 .devs = &spitz_pcmcia_scoop[0], 262 .devs = &spitz_pcmcia_scoop[0],
241 .num_devs = 2, 263 .num_devs = 2,
242 .power_ctrl = spitz_pcmcia_pwr, 264 .power_ctrl = spitz_pcmcia_pwr,
243}; 265};
244 266
245EXPORT_SYMBOL(spitzscoop_device); 267static void __init spitz_pcmcia_init(void)
246EXPORT_SYMBOL(spitzscoop2_device); 268{
269 /* Akita has only one PCMCIA slot used */
270 if (machine_is_akita())
271 spitz_pcmcia_config.num_devs = 1;
272
273 platform_scoop_config = &spitz_pcmcia_config;
274}
275#else
276static inline void spitz_pcmcia_init(void) {}
277#endif
278
279/******************************************************************************
280 * GPIO keyboard
281 ******************************************************************************/
282#if defined(CONFIG_KEYBOARD_MATRIX) || defined(CONFIG_KEYBOARD_MATRIX_MODULE)
247 283
248/*
249 * Spitz Keyboard Device
250 */
251#define SPITZ_KEY_CALENDAR KEY_F1 284#define SPITZ_KEY_CALENDAR KEY_F1
252#define SPITZ_KEY_ADDRESS KEY_F2 285#define SPITZ_KEY_ADDRESS KEY_F2
253#define SPITZ_KEY_FN KEY_F3 286#define SPITZ_KEY_FN KEY_F3
@@ -263,7 +296,7 @@ EXPORT_SYMBOL(spitzscoop2_device);
263#define SPITZ_KEY_OK KEY_F11 296#define SPITZ_KEY_OK KEY_F11
264#define SPITZ_KEY_MENU KEY_F12 297#define SPITZ_KEY_MENU KEY_F12
265 298
266static const uint32_t spitzkbd_keymap[] = { 299static const uint32_t spitz_keymap[] = {
267 KEY(0, 0, KEY_LEFTCTRL), 300 KEY(0, 0, KEY_LEFTCTRL),
268 KEY(0, 1, KEY_1), 301 KEY(0, 1, KEY_1),
269 KEY(0, 2, KEY_3), 302 KEY(0, 2, KEY_3),
@@ -330,36 +363,47 @@ static const uint32_t spitzkbd_keymap[] = {
330 KEY(6, 8, KEY_RIGHT), 363 KEY(6, 8, KEY_RIGHT),
331}; 364};
332 365
333static const struct matrix_keymap_data spitzkbd_keymap_data = { 366static const struct matrix_keymap_data spitz_keymap_data = {
334 .keymap = spitzkbd_keymap, 367 .keymap = spitz_keymap,
335 .keymap_size = ARRAY_SIZE(spitzkbd_keymap), 368 .keymap_size = ARRAY_SIZE(spitz_keymap),
336}; 369};
337 370
338static const uint32_t spitzkbd_row_gpios[] = 371static const uint32_t spitz_row_gpios[] =
339 { 12, 17, 91, 34, 36, 38, 39 }; 372 { 12, 17, 91, 34, 36, 38, 39 };
340static const uint32_t spitzkbd_col_gpios[] = 373static const uint32_t spitz_col_gpios[] =
341 { 88, 23, 24, 25, 26, 27, 52, 103, 107, 108, 114 }; 374 { 88, 23, 24, 25, 26, 27, 52, 103, 107, 108, 114 };
342 375
343static struct matrix_keypad_platform_data spitzkbd_pdata = { 376static struct matrix_keypad_platform_data spitz_mkp_pdata = {
344 .keymap_data = &spitzkbd_keymap_data, 377 .keymap_data = &spitz_keymap_data,
345 .row_gpios = spitzkbd_row_gpios, 378 .row_gpios = spitz_row_gpios,
346 .col_gpios = spitzkbd_col_gpios, 379 .col_gpios = spitz_col_gpios,
347 .num_row_gpios = ARRAY_SIZE(spitzkbd_row_gpios), 380 .num_row_gpios = ARRAY_SIZE(spitz_row_gpios),
348 .num_col_gpios = ARRAY_SIZE(spitzkbd_col_gpios), 381 .num_col_gpios = ARRAY_SIZE(spitz_col_gpios),
349 .col_scan_delay_us = 10, 382 .col_scan_delay_us = 10,
350 .debounce_ms = 10, 383 .debounce_ms = 10,
351 .wakeup = 1, 384 .wakeup = 1,
352}; 385};
353 386
354static struct platform_device spitzkbd_device = { 387static struct platform_device spitz_mkp_device = {
355 .name = "matrix-keypad", 388 .name = "matrix-keypad",
356 .id = -1, 389 .id = -1,
357 .dev = { 390 .dev = {
358 .platform_data = &spitzkbd_pdata, 391 .platform_data = &spitz_mkp_pdata,
359 }, 392 },
360}; 393};
361 394
395static void __init spitz_mkp_init(void)
396{
397 platform_device_register(&spitz_mkp_device);
398}
399#else
400static inline void spitz_mkp_init(void) {}
401#endif
362 402
403/******************************************************************************
404 * GPIO keys
405 ******************************************************************************/
406#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
363static struct gpio_keys_button spitz_gpio_keys[] = { 407static struct gpio_keys_button spitz_gpio_keys[] = {
364 { 408 {
365 .type = EV_PWR, 409 .type = EV_PWR,
@@ -396,10 +440,18 @@ static struct platform_device spitz_gpio_keys_device = {
396 }, 440 },
397}; 441};
398 442
443static void __init spitz_keys_init(void)
444{
445 platform_device_register(&spitz_gpio_keys_device);
446}
447#else
448static inline void spitz_keys_init(void) {}
449#endif
399 450
400/* 451/******************************************************************************
401 * Spitz LEDs 452 * LEDs
402 */ 453 ******************************************************************************/
454#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
403static struct gpio_led spitz_gpio_leds[] = { 455static struct gpio_led spitz_gpio_leds[] = {
404 { 456 {
405 .name = "spitz:amber:charge", 457 .name = "spitz:amber:charge",
@@ -418,20 +470,27 @@ static struct gpio_led_platform_data spitz_gpio_leds_info = {
418 .num_leds = ARRAY_SIZE(spitz_gpio_leds), 470 .num_leds = ARRAY_SIZE(spitz_gpio_leds),
419}; 471};
420 472
421static struct platform_device spitzled_device = { 473static struct platform_device spitz_led_device = {
422 .name = "leds-gpio", 474 .name = "leds-gpio",
423 .id = -1, 475 .id = -1,
424 .dev = { 476 .dev = {
425 .platform_data = &spitz_gpio_leds_info, 477 .platform_data = &spitz_gpio_leds_info,
426 }, 478 },
427}; 479};
428 480
429#if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE) 481static void __init spitz_leds_init(void)
430static struct pxa2xx_spi_master spitz_spi_info = { 482{
431 .num_chipselect = 3, 483 platform_device_register(&spitz_led_device);
432}; 484}
485#else
486static inline void spitz_leds_init(void) {}
487#endif
433 488
434static void spitz_wait_for_hsync(void) 489/******************************************************************************
490 * SSP Devices
491 ******************************************************************************/
492#if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE)
493static void spitz_ads7846_wait_for_hsync(void)
435{ 494{
436 while (gpio_get_value(SPITZ_GPIO_HSYNC)) 495 while (gpio_get_value(SPITZ_GPIO_HSYNC))
437 cpu_relax(); 496 cpu_relax();
@@ -447,7 +506,7 @@ static struct ads7846_platform_data spitz_ads7846_info = {
447 .y_plate_ohms = 486, 506 .y_plate_ohms = 486,
448 .pressure_max = 1024, 507 .pressure_max = 1024,
449 .gpio_pendown = SPITZ_GPIO_TP_INT, 508 .gpio_pendown = SPITZ_GPIO_TP_INT,
450 .wait_for_sync = spitz_wait_for_hsync, 509 .wait_for_sync = spitz_ads7846_wait_for_hsync,
451}; 510};
452 511
453static struct pxa2xx_spi_chip spitz_ads7846_chip = { 512static struct pxa2xx_spi_chip spitz_ads7846_chip = {
@@ -485,72 +544,88 @@ static struct pxa2xx_spi_chip spitz_max1111_chip = {
485 544
486static struct spi_board_info spitz_spi_devices[] = { 545static struct spi_board_info spitz_spi_devices[] = {
487 { 546 {
488 .modalias = "ads7846", 547 .modalias = "ads7846",
489 .max_speed_hz = 1200000, 548 .max_speed_hz = 1200000,
490 .bus_num = 2, 549 .bus_num = 2,
491 .chip_select = 0, 550 .chip_select = 0,
492 .platform_data = &spitz_ads7846_info, 551 .platform_data = &spitz_ads7846_info,
493 .controller_data= &spitz_ads7846_chip, 552 .controller_data = &spitz_ads7846_chip,
494 .irq = gpio_to_irq(SPITZ_GPIO_TP_INT), 553 .irq = gpio_to_irq(SPITZ_GPIO_TP_INT),
495 }, { 554 }, {
496 .modalias = "corgi-lcd", 555 .modalias = "corgi-lcd",
497 .max_speed_hz = 50000, 556 .max_speed_hz = 50000,
498 .bus_num = 2, 557 .bus_num = 2,
499 .chip_select = 1, 558 .chip_select = 1,
500 .platform_data = &spitz_lcdcon_info, 559 .platform_data = &spitz_lcdcon_info,
501 .controller_data= &spitz_lcdcon_chip, 560 .controller_data = &spitz_lcdcon_chip,
502 }, { 561 }, {
503 .modalias = "max1111", 562 .modalias = "max1111",
504 .max_speed_hz = 450000, 563 .max_speed_hz = 450000,
505 .bus_num = 2, 564 .bus_num = 2,
506 .chip_select = 2, 565 .chip_select = 2,
507 .controller_data= &spitz_max1111_chip, 566 .controller_data = &spitz_max1111_chip,
508 }, 567 },
509}; 568};
510 569
511static void __init spitz_init_spi(void) 570static struct pxa2xx_spi_master spitz_spi_info = {
571 .num_chipselect = 3,
572};
573
574static void __init spitz_spi_init(void)
512{ 575{
576 struct corgi_lcd_platform_data *lcd_data = &spitz_lcdcon_info;
577
513 if (machine_is_akita()) { 578 if (machine_is_akita()) {
514 spitz_lcdcon_info.gpio_backlight_cont = AKITA_GPIO_BACKLIGHT_CONT; 579 lcd_data->gpio_backlight_cont = AKITA_GPIO_BACKLIGHT_CONT;
515 spitz_lcdcon_info.gpio_backlight_on = AKITA_GPIO_BACKLIGHT_ON; 580 lcd_data->gpio_backlight_on = AKITA_GPIO_BACKLIGHT_ON;
516 } 581 }
517 582
518 pxa2xx_set_spi_info(2, &spitz_spi_info); 583 pxa2xx_set_spi_info(2, &spitz_spi_info);
519 spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices)); 584 spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices));
520} 585}
521#else 586#else
522static inline void spitz_init_spi(void) {} 587static inline void spitz_spi_init(void) {}
523#endif 588#endif
524 589
590/******************************************************************************
591 * SD/MMC card controller
592 ******************************************************************************/
593#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
525/* 594/*
526 * MMC/SD Device 595 * NOTE: The card detect interrupt isn't debounced so we delay it by 250ms to
527 * 596 * give the card a chance to fully insert/eject.
528 * The card detect interrupt isn't debounced so we delay it by 250ms
529 * to give the card a chance to fully insert/eject.
530 */ 597 */
531static void spitz_mci_setpower(struct device *dev, unsigned int vdd) 598static void spitz_mci_setpower(struct device *dev, unsigned int vdd)
532{ 599{
533 struct pxamci_platform_data* p_d = dev->platform_data; 600 struct pxamci_platform_data* p_d = dev->platform_data;
534 601
535 if (( 1 << vdd) & p_d->ocr_mask) 602 if ((1 << vdd) & p_d->ocr_mask)
536 spitz_card_pwr_ctrl(SPITZ_PWR_SD, 0x0004); 603 spitz_card_pwr_ctrl(SCOOP_CPR_SD_3V, SCOOP_CPR_SD_3V);
537 else 604 else
538 spitz_card_pwr_ctrl(SPITZ_PWR_SD, 0x0000); 605 spitz_card_pwr_ctrl(SCOOP_CPR_SD_3V, 0x0);
539} 606}
540 607
541static struct pxamci_platform_data spitz_mci_platform_data = { 608static struct pxamci_platform_data spitz_mci_platform_data = {
542 .detect_delay_ms = 250, 609 .detect_delay_ms = 250,
543 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, 610 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
544 .setpower = spitz_mci_setpower, 611 .setpower = spitz_mci_setpower,
545 .gpio_card_detect = SPITZ_GPIO_nSD_DETECT, 612 .gpio_card_detect = SPITZ_GPIO_nSD_DETECT,
546 .gpio_card_ro = SPITZ_GPIO_nSD_WP, 613 .gpio_card_ro = SPITZ_GPIO_nSD_WP,
547 .gpio_power = -1, 614 .gpio_power = -1,
548}; 615};
549 616
617static void __init spitz_mmc_init(void)
618{
619 pxa_set_mci_info(&spitz_mci_platform_data);
620}
621#else
622static inline void spitz_mmc_init(void) {}
623#endif
550 624
551/* 625/******************************************************************************
552 * USB Host (OHCI) 626 * USB Host
553 */ 627 ******************************************************************************/
628#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
554static int spitz_ohci_init(struct device *dev) 629static int spitz_ohci_init(struct device *dev)
555{ 630{
556 int err; 631 int err;
@@ -559,9 +634,7 @@ static int spitz_ohci_init(struct device *dev)
559 if (err) 634 if (err)
560 return err; 635 return err;
561 636
562 /* Only Port 2 is connected 637 /* Only Port 2 is connected, setup USB Port 2 Output Control Register */
563 * Setup USB Port 2 Output Control Register
564 */
565 UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE; 638 UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
566 639
567 return gpio_direction_output(SPITZ_GPIO_USB_HOST, 1); 640 return gpio_direction_output(SPITZ_GPIO_USB_HOST, 1);
@@ -580,67 +653,95 @@ static struct pxaohci_platform_data spitz_ohci_platform_data = {
580 .power_budget = 150, 653 .power_budget = 150,
581}; 654};
582 655
656static void __init spitz_uhc_init(void)
657{
658 pxa_set_ohci_info(&spitz_ohci_platform_data);
659}
660#else
661static inline void spitz_uhc_init(void) {}
662#endif
583 663
584/* 664/******************************************************************************
585 * Irda 665 * IrDA
586 */ 666 ******************************************************************************/
587 667#if defined(CONFIG_PXA_FICP) || defined(CONFIG_PXA_FICP_MODULE)
588static struct pxaficp_platform_data spitz_ficp_platform_data = { 668static struct pxaficp_platform_data spitz_ficp_platform_data = {
589/* .gpio_pwdown is set in spitz_init() and akita_init() accordingly */
590 .transceiver_cap = IR_SIRMODE | IR_OFF, 669 .transceiver_cap = IR_SIRMODE | IR_OFF,
591}; 670};
592 671
672static void __init spitz_irda_init(void)
673{
674 if (machine_is_akita())
675 spitz_ficp_platform_data.gpio_pwdown = AKITA_GPIO_IR_ON;
676 else
677 spitz_ficp_platform_data.gpio_pwdown = SPITZ_GPIO_IR_ON;
593 678
594/* 679 pxa_set_ficp_info(&spitz_ficp_platform_data);
595 * Spitz PXA Framebuffer 680}
596 */ 681#else
682static inline void spitz_irda_init(void) {}
683#endif
597 684
685/******************************************************************************
686 * Framebuffer
687 ******************************************************************************/
688#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
598static struct pxafb_mode_info spitz_pxafb_modes[] = { 689static struct pxafb_mode_info spitz_pxafb_modes[] = {
599{ 690 {
600 .pixclock = 19231, 691 .pixclock = 19231,
601 .xres = 480, 692 .xres = 480,
602 .yres = 640, 693 .yres = 640,
603 .bpp = 16, 694 .bpp = 16,
604 .hsync_len = 40, 695 .hsync_len = 40,
605 .left_margin = 46, 696 .left_margin = 46,
606 .right_margin = 125, 697 .right_margin = 125,
607 .vsync_len = 3, 698 .vsync_len = 3,
608 .upper_margin = 1, 699 .upper_margin = 1,
609 .lower_margin = 0, 700 .lower_margin = 0,
610 .sync = 0, 701 .sync = 0,
611},{ 702 }, {
612 .pixclock = 134617, 703 .pixclock = 134617,
613 .xres = 240, 704 .xres = 240,
614 .yres = 320, 705 .yres = 320,
615 .bpp = 16, 706 .bpp = 16,
616 .hsync_len = 20, 707 .hsync_len = 20,
617 .left_margin = 20, 708 .left_margin = 20,
618 .right_margin = 46, 709 .right_margin = 46,
619 .vsync_len = 2, 710 .vsync_len = 2,
620 .upper_margin = 1, 711 .upper_margin = 1,
621 .lower_margin = 0, 712 .lower_margin = 0,
622 .sync = 0, 713 .sync = 0,
623}, 714 },
624}; 715};
625 716
626static struct pxafb_mach_info spitz_pxafb_info = { 717static struct pxafb_mach_info spitz_pxafb_info = {
627 .modes = &spitz_pxafb_modes[0], 718 .modes = spitz_pxafb_modes,
628 .num_modes = 2, 719 .num_modes = ARRAY_SIZE(spitz_pxafb_modes),
629 .fixed_modes = 1, 720 .fixed_modes = 1,
630 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_ALTERNATE_MAPPING, 721 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_ALTERNATE_MAPPING,
631}; 722};
632 723
633static struct mtd_partition sharpsl_nand_partitions[] = { 724static void __init spitz_lcd_init(void)
725{
726 set_pxa_fb_info(&spitz_pxafb_info);
727}
728#else
729static inline void spitz_lcd_init(void) {}
730#endif
731
732/******************************************************************************
733 * Framebuffer
734 ******************************************************************************/
735#if defined(CONFIG_MTD_NAND_SHARPSL) || defined(CONFIG_MTD_NAND_SHARPSL_MODULE)
736static struct mtd_partition spitz_nand_partitions[] = {
634 { 737 {
635 .name = "System Area", 738 .name = "System Area",
636 .offset = 0, 739 .offset = 0,
637 .size = 7 * 1024 * 1024, 740 .size = 7 * 1024 * 1024,
638 }, 741 }, {
639 {
640 .name = "Root Filesystem", 742 .name = "Root Filesystem",
641 .offset = 7 * 1024 * 1024, 743 .offset = 7 * 1024 * 1024,
642 }, 744 }, {
643 {
644 .name = "Home Filesystem", 745 .name = "Home Filesystem",
645 .offset = MTDPART_OFS_APPEND, 746 .offset = MTDPART_OFS_APPEND,
646 .size = MTDPART_SIZ_FULL, 747 .size = MTDPART_SIZ_FULL,
@@ -649,37 +750,72 @@ static struct mtd_partition sharpsl_nand_partitions[] = {
649 750
650static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; 751static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
651 752
652static struct nand_bbt_descr sharpsl_bbt = { 753static struct nand_bbt_descr spitz_nand_bbt = {
653 .options = 0, 754 .options = 0,
654 .offs = 4, 755 .offs = 4,
655 .len = 2, 756 .len = 2,
656 .pattern = scan_ff_pattern 757 .pattern = scan_ff_pattern
758};
759
760static struct nand_ecclayout akita_oobinfo = {
761 .oobfree = { {0x08, 0x09} },
762 .eccbytes = 24,
763 .eccpos = {
764 0x05, 0x01, 0x02, 0x03, 0x06, 0x07, 0x15, 0x11,
765 0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23,
766 0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37,
767 },
657}; 768};
658 769
659static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = { 770static struct sharpsl_nand_platform_data spitz_nand_pdata = {
660 .badblock_pattern = &sharpsl_bbt, 771 .badblock_pattern = &spitz_nand_bbt,
661 .partitions = sharpsl_nand_partitions, 772 .partitions = spitz_nand_partitions,
662 .nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions), 773 .nr_partitions = ARRAY_SIZE(spitz_nand_partitions),
663}; 774};
664 775
665static struct resource sharpsl_nand_resources[] = { 776static struct resource spitz_nand_resources[] = {
666 { 777 {
667 .start = 0x0C000000, 778 .start = PXA_CS3_PHYS,
668 .end = 0x0C000FFF, 779 .end = PXA_CS3_PHYS + SZ_4K - 1,
669 .flags = IORESOURCE_MEM, 780 .flags = IORESOURCE_MEM,
670 }, 781 },
671}; 782};
672 783
673static struct platform_device sharpsl_nand_device = { 784static struct platform_device spitz_nand_device = {
674 .name = "sharpsl-nand", 785 .name = "sharpsl-nand",
675 .id = -1, 786 .id = -1,
676 .resource = sharpsl_nand_resources, 787 .resource = spitz_nand_resources,
677 .num_resources = ARRAY_SIZE(sharpsl_nand_resources), 788 .num_resources = ARRAY_SIZE(spitz_nand_resources),
678 .dev.platform_data = &sharpsl_nand_platform_data, 789 .dev = {
790 .platform_data = &spitz_nand_pdata,
791 }
679}; 792};
680 793
794static void __init spitz_nand_init(void)
795{
796 if (machine_is_spitz()) {
797 spitz_nand_partitions[1].size = 5 * 1024 * 1024;
798 } else if (machine_is_akita()) {
799 spitz_nand_partitions[1].size = 58 * 1024 * 1024;
800 spitz_nand_bbt.len = 1;
801 spitz_nand_pdata.ecc_layout = &akita_oobinfo;
802 } else if (machine_is_borzoi()) {
803 spitz_nand_partitions[1].size = 32 * 1024 * 1024;
804 spitz_nand_bbt.len = 1;
805 spitz_nand_pdata.ecc_layout = &akita_oobinfo;
806 }
807
808 platform_device_register(&spitz_nand_device);
809}
810#else
811static inline void spitz_nand_init(void) {}
812#endif
681 813
682static struct mtd_partition sharpsl_rom_parts[] = { 814/******************************************************************************
815 * NOR Flash
816 ******************************************************************************/
817#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
818static struct mtd_partition spitz_rom_parts[] = {
683 { 819 {
684 .name ="Boot PROM Filesystem", 820 .name ="Boot PROM Filesystem",
685 .offset = 0x00140000, 821 .offset = 0x00140000,
@@ -687,37 +823,105 @@ static struct mtd_partition sharpsl_rom_parts[] = {
687 }, 823 },
688}; 824};
689 825
690static struct physmap_flash_data sharpsl_rom_data = { 826static struct physmap_flash_data spitz_rom_data = {
691 .width = 2, 827 .width = 2,
692 .nr_parts = ARRAY_SIZE(sharpsl_rom_parts), 828 .nr_parts = ARRAY_SIZE(spitz_rom_parts),
693 .parts = sharpsl_rom_parts, 829 .parts = spitz_rom_parts,
694}; 830};
695 831
696static struct resource sharpsl_rom_resources[] = { 832static struct resource spitz_rom_resources[] = {
697 { 833 {
698 .start = 0x00000000, 834 .start = PXA_CS0_PHYS,
699 .end = 0x007fffff, 835 .end = PXA_CS0_PHYS + SZ_8M - 1,
700 .flags = IORESOURCE_MEM, 836 .flags = IORESOURCE_MEM,
701 }, 837 },
702}; 838};
703 839
704static struct platform_device sharpsl_rom_device = { 840static struct platform_device spitz_rom_device = {
705 .name = "physmap-flash", 841 .name = "physmap-flash",
706 .id = -1, 842 .id = -1,
707 .resource = sharpsl_rom_resources, 843 .resource = spitz_rom_resources,
708 .num_resources = ARRAY_SIZE(sharpsl_rom_resources), 844 .num_resources = ARRAY_SIZE(spitz_rom_resources),
709 .dev.platform_data = &sharpsl_rom_data, 845 .dev = {
846 .platform_data = &spitz_rom_data,
847 },
710}; 848};
711 849
712static struct platform_device *devices[] __initdata = { 850static void __init spitz_nor_init(void)
713 &spitzscoop_device, 851{
714 &spitzkbd_device, 852 platform_device_register(&spitz_rom_device);
715 &spitz_gpio_keys_device, 853}
716 &spitzled_device, 854#else
717 &sharpsl_nand_device, 855static inline void spitz_nor_init(void) {}
718 &sharpsl_rom_device, 856#endif
857
858/******************************************************************************
859 * GPIO expander
860 ******************************************************************************/
861#if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE)
862static struct pca953x_platform_data akita_pca953x_pdata = {
863 .gpio_base = AKITA_IOEXP_GPIO_BASE,
719}; 864};
720 865
866static struct i2c_board_info spitz_i2c_devs[] = {
867 {
868 .type = "wm8750",
869 .addr = 0x1b,
870 }, {
871 .type = "max7310",
872 .addr = 0x18,
873 .platform_data = &akita_pca953x_pdata,
874 },
875};
876
877static struct regulator_consumer_supply isl6271a_consumers[] = {
878 {
879 .supply = "vcc_core",
880 }
881};
882
883static struct regulator_init_data isl6271a_info[] = {
884 {
885 .constraints = {
886 .name = "vcc_core range",
887 .min_uV = 850000,
888 .max_uV = 1600000,
889 .always_on = 1,
890 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
891 },
892 .consumer_supplies = isl6271a_consumers,
893 .num_consumer_supplies = ARRAY_SIZE(isl6271a_consumers),
894 }
895};
896
897static struct i2c_board_info spitz_pi2c_devs[] = {
898 {
899 .type = "isl6271a",
900 .addr = 0x0c,
901 .platform_data = &isl6271a_info,
902 },
903};
904
905static void __init spitz_i2c_init(void)
906{
907 int size = ARRAY_SIZE(spitz_i2c_devs);
908
909 /* Only Akita has the max7310 chip */
910 if (!machine_is_akita())
911 size--;
912
913 pxa_set_i2c_info(NULL);
914 pxa27x_set_i2c_power_info(NULL);
915 i2c_register_board_info(0, spitz_i2c_devs, size);
916 i2c_register_board_info(1, ARRAY_AND_SIZE(spitz_pi2c_devs));
917}
918#else
919static inline void spitz_i2c_init(void) {}
920#endif
921
922/******************************************************************************
923 * Machine init
924 ******************************************************************************/
721static void spitz_poweroff(void) 925static void spitz_poweroff(void)
722{ 926{
723 arm_machine_restart('g', NULL); 927 arm_machine_restart('g', NULL);
@@ -726,26 +930,18 @@ static void spitz_poweroff(void)
726static void spitz_restart(char mode, const char *cmd) 930static void spitz_restart(char mode, const char *cmd)
727{ 931{
728 /* Bootloader magic for a reboot */ 932 /* Bootloader magic for a reboot */
729 if((MSC0 & 0xffff0000) == 0x7ff00000) 933 if ((MSC0 & 0xffff0000) == 0x7ff00000)
730 MSC0 = (MSC0 & 0xffff) | 0x7ee00000; 934 MSC0 = (MSC0 & 0xffff) | 0x7ee00000;
731 935
732 spitz_poweroff(); 936 spitz_poweroff();
733} 937}
734 938
735static void __init common_init(void) 939static void __init spitz_init(void)
736{ 940{
737 init_gpio_reset(SPITZ_GPIO_ON_RESET, 1, 0); 941 init_gpio_reset(SPITZ_GPIO_ON_RESET, 1, 0);
738 pm_power_off = spitz_poweroff; 942 pm_power_off = spitz_poweroff;
739 arm_pm_restart = spitz_restart; 943 arm_pm_restart = spitz_restart;
740 944
741 if (machine_is_spitz()) {
742 sharpsl_nand_partitions[1].size = 5 * 1024 * 1024;
743 } else if (machine_is_akita()) {
744 sharpsl_nand_partitions[1].size = 58 * 1024 * 1024;
745 } else if (machine_is_borzoi()) {
746 sharpsl_nand_partitions[1].size = 32 * 1024 * 1024;
747 }
748
749 PMCR = 0x00; 945 PMCR = 0x00;
750 946
751 /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */ 947 /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */
@@ -757,91 +953,22 @@ static void __init common_init(void)
757 pxa_set_btuart_info(NULL); 953 pxa_set_btuart_info(NULL);
758 pxa_set_stuart_info(NULL); 954 pxa_set_stuart_info(NULL);
759 955
760 spitz_init_spi(); 956 spitz_spi_init();
761 957 spitz_scoop_init();
762 platform_add_devices(devices, ARRAY_SIZE(devices)); 958 spitz_mkp_init();
763 pxa_set_mci_info(&spitz_mci_platform_data); 959 spitz_keys_init();
764 pxa_set_ohci_info(&spitz_ohci_platform_data); 960 spitz_leds_init();
765 pxa_set_ficp_info(&spitz_ficp_platform_data); 961 spitz_mmc_init();
766 set_pxa_fb_info(&spitz_pxafb_info); 962 spitz_pcmcia_init();
767 pxa_set_i2c_info(NULL); 963 spitz_irda_init();
964 spitz_uhc_init();
965 spitz_lcd_init();
966 spitz_nor_init();
967 spitz_nand_init();
968 spitz_i2c_init();
768} 969}
769 970
770#if defined(CONFIG_MACH_AKITA) || defined(CONFIG_MACH_BORZOI) 971static void __init spitz_fixup(struct machine_desc *desc,
771static struct nand_bbt_descr sharpsl_akita_bbt = {
772 .options = 0,
773 .offs = 4,
774 .len = 1,
775 .pattern = scan_ff_pattern
776};
777
778static struct nand_ecclayout akita_oobinfo = {
779 .eccbytes = 24,
780 .eccpos = {
781 0x5, 0x1, 0x2, 0x3, 0x6, 0x7, 0x15, 0x11,
782 0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23,
783 0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37},
784 .oobfree = {{0x08, 0x09}}
785};
786#endif
787
788#if defined(CONFIG_MACH_SPITZ) || defined(CONFIG_MACH_BORZOI)
789static void __init spitz_init(void)
790{
791 spitz_ficp_platform_data.gpio_pwdown = SPITZ_GPIO_IR_ON;
792
793#ifdef CONFIG_MACH_BORZOI
794 if (machine_is_borzoi()) {
795 sharpsl_nand_platform_data.badblock_pattern = &sharpsl_akita_bbt;
796 sharpsl_nand_platform_data.ecc_layout = &akita_oobinfo;
797 }
798#endif
799
800 platform_scoop_config = &spitz_pcmcia_config;
801
802 common_init();
803
804 platform_device_register(&spitzscoop2_device);
805}
806#endif
807
808#ifdef CONFIG_MACH_AKITA
809/*
810 * Akita IO Expander
811 */
812static struct pca953x_platform_data akita_ioexp = {
813 .gpio_base = AKITA_IOEXP_GPIO_BASE,
814};
815
816static struct i2c_board_info akita_i2c_board_info[] = {
817 {
818 .type = "max7310",
819 .addr = 0x18,
820 .platform_data = &akita_ioexp,
821 }, {
822 .type = "wm8750",
823 .addr = 0x1b,
824 },
825};
826
827static void __init akita_init(void)
828{
829 spitz_ficp_platform_data.gpio_pwdown = AKITA_GPIO_IR_ON;
830
831 sharpsl_nand_platform_data.badblock_pattern = &sharpsl_akita_bbt;
832 sharpsl_nand_platform_data.ecc_layout = &akita_oobinfo;
833
834 /* We just pretend the second element of the array doesn't exist */
835 spitz_pcmcia_config.num_devs = 1;
836 platform_scoop_config = &spitz_pcmcia_config;
837
838 i2c_register_board_info(0, ARRAY_AND_SIZE(akita_i2c_board_info));
839
840 common_init();
841}
842#endif
843
844static void __init fixup_spitz(struct machine_desc *desc,
845 struct tag *tags, char **cmdline, struct meminfo *mi) 972 struct tag *tags, char **cmdline, struct meminfo *mi)
846{ 973{
847 sharpsl_save_param(); 974 sharpsl_save_param();
@@ -854,7 +981,7 @@ static void __init fixup_spitz(struct machine_desc *desc,
854MACHINE_START(SPITZ, "SHARP Spitz") 981MACHINE_START(SPITZ, "SHARP Spitz")
855 .phys_io = 0x40000000, 982 .phys_io = 0x40000000,
856 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, 983 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
857 .fixup = fixup_spitz, 984 .fixup = spitz_fixup,
858 .map_io = pxa_map_io, 985 .map_io = pxa_map_io,
859 .init_irq = pxa27x_init_irq, 986 .init_irq = pxa27x_init_irq,
860 .init_machine = spitz_init, 987 .init_machine = spitz_init,
@@ -866,7 +993,7 @@ MACHINE_END
866MACHINE_START(BORZOI, "SHARP Borzoi") 993MACHINE_START(BORZOI, "SHARP Borzoi")
867 .phys_io = 0x40000000, 994 .phys_io = 0x40000000,
868 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, 995 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
869 .fixup = fixup_spitz, 996 .fixup = spitz_fixup,
870 .map_io = pxa_map_io, 997 .map_io = pxa_map_io,
871 .init_irq = pxa27x_init_irq, 998 .init_irq = pxa27x_init_irq,
872 .init_machine = spitz_init, 999 .init_machine = spitz_init,
@@ -878,10 +1005,10 @@ MACHINE_END
878MACHINE_START(AKITA, "SHARP Akita") 1005MACHINE_START(AKITA, "SHARP Akita")
879 .phys_io = 0x40000000, 1006 .phys_io = 0x40000000,
880 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, 1007 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
881 .fixup = fixup_spitz, 1008 .fixup = spitz_fixup,
882 .map_io = pxa_map_io, 1009 .map_io = pxa_map_io,
883 .init_irq = pxa27x_init_irq, 1010 .init_irq = pxa27x_init_irq,
884 .init_machine = akita_init, 1011 .init_machine = spitz_init,
885 .timer = &pxa_timer, 1012 .timer = &pxa_timer,
886MACHINE_END 1013MACHINE_END
887#endif 1014#endif
diff --git a/arch/arm/mach-pxa/spitz_pm.c b/arch/arm/mach-pxa/spitz_pm.c
index 4209ddf6da61..7fe74067d85f 100644
--- a/arch/arm/mach-pxa/spitz_pm.c
+++ b/arch/arm/mach-pxa/spitz_pm.c
@@ -22,11 +22,10 @@
22#include <asm/mach-types.h> 22#include <asm/mach-types.h>
23#include <mach/hardware.h> 23#include <mach/hardware.h>
24 24
25#include <mach/sharpsl.h>
26#include <mach/spitz.h> 25#include <mach/spitz.h>
27#include <mach/pxa27x.h> 26#include <mach/pxa27x.h>
27#include <mach/sharpsl_pm.h>
28 28
29#include "sharpsl.h"
30#include "generic.h" 29#include "generic.h"
31 30
32#define SHARPSL_CHARGE_ON_VOLT 0x99 /* 2.9V */ 31#define SHARPSL_CHARGE_ON_VOLT 0x99 /* 2.9V */
@@ -178,11 +177,11 @@ unsigned long spitzpm_read_devdata(int type)
178 case SHARPSL_STATUS_ACIN: 177 case SHARPSL_STATUS_ACIN:
179 return (((~GPLR(SPITZ_GPIO_AC_IN)) & GPIO_bit(SPITZ_GPIO_AC_IN)) != 0); 178 return (((~GPLR(SPITZ_GPIO_AC_IN)) & GPIO_bit(SPITZ_GPIO_AC_IN)) != 0);
180 case SHARPSL_STATUS_LOCK: 179 case SHARPSL_STATUS_LOCK:
181 return READ_GPIO_BIT(sharpsl_pm.machinfo->gpio_batlock); 180 return gpio_get_value(sharpsl_pm.machinfo->gpio_batlock);
182 case SHARPSL_STATUS_CHRGFULL: 181 case SHARPSL_STATUS_CHRGFULL:
183 return READ_GPIO_BIT(sharpsl_pm.machinfo->gpio_batfull); 182 return gpio_get_value(sharpsl_pm.machinfo->gpio_batfull);
184 case SHARPSL_STATUS_FATAL: 183 case SHARPSL_STATUS_FATAL:
185 return READ_GPIO_BIT(sharpsl_pm.machinfo->gpio_fatal); 184 return gpio_get_value(sharpsl_pm.machinfo->gpio_fatal);
186 case SHARPSL_ACIN_VOLT: 185 case SHARPSL_ACIN_VOLT:
187 return sharpsl_pm_pxa_read_max1111(MAX1111_ACIN_VOLT); 186 return sharpsl_pm_pxa_read_max1111(MAX1111_ACIN_VOLT);
188 case SHARPSL_BATT_TEMP: 187 case SHARPSL_BATT_TEMP:
@@ -212,8 +211,6 @@ struct sharpsl_charger_machinfo spitz_pm_machinfo = {
212 .should_wakeup = spitz_should_wakeup, 211 .should_wakeup = spitz_should_wakeup,
213#if defined(CONFIG_LCD_CORGI) 212#if defined(CONFIG_LCD_CORGI)
214 .backlight_limit = corgi_lcd_limit_intensity, 213 .backlight_limit = corgi_lcd_limit_intensity,
215#elif defined(CONFIG_BACKLIGHT_CORGI)
216 .backlight_limit = corgibl_limit_intensity,
217#endif 214#endif
218 .charge_on_volt = SHARPSL_CHARGE_ON_VOLT, 215 .charge_on_volt = SHARPSL_CHARGE_ON_VOLT,
219 .charge_on_temp = SHARPSL_CHARGE_ON_TEMP, 216 .charge_on_temp = SHARPSL_CHARGE_ON_TEMP,
diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c
index af40d2a12d37..a654d1e6b38a 100644
--- a/arch/arm/mach-pxa/stargate2.c
+++ b/arch/arm/mach-pxa/stargate2.c
@@ -29,6 +29,7 @@
29#include <linux/i2c/at24.h> 29#include <linux/i2c/at24.h>
30#include <linux/smc91x.h> 30#include <linux/smc91x.h>
31#include <linux/gpio.h> 31#include <linux/gpio.h>
32#include <linux/leds.h>
32 33
33#include <asm/types.h> 34#include <asm/types.h>
34#include <asm/setup.h> 35#include <asm/setup.h>
@@ -62,37 +63,12 @@
62#define SG2_GPIO_nSD_DETECT 90 63#define SG2_GPIO_nSD_DETECT 90
63#define SG2_SD_POWER_ENABLE 89 64#define SG2_SD_POWER_ENABLE 89
64 65
65static unsigned long stargate2_pin_config[] __initdata = { 66static unsigned long sg2_im2_unified_pin_config[] __initdata = {
66
67 GPIO15_nCS_1, /* SRAM */
68 /* SMC91x */
69 GPIO80_nCS_4,
70 GPIO40_GPIO, /*cable detect?*/
71 /* Device Identification for wakeup*/ 67 /* Device Identification for wakeup*/
72 GPIO102_GPIO, 68 GPIO102_GPIO,
73
74 /* Button */
75 GPIO91_GPIO | WAKEUP_ON_LEVEL_HIGH,
76
77 /* DA9030 */ 69 /* DA9030 */
78 GPIO1_GPIO, 70 GPIO1_GPIO,
79 71
80 /* Compact Flash */
81 GPIO79_PSKTSEL,
82 GPIO48_nPOE,
83 GPIO49_nPWE,
84 GPIO50_nPIOR,
85 GPIO51_nPIOW,
86 GPIO85_nPCE_1,
87 GPIO54_nPCE_2,
88 GPIO55_nPREG,
89 GPIO56_nPWAIT,
90 GPIO57_nIOIS16,
91 GPIO120_GPIO, /* Buff ctrl */
92 GPIO108_GPIO, /* Power ctrl */
93 GPIO82_GPIO, /* Reset */
94 GPIO53_GPIO, /* SG2_S0_GPIO_DETECT */
95
96 /* MMC */ 72 /* MMC */
97 GPIO32_MMC_CLK, 73 GPIO32_MMC_CLK,
98 GPIO112_MMC_CMD, 74 GPIO112_MMC_CMD,
@@ -100,49 +76,44 @@ static unsigned long stargate2_pin_config[] __initdata = {
100 GPIO109_MMC_DAT_1, 76 GPIO109_MMC_DAT_1,
101 GPIO110_MMC_DAT_2, 77 GPIO110_MMC_DAT_2,
102 GPIO111_MMC_DAT_3, 78 GPIO111_MMC_DAT_3,
103 GPIO90_GPIO, /* nSD detect */
104 GPIO89_GPIO, /* SD_POWER_ENABLE */
105 79
106 /* Bluetooth */ 80 /* 802.15.4 radio - driver out of mainline */
107 GPIO81_GPIO, /* reset */ 81 GPIO22_GPIO, /* CC_RSTN */
108 82 GPIO114_GPIO, /* CC_FIFO */
109 /* cc2420 802.15.4 radio */ 83 GPIO116_GPIO, /* CC_CCA */
110 GPIO22_GPIO, /* CC_RSTN (out)*/ 84 GPIO0_GPIO, /* CC_FIFOP */
111 GPIO114_GPIO, /* CC_FIFO (in) */ 85 GPIO16_GPIO, /* CCSFD */
112 GPIO116_GPIO, /* CC_CCA (in) */ 86 GPIO115_GPIO, /* Power enable */
113 GPIO0_GPIO, /* CC_FIFOP (in) */
114 GPIO16_GPIO, /* CCSFD (in) */
115 GPIO39_GPIO, /* CSn (out) */
116 87
117 /* I2C */ 88 /* I2C */
118 GPIO117_I2C_SCL, 89 GPIO117_I2C_SCL,
119 GPIO118_I2C_SDA, 90 GPIO118_I2C_SDA,
120 91
121 /* SSP 3 - 802.15.4 radio */ 92 /* SSP 3 - 802.15.4 radio */
122 GPIO39_GPIO, /* chip select */ 93 GPIO39_GPIO, /* Chip Select */
123 GPIO34_SSP3_SCLK, 94 GPIO34_SSP3_SCLK,
124 GPIO35_SSP3_TXD, 95 GPIO35_SSP3_TXD,
125 GPIO41_SSP3_RXD, 96 GPIO41_SSP3_RXD,
126 97
127 /* SSP 2 */ 98 /* SSP 2 to daughter boards */
128 GPIO11_SSP2_RXD, 99 GPIO11_SSP2_RXD,
129 GPIO38_SSP2_TXD, 100 GPIO38_SSP2_TXD,
130 GPIO36_SSP2_SCLK, 101 GPIO36_SSP2_SCLK,
131 GPIO37_GPIO, /* chip select */ 102 GPIO37_GPIO, /* chip select */
132 103
133 /* SSP 1 */ 104 /* SSP 1 - to daughter boards */
134 GPIO26_SSP1_RXD, 105 GPIO24_GPIO, /* Chip Select */
135 GPIO25_SSP1_TXD,
136 GPIO23_SSP1_SCLK, 106 GPIO23_SSP1_SCLK,
137 GPIO24_GPIO, /* chip select */ 107 GPIO25_SSP1_TXD,
108 GPIO26_SSP1_RXD,
138 109
139 /* BTUART */ 110 /* BTUART Basic Connector*/
140 GPIO42_BTUART_RXD, 111 GPIO42_BTUART_RXD,
141 GPIO43_BTUART_TXD, 112 GPIO43_BTUART_TXD,
142 GPIO44_BTUART_CTS, 113 GPIO44_BTUART_CTS,
143 GPIO45_BTUART_RTS, 114 GPIO45_BTUART_RTS,
144 115
145 /* STUART */ 116 /* STUART - IM2 via debug board not sure on SG2*/
146 GPIO46_STUART_RXD, 117 GPIO46_STUART_RXD,
147 GPIO47_STUART_TXD, 118 GPIO47_STUART_TXD,
148 119
@@ -150,47 +121,17 @@ static unsigned long stargate2_pin_config[] __initdata = {
150 GPIO96_GPIO, /* accelerometer interrupt */ 121 GPIO96_GPIO, /* accelerometer interrupt */
151 GPIO99_GPIO, /* ADC interrupt */ 122 GPIO99_GPIO, /* ADC interrupt */
152 123
153 /* Connector pins specified as gpios */
154 GPIO94_GPIO, /* large basic connector pin 14 */
155 GPIO10_GPIO, /* large basic connector pin 23 */
156
157 /* SHT15 */ 124 /* SHT15 */
158 GPIO100_GPIO, 125 GPIO100_GPIO,
159 GPIO98_GPIO, 126 GPIO98_GPIO,
160};
161 127
162/** 128 /* Basic sensor board */
163 * stargate2_reset_bluetooth() reset the bluecore to ensure consistent state 129 GPIO96_GPIO, /* accelerometer interrupt */
164 **/ 130 GPIO99_GPIO, /* ADC interrupt */
165static int stargate2_reset_bluetooth(void)
166{
167 int err;
168 err = gpio_request(SG2_BT_RESET, "SG2_BT_RESET");
169 if (err) {
170 printk(KERN_ERR "Could not get gpio for bluetooth reset \n");
171 return err;
172 }
173 gpio_direction_output(SG2_BT_RESET, 1);
174 mdelay(5);
175 /* now reset it - 5 msec minimum */
176 gpio_set_value(SG2_BT_RESET, 0);
177 mdelay(10);
178 gpio_set_value(SG2_BT_RESET, 1);
179 gpio_free(SG2_BT_RESET);
180 return 0;
181}
182 131
183static struct led_info stargate2_leds[] = { 132 /* Connector pins specified as gpios */
184 { 133 GPIO94_GPIO, /* large basic connector pin 14 */
185 .name = "sg2:red", 134 GPIO10_GPIO, /* large basic connector pin 23 */
186 .flags = DA9030_LED_RATE_ON,
187 }, {
188 .name = "sg2:blue",
189 .flags = DA9030_LED_RATE_ON,
190 }, {
191 .name = "sg2:green",
192 .flags = DA9030_LED_RATE_ON,
193 },
194}; 135};
195 136
196static struct sht15_platform_data platform_data_sht15 = { 137static struct sht15_platform_data platform_data_sht15 = {
@@ -352,20 +293,184 @@ static struct regulator_init_data stargate2_ldo_init_data[] = {
352 }, 293 },
353}; 294};
354 295
355static struct da903x_subdev_info stargate2_da9030_subdevs[] = { 296static struct mtd_partition stargate2flash_partitions[] = {
356 { 297 {
357 .name = "da903x-led", 298 .name = "Bootloader",
358 .id = DA9030_ID_LED_2, 299 .size = 0x00040000,
359 .platform_data = &stargate2_leds[0], 300 .offset = 0,
301 .mask_flags = 0,
360 }, { 302 }, {
361 .name = "da903x-led", 303 .name = "Kernel",
362 .id = DA9030_ID_LED_3, 304 .size = 0x00200000,
363 .platform_data = &stargate2_leds[2], 305 .offset = 0x00040000,
306 .mask_flags = 0
364 }, { 307 }, {
365 .name = "da903x-led", 308 .name = "Filesystem",
366 .id = DA9030_ID_LED_4, 309 .size = 0x01DC0000,
367 .platform_data = &stargate2_leds[1], 310 .offset = 0x00240000,
311 .mask_flags = 0
312 },
313};
314
315static struct resource flash_resources = {
316 .start = PXA_CS0_PHYS,
317 .end = PXA_CS0_PHYS + SZ_32M - 1,
318 .flags = IORESOURCE_MEM,
319};
320
321static struct flash_platform_data stargate2_flash_data = {
322 .map_name = "cfi_probe",
323 .parts = stargate2flash_partitions,
324 .nr_parts = ARRAY_SIZE(stargate2flash_partitions),
325 .name = "PXA27xOnChipROM",
326 .width = 2,
327};
328
329static struct platform_device stargate2_flash_device = {
330 .name = "pxa2xx-flash",
331 .id = 0,
332 .dev = {
333 .platform_data = &stargate2_flash_data,
334 },
335 .resource = &flash_resources,
336 .num_resources = 1,
337};
338
339static struct pxa2xx_spi_master pxa_ssp_master_0_info = {
340 .num_chipselect = 1,
341};
342
343static struct pxa2xx_spi_master pxa_ssp_master_1_info = {
344 .num_chipselect = 1,
345};
346
347static struct pxa2xx_spi_master pxa_ssp_master_2_info = {
348 .num_chipselect = 1,
349};
350
351/* An upcoming kernel change will scrap SFRM usage so these
352 * drivers have been moved to use gpio's via cs_control */
353static struct pxa2xx_spi_chip staccel_chip_info = {
354 .tx_threshold = 8,
355 .rx_threshold = 8,
356 .dma_burst_size = 8,
357 .timeout = 235,
358 .gpio_cs = 24,
359};
360
361static struct pxa2xx_spi_chip cc2420_info = {
362 .tx_threshold = 8,
363 .rx_threshold = 8,
364 .dma_burst_size = 8,
365 .timeout = 235,
366 .gpio_cs = 39,
367};
368
369static struct spi_board_info spi_board_info[] __initdata = {
370 {
371 .modalias = "lis3l02dq",
372 .max_speed_hz = 8000000,/* 8MHz max spi frequency at 3V */
373 .bus_num = 1,
374 .chip_select = 0,
375 .controller_data = &staccel_chip_info,
376 .irq = IRQ_GPIO(96),
368 }, { 377 }, {
378 .modalias = "cc2420",
379 .max_speed_hz = 6500000,
380 .bus_num = 3,
381 .chip_select = 0,
382 .controller_data = &cc2420_info,
383 },
384};
385
386static void sg2_udc_command(int cmd)
387{
388 switch (cmd) {
389 case PXA2XX_UDC_CMD_CONNECT:
390 UP2OCR |= UP2OCR_HXOE | UP2OCR_DPPUE | UP2OCR_DPPUBE;
391 break;
392 case PXA2XX_UDC_CMD_DISCONNECT:
393 UP2OCR &= ~(UP2OCR_HXOE | UP2OCR_DPPUE | UP2OCR_DPPUBE);
394 break;
395 }
396}
397
398static struct i2c_pxa_platform_data i2c_pwr_pdata = {
399 .fast_mode = 1,
400};
401
402static struct i2c_pxa_platform_data i2c_pdata = {
403 .fast_mode = 1,
404};
405
406static void __init imote2_stargate2_init(void)
407{
408
409 pxa2xx_mfp_config(ARRAY_AND_SIZE(sg2_im2_unified_pin_config));
410
411 pxa_set_ffuart_info(NULL);
412 pxa_set_btuart_info(NULL);
413 pxa_set_stuart_info(NULL);
414
415 pxa2xx_set_spi_info(1, &pxa_ssp_master_0_info);
416 pxa2xx_set_spi_info(2, &pxa_ssp_master_1_info);
417 pxa2xx_set_spi_info(3, &pxa_ssp_master_2_info);
418 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
419
420
421 pxa27x_set_i2c_power_info(&i2c_pwr_pdata);
422 pxa_set_i2c_info(&i2c_pdata);
423}
424
425#ifdef CONFIG_MACH_INTELMOTE2
426/* As the the imote2 doesn't currently have a conventional SD slot
427 * there is no option to hotplug cards, making all this rather simple
428 */
429static int imote2_mci_get_ro(struct device *dev)
430{
431 return 0;
432}
433
434/* Rather simple case as hotplugging not possible */
435static struct pxamci_platform_data imote2_mci_platform_data = {
436 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, /* default anyway */
437 .get_ro = imote2_mci_get_ro,
438 .gpio_card_detect = -1,
439 .gpio_card_ro = -1,
440 .gpio_power = -1,
441};
442
443static struct gpio_led imote2_led_pins[] = {
444 {
445 .name = "imote2:red",
446 .gpio = 103,
447 .active_low = 1,
448 }, {
449 .name = "imote2:green",
450 .gpio = 104,
451 .active_low = 1,
452 }, {
453 .name = "imote2:blue",
454 .gpio = 105,
455 .active_low = 1,
456 },
457};
458
459static struct gpio_led_platform_data imote2_led_data = {
460 .num_leds = ARRAY_SIZE(imote2_led_pins),
461 .leds = imote2_led_pins,
462};
463
464static struct platform_device imote2_leds = {
465 .name = "leds-gpio",
466 .id = -1,
467 .dev = {
468 .platform_data = &imote2_led_data,
469 },
470};
471
472static struct da903x_subdev_info imote2_da9030_subdevs[] = {
473 {
369 .name = "da903x-regulator", 474 .name = "da903x-regulator",
370 .id = DA9030_ID_LDO2, 475 .id = DA9030_ID_LDO2,
371 .platform_data = &stargate2_ldo_init_data[vcc_bbio], 476 .platform_data = &stargate2_ldo_init_data[vcc_bbio],
@@ -428,9 +533,121 @@ static struct da903x_subdev_info stargate2_da9030_subdevs[] = {
428 }, 533 },
429}; 534};
430 535
431static struct da903x_platform_data stargate2_da9030_pdata = { 536static struct da903x_platform_data imote2_da9030_pdata = {
432 .num_subdevs = ARRAY_SIZE(stargate2_da9030_subdevs), 537 .num_subdevs = ARRAY_SIZE(imote2_da9030_subdevs),
433 .subdevs = stargate2_da9030_subdevs, 538 .subdevs = imote2_da9030_subdevs,
539};
540
541static struct i2c_board_info __initdata imote2_pwr_i2c_board_info[] = {
542 {
543 .type = "da9030",
544 .addr = 0x49,
545 .platform_data = &imote2_da9030_pdata,
546 .irq = gpio_to_irq(1),
547 },
548};
549
550static struct i2c_board_info __initdata imote2_i2c_board_info[] = {
551 { /* UCAM sensor board */
552 .type = "max1239",
553 .addr = 0x35,
554 }, { /* ITS400 Sensor board only */
555 .type = "max1363",
556 .addr = 0x34,
557 /* Through a nand gate - Also beware, on V2 sensor board the
558 * pull up resistors are missing.
559 */
560 .irq = IRQ_GPIO(99),
561 }, { /* ITS400 Sensor board only */
562 .type = "tsl2561",
563 .addr = 0x49,
564 /* Through a nand gate - Also beware, on V2 sensor board the
565 * pull up resistors are missing.
566 */
567 .irq = IRQ_GPIO(99),
568 }, { /* ITS400 Sensor board only */
569 .type = "tmp175",
570 .addr = 0x4A,
571 .irq = IRQ_GPIO(96),
572 }, { /* IMB400 Multimedia board */
573 .type = "wm8940",
574 .addr = 0x1A,
575 },
576};
577
578static unsigned long imote2_pin_config[] __initdata = {
579
580 /* Button */
581 GPIO91_GPIO,
582
583 /* LEDS */
584 GPIO103_GPIO, /* red led */
585 GPIO104_GPIO, /* green led */
586 GPIO105_GPIO, /* blue led */
587};
588
589static struct pxa2xx_udc_mach_info imote2_udc_info __initdata = {
590 .udc_command = sg2_udc_command,
591};
592
593static struct platform_device *imote2_devices[] = {
594 &stargate2_flash_device,
595 &imote2_leds,
596 &sht15,
597};
598
599static void __init imote2_init(void)
600{
601 pxa2xx_mfp_config(ARRAY_AND_SIZE(imote2_pin_config));
602
603 imote2_stargate2_init();
604
605 platform_add_devices(imote2_devices, ARRAY_SIZE(imote2_devices));
606
607 i2c_register_board_info(0, imote2_i2c_board_info,
608 ARRAY_SIZE(imote2_i2c_board_info));
609 i2c_register_board_info(1, imote2_pwr_i2c_board_info,
610 ARRAY_SIZE(imote2_pwr_i2c_board_info));
611
612 pxa_set_mci_info(&imote2_mci_platform_data);
613 pxa_set_udc_info(&imote2_udc_info);
614}
615#endif
616
617#ifdef CONFIG_MACH_STARGATE2
618
619static unsigned long stargate2_pin_config[] __initdata = {
620
621 GPIO15_nCS_1, /* SRAM */
622 /* SMC91x */
623 GPIO80_nCS_4,
624 GPIO40_GPIO, /*cable detect?*/
625
626 /* Button */
627 GPIO91_GPIO | WAKEUP_ON_LEVEL_HIGH,
628
629 /* Compact Flash */
630 GPIO79_PSKTSEL,
631 GPIO48_nPOE,
632 GPIO49_nPWE,
633 GPIO50_nPIOR,
634 GPIO51_nPIOW,
635 GPIO85_nPCE_1,
636 GPIO54_nPCE_2,
637 GPIO55_nPREG,
638 GPIO56_nPWAIT,
639 GPIO57_nIOIS16,
640 GPIO120_GPIO, /* Buff ctrl */
641 GPIO108_GPIO, /* Power ctrl */
642 GPIO82_GPIO, /* Reset */
643 GPIO53_GPIO, /* SG2_S0_GPIO_DETECT */
644
645 /* MMC not shared with imote2 */
646 GPIO90_GPIO, /* nSD detect */
647 GPIO89_GPIO, /* SD_POWER_ENABLE */
648
649 /* Bluetooth */
650 GPIO81_GPIO, /* reset */
434}; 651};
435 652
436static struct resource smc91x_resources[] = { 653static struct resource smc91x_resources[] = {
@@ -463,7 +680,6 @@ static struct platform_device smc91x_device = {
463}; 680};
464 681
465 682
466
467/* 683/*
468 * The card detect interrupt isn't debounced so we delay it by 250ms 684 * The card detect interrupt isn't debounced so we delay it by 250ms
469 * to give the card a chance to fully insert / eject. 685 * to give the card a chance to fully insert / eject.
@@ -532,48 +748,6 @@ static struct pxamci_platform_data stargate2_mci_platform_data = {
532 .exit = stargate2_mci_exit, 748 .exit = stargate2_mci_exit,
533}; 749};
534 750
535static struct mtd_partition stargate2flash_partitions[] = {
536 {
537 .name = "Bootloader",
538 .size = 0x00040000,
539 .offset = 0,
540 .mask_flags = 0,
541 }, {
542 .name = "Kernel",
543 .size = 0x00200000,
544 .offset = 0x00040000,
545 .mask_flags = 0
546 }, {
547 .name = "Filesystem",
548 .size = 0x01DC0000,
549 .offset = 0x00240000,
550 .mask_flags = 0
551 },
552};
553
554static struct resource flash_resources = {
555 .start = PXA_CS0_PHYS,
556 .end = PXA_CS0_PHYS + SZ_32M - 1,
557 .flags = IORESOURCE_MEM,
558};
559
560static struct flash_platform_data stargate2_flash_data = {
561 .map_name = "cfi_probe",
562 .parts = stargate2flash_partitions,
563 .nr_parts = ARRAY_SIZE(stargate2flash_partitions),
564 .name = "PXA27xOnChipROM",
565 .width = 2,
566};
567
568static struct platform_device stargate2_flash_device = {
569 .name = "pxa2xx-flash",
570 .id = 0,
571 .dev = {
572 .platform_data = &stargate2_flash_data,
573 },
574 .resource = &flash_resources,
575 .num_resources = 1,
576};
577 751
578/* 752/*
579 * SRAM - The Stargate 2 has 32MB of SRAM. 753 * SRAM - The Stargate 2 has 32MB of SRAM.
@@ -616,6 +790,129 @@ static struct at24_platform_data pca9500_eeprom_pdata = {
616 .page_size = 4, 790 .page_size = 4,
617}; 791};
618 792
793/**
794 * stargate2_reset_bluetooth() reset the bluecore to ensure consistent state
795 **/
796static int stargate2_reset_bluetooth(void)
797{
798 int err;
799 err = gpio_request(SG2_BT_RESET, "SG2_BT_RESET");
800 if (err) {
801 printk(KERN_ERR "Could not get gpio for bluetooth reset\n");
802 return err;
803 }
804 gpio_direction_output(SG2_BT_RESET, 1);
805 mdelay(5);
806 /* now reset it - 5 msec minimum */
807 gpio_set_value(SG2_BT_RESET, 0);
808 mdelay(10);
809 gpio_set_value(SG2_BT_RESET, 1);
810 gpio_free(SG2_BT_RESET);
811 return 0;
812}
813
814static struct led_info stargate2_leds[] = {
815 {
816 .name = "sg2:red",
817 .flags = DA9030_LED_RATE_ON,
818 }, {
819 .name = "sg2:blue",
820 .flags = DA9030_LED_RATE_ON,
821 }, {
822 .name = "sg2:green",
823 .flags = DA9030_LED_RATE_ON,
824 },
825};
826
827static struct da903x_subdev_info stargate2_da9030_subdevs[] = {
828 {
829 .name = "da903x-led",
830 .id = DA9030_ID_LED_2,
831 .platform_data = &stargate2_leds[0],
832 }, {
833 .name = "da903x-led",
834 .id = DA9030_ID_LED_3,
835 .platform_data = &stargate2_leds[2],
836 }, {
837 .name = "da903x-led",
838 .id = DA9030_ID_LED_4,
839 .platform_data = &stargate2_leds[1],
840 }, {
841 .name = "da903x-regulator",
842 .id = DA9030_ID_LDO2,
843 .platform_data = &stargate2_ldo_init_data[vcc_bbio],
844 }, {
845 .name = "da903x-regulator",
846 .id = DA9030_ID_LDO3,
847 .platform_data = &stargate2_ldo_init_data[vcc_bb],
848 }, {
849 .name = "da903x-regulator",
850 .id = DA9030_ID_LDO4,
851 .platform_data = &stargate2_ldo_init_data[vcc_pxa_flash],
852 }, {
853 .name = "da903x-regulator",
854 .id = DA9030_ID_LDO5,
855 .platform_data = &stargate2_ldo_init_data[vcc_cc2420],
856 }, {
857 .name = "da903x-regulator",
858 .id = DA9030_ID_LDO6,
859 .platform_data = &stargate2_ldo_init_data[vcc_vref],
860 }, {
861 .name = "da903x-regulator",
862 .id = DA9030_ID_LDO7,
863 .platform_data = &stargate2_ldo_init_data[vcc_sram_ext],
864 }, {
865 .name = "da903x-regulator",
866 .id = DA9030_ID_LDO8,
867 .platform_data = &stargate2_ldo_init_data[vcc_mica],
868 }, {
869 .name = "da903x-regulator",
870 .id = DA9030_ID_LDO9,
871 .platform_data = &stargate2_ldo_init_data[vcc_bt],
872 }, {
873 .name = "da903x-regulator",
874 .id = DA9030_ID_LDO10,
875 .platform_data = &stargate2_ldo_init_data[vcc_sensor_1_8],
876 }, {
877 .name = "da903x-regulator",
878 .id = DA9030_ID_LDO11,
879 .platform_data = &stargate2_ldo_init_data[vcc_sensor_3],
880 }, {
881 .name = "da903x-regulator",
882 .id = DA9030_ID_LDO12,
883 .platform_data = &stargate2_ldo_init_data[vcc_lcd],
884 }, {
885 .name = "da903x-regulator",
886 .id = DA9030_ID_LDO15,
887 .platform_data = &stargate2_ldo_init_data[vcc_pxa_pll],
888 }, {
889 .name = "da903x-regulator",
890 .id = DA9030_ID_LDO17,
891 .platform_data = &stargate2_ldo_init_data[vcc_pxa_usim],
892 }, {
893 .name = "da903x-regulator", /*pxa vcc i/o and cc2420 vcc i/o */
894 .id = DA9030_ID_LDO18,
895 .platform_data = &stargate2_ldo_init_data[vcc_io],
896 }, {
897 .name = "da903x-regulator",
898 .id = DA9030_ID_LDO19,
899 .platform_data = &stargate2_ldo_init_data[vcc_pxa_mem],
900 },
901};
902
903static struct da903x_platform_data stargate2_da9030_pdata = {
904 .num_subdevs = ARRAY_SIZE(stargate2_da9030_subdevs),
905 .subdevs = stargate2_da9030_subdevs,
906};
907
908static struct i2c_board_info __initdata stargate2_pwr_i2c_board_info[] = {
909 {
910 .type = "da9030",
911 .addr = 0x49,
912 .platform_data = &stargate2_da9030_pdata,
913 .irq = gpio_to_irq(1),
914 },
915};
619 916
620static struct i2c_board_info __initdata stargate2_i2c_board_info[] = { 917static struct i2c_board_info __initdata stargate2_i2c_board_info[] = {
621 /* Techically this a pca9500 - but it's compatible with the 8574 918 /* Techically this a pca9500 - but it's compatible with the 8574
@@ -653,74 +950,6 @@ static struct i2c_board_info __initdata stargate2_i2c_board_info[] = {
653 }, 950 },
654}; 951};
655 952
656static struct i2c_board_info __initdata stargate2_pwr_i2c_board_info[] = {
657 {
658 .type = "da9030",
659 .addr = 0x49,
660 .platform_data = &stargate2_da9030_pdata,
661 .irq = gpio_to_irq(1),
662 },
663};
664
665static struct pxa2xx_spi_master pxa_ssp_master_0_info = {
666 .num_chipselect = 1,
667};
668
669static struct pxa2xx_spi_master pxa_ssp_master_1_info = {
670 .num_chipselect = 1,
671};
672
673static struct pxa2xx_spi_master pxa_ssp_master_2_info = {
674 .num_chipselect = 1,
675};
676
677/* An upcoming kernel change will scrap SFRM usage so these
678 * drivers have been moved to use gpio's via cs_control */
679static struct pxa2xx_spi_chip staccel_chip_info = {
680 .tx_threshold = 8,
681 .rx_threshold = 8,
682 .dma_burst_size = 8,
683 .timeout = 235,
684 .gpio_cs = 24,
685};
686
687static struct pxa2xx_spi_chip cc2420_info = {
688 .tx_threshold = 8,
689 .rx_threshold = 8,
690 .dma_burst_size = 8,
691 .timeout = 235,
692 .gpio_cs = 39,
693};
694
695static struct spi_board_info spi_board_info[] __initdata = {
696 {
697 .modalias = "lis3l02dq",
698 .max_speed_hz = 8000000,/* 8MHz max spi frequency at 3V */
699 .bus_num = 1,
700 .chip_select = 0,
701 .controller_data = &staccel_chip_info,
702 .irq = IRQ_GPIO(96),
703 }, {
704 .modalias = "cc2420",
705 .max_speed_hz = 6500000,
706 .bus_num = 3,
707 .chip_select = 0,
708 .controller_data = &cc2420_info,
709 },
710};
711
712static void sg2_udc_command(int cmd)
713{
714 switch (cmd) {
715 case PXA2XX_UDC_CMD_CONNECT:
716 UP2OCR |= UP2OCR_HXOE | UP2OCR_DPPUE | UP2OCR_DPPUBE;
717 break;
718 case PXA2XX_UDC_CMD_DISCONNECT:
719 UP2OCR &= ~(UP2OCR_HXOE | UP2OCR_DPPUE | UP2OCR_DPPUBE);
720 break;
721 }
722}
723
724/* Board doesn't support cable detection - so always lie and say 953/* Board doesn't support cable detection - so always lie and say
725 * something is there. 954 * something is there.
726 */ 955 */
@@ -741,14 +970,6 @@ static struct platform_device *stargate2_devices[] = {
741 &sht15, 970 &sht15,
742}; 971};
743 972
744static struct i2c_pxa_platform_data i2c_pwr_pdata = {
745 .fast_mode = 1,
746};
747
748static struct i2c_pxa_platform_data i2c_pdata = {
749 .fast_mode = 1,
750};
751
752static void __init stargate2_init(void) 973static void __init stargate2_init(void)
753{ 974{
754 /* This is probably a board specific hack as this must be set 975 /* This is probably a board specific hack as this must be set
@@ -757,22 +978,13 @@ static void __init stargate2_init(void)
757 978
758 pxa2xx_mfp_config(ARRAY_AND_SIZE(stargate2_pin_config)); 979 pxa2xx_mfp_config(ARRAY_AND_SIZE(stargate2_pin_config));
759 980
760 pxa_set_ffuart_info(NULL); 981 imote2_stargate2_init();
761 pxa_set_btuart_info(NULL);
762 pxa_set_stuart_info(NULL);
763 982
764 platform_add_devices(ARRAY_AND_SIZE(stargate2_devices)); 983 platform_add_devices(ARRAY_AND_SIZE(stargate2_devices));
765 984
766 pxa2xx_set_spi_info(1, &pxa_ssp_master_0_info);
767 pxa2xx_set_spi_info(2, &pxa_ssp_master_1_info);
768 pxa2xx_set_spi_info(3, &pxa_ssp_master_2_info);
769 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
770
771 i2c_register_board_info(0, ARRAY_AND_SIZE(stargate2_i2c_board_info)); 985 i2c_register_board_info(0, ARRAY_AND_SIZE(stargate2_i2c_board_info));
772 i2c_register_board_info(1, 986 i2c_register_board_info(1, stargate2_pwr_i2c_board_info,
773 ARRAY_AND_SIZE(stargate2_pwr_i2c_board_info)); 987 ARRAY_SIZE(stargate2_pwr_i2c_board_info));
774 pxa27x_set_i2c_power_info(&i2c_pwr_pdata);
775 pxa_set_i2c_info(&i2c_pdata);
776 988
777 pxa_set_mci_info(&stargate2_mci_platform_data); 989 pxa_set_mci_info(&stargate2_mci_platform_data);
778 990
@@ -780,7 +992,21 @@ static void __init stargate2_init(void)
780 992
781 stargate2_reset_bluetooth(); 993 stargate2_reset_bluetooth();
782} 994}
995#endif
996
997#ifdef CONFIG_MACH_INTELMOTE2
998MACHINE_START(INTELMOTE2, "IMOTE 2")
999 .phys_io = 0x40000000,
1000 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
1001 .map_io = pxa_map_io,
1002 .init_irq = pxa27x_init_irq,
1003 .timer = &pxa_timer,
1004 .init_machine = imote2_init,
1005 .boot_params = 0xA0000100,
1006MACHINE_END
1007#endif
783 1008
1009#ifdef CONFIG_MACH_STARGATE2
784MACHINE_START(STARGATE2, "Stargate 2") 1010MACHINE_START(STARGATE2, "Stargate 2")
785 .phys_io = 0x40000000, 1011 .phys_io = 0x40000000,
786 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, 1012 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
@@ -790,3 +1016,4 @@ MACHINE_START(STARGATE2, "Stargate 2")
790 .init_machine = stargate2_init, 1016 .init_machine = stargate2_init,
791 .boot_params = 0xA0000100, 1017 .boot_params = 0xA0000100,
792MACHINE_END 1018MACHINE_END
1019#endif
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c
index 69689112eae7..0acff172ef22 100644
--- a/arch/arm/mach-pxa/trizeps4.c
+++ b/arch/arm/mach-pxa/trizeps4.c
@@ -530,13 +530,9 @@ static void __init trizeps4_init(void)
530 i2c_register_board_info(0, trizeps4_i2c_devices, 530 i2c_register_board_info(0, trizeps4_i2c_devices,
531 ARRAY_SIZE(trizeps4_i2c_devices)); 531 ARRAY_SIZE(trizeps4_i2c_devices));
532 532
533#ifdef CONFIG_IDE_PXA_CF
534 /* if boot direct from compact flash dont disable power */
535 trizeps_conxs_bcr = 0x0009;
536#else
537 /* this is the reset value */ 533 /* this is the reset value */
538 trizeps_conxs_bcr = 0x00A0; 534 trizeps_conxs_bcr = 0x00A0;
539#endif 535
540 BCR_writew(trizeps_conxs_bcr); 536 BCR_writew(trizeps_conxs_bcr);
541 board_backlight_power(1); 537 board_backlight_power(1);
542} 538}
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c
index 9884fa978f16..c9b747cedea8 100644
--- a/arch/arm/mach-pxa/vpac270.c
+++ b/arch/arm/mach-pxa/vpac270.c
@@ -25,6 +25,7 @@
25#include <linux/dm9000.h> 25#include <linux/dm9000.h>
26#include <linux/ucb1400.h> 26#include <linux/ucb1400.h>
27#include <linux/ata_platform.h> 27#include <linux/ata_platform.h>
28#include <linux/regulator/max1586.h>
28 29
29#include <asm/mach-types.h> 30#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
@@ -37,6 +38,7 @@
37#include <mach/ohci.h> 38#include <mach/ohci.h>
38#include <mach/pxa27x-udc.h> 39#include <mach/pxa27x-udc.h>
39#include <mach/udc.h> 40#include <mach/udc.h>
41#include <mach/pata_pxa.h>
40 42
41#include <plat/i2c.h> 43#include <plat/i2c.h>
42 44
@@ -464,7 +466,6 @@ static struct i2c_board_info __initdata vpac270_i2c_devs[] = {
464 466
465static void __init vpac270_rtc_init(void) 467static void __init vpac270_rtc_init(void)
466{ 468{
467 pxa_set_i2c_info(NULL);
468 i2c_register_board_info(0, ARRAY_AND_SIZE(vpac270_i2c_devs)); 469 i2c_register_board_info(0, ARRAY_AND_SIZE(vpac270_i2c_devs));
469} 470}
470#else 471#else
@@ -492,7 +493,55 @@ static struct pxafb_mode_info vpac270_lcd_modes[] = {
492 .vsync_len = 2, 493 .vsync_len = 2,
493 494
494 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 495 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
495}, 496}, { /* CRT 640x480 */
497 .pixclock = 35000,
498 .xres = 640,
499 .yres = 480,
500 .bpp = 16,
501 .depth = 16,
502
503 .left_margin = 96,
504 .right_margin = 48,
505 .upper_margin = 33,
506 .lower_margin = 10,
507
508 .hsync_len = 48,
509 .vsync_len = 1,
510
511 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
512}, { /* CRT 800x600 H=30kHz V=48HZ */
513 .pixclock = 25000,
514 .xres = 800,
515 .yres = 600,
516 .bpp = 16,
517 .depth = 16,
518
519 .left_margin = 50,
520 .right_margin = 1,
521 .upper_margin = 21,
522 .lower_margin = 12,
523
524 .hsync_len = 8,
525 .vsync_len = 1,
526
527 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
528}, { /* CRT 1024x768 H=40kHz V=50Hz */
529 .pixclock = 15000,
530 .xres = 1024,
531 .yres = 768,
532 .bpp = 16,
533 .depth = 16,
534
535 .left_margin = 220,
536 .right_margin = 8,
537 .upper_margin = 33,
538 .lower_margin = 2,
539
540 .hsync_len = 48,
541 .vsync_len = 1,
542
543 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
544}
496}; 545};
497 546
498static struct pxafb_mach_info vpac270_lcd_screen = { 547static struct pxafb_mach_info vpac270_lcd_screen = {
@@ -538,9 +587,10 @@ static inline void vpac270_lcd_init(void) {}
538/****************************************************************************** 587/******************************************************************************
539 * PATA IDE 588 * PATA IDE
540 ******************************************************************************/ 589 ******************************************************************************/
541#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 590#if defined(CONFIG_PATA_PXA) || defined(CONFIG_PATA_PXA_MODULE)
542static struct pata_platform_info vpac270_pata_pdata = { 591static struct pata_pxa_pdata vpac270_pata_pdata = {
543 .ioport_shift = 1, 592 .reg_shift = 1,
593 .dma_dreq = 1,
544 .irq_flags = IRQF_TRIGGER_RISING, 594 .irq_flags = IRQF_TRIGGER_RISING,
545}; 595};
546 596
@@ -555,7 +605,12 @@ static struct resource vpac270_ide_resources[] = {
555 .end = PXA_CS3_PHYS + 0x15f, 605 .end = PXA_CS3_PHYS + 0x15f,
556 .flags = IORESOURCE_MEM 606 .flags = IORESOURCE_MEM
557 }, 607 },
558 [2] = { /* IDE IRQ pin */ 608 [2] = { /* DMA Base address */
609 .start = PXA_CS3_PHYS + 0x20,
610 .end = PXA_CS3_PHYS + 0x2f,
611 .flags = IORESOURCE_DMA
612 },
613 [3] = { /* IDE IRQ pin */
559 .start = gpio_to_irq(GPIO36_VPAC270_IDE_IRQ), 614 .start = gpio_to_irq(GPIO36_VPAC270_IDE_IRQ),
560 .end = gpio_to_irq(GPIO36_VPAC270_IDE_IRQ), 615 .end = gpio_to_irq(GPIO36_VPAC270_IDE_IRQ),
561 .flags = IORESOURCE_IRQ 616 .flags = IORESOURCE_IRQ
@@ -563,11 +618,12 @@ static struct resource vpac270_ide_resources[] = {
563}; 618};
564 619
565static struct platform_device vpac270_ide_device = { 620static struct platform_device vpac270_ide_device = {
566 .name = "pata_platform", 621 .name = "pata_pxa",
567 .num_resources = ARRAY_SIZE(vpac270_ide_resources), 622 .num_resources = ARRAY_SIZE(vpac270_ide_resources),
568 .resource = vpac270_ide_resources, 623 .resource = vpac270_ide_resources,
569 .dev = { 624 .dev = {
570 .platform_data = &vpac270_pata_pdata, 625 .platform_data = &vpac270_pata_pdata,
626 .coherent_dma_mask = 0xffffffff,
571 } 627 }
572}; 628};
573 629
@@ -580,6 +636,59 @@ static inline void vpac270_ide_init(void) {}
580#endif 636#endif
581 637
582/****************************************************************************** 638/******************************************************************************
639 * Core power regulator
640 ******************************************************************************/
641#if defined(CONFIG_REGULATOR_MAX1586) || \
642 defined(CONFIG_REGULATOR_MAX1586_MODULE)
643static struct regulator_consumer_supply vpac270_max1587a_consumers[] = {
644 {
645 .supply = "vcc_core",
646 }
647};
648
649static struct regulator_init_data vpac270_max1587a_v3_info = {
650 .constraints = {
651 .name = "vcc_core range",
652 .min_uV = 900000,
653 .max_uV = 1705000,
654 .always_on = 1,
655 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
656 },
657 .consumer_supplies = vpac270_max1587a_consumers,
658 .num_consumer_supplies = ARRAY_SIZE(vpac270_max1587a_consumers),
659};
660
661static struct max1586_subdev_data vpac270_max1587a_subdevs[] = {
662 {
663 .name = "vcc_core",
664 .id = MAX1586_V3,
665 .platform_data = &vpac270_max1587a_v3_info,
666 }
667};
668
669static struct max1586_platform_data vpac270_max1587a_info = {
670 .subdevs = vpac270_max1587a_subdevs,
671 .num_subdevs = ARRAY_SIZE(vpac270_max1587a_subdevs),
672 .v3_gain = MAX1586_GAIN_R24_3k32, /* 730..1550 mV */
673};
674
675static struct i2c_board_info __initdata vpac270_pi2c_board_info[] = {
676 {
677 I2C_BOARD_INFO("max1586", 0x14),
678 .platform_data = &vpac270_max1587a_info,
679 },
680};
681
682static void __init vpac270_pmic_init(void)
683{
684 i2c_register_board_info(1, ARRAY_AND_SIZE(vpac270_pi2c_board_info));
685}
686#else
687static inline void vpac270_pmic_init(void) {}
688#endif
689
690
691/******************************************************************************
583 * Machine init 692 * Machine init
584 ******************************************************************************/ 693 ******************************************************************************/
585static void __init vpac270_init(void) 694static void __init vpac270_init(void)
@@ -589,7 +698,10 @@ static void __init vpac270_init(void)
589 pxa_set_ffuart_info(NULL); 698 pxa_set_ffuart_info(NULL);
590 pxa_set_btuart_info(NULL); 699 pxa_set_btuart_info(NULL);
591 pxa_set_stuart_info(NULL); 700 pxa_set_stuart_info(NULL);
701 pxa_set_i2c_info(NULL);
702 pxa27x_set_i2c_power_info(NULL);
592 703
704 vpac270_pmic_init();
593 vpac270_lcd_init(); 705 vpac270_lcd_init();
594 vpac270_mmc_init(); 706 vpac270_mmc_init();
595 vpac270_nor_init(); 707 vpac270_nor_init();
diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c
index d303c6929d32..f0d02288b4ca 100644
--- a/arch/arm/mach-pxa/z2.c
+++ b/arch/arm/mach-pxa/z2.c
@@ -17,6 +17,7 @@
17#include <linux/mtd/mtd.h> 17#include <linux/mtd/mtd.h>
18#include <linux/mtd/partitions.h> 18#include <linux/mtd/partitions.h>
19#include <linux/pwm_backlight.h> 19#include <linux/pwm_backlight.h>
20#include <linux/z2_battery.h>
20#include <linux/dma-mapping.h> 21#include <linux/dma-mapping.h>
21#include <linux/spi/spi.h> 22#include <linux/spi/spi.h>
22#include <linux/spi/libertas_spi.h> 23#include <linux/spi/libertas_spi.h>
@@ -26,6 +27,7 @@
26#include <linux/gpio.h> 27#include <linux/gpio.h>
27#include <linux/gpio_keys.h> 28#include <linux/gpio_keys.h>
28#include <linux/delay.h> 29#include <linux/delay.h>
30#include <linux/regulator/machine.h>
29 31
30#include <asm/mach-types.h> 32#include <asm/mach-types.h>
31#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
@@ -162,7 +164,7 @@ static struct mtd_partition z2_flash_parts[] = {
162 }, { 164 }, {
163 .name = "U-Boot Environment", 165 .name = "U-Boot Environment",
164 .offset = 0x40000, 166 .offset = 0x40000,
165 .size = 0x60000, 167 .size = 0x20000,
166 }, { 168 }, {
167 .name = "Flash", 169 .name = "Flash",
168 .offset = 0x60000, 170 .offset = 0x60000,
@@ -452,6 +454,42 @@ static inline void z2_keys_init(void) {}
452#endif 454#endif
453 455
454/****************************************************************************** 456/******************************************************************************
457 * Battery
458 ******************************************************************************/
459#if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE)
460static struct z2_battery_info batt_chip_info = {
461 .batt_I2C_bus = 0,
462 .batt_I2C_addr = 0x55,
463 .batt_I2C_reg = 2,
464 .charge_gpio = GPIO0_ZIPITZ2_AC_DETECT,
465 .min_voltage = 2400000,
466 .max_voltage = 3700000,
467 .batt_div = 69,
468 .batt_mult = 1000000,
469 .batt_tech = POWER_SUPPLY_TECHNOLOGY_LION,
470 .batt_name = "Z2",
471};
472
473static struct i2c_board_info __initdata z2_i2c_board_info[] = {
474 {
475 I2C_BOARD_INFO("aer915", 0x55),
476 .platform_data = &batt_chip_info,
477 }, {
478 I2C_BOARD_INFO("wm8750", 0x1b),
479 },
480
481};
482
483static void __init z2_i2c_init(void)
484{
485 pxa_set_i2c_info(NULL);
486 i2c_register_board_info(0, ARRAY_AND_SIZE(z2_i2c_board_info));
487}
488#else
489static inline void z2_i2c_init(void) {}
490#endif
491
492/******************************************************************************
455 * SSP Devices - WiFi and LCD control 493 * SSP Devices - WiFi and LCD control
456 ******************************************************************************/ 494 ******************************************************************************/
457#if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE) 495#if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE)
@@ -573,23 +611,95 @@ static inline void z2_spi_init(void) {}
573#endif 611#endif
574 612
575/****************************************************************************** 613/******************************************************************************
614 * Core power regulator
615 ******************************************************************************/
616#if defined(CONFIG_REGULATOR_TPS65023) || \
617 defined(CONFIG_REGULATOR_TPS65023_MODULE)
618static struct regulator_consumer_supply z2_tps65021_consumers[] = {
619 {
620 .supply = "vcc_core",
621 }
622};
623
624static struct regulator_init_data z2_tps65021_info[] = {
625 {
626 .constraints = {
627 .name = "vcc_core range",
628 .min_uV = 800000,
629 .max_uV = 1600000,
630 .always_on = 1,
631 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
632 },
633 .consumer_supplies = z2_tps65021_consumers,
634 .num_consumer_supplies = ARRAY_SIZE(z2_tps65021_consumers),
635 }, {
636 .constraints = {
637 .name = "DCDC2",
638 .min_uV = 3300000,
639 .max_uV = 3300000,
640 .always_on = 1,
641 },
642 }, {
643 .constraints = {
644 .name = "DCDC3",
645 .min_uV = 1800000,
646 .max_uV = 1800000,
647 .always_on = 1,
648 },
649 }, {
650 .constraints = {
651 .name = "LDO1",
652 .min_uV = 1000000,
653 .max_uV = 3150000,
654 .always_on = 1,
655 },
656 }, {
657 .constraints = {
658 .name = "LDO2",
659 .min_uV = 1050000,
660 .max_uV = 3300000,
661 .always_on = 1,
662 },
663 }
664};
665
666static struct i2c_board_info __initdata z2_pi2c_board_info[] = {
667 {
668 I2C_BOARD_INFO("tps65021", 0x48),
669 .platform_data = &z2_tps65021_info,
670 },
671};
672
673static void __init z2_pmic_init(void)
674{
675 pxa27x_set_i2c_power_info(NULL);
676 i2c_register_board_info(1, ARRAY_AND_SIZE(z2_pi2c_board_info));
677}
678#else
679static inline void z2_pmic_init(void) {}
680#endif
681
682/******************************************************************************
576 * Machine init 683 * Machine init
577 ******************************************************************************/ 684 ******************************************************************************/
578static void __init z2_init(void) 685static void __init z2_init(void)
579{ 686{
580 pxa2xx_mfp_config(ARRAY_AND_SIZE(z2_pin_config)); 687 pxa2xx_mfp_config(ARRAY_AND_SIZE(z2_pin_config));
581 688
689 pxa_set_ffuart_info(NULL);
690 pxa_set_btuart_info(NULL);
691 pxa_set_stuart_info(NULL);
692
582 z2_lcd_init(); 693 z2_lcd_init();
583 z2_mmc_init(); 694 z2_mmc_init();
584 z2_mkp_init(); 695 z2_mkp_init();
585 696 z2_i2c_init();
586 pxa_set_i2c_info(NULL);
587
588 z2_spi_init(); 697 z2_spi_init();
589 z2_nor_init(); 698 z2_nor_init();
590 z2_pwm_init(); 699 z2_pwm_init();
591 z2_leds_init(); 700 z2_leds_init();
592 z2_keys_init(); 701 z2_keys_init();
702 z2_pmic_init();
593} 703}
594 704
595MACHINE_START(ZIPIT2, "Zipit Z2") 705MACHINE_START(ZIPIT2, "Zipit Z2")