From: <pet...@us...> - 2007-05-01 14:43:11
|
Revision: 963 http://svn.sourceforge.net/hackndev/?rev=963&view=rev Author: petrblaha Date: 2007-05-01 07:43:07 -0700 (Tue, 01 May 2007) Log Message: ----------- Modified Paths: -------------- linux4palm/linux/trunk/Makefile linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/Kconfig linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/Makefile linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/palmt650.c linux4palm/linux/trunk/arch/arm/mach-pxa/pxa27x.c linux4palm/linux/trunk/drivers/leds/leds-palmt650.c linux4palm/linux/trunk/drivers/misc/Kconfig linux4palm/linux/trunk/drivers/misc/Makefile linux4palm/linux/trunk/drivers/video/logo/Makefile linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmt650-gpio.h Added Paths: ----------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/palmt650_pm.c Modified: linux4palm/linux/trunk/Makefile =================================================================== --- linux4palm/linux/trunk/Makefile 2007-04-30 11:41:31 UTC (rev 962) +++ linux4palm/linux/trunk/Makefile 2007-05-01 14:43:07 UTC (rev 963) @@ -183,7 +183,7 @@ # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile ARCH := arm -CROSS_COMPILE ?= arm-softfloat-linux-gnu- +CROSS_COMPILE ?= arm-none-eabi- # Architecture as present in compile.h UTS_MACHINE := $(ARCH) Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/Kconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/Kconfig 2007-04-30 11:41:31 UTC (rev 962) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/Kconfig 2007-05-01 14:43:07 UTC (rev 963) @@ -6,3 +6,9 @@ Palm Treo 650. Currently there is only basic support for this PDA. +config MACH_XSCALE_PALMTREO650_PM + tristate "Palm Treo 650 Power Management support" + depends on MACH_XSCALE_PALMTREO650 + default y if MACH_XSCALE_PALMTREO650 + help + Enables support for suspend/resume the PalmOne treo 650. Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/Makefile =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/Makefile 2007-04-30 11:41:31 UTC (rev 962) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/Makefile 2007-05-01 14:43:07 UTC (rev 963) @@ -2,5 +2,5 @@ # Makefile for Palm Treo 650 support # -obj-$(CONFIG_MACH_XSCALE_PALMTREO650) += palmt650.o - +obj-$(CONFIG_MACH_XSCALE_PALMTREO650) += palmt650.o +obj-$(CONFIG_MACH_XSCALE_PALMTREO650_PM) += palmt650_pm.o Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/palmt650.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/palmt650.c 2007-04-30 11:41:31 UTC (rev 962) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/palmt650.c 2007-05-01 14:43:07 UTC (rev 963) @@ -96,9 +96,7 @@ static void palmt650_irda_transceiver_mode(struct device *dev, int mode) { -#if 0 - SET_PALMT650_GPIO(IRDA_SD, mode & IR_OFF); -#endif +/* SET_PALMT650_GPIO(IRDA_SD, mode & IR_OFF); */ } static struct pxaficp_platform_data palmt650_ficp_platform_data = { @@ -109,7 +107,6 @@ /********************************************************* * LEDs *********************************************************/ - static struct platform_device palmt650_led = { .name = "palmt650-led", .id = -1, @@ -188,68 +185,68 @@ .keycodes = { { /* row 0 */ KEY_O, // "O" - KEY_LEFT, // "5-Way Left" }, - KEY_RIGHTSHIFT, // "Alternate" }, + KEY_DOWN, // "5-Way Left" }, + -1, // "Alternate" }, KEY_L, // "L" }, KEY_A, // "A" }, KEY_Q, // "Q" }, - KEY_RIGHTCTRL, // "Right Shift" }, + KEY_RIGHTCTRL, // "Right Shift" }, }, { /* row 1 */ KEY_P, // "P" }, - KEY_RIGHT, // "5-Way Right" }, + KEY_UP, // "5-Way Right" }, KEY_LEFTSHIFT, //"Left Shift" }, KEY_Z, // "Z" }, KEY_S, // "S" }, KEY_W, // "W" }, - -1, // "Unused" }, + -1, // "Unused" }, }, { /* row 2 */ - KEY_F1, // "Phone" }, - KEY_UP, // "5-Way Up" }, + -1, // "Phone" }, + KEY_LEFT, // "5-Way Up" }, KEY_0, // "0" }, KEY_X, // "X" }, KEY_D, // "D" }, KEY_E, // "E" }, - -1, // "Unused" }, + -1, // "Unused" }, }, { /* row 3 */ - KEY_F2, // "Calendar" }, - KEY_DOWN, // "5-Way Down" }, - KEY_SPACE, // "Space" }, + KEY_F10, // "Calendar" }, + KEY_RIGHT, // "5-Way Down" }, + KEY_SPACE, // "Space" }, KEY_C, // "C" }, KEY_F, // "F" }, KEY_R, // "R" }, - -1, // "Unused" }, + -1, // "Unused" }, }, { /* row 4 */ - KEY_F3, // "Mail" }, - KEY_SELECT, // "5-Way Center" }, - KEY_HOME, // "Unused" }, + KEY_F12, // "Mail" }, + KEY_ENTER, // "5-Way Center" }, + KEY_F9, // "HOME" }, KEY_V, // "V" }, KEY_G, // "G" }, KEY_T, // "T" }, - -1, // "Unused" }, + -1, // "Unused" }, }, { /* row 5 */ - KEY_F4, // "Off" }, + -1, // "Off" }, KEY_VOLUMEUP, // "Volume Up" }, - KEY_DOT, // "." }, + KEY_DOT, // "." }, KEY_B, // "B" }, KEY_H, // "H" }, KEY_Y, // "Y" }, - -1, // "Unused" }, + -1, // "Unused" }, }, { /* row 6 */ - KEY_F5, // "Mute" }, + KEY_F11, // "Mute" }, KEY_VOLUMEDOWN, // "Volume Down" }, - KEY_KPENTER, // "Return" }, + KEY_ENTER, // "Return" }, KEY_N, // "N" }, KEY_J, // "J" }, KEY_U, // "U" }, - -1, // "Unused" }, + -1, // "Unused" }, }, { /* row 7 */ KEY_RIGHTALT, // "Alt" }, - KEY_MENU, // "Unused" }, - KEY_BACKSPACE, // "P" }, + -1, // "Unused" }, + KEY_BACKSPACE, // "P" }, KEY_M, // "M" KEY_K, // "K" KEY_I, // "I" - -1, // "Unused" }, + -1, // "Unused" }, }, }, @@ -282,7 +279,9 @@ static struct platform_device *devices[] __initdata = { - &palmt650_kbd, &palmt650_ac97, &palmt650_bl, + &palmt650_kbd, + &palmt650_ac97, + &palmt650_bl, &palmt650_led, }; @@ -344,8 +343,8 @@ pxa_set_udc_info( &palmt650_udc_mach_info ); platform_add_devices(devices, ARRAY_SIZE(devices)); -#if 0 /* configure power switch to resume from standby */ +#if 0 PWER |= PWER_GPIO12; PRER |= PWER_GPIO12; #endif @@ -360,4 +359,3 @@ .timer = &pxa_timer, .init_machine = palmt650_init, MACHINE_END - Added: linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/palmt650_pm.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/palmt650_pm.c (rev 0) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/palmt650_pm.c 2007-05-01 14:43:07 UTC (rev 963) @@ -0,0 +1,134 @@ +/************************************************************************ + * PalmOne Zire72 suspend/resume support * + * * + * Authors: Jan Herman <2h...@se...> * + * Sergey Lapin <sla...@gm...> * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License version 2 as * + * published by the Free Software Foundation. * + * * + ************************************************************************/ + +#include <linux/kernel.h> +#include <linux/device.h> +#include <linux/pm.h> +#include <linux/fb.h> +#include <linux/platform_device.h> +#include <asm/mach-types.h> +#include <asm/hardware.h> + +#include <asm/arch/pm.h> +#include <asm/arch/pxa-pm_ll.h> +#include <asm/arch/hardware.h> +#include <asm/arch/pxa-regs.h> + +#include <asm/arch/palmt650-gpio.h> +#include <asm/arch/pxa27x_keyboard.h> + +#ifdef CONFIG_PM +static int palmt650_suspend(struct device *dev, pm_message_t state) +{ + /* Wake-Up on RTC event, etc. */ + PWER |= PWER_RTC | PWER_WEP1; + + /* Wakeup by keyboard :) */ + PKWR = 0xe0000; + + /* Enabled Deep-Sleep mode */ + PCFR |= PCFR_DS; + + /* Low power mode */ + PCFR |= PCFR_OPDE; + + /* 3.6.8.1 */ + while(!(OSCC & OSCC_OOK)) + {} + + /* Turn off LCD power */ + SET_PALMT650_GPIO(LCD_POWER,0); + /* Turn screen off */ + SET_PALMT650_GPIO(LCD_SCREEN,0); + /* Turn off USB power */ +/* SET_PALMT650_GPIO(USB_POWER,0); */ + + + /* disable GPIO reset - DO NOT REMOVE! */ + PCFR = PCFR_GPROD; +/* PCFR &= PCFR_GPR_EN; */ + + return 0; +} + +static int palmt650_resume(struct device *dev) +{ + + /* Disabled Deep-Sleep mode ?? */ + PCFR &= PCFR_DS; + + /* Re-enable GPIO reset */ + PCFR |= PCFR_GPR_EN; /* !! DO NOT REMOVE !! THIS IS NECCESARY FOR ENABLE PALM RESET !! */ + + + /* Here are all of special to resume PalmOne treo 650 */ + + /* Turn on LCD power */ + SET_PALMT650_GPIO(LCD_POWER,1); + /* Turn screen on */ + SET_PALMT650_GPIO(LCD_SCREEN,1); + /* Turn on USB power */ +/* SET_PALMT650_GPIO(USB_POWER,1); */ + + return 0; +} +#else +#define palmt650_suspend NULL +#define palmt650_resume NULL +#endif + +static void palmt650_pxa_ll_pm_suspend(unsigned long resume_addr) +{ + /* For future */ + return; +} + +static void palmt650_pxa_ll_pm_resume(void) +{ + /* For future */ +} + +struct pxa_ll_pm_ops palmt650_ll_pm_ops = { + .suspend = palmt650_pxa_ll_pm_suspend, + .resume = palmt650_pxa_ll_pm_resume, +}; + +static int palmt650_pm_probe(struct device *dev) +{ + printk(KERN_NOTICE "PalmOne Treo 650 power management driver registered\n"); + return 0; +} + +struct device_driver palmt650_pm_driver = { + .name = "palmt650-pm", + .bus = &platform_bus_type, + .probe = palmt650_pm_probe, + .suspend = palmt650_suspend, + .resume = palmt650_resume, +}; + +static int __init palmt650_pm_init(void) +{ + return driver_register(&palmt650_pm_driver); +} + +static void __exit palmt650_pm_exit(void) +{ + driver_unregister(&palmt650_pm_driver); +} + +module_init(palmt650_pm_init); +module_exit(palmt650_pm_exit); + +MODULE_AUTHOR("Jan Herman <2h...@se...>, Sergey Lapin <sla...@gm...>"); +MODULE_DESCRIPTION("PalmOne Treo 650 power management driver"); +MODULE_LICENSE("GPL"); Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/pxa27x.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/pxa27x.c 2007-04-30 11:41:31 UTC (rev 962) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/pxa27x.c 2007-05-01 14:43:07 UTC (rev 963) @@ -139,7 +139,8 @@ extern void pxa_cpu_standby(void); extern void pxa_cpu_suspend(unsigned int); #if defined(CONFIG_MACH_XSCALE_PALMLD) || defined(CONFIG_MACH_XSCALE_PALMTX) \ - || defined(CONFIG_MACH_PALMZ72) || defined(CONFIG_MACH_XSCALE_PALMTT5) + || defined(CONFIG_MACH_PALMZ72) || defined(CONFIG_MACH_XSCALE_PALMTT5) \ + || defined(CONFIG_MACH_XSCALE_PALMTREO650) /* For safety. suspend_mem puts the device in an unresetable state. * On TX one needs to desolder the battery to get out of it. */ Modified: linux4palm/linux/trunk/drivers/leds/leds-palmt650.c =================================================================== --- linux4palm/linux/trunk/drivers/leds/leds-palmt650.c 2007-04-30 11:41:31 UTC (rev 962) +++ linux4palm/linux/trunk/drivers/leds/leds-palmt650.c 2007-05-01 14:43:07 UTC (rev 963) @@ -7,7 +7,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> @@ -97,6 +96,7 @@ }; #ifdef CONFIG_PM + static int palmt650_led_suspend(struct platform_device *dev, pm_message_t state) { led_classdev_suspend(&palmt650_green_led); @@ -148,10 +148,12 @@ asic6_write(0x12, 0xe3); /* FIXME: should be moved to seperate phone driver */ +/* printk("Attempting to reset phone module...\n"); asic6_write(0x48, asic6_read(0x48) & ~0x40); msleep(5); asic6_write(0x48, asic6_read(0x48) | 0x40); +*/ return ret; vibra_err: Modified: linux4palm/linux/trunk/drivers/misc/Kconfig =================================================================== --- linux4palm/linux/trunk/drivers/misc/Kconfig 2007-04-30 11:41:31 UTC (rev 962) +++ linux4palm/linux/trunk/drivers/misc/Kconfig 2007-05-01 14:43:07 UTC (rev 963) @@ -34,6 +34,13 @@ Say Y here to enable monitoring of battery and charger using sysfs interface. +config ASIC6ED + tristate "ASIC6ED" + depends on ARCH_PXA + default n + help + ASIC6 register editor, only for debugging or testing!!! + config GPIOED tristate "GPIOED" depends on ARCH_PXA Modified: linux4palm/linux/trunk/drivers/misc/Makefile =================================================================== --- linux4palm/linux/trunk/drivers/misc/Makefile 2007-04-30 11:41:31 UTC (rev 962) +++ linux4palm/linux/trunk/drivers/misc/Makefile 2007-05-01 14:43:07 UTC (rev 963) @@ -15,6 +15,7 @@ obj-$(CONFIG_BATTCHARGE_MONITOR) += battchargemon.o obj-$(CONFIG_GPIOED) += gpioed.o obj-$(CONFIG_GPIOEDNG) += gpioed-ng.o +obj-$(CONFIG_ASIC6ED) += asic6ed.o obj-$(CONFIG_MCP) += mcp-core.o obj-$(CONFIG_MCP_SA1100) += mcp-sa1100.o Modified: linux4palm/linux/trunk/drivers/video/logo/Makefile =================================================================== --- linux4palm/linux/trunk/drivers/video/logo/Makefile 2007-04-30 11:41:31 UTC (rev 962) +++ linux4palm/linux/trunk/drivers/video/logo/Makefile 2007-05-01 14:43:07 UTC (rev 963) @@ -13,7 +13,6 @@ obj-$(CONFIG_LOGO_SUPERH_VGA16) += logo_superh_vga16.o obj-$(CONFIG_LOGO_SUPERH_CLUT224) += logo_superh_clut224.o obj-$(CONFIG_LOGO_M32R_CLUT224) += logo_m32r_clut224.o - # How to generate logo's # Use logo-cfiles to retrieve list of .c files to be built Modified: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmt650-gpio.h =================================================================== --- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmt650-gpio.h 2007-04-30 11:41:31 UTC (rev 962) +++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmt650-gpio.h 2007-05-01 14:43:07 UTC (rev 963) @@ -33,11 +33,14 @@ #define ASIC6_LED2_AUTOSTOP __REG16(0x080000aa) /* Palm Treo 650 GPIOs */ -#define GPIO_NR_PALMT650_POWER_DETECT 15 +#define GPIO_NR_PALMT650_POWER_DETECT 0 #define GPIO_NR_PALMT650_VIBRATE_EN 26 #define GPIO_NR_PALMT650_SILENT_SWITCH 33 #define GPIO_NR_PALMT650_WM9712_IRQ 90 #define GPIO_NR_PALMT650_SD_DETECT_N 113 /* SD card inserted; RE FE; Input */ +#define GPIO_NR_PALMT650_LCD_POWER 20 +#define GPIO_NR_PALMT650_LCD_SCREEN 77 +#define GPIO_NR_PALMT650_USB_DETECT 9 #define GPIO_NR_PALMT650_KP_MKIN0 100 #define GPIO_NR_PALMT650_KP_MKIN1 101 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |