1 /* platform specific code to drive the T7L66XB chip on the e740. */
3 //#include <linux/module.h>
5 #include <linux/kernel.h>
6 #include <linux/init.h>
7 #include <linux/device.h>
8 #include <linux/major.h>
9 #include <linux/interrupt.h>
10 #include <linux/device.h>
11 #include <linux/delay.h>
13 #include <asm/mach-types.h>
14 #include <asm/arch/hardware.h>
15 #include <asm/arch/pxa-regs.h>
16 #include <asm/arch/irq.h>
18 #include <asm/arch/eseries-irq.h>
19 #include <asm/arch/eseries-gpio.h>
21 #include <soc/t7l66xb.h>
23 static struct resource e740_t7l66xb_resources
[] = {
25 .start
= PXA_CS4_PHYS
,
26 .end
= PXA_CS4_PHYS
+ 0x1fffff,
27 .flags
= IORESOURCE_MEM
,
30 .start
= IRQ_GPIO(GPIO_ESERIES_TMIO_IRQ
),
31 .end
= IRQ_GPIO(GPIO_ESERIES_TMIO_IRQ
),
32 .flags
= IORESOURCE_IRQ
,
37 //FIXME - who should really be setting up the clock? bootloader or kernel ?
38 static void e740_t7l66xb_hwinit(void) {
40 GPCR(19) = GPIO_bit(19); // #SUSPEND low
41 GPCR(7) = GPIO_bit(7); // #PCLR low (reset)
42 pxa_gpio_mode(GPIO7_48MHz_MD
);
43 pxa_gpio_mode(GPIO12_32KHz_MD
);
45 GPSR(19) = GPIO_bit(19); // #SUSPEND high
47 GPSR(7) = GPIO_bit(7); // #PCLR high
51 static void e740_t7l66xb_suspend(void) {
52 GPCR(19) = GPIO_bit(19); // #SUSPEND low
54 GPCR(7) = GPIO_bit(7); // #PCLR low
57 // pxa_gpio_mode(GPIO7_48MHz_MD|GPIO_OUT);
58 // GPSR0 = GPIO_bit(GPIO7_48MHz);
61 static void e740_t7l66xb_resume(void) {
62 e740_t7l66xb_hwinit();
65 static struct t7l66xb_platform_data e740_t7l66xb_info
= {
66 .hw_init
= &e740_t7l66xb_hwinit
,
67 .suspend
= &e740_t7l66xb_suspend
,
68 .resume
= &e740_t7l66xb_resume
,
71 static struct platform_device e740_t7l66xb_device
= {
75 .driver_data
= &e740_t7l66xb_info
,
77 .num_resources
= ARRAY_SIZE(e740_t7l66xb_resources
),
78 .resource
= e740_t7l66xb_resources
,
81 static int __init
e740_t7l66xb_init(void)
83 if(!machine_is_e740())
86 platform_device_register(&e740_t7l66xb_device
);
90 module_init(e740_t7l66xb_init
);
92 MODULE_AUTHOR("Ian Molton <spyro@f2s.com>");
93 MODULE_DESCRIPTION("e740 t7l66xb device support");
94 MODULE_LICENSE("GPL");