1 /* Core Hardware driver for HTC Sable (Serial, ASIC3, EGPIOs)
3 * Copyright (c) 2005 SDG Systems, LLC
5 * 2005-03-29 Todd Blumer Converted basic structure to support hx4700
6 * 2005-04-30 Todd Blumer Add IRDA code from H2200
9 #include <linux/kernel.h>
10 #include <linux/module.h>
11 #include <linux/device.h>
12 #include <linux/version.h>
13 #include <linux/config.h>
14 #include <linux/interrupt.h>
15 #include <linux/platform_device.h>
16 #include <linux/delay.h>
19 #include <asm/mach-types.h>
20 #include <asm/hardware.h>
23 #include <asm/mach/irq.h>
24 #include <asm/arch/pxa-regs.h>
25 #include <asm/arch/pxa-pm_ll.h>
26 #include <asm/arch/htcsable-gpio.h>
27 #include <asm/arch/htcsable-asic.h>
29 #include <linux/soc/asic3_base.h>
30 #include <asm/hardware/ipaq-asic3.h>
37 void htcsable_ll_pm_init(void);
39 static int htcsable_suspend(struct device
*dev
, pm_message_t state
)
41 /* Turn off external clocks here, because htcsable_power and asic3_mmc
42 * scared to do so to not hurt each other. (-5 mA) */
44 asic3_set_clock_cdex(&htcsable_asic3
.dev
,
45 CLOCK_CDEX_EX0
| CLOCK_CDEX_EX1
, 0 | 0);
47 /* 0x20c2 is HTC clock value
58 * CLOCK_CDEX_SD_HOST 0
62 * CLOCK_CDEX_CONTROL_CX 0
66 asic3_set_clock_cdex(&htcsable_asic3
.dev
, 0xffff, 0x73cc);
70 | PWER_GPIO1
/* reset */
73 /* Wake up on falling edge. */
76 /* Wake up on rising edge. */
80 /* 3.6864 MHz oscillator power-down enable */
81 PCFR
= PCFR_OPDE
| PCFR_PI2CEN
| (1<<5);
90 asic3_set_extcf_select(&htcsable_asic3
.dev
, ASIC3_EXTCF_OWM_EN
, 0);
95 static int htcsable_resume(struct device
*dev
)
100 # define htcsable_suspend NULL
101 # define htcsable_resume NULL
105 htcsable_core_probe( struct device
*dev
)
107 printk( KERN_NOTICE
"HTC Sable Core Hardware Driver\n" );
109 htcsable_ll_pm_init();
115 htcsable_core_remove( struct device
*dev
)
121 struct device_driver htcsable_core_driver
= {
122 .name
= "htcsable_core",
123 .bus
= &platform_bus_type
,
124 .probe
= htcsable_core_probe
,
125 .remove
= htcsable_core_remove
,
126 .suspend
= htcsable_suspend
,
127 .resume
= htcsable_resume
,
131 htcsable_core_init( void )
133 return driver_register( &htcsable_core_driver
);
138 htcsable_core_exit( void )
140 driver_unregister( &htcsable_core_driver
);
143 module_init( htcsable_core_init
);
144 module_exit( htcsable_core_exit
);
146 MODULE_AUTHOR("Todd Blumer, SDG Systems, LLC");
147 MODULE_DESCRIPTION("HTC Sable Core Hardware Driver");
148 MODULE_LICENSE("GPL");
150 /* vim600: set noexpandtab sw=8 ts=8 :*/