2 * Support for HP iPAQ hx4700 PDAs.
4 * Copyright (c) 2008-2009 Philipp Zabel
7 * Copyright (c) 2004 Hewlett-Packard Company.
8 * Copyright (c) 2005 SDG Systems, LLC
9 * Copyright (c) 2006 Anton Vorontsov <cbou@mail.ru>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
17 #include <linux/kernel.h>
18 #include <linux/init.h>
19 #include <linux/platform_device.h>
20 #include <linux/delay.h>
22 #include <linux/gpio.h>
23 #include <linux/gpio_keys.h>
24 #include <linux/input.h>
25 #include <linux/input/navpoint.h>
26 #include <linux/lcd.h>
27 #include <linux/mfd/htc-egpio.h>
28 #include <linux/mfd/asic3.h>
29 #include <linux/mtd/physmap.h>
30 #include <linux/pda_power.h>
31 #include <linux/pwm_backlight.h>
32 #include <linux/regulator/driver.h>
33 #include <linux/regulator/gpio-regulator.h>
34 #include <linux/regulator/machine.h>
35 #include <linux/regulator/max1586.h>
36 #include <linux/spi/ads7846.h>
37 #include <linux/spi/spi.h>
38 #include <linux/spi/pxa2xx_spi.h>
39 #include <linux/usb/gpio_vbus.h>
40 #include <linux/i2c/pxa-i2c.h>
42 #include <mach/hardware.h>
43 #include <asm/mach-types.h>
44 #include <asm/mach/arch.h>
46 #include <mach/pxa27x.h>
47 #include <mach/hx4700.h>
48 #include <mach/irda.h>
50 #include <sound/ak4641.h>
51 #include <video/platform_lcd.h>
52 #include <video/w100fb.h>
57 /* Physical address space information */
59 #define ATI_W3220_PHYS PXA_CS2_PHYS /* ATI Imageon 3220 Graphics */
60 #define ASIC3_PHYS PXA_CS3_PHYS
61 #define ASIC3_SD_PHYS (PXA_CS3_PHYS + 0x02000000)
63 static unsigned long hx4700_pin_config[] __initdata = {
65 /* SDRAM and Static Memory I/O Signals */
69 GPIO78_nCS_2, /* W3220 */
70 GPIO79_nCS_3, /* ASIC3 */
72 GPIO33_nCS_5, /* EGPIO, WLAN */
102 GPIO43_BTUART_TXD_LPM_LOW,
104 GPIO45_BTUART_RTS_LPM_LOW,
110 /* PWM 1 (Backlight) */
114 GPIO28_I2S_BITCLK_OUT,
116 GPIO30_I2S_SDATA_OUT,
120 /* SSP 1 (NavPoint) */
126 /* SSP 2 (TSC2046) */
130 GPIO88_GPIO | MFP_LPM_DRIVE_HIGH, /* TSC2046_CS */
132 /* BQ24022 Regulator */
133 GPIO72_GPIO | MFP_LPM_KEEP_OUTPUT, /* BQ24022_nCHARGE_EN */
134 GPIO96_GPIO | MFP_LPM_KEEP_OUTPUT, /* BQ24022_ISET2 */
136 /* HX4700 specific input GPIOs */
137 GPIO12_GPIO | WAKEUP_ON_EDGE_RISE, /* ASIC3_IRQ */
138 GPIO13_GPIO, /* W3220_IRQ */
139 GPIO14_GPIO, /* nWLAN_IRQ */
141 /* HX4700 specific output GPIOs */
142 GPIO61_GPIO | MFP_LPM_DRIVE_HIGH, /* W3220_nRESET */
143 GPIO71_GPIO | MFP_LPM_DRIVE_HIGH, /* ASIC3_nRESET */
144 GPIO81_GPIO | MFP_LPM_DRIVE_HIGH, /* CPU_GP_nRESET */
145 GPIO116_GPIO | MFP_LPM_DRIVE_HIGH, /* CPU_HW_nRESET */
146 GPIO102_GPIO | MFP_LPM_DRIVE_LOW, /* SYNAPTICS_POWER_ON */
148 GPIO10_GPIO, /* GSM_IRQ */
149 GPIO13_GPIO, /* CPLD_IRQ */
150 GPIO107_GPIO, /* DS1WM_IRQ */
151 GPIO108_GPIO, /* GSM_READY */
152 GPIO58_GPIO, /* TSC2046_nPENIRQ */
153 GPIO66_GPIO, /* nSDIO_IRQ */
160 static struct pxaficp_platform_data ficp_info = {
161 .gpio_pwdown = GPIO105_HX4700_nIR_ON,
162 .transceiver_cap = IR_SIRMODE | IR_OFF,
169 #define INIT_KEY(_code, _gpio, _active_low, _desc) \
171 .code = KEY_##_code, \
173 .active_low = _active_low, \
179 static struct gpio_keys_button gpio_keys_buttons[] = {
180 INIT_KEY(POWER, GPIO0_HX4700_nKEY_POWER, 1, "Power button"),
181 INIT_KEY(MAIL, GPIO94_HX4700_KEY_MAIL, 0, "Mail button"),
182 INIT_KEY(ADDRESSBOOK, GPIO99_HX4700_KEY_CONTACTS,0, "Contacts button"),
183 INIT_KEY(RECORD, GPIOD6_nKEY_RECORD, 1, "Record button"),
184 INIT_KEY(CALENDAR, GPIOD1_nKEY_CALENDAR, 1, "Calendar button"),
185 INIT_KEY(HOMEPAGE, GPIOD3_nKEY_HOME, 1, "Home button"),
188 static struct gpio_keys_platform_data gpio_keys_data = {
189 .buttons = gpio_keys_buttons,
190 .nbuttons = ARRAY_SIZE(gpio_keys_buttons),
193 static struct platform_device gpio_keys = {
196 .platform_data = &gpio_keys_data,
202 * Synaptics NavPoint connected to SSP1
205 static struct navpoint_platform_data navpoint_platform_data = {
207 .gpio = GPIO102_HX4700_SYNAPTICS_POWER_ON,
210 static struct platform_device navpoint = {
214 .platform_data = &navpoint_platform_data,
222 static u16 asic3_gpio_config[] = {
223 /* ASIC3 GPIO banks A and B along with some of C and D
224 implement the buffering for the CF slot. */
225 ASIC3_CONFIG_GPIO(0, 1, 1, 0),
226 ASIC3_CONFIG_GPIO(1, 1, 1, 0),
227 ASIC3_CONFIG_GPIO(2, 1, 1, 0),
228 ASIC3_CONFIG_GPIO(3, 1, 1, 0),
229 ASIC3_CONFIG_GPIO(4, 1, 1, 0),
230 ASIC3_CONFIG_GPIO(5, 1, 1, 0),
231 ASIC3_CONFIG_GPIO(6, 1, 1, 0),
232 ASIC3_CONFIG_GPIO(7, 1, 1, 0),
233 ASIC3_CONFIG_GPIO(8, 1, 1, 0),
234 ASIC3_CONFIG_GPIO(9, 1, 1, 0),
235 ASIC3_CONFIG_GPIO(10, 1, 1, 0),
236 ASIC3_CONFIG_GPIO(11, 1, 1, 0),
237 ASIC3_CONFIG_GPIO(12, 1, 1, 0),
238 ASIC3_CONFIG_GPIO(13, 1, 1, 0),
239 ASIC3_CONFIG_GPIO(14, 1, 1, 0),
240 ASIC3_CONFIG_GPIO(15, 1, 1, 0),
242 ASIC3_CONFIG_GPIO(16, 1, 1, 0),
243 ASIC3_CONFIG_GPIO(17, 1, 1, 0),
244 ASIC3_CONFIG_GPIO(18, 1, 1, 0),
245 ASIC3_CONFIG_GPIO(19, 1, 1, 0),
246 ASIC3_CONFIG_GPIO(20, 1, 1, 0),
247 ASIC3_CONFIG_GPIO(21, 1, 1, 0),
248 ASIC3_CONFIG_GPIO(22, 1, 1, 0),
249 ASIC3_CONFIG_GPIO(23, 1, 1, 0),
250 ASIC3_CONFIG_GPIO(24, 1, 1, 0),
251 ASIC3_CONFIG_GPIO(25, 1, 1, 0),
252 ASIC3_CONFIG_GPIO(26, 1, 1, 0),
253 ASIC3_CONFIG_GPIO(27, 1, 1, 0),
254 ASIC3_CONFIG_GPIO(28, 1, 1, 0),
255 ASIC3_CONFIG_GPIO(29, 1, 1, 0),
256 ASIC3_CONFIG_GPIO(30, 1, 1, 0),
257 ASIC3_CONFIG_GPIO(31, 1, 1, 0),
259 /* GPIOC - CF, LEDs, SD */
260 ASIC3_GPIOC0_LED0, /* red */
261 ASIC3_GPIOC1_LED1, /* green */
262 ASIC3_GPIOC2_LED2, /* blue */
269 ASIC3_GPIOC11_PSKTSEL,
271 ASIC3_GPIOC13_nPWAIT,
272 ASIC3_GPIOC14_nPIOIS16,
275 /* GPIOD: input GPIOs, CF */
277 ASIC3_GPIOD11_nCIOIS16,
278 ASIC3_GPIOD12_nCWAIT,
282 static struct asic3_led asic3_leds[ASIC3_NUM_LEDS] = {
284 .name = "hx4700:amber",
285 .default_trigger = "ds2760-battery.0-charging-blink-full-solid",
288 .name = "hx4700:green",
289 .default_trigger = "unused",
292 .name = "hx4700:blue",
293 .default_trigger = "hx4700-radio",
297 static struct resource asic3_resources[] = {
299 [0] = DEFINE_RES_MEM(ASIC3_PHYS, ASIC3_MAP_SIZE_16BIT),
300 [1] = DEFINE_RES_IRQ(PXA_GPIO_TO_IRQ(GPIO12_HX4700_ASIC3_IRQ)),
302 [2] = DEFINE_RES_MEM(ASIC3_SD_PHYS, ASIC3_MAP_SIZE_16BIT),
303 [3] = DEFINE_RES_IRQ(PXA_GPIO_TO_IRQ(GPIO66_HX4700_ASIC3_nSDIO_IRQ)),
306 static struct asic3_platform_data asic3_platform_data = {
307 .gpio_config = asic3_gpio_config,
308 .gpio_config_num = ARRAY_SIZE(asic3_gpio_config),
309 .irq_base = IRQ_BOARD_START,
310 .gpio_base = HX4700_ASIC3_GPIO_BASE,
311 .clock_rate = 4000000,
315 static struct platform_device asic3 = {
318 .resource = asic3_resources,
319 .num_resources = ARRAY_SIZE(asic3_resources),
321 .platform_data = &asic3_platform_data,
329 static struct resource egpio_resources[] = {
330 [0] = DEFINE_RES_MEM(PXA_CS5_PHYS, 0x4),
333 static struct htc_egpio_chip egpio_chips[] = {
336 .gpio_base = HX4700_EGPIO_BASE,
338 .direction = HTC_EGPIO_OUTPUT,
342 static struct htc_egpio_platform_data egpio_info = {
346 .num_chips = ARRAY_SIZE(egpio_chips),
349 static struct platform_device egpio = {
352 .resource = egpio_resources,
353 .num_resources = ARRAY_SIZE(egpio_resources),
355 .platform_data = &egpio_info,
360 * LCD - Sony display connected to ATI Imageon w3220
363 static void sony_lcd_init(void)
365 gpio_set_value(GPIO84_HX4700_LCD_SQN, 1);
366 gpio_set_value(GPIO110_HX4700_LCD_LVDD_3V3_ON, 0);
367 gpio_set_value(GPIO111_HX4700_LCD_AVDD_3V3_ON, 0);
368 gpio_set_value(GPIO70_HX4700_LCD_SLIN1, 0);
369 gpio_set_value(GPIO62_HX4700_LCD_nRESET, 0);
371 gpio_set_value(GPIO59_HX4700_LCD_PC1, 0);
372 gpio_set_value(GPIO110_HX4700_LCD_LVDD_3V3_ON, 0);
375 gpio_set_value(GPIO110_HX4700_LCD_LVDD_3V3_ON, 1);
377 gpio_set_value(GPIO111_HX4700_LCD_AVDD_3V3_ON, 1);
379 /* FIXME: init w3220 registers here */
382 gpio_set_value(GPIO70_HX4700_LCD_SLIN1, 1);
384 gpio_set_value(GPIO62_HX4700_LCD_nRESET, 1);
386 gpio_set_value(GPIO59_HX4700_LCD_PC1, 1);
388 gpio_set_value(GPIO112_HX4700_LCD_N2V7_7V3_ON, 1);
391 static void sony_lcd_off(void)
393 gpio_set_value(GPIO59_HX4700_LCD_PC1, 0);
394 gpio_set_value(GPIO62_HX4700_LCD_nRESET, 0);
396 gpio_set_value(GPIO112_HX4700_LCD_N2V7_7V3_ON, 0);
398 gpio_set_value(GPIO111_HX4700_LCD_AVDD_3V3_ON, 0);
400 gpio_set_value(GPIO110_HX4700_LCD_LVDD_3V3_ON, 0);
404 static void w3220_lcd_suspend(struct w100fb_par *wfb)
409 static void w3220_lcd_resume(struct w100fb_par *wfb)
414 #define w3220_lcd_resume NULL
415 #define w3220_lcd_suspend NULL
418 static struct w100_tg_info w3220_tg_info = {
419 .suspend = w3220_lcd_suspend,
420 .resume = w3220_lcd_resume,
424 static struct w100_gen_regs w3220_regs = {
425 .lcd_format = 0x00000003,
426 .lcdd_cntl1 = 0x00000000,
427 .lcdd_cntl2 = 0x0003ffff,
428 .genlcd_cntl1 = 0x00abf003, /* 0x00fff003 */
429 .genlcd_cntl2 = 0x00000003,
430 .genlcd_cntl3 = 0x000102aa,
433 static struct w100_mode w3220_modes[] = {
441 .crtc_ss = 0x00000000,
442 .crtc_ls = 0xa1ff01f9, /* 0x21ff01f9 */
443 .crtc_gs = 0xc0000000, /* 0x40000000 */
444 .crtc_vpos_gs = 0x0000028f,
445 .crtc_ps1_active = 0x00000000, /* 0x41060010 */
447 .crtc_dclk = 0x80000000,
448 .crtc_gclk = 0x040a0104,
452 .pixclk_divider_rotated = 4,
453 .pixclk_src = CLK_SRC_PLL,
455 .sysclk_src = CLK_SRC_PLL,
464 .crtc_ss = 0x80150014,
465 .crtc_ls = 0xa0fb00f7,
466 .crtc_gs = 0xc0080007,
467 .crtc_vpos_gs = 0x00080007,
468 .crtc_rev = 0x0000000a,
469 .crtc_dclk = 0x81700030,
470 .crtc_gclk = 0x8015010f,
471 .crtc_goe = 0x00000000,
474 .pixclk_divider_rotated = 4,
475 .pixclk_src = CLK_SRC_PLL,
477 .sysclk_src = CLK_SRC_PLL,
481 struct w100_mem_info w3220_mem_info = {
482 .ext_cntl = 0x09640011,
483 .sdram_mode_reg = 0x00600021,
484 .ext_timing_cntl = 0x1a001545, /* 0x15001545 */
485 .io_cntl = 0x7ddd7333,
489 struct w100_bm_mem_info w3220_bm_mem_info = {
490 .ext_mem_bw = 0x50413e01,
492 .ext_timing_ctl = 0x00043f7f,
493 .ext_cntl = 0x00000010,
494 .mode_reg = 0x00250000,
495 .io_cntl = 0x0fff0000,
496 .config = 0x08301480,
499 static struct w100_gpio_regs w3220_gpio_info = {
500 .init_data1 = 0xdfe00100, /* GPIO_DATA */
501 .gpio_dir1 = 0xffff0000, /* GPIO_CNTL1 */
502 .gpio_oe1 = 0x00000000, /* GPIO_CNTL2 */
503 .init_data2 = 0x00000000, /* GPIO_DATA2 */
504 .gpio_dir2 = 0x00000000, /* GPIO_CNTL3 */
505 .gpio_oe2 = 0x00000000, /* GPIO_CNTL4 */
508 static struct w100fb_mach_info w3220_info = {
509 .tg = &w3220_tg_info,
510 .mem = &w3220_mem_info,
511 .bm_mem = &w3220_bm_mem_info,
512 .gpio = &w3220_gpio_info,
514 .modelist = w3220_modes,
516 .xtal_freq = 16000000,
519 static struct resource w3220_resources[] = {
520 [0] = DEFINE_RES_MEM(ATI_W3220_PHYS, SZ_16M),
523 static struct platform_device w3220 = {
527 .platform_data = &w3220_info,
529 .num_resources = ARRAY_SIZE(w3220_resources),
530 .resource = w3220_resources,
533 static void hx4700_lcd_set_power(struct plat_lcd_data *pd, unsigned int power)
541 static struct plat_lcd_data hx4700_lcd_data = {
542 .set_power = hx4700_lcd_set_power,
545 static struct platform_device hx4700_lcd = {
546 .name = "platform-lcd",
549 .platform_data = &hx4700_lcd_data,
550 .parent = &w3220.dev,
558 static struct platform_pwm_backlight_data backlight_data = {
560 .max_brightness = 200,
561 .dft_brightness = 100,
562 .pwm_period_ns = 30923,
565 static struct platform_device backlight = {
566 .name = "pwm-backlight",
569 .parent = &pxa27x_device_pwm1.dev,
570 .platform_data = &backlight_data,
578 static struct gpio_vbus_mach_info gpio_vbus_info = {
579 .gpio_pullup = GPIO76_HX4700_USBC_PUEN,
580 .gpio_vbus = GPIOD14_nUSBC_DETECT,
581 .gpio_vbus_inverted = 1,
584 static struct platform_device gpio_vbus = {
588 .platform_data = &gpio_vbus_info,
593 * Touchscreen - TSC2046 connected to SSP2
596 static const struct ads7846_platform_data tsc2046_info = {
598 .vref_delay_usecs = 100,
599 .pressure_max = 1024,
603 .gpio_pendown = GPIO58_HX4700_TSC2046_nPENIRQ,
606 static struct pxa2xx_spi_chip tsc2046_chip = {
610 .gpio_cs = GPIO88_HX4700_TSC2046_CS,
613 static struct spi_board_info tsc2046_board_info[] __initdata = {
615 .modalias = "ads7846",
617 .max_speed_hz = 2600000, /* 100 kHz sample rate */
618 .irq = PXA_GPIO_TO_IRQ(GPIO58_HX4700_TSC2046_nPENIRQ),
619 .platform_data = &tsc2046_info,
620 .controller_data = &tsc2046_chip,
624 static struct pxa2xx_spi_master pxa_ssp2_master_info = {
626 .clock_enable = CKEN_SSP2,
634 static int power_supply_init(struct device *dev)
636 return gpio_request(GPIOD9_nAC_IN, "AC charger detect");
639 static int hx4700_is_ac_online(void)
641 return !gpio_get_value(GPIOD9_nAC_IN);
644 static void power_supply_exit(struct device *dev)
646 gpio_free(GPIOD9_nAC_IN);
649 static char *hx4700_supplicants[] = {
650 "ds2760-battery.0", "backup-battery"
653 static struct pda_power_pdata power_supply_info = {
654 .init = power_supply_init,
655 .is_ac_online = hx4700_is_ac_online,
656 .exit = power_supply_exit,
657 .supplied_to = hx4700_supplicants,
658 .num_supplicants = ARRAY_SIZE(hx4700_supplicants),
661 static struct resource power_supply_resources[] = {
662 [0] = DEFINE_RES_NAMED(PXA_GPIO_TO_IRQ(GPIOD9_nAC_IN), 1, "ac",
664 IORESOURCE_IRQ_HIGHEDGE | IORESOURCE_IRQ_LOWEDGE),
665 [1] = DEFINE_RES_NAMED(PXA_GPIO_TO_IRQ(GPIOD14_nUSBC_DETECT), 1, "usb",
667 IORESOURCE_IRQ_HIGHEDGE | IORESOURCE_IRQ_LOWEDGE),
670 static struct platform_device power_supply = {
674 .platform_data = &power_supply_info,
676 .resource = power_supply_resources,
677 .num_resources = ARRAY_SIZE(power_supply_resources),
684 static struct regulator_consumer_supply bq24022_consumers[] = {
685 REGULATOR_SUPPLY("vbus_draw", NULL),
686 REGULATOR_SUPPLY("ac_draw", NULL),
689 static struct regulator_init_data bq24022_init_data = {
692 .valid_ops_mask = REGULATOR_CHANGE_CURRENT|REGULATOR_CHANGE_STATUS,
694 .num_consumer_supplies = ARRAY_SIZE(bq24022_consumers),
695 .consumer_supplies = bq24022_consumers,
698 static struct gpio bq24022_gpios[] = {
699 { GPIO96_HX4700_BQ24022_ISET2, GPIOF_OUT_INIT_LOW, "bq24022_iset2" },
702 static struct gpio_regulator_state bq24022_states[] = {
703 { .value = 100000, .gpios = (0 << 0) },
704 { .value = 500000, .gpios = (1 << 0) },
707 static struct gpio_regulator_config bq24022_info = {
708 .supply_name = "bq24022",
710 .enable_gpio = GPIO72_HX4700_BQ24022_nCHARGE_EN,
712 .enabled_at_boot = 0,
714 .gpios = bq24022_gpios,
715 .nr_gpios = ARRAY_SIZE(bq24022_gpios),
717 .states = bq24022_states,
718 .nr_states = ARRAY_SIZE(bq24022_states),
720 .type = REGULATOR_CURRENT,
721 .init_data = &bq24022_init_data,
724 static struct platform_device bq24022 = {
725 .name = "gpio-regulator",
728 .platform_data = &bq24022_info,
736 static void hx4700_set_vpp(struct platform_device *pdev, int vpp)
738 gpio_set_value(GPIO91_HX4700_FLASH_VPEN, vpp);
741 static struct resource strataflash_resource[] = {
742 [0] = DEFINE_RES_MEM(PXA_CS0_PHYS, SZ_64M),
743 [1] = DEFINE_RES_MEM(PXA_CS0_PHYS + SZ_64M, SZ_64M),
746 static struct physmap_flash_data strataflash_data = {
748 .set_vpp = hx4700_set_vpp,
751 static struct platform_device strataflash = {
752 .name = "physmap-flash",
754 .resource = strataflash_resource,
755 .num_resources = ARRAY_SIZE(strataflash_resource),
757 .platform_data = &strataflash_data,
762 * Maxim MAX1587A on PI2C
765 static struct regulator_consumer_supply max1587a_consumer =
766 REGULATOR_SUPPLY("vcc_core", NULL);
768 static struct regulator_init_data max1587a_v3_info = {
770 .name = "vcc_core range",
774 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
776 .num_consumer_supplies = 1,
777 .consumer_supplies = &max1587a_consumer,
780 static struct max1586_subdev_data max1587a_subdev = {
783 .platform_data = &max1587a_v3_info,
786 static struct max1586_platform_data max1587a_info = {
788 .subdevs = &max1587a_subdev,
789 .v3_gain = MAX1586_GAIN_R24_3k32, /* 730..1550 mV */
792 static struct i2c_board_info __initdata pi2c_board_info[] = {
794 I2C_BOARD_INFO("max1586", 0x14),
795 .platform_data = &max1587a_info,
800 * Asahi Kasei AK4641 on I2C
803 static struct ak4641_platform_data ak4641_info = {
804 .gpio_power = GPIO27_HX4700_CODEC_ON,
805 .gpio_npdn = GPIO109_HX4700_CODEC_nPDN,
808 static struct i2c_board_info i2c_board_info[] __initdata = {
810 I2C_BOARD_INFO("ak4641", 0x12),
811 .platform_data = &ak4641_info,
815 static struct platform_device audio = {
816 .name = "hx4700-audio",
825 static struct platform_device *devices[] __initdata = {
840 static struct gpio global_gpios[] = {
841 { GPIO12_HX4700_ASIC3_IRQ, GPIOF_IN, "ASIC3_IRQ" },
842 { GPIO13_HX4700_W3220_IRQ, GPIOF_IN, "W3220_IRQ" },
843 { GPIO14_HX4700_nWLAN_IRQ, GPIOF_IN, "WLAN_IRQ" },
844 { GPIO59_HX4700_LCD_PC1, GPIOF_OUT_INIT_HIGH, "LCD_PC1" },
845 { GPIO62_HX4700_LCD_nRESET, GPIOF_OUT_INIT_HIGH, "LCD_RESET" },
846 { GPIO70_HX4700_LCD_SLIN1, GPIOF_OUT_INIT_HIGH, "LCD_SLIN1" },
847 { GPIO84_HX4700_LCD_SQN, GPIOF_OUT_INIT_HIGH, "LCD_SQN" },
848 { GPIO110_HX4700_LCD_LVDD_3V3_ON, GPIOF_OUT_INIT_HIGH, "LCD_LVDD" },
849 { GPIO111_HX4700_LCD_AVDD_3V3_ON, GPIOF_OUT_INIT_HIGH, "LCD_AVDD" },
850 { GPIO32_HX4700_RS232_ON, GPIOF_OUT_INIT_HIGH, "RS232_ON" },
851 { GPIO61_HX4700_W3220_nRESET, GPIOF_OUT_INIT_HIGH, "W3220_nRESET" },
852 { GPIO71_HX4700_ASIC3_nRESET, GPIOF_OUT_INIT_HIGH, "ASIC3_nRESET" },
853 { GPIO81_HX4700_CPU_GP_nRESET, GPIOF_OUT_INIT_HIGH, "CPU_GP_nRESET" },
854 { GPIO82_HX4700_EUART_RESET, GPIOF_OUT_INIT_HIGH, "EUART_RESET" },
855 { GPIO116_HX4700_CPU_HW_nRESET, GPIOF_OUT_INIT_HIGH, "CPU_HW_nRESET" },
858 static void __init hx4700_init(void)
862 PCFR = PCFR_GPR_EN | PCFR_OPDE;
864 pxa2xx_mfp_config(ARRAY_AND_SIZE(hx4700_pin_config));
865 gpio_set_wake(GPIO12_HX4700_ASIC3_IRQ, 1);
866 ret = gpio_request_array(ARRAY_AND_SIZE(global_gpios));
868 pr_err ("hx4700: Failed to request GPIOs.\n");
870 pxa_set_ffuart_info(NULL);
871 pxa_set_btuart_info(NULL);
872 pxa_set_stuart_info(NULL);
874 platform_add_devices(devices, ARRAY_SIZE(devices));
876 pxa_set_ficp_info(&ficp_info);
877 pxa27x_set_i2c_power_info(NULL);
878 pxa_set_i2c_info(NULL);
879 i2c_register_board_info(0, ARRAY_AND_SIZE(i2c_board_info));
880 i2c_register_board_info(1, ARRAY_AND_SIZE(pi2c_board_info));
881 pxa2xx_set_spi_info(2, &pxa_ssp2_master_info);
882 spi_register_board_info(ARRAY_AND_SIZE(tsc2046_board_info));
884 gpio_set_value(GPIO71_HX4700_ASIC3_nRESET, 0);
886 gpio_set_value(GPIO71_HX4700_ASIC3_nRESET, 1);
890 MACHINE_START(H4700, "HP iPAQ HX4700")
891 .atag_offset = 0x100,
892 .map_io = pxa27x_map_io,
893 .nr_irqs = HX4700_NR_IRQS,
894 .init_irq = pxa27x_init_irq,
895 .handle_irq = pxa27x_handle_irq,
896 .init_machine = hx4700_init,
898 .restart = pxa_restart,