|
From: <mar...@us...> - 2007-03-20 16:12:28
|
Revision: 928
http://svn.sourceforge.net/hackndev/?rev=928&view=rev
Author: marex_z71
Date: 2007-03-20 09:05:19 -0700 (Tue, 20 Mar 2007)
Log Message:
-----------
PalmLD: various cleanups and testing microdrive suspend/resume
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_ide.c
linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_pm.c
linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-gpio.h
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_ide.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_ide.c 2007-03-19 23:47:26 UTC (rev 927)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_ide.c 2007-03-20 16:05:19 UTC (rev 928)
@@ -57,13 +57,33 @@
if (hd) {
ide_unregister(*hd);
}
-
+ kfree(hd);
/* conserve battery where we can */
SET_PALMLD_GPIO(IDE_PWEN, 0);
return 0;
}
+#ifdef CONFIG_PM
+static int palmld_ide_suspend(struct platform_device *dev, pm_message_t state)
+{
+ printk("palmld_ide_suspend: going zzz\n");
+ palmld_ide_remove(dev);
+ return 0;
+}
+
+static int palmld_ide_resume(struct platform_device *dev)
+{
+ printk("palmld_ide_resume: resuming\n");
+ palmld_ide_probe(dev);
+ return 0;
+}
+#else
+#define palmld_suspend NULL
+#define palmld_resume NULL
+#endif
+
+
static struct platform_driver palmld_ide_driver = {
.driver = {
.name = "palmld-ide",
@@ -71,8 +91,8 @@
},
.probe = palmld_ide_probe,
.remove = palmld_ide_remove,
- .suspend= NULL,
- .resume = NULL,
+ .suspend= palmld_ide_suspend,
+ .resume = palmld_ide_resume,
};
static int __init palmld_ide_init(void)
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_pm.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_pm.c 2007-03-19 23:47:26 UTC (rev 927)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_pm.c 2007-03-20 16:05:19 UTC (rev 928)
@@ -31,14 +31,6 @@
#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 palmld_suspend(struct device *dev, pm_message_t state)
{
@@ -67,8 +59,14 @@
while(!(OSCC & OSCC_OOK))
{}
+ /* Here are all of special for suspend PalmOne LifeDrive */
+
+ /* Turn off LCD power */
+ SET_PALMLD_GPIO(LCD_POWER,0);
+ /* Turn screen off */
+ SET_PALMLD_GPIO(SCREEN,0);
+
/* disable GPIO reset, palm bootloader will hang us */
- //PCFR |= PCFR_GPR_EN | PCFR_OPDE;
PCFR &= PCFR_GPR_EN;
return 0;
@@ -86,9 +84,9 @@
/* Here are all of special to resume PalmOne LifeDrive */
/* Turn on LCD power */
-// SET_PALMZ72_GPIO(LCD_POWER,1);
- /* Turn on USB power */
-// SET_PALMZ72_GPIO(USB_POWER,1);
+ SET_PALMLD_GPIO(LCD_POWER,1);
+ /* Turn screen on */
+ SET_PALMLD_GPIO(SCREEN,1);
return 0;
}
@@ -115,39 +113,6 @@
static int (*pxa_pm_enter_orig)(suspend_state_t state);
-static int lifedrive_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 */
- pxa_pm_enter_orig(state);
-
- 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 lifedrive_pxa_pm_enter(suspend_state_t state)
-{
- pm_save_data.rcnr = 0;
- pxa_pm_enter_orig(state);
- while (lifedrive_enter_suspend(state))
- {}
- return 0;
-}
-
-
-static struct pm_ops lifedrive_pm_ops = {
- .pm_disk_mode = PM_DISK_FIRMWARE,
- .prepare = pxa_pm_prepare,
- .enter = lifedrive_pxa_pm_enter,
- .finish = pxa_pm_finish,
-};
-
extern struct pm_ops pxa_pm_ops;
static int palmld_pm_probe(struct device *dev)
Modified: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-gpio.h
===================================================================
--- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-gpio.h 2007-03-19 23:47:26 UTC (rev 927)
+++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-gpio.h 2007-03-20 16:05:19 UTC (rev 928)
@@ -29,6 +29,7 @@
#define GPIO_NR_PALMLD_EARPHONE_DETECT 13
#define GPIO_NR_PALMLD_SD_DETECT_N 14 /* SD card inserted; RE FE; Input */
#define GPIO_NR_PALMLD_LOCK_SWITCH 15 /* keypad lock */
+#define GPIO_NR_PALMLD_SCREEN 19
#define GPIO_NR_PALMLD_WM9712_IRQ 27
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|