hh.org updates
[hh.org.git] / arch / arm / mach-pxa / htcalpine / htcalpine.c
blob94528f8b333894870ea70dc1262d74ac183e3593
1 /*
2 * linux/arch/arm/mach-pxa/htcalpine/htcalpine.c
4 * Support for the Intel XScale based Palm PDAs. Only the LifeDrive is
5 * supported at the moment.
7 * Author: Alex Osborne <bobofdoom@gmail.com>
9 * USB stubs based on aximx30.c (Michael Opdenacker)
13 #include <linux/kernel.h>
14 #include <linux/init.h>
15 #include <linux/device.h>
16 #include <linux/fb.h>
17 #include <linux/platform_device.h>
19 #include <asm/mach-types.h>
20 #include <asm/mach/arch.h>
22 #include <asm/arch/hardware.h>
23 #include <asm/arch/pxafb.h>
24 #include <asm/arch/pxa-regs.h>
25 #include <asm/arch/udc.h>
27 #include <asm/arch/htcalpine-gpio.h>
29 #include "tsc2046_ts.h"
31 #include "../generic.h"
33 #define GPSR_BIT(n) (GPSR((n)) = GPIO_bit((n)))
34 #define GPCR_BIT(n) (GPCR((n)) = GPIO_bit((n)))
36 static struct pxafb_mach_info htcalpine_lcd __initdata = {
37 .pixclock = 115384,
38 .xres = 240,
39 .yres = 320,
40 .bpp = 16,
41 .hsync_len = 34,
42 .vsync_len = 8,
43 .left_margin = 34,
44 .right_margin = 34,
45 .upper_margin = 7,
46 .lower_margin = 7,
48 // .sync = FB_SYNC_HOR_LOW_ACT|FB_SYNC_VERT_LOW_ACT,
50 /* fixme: this is a hack, use constants instead. */
51 .lccr0 = 0x04000081,
52 .lccr3 = 0x04400000,
56 static struct tsc2046_mach_info htcalpine_ts_platform_data = {
57 .port = 2,
58 .clock = CKEN3_SSP2,
59 .pwrbit_X = 1,
60 .pwrbit_Y = 1,
61 .irq = HTCALPINE_IRQ(TOUCHPANEL_IRQ_N)
64 static struct platform_device htcalpine_ts = {
65 .name = "htcalpine_ts",
66 .dev = {
67 .platform_data = &htcalpine_ts_platform_data,
71 static struct platform_device *devices[] __initdata = {
72 &htcalpine_ts,
73 // &htcalpine_flash,
74 // &htcalpine_pxa_keys,
77 /****************************************************************
78 * USB client controller
79 ****************************************************************/
81 static void udc_command(int cmd)
83 switch (cmd)
85 case PXA2XX_UDC_CMD_DISCONNECT:
86 printk(KERN_NOTICE "USB cmd disconnect\n");
87 GPCR_BIT(GPIO_NR_HTCALPINE_USB_PUEN);
88 break;
89 case PXA2XX_UDC_CMD_CONNECT:
90 printk(KERN_NOTICE "USB cmd connect\n");
91 GPSR_BIT(GPIO_NR_HTCALPINE_USB_PUEN);
92 break;
96 static struct pxa2xx_udc_mach_info htcalpine_udc_mach_info = {
97 .udc_command = udc_command,
100 static void __init htcalpine_init(void)
102 set_pxa_fb_info( &htcalpine_lcd );
103 platform_add_devices( devices, ARRAY_SIZE(devices) );
104 pxa_set_udc_info( &htcalpine_udc_mach_info );
107 MACHINE_START(HTCALPINE, "HTC Alpine")
108 .phys_io = 0x40000000,
109 .io_pg_offst = io_p2v(0x40000000),
110 .boot_params = 0xa0000100,
111 .map_io = pxa_map_io,
112 .init_irq = pxa_init_irq,
113 .timer = &pxa_timer,
114 .init_machine = htcalpine_init,
115 MACHINE_END