Index: arch/arm/mach-pxa/htcuniversal/htcuniversal_core.c =================================================================== RCS file: /cvs/linux/kernel26/arch/arm/mach-pxa/htcuniversal/htcuniversal_core.c,v retrieving revision 1.12 diff -u -r1.12 htcuniversal_core.c --- arch/arm/mach-pxa/htcuniversal/htcuniversal_core.c 18 Jul 2007 13:21:03 -0000 1.12 +++ arch/arm/mach-pxa/htcuniversal/htcuniversal_core.c 15 Dec 2007 20:42:51 -0000 @@ -70,6 +70,8 @@ static int htcuniversal_suspend(struct platform_device *dev, pm_message_t state) { + printk("htcuniversal_suspend\n"); + /* Turn off external clocks here, because htcuniversal_power and asic3_mmc * scared to do so to not hurt each other. (-5 mA) */ @@ -120,6 +122,7 @@ PRER = PWER_GPIO0 | PWER_GPIO1 | PWER_GPIO9 + | PWER_GPIO14 /* ASIC3 mux */ | PWER_GPIO10; /* 3.6864 MHz oscillator power-down enable */ PCFR = PCFR_OPDE | PCFR_PI2CEN | PCFR_GPROD | PCFR_GPR_EN; @@ -153,6 +156,7 @@ static int htcuniversal_resume(struct platform_device *dev) { + printk("htcuniversal_resume\n"); htcuniversal_egpio_enable(0); return 0; Index: arch/arm/mach-pxa/htcuniversal/htcuniversal_phone.c =================================================================== RCS file: /cvs/linux/kernel26/arch/arm/mach-pxa/htcuniversal/htcuniversal_phone.c,v retrieving revision 1.9 diff -u -r1.9 htcuniversal_phone.c --- arch/arm/mach-pxa/htcuniversal/htcuniversal_phone.c 18 Jul 2007 13:21:03 -0000 1.9 +++ arch/arm/mach-pxa/htcuniversal/htcuniversal_phone.c 15 Dec 2007 20:42:51 -0000 @@ -11,6 +11,9 @@ #include #include #include +#include +#include +#include #include #include @@ -22,6 +25,7 @@ static void phone_reset(void) { + printk("phone_reset called\n"); asic3_set_gpio_out_b(&htcuniversal_asic3.dev, 1< #include #include +#include +#include +#include #ifdef CONFIG_ARCH_PXA #include @@ -152,11 +155,25 @@ .fops = &sa1100dog_fops, }; -static int margin __initdata = 60; /* (secs) Default is 1 minute */ +static int margin __initdata = 200; /* Default is 200 secs */ + +static int internal_keepalive(void *unused_arg) +{ + while (!kthread_should_stop()) { + set_current_state(TASK_RUNNING); + OSMR3 = OSCR + pre_margin; + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(msecs_to_jiffies(5000)); /* Sleep during 5 secs */ + try_to_freeze(); + } + + return 0; +} static int __init sa1100dog_init(void) { int ret; + struct task_struct *p; /* * Read the reset status, and save it for later. If @@ -165,11 +182,16 @@ */ boot_status = (RCSR & RCSR_WDR) ? WDIOF_CARDRESET : 0; pre_margin = OSCR_FREQ * margin; + printk("Set timer to %d\n", OSCR + pre_margin); + OSMR3 = OSCR + pre_margin; ret = misc_register(&sa1100dog_miscdev); if (ret == 0) printk("SA1100/PXA2xx Watchdog Timer: timer margin %d sec\n", margin); + if (IS_ERR(p = kthread_create(internal_keepalive, NULL, "sa1100d"))) + panic("Could not create keepalive kthread !\n"); + wake_up_process(p); return ret; }