|
From: <hap...@us...> - 2007-03-20 16:40:25
|
Revision: 929
http://svn.sourceforge.net/hackndev/?rev=929&view=rev
Author: happy-slapin
Date: 2007-03-20 09:40:22 -0700 (Tue, 20 Mar 2007)
Log Message:
-----------
z72: PM cleanup
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c 2007-03-20 16:05:19 UTC (rev 928)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c 2007-03-20 16:40:22 UTC (rev 929)
@@ -26,17 +26,6 @@
#include <asm/arch/palmz72-gpio.h>
#include <asm/arch/pxa27x_keyboard.h>
-#define KPASMKP(col) (col/2==0 ? KPASMKP0 : col/2==1 ? KPASMKP1 : col/2==2 ? KPASMKP2 : KPASMKP3)
-#define KPASMKPx_MKC(row, col) (1 << (row + 16*(col%2)))
-
-struct pm_save_data
-{
- int brightness;
- u32 rcnr;
-};
-
-static struct pm_save_data pm_save_data;
-
#ifdef CONFIG_PM
static int palmz72_suspend(struct device *dev, pm_message_t state)
{
@@ -56,9 +45,6 @@
while(!(OSCC & OSCC_OOK))
{}
- /* Here are all of special for suspend PalmOne Zire 72 */
- //printk("Palmz72_suspend: suspending...");
-
/* Turn off LCD power */
SET_PALMZ72_GPIO(LCD_POWER,0);
/* Turn screen off */
@@ -115,98 +101,6 @@
.resume = palmz72_pxa_ll_pm_resume,
};
-static int (*pxa_pm_enter_orig)(suspend_state_t state);
-#define KBD_ROWS 4
-#define KBD_COLS 3
-#if 0
-static int check_buttons(void)
-{
- int data = 0, row, col;
- u32 storekpc = KPC;
-
- data = GET_GPIO(GPIO_NR_PALMZ72_KP_DKIN7) && 1;
-
- pxa_set_cken(CKEN19_KEYPAD, 1);
-
- KPC |= KBD_ROWS << 26;
- KPC |= KBD_COLS << 23;
-
- KPC &= ~(KPC_ASACT|KPC_AS|KPC_IMKP|KPC_DE|KPC_DIE|KPC_MIE);
-
- /* Processing automatic scan once */
- KPC |= KPC_ME | KPC_AS;
-
- for (row=0; row < KBD_ROWS; row++) {
- for (col=0; col < KBD_COLS; col++) {
- data |= (KPASMKP(col) & KPASMKPx_MKC(row, col) && 1) << 2;
- }
- }
-
-
-// pxa_set_cken(CKEN19_KEYPAD, 0);
- KPC = storekpc;
- return data;
-}
-#endif
-static int zire72_enter_suspend(suspend_state_t state)
-{
- /* Here we should implement wakeup conditions
- If we have none, just return 1 to continue
- sleeping */
- int data = 0;
-
- /* Do not suspend on active keypress */
-#if 0
- if(check_buttons())
- return 1;
-#endif
- pxa_pm_enter_orig(state);
-
-#if 0
- if(!pm_save_data.rcnr) pm_save_data.rcnr = RCNR;
- while(RCNR < ( pm_save_data.rcnr + 3)) {
-
- /* If we release button, sleep back */
- if(!(data = check_buttons())) {
- pm_save_data.rcnr = 0;
- return 1;
- }
- }
-#endif
- printk(KERN_NOTICE "Returning from sleep due to GPIOs 100-102 or 13\n");
- printk(KERN_NOTICE "RCNR = %u pm_save_data.rcnr = %u\n", RCNR, pm_save_data.rcnr);
- printk(KERN_NOTICE "Keys pressed: %d\n", data);
- pm_save_data.rcnr = 0;
- return 0;
-}
-
-
-static int zire72_pxa_pm_enter(suspend_state_t state)
-{
- pm_save_data.rcnr = 0;
-
-#if 0
- /* Do not suspend on active keypress */
- if(check_buttons())
- return 0;
-#endif
- pxa_pm_enter_orig(state);
-
- while (zire72_enter_suspend(state))
- {}
- return 0;
-}
-
-
-static struct pm_ops zire72_pm_ops = {
- .pm_disk_mode = PM_DISK_FIRMWARE,
- .prepare = pxa_pm_prepare,
- .enter = zire72_pxa_pm_enter,
- .finish = pxa_pm_finish,
-};
-
-extern struct pm_ops pxa_pm_ops;
-
static int palmz72_pm_probe(struct device *dev)
{
printk(KERN_NOTICE "PalmOne Zire72 power management driver registered\n");
@@ -223,14 +117,11 @@
static int __init palmz72_pm_init(void)
{
- pxa_pm_enter_orig = pxa_pm_ops.enter;
- pxa_pm_ops.enter = zire72_pxa_pm_enter;
return driver_register(&palmz72_pm_driver);
}
static void __exit palmz72_pm_exit(void)
{
- pxa_pm_ops.enter = pxa_pm_enter_orig;
driver_unregister(&palmz72_pm_driver);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|