hh.org updates
[hh.org.git] / arch / arm / mach-pxa / palmld / palmld.c
blob0efc1b1c9458651b20abdd38a2c011b0539576a7
1 /*
2 * linux/arch/arm/mach-pxa/palm/palm.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>
18 #include <asm/mach-types.h>
19 #include <asm/mach/arch.h>
21 #include <asm/arch/hardware.h>
22 #include <asm/arch/pxafb.h>
23 #include <asm/arch/pxa-regs.h>
24 #include <asm/arch/udc.h>
25 #include <asm/arch/palmld-gpio.h>
27 #include "../generic.h"
29 static void palm_backlight_power(int on)
31 /**
32 * TODO: check which particular PWM controls the backlight on the LifeDrive
33 * and enable and disable it here. It's PWM1 on the Tungsten T3. Quite
34 * likely to be the same.
39 /* USB Device Controller */
41 static int udc_is_connected(void)
43 return GPLR(GPIO_PALMLD_USB_DETECT) & GPIO_bit(GPIO_PALMLD_USB_DETECT);
46 static void udc_enable(int cmd)
48 /**
49 * TODO: find the GPIO line which powers up the USB.
51 switch (cmd)
53 case PXA2XX_UDC_CMD_DISCONNECT:
54 printk (KERN_NOTICE "USB cmd disconnect\n");
55 /* SET_X30_GPIO(USB_PUEN, 0); */
56 break;
58 case PXA2XX_UDC_CMD_CONNECT:
59 printk (KERN_NOTICE "USB cmd connect\n");
60 /* SET_X30_GPIO(USB_PUEN, 1); */
61 break;
64 static struct pxa2xx_udc_mach_info palmld_udc_mach_info = {
65 .udc_is_connected = udc_is_connected,
66 .udc_command = udc_enable,
70 static struct pxafb_mach_info palmld_lcd __initdata = {
71 /* pixclock is set by lccr3 below */
72 .pixclock = 0,
73 .xres = 320,
74 .yres = 480,
75 .bpp = 16,
76 .hsync_len = 4,
77 .vsync_len = 1,
79 /* fixme: these are the margins PalmOS has set,
80 * they seem to work but could be better.
82 .left_margin = 31,
83 .right_margin = 3,
84 .upper_margin = 7, //5,
85 .lower_margin = 8, //3,
87 .sync = FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT,
89 /* fixme: this is a hack, use constants instead. */
90 .lccr0 = 0x7b008f8,
91 .lccr3 = 0x4700004,
93 .pxafb_backlight_power = palm_backlight_power,
96 static void __init palmld_init(void)
98 set_pxa_fb_info( &palmld_lcd );
99 pxa_set_udc_info( &palmld_udc_mach_info );
102 MACHINE_START(XSCALE_PALMLD, "Palm LifeDrive")
103 .phys_ram = 0xa0000000,
104 .phys_io = 0x40000000,
105 .io_pg_offst = io_p2v(0x40000000),
106 .boot_params = 0xa0000100,
107 .map_io = pxa_map_io,
108 .init_irq = pxa_init_irq,
109 .timer = &pxa_timer,
110 .init_machine = palmld_init,
111 MACHINE_END