From: <hap...@us...> - 2006-10-12 17:48:30
|
Revision: 623 http://svn.sourceforge.net/hackndev/?rev=623&view=rev Author: happy-slapin Date: 2006-10-12 10:48:14 -0700 (Thu, 12 Oct 2006) Log Message: ----------- zire72: Found LED GPIO, used as debugging. zire72: Finzlly fixed support for keypad. Now it really works. zire72: updated GPIO map in SVN for proper awk parsing. ALL: semi-applied PXA27 udc-ep and overlays patches from OpenZaurus Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/configs/palmz72_defconfig linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpio_map.txt linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-gpio.h linux4palm/linux/trunk/include/asm-arm/arch-pxa/pxa-regs.h Modified: linux4palm/linux/trunk/arch/arm/configs/palmz72_defconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/configs/palmz72_defconfig 2006-10-06 17:50:43 UTC (rev 622) +++ linux4palm/linux/trunk/arch/arm/configs/palmz72_defconfig 2006-10-12 17:48:14 UTC (rev 623) @@ -1,13 +1,15 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.16-hnd0 -# Thu Sep 28 19:45:51 2006 +# Linux kernel version: 2.6.17-hnd0 +# Thu Oct 12 20:26:28 2006 # CONFIG_ARM=y CONFIG_MMU=y CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_ARCH_MTD_XIP=y +CONFIG_VECTORS_BASE=0xffff0000 # # Code maturity level options @@ -22,14 +24,16 @@ # CONFIG_LOCALVERSION="" CONFIG_LOCALVERSION_AUTO=y -# CONFIG_SWAP is not set -# CONFIG_SYSVIPC is not set -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -# CONFIG_SYSCTL is not set +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y +CONFIG_BSD_PROCESS_ACCT=y +# CONFIG_BSD_PROCESS_ACCT_V3 is not set +CONFIG_SYSCTL=y # CONFIG_AUDIT is not set # CONFIG_IKCONFIG is not set # CONFIG_MINIMAL_OOPS is not set +# CONFIG_RELAY is not set CONFIG_INITRAMFS_SOURCE="" CONFIG_UID16=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y @@ -43,15 +47,11 @@ CONFIG_BASE_FULL=y CONFIG_FUTEX=y CONFIG_EPOLL=y -# CONFIG_SHMEM is not set +CONFIG_SHMEM=y CONFIG_USELIB=y # CONFIG_CORE_DUMP is not set -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 CONFIG_SLAB=y -CONFIG_TINY_SHMEM=y +# CONFIG_TINY_SHMEM is not set CONFIG_BASE_SMALL=0 # CONFIG_SLOB is not set @@ -61,7 +61,6 @@ CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y -CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set # CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y @@ -69,6 +68,7 @@ # # Block layer # +# CONFIG_BLK_DEV_IO_TRACE is not set # # IO Schedulers @@ -76,7 +76,7 @@ CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y # CONFIG_IOSCHED_DEADLINE is not set -# CONFIG_IOSCHED_CFQ is not set +CONFIG_IOSCHED_CFQ=y CONFIG_DEFAULT_AS=y # CONFIG_DEFAULT_DEADLINE is not set # CONFIG_DEFAULT_CFQ is not set @@ -90,11 +90,13 @@ # CONFIG_ARCH_CLPS711X is not set # CONFIG_ARCH_CO285 is not set # CONFIG_ARCH_EBSA110 is not set +# CONFIG_ARCH_EP93XX is not set # CONFIG_ARCH_FOOTBRIDGE is not set # CONFIG_ARCH_INTEGRATOR is not set # CONFIG_ARCH_IOP3XX is not set # CONFIG_ARCH_IXP4XX is not set # CONFIG_ARCH_IXP2000 is not set +# CONFIG_ARCH_IXP23XX is not set # CONFIG_ARCH_L7200 is not set CONFIG_ARCH_PXA=y # CONFIG_ARCH_RPC is not set @@ -114,6 +116,7 @@ # Intel PXA2xx Implementations # # CONFIG_ARCH_LUBBOCK is not set +# CONFIG_MACH_LOGICPD_PXA270 is not set # CONFIG_MACH_MAINSTONE is not set # CONFIG_ARCH_PXA_IDP is not set # CONFIG_ARCH_ESERIES is not set @@ -127,6 +130,12 @@ # CONFIG_MACH_HX2750 is not set # CONFIG_ARCH_H5400 is not set # CONFIG_MACH_HIMALAYA is not set +# CONFIG_MACH_HTCUNIVERSAL is not set +# CONFIG_MACH_HTCALPINE is not set +# CONFIG_MACH_MAGICIAN is not set +# CONFIG_MACH_HTCAPACHE is not set +# CONFIG_MACH_BLUEANGEL is not set +# CONFIG_MACH_HTCBEETLES is not set # CONFIG_ARCH_AXIMX5 is not set # CONFIG_ARCH_AXIMX3 is not set # CONFIG_ARCH_ROVERP1 is not set @@ -137,10 +146,10 @@ # CONFIG_MACH_XSCALE_PALMTT5 is not set # CONFIG_MACH_XSCALE_PALMTX is not set CONFIG_MACH_PALMZ72=y -CONFIG_PALMZ72_BUTTONS=y # CONFIG_MACH_OMAP_PALMTC is not set # CONFIG_PXA_SHARPSL is not set CONFIG_PXA27x=y +CONFIG_PXA_RTC_EPOCH=1970 # CONFIG_SA1100_H3100 is not set # CONFIG_SA1100_H3600 is not set # CONFIG_SA1100_H3800 is not set @@ -166,6 +175,7 @@ CONFIG_ARM_THUMB=y # CONFIG_ARMBOOT_PROC is not set CONFIG_XSCALE_PMU=y +# CONFIG_KEXEC is not set # # Compaq/iPAQ Platforms @@ -194,8 +204,8 @@ # CONFIG_PREEMPT=y # CONFIG_NO_IDLE_HZ is not set -CONFIG_AEABI=y -CONFIG_OABI_COMPAT=y +CONFIG_HZ=100 +# CONFIG_AEABI is not set # CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set CONFIG_SELECT_MEMORY_MODEL=y CONFIG_FLATMEM_MANUAL=y @@ -228,7 +238,7 @@ # At least one emulation must be selected # CONFIG_FPE_NWFPE=y -CONFIG_FPE_NWFPE_XP=y +# CONFIG_FPE_NWFPE_XP is not set # CONFIG_FPE_FASTFPE is not set # @@ -237,6 +247,7 @@ CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_AOUT is not set # CONFIG_BINFMT_MISC is not set +# CONFIG_ARTHUR is not set # # Power management options @@ -268,12 +279,15 @@ # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +# CONFIG_INET_XFRM_TUNNEL is not set # CONFIG_INET_TUNNEL is not set CONFIG_INET_DIAG=y CONFIG_INET_TCP_DIAG=y # CONFIG_TCP_CONG_ADVANCED is not set CONFIG_TCP_CONG_BIC=y # CONFIG_IPV6 is not set +# CONFIG_INET6_XFRM_TUNNEL is not set +# CONFIG_INET6_TUNNEL is not set # CONFIG_NETFILTER is not set # @@ -365,7 +379,13 @@ # # CONFIG_BT_HCIUART is not set # CONFIG_BT_HCIVHCI is not set -# CONFIG_IEEE80211 is not set +CONFIG_IEEE80211=m +# CONFIG_IEEE80211_DEBUG is not set +# CONFIG_IEEE80211_CRYPT_WEP is not set +# CONFIG_IEEE80211_CRYPT_CCMP is not set +CONFIG_IEEE80211_SOFTMAC=m +# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set +CONFIG_WIRELESS_EXT=y # # Device Drivers @@ -404,9 +424,7 @@ CONFIG_BLK_DEV_LOOP=m # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_RAM_COUNT=16 -CONFIG_BLK_DEV_RAM_SIZE=4096 +# CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_INITRD=y # CONFIG_CDROM_PKTCDVD is not set # CONFIG_ATA_OVER_ETH is not set @@ -517,10 +535,19 @@ # # Input Device Drivers # -# CONFIG_INPUT_KEYBOARD is not set +CONFIG_INPUT_KEYBOARD=y +# CONFIG_KEYBOARD_ATKBD is not set +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_XTKBD is not set +# CONFIG_KEYBOARD_NEWTON is not set +# CONFIG_KEYBOARD_STOWAWAY is not set +CONFIG_KEYBOARD_PXA27x=y +# CONFIG_KEYBOARD_PALMIR is not set # CONFIG_INPUT_MOUSE is not set # CONFIG_INPUT_JOYSTICK is not set CONFIG_INPUT_TOUCHSCREEN=y +# CONFIG_TOUCHSCREEN_ADS7846 is not set # CONFIG_TOUCHSCREEN_GUNZE is not set # CONFIG_TOUCHSCREEN_ELO is not set # CONFIG_TOUCHSCREEN_MTOUCH is not set @@ -536,7 +563,10 @@ # # Hardware I/O ports # -# CONFIG_SERIO is not set +CONFIG_SERIO=y +CONFIG_SERIO_SERPORT=y +CONFIG_SERIO_LIBPS2=y +# CONFIG_SERIO_RAW is not set # CONFIG_GAMEPORT is not set # @@ -607,10 +637,20 @@ # # SPI support # -# CONFIG_SPI is not set -# CONFIG_SPI_MASTER is not set +CONFIG_SPI=y +CONFIG_SPI_MASTER=y # +# SPI Master Controller Drivers +# +# CONFIG_SPI_BITBANG is not set +CONFIG_SPI_PXA2XX=m + +# +# SPI Protocol Masters +# + +# # Dallas's 1-wire bus # # CONFIG_W1 is not set @@ -642,13 +682,23 @@ # CONFIG_MCP is not set # -# Multimedia Capabilities Port drivers +# LED devices # +# CONFIG_NEW_LEDS is not set # +# LED drivers +# + +# +# LED Triggers +# + +# # Multimedia devices # # CONFIG_VIDEO_DEV is not set +CONFIG_VIDEO_V4L2=y # # Digital Video Broadcasting Devices @@ -663,6 +713,7 @@ CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y # CONFIG_FB_MACMODES is not set +CONFIG_FB_FIRMWARE_EDID=y # CONFIG_FB_MODE_HELPERS is not set # CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_IMAGEON is not set @@ -697,7 +748,7 @@ CONFIG_BACKLIGHT_LCD_SUPPORT=y CONFIG_BACKLIGHT_CLASS_DEVICE=y CONFIG_BACKLIGHT_DEVICE=y -CONFIG_BACKLIGHT_PALMZ72=y +# CONFIG_BACKLIGHT_CORGI is not set CONFIG_BACKLIGHT_PXAPWM=y # CONFIG_LCD_CLASS_DEVICE is not set @@ -716,8 +767,10 @@ CONFIG_SND_OSSEMUL=y # CONFIG_SND_MIXER_OSS is not set CONFIG_SND_PCM_OSS=m +CONFIG_SND_PCM_OSS_PLUGINS=y # CONFIG_SND_DYNAMIC_MINORS is not set CONFIG_SND_SUPPORT_OLD_API=y +CONFIG_SND_VERBOSE_PROCFS=y CONFIG_SND_VERBOSE_PRINTK=y # CONFIG_SND_DEBUG is not set @@ -748,6 +801,7 @@ # CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y +# CONFIG_USB_ARCH_HAS_EHCI is not set # CONFIG_USB is not set # @@ -769,6 +823,7 @@ # CONFIG_USB_GADGET_MQ11XX is not set # CONFIG_USB_GADGET_LH7A40X is not set # CONFIG_USB_GADGET_OMAP is not set +# CONFIG_USB_GADGET_AT91 is not set # CONFIG_USB_GADGET_DUMMY_HCD is not set # CONFIG_USB_GADGET_DUALSPEED is not set # CONFIG_USB_ZERO is not set @@ -782,7 +837,7 @@ # # MMC/SD Card support # -CONFIG_MMC=y +CONFIG_MMC=m # CONFIG_MMC_DEBUG is not set CONFIG_MMC_BLOCK=m CONFIG_MMC_PXA=m @@ -792,11 +847,26 @@ # CONFIG_MMC_WBSD_PALMT3 is not set # -# LED devices +# Real Time Clock # -# CONFIG_CLASS_LEDS is not set +CONFIG_RTC_LIB=y +CONFIG_RTC_CLASS=m # +# RTC interfaces +# +CONFIG_RTC_INTF_SYSFS=m +CONFIG_RTC_INTF_PROC=m +CONFIG_RTC_INTF_DEV=m + +# +# RTC drivers +# +# CONFIG_RTC_DRV_M48T86 is not set +CONFIG_RTC_DRV_SA1100=m +# CONFIG_RTC_DRV_TEST is not set + +# # File systems # CONFIG_EXT2_FS=m @@ -841,7 +911,6 @@ CONFIG_TMPFS=y # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y -# CONFIG_RELAYFS_FS is not set # CONFIG_CONFIGFS_FS is not set # @@ -902,7 +971,7 @@ # CONFIG_NLS_CODEPAGE_863 is not set # CONFIG_NLS_CODEPAGE_864 is not set # CONFIG_NLS_CODEPAGE_865 is not set -# CONFIG_NLS_CODEPAGE_866 is not set +CONFIG_NLS_CODEPAGE_866=m # CONFIG_NLS_CODEPAGE_869 is not set # CONFIG_NLS_CODEPAGE_936 is not set # CONFIG_NLS_CODEPAGE_950 is not set @@ -924,7 +993,7 @@ # CONFIG_NLS_ISO8859_13 is not set # CONFIG_NLS_ISO8859_14 is not set # CONFIG_NLS_ISO8859_15 is not set -# CONFIG_NLS_KOI8_R is not set +CONFIG_NLS_KOI8_R=m # CONFIG_NLS_KOI8_U is not set CONFIG_NLS_UTF8=m @@ -942,7 +1011,9 @@ # CONFIG_DEBUG_KERNEL is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_DEBUG_BUGVERBOSE is not set +# CONFIG_DEBUG_FS is not set CONFIG_FRAME_POINTER=y +# CONFIG_UNWIND_INFO is not set # CONFIG_DEBUG_USER is not set # Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig 2006-10-06 17:50:43 UTC (rev 622) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig 2006-10-12 17:48:14 UTC (rev 623) @@ -1,5 +1,6 @@ menuconfig MACH_PALMZ72 bool "Palm Zire 72" select PXA27x + select KEYBOARD_PXA27x help This enables support for Palm Zire 72 handheld. Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpio_map.txt =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpio_map.txt 2006-10-06 17:50:43 UTC (rev 622) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpio_map.txt 2006-10-12 17:48:14 UTC (rev 623) @@ -1,104 +1,104 @@ GPIO pin Level Dir Function -GPIO 0 0 I 00 -GPIO 1 1 I 00 -GPIO 2 1 O 00 -GPIO 3 1 O 00 -GPIO 4 1 O 00 -GPIO 5 1 I 00 -GPIO 6 1 I 00 -GPIO 7 1 I 00 -GPIO 8 1 I 00 -GPIO 9 0 I 00 -GPIO 10 1 I 00 -GPIO 11 0 I 00 -GPIO 12 1 I 00 -GPIO 13 0 I 02 KP_DKIN7 // ??? -GPIO 14 0 I 00 -GPIO 15 0 I 00 -GPIO 16 1 O 02 PWM_OUT0 -GPIO 17 1 O 00 -GPIO 18 0 O 00 -GPIO 19 1 O 00 -GPIO 20 1 O 00 -GPIO 21 0 O 00 -GPIO 22 0 O 00 -GPIO 23 0 O 02 SSPSCLK -GPIO 24 1 O 02 SSPSFRM -GPIO 25 0 O 02 SSPSTXD -GPIO 26 1 I 01 -GPIO 27 0 I 00 -GPIO 28 0 I 01 AC97_BITCLK // AC97 -GPIO 29 0 I 01 AC97_SDATA_IN0 // AC97 -GPIO 30 0 O 02 AC97_SDATA_OUT // AC97 -GPIO 31 0 O 02 AC97_SYNC // AC97 -GPIO 32 0 O 00 -GPIO 33 0 O 00 -GPIO 34 1 I 00 -GPIO 35 1 I 01 FFCTS -GPIO 36 1 O 00 -GPIO 37 1 I 00 -GPIO 38 0 O 00 -GPIO 39 0 O 00 -GPIO 40 0 O 00 -GPIO 41 1 O 02 KP_MKOUT7 // ?? -GPIO 42 1 I 01 IrDA -GPIO 43 1 O 02 IrDA -GPIO 44 1 I 01 BTCTS // blutooth -GPIO 45 1 O 02 BTRTS // blutooth -GPIO 46 1 I 02 STD_RXD -GPIO 47 0 O 01 STD_TXD -GPIO 48 1 I 01 CIF_DD5 -GPIO 49 0 O 00 -GPIO 50 1 I 01 CIF_DD3 -GPIO 51 1 I 01 CIF_DD2 -GPIO 52 1 I 01 CIF_DD4 -GPIO 53 0 O 02 CIF_MCLK -GPIO 54 1 I 03 CIF_PCLK -GPIO 55 0 I 01 CIF_DD1 -GPIO 56 1 O 00 -GPIO 57 0 O 00 -GPIO 58 1 O 02 LDD0 -GPIO 59 1 O 02 LDD1 -GPIO 60 1 O 02 LDD2 -GPIO 61 1 O 02 LDD3 -GPIO 62 1 O 02 LDD4 -GPIO 63 1 O 02 LDD5 -GPIO 64 1 O 02 LDD6 -GPIO 65 1 O 02 LDD7 -GPIO 66 1 O 02 LDD8 -GPIO 67 1 O 02 LDD9 -GPIO 68 1 O 02 LDD10 -GPIO 69 1 O 02 LDD11 -GPIO 70 1 O 02 LDD12 -GPIO 71 1 O 02 LDD13 -GPIO 72 1 O 02 LDD14 -GPIO 73 1 O 02 LDD15 -GPIO 74 1 O 02 L_LCLK_RD -GPIO 75 1 O 02 L_LCLK_A0 -GPIO 76 1 O 02 L_PCLK_WR -GPIO 77 1 O 02 L_BIAS -GPIO 78 0 O 00 -GPIO 79 0 O 00 -GPIO 80 1 I 00 -GPIO 81 1 I 02 CIF_DD0 -GPIO 82 0 O 00 -GPIO 83 0 O 00 -GPIO 84 1 I 03 CIF_FV -GPIO 85 1 I 03 CIF_LV -GPIO 86 1 I 00 -GPIO 87 0 I 00 -GPIO 88 0 O 00 -GPIO 89 0 O 01 AC97_SYSCLK -GPIO 90 0 O 00 -GPIO 91 1 O 00 -GPIO 92 0 O 00 -GPIO 93 1 I 02 CIF_DD6 -GPIO 94 0 I 00 -GPIO 95 0 O 00 -GPIO 96 1 O 00 -GPIO 97 0 I 03 KP_MKIN3 -GPIO 98 1 O 00 -GPIO 99 1 I 00 +GPIO_0 0 I 00 +GPIO_1 1 I 00 +GPIO_2 1 O 00 SYS_EN +GPIO_3 1 O 00 +GPIO_4 1 O 00 +GPIO_5 1 I 00 PWR_CAP<0> +GPIO_6 1 I 00 PWR_CAP<1> +GPIO_7 1 I 00 PWR_CAP<2> +GPIO_8 1 I 00 PWR_CAP<3> +GPIO_9 0 I 00 +GPIO_10 1 I 00 +GPIO_11 0 I 00 +GPIO_12 1 I 00 +GPIO_13 0 I 02 KP_DKIN7 // ??? +GPIO_14 0 I 00 +GPIO_15 0 I 00 USB_PULLUP +GPIO_16 1 O 02 PWM_OUT0 +GPIO_17 1 O 00 +GPIO_18 0 O 00 +GPIO_19 1 O 00 +GPIO_20 1 O 00 +GPIO_21 0 O 00 +GPIO_22 0 O 00 +GPIO_23 0 O 02 SSPSCLK +GPIO_24 1 O 02 SSPSFRM +GPIO_25 0 O 02 SSPSTXD +GPIO_26 1 I 01 SSPRXD +GPIO_27 0 I 00 WM9712_IRQ +GPIO_28 0 I 01 AC97_BITCLK // AC97 +GPIO_29 0 I 01 AC97_SDATA_IN0 // AC97 +GPIO_30 0 O 02 AC97_SDATA_OUT // AC97 +GPIO_31 0 O 02 AC97_SYNC // AC97 +GPIO_32 0 O 00 +GPIO_33 0 O 00 +GPIO_34 1 I 00 +GPIO_35 1 I 01 FFCTS +GPIO_36 1 O 00 +GPIO_37 1 I 00 +GPIO_38 0 O 00 +GPIO_39 0 O 00 +GPIO_40 0 O 00 +GPIO_41 1 O 02 KP_MKOUT7 // ?? +GPIO_42 1 I 01 IrDA +GPIO_43 1 O 02 IrDA +GPIO_44 1 I 01 BTCTS // blutooth +GPIO_45 1 O 02 BTRTS // blutooth +GPIO_46 1 I 02 STD_RXD +GPIO_47 0 O 01 STD_TXD +GPIO_48 1 I 01 CIF_DD5 +GPIO_49 0 O 00 +GPIO_50 1 I 01 CIF_DD3 +GPIO_51 1 I 01 CIF_DD2 +GPIO_52 1 I 01 CIF_DD4 +GPIO_53 0 O 02 CIF_MCLK +GPIO_54 1 I 03 CIF_PCLK +GPIO_55 0 I 01 CIF_DD1 +GPIO_56 1 O 00 +GPIO_57 0 O 00 +GPIO_58 1 O 02 LDD0 +GPIO_59 1 O 02 LDD1 +GPIO_60 1 O 02 LDD2 +GPIO_61 1 O 02 LDD3 +GPIO_62 1 O 02 LDD4 +GPIO_63 1 O 02 LDD5 +GPIO_64 1 O 02 LDD6 +GPIO_65 1 O 02 LDD7 +GPIO_66 1 O 02 LDD8 +GPIO_67 1 O 02 LDD9 +GPIO_68 1 O 02 LDD10 +GPIO_69 1 O 02 LDD11 +GPIO_70 1 O 02 LDD12 +GPIO_71 1 O 02 LDD13 +GPIO_72 1 O 02 LDD14 +GPIO_73 1 O 02 LDD15 +GPIO_74 1 O 02 L_LCLK_RD +GPIO_75 1 O 02 L_LCLK_A0 +GPIO_76 1 O 02 L_PCLK_WR +GPIO_77 1 O 02 L_BIAS +GPIO_78 0 O 00 +GPIO_79 0 O 00 +GPIO_80 1 I 00 +GPIO_81 1 I 02 CIF_DD0 +GPIO_82 0 O 00 +GPIO_83 0 O 00 +GPIO_84 1 I 03 CIF_FV +GPIO_85 1 I 03 CIF_LV +GPIO_86 1 I 00 +GPIO_87 0 I 00 +GPIO_88 0 O 00 +GPIO_89 0 O 01 AC97_SYSCLK +GPIO_90 0 O 00 +GPIO_91 1 O 00 +GPIO_92 0 O 00 +GPIO_93 1 I 02 CIF_DD6 +GPIO_94 0 I 00 +GPIO_95 0 O 00 USB_POWER +GPIO_96 1 O 00 +GPIO_97 0 I 03 KP_MKIN3 +GPIO_98 1 O 00 +GPIO_99 1 I 00 GPIO100 0 I 01 KP_MKIN0 GPIO101 0 I 01 KP_MKIN1 GPIO102 0 I 01 KP_MKIN2 Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c 2006-10-06 17:50:43 UTC (rev 622) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c 2006-10-12 17:48:14 UTC (rev 623) @@ -54,6 +54,9 @@ #define IR_TRANSCEIVER_OFF \ SET_HX4700_GPIO_N(IR_ON, 0) +#define LED_ON SET_GPIO(GPIO_NR_ZIRE72_LED,1) +#define LED_OFF SET_GPIO(GPIO_NR_ZIRE72_LED,0) + static int palmz72_udc_is_connected(void) { int ret = !(GET_GPIO(GPIO_NR_PALMZ72_USB_DETECT)); @@ -293,10 +296,12 @@ pxa_gpio_mode(GPIO29_SDATA_IN_AC97_MD); pxa_gpio_mode(GPIO30_SDATA_OUT_AC97_MD); pxa_gpio_mode(GPIO31_SYNC_AC97_MD); + pxa_gpio_mode(GPIO_NR_ZIRE72_LED_MD); // testing // GPSR(91) = GPIO_bit(91); - + LED_ON; + switch(palmz72lcd.bpp) { case 8: @@ -316,6 +321,7 @@ palmlz72_irda_set_txrx (NULL, PXA_SERIAL_TX); #endif #endif + LED_OFF; } MACHINE_START(PALMZ72, "Palm Zire 72") Modified: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-gpio.h =================================================================== --- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-gpio.h 2006-10-06 17:50:43 UTC (rev 622) +++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-gpio.h 2006-10-12 17:48:14 UTC (rev 623) @@ -19,6 +19,8 @@ #define GPIO_NR_ZIRE72_KP_MKOUT1 104 #define GPIO_NR_ZIRE72_KP_MKOUT2 105 +#define GPIO_NR_ZIRE72_LED 88 +#define GPIO_NR_ZIRE72_LED_MD GPIO_NR_ZIRE72_LED #define GPIO_NR_ZIRE72_KP_MKIN3_MD (GPIO_NR_ZIRE72_KP_MKIN3 | GPIO_ALT_FN_3_IN) #define GPIO_NR_ZIRE72_KP_MKIN0_MD (GPIO_NR_ZIRE72_KP_MKIN0 | GPIO_ALT_FN_1_IN) Modified: linux4palm/linux/trunk/include/asm-arm/arch-pxa/pxa-regs.h =================================================================== --- linux4palm/linux/trunk/include/asm-arm/arch-pxa/pxa-regs.h 2006-10-06 17:50:43 UTC (rev 622) +++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/pxa-regs.h 2006-10-12 17:48:14 UTC (rev 623) @@ -101,6 +101,7 @@ #define DCSR_CLRCMPST (1 << 24) /* Clear Descriptor Compare Status */ #define DCSR_CMPST (1 << 10) /* The Descriptor Compare Status */ #define DCSR_ENRINTR (1 << 9) /* The end of Receive */ +#define DCSR_EORINTR (1 << 9) /* The end of Receive */ #endif #define DCSR_REQPEND (1 << 8) /* Request Pending (read-only) */ #define DCSR_STOPSTATE (1 << 3) /* Stop State (read-only) */ @@ -800,11 +801,18 @@ #define UDC_INT_PACKETCMP (0x1) #define UDCICR_INT(n,intr) (((intr) & 0x03) << (((n) & 0x0F) * 2)) +/* Older defines, do not use. */ #define UDCICR1_IECC (1 << 31) /* IntEn - Configuration Change */ #define UDCICR1_IESOF (1 << 30) /* IntEn - Start of Frame */ #define UDCICR1_IERU (1 << 29) /* IntEn - Resume */ #define UDCICR1_IESU (1 << 28) /* IntEn - Suspend */ #define UDCICR1_IERS (1 << 27) /* IntEn - Reset */ +/* New defines. */ +#define UDCISR1_IRCC (1 << 31) /* IntEn - Configuration Change */ +#define UDCISR1_IRSOF (1 << 30) /* IntEn - Start of Frame */ +#define UDCISR1_IRRU (1 << 29) /* IntEn - Resume */ +#define UDCISR1_IRSU (1 << 28) /* IntEn - Suspend */ +#define UDCISR1_IRRS (1 << 27) /* IntEn - Reset */ #define UDCISR0 __REG(0x4060000C) /* UDC Interrupt Status Register 0 */ #define UDCISR1 __REG(0x40600010) /* UDC Interrupt Status Register 1 */ @@ -1835,6 +1843,8 @@ #define DFBR0 __REG(0x44000020) /* DMA Channel 0 Frame Branch Register */ #define DFBR1 __REG(0x44000024) /* DMA Channel 1 Frame Branch Register */ #define LCSR __REG(0x44000038) /* LCD Controller Status Register */ +#define LCSR0 __REG(0x44000038) /* LCD Controller Status Register */ +#define LCSR1 __REG(0x44000034) /* LCD Controller Status Register */ #define LIIDR __REG(0x4400003C) /* LCD Controller Interrupt ID Register */ #define TMEDRGBR __REG(0x44000040) /* TMED RGB Seed Register */ #define TMEDCR __REG(0x44000044) /* TMED Control Register */ @@ -1844,6 +1854,10 @@ #define LCCR3_4BPP (2 << 24) #define LCCR3_8BPP (3 << 24) #define LCCR3_16BPP (4 << 24) +#define LCCR3_18BPP (6 << 24) +#define LCCR3_19BPP (8 << 24) +#define LCCR3_24BPP (9 << 24) +#define LCCR3_25BPP (10<< 24) #define FDADR0 __REG(0x44000200) /* DMA Channel 0 Frame Descriptor Address Register */ #define FSADR0 __REG(0x44000204) /* DMA Channel 0 Frame Source Address Register */ @@ -2008,6 +2022,104 @@ #define LDCMD_PAL (1 << 26) /* instructs DMA to load palette buffer */ +/* Overlay1 & Overlay2 & Hardware Cursor */ +#define LCSR1_SOF1 (1 << 0) +#define LCSR1_SOF2 (1 << 1) +#define LCSR1_SOF3 (1 << 2) +#define LCSR1_SOF4 (1 << 3) +#define LCSR1_SOF5 (1 << 4) +#define LCSR1_SOF6 (1 << 5) + +#define LCSR1_EOF1 (1 << 8) +#define LCSR1_EOF2 (1 << 9) +#define LCSR1_EOF3 (1 << 10) +#define LCSR1_EOF4 (1 << 11) +#define LCSR1_EOF5 (1 << 12) +#define LCSR1_EOF6 (1 << 13) + +#define LCSR1_BS1 (1 << 16) +#define LCSR1_BS2 (1 << 17) +#define LCSR1_BS3 (1 << 18) +#define LCSR1_BS4 (1 << 19) +#define LCSR1_BS5 (1 << 20) +#define LCSR1_BS6 (1 << 21) + +#define LCSR1_IU2 (1 << 25) +#define LCSR1_IU3 (1 << 26) +#define LCSR1_IU4 (1 << 27) +#define LCSR1_IU5 (1 << 28) +#define LCSR1_IU6 (1 << 29) + +#define LDCMD_SOFINT (1 << 22) +#define LDCMD_EOFINT (1 << 21) + + +#define LCCR5_SOFM1 (1<<0) /* Start Of Frame Mask for Overlay 1 (channel 1) */ +#define LCCR5_SOFM2 (1<<1) /* Start Of Frame Mask for Overlay 2 (channel 2) */ +#define LCCR5_SOFM3 (1<<2) /* Start Of Frame Mask for Overlay 2 (channel 3) */ +#define LCCR5_SOFM4 (1<<3) /* Start Of Frame Mask for Overlay 2 (channel 4) */ +#define LCCR5_SOFM5 (1<<4) /* Start Of Frame Mask for cursor (channel 5) */ +#define LCCR5_SOFM6 (1<<5) /* Start Of Frame Mask for command data (channel 6) */ + +#define LCCR5_EOFM1 (1<<8) /* End Of Frame Mask for Overlay 1 (channel 1) */ +#define LCCR5_EOFM2 (1<<9) /* End Of Frame Mask for Overlay 2 (channel 2) */ +#define LCCR5_EOFM3 (1<<10) /* End Of Frame Mask for Overlay 2 (channel 3) */ +#define LCCR5_EOFM4 (1<<11) /* End Of Frame Mask for Overlay 2 (channel 4) */ +#define LCCR5_EOFM5 (1<<12) /* End Of Frame Mask for cursor (channel 5) */ +#define LCCR5_EOFM6 (1<<13) /* End Of Frame Mask for command data (channel 6) */ + +#define LCCR5_BSM1 (1<<16) /* Branch mask for Overlay 1 (channel 1) */ +#define LCCR5_BSM2 (1<<17) /* Branch mask for Overlay 2 (channel 2) */ +#define LCCR5_BSM3 (1<<18) /* Branch mask for Overlay 2 (channel 3) */ +#define LCCR5_BSM4 (1<<19) /* Branch mask for Overlay 2 (channel 4) */ +#define LCCR5_BSM5 (1<<20) /* Branch mask for cursor (channel 5) */ +#define LCCR5_BSM6 (1<<21) /* Branch mask for data command (channel 6) */ + +#define LCCR5_IUM1 (1<<24) /* Input FIFO Underrun Mask for Overlay 1 */ +#define LCCR5_IUM2 (1<<25) /* Input FIFO Underrun Mask for Overlay 2 */ +#define LCCR5_IUM3 (1<<26) /* Input FIFO Underrun Mask for Overlay 2 */ +#define LCCR5_IUM4 (1<<27) /* Input FIFO Underrun Mask for Overlay 2 */ +#define LCCR5_IUM5 (1<<28) /* Input FIFO Underrun Mask for cursor */ +#define LCCR5_IUM6 (1<<29) /* Input FIFO Underrun Mask for data command */ + +#define OVL1C1_O1EN (1<<31) /* Enable bit for Overlay 1 */ +#define OVL2C1_O2EN (1<<31) /* Enable bit for Overlay 2 */ +#define CCR_CEN (1<<31) /* Enable bit for Cursor */ + +/* LCD registers */ +#define LCCR4 __REG(0x44000010) /* LCD Controller Control Register 4 */ +#define LCCR5 __REG(0x44000014) /* LCD Controller Control Register 5 */ +#define FBR0 __REG(0x44000020) /* DMA Channel 0 Frame Branch Register */ +#define FBR1 __REG(0x44000024) /* DMA Channel 1 Frame Branch Register */ +#define FBR2 __REG(0x44000028) /* DMA Channel 2 Frame Branch Register */ +#define FBR3 __REG(0x4400002C) /* DMA Channel 3 Frame Branch Register */ +#define FBR4 __REG(0x44000030) /* DMA Channel 4 Frame Branch Register */ +#define FDADR2 __REG(0x44000220) /* DMA Channel 2 Frame Descriptor Address Register */ +#define FSADR2 __REG(0x44000224) /* DMA Channel 2 Frame Source Address Register */ +#define FIDR2 __REG(0x44000228) /* DMA Channel 2 Frame ID Register */ +#define LDCMD2 __REG(0x4400022C) /* DMA Channel 2 Command Register */ +#define FDADR3 __REG(0x44000230) /* DMA Channel 3 Frame Descriptor Address Register */ +#define FSADR3 __REG(0x44000234) /* DMA Channel 3 Frame Source Address Register */ +#define FIDR3 __REG(0x44000238) /* DMA Channel 3 Frame ID Register */ +#define LDCMD3 __REG(0x4400023C) /* DMA Channel 3 Command Register */ +#define FDADR4 __REG(0x44000240) /* DMA Channel 4 Frame Descriptor Address Register */ +#define FSADR4 __REG(0x44000244) /* DMA Channel 4 Frame Source Address Register */ +#define FIDR4 __REG(0x44000248) /* DMA Channel 4 Frame ID Register */ +#define LDCMD4 __REG(0x4400024C) /* DMA Channel 4 Command Register */ +#define FDADR5 __REG(0x44000250) /* DMA Channel 5 Frame Descriptor Address Register */ +#define FSADR5 __REG(0x44000254) /* DMA Channel 5 Frame Source Address Register */ +#define FIDR5 __REG(0x44000258) /* DMA Channel 5 Frame ID Register */ +#define LDCMD5 __REG(0x4400025C) /* DMA Channel 5 Command Register */ + +#define OVL1C1 __REG(0x44000050) /* Overlay 1 Control Register 1 */ +#define OVL1C2 __REG(0x44000060) /* Overlay 1 Control Register 2 */ +#define OVL2C1 __REG(0x44000070) /* Overlay 2 Control Register 1 */ +#define OVL2C2 __REG(0x44000080) /* Overlay 2 Control Register 2 */ +#define CCR __REG(0x44000090) /* Cursor Control Register */ + +#define FBR5 __REG(0x44000110) /* DMA Channel 5 Frame Branch Register */ +#define FBR6 __REG(0x44000114) /* DMA Channel 6 Frame Branch Register */ + /* * Memory controller */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2006-10-13 19:51:56
|
Revision: 624 http://svn.sourceforge.net/hackndev/?rev=624&view=rev Author: magon Date: 2006-10-13 12:51:42 -0700 (Fri, 13 Oct 2006) Log Message: ----------- palmt3: Sound fixed, it is general ARM DMA alloc error and this is just work-around Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mm/consistent.c linux4palm/linux/trunk/drivers/soc/tsc2101.c linux4palm/linux/trunk/sound/core/pcm_native.c Modified: linux4palm/linux/trunk/arch/arm/mm/consistent.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mm/consistent.c 2006-10-12 17:48:14 UTC (rev 623) +++ linux4palm/linux/trunk/arch/arm/mm/consistent.c 2006-10-13 19:51:42 UTC (rev 624) @@ -257,7 +257,8 @@ pte = consistent_pte[idx] + off; c->vm_pages = page; - split_page(page, order); + if(!PageCompound(page)) + split_page(page, order); /* * Set the "dma handle" Modified: linux4palm/linux/trunk/drivers/soc/tsc2101.c =================================================================== --- linux4palm/linux/trunk/drivers/soc/tsc2101.c 2006-10-12 17:48:14 UTC (rev 623) +++ linux4palm/linux/trunk/drivers/soc/tsc2101.c 2006-10-13 19:51:42 UTC (rev 624) @@ -858,8 +858,7 @@ int ret; ret = driver_register(&tsc2101_driver); /* Sound driver */ - printk(KERN_ERR "!! SOUND CODE DISABLED !! FIXME !!\n"); - /* snd_pxa2xx_i2sound_card_activate(&tsc2101_audio); */ + snd_pxa2xx_i2sound_card_activate(&tsc2101_audio); return ret; } Modified: linux4palm/linux/trunk/sound/core/pcm_native.c =================================================================== --- linux4palm/linux/trunk/sound/core/pcm_native.c 2006-10-12 17:48:14 UTC (rev 623) +++ linux4palm/linux/trunk/sound/core/pcm_native.c 2006-10-13 19:51:42 UTC (rev 624) @@ -3110,7 +3110,7 @@ return NOPAGE_OOM; } else { vaddr = runtime->dma_area + offset; - page = virt_to_page(vaddr); + page = vmalloc_to_page(vaddr); } get_page(page); if (type) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cri...@us...> - 2006-10-20 18:49:51
|
Revision: 639 http://svn.sourceforge.net/hackndev/?rev=639&view=rev Author: cristianop Date: 2006-10-20 11:49:32 -0700 (Fri, 20 Oct 2006) Log Message: ----------- palmtx: first batch of changes for new kernel Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/configs/palmtx_defconfig linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Makefile linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c linux4palm/linux/trunk/drivers/input/keyboard/Kconfig linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-ac97.h Modified: linux4palm/linux/trunk/arch/arm/configs/palmtx_defconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/configs/palmtx_defconfig 2006-10-20 18:31:37 UTC (rev 638) +++ linux4palm/linux/trunk/arch/arm/configs/palmtx_defconfig 2006-10-20 18:49:32 UTC (rev 639) @@ -1,13 +1,15 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.16-hnd0 -# Mon Sep 18 19:46:51 2006 +# Linux kernel version: 2.6.17-hnd0 +# Fri Oct 20 20:36:57 2006 # CONFIG_ARM=y CONFIG_MMU=y CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_ARCH_MTD_XIP=y +CONFIG_VECTORS_BASE=0xffff0000 # # Code maturity level options @@ -29,7 +31,10 @@ # CONFIG_AUDIT is not set # CONFIG_IKCONFIG is not set # CONFIG_MINIMAL_OOPS is not set -CONFIG_INITRAMFS_SOURCE="" +# CONFIG_RELAY is not set +CONFIG_INITRAMFS_SOURCE="../initramfs/root" +CONFIG_INITRAMFS_ROOT_UID=0 +CONFIG_INITRAMFS_ROOT_GID=0 CONFIG_UID16=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y # CONFIG_EMBEDDED is not set @@ -45,10 +50,6 @@ CONFIG_SHMEM=y CONFIG_USELIB=y CONFIG_CORE_DUMP=y -CONFIG_CC_ALIGN_FUNCTIONS=0 -CONFIG_CC_ALIGN_LABELS=0 -CONFIG_CC_ALIGN_LOOPS=0 -CONFIG_CC_ALIGN_JUMPS=0 CONFIG_SLAB=y # CONFIG_TINY_SHMEM is not set CONFIG_BASE_SMALL=0 @@ -60,7 +61,6 @@ CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y -CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set # CONFIG_MODULE_SRCVERSION_ALL is not set # CONFIG_KMOD is not set @@ -68,6 +68,7 @@ # # Block layer # +# CONFIG_BLK_DEV_IO_TRACE is not set # # IO Schedulers @@ -89,11 +90,13 @@ # CONFIG_ARCH_CLPS711X is not set # CONFIG_ARCH_CO285 is not set # CONFIG_ARCH_EBSA110 is not set +# CONFIG_ARCH_EP93XX is not set # CONFIG_ARCH_FOOTBRIDGE is not set # CONFIG_ARCH_INTEGRATOR is not set # CONFIG_ARCH_IOP3XX is not set # CONFIG_ARCH_IXP4XX is not set # CONFIG_ARCH_IXP2000 is not set +# CONFIG_ARCH_IXP23XX is not set # CONFIG_ARCH_L7200 is not set CONFIG_ARCH_PXA=y # CONFIG_ARCH_RPC is not set @@ -113,6 +116,7 @@ # Intel PXA2xx Implementations # # CONFIG_ARCH_LUBBOCK is not set +# CONFIG_MACH_LOGICPD_PXA270 is not set # CONFIG_MACH_MAINSTONE is not set # CONFIG_ARCH_PXA_IDP is not set # CONFIG_ARCH_ESERIES is not set @@ -126,6 +130,12 @@ # CONFIG_MACH_HX2750 is not set # CONFIG_ARCH_H5400 is not set # CONFIG_MACH_HIMALAYA is not set +# CONFIG_MACH_HTCUNIVERSAL is not set +# CONFIG_MACH_HTCALPINE is not set +# CONFIG_MACH_MAGICIAN is not set +# CONFIG_MACH_HTCAPACHE is not set +# CONFIG_MACH_BLUEANGEL is not set +# CONFIG_MACH_HTCBEETLES is not set # CONFIG_ARCH_AXIMX5 is not set # CONFIG_ARCH_AXIMX3 is not set # CONFIG_ARCH_ROVERP1 is not set @@ -142,6 +152,7 @@ # CONFIG_MACH_OMAP_PALMTC is not set # CONFIG_PXA_SHARPSL is not set CONFIG_PXA27x=y +CONFIG_PXA_RTC_EPOCH=1970 # CONFIG_SA1100_H3100 is not set # CONFIG_SA1100_H3600 is not set # CONFIG_SA1100_H3800 is not set @@ -167,6 +178,7 @@ CONFIG_ARM_THUMB=y # CONFIG_ARMBOOT_PROC is not set CONFIG_XSCALE_PMU=y +# CONFIG_KEXEC is not set # # Compaq/iPAQ Platforms @@ -195,6 +207,7 @@ # # CONFIG_PREEMPT is not set CONFIG_NO_IDLE_HZ=y +CONFIG_HZ=100 # CONFIG_AEABI is not set # CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set CONFIG_SELECT_MEMORY_MODEL=y @@ -212,7 +225,7 @@ # CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 -CONFIG_CMDLINE="root=/dev/ram0 rw mem=32m init=/linuxrc initrd=0xa0400000,330615" +CONFIG_CMDLINE="mem=32M" # CONFIG_XIP_KERNEL is not set # @@ -272,12 +285,15 @@ # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +# CONFIG_INET_XFRM_TUNNEL is not set # CONFIG_INET_TUNNEL is not set CONFIG_INET_DIAG=y CONFIG_INET_TCP_DIAG=y # CONFIG_TCP_CONG_ADVANCED is not set CONFIG_TCP_CONG_BIC=y # CONFIG_IPV6 is not set +# CONFIG_INET6_XFRM_TUNNEL is not set +# CONFIG_INET6_TUNNEL is not set # CONFIG_NETFILTER is not set # @@ -524,12 +540,13 @@ # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set # CONFIG_KEYBOARD_STOWAWAY is not set +CONFIG_KEYBOARD_PXA27x=m CONFIG_KEYBOARD_PALMIR=m -CONFIG_KEYBOARD_PXA27X=m # CONFIG_INPUT_MOUSE is not set # CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_TOUCHSCREEN is not set -# CONFIG_INPUT_MISC is not set +CONFIG_INPUT_MISC=y +# CONFIG_INPUT_UINPUT is not set # # Hardware I/O ports @@ -599,9 +616,7 @@ # CONFIG_SENSORS_PCA9539 is not set # CONFIG_SENSORS_PCA9535 is not set # CONFIG_SENSORS_PCF8591 is not set -# CONFIG_SENSORS_RTC8564 is not set # CONFIG_SENSORS_MAX6875 is not set -# CONFIG_RTC_X1205_I2C is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set @@ -652,6 +667,7 @@ # SPI Master Controller Drivers # CONFIG_SPI_BITBANG=y +CONFIG_SPI_PXA2XX=y # # SPI Protocol Masters @@ -723,13 +739,23 @@ # CONFIG_MCP is not set # -# Multimedia Capabilities Port drivers +# LED devices # +# CONFIG_NEW_LEDS is not set # +# LED drivers +# + +# +# LED Triggers +# + +# # Multimedia devices # # CONFIG_VIDEO_DEV is not set +CONFIG_VIDEO_V4L2=y # # Digital Video Broadcasting Devices @@ -744,6 +770,7 @@ CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y # CONFIG_FB_MACMODES is not set +CONFIG_FB_FIRMWARE_EDID=y CONFIG_FB_MODE_HELPERS=y # CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_IMAGEON is not set @@ -773,6 +800,7 @@ CONFIG_BACKLIGHT_LCD_SUPPORT=y CONFIG_BACKLIGHT_CLASS_DEVICE=m CONFIG_BACKLIGHT_DEVICE=y +# CONFIG_BACKLIGHT_CORGI is not set CONFIG_BACKLIGHT_PXAPWM=m CONFIG_LCD_CLASS_DEVICE=m CONFIG_LCD_DEVICE=y @@ -793,9 +821,11 @@ CONFIG_SND_OSSEMUL=y CONFIG_SND_MIXER_OSS=m CONFIG_SND_PCM_OSS=m +CONFIG_SND_PCM_OSS_PLUGINS=y CONFIG_SND_SEQUENCER_OSS=y # CONFIG_SND_DYNAMIC_MINORS is not set # CONFIG_SND_SUPPORT_OLD_API is not set +# CONFIG_SND_VERBOSE_PROCFS is not set # CONFIG_SND_VERBOSE_PRINTK is not set # CONFIG_SND_DEBUG is not set @@ -816,7 +846,10 @@ # CONFIG_SND_A716 is not set # CONFIG_SND_H1910 is not set # CONFIG_SND_H2200 is not set +# CONFIG_SND_H4000 is not set +# CONFIG_SND_HTCMAGICIAN is not set # CONFIG_SND_HX4700 is not set +# CONFIG_SND_HTCUNIVERSAL is not set # CONFIG_SND_H5XXX_AK4535 is not set CONFIG_SND_PXA2xx_I2SOUND=m CONFIG_SND_PXA2XX_PCM=m @@ -832,6 +865,7 @@ # CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y +# CONFIG_USB_ARCH_HAS_EHCI is not set # CONFIG_USB is not set # @@ -841,18 +875,19 @@ # # USB Gadget Support # -CONFIG_USB_GADGET=y +CONFIG_USB_GADGET=m # CONFIG_USB_GADGET_DEBUG_FILES is not set CONFIG_USB_GADGET_SELECTED=y # CONFIG_USB_GADGET_NET2280 is not set # CONFIG_USB_GADGET_PXA2XX is not set CONFIG_USB_GADGET_PXA27X=y -CONFIG_USB_PXA27X=y +CONFIG_USB_PXA27X=m # CONFIG_USB_PXA27X_DMA is not set # CONFIG_USB_GADGET_GOKU is not set # CONFIG_USB_GADGET_MQ11XX is not set # CONFIG_USB_GADGET_LH7A40X is not set # CONFIG_USB_GADGET_OMAP is not set +# CONFIG_USB_GADGET_AT91 is not set # CONFIG_USB_GADGET_DUMMY_HCD is not set # CONFIG_USB_GADGET_DUALSPEED is not set # CONFIG_USB_ZERO is not set @@ -877,11 +912,30 @@ # CONFIG_MMC_WBSD_PALMT3 is not set # -# LED devices +# Real Time Clock # -# CONFIG_CLASS_LEDS is not set +CONFIG_RTC_LIB=y +CONFIG_RTC_CLASS=m # +# RTC interfaces +# +CONFIG_RTC_INTF_SYSFS=m +CONFIG_RTC_INTF_PROC=m +CONFIG_RTC_INTF_DEV=m + +# +# RTC drivers +# +# CONFIG_RTC_DRV_X1205 is not set +# CONFIG_RTC_DRV_DS1672 is not set +# CONFIG_RTC_DRV_PCF8563 is not set +# CONFIG_RTC_DRV_RS5C372 is not set +# CONFIG_RTC_DRV_M48T86 is not set +CONFIG_RTC_DRV_SA1100=m +# CONFIG_RTC_DRV_TEST is not set + +# # File systems # CONFIG_EXT2_FS=y @@ -926,7 +980,6 @@ CONFIG_TMPFS=y # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y -# CONFIG_RELAYFS_FS is not set # CONFIG_CONFIGFS_FS is not set # @@ -949,7 +1002,7 @@ # CONFIG_QNX4FS_FS is not set # CONFIG_SYSV_FS is not set # CONFIG_UFS_FS is not set -# CONFIG_UNION_FS is not set +CONFIG_UNION_FS=m # # Network File Systems @@ -1036,7 +1089,9 @@ # CONFIG_DEBUG_KERNEL is not set CONFIG_LOG_BUF_SHIFT=14 CONFIG_DEBUG_BUGVERBOSE=y +# CONFIG_DEBUG_FS is not set CONFIG_FRAME_POINTER=y +# CONFIG_UNWIND_INFO is not set # CONFIG_DEBUG_USER is not set # @@ -1058,7 +1113,7 @@ # Library routines # CONFIG_CRC_CCITT=y -# CONFIG_CRC16 is not set +CONFIG_CRC16=m CONFIG_CRC32=y -# CONFIG_LIBCRC32C is not set +CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=m Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig 2006-10-20 18:31:37 UTC (rev 638) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig 2006-10-20 18:49:32 UTC (rev 639) @@ -10,7 +10,9 @@ depends on MACH_XSCALE_PALMTX default y if MACH_XSCALE_PALMTX help - AC97 codec for Palm TX + AC97 codec for Palm TX. + Enable support for WM9712 touchscreen and battery for + the Palm TX PDA config PALMTX_PCMCIA tristate "Palm TX PCMCIA driver" @@ -27,10 +29,3 @@ help Enable core debug output for Palm TX modules. -config PALMTX_AC97_DEBUG - bool "Debug for Palm TX AC97 driver" - depends on PALMTX_DEBUG && PALMTX_AC97 - default y if PALMTX_DEBUG && PALMTX_AC97 - help - Enable debug output for Palm TX AC97 module. - Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Makefile =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Makefile 2006-10-20 18:31:37 UTC (rev 638) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Makefile 2006-10-20 18:49:32 UTC (rev 639) @@ -4,4 +4,4 @@ # obj-$(CONFIG_MACH_XSCALE_PALMTX) += palmtx.o obj-$(CONFIG_PALMTX_AC97) += palmld_ac97.o -obj-$(CONFIG_PALMTX_PCMCIA) += palmld_pcmcia.o +#obj-$(CONFIG_PALMTX_PCMCIA) += palmtx_pcmcia.o Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c 2006-10-20 18:31:37 UTC (rev 638) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmld_ac97.c 2006-10-20 18:49:32 UTC (rev 639) @@ -1,12 +1,19 @@ /* - * linux/arch/arm/mach-pxa/palmld/palmld_ac97.c + * linux/arch/arm/mach-pxa/palmtx/palmld_ac97.c * - * Touchscreen/battery driver for Palm LifeDrive's WM9712 AC97 codec. + * Touchscreen/battery driver for Palm TX' WM9712 AC97 codec * - * Author: Alex Osborne <bob...@gm...> - * Cristiano P. - adapted for Palm TX + * Based on palmld_ac97.c code from Alex Osborne + * */ +/* TODO: + - change DIG2_INIT to DIG2_BASE (useless to make an aasignment) + - fix battery code + - add battery charge + - suspend/resume (after having the TX ready for PM ...) +*/ + #include <linux/kernel.h> #include <linux/module.h> #include <linux/moduleparam.h> @@ -19,41 +26,41 @@ #include <asm/apm.h> #include <asm/delay.h> +#include <asm/mach-types.h> +#include <asm/mach/arch.h> +#include <asm/mach/map.h> #include <asm/arch/hardware.h> #include <asm/arch/pxa-regs.h> #include <asm/arch/irqs.h> -#include <asm/arch/palmtx-gpio.h> -#include <asm/arch/palmtx-init.h> -#include <asm/arch/palmld-ac97.h> -#include <asm/mach-types.h> -#include <asm/mach/arch.h> -#include <asm/mach/map.h> - #include <sound/driver.h> #include <sound/core.h> #include <sound/pcm.h> #include <sound/initval.h> #include <sound/ac97_codec.h> -#define X_AXIS_MAX 3900 //3630 -#define X_AXIS_MIN 350 //200 -#define Y_AXIS_MAX 3750 //3880 -#define Y_AXIS_MIN 320 //160 -#define PRESSURE_MIN 0 -#define PRESSURE_MAX 150 //300 +#include <asm/arch/palmtx-gpio.h> +#include <asm/arch/palmtx-init.h> +#include <asm/arch/palmld-ac97.h> -#define DIG2_INIT 0x0001 /* initial value for digitiser2 register */ -#define AC97_LINK_FRAME 21 /* time in uS for AC97 link frame */ +#define X_AXIS_MAX 3900 +#define X_AXIS_MIN 350 +#define Y_AXIS_MAX 3750 +#define Y_AXIS_MIN 320 +#define PRESSURE_MIN 0 +#define PRESSURE_MAX 150 +#define DIG2_INIT 0x0001 /* initial value for digitiser2 reg */ + #define DEFAULT_PRESSURE_TRESHOLD 45160 /* default pressure treshold for pen up/down */ #define DEFAULT_X_AXIS_FUZZ 5 /* default x axis noise treshold */ #define DEFAULT_Y_AXIS_FUZZ 35 /* default y axis noise treshold */ #define PRESSURE_FUZZ 5 /* default pressure noise treshold */ -#define palmld_ac97_WORK_QUEUE_NAME "palmld_ac97.c" +#define palmld_ac97_WORK_QUEUE_NAME "palmld_ac97_workqueue" +/* module parameters */ static int ptrsh = DEFAULT_PRESSURE_TRESHOLD; module_param(ptrsh, int, 0); @@ -71,6 +78,7 @@ module_param(ydjtrsh, int, 0); MODULE_PARM_DESC(ydjtrsh, "treshold for y axis jitter"); + static DECLARE_MUTEX_LOCKED(queue_sem); static DECLARE_MUTEX(digitiser_sem); static DECLARE_MUTEX(battery_update_mutex); @@ -81,23 +89,18 @@ struct input_dev *palmld_ac97_input; struct device *palmld_ac97_dev; +static ac97_t *ac97; + static unsigned long last_update = 0; -static int battery_voltage; +static int current_voltage; static int previous_voltage; static u16 d2base; - -#if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE) -/* original APM hook */ -static void (*apm_get_power_status_orig)(struct apm_power_info *info); -#endif - - /* * ac97 codec */ -void wm97xx_gpio_func(ac97_t *ac97, int gpio, int func) +void wm97xx_gpio_func(int gpio, int func) { int GEn; GEn = ac97->bus->ops->read(ac97, 0x56); @@ -109,8 +112,7 @@ } -void wm97xx_gpio_mode(ac97_t *ac97, int gpio, int config, int polarity, - int sticky, int wakeup) +void wm97xx_gpio_mode(int gpio, int config, int polarity, int sticky, int wakeup) { int GCn, GPn, GSn, GWn; GCn = ac97->bus->ops->read(ac97, 0x4c); @@ -145,10 +147,8 @@ } -static void wm97xx_set_digitiser_power(struct device *dev, int value) +static void wm97xx_set_digitiser_power(int value) { - ac97_t *ac97 = dev->platform_data; - ac97->bus->ops->write(ac97, AC97_WM97XX_DIGITISER2, d2base | value); } @@ -160,18 +160,18 @@ * (PXA27x Specification Update: 28007109.pdf sec.: E54) */ -static int palmld_ac97_take_reading(struct device *dev, int adcsel) +static int palmld_ac97_take_reading(int adcsel) { - ac97_t *ac97 = dev->platform_data; int timeout = 15; u16 r76 = 0; u16 r7a; - r76 |= adcsel; /* set ADCSEL (ADC source) */ - r76 |= WM97XX_DELAY(3); /* set settling time delay DELAY */ - r76 &= ~(1<<11); /* COO = 0 (single measurement) */ - r76 &= ~(1<<10); /* CTC = 0 (polling mode) */ - r76 |= (1<<15); /* initiate measurement (POLL) */ + r76 |= adcsel; /* set ADCSEL (ADC source) */ + r76 |= WM97XX_DELAY(3); /* set settling time delay */ + r76 &= ~(1<<11); /* COO = 0 (single measurement) */ + r76 &= ~(1<<10); /* CTC = 0 (polling mode) */ + r76 |= (1<<15); /* initiate measurement (POLL) */ + ac97->bus->ops->write(ac97, 0x76, r76); // wait settling time @@ -184,14 +184,14 @@ } if (timeout == 0){ - printk("wm9712: discarding reading due to POLL wait timout on 0x76\n"); + printk("palmld_ac97: discarding reading due to POLL wait timout on 0x76\n"); return 0; } r7a = ac97->bus->ops->read(ac97, 0x7a); if ((r7a & WM97XX_ADCSEL_MASK) != adcsel){ - printk("wm9712: discarding reading -> wrong ADC source\n"); + printk("palmld_ac97: discarding reading -> wrong ADC source\n"); return 0; } @@ -199,158 +199,17 @@ } - -/* - * battery - */ - -void update_data(int force) +static void palmld_ac97_pendown(void) { - u16 reading; - - if(!force && ((last_update + 10 *HZ) > jiffies)) - return; - - if(down_trylock(&battery_update_mutex)) - return; - - down(&digitiser_sem); - //wm97xx_set_digitiser_power(palmld_ac97_dev, WM97XX_PRP_DET_DIG); - wm97xx_set_digitiser_power(palmld_ac97_dev, WM97XX_PRP_DET_DIG); - // todo: check if reading is valid - reading = palmld_ac97_take_reading(palmld_ac97_dev, WM97XX_ADCSEL_BMON); - wm97xx_set_digitiser_power(palmld_ac97_dev, WM97XX_PRP_DET); - up(&digitiser_sem); - previous_voltage = battery_voltage; - battery_voltage = reading & 0xfff; - //printk("wm9712: battery -> %d\n", battery_voltage); - last_update = jiffies; - - up(&battery_update_mutex); -} - -#if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE) -static void palmtx_apm_get_power_status(struct apm_power_info *info){ - update_data(0); - info->ac_line_status = (GET_GPIO(GPIO_NR_PALMTX_POWER_DETECT)) ? APM_AC_ONLINE : APM_AC_OFFLINE; - // TODO: correct this stuff ... (see correct formula into get_voltage() ) - if (info->ac_line_status == APM_AC_ONLINE) - info->battery_status = APM_BATTERY_STATUS_CHARGING; - - if (battery_voltage * 3 > PALMTX_BAT_MAX_VOLTAGE - 200) - info->battery_status = APM_BATTERY_STATUS_HIGH; - else if (battery_voltage * 3 <= PALMTX_BAT_MIN_VOLTAGE) - info->battery_status = APM_BATTERY_STATUS_CRITICAL; - else - info->battery_status = APM_BATTERY_STATUS_LOW; - -} -#endif - - -int get_min_voltage(struct battery *b) -{ - return PALMTX_BAT_MIN_VOLTAGE; -} - -int get_min_charge(struct battery *b) -{ - return PALMTX_BAT_MIN_CHARGE; -} - -int get_max_voltage(struct battery *b) -{ - return PALMTX_BAT_MAX_VOLTAGE; /* mV */ -} - -int get_max_charge(struct battery *b) -{ - return PALMTX_BAT_MAX_CHARGE; -} - -// let's suppose AVDD=+3.3v so battV = intV * 3 * 0.80586 -// note: 0.80586 = 3.3/4095 -int get_voltage(struct battery *b) -{ - update_data(0); - return battery_voltage * 3 * 80586 / 100000; -} - -int get_charge(struct battery *b) -{ - return 0; -} - -int get_status(struct battery *b) -{ - int ac_connected = 0; - - ac_connected = GET_GPIO(GPIO_NR_PALMTX_POWER_DETECT); - - if (battery_voltage <= 0) - return BATTERY_STATUS_UNKNOWN; - - if (ac_connected){ - // TODO: ok maybe this is too stupid ... to be reviewed - if ( ( battery_voltage > previous_voltage ) || (battery_voltage <= PALMTX_BAT_MAX_VOLTAGE) ) - return BATTERY_STATUS_CHARGING; - return BATTERY_STATUS_NOT_CHARGING; - } - else - return BATTERY_STATUS_DISCHARGING; -} - -static struct battery palmld_battery = { - .name = "palmtx-battery", - .id = "battery0", - .get_min_voltage = get_min_voltage, - .get_min_current = NULL, - .get_min_charge = get_min_charge, - .get_max_voltage = get_max_voltage, - .get_max_current = NULL, - .get_max_charge = get_max_charge, - .get_temp = NULL, - .get_voltage = get_voltage, - .get_current = NULL, - .get_charge = get_charge, - .get_status = get_status, -}; - -/* -static int -battery_class_hotplug(struct class_device *dev, char **envp, int num_envp, - char *buffer, int buffer_size) -{ - return 0; -} -*/ - -static void -battery_class_release(struct class_device *dev) -{ -} - -static void -battery_class_class_release(struct class *class) -{ -} - - -/* - * touchscreen - */ - -static void palmld_ac97_pendown(struct device *dev) -{ int xread, yread, pressure; int valid_coords=0, btn_pressed = 0; /* take readings until the pen goes up */ do { /* take readings */ - xread = palmld_ac97_take_reading(dev, WM97XX_ADCSEL_X); - yread = palmld_ac97_take_reading(dev, WM97XX_ADCSEL_Y); - pressure = palmld_ac97_take_reading(dev, WM97XX_ADCSEL_PRES); + xread = palmld_ac97_take_reading(WM97XX_ADCSEL_X); + yread = palmld_ac97_take_reading(WM97XX_ADCSEL_Y); + pressure = palmld_ac97_take_reading(WM97XX_ADCSEL_PRES); valid_coords = (xread & 0xfff) && (yread & 0xfff) && (pressure & 0xfff); @@ -382,8 +241,8 @@ static void palmld_ac97_irq_work(void *data) { - struct device *dev = data; - ac97_t *ac97 = dev->platform_data; + //struct device *dev = data; + //ac97_t *ac97 = dev->platform_data; u16 levels; u16 polarity; @@ -393,12 +252,12 @@ if(polarity & levels & WM97XX_GPIO_13) { // power up digitiser: down(&digitiser_sem); - wm97xx_set_digitiser_power(dev, WM97XX_PRP_DET_DIG); + wm97xx_set_digitiser_power(WM97XX_PRP_DET_DIG); - palmld_ac97_pendown(dev); + palmld_ac97_pendown(); /* power down digitiser to conserve power */ - wm97xx_set_digitiser_power(dev, WM97XX_PRP_DET); + wm97xx_set_digitiser_power(WM97XX_PRP_DET); ac97->bus->ops->write(ac97, 0x4e, polarity & ~WM97XX_GPIO_13); up(&digitiser_sem); } @@ -420,6 +279,7 @@ disable_irq(IRQ_GPIO_PALMTX_WM9712_IRQ); queue_work(palmld_ac97_workqueue, &palmld_ac97_irq_task); } + return IRQ_HANDLED; } @@ -428,19 +288,18 @@ static int __init palmld_ac97_probe(struct device *dev) { int err; - ac97_t *ac97 = dev->platform_data; u16 d2 = DIG2_INIT; // init d1 too? - + if(!machine_is_xscale_palmtx()) return -ENODEV; - /* for use by battery level monitor */ - palmld_ac97_dev = dev; + ac97 = to_ac97_t(dev); set_irq_type(IRQ_GPIO_PALMTX_WM9712_IRQ, IRQT_RISING); + err = request_irq(IRQ_GPIO_PALMTX_WM9712_IRQ, palmld_ac97_irq_handler, SA_INTERRUPT, "WM9712 pendown IRQ", dev); - + if(err) { printk(KERN_ERR "palmld_ac97_probe: cannot request pen down IRQ\n"); return -1; @@ -453,25 +312,29 @@ d2 |= WM97XX_PRP_DET; d2base = d2; ac97->bus->ops->write(ac97, AC97_WM97XX_DIGITISER2, d2base); - + /* enable interrupts on codec's gpio 2 (connected to cpu gpio 27) */ - wm97xx_gpio_mode(ac97, WM97XX_GPIO_2, WM97XX_GPIO_IN, - WM97XX_GPIO_POL_HIGH, WM97XX_GPIO_NOTSTICKY, WM97XX_GPIO_NOWAKE); - wm97xx_gpio_func(ac97, WM97XX_GPIO_2, 0); + wm97xx_gpio_mode(WM97XX_GPIO_2, WM97XX_GPIO_IN, WM97XX_GPIO_POL_HIGH, + WM97XX_GPIO_NOTSTICKY, WM97XX_GPIO_NOWAKE); + wm97xx_gpio_func(WM97XX_GPIO_2, 0); /* enable pen detect interrupt */ - wm97xx_gpio_mode(ac97, WM97XX_GPIO_13, WM97XX_GPIO_IN, - WM97XX_GPIO_POL_HIGH, WM97XX_GPIO_STICKY, WM97XX_GPIO_WAKE); - - + wm97xx_gpio_mode(WM97XX_GPIO_13, WM97XX_GPIO_IN, WM97XX_GPIO_POL_HIGH, + WM97XX_GPIO_STICKY, WM97XX_GPIO_WAKE); + /* turn off irq gpio inverting */ ac97->bus->ops->write(ac97, 0x58, ac97->bus->ops->read(ac97, 0x58)&~1); /* turn on the digitiser and pen down detector */ ac97->bus->ops->write(ac97, AC97_WM97XX_DIGITISER2, d2base | WM97XX_PRP_DETW); - + /* setup the input device */ palmld_ac97_input = input_allocate_device(); + if (palmld_ac97_input == NULL){ + printk ("palmld_ac97_probe: cannot allocate input device\n"); + return -ENOMEM; + } + palmld_ac97_input->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); palmld_ac97_input->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); @@ -479,71 +342,62 @@ input_set_abs_params(palmld_ac97_input, ABS_Y, Y_AXIS_MIN, Y_AXIS_MAX, ydjtrsh, 0); input_set_abs_params(palmld_ac97_input, ABS_PRESSURE, PRESSURE_MIN, PRESSURE_MAX, PRESSURE_FUZZ, 0); - palmld_ac97_input->name = "Palm TX touchscreen (Wolfson WM9712)"; + palmld_ac97_input->name = "palmtx touchscreen"; palmld_ac97_input->dev = dev; palmld_ac97_input->id.bustype = BUS_HOST; input_register_device(palmld_ac97_input); - -#if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE) - apm_get_power_status = palmtx_apm_get_power_status; -#endif /* setup work queue */ palmld_ac97_workqueue = create_workqueue(palmld_ac97_WORK_QUEUE_NAME); INIT_WORK(&palmld_ac97_irq_task, palmld_ac97_irq_work, dev); - /* register battery */ - - if(battery_class_register(&palmld_battery)) { - printk(KERN_ERR "palmld_ac97_probe: Could not register battery class\n"); - } else { - palmld_battery.class_dev.class->release = battery_class_release; - // palmld_battery.class_dev.class->hotplug = battery_class_hotplug; - palmld_battery.class_dev.class->class_release = battery_class_class_release; - } - - up(&queue_sem); return 0; } + static int palmld_ac97_remove (struct device *dev) { - ac97_t *ac97 = dev->platform_data; - printk("x: %x\n", ac97->bus->ops->read(ac97, AC97_WM97XX_DIGITISER2)); + // TODO: stop running tasks if any? + + ac97 = NULL; input_unregister_device(palmld_ac97_input); - free_irq(IRQ_GPIO_PALMTX_WM9712_IRQ, dev); return 0; } + static struct device_driver palmld_ac97_driver = { - .name = "WM9712", + .name = "palmld_ac97 (WM9712)", .bus = &ac97_bus_type, + .owner = THIS_MODULE, .probe = palmld_ac97_probe, .remove = palmld_ac97_remove, + #ifdef CONFIG_PM .suspend = NULL, .resume = NULL, #endif }; + static int __init palmld_ac97_init(void) { if(!machine_is_xscale_palmtx()) return -ENODEV; - return driver_register(&palmld_ac97_driver); } + static void __exit palmld_ac97_exit(void) { driver_unregister(&palmld_ac97_driver); } + module_init(palmld_ac97_init); module_exit(palmld_ac97_exit); MODULE_AUTHOR ("Alex Osborne <bob...@gm...>"); -MODULE_DESCRIPTION ("WM9712 AC97 codec support for Palm LifeDrive"); +MODULE_DESCRIPTION ("WM9712 AC97 codec support for Palm TX"); MODULE_LICENSE ("GPL"); Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c 2006-10-20 18:31:37 UTC (rev 638) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c 2006-10-20 18:49:32 UTC (rev 639) @@ -22,6 +22,7 @@ #include <linux/device.h> #include <linux/platform_device.h> #include <linux/fb.h> +#include <linux/input.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> @@ -30,20 +31,17 @@ #include <asm/arch/audio.h> #include <asm/arch/hardware.h> #include <asm/arch/mmc.h> +#include <asm/arch/pxafb.h> #include <asm/arch/pxa-dmabounce.h> -#include <asm/arch/pxafb.h> #include <asm/arch/pxa-regs.h> +#include <asm/arch/udc.h> +#include <asm/arch/pxa27x_keyboard.h> +#include <asm/arch/pxapwm-bl.h> #include "../generic.h" #include "../drivers/serial/pxa-serial.h" - -#include <asm/arch/udc.h> - #include <../drivers/pcmcia/soc_common.h> -#include <asm/arch/pxa27x-keypad.h> -#include <asm/arch/pxapwm-bl.h> - #include "asm-arm/arch-pxa/palmtx-init.h" #include "asm-arm/arch-pxa/palmtx-gpio.h" @@ -101,27 +99,74 @@ // Keypad driver +static struct pxa27x_keyboard_platform_data palmtx_kbd_data = { + .nr_rows = 4, + .nr_cols = 3, + .keycodes = { + { /* row 0 */ + KEY_POWER, + KEY_F9, + KEY_ENTER, + }, + { /* row 1 */ + KEY_F10, + KEY_F11, + KEY_F12, + }, + { /* row 2 */ + KEY_UP, + -1, + KEY_DOWN, + }, + { + /* row 3 */ + KEY_RIGHT, + -1, + KEY_LEFT, + }, -static int palmtx_keypad_matrix[] = { - /* row 0 */ - KEY_POWER, - KEY_F9, - KEY_ENTER, - /* row 1 */ - KEY_F10, - KEY_F11, - KEY_F12, - /* row 2 */ - KEY_UP, - -1, - KEY_DOWN, - /* row 3 */ - KEY_RIGHT, - -1, - KEY_LEFT, - }; + }, + .gpio_modes = { + GPIO_NR_PALMTX_KP_MKIN0_MD, + GPIO_NR_PALMTX_KP_MKIN1_MD, + GPIO_NR_PALMTX_KP_MKIN2_MD, + GPIO_NR_PALMTX_KP_MKIN3_MD, + GPIO_NR_PALMTX_KP_MKOUT0_MD, + GPIO_NR_PALMTX_KP_MKOUT1_MD, + GPIO_NR_PALMTX_KP_MKOUT2_MD, + }, +}; +static struct platform_device palmtx_keypad = { + .name = "pxa27x-keyboard", + .id = -1, + .dev = { + .platform_data = &palmtx_kbd_data, + }, +}; + +// static int palmtx_keypad_matrix[] = { +// /* row 0 */ +// KEY_POWER, +// KEY_F9, +// KEY_ENTER, +// /* row 1 */ +// KEY_F10, +// KEY_F11, +// KEY_F12, +// /* row 2 */ +// KEY_UP, +// -1, +// KEY_DOWN, +// /* row 3 */ +// KEY_RIGHT, +// -1, +// KEY_LEFT, +// }; + + +/* static struct pxa27x_keypad_platform_data palmtx_keypad_data = { .matrix = palmtx_keypad_matrix, .rows = 4, @@ -136,6 +181,8 @@ }, }; +*/ + // backlight static struct pxapwmbl_platform_data palmtx_backlight_data = { @@ -230,7 +277,7 @@ }; -// UDC +// UDC (USB gadget controller) static int palmtx_udc_is_connected (void){ int ret = !(GET_GPIO(GPIO_NR_PALMTX_USB_DETECT)); @@ -392,9 +439,11 @@ MACHINE_START(XSCALE_PALMTX, "Palm TX") - .phys_ram = PALMTX_PHYS_RAM_START, + //.phys_ram = PALMTX_PHYS_RAM_START, .phys_io = PALMTX_PHYS_IO_START, - .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, + //.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, + .io_pg_offst = io_p2v(0x40000000), + .boot_params = 0xa0000100, .map_io = palmtx_map_io, .init_irq = pxa_init_irq, .timer = &pxa_timer, Modified: linux4palm/linux/trunk/drivers/input/keyboard/Kconfig =================================================================== --- linux4palm/linux/trunk/drivers/input/keyboard/Kconfig 2006-10-20 18:31:37 UTC (rev 638) +++ linux4palm/linux/trunk/drivers/input/keyboard/Kconfig 2006-10-20 18:49:32 UTC (rev 639) @@ -201,7 +201,7 @@ This enables support for the buttons and joypad on HP iPAQ H2200. config KEYBOARD_PXA27x - tristate + tristate "PXA27x keypad and buttons Driver" depends on PXA27x help Enable support for PXA27x matrix keyboard controller Modified: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-ac97.h =================================================================== --- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-ac97.h 2006-10-20 18:31:37 UTC (rev 638) +++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-ac97.h 2006-10-20 18:49:32 UTC (rev 639) @@ -87,4 +87,6 @@ #define WM97XX_GPIO_14 (1 << 14) #define WM97XX_GPIO_15 (1 << 15) +#define AC97_LINK_FRAME 21 /* time in uS for AC97 link frame */ + #endif /* _PALMLD_AC97_H_ */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-10-21 21:46:13
|
Revision: 641 http://svn.sourceforge.net/hackndev/?rev=641&view=rev Author: marex_z71 Date: 2006-10-21 14:45:59 -0700 (Sat, 21 Oct 2006) Log Message: ----------- l4p: PalmLD LED driver - use over sysfs, no triggers set Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c linux4palm/linux/trunk/drivers/leds/Kconfig linux4palm/linux/trunk/drivers/leds/Makefile Added Paths: ----------- linux4palm/linux/trunk/drivers/leds/leds-palmld.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c 2006-10-21 09:47:47 UTC (rev 640) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c 2006-10-21 21:45:59 UTC (rev 641) @@ -195,6 +195,14 @@ /* platform */ +/* + * LEDs + */ +static struct platform_device palmldled_device = { + .name = "palmld-led", + .id = -1, +}; + /** * Backlight */ @@ -278,6 +286,7 @@ static struct platform_device *devices[] __initdata = { &palmld_kbd, &palmld_ac97, &palmld_ide, &palmld_backlight, + &palmldled_device, }; /********************************************************* Modified: linux4palm/linux/trunk/drivers/leds/Kconfig =================================================================== --- linux4palm/linux/trunk/drivers/leds/Kconfig 2006-10-21 09:47:47 UTC (rev 640) +++ linux4palm/linux/trunk/drivers/leds/Kconfig 2006-10-21 21:45:59 UTC (rev 641) @@ -76,6 +76,12 @@ This option enables support for the LEDs connected to the AIC3 MA17635 0450 v1.1 MPU Timing Generator. +config LEDS_PALMLD + tristate "LED Support for Palm LifeDrive" + depends LEDS_CLASS && MACH_XSCALE_PALMLD + help + This option enables support for the LEDs on Palm LifeDrive. + comment "LED Triggers" config LEDS_TRIGGERS Modified: linux4palm/linux/trunk/drivers/leds/Makefile =================================================================== --- linux4palm/linux/trunk/drivers/leds/Makefile 2006-10-21 09:47:47 UTC (rev 640) +++ linux4palm/linux/trunk/drivers/leds/Makefile 2006-10-21 21:45:59 UTC (rev 641) @@ -13,6 +13,7 @@ obj-$(CONFIG_LEDS_S3C24XX) += leds-s3c24xx.o obj-$(CONFIG_LEDS_H2200) += h2200_leds.o obj-$(CONFIG_LEDS_MAGICIAN) += leds-magician.o +obj-$(CONFIG_LEDS_PALMLD) += leds-palmld.o # LED Triggers obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o Added: linux4palm/linux/trunk/drivers/leds/leds-palmld.c =================================================================== --- linux4palm/linux/trunk/drivers/leds/leds-palmld.c (rev 0) +++ linux4palm/linux/trunk/drivers/leds/leds-palmld.c 2006-10-21 21:45:59 UTC (rev 641) @@ -0,0 +1,114 @@ +/* + * Palm LifeDrive LED Driver + * + * Author: Marek Vasut <mar...@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/config.h> +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/platform_device.h> +#include <linux/leds.h> +#include <asm/mach-types.h> +#include <asm/arch/palmld-gpio.h> +#include <asm/arch/hardware.h> +#include <asm/arch/pxa-regs.h> +#include <asm/hardware/scoop.h> + +static void palmldled_amber_set(struct led_classdev *led_cdev, enum led_brightness value) +{ + if (value) + SET_PALMLD_GPIO(ORANGE_LED,1); + else + SET_PALMLD_GPIO(ORANGE_LED,0); +} + +static void palmldled_green_set(struct led_classdev *led_cdev, enum led_brightness value) +{ + if (value) + SET_PALMLD_GPIO(GREEN_LED,1); + else + SET_PALMLD_GPIO(GREEN_LED,0); +} + +static struct led_classdev palmld_amber_led = { + .name = "palmld:amber", + .brightness_set = palmldled_amber_set, +}; + +static struct led_classdev palmld_green_led = { + .name = "palmld:green", + .brightness_set = palmldled_green_set, +}; + +#ifdef CONFIG_PM +static int palmldled_suspend(struct platform_device *dev, pm_message_t state) +{ + led_classdev_suspend(&palmld_amber_led); + led_classdev_suspend(&palmld_green_led); + return 0; +} + +static int palmldled_resume(struct platform_device *dev) +{ + led_classdev_resume(&palmld_amber_led); + led_classdev_resume(&palmld_green_led); + return 0; +} +#endif + +static int palmldled_probe(struct platform_device *pdev) +{ + int ret; + + ret = led_classdev_register(&pdev->dev, &palmld_amber_led); + if (ret < 0) + return ret; + + ret = led_classdev_register(&pdev->dev, &palmld_green_led); + if (ret < 0) + led_classdev_unregister(&palmld_amber_led); + + return ret; +} + +static int palmldled_remove(struct platform_device *pdev) +{ + led_classdev_unregister(&palmld_amber_led); + led_classdev_unregister(&palmld_green_led); + return 0; +} + +static struct platform_driver palmldled_driver = { + .probe = palmldled_probe, + .remove = palmldled_remove, +#ifdef CONFIG_PM + .suspend = palmldled_suspend, + .resume = palmldled_resume, +#endif + .driver = { + .name = "palmld-led", + }, +}; + +static int __init palmldled_init(void) +{ + return platform_driver_register(&palmldled_driver); +} + +static void __exit palmldled_exit(void) +{ + platform_driver_unregister(&palmldled_driver); +} + +module_init(palmldled_init); +module_exit(palmldled_exit); + +MODULE_AUTHOR("Marek Vasut <mar...@gm...>"); +MODULE_DESCRIPTION("Palm LifeDrive LED driver"); +MODULE_LICENSE("GPL"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <far...@us...> - 2006-10-23 15:52:35
|
Revision: 642 http://svn.sourceforge.net/hackndev/?rev=642&view=rev Author: farcaller Date: 2006-10-23 08:52:20 -0700 (Mon, 23 Oct 2006) Log Message: ----------- palmt3: cpu-freq fixed Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/cpu-pxa.c linux4palm/linux/trunk/drivers/video/pxafb.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/cpu-pxa.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/cpu-pxa.c 2006-10-21 21:45:59 UTC (rev 641) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/cpu-pxa.c 2006-10-23 15:52:20 UTC (rev 642) @@ -120,6 +120,14 @@ { /* CPU MEMBUS CCCR DIV2*/ #if defined(CONFIG_PXA25x) +#if defined(CONFIG_MACH_T3XSCALE) + {133000, 99500, 0x123, 1, PXA25x_CCLKCFG}, // 133 * 1 * 1 + {199000, 99500, 0x1a3, 0, PXA25x_CCLKCFG}, // 133 * 1 * 1.5 + {266000, 99500, 0x143, 0, PXA25x_CCLKCFG}, // 133 * 2 * 1 + {399000, 99500, 0x1c3, 0, PXA25x_CCLKCFG}, // 133 * 2 * 1.5 + //{441000, 99500, 0x1c4, 0, PXA25x_CCLKCFG}, // 147 * 2 * 1.5 FIXME: doesn't work? + //{472000, 99500, 0x242, 0, PXA25x_CCLKCFG}, // 118 * 2 * 2 FIXME: is that stabe enough? +#else #if defined(CONFIG_PXA25x_ALTERNATE_FREQS) { 99500, 99500, 0x121, 1, PXA25x_CCLKCFG}, /* run=99, turbo= 99, PXbus=50, SDRAM=50 */ {199100, 99500, 0x221, 0, PXA25x_CCLKCFG}, /* run=99, turbo=199, PXbus=50, SDRAM=99 */ @@ -134,6 +142,7 @@ {331800, 165900, 0x145, 1, PXA25x_CCLKCFG}, /* run=331, turbo=331, PXbus=166, SDRAM=83 */ {398100, 99500, 0x161, 0, PXA25x_CCLKCFG} /* run=398, turbo=398, PXbus=196, SDRAM=99 */ #endif +#endif #elif defined(CONFIG_PXA27x) {104000, 104000, PXA27x_CCCR(1, 8, 2), 0, PXA27x_CCLKCFG(1, 0, 1)}, {156000, 104000, PXA27x_CCCR(1, 8, 6), 0, PXA27x_CCLKCFG(1, 1, 1)}, @@ -221,6 +230,7 @@ * we need to preset the smaller DRI before the change. If we're speeding * up we need to set the larger DRI value after the change. */ +#ifndef CONFIG_MACH_T3XSCALE preset_mdrefr = postset_mdrefr = MDREFR; if((MDREFR & MDREFR_DRI_MASK) > MDREFR_DRI(pxa2xx_freqs[idx].membus)) { preset_mdrefr = (preset_mdrefr & ~MDREFR_DRI_MASK) | @@ -252,7 +262,7 @@ postset_mdrefr &= ~MDREFR_K0DB4; postset_mdrefr |= MDREFR_K0DB2; } - +#endif cclkcfg = pxa2xx_freqs[idx].cclkcfg; if (freq_debug) { @@ -281,8 +291,26 @@ * The current values in the pxa2xx_freqs table don't do this, so the code * is unimplemented. */ - +#ifdef CONFIG_MACH_T3XSCALE __asm__ __volatile__(" \ + /*ldr r4, [%1] ;*/ /* load MDREFR */ \ + b 2f ; \ + .align 5 ; \ +1: \ + /*str %3, [%1] ;*/ /* preset the MDREFR */ \ + mcr p14, 0, %2, c6, c0, 0 ; /* set CCLKCFG[FCS] */ \ + /*str %4, [%1] ;*/ /* postset the MDREFR */ \ + \ + b 3f ; \ +2: b 1b ; \ +3: nop ; \ + " + : "=&r" (unused) + : "r" (&MDREFR), "r" (cclkcfg), + "r" (preset_mdrefr), "r" (postset_mdrefr) + : "r4", "r5"); +#else + __asm__ __volatile__(" \ ldr r4, [%1] ; /* load MDREFR */ \ b 2f ; \ .align 5 ; \ @@ -299,6 +327,7 @@ : "r" (&MDREFR), "r" (cclkcfg), \ "r" (preset_mdrefr), "r" (postset_mdrefr) : "r4", "r5"); +#endif local_irq_restore(flags); if (freq_debug) { Modified: linux4palm/linux/trunk/drivers/video/pxafb.c =================================================================== --- linux4palm/linux/trunk/drivers/video/pxafb.c 2006-10-21 21:45:59 UTC (rev 641) +++ linux4palm/linux/trunk/drivers/video/pxafb.c 2006-10-23 15:52:20 UTC (rev 642) @@ -1362,11 +1362,13 @@ #endif #ifdef CONFIG_CPU_FREQ +#ifndef CONFIG_MACH_T3XSCALE fbi->freq_transition.notifier_call = pxafb_freq_transition; fbi->freq_policy.notifier_call = pxafb_freq_policy; cpufreq_register_notifier(&fbi->freq_transition, CPUFREQ_TRANSITION_NOTIFIER); cpufreq_register_notifier(&fbi->freq_policy, CPUFREQ_POLICY_NOTIFIER); #endif +#endif /* * Ok, now enable the LCD controller This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cri...@us...> - 2006-10-23 21:46:32
|
Revision: 644 http://svn.sourceforge.net/hackndev/?rev=644&view=rev Author: cristianop Date: 2006-10-23 14:46:19 -0700 (Mon, 23 Oct 2006) Log Message: ----------- l4p: added (experimental) bl power handling Modified Paths: -------------- linux4palm/linux/trunk/drivers/video/backlight/pxapwm_bl.c linux4palm/linux/trunk/include/asm-arm/arch-pxa/pxapwm-bl.h Modified: linux4palm/linux/trunk/drivers/video/backlight/pxapwm_bl.c =================================================================== --- linux4palm/linux/trunk/drivers/video/backlight/pxapwm_bl.c 2006-10-23 19:38:29 UTC (rev 643) +++ linux4palm/linux/trunk/drivers/video/backlight/pxapwm_bl.c 2006-10-23 21:46:19 UTC (rev 644) @@ -19,6 +19,8 @@ #include <asm/arch/pxapwm-bl.h> static struct backlight_properties pxapwmbl_data; +static void (*pxapwmbl_mach_turn_bl_on)(void); +static void (*pxapwmbl_mach_turn_bl_off)(void); static void pxapwmbl_send_intensity(struct pxapwmbl_platform_data *bl, int intensity) { @@ -28,6 +30,12 @@ if (bl->limit) intensity &= bl->limit_mask; + // set intensity to 0 if in power saving or fb is blanked + if (bl->power != FB_BLANK_UNBLANK) + intensity = 0; + if (bl->fb_blank != FB_BLANK_UNBLANK) + intensity = 0; + /* Does the backlight frequency need to be configured on a per device basis? * What are sensible defaults? Farcaller had prescaler 2, period 0x12bi (~6.1khz). * LD is configured for 1.2khz. @@ -41,9 +49,17 @@ period = 0; prescaler=0; } - + + //printk("pxapwmbl: setting intensity to %d [bl->intensity=%d]\n", intensity, bl->intensity); spin_lock_irqsave(&bl->lock, flags); + // poweron backlight if possible and needed + if (pxapwmbl_mach_turn_bl_on){ + if ((bl->intensity <= bl->off_threshold) && (intensity > bl->off_threshold)){ + pxapwmbl_mach_turn_bl_on(); + } + } + switch (bl->pwm) { case 0: PWM_CTRL0 = prescaler; @@ -66,6 +82,13 @@ " platform data.\n"); } + // poweroff backlight if possible and needed + if (pxapwmbl_mach_turn_bl_off){ + if ((bl->intensity > bl->off_threshold) && (intensity <= bl->off_threshold)){ + pxapwmbl_mach_turn_bl_off(); + } + } + spin_unlock_irqrestore(&bl->lock, flags); } @@ -139,10 +162,16 @@ pxapwmbl_data.max_brightness = bl->max_intensity; + pxapwmbl_mach_turn_bl_on = bl->turn_bl_on; + pxapwmbl_mach_turn_bl_off = bl->turn_bl_off; + bl->intensity = 0; bl->limit = 0; bl->lock = SPIN_LOCK_UNLOCKED; + bl->power = FB_BLANK_UNBLANK; + bl->off_threshold = 5; + bl->dev = backlight_device_register ("pxapwm-bl", bl, &pxapwmbl_data); if (IS_ERR (bl->dev)) return PTR_ERR (bl->dev); Modified: linux4palm/linux/trunk/include/asm-arm/arch-pxa/pxapwm-bl.h =================================================================== --- linux4palm/linux/trunk/include/asm-arm/arch-pxa/pxapwm-bl.h 2006-10-23 19:38:29 UTC (rev 643) +++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/pxapwm-bl.h 2006-10-23 21:46:19 UTC (rev 644) @@ -29,10 +29,16 @@ int prescaler; int intensity; - int powermode; + int power; + int fb_blank; int limit; + int off_threshold; + spinlock_t lock; struct backlight_device *dev; + void (*turn_bl_on)(void); + void (*turn_bl_off)(void); + }; #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cri...@us...> - 2006-10-23 21:52:46
|
Revision: 645 http://svn.sourceforge.net/hackndev/?rev=645&view=rev Author: cristianop Date: 2006-10-23 14:52:29 -0700 (Mon, 23 Oct 2006) Log Message: ----------- palmtx: adedd (experimental) support for backlight and for LCD Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Makefile linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtx-gpio.h Added Paths: ----------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_lcd.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig 2006-10-23 21:46:19 UTC (rev 644) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig 2006-10-23 21:52:29 UTC (rev 645) @@ -14,6 +14,15 @@ Enable support for WM9712 touchscreen and battery for the Palm TX PDA +config PALMTX_LCD + tristate "Palm TX LCD driver" + select BACKLIGHT_LCD_SUPPORT + depends on MACH_XSCALE_PALMTX + default y if MACH_XSCALE_PALMTX + help + LCD driver for Palm TX. + Enable support for switching the Palm TX LCD on/off + config PALMTX_PCMCIA tristate "Palm TX PCMCIA driver" depends on MACH_XSCALE_PALMTX Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Makefile =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Makefile 2006-10-23 21:46:19 UTC (rev 644) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Makefile 2006-10-23 21:52:29 UTC (rev 645) @@ -4,4 +4,5 @@ # obj-$(CONFIG_MACH_XSCALE_PALMTX) += palmtx.o obj-$(CONFIG_PALMTX_AC97) += palmld_ac97.o +obj-$(CONFIG_PALMTX_LCD) += palmtx_lcd.o #obj-$(CONFIG_PALMTX_PCMCIA) += palmtx_pcmcia.o Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c 2006-10-23 21:46:19 UTC (rev 644) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c 2006-10-23 21:52:29 UTC (rev 645) @@ -23,6 +23,7 @@ #include <linux/platform_device.h> #include <linux/fb.h> #include <linux/input.h> +#include <linux/delay.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> @@ -148,6 +149,20 @@ // backlight +static void palmtx_bl_on(void){ + //printk("palmtx: turning backlight on\n"); + SET_GPIO(GPIO_NR_PALMTX_BL_POWER, 1); + //printk("GPIO_NR_PALMTX_BL_POWER: %d\n",GET_GPIO(GPIO_NR_PALMTX_BL_POWER)); + mdelay(50); +} + +static void palmtx_bl_off(void){ + //printk("palmtx: turning backlight off\n"); + SET_GPIO(GPIO_NR_PALMTX_BL_POWER, 0); + //printk("GPIO_NR_PALMTX_BL_POWER: %d\n",GET_GPIO(GPIO_NR_PALMTX_BL_POWER)); + mdelay(50); +} + static struct pxapwmbl_platform_data palmtx_backlight_data = { .pwm = 0, .max_intensity = 0x16c, @@ -155,6 +170,8 @@ .limit_mask = 0x6d, .prescaler = 7, .period = 0x16c, + .turn_bl_on = palmtx_bl_on, + .turn_bl_off = palmtx_bl_off, }; static struct platform_device palmtx_backlight = { @@ -164,7 +181,12 @@ }, }; +// LCD +static struct platform_device palmtx_lcd = { + .name = "palmtx-lcd", +}; + /** * IRDA */ @@ -298,6 +320,7 @@ &palmtx_keypad, &palmtx_ac97, &palmtx_backlight, + &palmtx_lcd, }; @@ -312,7 +335,7 @@ * */ -static struct pxafb_mach_info palmtx_lcd __initdata = { +static struct pxafb_mach_info palmtx_fb __initdata = { .pixclock = 80000, .xres = 320, // PPL + 1 .yres = 480, // LPP + 1 @@ -390,7 +413,7 @@ pxa_gpio_mode(GPIO30_SDATA_OUT_AC97_MD); pxa_gpio_mode(GPIO31_SYNC_AC97_MD); - set_pxa_fb_info(&palmtx_lcd); + set_pxa_fb_info(&palmtx_fb); pxa_set_mci_info( &palmtx_mci_platform_data ); pxa_set_udc_info(&palmtx_udc_mach_info); Added: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_lcd.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_lcd.c (rev 0) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_lcd.c 2006-10-23 21:52:29 UTC (rev 645) @@ -0,0 +1,154 @@ +/* + * Palm TX LCD driver + * + * Based on Asus MyPal 716 LCD and Backlight driver + * + * 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/module.h> +#include <linux/init.h> +#include <linux/notifier.h> +#include <linux/lcd.h> +#include <linux/fb.h> +#include <linux/delay.h> +#include <linux/platform_device.h> + +#include <asm/mach/arch.h> +#include <asm/mach/map.h> +#include <asm/mach-types.h> + +#include <asm/hardware.h> +#include <asm/arch/pxa-regs.h> +#include <asm/arch/pxafb.h> + +#include <asm/arch/palmtx-gpio.h> +#include <asm/arch/palmtx-init.h> + +static int lcd_power; + +int palmtx_lcd_set_power(struct lcd_device *lm, int level) +{ + switch (level) { + case FB_BLANK_UNBLANK: + case FB_BLANK_NORMAL: + // this is very likely incomplete !!! + printk("palmtx_lcd: turning LCD on\n"); + SET_GPIO(GPIO_NR_PALMTX_LCD_POWER, 1); + mdelay(70); + break; + case FB_BLANK_VSYNC_SUSPEND: + case FB_BLANK_HSYNC_SUSPEND: + break; + case FB_BLANK_POWERDOWN: + // this is very likely incomplete !!! + printk("palmtx_lcd: turning LCD off\n"); + SET_GPIO(GPIO_NR_PALMTX_LCD_POWER, 0); + mdelay(65); + break; + } + + lcd_power = level; + + return 0; +} + +static int palmtx_lcd_get_power(struct lcd_device *lm) +{ + printk("palmtx_lcd: power is set to %d", lcd_power); + return lcd_power; +} + +struct lcd_properties palmtx_lcd_properties = +{ + .owner = THIS_MODULE, + .set_power = palmtx_lcd_set_power, + .get_power = palmtx_lcd_get_power, +}; + +static struct lcd_device *pxafb_lcd_device; + + +int palmtx_lcd_probe(struct device *dev) +{ + if (!machine_is_xscale_palmtx()) + return -ENODEV; + + pxafb_lcd_device = lcd_device_register("pxafb", NULL, &palmtx_lcd_properties); + + if (IS_ERR(pxafb_lcd_device)){ + printk("palmtx_lcd_probe: cannot register LCD device\n"); + return -ENOMEM; + } + + printk ("palmtx LCD driver registered\n"); + + return 0; +} + +static int palmtx_lcd_remove(struct device *dev) +{ + lcd_device_unregister(pxafb_lcd_device); + printk ("palmtx LCD driver unregistered\n"); + return 0; +} + +#ifdef CONFIG_PM + +static int palmtx_lcd_suspend(struct device *dev, pm_message_t state) +{ + struct pm_save_data *save; + + if (!dev->power.saved_state) + dev->power.saved_state = kmalloc(sizeof(struct pm_save_data), GFP_KERNEL); + if (!dev->power.saved_state) + return -ENOMEM; + save = dev->power.saved_state; + return 0; +} + +static int palmtx_lcd_resume(struct device *dev) +{ + if (dev->power.saved_state) { + struct pm_save_data *save = dev->power.saved_state; + kfree(dev->power.saved_state); + dev->power.saved_state = NULL; + } + + return 0; +} +#endif + +static struct device_driver palmtx_lcd_driver = { + .name = "palmtx-lcd", + .bus = &platform_bus_type, + .probe = palmtx_lcd_probe, + .remove = palmtx_lcd_remove, +#ifdef CONFIG_PM + .suspend = palmtx_lcd_suspend, + .resume = palmtx_lcd_resume, +#endif +}; + +static int palmtx_lcd_init(void) +{ + if (!machine_is_xscale_palmtx()) + return -ENODEV; + + return driver_register(&palmtx_lcd_driver); +} + +static void palmtx_lcd_exit(void) +{ + lcd_device_unregister(pxafb_lcd_device); + driver_unregister(&palmtx_lcd_driver); +} + +module_init(palmtx_lcd_init); +module_exit(palmtx_lcd_exit); + +MODULE_DESCRIPTION("LCD driver for Palm TX"); +MODULE_LICENSE("GPL"); Property changes on: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_lcd.c ___________________________________________________________________ Name: svn:executable + * Modified: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtx-gpio.h =================================================================== --- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtx-gpio.h 2006-10-23 21:46:19 UTC (rev 644) +++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtx-gpio.h 2006-10-23 21:52:29 UTC (rev 645) @@ -64,6 +64,9 @@ #define GPIO_NR_PALMTX_USB_POWER 95 #define GPIO_NR_PALMTX_USB_PULLUP 93 +#define GPIO_NR_PALMTX_BL_POWER 84 +#define GPIO_NR_PALMTX_LCD_POWER 96 + /* INTERRUPTS */ #define IRQ_GPIO_PALMTX_SD_DETECT_N IRQ_GPIO(GPIO_NR_PALMTX_SD_DETECT_N) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <far...@us...> - 2006-10-31 06:35:43
|
Revision: 656 http://svn.sourceforge.net/hackndev/?rev=656&view=rev Author: farcaller Date: 2006-10-30 22:35:33 -0800 (Mon, 30 Oct 2006) Log Message: ----------- palmt3: moved lcd power to palmt3.c removed palmt3_bl_device until someone figures wtf is that (old backlight driver?) returned pxafb_backlight_power code Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmt3/palmt3.c linux4palm/linux/trunk/drivers/video/pxafb.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmt3/palmt3.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmt3/palmt3.c 2006-10-31 06:03:40 UTC (rev 655) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmt3/palmt3.c 2006-10-31 06:35:33 UTC (rev 656) @@ -44,11 +44,34 @@ /*** BackLight ***/ +/* FIXME: wtf is this? Pending for removal static struct platform_device palmt3_bl_device = { .name = "palmt3-bl", .id = -1, }; +*/ +static void palmt3_pxafb_backlight_power(int level) +{ + // just turn it on/off, other controls via backlight class + if(level) + CKEN = CKEN | CKEN1_PWM1; + else + CKEN = CKEN & (~CKEN1_PWM1); +} + +static void palmt3_pxafb_lcd_power(int level) +{ + if(level) { + GPSR1 = GPIO_bit(38); + GPSR1 = GPIO_bit(41); + + } else { + GPLR1 = GPIO_bit(38); + GPLR1 = GPIO_bit(41); + } +} + static struct pxafb_mach_info palmt3lcd __initdata = { .pixclock = 0, .xres = 320, @@ -65,7 +88,8 @@ .lccr0 = 0x003008F9, .lccr3 = 0x03700002, - .pxafb_backlight_power = NULL, + .pxafb_backlight_power = palmt3_pxafb_backlight_power, + .pxafb_lcd_power = palmt3_pxafb_lcd_power, }; /*** SSP ***/ @@ -223,7 +247,7 @@ /*** INIT ***/ static struct platform_device *devices[] __initdata = { - &palmt3_bl_device, + //&palmt3_bl_device, &tsc2101_device, &palmt3_btn_device, &palmt3_backlight_device, Modified: linux4palm/linux/trunk/drivers/video/pxafb.c =================================================================== --- linux4palm/linux/trunk/drivers/video/pxafb.c 2006-10-31 06:03:40 UTC (rev 655) +++ linux4palm/linux/trunk/drivers/video/pxafb.c 2006-10-31 06:35:33 UTC (rev 656) @@ -747,11 +747,6 @@ pr_debug("reg_lccr2 0x%08x\n", (unsigned int) fbi->reg_lccr2); pr_debug("reg_lccr3 0x%08x\n", (unsigned int) fbi->reg_lccr3); -#ifdef CONFIG_MACH_T3XSCALE - GPSR1 = GPIO_bit(38); - GPSR1 = GPIO_bit(41); -#endif - /* enable LCD controller clock */ pxa_set_cken(CKEN16_LCD, 1); @@ -791,10 +786,6 @@ /* disable LCD controller clock */ pxa_set_cken(CKEN16_LCD, 0); -#ifdef CONFIG_MACH_T3XSCALE - GPCR1 = GPIO_bit(38); - GPCR1 = GPIO_bit(41); -#endif } /* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <far...@us...> - 2006-11-03 20:09:49
|
Revision: 660 http://svn.sourceforge.net/hackndev/?rev=660&view=rev Author: farcaller Date: 2006-11-03 12:09:33 -0800 (Fri, 03 Nov 2006) Log Message: ----------- l4p: initial commit of battery/charger classes Added Paths: ----------- linux4palm/linux/trunk/drivers/misc/battchargemon.c linux4palm/linux/trunk/include/linux/battchargemon.h Added: linux4palm/linux/trunk/drivers/misc/battchargemon.c =================================================================== --- linux4palm/linux/trunk/drivers/misc/battchargemon.c (rev 0) +++ linux4palm/linux/trunk/drivers/misc/battchargemon.c 2006-11-03 20:09:33 UTC (rev 660) @@ -0,0 +1,63 @@ +/* + * battchargemon.c + * + * Battery and charger monitor class, mostly inspired by battery.c + * + * (c) 2006 Vladimir "Farcaller" Pouzanov <far...@gm...> + * + * You may use this code as per GPL version 2 + * + * All volatges, currents, charges, and temperatures in mV, mA, mJ and + * tenths of a degree unless otherwise stated. + * + */ + +#include <linux/config.h> +#include <linux/module.h> +#include <linux/types.h> +#include <linux/init.h> +#include <linux/device.h> +#include <linux/battchargemon.h> + + + + +static struct class battery_class = { + .name = "battery", +// .hotplug = battery_class_hotplug, +// .release = battery_class_release, +}; + +static struct class charger_class = { + .name = "charger", +}; + +static int __init battcharge_class_init(void) +{ + int ret = class_register(&battery_class); + if(likely(ret)) { + if(likely((ret = class_register(&charger_class)) == 0)) { + return 0; + } else { + class_unregister(&battery_class); + } + } + return ret; +} + +static void __exit battcharge_class_exit(void) +{ + class_unregister(&charger_class); + class_unregister(&battery_class); +} + +#ifdef MODULE +module_init(battcharge_class_init); +#else /* start early */ +subsys_initcall(battcharge_class_init); +#endif +module_exit(battcharge_class_exit); + +MODULE_DESCRIPTION("Battery and charger driver"); +MODULE_AUTHOR("Vladimir Pouzanov"); +MODULE_LICENSE("GPL"); Added: linux4palm/linux/trunk/include/linux/battchargemon.h =================================================================== --- linux4palm/linux/trunk/include/linux/battchargemon.h (rev 0) +++ linux4palm/linux/trunk/include/linux/battchargemon.h 2006-11-03 20:09:33 UTC (rev 660) @@ -0,0 +1,51 @@ +/* + * battchargemon.h + * + * Battery and charger monitor class + * + * (c) 2006 Vladimir "Farcaller" Pouzanov <far...@gm...> + * + * You may use this code as per GPL version 2 + * + */ + +#ifndef _LINUX_BATTCHARGEMON_H +#define _LINUX_BATTCHARGEMON_H + +#include <linux/device.h> + +struct battery { + struct class_device class_dev; + const char *name; + char *id; + int (*get_min_voltage)(struct battery *); + int (*get_max_voltage)(struct battery *); + int (*get_voltage)(struct battery *); + + int (*get_current)(struct battery *); + + int (*get_temp)(struct battery *); + + int (*get_charge)(struct battery *); +}; + +struct charger { + struct class_device class_dev; + const char *name; + +#define CHARGER_DISCONNECTED 0 +#define CHARGER_CONNECTED 1 + int (*get_status)(struct charger *); +}; + +#define BATTERY_STATUS_UNKNOWN 0 +#define BATTERY_STATUS_CHARGING 1 +#define BATTERY_STATUS_DISCHARGING 2 +#define BATTERY_STATUS_NOT_CHARGING 3 + +extern int battery_class_register(struct battery *); +extern void battery_class_unregister(struct battery *); + + +#endif + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <far...@us...> - 2006-11-03 21:24:17
|
Revision: 661 http://svn.sourceforge.net/hackndev/?rev=661&view=rev Author: farcaller Date: 2006-11-03 13:23:57 -0800 (Fri, 03 Nov 2006) Log Message: ----------- l4p: made battchargemon usable Modified Paths: -------------- linux4palm/linux/trunk/drivers/misc/battchargemon.c linux4palm/linux/trunk/include/linux/battchargemon.h Modified: linux4palm/linux/trunk/drivers/misc/battchargemon.c =================================================================== --- linux4palm/linux/trunk/drivers/misc/battchargemon.c 2006-11-03 20:09:33 UTC (rev 660) +++ linux4palm/linux/trunk/drivers/misc/battchargemon.c 2006-11-03 21:23:57 UTC (rev 661) @@ -19,9 +19,35 @@ #include <linux/device.h> #include <linux/battchargemon.h> +#define DEB(s) printk(KERN_ERR s "\n"); +/**** handlers ****/ +static ssize_t battery_show_id(struct class_device *cdev, char *buf) { + struct battery *bat = container_of(cdev, struct battery, class_dev); + return sprintf(buf, "%s\n", bat->id); +} +static ssize_t charger_show_id(struct class_device *cdev, char *buf) { + struct charger *bat = container_of(cdev, struct charger, class_dev); + return sprintf(buf, "%s\n", bat->id); +} +#define show_int_val(_class, _name) \ +static ssize_t _class##_show_##_name(struct class_device *cdev, char *buf) { \ + struct _class *cl = container_of(cdev, struct _class, class_dev); \ + if (cl->get_##_name) \ + return sprintf(buf, "%d\n", cl->get_##_name(cl)); \ + return 0; \ +} + +show_int_val(battery, min_voltage); +show_int_val(battery, max_voltage); +show_int_val(battery, voltage); +show_int_val(battery, current); +show_int_val(battery, temp); +show_int_val(battery, charge); +show_int_val(charger, status); + static struct class battery_class = { .name = "battery", // .hotplug = battery_class_hotplug, @@ -32,9 +58,95 @@ .name = "charger", }; +#define CLS_DEV_ATTR(_class, _name, _mode, _show, _store) \ + struct class_device_attribute _class##_class_device_attr_##_name = { \ + .attr = { .name = #_name, .mode = _mode, .owner = THIS_MODULE }, \ + .show = _show, \ + .store = _store, \ + } + +/**** device attributes ****/ +static CLS_DEV_ATTR (battery, id, 0444, battery_show_id, NULL); +static CLS_DEV_ATTR (battery, min_voltage, 0444, battery_show_min_voltage, NULL); +static CLS_DEV_ATTR (battery, max_voltage, 0444, battery_show_max_voltage, NULL); +static CLS_DEV_ATTR (battery, voltage, 0444, battery_show_voltage, NULL); +static CLS_DEV_ATTR (battery, current, 0444, battery_show_current, NULL); +static CLS_DEV_ATTR (battery, temp, 0444, battery_show_temp, NULL); +static CLS_DEV_ATTR (battery, charge, 0444, battery_show_charge, NULL); + +static CLS_DEV_ATTR (charger, id, 0444, charger_show_id, NULL); +static CLS_DEV_ATTR (charger, status, 0444, charger_show_status, NULL); + +/**** class registration ****/ + +#define create_entry_conditional(_name) \ +if(bat->get_##_name) \ + class_device_create_file(&bat->class_dev, &battery_class_device_attr_##_name); + +int battery_class_register(struct battery *bat) +{ + int rc = 0; + + WARN_ON(!bat->name); + bat->class_dev.class = &battery_class; + strcpy(bat->class_dev.class_id, bat->name); + rc = class_device_register(&bat->class_dev); + if(rc) + goto out; + + if(bat->id) + class_device_create_file(&bat->class_dev, &battery_class_device_attr_id); + create_entry_conditional(min_voltage); + create_entry_conditional(max_voltage); + create_entry_conditional(voltage); + create_entry_conditional(current); + create_entry_conditional(temp); + create_entry_conditional(charge); + +out: + return rc; +} +EXPORT_SYMBOL (battery_class_register); + +void battery_class_unregister (struct battery *bat) +{ + class_device_unregister(&bat->class_dev); +} +EXPORT_SYMBOL (battery_class_unregister); + +int charger_class_register(struct charger *cha) +{ + int rc = 0; + + WARN_ON(!cha->name); + cha->class_dev.class = &charger_class; + strcpy(cha->class_dev.class_id, cha->name); + rc = class_device_register(&cha->class_dev); + if(rc) + goto out; + + if(cha->id) + class_device_create_file(&cha->class_dev, &charger_class_device_attr_id); + if(cha->get_status) + class_device_create_file(&cha->class_dev, &charger_class_device_attr_status); + +out: + return rc; +} +EXPORT_SYMBOL (charger_class_register); + +void charger_class_unregister (struct charger *cha) +{ + class_device_unregister(&cha->class_dev); +} +EXPORT_SYMBOL (charger_class_unregister); + +/**** module init/exit ****/ + static int __init battcharge_class_init(void) { int ret = class_register(&battery_class); + DEB("initializing battcharge"); if(likely(ret)) { if(likely((ret = class_register(&charger_class)) == 0)) { return 0; @@ -47,6 +159,7 @@ static void __exit battcharge_class_exit(void) { + DEB("modexit"); class_unregister(&charger_class); class_unregister(&battery_class); } Modified: linux4palm/linux/trunk/include/linux/battchargemon.h =================================================================== --- linux4palm/linux/trunk/include/linux/battchargemon.h 2006-11-03 20:09:33 UTC (rev 660) +++ linux4palm/linux/trunk/include/linux/battchargemon.h 2006-11-03 21:23:57 UTC (rev 661) @@ -32,17 +32,13 @@ struct charger { struct class_device class_dev; const char *name; + char *id; #define CHARGER_DISCONNECTED 0 #define CHARGER_CONNECTED 1 int (*get_status)(struct charger *); }; -#define BATTERY_STATUS_UNKNOWN 0 -#define BATTERY_STATUS_CHARGING 1 -#define BATTERY_STATUS_DISCHARGING 2 -#define BATTERY_STATUS_NOT_CHARGING 3 - extern int battery_class_register(struct battery *); extern void battery_class_unregister(struct battery *); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cri...@us...> - 2006-12-03 13:46:45
|
Revision: 692 http://svn.sourceforge.net/hackndev/?rev=692&view=rev Author: cristianop Date: 2006-12-03 05:46:39 -0800 (Sun, 03 Dec 2006) Log Message: ----------- palmtx: added irda support; some cleanup ... Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Makefile linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_lcd.c linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtx-gpio.h linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtx-init.h Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Makefile =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Makefile 2006-12-02 19:44:15 UTC (rev 691) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Makefile 2006-12-03 13:46:39 UTC (rev 692) @@ -5,4 +5,5 @@ obj-$(CONFIG_MACH_XSCALE_PALMTX) += palmtx.o obj-$(CONFIG_PALMTX_AC97) += palmld_ac97.o obj-$(CONFIG_PALMTX_LCD) += palmtx_lcd.o +obj-$(CONFIG_PM) += palmtx_pm.o #obj-$(CONFIG_PALMTX_PCMCIA) += palmtx_pcmcia.o Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c 2006-12-02 19:44:15 UTC (rev 691) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx.c 2006-12-03 13:46:39 UTC (rev 692) @@ -36,6 +36,7 @@ #include <asm/arch/pxa-dmabounce.h> #include <asm/arch/pxa-regs.h> #include <asm/arch/udc.h> +#include <asm/arch/irda.h> #include <asm/arch/pxa27x_keyboard.h> #include <asm/arch/pxapwm-bl.h> @@ -187,86 +188,58 @@ .name = "palmtx-lcd", }; -/** - * IRDA - */ -/* Uncomment the following line to get serial console via SIR work from - * the very early booting stage. This is not useful for end-user. - */ -// #define EARLY_SIR_CONSOLE -#define IR_TRANSCEIVER_ON SET_HX4700_GPIO_N(IR_ON, 1) -#define IR_TRANSCEIVER_OFF SET_HX4700_GPIO_N(IR_ON, 0) +// IRDA -static void palmtx_irda_configure (struct uart_pxa_port *up, int enable) +static void palmtx_irda_transceiver_mode(struct device *dev, int mode) { - /* Switch STUART RX/TX pins to SIR */ - pxa_gpio_mode( GPIO_NR_PALMTX_ICP_RXD_MD ); - pxa_gpio_mode( GPIO_NR_PALMTX_ICP_TXD_MD ); + unsigned long flags; - /* make sure FIR ICP is off */ - ICCR0 = 0; + local_irq_save(flags); - if (enable) { - /* configure STUART to for SIR */ - STISR = STISR_XMODE | STISR_RCVEIR | STISR_RXPL; - //IR_TRANSCEIVER_ON; - } else { - STISR = 0; - //IR_TRANSCEIVER_OFF; - } -} + if (mode & IR_SIRMODE){ + printk (KERN_INFO "palmtx_irda: setting mode to SIR\n"); + } + else if (mode & IR_FIRMODE){ + printk (KERN_INFO "palmtx_irda: setting mode to FIR\n"); + } + if (mode & IR_OFF){ + printk (KERN_INFO "palmtx_irda: turning tranceiver OFF\n"); + SET_GPIO(GPIO_NR_PALMTX_IR_DISABLE, 1); + } + else { + printk (KERN_INFO "palmtx_irda: turning tranceiver ON\n"); + SET_GPIO(GPIO_NR_PALMTX_IR_DISABLE, 0); + SET_GPIO(GPIO_NR_PALMTX_ICP_TXD_MD, 1); + mdelay(30); + SET_GPIO(GPIO_NR_PALMTX_ICP_TXD_MD, 0); + } - -static void palmtx_irda_set_txrx (struct uart_pxa_port *up, int txrx) -{ - unsigned old_stisr = STISR; - unsigned new_stisr = old_stisr; - - if (txrx & PXA_SERIAL_TX) { - /* Ignore RX if TX is set */ - txrx &= PXA_SERIAL_TX; - new_stisr |= STISR_XMITIR; - } else - new_stisr &= ~STISR_XMITIR; - - if (txrx & PXA_SERIAL_RX) - new_stisr |= STISR_RCVEIR; - else - new_stisr &= ~STISR_RCVEIR; - - if (new_stisr != old_stisr) { - while (!(STLSR & LSR_TEMT)) - ; - //IR_TRANSCEIVER_OFF; - STISR = new_stisr; - //IR_TRANSCEIVER_ON; - } + local_irq_restore(flags); } -static int palmtx_irda_get_txrx (struct uart_pxa_port *up) -{ - return ((STISR & STISR_XMITIR) ? PXA_SERIAL_TX : 0) | - ((STISR & STISR_RCVEIR) ? PXA_SERIAL_RX : 0); +static struct pxaficp_platform_data palmtx_ficp_platform_data = { + .transceiver_cap = IR_SIRMODE | IR_FIRMODE | IR_OFF, + .transceiver_mode = palmtx_irda_transceiver_mode, +}; -} -static struct platform_pxa_serial_funcs palmtx_pxa_irda_funcs = { - .configure = palmtx_irda_configure, - .set_txrx = palmtx_irda_set_txrx, - .get_txrx = palmtx_irda_get_txrx, -}; + // UDC (USB gadget controller) static int palmtx_udc_is_connected (void){ int ret = !(GET_GPIO(GPIO_NR_PALMTX_USB_DETECT)); - printk (KERN_INFO "palmtx_udc: gpio status is %d\n",ret); + if (ret) + printk (KERN_INFO "palmtx_udc: device detected [USB_DETECT: %d]\n",ret); + else + printk (KERN_INFO "palmtx_udc: no device detected [USB_DETECT: %d]\n",ret); + return ret; } @@ -371,63 +344,41 @@ }; -// grabbed Alex' initialization code: thx! static void __init palmtx_map_io(void) { pxa_map_io(); iotable_init(palmtx_io_desc, ARRAY_SIZE(palmtx_io_desc)); - - /* wake up on */ - - PWER |= PWER_GPIO0 | PWER_RTC | PWER_GPIO12; - PFER |= PWER_GPIO0 | PWER_RTC; - PRER |= PWER_GPIO12; - - /* USB, in theory this can even wake us from deep sleep */ - PWER |= PWER_GPIO3; - PFER |= PWER_GPIO3; - PRER |= PWER_GPIO3; - - PGSR2 |= (1<<30); - PGSR3 |= (1<<7) | (1<<8) | (1<<9); - - PKWR |= GPIO_bit(0) | GPIO_bit(12) | GPIO_bit(3) | (1<<17); - PKSR = 0xffffffff; // clear - - /* Clear reset status */ - RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR; } + static void __init palmtx_init(void) { - - // disable interrupt to prevent WM9712 constantly interrupting the CPU + // disable primary codec interrupt to prevent WM9712 constantly interrupting the CPU // and preventing the boot process to complete (Thanx Alex & Shadowmite!) GCR &= ~GCR_PRIRDY_IEN; - // set AC97's GPIOs + // configure AC97's GPIOs pxa_gpio_mode(GPIO28_BITCLK_AC97_MD); pxa_gpio_mode(GPIO29_SDATA_IN_AC97_MD); pxa_gpio_mode(GPIO30_SDATA_OUT_AC97_MD); pxa_gpio_mode(GPIO31_SYNC_AC97_MD); - set_pxa_fb_info(&palmtx_fb); - pxa_set_mci_info( &palmtx_mci_platform_data ); - pxa_set_udc_info(&palmtx_udc_mach_info); - - platform_add_devices( devices, ARRAY_SIZE(devices) ); + set_pxa_fb_info ( &palmtx_fb ); + pxa_set_mci_info ( &palmtx_mci_platform_data ); + pxa_set_udc_info ( &palmtx_udc_mach_info ); + pxa_set_ficp_info ( &palmtx_ficp_platform_data ); - stuart_device.dev.platform_data = &palmtx_pxa_irda_funcs; + platform_add_devices( devices, ARRAY_SIZE(devices) ); + + //stuart_device.dev.platform_data = &palmtx_pxa_irda_funcs; } MACHINE_START(XSCALE_PALMTX, "Palm TX") - //.phys_ram = PALMTX_PHYS_RAM_START, .phys_io = PALMTX_PHYS_IO_START, - //.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .io_pg_offst = io_p2v(0x40000000), .boot_params = 0xa0000100, .map_io = palmtx_map_io, Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_lcd.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_lcd.c 2006-12-02 19:44:15 UTC (rev 691) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/palmtx_lcd.c 2006-12-03 13:46:39 UTC (rev 692) @@ -100,24 +100,13 @@ static int palmtx_lcd_suspend(struct device *dev, pm_message_t state) { - struct pm_save_data *save; - - if (!dev->power.saved_state) - dev->power.saved_state = kmalloc(sizeof(struct pm_save_data), GFP_KERNEL); - if (!dev->power.saved_state) - return -ENOMEM; - save = dev->power.saved_state; + palmtx_lcd_set_power(pxafb_lcd_device, FB_BLANK_UNBLANK); return 0; } static int palmtx_lcd_resume(struct device *dev) { - if (dev->power.saved_state) { - struct pm_save_data *save = dev->power.saved_state; - kfree(dev->power.saved_state); - dev->power.saved_state = NULL; - } - + palmtx_lcd_set_power(pxafb_lcd_device, FB_BLANK_POWERDOWN); return 0; } #endif Modified: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtx-gpio.h =================================================================== --- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtx-gpio.h 2006-12-02 19:44:15 UTC (rev 691) +++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtx-gpio.h 2006-12-03 13:46:39 UTC (rev 692) @@ -28,6 +28,7 @@ #define _INCLUDE_PALMTX_GPIO_H_ /* GPIOs */ +#define GPIO_NR_PALMTX_GPIO_RESET 1 #define GPIO_NR_PALMTX_POWER_DETECT 90 #define GPIO_NR_PALMTX_HOTSYNC_BUTTON_N 10 @@ -56,6 +57,7 @@ #define GPIO_NR_PALMTX_ICP_RXD 46 // Infrared receive pin #define GPIO_NR_PALMTX_ICP_TXD 47 // Infrared transmit pin +#define GPIO_NR_PALMTX_IR_DISABLE 40 // connected to SD pin of tranceiver (TFBS4710?) ? #define GPIO_NR_PALMTX_ICP_RXD_MD (GPIO_NR_PALMTX_ICP_RXD | GPIO_ALT_FN_1_IN) #define GPIO_NR_PALMTX_ICP_TXD_MD (GPIO_NR_PALMTX_ICP_TXD | GPIO_ALT_FN_2_OUT) @@ -75,4 +77,6 @@ #define IRQ_GPIO_PALMTX_USB_DETECT IRQ_GPIO(GPIO_NR_PALMTX_USB_DETECT) +#define IRQ_GPIO_PALMTX_GPIO_RESET IRQ_GPIO(GPIO_NR_PALMTX_GPIO_RESET) + #endif Modified: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtx-init.h =================================================================== --- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtx-init.h 2006-12-02 19:44:15 UTC (rev 691) +++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmtx-init.h 2006-12-03 13:46:39 UTC (rev 692) @@ -46,6 +46,11 @@ #define PALMTX_KM_COLS 3 +// TOUCHSCREEN + +#define AC97_LINK_FRAME 21 + + // BATTERY #define PALMTX_BAT_MAX_VOLTAGE 4000 // 3.99v current voltage at max charge as from Filez This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <far...@us...> - 2006-12-07 15:49:27
|
Revision: 695 http://svn.sourceforge.net/hackndev/?rev=695&view=rev Author: farcaller Date: 2006-12-07 07:49:20 -0800 (Thu, 07 Dec 2006) Log Message: ----------- l4p: new release of battchargemon Modified Paths: -------------- linux4palm/linux/trunk/drivers/misc/battchargemon.c linux4palm/linux/trunk/include/linux/battchargemon.h Modified: linux4palm/linux/trunk/drivers/misc/battchargemon.c =================================================================== --- linux4palm/linux/trunk/drivers/misc/battchargemon.c 2006-12-03 17:25:38 UTC (rev 694) +++ linux4palm/linux/trunk/drivers/misc/battchargemon.c 2006-12-07 15:49:20 UTC (rev 695) @@ -25,26 +25,43 @@ return sprintf(buf, "%s\n", bat->id); } +static ssize_t battery_show_charge(struct class_device *cdev, char *buf) { + int v_normalized, v_max_normalized, voltage, charge; + struct battery *bat = container_of(cdev, struct battery, class_dev); + voltage = bat->get_voltage(bat); + v_normalized = voltage - bat->min_voltage; + v_normalized = (v_normalized>0) ? v_normalized : 0; + v_max_normalized = bat->max_voltage - bat->min_voltage; + charge = v_normalized * 100 / v_max_normalized; + charge = (charge>0) ? (charge<100?charge:100) : 0; + return sprintf(buf, "%d%%\n", charge); +} + static ssize_t charger_show_id(struct class_device *cdev, char *buf) { struct charger *bat = container_of(cdev, struct charger, class_dev); return sprintf(buf, "%s\n", bat->id); } +static ssize_t battery_show_voltage(struct class_device *cdev, char *buf) { + struct battery *cl = container_of(cdev, struct battery, class_dev); + return sprintf(buf, "%d\n", cl->get_voltage(cl)); +} + +static ssize_t charger_show_status(struct class_device *cdev, char *buf) { + struct charger *cl = container_of(cdev, struct charger, class_dev); + return sprintf(buf, "%d\n", cl->get_status(cl)); +} + #define show_int_val(_class, _name) \ static ssize_t _class##_show_##_name(struct class_device *cdev, char *buf) { \ struct _class *cl = container_of(cdev, struct _class, class_dev); \ - if (cl->get_##_name) \ - return sprintf(buf, "%d\n", cl->get_##_name(cl)); \ - return 0; \ + return sprintf(buf, "%d\n", cl->_name); \ } show_int_val(battery, min_voltage); show_int_val(battery, max_voltage); -show_int_val(battery, voltage); -show_int_val(battery, current); +show_int_val(battery, v_current); show_int_val(battery, temp); -show_int_val(battery, charge); -show_int_val(charger, status); static struct class battery_class = { .name = "battery", @@ -68,7 +85,7 @@ static CLS_DEV_ATTR (battery, min_voltage, 0444, battery_show_min_voltage, NULL); static CLS_DEV_ATTR (battery, max_voltage, 0444, battery_show_max_voltage, NULL); static CLS_DEV_ATTR (battery, voltage, 0444, battery_show_voltage, NULL); -static CLS_DEV_ATTR (battery, current, 0444, battery_show_current, NULL); +static CLS_DEV_ATTR (battery, v_current, 0444, battery_show_v_current, NULL); static CLS_DEV_ATTR (battery, temp, 0444, battery_show_temp, NULL); static CLS_DEV_ATTR (battery, charge, 0444, battery_show_charge, NULL); @@ -78,12 +95,16 @@ /**** class registration ****/ #define create_entry_conditional(_name) \ -if(bat->get_##_name) \ - class_device_create_file(&bat->class_dev, &battery_class_device_attr_##_name); + if(bat->_name != -1) \ + class_device_create_file(&bat->class_dev, &battery_class_device_attr_##_name); int battery_class_register(struct battery *bat) { int rc = 0; + + // init list + bat->attached_chargers.next = &bat->attached_chargers; + bat->attached_chargers.prev = &bat->attached_chargers; WARN_ON(!bat->name); bat->class_dev.class = &battery_class; @@ -96,10 +117,17 @@ class_device_create_file(&bat->class_dev, &battery_class_device_attr_id); create_entry_conditional(min_voltage); create_entry_conditional(max_voltage); - create_entry_conditional(voltage); - create_entry_conditional(current); + create_entry_conditional(v_current); create_entry_conditional(temp); - create_entry_conditional(charge); + printk(KERN_ERR "\n\n\tBATT: gw = 0x%p\n", bat->get_voltage); + if(bat->get_voltage) { + class_device_create_file(&bat->class_dev, &battery_class_device_attr_voltage); + printk(KERN_ERR "BATT: adding voltage\n"); + if((bat->min_voltage != -1) && (bat->max_voltage != -1)) { + class_device_create_file(&bat->class_dev, &battery_class_device_attr_charge); + printk(KERN_ERR "BATT: and charge\n"); + } + } out: return rc; @@ -115,7 +143,6 @@ int charger_class_register(struct charger *cha) { int rc = 0; - WARN_ON(!cha->name); cha->class_dev.class = &charger_class; strcpy(cha->class_dev.class_id, cha->name); @@ -125,8 +152,7 @@ if(cha->id) class_device_create_file(&cha->class_dev, &charger_class_device_attr_id); - if(cha->get_status) - class_device_create_file(&cha->class_dev, &charger_class_device_attr_status); + class_device_create_file(&cha->class_dev, &charger_class_device_attr_status); out: return rc; @@ -139,13 +165,50 @@ } EXPORT_SYMBOL (charger_class_unregister); +/**** cherger attaching ****/ + +// FIXME: there's no way to attach one charger to two batteries using lists.h +// possible workarounds: implement own linked list? +int battery_attach_charger(struct battery *batt, struct charger *cha) +{ + // TODO: do we need to grab charger device driver here? it would be removed + // anyway in correctly written driver... + list_add(&cha->list, &batt->attached_chargers); + printk(KERN_ERR "BATT: Adding %s to %s chargers\n", cha->name, batt->name); + return 0; +} +EXPORT_SYMBOL(battery_attach_charger); + +int battery_remove_charger(struct battery *batt, struct charger *cha) +{ + list_del(&cha->list); + return 0; +} +EXPORT_SYMBOL(battery_remove_charger); + +void battery_update_charge_link(struct battery *batt) +{ + struct charger *cha; + sysfs_remove_link(&batt->class_dev.kobj, "charger"); + list_for_each_entry(cha, &batt->attached_chargers, list) { + printk(KERN_ERR "BATT: LL: %s = %d\n", cha->name, cha->get_status(cha)); + if(cha->get_status(cha)) { + sysfs_create_link(&batt->class_dev.kobj, &cha->class_dev.kobj, "charger"); + printk(KERN_ERR "BATT: LL: linked\n"); + return; + } + } +} +EXPORT_SYMBOL(battery_update_charge_link); + /**** module init/exit ****/ static int __init battcharge_class_init(void) { int ret = class_register(&battery_class); - if(likely(ret)) { - if(likely((ret = class_register(&charger_class)) == 0)) { + if(!ret) { + ret = class_register(&charger_class); + if(!ret) { return 0; } else { class_unregister(&battery_class); Modified: linux4palm/linux/trunk/include/linux/battchargemon.h =================================================================== --- linux4palm/linux/trunk/include/linux/battchargemon.h 2006-12-03 17:25:38 UTC (rev 694) +++ linux4palm/linux/trunk/include/linux/battchargemon.h 2006-12-07 15:49:20 UTC (rev 695) @@ -18,15 +18,16 @@ struct class_device class_dev; const char *name; char *id; - int (*get_min_voltage)(struct battery *); - int (*get_max_voltage)(struct battery *); - int (*get_voltage)(struct battery *); - int (*get_current)(struct battery *); + int min_voltage; + int max_voltage; + + int v_current; + int temp; - int (*get_temp)(struct battery *); + int (*get_voltage)(struct battery *); - int (*get_charge)(struct battery *); + struct list_head attached_chargers; }; struct charger { @@ -37,11 +38,19 @@ #define CHARGER_DISCONNECTED 0 #define CHARGER_CONNECTED 1 int (*get_status)(struct charger *); + + struct list_head list; }; extern int battery_class_register(struct battery *); extern void battery_class_unregister(struct battery *); +extern int charger_class_register(struct charger *); +extern void charger_class_unregister(struct charger *); +extern int battery_attach_charger(struct battery *batt, struct charger *cha); +extern int battery_remove_charger(struct battery *batt, struct charger *cha); +extern void battery_update_charge_link(struct battery *batt); + #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cri...@us...> - 2006-12-08 17:02:09
|
Revision: 696 http://svn.sourceforge.net/hackndev/?rev=696&view=rev Author: cristianop Date: 2006-12-08 09:01:58 -0800 (Fri, 08 Dec 2006) Log Message: ----------- l4p: fix gpe's no backlight problem (configuration of the backligth's driver data) Modified Paths: -------------- linux4palm/linux/trunk/drivers/video/backlight/pxapwm_bl.c linux4palm/linux/trunk/include/asm-arm/arch-pxa/pxapwm-bl.h Modified: linux4palm/linux/trunk/drivers/video/backlight/pxapwm_bl.c =================================================================== --- linux4palm/linux/trunk/drivers/video/backlight/pxapwm_bl.c 2006-12-07 15:49:20 UTC (rev 695) +++ linux4palm/linux/trunk/drivers/video/backlight/pxapwm_bl.c 2006-12-08 17:01:58 UTC (rev 696) @@ -31,9 +31,9 @@ intensity &= bl->limit_mask; // set intensity to 0 if in power saving or fb is blanked - if (bl->power != FB_BLANK_UNBLANK) + if (bl->dev->props->power != FB_BLANK_UNBLANK) intensity = 0; - if (bl->fb_blank != FB_BLANK_UNBLANK) + if (bl->dev->props->fb_blank != FB_BLANK_UNBLANK) intensity = 0; /* Does the backlight frequency need to be configured on a per device basis? @@ -60,6 +60,7 @@ } } + //printk("pxapwmbl: setting intensity to %d [bl->intensity = %d]\n", intensity, bl->intensity); switch (bl->pwm) { case 0: PWM_CTRL0 = prescaler; @@ -88,6 +89,9 @@ pxapwmbl_mach_turn_bl_off(); } } + + bl->dev->props->brightness = intensity; + bl->intensity=intensity; spin_unlock_irqrestore(&bl->lock, flags); } @@ -125,8 +129,9 @@ if (intensity < 0) intensity = 0; + pxapwmbl_send_intensity(bl, intensity); - bl->intensity=intensity; + return 0; } @@ -165,11 +170,13 @@ pxapwmbl_mach_turn_bl_on = bl->turn_bl_on; pxapwmbl_mach_turn_bl_off = bl->turn_bl_off; - bl->intensity = 0; bl->limit = 0; bl->lock = SPIN_LOCK_UNLOCKED; - - bl->power = FB_BLANK_UNBLANK; + + pxapwmbl_data.brightness = bl->default_intensity; + pxapwmbl_data.power = FB_BLANK_UNBLANK; + pxapwmbl_data.fb_blank = FB_BLANK_UNBLANK; + bl->off_threshold = 5; bl->dev = backlight_device_register ("pxapwm-bl", bl, &pxapwmbl_data); @@ -189,7 +196,7 @@ { struct pxapwmbl_platform_data *bl = pdev->dev.platform_data; - pxapwmbl_send_intensity(bl, 0); + pxapwmbl_send_intensity(bl, bl->default_intensity); backlight_device_unregister(bl->dev); Modified: linux4palm/linux/trunk/include/asm-arm/arch-pxa/pxapwm-bl.h =================================================================== --- linux4palm/linux/trunk/include/asm-arm/arch-pxa/pxapwm-bl.h 2006-12-07 15:49:20 UTC (rev 695) +++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/pxapwm-bl.h 2006-12-08 17:01:58 UTC (rev 696) @@ -29,8 +29,6 @@ int prescaler; int intensity; - int power; - int fb_blank; int limit; int off_threshold; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2007-01-02 00:25:56
|
Revision: 717 http://svn.sourceforge.net/hackndev/?rev=717&view=rev Author: marex_z71 Date: 2007-01-01 16:25:54 -0800 (Mon, 01 Jan 2007) Log Message: ----------- l4p: Some progress with LD wifi. I guess I can communicate with the chip and I can even upload firmware to it. Though, it wont init again after genesis mode so it?\194?\180s still no use... Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_pcmcia.c linux4palm/linux/trunk/drivers/net/wireless/hostap/hostap_cs.c linux4palm/linux/trunk/drivers/net/wireless/hostap/hostap_download.c linux4palm/linux/trunk/drivers/pcmcia/pxa2xx_base.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_pcmcia.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_pcmcia.c 2006-12-27 09:40:10 UTC (rev 716) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld_pcmcia.c 2007-01-02 00:25:54 UTC (rev 717) @@ -100,9 +100,13 @@ static struct pcmcia_low_level palmld_pcmcia_ops = { .owner = THIS_MODULE, - /* socket 1, since socket 0 is HDD */ - .first = 1, - .nr = 1, + /* Setting it this way makes pcmcia-cs + scream about memory-cs (because of + HDD/CF memory in socket 0), but it's + much nicer than make some weird changes + in pxa pcmcia subsystem */ + .first = 0, + .nr = 2, .hw_init = palmld_pcmcia_hw_init, .hw_shutdown = palmld_pcmcia_hw_shutdown, Modified: linux4palm/linux/trunk/drivers/net/wireless/hostap/hostap_cs.c =================================================================== --- linux4palm/linux/trunk/drivers/net/wireless/hostap/hostap_cs.c 2006-12-27 09:40:10 UTC (rev 716) +++ linux4palm/linux/trunk/drivers/net/wireless/hostap/hostap_cs.c 2007-01-02 00:25:54 UTC (rev 717) @@ -842,6 +842,7 @@ PCMCIA_DEVICE_MANF_CARD(0x028a, 0x0002), PCMCIA_DEVICE_MANF_CARD(0x02aa, 0x0002), PCMCIA_DEVICE_MANF_CARD(0x02d2, 0x0001), + PCMCIA_DEVICE_MANF_CARD(0x02db, 0x8103), // SyChip WLAN6061EB PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x0001), PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x7300), PCMCIA_DEVICE_MANF_CARD(0xc00f, 0x0000), Modified: linux4palm/linux/trunk/drivers/net/wireless/hostap/hostap_download.c =================================================================== --- linux4palm/linux/trunk/drivers/net/wireless/hostap/hostap_download.c 2006-12-27 09:40:10 UTC (rev 716) +++ linux4palm/linux/trunk/drivers/net/wireless/hostap/hostap_download.c 2007-01-02 00:25:54 UTC (rev 717) @@ -107,7 +107,10 @@ } } #else /* PRISM2_PCI */ - HFA384X_INSW(HFA384X_AUXDATA_OFF, buf, len / 2); +/* HFA384X_INSW(HFA384X_AUXDATA_OFF, buf, len / 2);*/ + HFA384X_INSW(HFA384X_AUXDATA_OFF, buf, len); + /* Removing that "/ 2" lets readback test pass. + That can point to bad memory/chip configuration. */ #endif /* PRISM2_PCI */ return 0; @@ -138,7 +141,10 @@ } } #else /* PRISM2_PCI */ - HFA384X_OUTSW(HFA384X_AUXDATA_OFF, buf, len / 2); +/* HFA384X_OUTSW(HFA384X_AUXDATA_OFF, buf, len / 2);*/ + HFA384X_OUTSW(HFA384X_AUXDATA_OFF, buf, len); + /* Removing that "/ 2" lets readback test pass. + That can point to bad memory/chip configuration. */ #endif /* PRISM2_PCI */ return 0; Modified: linux4palm/linux/trunk/drivers/pcmcia/pxa2xx_base.c =================================================================== --- linux4palm/linux/trunk/drivers/pcmcia/pxa2xx_base.c 2006-12-27 09:40:10 UTC (rev 716) +++ linux4palm/linux/trunk/drivers/pcmcia/pxa2xx_base.c 2007-01-02 00:25:54 UTC (rev 717) @@ -197,8 +197,6 @@ MECR |= MECR_CIT; /* Set MECR:NOS (Number Of Sockets) */ - /* Use (nr > 0) on Palm LifeDrive to get WiFi - chip detected */ if (nr > 1) MECR |= MECR_NOS; else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bob...@us...> - 2007-01-04 04:11:43
|
Revision: 719 http://svn.sourceforge.net/hackndev/?rev=719&view=rev Author: bobofdoom Date: 2007-01-03 20:11:41 -0800 (Wed, 03 Jan 2007) Log Message: ----------- t650: Fixed keyboard support. Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/configs/palmt650_defconfig linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/palmt650.c linux4palm/linux/trunk/drivers/input/keyboard/pxa27x_keyboard.c Modified: linux4palm/linux/trunk/arch/arm/configs/palmt650_defconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/configs/palmt650_defconfig 2007-01-04 03:48:05 UTC (rev 718) +++ linux4palm/linux/trunk/arch/arm/configs/palmt650_defconfig 2007-01-04 04:11:41 UTC (rev 719) @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.17-hnd0 -# Thu Jan 4 14:41:44 2007 +# Thu Jan 4 15:10:28 2007 # CONFIG_ARM=y CONFIG_MMU=y @@ -848,7 +848,7 @@ # MMC/SD Card support # CONFIG_MMC=y -CONFIG_MMC_DEBUG=y +# CONFIG_MMC_DEBUG is not set CONFIG_MMC_BLOCK=y CONFIG_MMC_PXA=y # CONFIG_MMC_TMIO is not set Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/palmt650.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/palmt650.c 2007-01-04 03:48:05 UTC (rev 718) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmt650/palmt650.c 2007-01-04 04:11:41 UTC (rev 719) @@ -274,7 +274,7 @@ }; static struct platform_device palmt650_kbd = { - .name = "pxa27x-keypad", + .name = "pxa27x-keyboard", .dev = { .platform_data = &palmt650_kbd_data, }, Modified: linux4palm/linux/trunk/drivers/input/keyboard/pxa27x_keyboard.c =================================================================== --- linux4palm/linux/trunk/drivers/input/keyboard/pxa27x_keyboard.c 2007-01-04 03:48:05 UTC (rev 718) +++ linux4palm/linux/trunk/drivers/input/keyboard/pxa27x_keyboard.c 2007-01-04 04:11:41 UTC (rev 719) @@ -110,7 +110,7 @@ } KPC |= KPC_ME; /* matrix keypad enabled */ - KPC |= KPC_ME; /* matrix keypad interrupt enabled */ + KPC |= KPC_MIE; /* matrix keypad interrupt enabled */ return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bob...@us...> - 2007-01-07 15:19:52
|
Revision: 727 http://svn.sourceforge.net/hackndev/?rev=727&view=rev Author: bobofdoom Date: 2007-01-07 07:19:50 -0800 (Sun, 07 Jan 2007) Log Message: ----------- palmt680: Added initial code based on Treo 650 port. Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/Kconfig linux4palm/linux/trunk/arch/arm/mach-pxa/Makefile Added Paths: ----------- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmt680-gpio.h Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/Kconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/Kconfig 2007-01-07 15:19:15 UTC (rev 726) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/Kconfig 2007-01-07 15:19:50 UTC (rev 727) @@ -43,6 +43,7 @@ source "arch/arm/mach-pxa/rover/Kconfig" source "arch/arm/mach-pxa/palmld/Kconfig" source "arch/arm/mach-pxa/palmt650/Kconfig" +source "arch/arm/mach-pxa/palmt680/Kconfig" source "arch/arm/mach-pxa/palmte2/Kconfig" source "arch/arm/mach-pxa/palmt3/Kconfig" source "arch/arm/mach-pxa/palmt5/Kconfig" Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/Makefile =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/Makefile 2007-01-07 15:19:15 UTC (rev 726) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/Makefile 2007-01-07 15:19:50 UTC (rev 727) @@ -40,6 +40,7 @@ obj-y += rover/ obj-$(CONFIG_MACH_XSCALE_PALMLD) += palmld/ obj-$(CONFIG_MACH_XSCALE_PALMTREO650) += palmt650/ +obj-$(CONFIG_MACH_XSCALE_PALMTREO680) += palmt650/ obj-$(CONFIG_MACH_T3XSCALE) += ssp.o palmt3/ obj-$(CONFIG_MACH_XSCALE_PALMTT5) += palmt5/ obj-$(CONFIG_MACH_XSCALE_PALMTX) += palmtx/ Added: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmt680-gpio.h =================================================================== --- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmt680-gpio.h (rev 0) +++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmt680-gpio.h 2007-01-07 15:19:50 UTC (rev 727) @@ -0,0 +1,103 @@ +/* + * include/asm-arm/arch-pxa/palmt680-gpio.h + * + */ + +#ifndef _PALMT680_GPIO_H_ +#define _PALMT680_GPIO_H_ + +#include <asm/arch/pxa-regs.h> + +/* IO mappings */ +#define PALMT680_ASIC6_PHYS (PXA_CS2_PHYS) +#define PALMT680_ASIC6_VIRT (0xf0000000) +#define PALMT680_ASIC6_SIZE (0x00100000) + +/* ASIC 6 registers */ +#define __REG16(x) (*((volatile u16 *)io_p2v(x))) +#define ASIC6_LED0_TBS __REG16(0x08000080) +#define ASIC6_LED0_U1 __REG16(0x08000082) /* unknown=0 */ +#define ASIC6_LED0_PERIOD __REG16(0x08000084) +#define ASIC6_LED0_U2 __REG16(0x08000086) /* unknown=3 */ +#define ASIC6_LED0_DUTY __REG16(0x08000088) +#define ASIC6_LED0_AUTOSTOP __REG16(0x0800008a) +#define ASIC6_LED1_TBS __REG16(0x08000090) +#define ASIC6_LED1_PERIOD __REG16(0x08000094) +#define ASIC6_LED1_DUTY __REG16(0x08000098) +#define ASIC6_LED1_AUTOSTOP __REG16(0x0800009a) +#define ASIC6_LED2_TBS __REG16(0x080000a0) +#define ASIC6_LED2_PERIOD __REG16(0x080000a4) +#define ASIC6_LED2_DUTY __REG16(0x080000a8) +#define ASIC6_LED2_AUTOSTOP __REG16(0x080000aa) + +/* Palm Treo 680 GPIOs */ +/* FIXME: these values are currently from 650. They will probably be + * different for the 680. */ +#define GPIO_NR_PALMT680_POWER_DETECT 15 +#define GPIO_NR_PALMT680_VIBRATE_EN 26 +#define GPIO_NR_PALMT680_SILENT_SWITCH 33 +#define GPIO_NR_PALMT680_WM9712_IRQ 90 +#define GPIO_NR_PALMT680_SD_DETECT_N 113 /* SD card inserted; RE FE; Input */ + +#define GPIO_NR_PALMT680_KP_MKIN0 100 +#define GPIO_NR_PALMT680_KP_MKIN1 101 +#define GPIO_NR_PALMT680_KP_MKIN2 102 +#define GPIO_NR_PALMT680_KP_MKIN3 97 +#define GPIO_NR_PALMT680_KP_MKIN4 98 +#define GPIO_NR_PALMT680_KP_MKIN5 99 +#define GPIO_NR_PALMT680_KP_MKIN6 17 +#define GPIO_NR_PALMT680_KP_MKIN7 13 + +#define GPIO_NR_PALMT680_KP_MKOUT0 103 +#define GPIO_NR_PALMT680_KP_MKOUT1 104 +#define GPIO_NR_PALMT680_KP_MKOUT2 105 +#define GPIO_NR_PALMT680_KP_MKOUT3 106 +#define GPIO_NR_PALMT680_KP_MKOUT4 107 +#define GPIO_NR_PALMT680_KP_MKOUT5 108 +#define GPIO_NR_PALMT680_KP_MKOUT6 40 + +#define IRQ_GPIO_PALMT680_SD_DETECT_N IRQ_GPIO(GPIO_NR_PALMT680_SD_DETECT_N) +#define IRQ_GPIO_PALMT680_WM9712_IRQ IRQ_GPIO(GPIO_NR_PALMT680_WM9712_IRQ) + +#define GPIO_NR_PALMT680_KP_MKIN0_MD (GPIO_NR_PALMT680_KP_MKIN0 | GPIO_ALT_FN_1_IN) +#define GPIO_NR_PALMT680_KP_MKIN1_MD (GPIO_NR_PALMT680_KP_MKIN1 | GPIO_ALT_FN_1_IN) +#define GPIO_NR_PALMT680_KP_MKIN2_MD (GPIO_NR_PALMT680_KP_MKIN2 | GPIO_ALT_FN_1_IN) +#define GPIO_NR_PALMT680_KP_MKIN3_MD (GPIO_NR_PALMT680_KP_MKIN3 | GPIO_ALT_FN_3_IN) +#define GPIO_NR_PALMT680_KP_MKIN4_MD (GPIO_NR_PALMT680_KP_MKIN4 | GPIO_ALT_FN_3_IN) +#define GPIO_NR_PALMT680_KP_MKIN5_MD (GPIO_NR_PALMT680_KP_MKIN5 | GPIO_ALT_FN_3_IN) +#define GPIO_NR_PALMT680_KP_MKIN6_MD (GPIO_NR_PALMT680_KP_MKIN6 | GPIO_ALT_FN_1_IN) +#define GPIO_NR_PALMT680_KP_MKIN7_MD (GPIO_NR_PALMT680_KP_MKIN7 | GPIO_ALT_FN_3_IN) + +#define GPIO_NR_PALMT680_KP_MKOUT0_MD (GPIO_NR_PALMT680_KP_MKOUT0 | GPIO_ALT_FN_2_OUT) +#define GPIO_NR_PALMT680_KP_MKOUT1_MD (GPIO_NR_PALMT680_KP_MKOUT1 | GPIO_ALT_FN_2_OUT) +#define GPIO_NR_PALMT680_KP_MKOUT2_MD (GPIO_NR_PALMT680_KP_MKOUT2 | GPIO_ALT_FN_2_OUT) +#define GPIO_NR_PALMT680_KP_MKOUT3_MD (GPIO_NR_PALMT680_KP_MKOUT3 | GPIO_ALT_FN_2_OUT) +#define GPIO_NR_PALMT680_KP_MKOUT4_MD (GPIO_NR_PALMT680_KP_MKOUT4 | GPIO_ALT_FN_2_OUT) +#define GPIO_NR_PALMT680_KP_MKOUT5_MD (GPIO_NR_PALMT680_KP_MKOUT5 | GPIO_ALT_FN_2_OUT) +#define GPIO_NR_PALMT680_KP_MKOUT6_MD (GPIO_NR_PALMT680_KP_MKOUT6 | GPIO_ALT_FN_1_OUT) + +/* Utility macros */ +#define GET_PALMT680_GPIO(gpio) \ + (GPLR(GPIO_NR_PALMT680_ ## gpio) & GPIO_bit(GPIO_NR_PALMT680_ ## gpio)) + +#define SET_PALMT680_GPIO(gpio, setp) \ +do { \ +if (setp) \ + GPSR(GPIO_NR_PALMT680_ ## gpio) = GPIO_bit(GPIO_NR_PALMT680_ ## gpio); \ +else \ + GPCR(GPIO_NR_PALMT680_ ## gpio) = GPIO_bit(GPIO_NR_PALMT680_ ## gpio); \ +} while (0) + +#define SET_PALMT680_GPIO_N(gpio, setp) \ +do { \ +if (setp) \ + GPCR(GPIO_NR_PALMT680_ ## gpio) = GPIO_bit(GPIO_NR_PALMT680_ ## gpio); \ +else \ + GPSR(GPIO_NR_PALMT680_ ## gpio) = GPIO_bit(GPIO_NR_PALMT680_ ## gpio); \ +} while (0) + + +#define GET_GPIO(gpio) (GPLR(gpio) & GPIO_bit(gpio)) + + +#endif /* _PALMT680_GPIO_H_ */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2007-02-09 23:33:56
|
Revision: 801 http://svn.sourceforge.net/hackndev/?rev=801&view=rev Author: marex_z71 Date: 2007-02-09 15:33:53 -0800 (Fri, 09 Feb 2007) Log Message: ----------- l4p: PalmLD IrDA support - seems to work quite well Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/configs/palmld_defconfig linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-gpio.h Modified: linux4palm/linux/trunk/arch/arm/configs/palmld_defconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/configs/palmld_defconfig 2007-02-09 19:52:41 UTC (rev 800) +++ linux4palm/linux/trunk/arch/arm/configs/palmld_defconfig 2007-02-09 23:33:53 UTC (rev 801) @@ -389,7 +389,7 @@ # # FIR device drivers # -# CONFIG_PXA_FICP is not set +CONFIG_PXA_FICP=m CONFIG_BT=m CONFIG_BT_L2CAP=m CONFIG_BT_SCO=m Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c 2007-02-09 19:52:41 UTC (rev 800) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c 2007-02-09 23:33:53 UTC (rev 801) @@ -13,6 +13,7 @@ #include <linux/platform_device.h> #include <linux/fb.h> #include <linux/input.h> +#include <linux/delay.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> @@ -23,6 +24,7 @@ #include <asm/arch/mmc.h> #include <asm/arch/pxafb.h> #include <asm/arch/pxa-regs.h> +#include <asm/arch/irda.h> #include <asm/arch/palmld-gpio.h> #include <asm/arch/pxa27x_keyboard.h> #include <asm/arch/pxapwm-bl.h> @@ -118,81 +120,39 @@ * IRDA */ -/* Uncomment the following line to get serial console via SIR work from - * the very early booting stage. This is not useful for end-user. - */ -// #define EARLY_SIR_CONSOLE - -#define IR_TRANSCEIVER_ON \ - SET_HX4700_GPIO_N(IR_ON, 1) - -#define IR_TRANSCEIVER_OFF \ - SET_HX4700_GPIO_N(IR_ON, 0) - - -static void -palmld_irda_configure (struct uart_pxa_port *up, int enable) +static void palmld_irda_transceiver_mode(struct device *dev, int mode) { - /* Switch STUART RX/TX pins to SIR */ - pxa_gpio_mode( GPIO_NR_PALMLD_STD_RXD_MD ); - pxa_gpio_mode( GPIO_NR_PALMLD_STD_TXD_MD ); + unsigned long flags; - /* make sure FIR ICP is off */ - ICCR0 = 0; + local_irq_save(flags); - if (enable) { - /* configure STUART to for SIR */ - STISR = STISR_XMODE | STISR_RCVEIR | STISR_RXPL; - //IR_TRANSCEIVER_ON; - } else { - STISR = 0; - //IR_TRANSCEIVER_OFF; - } -} + if (mode & IR_SIRMODE){ + printk (KERN_INFO "palmld_irda: setting mode to SIR\n"); + } + else if (mode & IR_FIRMODE){ + printk (KERN_INFO "palmld_irda: setting mode to FIR\n"); + } + if (mode & IR_OFF){ + printk (KERN_INFO "palmld_irda: turning tranceiver OFF\n"); + SET_PALMLD_GPIO(IR_DISABLE, 1); + } + else { + printk (KERN_INFO "palmld_irda: turning tranceiver ON\n"); + SET_PALMLD_GPIO(IR_DISABLE, 0); + SET_PALMLD_GPIO(ICP_TXD_MD, 1); + mdelay(30); + SET_PALMLD_GPIO(ICP_TXD_MD, 0); + } -static void -palmld_irda_set_txrx (struct uart_pxa_port *up, int txrx) -{ - unsigned old_stisr = STISR; - unsigned new_stisr = old_stisr; - - if (txrx & PXA_SERIAL_TX) { - /* Ignore RX if TX is set */ - txrx &= PXA_SERIAL_TX; - new_stisr |= STISR_XMITIR; - } else - new_stisr &= ~STISR_XMITIR; - - if (txrx & PXA_SERIAL_RX) - new_stisr |= STISR_RCVEIR; - else - new_stisr &= ~STISR_RCVEIR; - - if (new_stisr != old_stisr) { - while (!(STLSR & LSR_TEMT)) - ; - //IR_TRANSCEIVER_OFF; - STISR = new_stisr; - //IR_TRANSCEIVER_ON; - } + local_irq_restore(flags); } -static int -palmld_irda_get_txrx (struct uart_pxa_port *up) -{ - return ((STISR & STISR_XMITIR) ? PXA_SERIAL_TX : 0) | - ((STISR & STISR_RCVEIR) ? PXA_SERIAL_RX : 0); -} - - -static struct platform_pxa_serial_funcs palmld_pxa_irda_funcs = { - .configure = palmld_irda_configure, - .set_txrx = palmld_irda_set_txrx, - .get_txrx = palmld_irda_get_txrx, +static struct pxaficp_platform_data palmld_ficp_platform_data = { + .transceiver_cap = IR_SIRMODE | IR_FIRMODE | IR_OFF, + .transceiver_mode = palmld_irda_transceiver_mode, }; - /* platform */ /* @@ -369,12 +329,7 @@ set_pxa_fb_info( &palmld_lcd ); pxa_set_mci_info( &palmld_mci_platform_data ); platform_add_devices( devices, ARRAY_SIZE(devices) ); - - stuart_device.dev.platform_data = &palmld_pxa_irda_funcs; -#ifdef EARLY_SIR_CONSOLE - palmld_irda_configure (NULL, 1); - palmld_irda_set_txrx (NULL, PXA_SERIAL_TX); -#endif + pxa_set_ficp_info( &palmld_ficp_platform_data ); } MACHINE_START(XSCALE_PALMLD, "Palm LifeDrive") Modified: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-gpio.h =================================================================== --- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-gpio.h 2007-02-09 19:52:41 UTC (rev 800) +++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-gpio.h 2007-02-09 23:33:53 UTC (rev 801) @@ -21,6 +21,7 @@ /* Palm LifeDrive GPIOs */ +#define GPIO_NR_PALMLD_GPIO_RESET 1 #define GPIO_NR_PALMLD_USB_DETECT 3 #define GPIO_NR_PALMLD_POWER_DETECT 4 #define GPIO_NR_PALMLD_HOTSYNC_BUTTON_N 10 @@ -31,8 +32,9 @@ #define GPIO_NR_PALMLD_WM9712_IRQ 27 -#define GPIO_NR_PALMLD_STD_RXD 46 /* IRDA */ -#define GPIO_NR_PALMLD_STD_TXD 47 +#define GPIO_NR_PALMLD_IR_DISABLE 40 /* IRDA */ +#define GPIO_NR_PALMLD_ICP_RXD 46 +#define GPIO_NR_PALMLD_ICP_TXD 47 #define GPIO_NR_PALMLD_GREEN_LED 52 @@ -52,18 +54,19 @@ #define GPIO_NR_PALMLD_IDE_PWEN 115 -#define GPIO_NR_PALMLD_STD_RXD_MD (GPIO_NR_PALMLD_STD_RXD | GPIO_ALT_FN_2_IN) -#define GPIO_NR_PALMLD_STD_TXD_MD (GPIO_NR_PALMLD_STD_TXD | GPIO_ALT_FN_1_OUT) - #define GPIO_NR_PALMLD_KP_MKIN3_MD (GPIO_NR_PALMLD_KP_MKIN3 | GPIO_ALT_FN_3_IN) #define GPIO_NR_PALMLD_KP_MKIN0_MD (GPIO_NR_PALMLD_KP_MKIN0 | GPIO_ALT_FN_1_IN) #define GPIO_NR_PALMLD_KP_MKIN1_MD (GPIO_NR_PALMLD_KP_MKIN1 | GPIO_ALT_FN_1_IN) #define GPIO_NR_PALMLD_KP_MKIN2_MD (GPIO_NR_PALMLD_KP_MKIN2 | GPIO_ALT_FN_1_IN) -#define GPIO_NR_PALMLD_KP_MKOUT0_MD (GPIO_NR_PALMLD_KP_MKOUT0 | GPIO_ALT_FN_2_OUT) -#define GPIO_NR_PALMLD_KP_MKOUT1_MD (GPIO_NR_PALMLD_KP_MKOUT1 | GPIO_ALT_FN_2_OUT) -#define GPIO_NR_PALMLD_KP_MKOUT2_MD (GPIO_NR_PALMLD_KP_MKOUT2 | GPIO_ALT_FN_2_OUT) +#define GPIO_NR_PALMLD_KP_MKOUT0_MD (GPIO_NR_PALMLD_KP_MKOUT0 | GPIO_ALT_FN_2_OUT) +#define GPIO_NR_PALMLD_KP_MKOUT1_MD (GPIO_NR_PALMLD_KP_MKOUT1 | GPIO_ALT_FN_2_OUT) +#define GPIO_NR_PALMLD_KP_MKOUT2_MD (GPIO_NR_PALMLD_KP_MKOUT2 | GPIO_ALT_FN_2_OUT) +#define GPIO_NR_PALMLD_ICP_RXD_MD (GPIO_NR_PALMLD_ICP_RXD | GPIO_ALT_FN_1_IN) +#define GPIO_NR_PALMLD_ICP_TXD_MD (GPIO_NR_PALMLD_ICP_TXD | GPIO_ALT_FN_2_OUT) + +#define IRQ_GPIO_PALMLD_GPIO_RESET IRQ_GPIO(GPIO_NR_PALMLD_GPIO_RESET) #define IRQ_GPIO_PALMLD_SD_DETECT_N IRQ_GPIO(GPIO_NR_PALMLD_SD_DETECT_N) #define IRQ_GPIO_PALMLD_WM9712_IRQ IRQ_GPIO(GPIO_NR_PALMLD_WM9712_IRQ) #define IRQ_GPIO_PALMLD_IDE_IRQ IRQ_GPIO(GPIO_NR_PALMLD_IDE_IRQ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2007-02-18 12:43:14
|
Revision: 847 http://svn.sourceforge.net/hackndev/?rev=847&view=rev Author: marex_z71 Date: 2007-02-18 04:43:11 -0800 (Sun, 18 Feb 2007) Log Message: ----------- K2-6-20-hnd0: Sync with 2.6.20-hh from 02/18/2007 13:35 GMT+1 ;minor fixes Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/aximx50/Kconfig linux4palm/linux/trunk/arch/arm/mach-pxa/aximx50/aximx50_ts.c linux4palm/linux/trunk/arch/arm/mach-pxa/magician/magician_cpld.c linux4palm/linux/trunk/arch/arm/mach-pxa/magician/magician_ts.c linux4palm/linux/trunk/drivers/hwmon/battery/Kconfig linux4palm/linux/trunk/drivers/hwmon/battery/ds2760_battery.c linux4palm/linux/trunk/drivers/hwmon/battery/magician-battery.c linux4palm/linux/trunk/drivers/input/touchscreen/ts-adc-debounce.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/aximx50/Kconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/aximx50/Kconfig 2007-02-18 12:30:02 UTC (rev 846) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/aximx50/Kconfig 2007-02-18 12:43:11 UTC (rev 847) @@ -24,7 +24,7 @@ config X50_TS tristate "ADS7846 / TSC2046 touchscreen support" depends on MACH_X50 - select TOUCHSCREEN_ADS7846_SSP + select TOUCHSCREEN_ADC_DEBOUNCE help X50/X51(v) touchscreen support. Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/aximx50/aximx50_ts.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/aximx50/aximx50_ts.c 2007-02-18 12:30:02 UTC (rev 846) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/aximx50/aximx50_ts.c 2007-02-18 12:43:11 UTC (rev 847) @@ -14,7 +14,7 @@ #include <linux/platform_device.h> #include <linux/delay.h> #include <linux/ads7846.h> -#include <linux/ads7846ts.h> +#include <linux/touchscreen-adc.h> #include <asm/irq.h> #include <asm/mach-types.h> #include <asm/hardware.h> @@ -39,8 +39,10 @@ }; struct ads7846ts_ssp_platform_data aximx50_ts_params = { - .irq = IRQ_GPIO(GPIO_NR_X50_PEN_IRQ_N), - .gpio = GPIO_NR_X50_PEN_IRQ_N, + .pen_irq = IRQ_GPIO(GPIO_NR_X50_PEN_IRQ_N), + .pen_gpio = GPIO_NR_X50_PEN_IRQ_N, + .adc_dev = &ads7846_ssp.dev, + .sense = ads7846_sense, }; static struct platform_device aximx50_ts = { .name = "ads7846ts-ssp", Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/magician/magician_cpld.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/magician/magician_cpld.c 2007-02-18 12:30:02 UTC (rev 846) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/magician/magician_cpld.c 2007-02-18 12:43:11 UTC (rev 847) @@ -281,7 +281,7 @@ dbg ("EP\nep_state = 0x%02x\n", cpld->mapping->cpld18); break; case 0x4: - dbg ("BT\n", cable_state); + dbg ("BT\n"); break; case 0x8: dbg ("AC\ncable_state = 0x%02x\n", cable_state); Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/magician/magician_ts.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/magician/magician_ts.c 2007-02-18 12:30:02 UTC (rev 846) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/magician/magician_ts.c 2007-02-18 12:43:11 UTC (rev 847) @@ -717,21 +717,6 @@ .get_charge = get_charge, .get_status = get_status, }; - -static int -battery_class_uevent(struct class_device *dev, char **envp, int num_envp, - char *buffer, int buffer_size) -{ - return 0; -} - -static void battery_class_release(struct class_device *dev) -{ -} - -static void battery_class_class_release(struct class *class) -{ -} #endif static int tssim_init(void) @@ -761,10 +746,6 @@ "magician_ts: Could not register battery class\n"); } else { battery_class = 1; - magician_power.class_dev.class->uevent = battery_class_uevent; - magician_power.class_dev.class->release = battery_class_release; - magician_power.class_dev.class->class_release = - battery_class_class_release; } #endif Modified: linux4palm/linux/trunk/drivers/hwmon/battery/Kconfig =================================================================== --- linux4palm/linux/trunk/drivers/hwmon/battery/Kconfig 2007-02-18 12:30:02 UTC (rev 846) +++ linux4palm/linux/trunk/drivers/hwmon/battery/Kconfig 2007-02-18 12:43:11 UTC (rev 847) @@ -26,8 +26,7 @@ config MAGICIAN_BATTERY tristate "HTC Magician battery control" - depends on MACH_MAGICIAN && BATTERY_MONITOR - select W1_DS2760 + depends on MACH_MAGICIAN && DS2760_BATTERY help Say Y here to enable support for HTC Magician battery control. Modified: linux4palm/linux/trunk/drivers/hwmon/battery/ds2760_battery.c =================================================================== --- linux4palm/linux/trunk/drivers/hwmon/battery/ds2760_battery.c 2007-02-18 12:30:02 UTC (rev 846) +++ linux4palm/linux/trunk/drivers/hwmon/battery/ds2760_battery.c 2007-02-18 12:43:11 UTC (rev 847) @@ -197,7 +197,6 @@ acr[0] = (di->status.full_active_mAh * 4) >> 8; acr[1] = (di->status.full_active_mAh * 4) & 0xff; -printk(KERN_ERR "writing %d to ACR\n", di->status.full_active); if (w1_ds2760_write(di->w1_dev, acr, DS2760_CURRENT_ACCUM_MSB, 2) < 2) printk(KERN_ERR "ACR reset failed\n"); Modified: linux4palm/linux/trunk/drivers/hwmon/battery/magician-battery.c =================================================================== --- linux4palm/linux/trunk/drivers/hwmon/battery/magician-battery.c 2007-02-18 12:30:02 UTC (rev 846) +++ linux4palm/linux/trunk/drivers/hwmon/battery/magician-battery.c 2007-02-18 12:43:11 UTC (rev 847) @@ -1,542 +1,208 @@ /* - * Battery driver lowlevel interface for HTC Magician + * Battery driver for HTC Magician * - * Copyright (c) 2006 Philipp Zabel - * 2004 Matt Reimer - * 2004 Szabolcs Gyurko + * Copyright 2007 Philipp Zabel <phi...@gm...> + * Copyright 2007 Anton Vorontsov <cb...@ma...> + * Copyright 2005 SDG Systems, LLC + * Copyright 2005 Aric D. Blumer + * Copyright 2005 Phil Blundell * - * Use consistent with the GNU GPL is permitted, - * provided that this copyright notice is - * preserved in its entirety in all copies and derived works. + * 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. * - * Author: Philipp Zabel <phi...@gm...> - * December 2006 - * - * Matt Reimer <mr...@vp...> - * April 2004, 2005 - * - * Szabolcs Gyurko <sza...@tl...> - * September 2004 - * - * To do: - * - * - While suspended, periodically check for battery full and update - * the LED status. - * - Should we turn off the charger GPIO when the battery is full? - * - Is the battery status caching necessary? + * History: + * 2007/02/14 Anton Vorontsov Use ds2760_battery driver, cleanup */ #include <linux/module.h> -#include <linux/version.h> -//#include <linux/init.h> -//#include <linux/fs.h> -#include <linux/interrupt.h> /* request_irq */ -//#include <linux/sched.h> -//#include <linux/pm.h> -//#include <linux/sysctl.h> -//#include <linux/proc_fs.h> -#include <linux/delay.h> -#include <linux/jiffies.h> #include <linux/platform_device.h> -#include <linux/battery.h> +#include <linux/timer.h> +#include <linux/pm.h> +#include <linux/irq.h> +#include <linux/interrupt.h> #include <linux/leds.h> - -//#include <asm/io.h> -#include <asm/irq.h> /* IRQF..., IRQT... */ +#include <linux/ds2760_battery.h> +#include <asm/mach-types.h> +#include <asm/hardware.h> #include <asm/apm.h> -#include <asm/arch/hardware.h> /* __REG */ -#include <asm/arch/pxa-regs.h> /* pxa GPIOs */ -#include <asm/arch/magician.h> /* magician specific GPIOs */ -#include <asm/arch/magician_cpld.h> /* magician_cable_state() */ +#include <asm/gpio.h> +#include <asm/arch/magician.h> +#include <asm/arch/magician_cpld.h> -#include "../../w1/w1.h" -#include "../../w1/slaves/w1_ds2760.h" +#define DRIVER_NAME "magician_power" -extern struct platform_device magician_cpld; +#define POWER_NONE 0 +#define POWER_AC 1 +#define POWER_USB 2 -#define MAGICIAN_BATTERY_MAX_VOLTAGE 4400 /* My measurements */ -#define MAGICIAN_BATTERY_MIN_VOLTAGE 0 /* Maybe incorrect */ -#define MAGICIAN_BATTERY_MAX_CURRENT 950 /* MUST BE MEASURED */ -#define MAGICIAN_BATTERY_MIN_CURRENT -950 /* Maybe incorrect */ -#define MAGICIAN_BATTERY_MIN_CHARGE 0 /* Maybe incorrect */ +static struct ds2760_device_info ds2760_di; +static int supply_status; +static unsigned int ac_irq; +struct timer_list isr_timer; -#define BATTERY_CHECK_INTERVAL (HZ * 60) /* every 60 seconds */ +DEFINE_LED_TRIGGER(charging_trig); +DEFINE_LED_TRIGGER(chargefull_trig); -#define POWER_NONE 0 -#define POWER_AC 1 +extern struct platform_device magician_cpld; -/* AC present? */ -static int power_status; - -/* w1_samcop device */ -static struct workqueue_struct *probe_q; -static struct work_struct probe_work; - -/* DS2760 device */ -struct device *ds2760_dev = NULL; - -/* Cache the battery status for this many seconds. */ -#define STATUS_CACHE_TIME (HZ * 1) -static struct ds2760_status battery_status; - -static int battery_charge_state; -#define BATTERY_STATE_UNKNOWN 0 -#define BATTERY_DISCHARGING 1 -#define BATTERY_CHARGING 2 -#define BATTERY_FULL 3 - -/* battery monitor */ -static struct timer_list monitor_timer; -static struct workqueue_struct *monitor_q; -static struct work_struct monitor_work; - -#if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE) -/* original APM hook */ -static void (*apm_get_power_status_orig)(struct apm_power_info *info); -#endif - -DEFINE_LED_TRIGGER(magician_charge_led_trigger) -DEFINE_LED_TRIGGER(magician_charge_full_led_trigger) - -magician_battery_read_status(void) +static void magician_update_leds(struct ds2760_device_info *di) { - if (jiffies < (battery_status.update_time + STATUS_CACHE_TIME)) - return 0; - - if (!ds2760_dev) - return 0; - - if (!w1_ds2760_status(ds2760_dev, &battery_status)) { - printk("call to w1_ds2760_status failed (0x%08x)\n", - (unsigned int)ds2760_dev); - return 1; + if (supply_status) { + if (di->charge_status == BATTERY_STATUS_FULL) { + led_trigger_event(chargefull_trig, LED_FULL); + led_trigger_event(charging_trig, LED_OFF); + return; + } + else if (di->charge_status == BATTERY_STATUS_CHARGING) { + led_trigger_event(chargefull_trig, LED_FULL); + led_trigger_event(charging_trig, LED_FULL); + return; + } } - - return 0; + led_trigger_event(chargefull_trig, LED_OFF); + led_trigger_event(charging_trig, LED_OFF); } -#if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE) -static void -magician_apm_get_power_status (struct apm_power_info *info) -{ - magician_battery_read_status(); - - info->ac_line_status = (power_status != POWER_NONE) ? - APM_AC_ONLINE : APM_AC_OFFLINE; - - if (info->ac_line_status == APM_AC_ONLINE && current > 0) { - info->battery_status = APM_BATTERY_STATUS_CHARGING; - } else { - - info->battery_status = battery_status.accum_current_mAh > - ((battery_status.rated_capacity * 75) / 100) ? - APM_BATTERY_STATUS_HIGH : - battery_status.accum_current_mAh > - ((battery_status.rated_capacity* 25) / 100) ? - APM_BATTERY_STATUS_LOW : APM_BATTERY_STATUS_CRITICAL; +static void magician_supply_changed(void) { + if (supply_status) { + /* We're on AC or USB, charge */ + gpio_set_value(GPIO_NR_MAGICIAN_USB_CHARGE_N, 0); } - - info->battery_flag = info->battery_status; - - if (battery_status.rated_capacity) - info->battery_life = (battery_status.accum_current_mAh * 100) / - battery_status.rated_capacity; - - if (info->battery_life > 100) - info->battery_life = 100; - if (info->battery_life < 0) - info->battery_life = 0; - - if (battery_status.current_mA) { - info->time = - ((battery_status.accum_current_mAh * 6000) / - battery_status.current_mA) / 100; - info->units = APM_UNITS_MINS; - } else - info->units = APM_UNITS_UNKNOWN; + else { + /* We're not on AC or USB, don't charge */ + gpio_set_value(GPIO_NR_MAGICIAN_USB_CHARGE_N, 1); + } } -#endif -int -magician_battery_get_max_voltage(struct battery *bat) +static int magician_update_supply_status(void) { - return MAGICIAN_BATTERY_MAX_VOLTAGE; -} + unsigned int cable_state; + cable_state = magician_cable_state(&magician_cpld); -int -magician_battery_get_min_voltage(struct battery *bat) -{ - return MAGICIAN_BATTERY_MIN_VOLTAGE; -} + supply_status = POWER_NONE; + if (cable_state == 1) supply_status |= POWER_AC; + if (cable_state == 2) supply_status |= POWER_USB; -int -magician_battery_get_voltage(struct battery *bat) -{ - magician_battery_read_status(); - return battery_status.voltage_mV; + return supply_status; } -int -magician_battery_get_max_current(struct battery *bat) +static void magician_isr_timer_func(unsigned long enableirq) { - return MAGICIAN_BATTERY_MAX_CURRENT; -} + supply_status = magician_update_supply_status(); -int -magician_battery_get_min_current(struct battery *bat) -{ - return MAGICIAN_BATTERY_MIN_CURRENT; -} + magician_supply_changed(); + magician_update_leds(&ds2760_di); -int -magician_battery_get_current(struct battery *bat) -{ - magician_battery_read_status(); - return battery_status.current_mA; -} + if (ds2760_di.power_supply_changed) + ds2760_di.power_supply_changed(&ds2760_di); -int -magician_battery_get_max_charge(struct battery *bat) -{ - magician_battery_read_status(); - return battery_status.rated_capacity; -} - -int -magician_battery_get_min_charge(struct battery *bat) -{ - return MAGICIAN_BATTERY_MIN_CHARGE; -} - -int -magician_battery_get_charge(struct battery *bat) -{ - magician_battery_read_status(); - return battery_status.accum_current_mAh; -} - -int -magician_battery_get_temp(struct battery *bat) -{ - magician_battery_read_status(); - return battery_status.temp_C; -} - -int -magician_battery_get_status(struct battery *bat) -{ - int status; - - // this could be taken from GPIO30 (CHARGE_EN?) or DS2760 status. - status = (GPLR(GPIO_NR_MAGICIAN_USB_CHARGE_N) & GPIO_bit(GPIO_NR_MAGICIAN_USB_CHARGE_N)) ? - BATTERY_STATUS_NOT_CHARGING : BATTERY_STATUS_CHARGING; - - return status; -} - -void -magician_battery_update_status(void *data) -{ - static int full_counter; - - magician_battery_read_status(); - - if (battery_charge_state == BATTERY_STATE_UNKNOWN) - full_counter = 0; - - /* Set the proper charging rate. */ - power_status = magician_cable_state(&magician_cpld); - if (power_status) { - - GPCR(GPIO_NR_MAGICIAN_USB_CHARGE_N) = GPIO_bit(GPIO_NR_MAGICIAN_USB_CHARGE_N); - //gpio_set_value(GPIO30_MAGICIAN_USB_CHARGE_N, 0); - - if (battery_status.current_mA > 10) { - - battery_charge_state = BATTERY_CHARGING; - full_counter = 0; - - } else if (battery_status.current_mA < 10 && - battery_charge_state != BATTERY_FULL) { - - /* Don't consider the battery to be full unless - * we've seen the current < 10 mA at least two - * consecutive times. */ - - full_counter++; - - if (full_counter < 2) - battery_charge_state = BATTERY_CHARGING; - else { - - unsigned char acr[2]; - - acr[0] = (battery_status.rated_capacity * 4) >> 8; - acr[1] = (battery_status.rated_capacity * 4) & 0xff; - - if (w1_ds2760_write(ds2760_dev, acr, - DS2760_CURRENT_ACCUM_MSB, 2) < 2) - printk(KERN_ERR "ACR reset failed\n"); - battery_charge_state = BATTERY_FULL; - } - } - - if (battery_charge_state == BATTERY_CHARGING) { - - /* Blink the LED while plugged in and charging. */ - led_trigger_event(magician_charge_led_trigger, LED_FULL); - led_trigger_event(magician_charge_full_led_trigger, LED_FULL); - //leds_set_frequency(h2200_power_led, 500); - } else { - - /* Set the LED solid while on AC and not charging. */ - led_trigger_event(magician_charge_led_trigger, LED_OFF); - led_trigger_event(magician_charge_full_led_trigger, LED_FULL); - //leds_set_frequency(h2200_power_led, 0); - } - - } else { - - battery_charge_state = BATTERY_DISCHARGING; - full_counter = 0; - - GPSR(GPIO_NR_MAGICIAN_USB_CHARGE_N) = GPIO_bit(GPIO_NR_MAGICIAN_USB_CHARGE_N); - //gpio_set_value(GPIO30_MAGICIAN_USB_CHARGE_N, 1); - - /* Turn off the LED while unplugged from AC. */ - led_trigger_event(magician_charge_led_trigger, LED_OFF); - led_trigger_event(magician_charge_full_led_trigger, LED_OFF); - //leds_set_frequency(h2200_power_led, 0); + if (enableirq) { + enable_irq(ac_irq); } + return; } -static irqreturn_t magician_ac_plug_isr (int isr, void *data) +static irqreturn_t magician_attach_isr(int irq, void *dev_id) { - - /* Update the LED status right away, for timely feedback. */ - - int power_status = magician_cable_state(&magician_cpld); - if (power_status) { - /* Start off with a solid LED; if we're charging, - the LED state will be updated when the queued work runs. */ - led_trigger_event(magician_charge_led_trigger, LED_HALF); - led_trigger_event(magician_charge_full_led_trigger, LED_HALF); - //leds_set_frequency(h2200_power_led, 0); - } else { - led_trigger_event(magician_charge_led_trigger, LED_OFF); - led_trigger_event(magician_charge_full_led_trigger, LED_OFF); - //leds_set_frequency(h2200_power_led, 0); + if(irq != ac_irq) { + printk(DRIVER_NAME " bad irq: %d, not %d\n", + irq, ac_irq); } - /* Force the data to be re-read. */ - battery_status.update_time = 0; + gpio_set_value(GPIO_NR_MAGICIAN_USB_CHARGE_N, 1); + mod_timer(&isr_timer, jiffies + HZ/10); + disable_irq(ac_irq); - /* Wait a few seconds to let the DS2760 update its current reading. */ - queue_delayed_work(monitor_q, &monitor_work, HZ * 7); - return IRQ_HANDLED; } -static struct battery magician_battery = { - .name = "magician_main", - .id = "main battery", - .get_voltage = magician_battery_get_voltage, - .get_min_voltage = magician_battery_get_min_voltage, - .get_max_voltage = magician_battery_get_max_voltage, - .get_current = magician_battery_get_current, - .get_min_current = magician_battery_get_min_current, - .get_max_current = magician_battery_get_max_current, - .get_charge = magician_battery_get_charge, - .get_min_charge = magician_battery_get_min_charge, - .get_max_charge = magician_battery_get_max_charge, - .get_temp = magician_battery_get_temp, - .get_status = magician_battery_get_status, -}; - -/* -------------------------------------------------------------------- */ - -static int -magician_battery_match_callback(struct device *dev, void *data) +static void magician_charge_callback(struct ds2760_device_info *di) { - struct w1_slave *sl; - - if (!(dev->driver && dev->driver->name && - (strcmp(dev->driver->name, "w1_slave_driver") == 0))) - return 0; - - sl = container_of(dev, struct w1_slave, dev); - - /* DS2760 w1 slave device names begin with the family number 0x30. */ - if (strncmp(sl->name, "30-", 3) != 0) - return 0; - - return 1; + magician_update_leds(di); + return; } -void -magician_battery_probe_work(void *data) +void magician_null_release(struct device *dev) { - struct bus_type *bus; - - /* Get the battery w1 slave device. */ - bus = find_bus("w1"); - if (bus) - ds2760_dev = bus_find_device(bus, NULL, NULL, - magician_battery_match_callback); - - if (!ds2760_dev) { - /* No DS2760 device found; try again later. */ - queue_delayed_work(probe_q, &probe_work, HZ * 5); - return; - } + return; /* current platform_device api is weird */ } +static struct ds2760_device_info ds2760_di = { + .name = "magician_primary", + .id = "main", + .max_voltage = 4750, + .min_voltage = 0, + .max_current = 950, + .min_current = -950, + .min_charge = 0, + .power_supplied = magician_update_supply_status, + .charge_callback = magician_charge_callback, +}; -static void -magician_battery_timer(unsigned long data) -{ - queue_work(monitor_q, &monitor_work); - mod_timer(&monitor_timer, jiffies + BATTERY_CHECK_INTERVAL); -} +static struct platform_device ds2760_pdev = { + .name = "ds2760-battery", + .dev = { + .platform_data = &ds2760_di, + .release = magician_null_release, + }, +}; -static int -magician_battery_probe(struct platform_device *dev) -{ - printk("Battery interface for HTC Magician\n"); - - battery_charge_state = BATTERY_STATE_UNKNOWN; - - /* Install an interrupt handler for AC plug/unplug. */ -// set_irq_type(IRQ_MAGICIAN_AC, IRQT_BOTHEDGE); - request_irq(IRQ_MAGICIAN_AC, magician_ac_plug_isr, IRQF_SAMPLE_RANDOM, - "AC plug", NULL); - - /* Create a workqueue in which the battery monitor will run. */ - monitor_q = create_singlethread_workqueue("battmon"); - INIT_WORK(&monitor_work, magician_battery_update_status, NULL); - - /* Create a timer to run the battery monitor every - BATTERY_CHECK_INTERVAL seconds. */ - init_timer(&monitor_timer); - monitor_timer.function = magician_battery_timer; - monitor_timer.data = 0; - - /* Start the first monitor task a few seconds from now. */ - mod_timer(&monitor_timer, jiffies + HZ * 10); - #if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE) - apm_get_power_status = magician_apm_get_power_status; -#endif - - led_trigger_register_simple("magician-charge", &magician_charge_led_trigger); - led_trigger_register_simple("magician-charge-full", &magician_charge_full_led_trigger); - - /* Get the DS2760 W1 device. */ - probe_q = create_singlethread_workqueue("battmonprb"); - INIT_WORK(&probe_work, magician_battery_probe_work, NULL); - magician_battery_probe_work(NULL); - - return 0; -} - -static void -magician_battery_shutdown(struct platform_device *dev) +static void magician_apm_get_power_status(struct apm_power_info *info) { -#if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE) - apm_get_power_status = apm_get_power_status_orig; + ds2760_di.get_apm_power_info(&ds2760_di, info); + return; +} #endif - del_timer_sync(&monitor_timer); - - cancel_delayed_work(&monitor_work); - flush_workqueue(monitor_q); - destroy_workqueue(monitor_q); - - cancel_delayed_work(&probe_work); - flush_workqueue(probe_q); - destroy_workqueue(probe_q); - - if (ds2760_dev) - put_device(ds2760_dev); - - free_irq(IRQ_MAGICIAN_AC, NULL); - - led_trigger_event(magician_charge_led_trigger, LED_OFF); - led_trigger_event(magician_charge_full_led_trigger, LED_OFF); - //leds_set_frequency(h2200_power_led, 0); - led_trigger_unregister_simple(magician_charge_led_trigger); - led_trigger_unregister_simple(magician_charge_full_led_trigger); -} - -static int -magician_battery_remove(struct platform_device *dev) +static int magician_battery_init (void) { - magician_battery_shutdown(dev); - return 0; -} + int ret; -static int -magician_battery_suspend(struct platform_device *dev, pm_message_t state) -{ - cancel_delayed_work(&monitor_work); - flush_workqueue(monitor_q); + setup_timer(&isr_timer, magician_isr_timer_func, 1); - return 0; -} + ac_irq = IRQ_MAGICIAN_AC; + ret = request_irq (ac_irq, magician_attach_isr, IRQF_SAMPLE_RANDOM, + "AC plug", NULL); + if (ret) goto ac_irq_failed; -static int -magician_battery_resume(struct platform_device *dev) -{ -// battery_charge_state = BATTERY_STATUS_UNKNOWN; - queue_work(monitor_q, &monitor_work); - mod_timer(&monitor_timer, jiffies + HZ * 5); + ret = platform_device_register(&ds2760_pdev); + if (ret) goto platform_device_failed; - return 0; -} + led_trigger_register_simple("magician-charge-full", &chargefull_trig); + led_trigger_register_simple("magician-charge", &charging_trig); + magician_isr_timer_func(0); -static struct platform_driver magician_battery_driver = { - .driver = { - .name = "magician-battery", - }, - .probe = magician_battery_probe, - .remove = magician_battery_remove, - .shutdown = magician_battery_shutdown, - .suspend = magician_battery_suspend, - .resume = magician_battery_resume -}; + #if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE) + apm_get_power_status = magician_apm_get_power_status; + #endif -static int __init -magician_battery_init(void) -{ - int retval; + goto success; - retval = platform_driver_register(&magician_battery_driver); - if (retval) - return retval; - - retval = battery_class_register(&magician_battery); - - return retval; +platform_device_failed: + printk (KERN_ERR "%s: failed to register device\n", __FUNCTION__); + free_irq(ac_irq, NULL); +ac_irq_failed: + printk (KERN_ERR "%s: unable to grab AC in IRQ\n", __FUNCTION__); +success: + return ret; } -static void __exit magician_battery_exit(void) +static void magician_battery_exit(void) { - battery_class_unregister(&magician_battery); - platform_driver_unregister(&magician_battery_driver); + #if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE) + apm_get_power_status = NULL; + #endif + led_trigger_unregister_simple(chargefull_trig); + led_trigger_unregister_simple(charging_trig); + free_irq(ac_irq, NULL); + del_timer_sync(&isr_timer); + platform_device_unregister(&ds2760_pdev); + return; } module_init(magician_battery_init); module_exit(magician_battery_exit); - MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Szabolcs Gyurko <sza...@tl...>"); -MODULE_DESCRIPTION("HTC Magician battery driver"); - -/* - * Local Variables: - * mode:c - * c-style:"K&R" - * c-basic-offset:8 - * End: - * - */ Modified: linux4palm/linux/trunk/drivers/input/touchscreen/ts-adc-debounce.c =================================================================== --- linux4palm/linux/trunk/drivers/input/touchscreen/ts-adc-debounce.c 2007-02-18 12:30:02 UTC (rev 846) +++ linux4palm/linux/trunk/drivers/input/touchscreen/ts-adc-debounce.c 2007-02-18 12:43:11 UTC (rev 847) @@ -256,7 +256,7 @@ struct ts_adc *ts = platform_get_drvdata(pdev); del_timer_sync(&ts->timer); - free_irq(params->pen_irq, params); + free_irq(params->pen_irq, pdev); input_unregister_device(ts->input); input_free_device(ts->input); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z7...@us...> - 2007-02-25 17:56:50
|
Revision: 873 http://svn.sourceforge.net/hackndev/?rev=873&view=rev Author: z72ka Date: 2007-02-25 09:56:35 -0800 (Sun, 25 Feb 2007) Log Message: ----------- Added a new LED MMC card trigger for pxamci (now used in Palm Z72) Modified Paths: -------------- linux4palm/linux/trunk/drivers/leds/Kconfig linux4palm/linux/trunk/drivers/leds/Makefile linux4palm/linux/trunk/drivers/mmc/pxamci.c linux4palm/linux/trunk/include/linux/leds.h Added Paths: ----------- linux4palm/linux/trunk/drivers/leds/ledtrig-mmc-card.c Modified: linux4palm/linux/trunk/drivers/leds/Kconfig =================================================================== --- linux4palm/linux/trunk/drivers/leds/Kconfig 2007-02-24 01:37:32 UTC (rev 872) +++ linux4palm/linux/trunk/drivers/leds/Kconfig 2007-02-25 17:56:35 UTC (rev 873) @@ -158,6 +158,13 @@ This allows LEDs to be controlled by IDE disk activity. If unsure, say Y. +config LEDS_TRIGGER_MMC_CARD + bool "LED MMC Card Trigger" + depends on LEDS_TRIGGERS && MMC_PXA && ARCH_PXA + help + This allows LEDs to be controlled by MMC card activity on Intel PXA 25x/26x/27x MMC interface . + If unsure, say Y. + config LEDS_TRIGGER_HEARTBEAT tristate "LED Heartbeat Trigger" depends on LEDS_TRIGGERS Modified: linux4palm/linux/trunk/drivers/leds/Makefile =================================================================== --- linux4palm/linux/trunk/drivers/leds/Makefile 2007-02-24 01:37:32 UTC (rev 872) +++ linux4palm/linux/trunk/drivers/leds/Makefile 2007-02-25 17:56:35 UTC (rev 873) @@ -30,3 +30,4 @@ obj-$(CONFIG_LEDS_TRIGGER_IDE_DISK) += ledtrig-ide-disk.o obj-$(CONFIG_LEDS_TRIGGER_HEARTBEAT) += ledtrig-heartbeat.o obj-$(CONFIG_LEDS_TRIGGER_SHARED) += ledtrig-shared.o +obj-$(CONFIG_LEDS_TRIGGER_MMC_CARD) += ledtrig-mmc-card.o Added: linux4palm/linux/trunk/drivers/leds/ledtrig-mmc-card.c =================================================================== --- linux4palm/linux/trunk/drivers/leds/ledtrig-mmc-card.c (rev 0) +++ linux4palm/linux/trunk/drivers/leds/ledtrig-mmc-card.c 2007-02-25 17:56:35 UTC (rev 873) @@ -0,0 +1,63 @@ +/* + * LED MMC-Card Activity Trigger + * + * Author: Jan Herman <2h...@se...> + * + * Based on code IDE-disk Trigger from Richard Purdie <rp...@op...> + * + * 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/module.h> +#include <linux/jiffies.h> +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/timer.h> +#include <linux/leds.h> + +static void ledtrig_mmc_timerfunc(unsigned long data); + +DEFINE_LED_TRIGGER(ledtrig_mmc); +static DEFINE_TIMER(ledtrig_mmc_timer, ledtrig_mmc_timerfunc, 0, 0); +static int mmc_activity; +static int mmc_lastactivity; + +void ledtrig_mmc_activity(void) +{ + mmc_activity++; + if (!timer_pending(&ledtrig_mmc_timer)) + mod_timer(&ledtrig_mmc_timer, jiffies + msecs_to_jiffies(10)); +} +EXPORT_SYMBOL(ledtrig_mmc_activity); + +static void ledtrig_mmc_timerfunc(unsigned long data) +{ + if (mmc_lastactivity != mmc_activity) { + mmc_lastactivity = mmc_activity; + led_trigger_event(ledtrig_mmc, LED_FULL); + mod_timer(&ledtrig_mmc_timer, jiffies + msecs_to_jiffies(10)); + } else { + led_trigger_event(ledtrig_mmc, LED_OFF); + } +} + +static int __init ledtrig_mmc_init(void) +{ + led_trigger_register_simple("mmc-card", &ledtrig_mmc); + return 0; +} + +static void __exit ledtrig_mmc_exit(void) +{ + led_trigger_unregister_simple(ledtrig_mmc); +} + +module_init(ledtrig_mmc_init); +module_exit(ledtrig_mmc_exit); + +MODULE_AUTHOR("Jan Herman <2h...@se...>"); +MODULE_DESCRIPTION("LED MMC Card Activity Trigger"); +MODULE_LICENSE("GPL"); Modified: linux4palm/linux/trunk/drivers/mmc/pxamci.c =================================================================== --- linux4palm/linux/trunk/drivers/mmc/pxamci.c 2007-02-24 01:37:32 UTC (rev 872) +++ linux4palm/linux/trunk/drivers/mmc/pxamci.c 2007-02-25 17:56:35 UTC (rev 873) @@ -25,6 +25,7 @@ #include <linux/dma-mapping.h> #include <linux/mmc/host.h> #include <linux/mmc/protocol.h> +#include <linux/leds.h> #include <asm/dma.h> #include <asm/io.h> @@ -263,6 +264,8 @@ { struct mmc_data *data = host->data; + ledtrig_mmc_activity(); + if (!data) return 0; Modified: linux4palm/linux/trunk/include/linux/leds.h =================================================================== --- linux4palm/linux/trunk/include/linux/leds.h 2007-02-24 01:37:32 UTC (rev 872) +++ linux4palm/linux/trunk/include/linux/leds.h 2007-02-25 17:56:35 UTC (rev 873) @@ -140,5 +140,10 @@ #else #define ledtrig_ide_activity() do {} while(0) #endif +#ifdef CONFIG_LEDS_TRIGGER_MMC_CARD +extern void ledtrig_mmc_activity(void); +#else +#define ledtrig_mmc_activity() do {} while(0) +#endif #endif /* __LINUX_LEDS_H_INCLUDED */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sle...@us...> - 2007-02-27 00:48:46
|
Revision: 875 http://svn.sourceforge.net/hackndev/?rev=875&view=rev Author: sleep_walker Date: 2007-02-26 16:48:43 -0800 (Mon, 26 Feb 2007) Log Message: ----------- l4p: some (not only) temporary 2.6.20 fixes for T|T3 Modified Paths: -------------- linux4palm/linux/trunk/Documentation/filesystems/00-INDEX linux4palm/linux/trunk/MAINTAINERS linux4palm/linux/trunk/arch/arm/mach-pxa/palmt3/palmt3.c linux4palm/linux/trunk/arch/arm/mach-pxa/palmt3/palmt3_buttons.c linux4palm/linux/trunk/drivers/i2c/chips/tps65010.c linux4palm/linux/trunk/drivers/input/touchscreen/Kconfig Modified: linux4palm/linux/trunk/Documentation/filesystems/00-INDEX =================================================================== --- linux4palm/linux/trunk/Documentation/filesystems/00-INDEX 2007-02-26 00:50:14 UTC (rev 874) +++ linux4palm/linux/trunk/Documentation/filesystems/00-INDEX 2007-02-27 00:48:43 UTC (rev 875) @@ -82,6 +82,8 @@ - info and mount options for the UDF filesystem. ufs.txt - info on the ufs filesystem. +unionfs/ + - info on the unionfs filesystem v9fs.txt - v9fs is a Unix implementation of the Plan 9 9p remote fs protocol. vfat.txt Modified: linux4palm/linux/trunk/MAINTAINERS =================================================================== --- linux4palm/linux/trunk/MAINTAINERS 2007-02-26 00:50:14 UTC (rev 874) +++ linux4palm/linux/trunk/MAINTAINERS 2007-02-27 00:48:43 UTC (rev 875) @@ -3293,6 +3293,13 @@ W: http://www.kernel.dk S: Maintained +UNIONFS +P: Josef "Jeff" Sipek +M: js...@cs... +L: un...@fi... +W: http://unionfs.filesystems.org/ +S: Maintained + USB ACM DRIVER P: Oliver Neukum M: ol...@ne... Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmt3/palmt3.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmt3/palmt3.c 2007-02-26 00:50:14 UTC (rev 874) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmt3/palmt3.c 2007-02-27 00:48:43 UTC (rev 875) @@ -10,6 +10,7 @@ #include <linux/kernel.h> #include <linux/init.h> +#include <linux/input.h> #include <asm/mach/arch.h> #include <asm/mach-types.h> #include <asm/arch/hardware.h> @@ -19,13 +20,17 @@ #include <linux/device.h> #include <linux/fb.h> +#include <asm/arch/hardware.h> #include <asm/arch/pxa-dmabounce.h> #include <asm/arch/pxafb.h> #include <asm/arch/pxa-regs.h> -#include <linux/device.h> #include <linux/platform_device.h> +#include <asm/irq.h> //test #include <asm/arch/ssp.h> +#include <asm/arch/irq.h> //test +#include <asm/arch/hardware.h> //test + #include <linux/input.h> #include <linux/soc/tsc2101.h> #include <asm/arch/pxa-pm_ll.h> @@ -34,8 +39,8 @@ #include "../generic.h" // FIXME move this to include/asm/arch/plamt3.h some time -#define PALMT3_GPIO_TSC2101_SS (24) -#define PALMT3_GPIO_PENDOWN (37) +#define PALMT3_GPIO_TSC2101_SS (24) +#define PALMT3_GPIO_PENDOWN (37) #define PALMT3_IRQ_GPIO_PENDOWN IRQ_GPIO(PALMT3_GPIO_PENDOWN) #define DEBUG 1 @@ -60,7 +65,7 @@ CKEN = CKEN & (~CKEN1_PWM1); } -static void palmt3_pxafb_lcd_power(int level) +static void palmt3_pxafb_lcd_power(int level, struct fb_var_screeninfo *var) { if(level) { GPSR1 = GPIO_bit(38); @@ -72,7 +77,13 @@ } } -static struct pxafb_mach_info palmt3lcd = { + + + +/*** framebuffer ***/ + +static struct pxafb_mode_info palmt3_lcd_modes[] = { + { .pixclock = 0, .xres = 320, .yres = 480, @@ -84,12 +95,19 @@ .upper_margin = 8, .lower_margin = 7, .sync = FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, + } +}; +static struct pxafb_mach_info palmt3_lcd_screen[] = { + { + .modes = palmt3_lcd_modes, + .num_modes = ARRAY_SIZE(palmt3_lcd_modes), .lccr0 = 0x003008F9, .lccr3 = 0x03700002, - .pxafb_backlight_power = palmt3_pxafb_backlight_power, - .pxafb_lcd_power = palmt3_pxafb_lcd_power, + .pxafb_backlight_power = &palmt3_pxafb_backlight_power, + .pxafb_lcd_power = &palmt3_pxafb_lcd_power, + } }; /*** SSP ***/ @@ -131,24 +149,25 @@ void palmt3_tsc2101_send(int read, int command, int *values, int numval) { + u32 ret; + int i; GPCR0 = GPIO_bit(PALMT3_GPIO_TSC2101_SS); ssp_write_word(&palmt3_ssp_dev, command | read); /* dummy read */ - ssp_read_word(&palmt3_ssp_dev); + ssp_read_word(&palmt3_ssp_dev, &ret); for (i=0; i < numval; i++) { if (read) { ssp_write_word(&palmt3_ssp_dev, 0); - values[i]=ssp_read_word(&palmt3_ssp_dev); + values[i]=ssp_read_word(&palmt3_ssp_dev, &ret); } else { ssp_write_word(&palmt3_ssp_dev, values[i]); - ssp_read_word(&palmt3_ssp_dev); + ssp_read_word(&palmt3_ssp_dev, &ret); } } - GPSR0 = GPIO_bit(PALMT3_GPIO_TSC2101_SS); } @@ -207,15 +226,15 @@ { unsigned long * addr; - addr = 0xC0000000; + addr = (unsigned long *) 0xC0000000; _PM_backup[0] = *addr; *addr = 0xFEEDC0DE; - addr = 0xC0000004; + addr = (unsigned long *) 0xC0000004; _PM_backup[1] = *addr; *addr = 0xBEEFF00D; - addr = 0xC0000008; + addr = (unsigned long *) 0xC0000008; _PM_backup[2] = *addr; *addr = ret; @@ -228,13 +247,13 @@ { unsigned long * addr; - addr = 0xC0000000; + addr = (unsigned long *) 0xC0000000; *addr = _PM_backup[0]; - addr = 0xC0000004; + addr = (unsigned long *) 0xC0000004; *addr = _PM_backup[1]; - addr = 0xC0000008; + addr = (unsigned long *) 0xC0000008; *addr = _PM_backup[2]; } @@ -255,7 +274,7 @@ static void __init palmt3_init(void) { - set_pxa_fb_info(&palmt3lcd); + set_pxa_fb_info(palmt3_lcd_screen); #ifdef CONFIG_PM pxa_pm_set_ll_ops(&palmt3_pm_ops); #endif Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmt3/palmt3_buttons.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmt3/palmt3_buttons.c 2007-02-26 00:50:14 UTC (rev 874) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmt3/palmt3_buttons.c 2007-02-27 00:48:43 UTC (rev 875) @@ -12,6 +12,7 @@ #include <linux/platform_device.h> #include <linux/workqueue.h> #include <linux/delay.h> +#include <linux/irq.h> #include <asm/mach/arch.h> #include <asm/mach-types.h> @@ -251,7 +252,7 @@ key_status = 0; palmt3_workqueue = create_workqueue("palmt3btnw"); - INIT_WORK(&palmt3_irq_task, palmt3_irq_queuework, NULL); + INIT_WORK(&palmt3_irq_task, palmt3_irq_queuework); /* Configure GPIOs as Output and low */ spin_lock_irqsave(&btn_lock, flags); Modified: linux4palm/linux/trunk/drivers/i2c/chips/tps65010.c =================================================================== --- linux4palm/linux/trunk/drivers/i2c/chips/tps65010.c 2007-02-26 00:50:14 UTC (rev 874) +++ linux4palm/linux/trunk/drivers/i2c/chips/tps65010.c 2007-02-27 00:48:43 UTC (rev 875) @@ -32,6 +32,7 @@ #include <linux/debugfs.h> #include <linux/seq_file.h> #include <linux/mutex.h> +#include <linux/irq.h> #include <asm/irq.h> #include <asm/mach-types.h> @@ -551,7 +552,7 @@ tps->model = TPS65010; tps->irq = IRQ_GPIO(T3_TPS65010_GPIO); // is it ok to do this here? - set_irq_type (IRQ_GPIO(T3_TPS65010_GPIO), IRQT_FALLING); +// set_irq_type (IRQ_GPIO(T3_TPS65010_GPIO), IRQT_FALLING); #else if (machine_is_omap_h2()) { tps->model = TPS65010; Modified: linux4palm/linux/trunk/drivers/input/touchscreen/Kconfig =================================================================== --- linux4palm/linux/trunk/drivers/input/touchscreen/Kconfig 2007-02-26 00:50:14 UTC (rev 874) +++ linux4palm/linux/trunk/drivers/input/touchscreen/Kconfig 2007-02-27 00:48:43 UTC (rev 875) @@ -51,12 +51,12 @@ config TOUCHSCREEN_TSC2101 tristate "TI TSC2101 touchscreen input driver" - depends on MACH_HX2750 && INPUT && INPUT_TOUCHSCREEN + depends on (MACH_HX2750 || MACH_T3XSCALE) && INPUT && INPUT_TOUCHSCREEN select SOC_TSC2101 default y help Say Y here to enable the driver for the touchscreen on the - iPAQ hx2750 series of PDAs. + iPAQ hx2750 series of PDAs or Palm Tungsten T3. If unsure, say N. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bal...@us...> - 2007-02-27 02:30:18
|
Revision: 876 http://svn.sourceforge.net/hackndev/?rev=876&view=rev Author: balrog-kun Date: 2007-02-26 18:30:14 -0800 (Mon, 26 Feb 2007) Log Message: ----------- l4p: battchargemon build error and warning fixes. Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig linux4palm/linux/trunk/drivers/input/serio/serio_raw.c linux4palm/linux/trunk/drivers/misc/battchargemon.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig 2007-02-27 00:48:43 UTC (rev 875) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig 2007-02-27 02:30:14 UTC (rev 876) @@ -5,7 +5,7 @@ This enables support for Palm TX handheld. Note: this is in a very early stage. -config PALMTX_AC97 +config PALMTX_AC97 tristate "Palm TX AC97 driver" depends on MACH_XSCALE_PALMTX default y if MACH_XSCALE_PALMTX @@ -14,7 +14,7 @@ Enable support for WM9712 touchscreen and battery for the Palm TX PDA -config PALMTX_LCD +config PALMTX_LCD tristate "Palm TX LCD driver" select LCD_CLASS_DEVICE depends on MACH_XSCALE_PALMTX @@ -23,14 +23,14 @@ LCD driver for Palm TX. Enable support for switching the Palm TX LCD on/off -config PALMTX_PCMCIA +config PALMTX_PCMCIA tristate "Palm TX PCMCIA driver" depends on MACH_XSCALE_PALMTX default y if MACH_XSCALE_PALMTX help PCMCIA driver for Palm TX -config PALMTX_DEBUG +config PALMTX_DEBUG bool "Debug output for Palm TX" depends on MACH_XSCALE_PALMTX default n Modified: linux4palm/linux/trunk/drivers/input/serio/serio_raw.c =================================================================== --- linux4palm/linux/trunk/drivers/input/serio/serio_raw.c 2007-02-27 00:48:43 UTC (rev 875) +++ linux4palm/linux/trunk/drivers/input/serio/serio_raw.c 2007-02-27 02:30:14 UTC (rev 876) @@ -160,7 +160,7 @@ { struct serio_raw_list *list = file->private_data; struct serio_raw *serio_raw = list->serio_raw; - char c; + char c = 0; ssize_t retval = 0; if (!serio_raw->serio) Modified: linux4palm/linux/trunk/drivers/misc/battchargemon.c =================================================================== --- linux4palm/linux/trunk/drivers/misc/battchargemon.c 2007-02-27 00:48:43 UTC (rev 875) +++ linux4palm/linux/trunk/drivers/misc/battchargemon.c 2007-02-27 02:30:14 UTC (rev 876) @@ -12,7 +12,6 @@ * */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/init.h> @@ -95,13 +94,14 @@ /**** class registration ****/ #define create_entry_conditional(_name) \ - if(bat->_name != -1) \ - class_device_create_file(&bat->class_dev, &battery_class_device_attr_##_name); + (bat->_name == -1 ? 0 : \ + class_device_create_file(&bat->class_dev, \ + &battery_class_device_attr_##_name)) int battery_class_register(struct battery *bat) { int rc = 0; - + // init list bat->attached_chargers.next = &bat->attached_chargers; bat->attached_chargers.prev = &bat->attached_chargers; @@ -114,18 +114,27 @@ goto out; if(bat->id) - class_device_create_file(&bat->class_dev, &battery_class_device_attr_id); - create_entry_conditional(min_voltage); - create_entry_conditional(max_voltage); - create_entry_conditional(v_current); - create_entry_conditional(temp); + rc |= class_device_create_file(&bat->class_dev, + &battery_class_device_attr_id); + rc |= create_entry_conditional(min_voltage); + rc |= create_entry_conditional(max_voltage); + rc |= create_entry_conditional(v_current); + rc |= create_entry_conditional(temp); if(bat->get_voltage) { - class_device_create_file(&bat->class_dev, &battery_class_device_attr_voltage); + rc |= class_device_create_file(&bat->class_dev, + &battery_class_device_attr_voltage); if((bat->min_voltage != -1) && (bat->max_voltage != -1)) { - class_device_create_file(&bat->class_dev, &battery_class_device_attr_charge); + rc |= class_device_create_file(&bat->class_dev, + &battery_class_device_attr_charge); } } + if(rc) { + printk(KERN_ERR "battchargemon: " + "creation of device entries failed\n"); + class_device_unregister(&bat->class_dev); + } + out: return rc; } @@ -148,9 +157,17 @@ goto out; if(cha->id) - class_device_create_file(&cha->class_dev, &charger_class_device_attr_id); - class_device_create_file(&cha->class_dev, &charger_class_device_attr_status); - + rc |= class_device_create_file(&cha->class_dev, + &charger_class_device_attr_id); + rc |= class_device_create_file(&cha->class_dev, + &charger_class_device_attr_status); + + if(rc) { + printk(KERN_ERR "charger: " + "creation of device entries failed\n"); + class_device_unregister(&cha->class_dev); + } + out: return rc; } @@ -188,7 +205,11 @@ sysfs_remove_link(&batt->class_dev.kobj, "charger"); list_for_each_entry(cha, &batt->attached_chargers, list) { if(cha->get_status(cha)) { - sysfs_create_link(&batt->class_dev.kobj, &cha->class_dev.kobj, "charger"); + if (sysfs_create_link(&batt->class_dev.kobj, + &cha->class_dev.kobj, + "charger")) + printk(KERN_ERR "charger: " + "sysfs link failed\n"); return; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bal...@us...> - 2007-02-27 03:12:37
|
Revision: 878 http://svn.sourceforge.net/hackndev/?rev=878&view=rev Author: balrog-kun Date: 2007-02-26 19:12:35 -0800 (Mon, 26 Feb 2007) Log Message: ----------- TT3: tsc2101 and flash update and minor cleanup. Modified Paths: -------------- linux4palm/linux/trunk/drivers/mmc/wbsd-palmt3.c linux4palm/linux/trunk/drivers/mtd/maps/palmt3-flash.c linux4palm/linux/trunk/drivers/soc/tsc2101.c linux4palm/linux/trunk/include/linux/soc/tsc2101.h linux4palm/linux/trunk/sound/arm/pxa2xx-i2sound.h Modified: linux4palm/linux/trunk/drivers/mmc/wbsd-palmt3.c =================================================================== --- linux4palm/linux/trunk/drivers/mmc/wbsd-palmt3.c 2007-02-27 02:48:01 UTC (rev 877) +++ linux4palm/linux/trunk/drivers/mmc/wbsd-palmt3.c 2007-02-27 03:12:35 UTC (rev 878) @@ -1465,7 +1465,7 @@ if (!host->irq) return; -#define UREG(x) free_irq(IRQ_GPIO(x), (void*) x); +#define UREG(x) free_irq(IRQ_GPIO(x), (void *) x) UREG(2); UREG(8); Modified: linux4palm/linux/trunk/drivers/mtd/maps/palmt3-flash.c =================================================================== --- linux4palm/linux/trunk/drivers/mtd/maps/palmt3-flash.c 2007-02-27 02:48:01 UTC (rev 877) +++ linux4palm/linux/trunk/drivers/mtd/maps/palmt3-flash.c 2007-02-27 03:12:35 UTC (rev 878) @@ -10,7 +10,6 @@ * Thomas Gleixner <tg...@li...> */ -#include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> Modified: linux4palm/linux/trunk/drivers/soc/tsc2101.c =================================================================== --- linux4palm/linux/trunk/drivers/soc/tsc2101.c 2007-02-27 02:48:01 UTC (rev 877) +++ linux4palm/linux/trunk/drivers/soc/tsc2101.c 2007-02-27 03:12:35 UTC (rev 878) @@ -95,13 +95,14 @@ } } -static irqreturn_t tsc2101_headset_int(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t tsc2101_headset_int(int irq, void *dev_id) { tsc2101_set_route(); return IRQ_HANDLED; } -static int tsc2101_snd_activate(void) { +static int tsc2101_snd_activate(void) +{ u32 data; if(snd_data == NULL) @@ -135,11 +136,16 @@ tsc2101_regwrite(snd_data, TSC2101_REG_MICAGC, TSC2101_MMPGA(0) | TSC2101_MDEBNS(0x03) | TSC2101_MDEBSN(0x03) ); - //Hack - PalmOS sets that, so cleaning it + /* + * Hack - PalmOS sets that, so cleaning it. + * + * XXX: shouldn't we be just resetting the chip instead? + */ tsc2101_regwrite(snd_data, TSC2101_REG_HEADSETPGA, 0x0000); - data = request_irq (IRQ_GPIO(55), tsc2101_headset_int, SA_SAMPLE_RANDOM, "TSC2101 Headphones", (void*)55); - set_irq_type (IRQ_GPIO(55), IRQT_RISING); + data = request_irq(IRQ_GPIO(55), tsc2101_headset_int, + SA_INTERRUPT | SA_TRIGGER_RISING, + "TSC2101 Headphones", (void *) 55); if(data) return data; @@ -148,12 +154,14 @@ return 0; } -static void tsc2101_snd_deactivate(void) { +static void tsc2101_snd_deactivate(void) +{ snd_pxa2xx_i2sound_i2slink_free(); - free_irq(IRQ_GPIO(55), (void*) 55); + free_irq(IRQ_GPIO(55), (void *) 55); } -static int tsc2101_snd_set_rate(unsigned int rate) { +static int tsc2101_snd_set_rate(unsigned int rate) +{ uint div, fs_44; u32 data; @@ -529,39 +537,54 @@ return 0; } +#ifdef CONFIG_PM +static int tsc2101_snd_suspend(pm_message_t state) +{ + tsc2101_snd_deactivate(); + return 0; +} + +static int tsc2101_snd_resume(void) +{ + return tsc2101_snd_activate(); +} +#else +# define tsc2101_snd_suspend 0 +# define tsc2101_snd_resume 0 +#endif + static struct snd_pxa2xx_i2sound_board tsc2101_audio = { - .name = "tsc2101 Audio", - .desc = "TI tsc2101 Audio driver", - .acard_id = "tsc2101", - .info = SND_PXA2xx_I2SOUND_INFO_CAN_CAPTURE | SND_PXA2xx_I2SOUND_INFO_CLOCK_FROM_PXA | - SND_PXA2xx_I2SOUND_INFO_SYSCLOCK_DISABLE, - .activate = tsc2101_snd_activate, - .deactivate = tsc2101_snd_deactivate, - .set_rate = tsc2101_snd_set_rate, - .open_stream = tsc2101_snd_open_stream, - .close_stream = tsc2101_snd_close_stream, - .add_mixer_controls = tsc2101_snd_add_mixer_controls, + .name = "tsc2101 Audio", + .desc = "TI tsc2101 Audio driver", + .acard_id = "tsc2101", + .info = SND_PXA2xx_I2SOUND_INFO_CAN_CAPTURE | + SND_PXA2xx_I2SOUND_INFO_CLOCK_FROM_PXA | + SND_PXA2xx_I2SOUND_INFO_SYSCLOCK_DISABLE, + .activate = tsc2101_snd_activate, + .deactivate = tsc2101_snd_deactivate, + .set_rate = tsc2101_snd_set_rate, + .open_stream = tsc2101_snd_open_stream, + .close_stream = tsc2101_snd_close_stream, + .add_mixer_controls = tsc2101_snd_add_mixer_controls, - .streams_hw = { - { - .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | - SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | - SNDRV_PCM_RATE_48000, + .streams_hw = { + { + .rates = SNDRV_PCM_RATE_8000 | + SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | + SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000, .rate_min = 8000, .rate_max = 48000, - }, - { - .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | - SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | - SNDRV_PCM_RATE_48000, + }, + { + .rates = SNDRV_PCM_RATE_8000 | + SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | + SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000, .rate_min = 8000, .rate_max = 48000, - } - }, -#ifdef CONFIG_PM - .suspend = tsc2101_snd_activate, - .resume = tsc2101_snd_deactivate -#endif + } + }, + .suspend = tsc2101_snd_suspend, + .resume = tsc2101_snd_resume, }; @@ -570,9 +593,11 @@ */ extern void tsc2101_ts_setup(struct device *dev); -extern void tsc2101_ts_report(struct tsc2101_data *devdata, int x, int y, int p, int pendown); +extern void tsc2101_ts_report(struct tsc2101_data *devdata, + int x, int y, int p, int pendown); -static void tsc2101_readdata(struct tsc2101_data *devdata, struct tsc2101_ts_event *ts_data) +static void tsc2101_readdata(struct tsc2101_data *devdata, + struct tsc2101_ts_event *ts_data) { int z1,z2,fixadc=0; u32 values[4],status; @@ -689,7 +714,7 @@ devdata->pendown = 0; - set_irq_type(devdata->platform->irq,IRQT_FALLING); + set_irq_type(devdata->platform->irq, IRQT_FALLING); /* This must be checked after set_irq_type() to make sure no data was missed */ if (devdata->platform->pendown()) { @@ -712,8 +737,8 @@ static irqreturn_t tsc2101_handler(int irq, void *dev_id, struct pt_regs *regs) { struct tsc2101_data *devdata = dev_id; - - set_irq_type(devdata->platform->irq,IRQT_NOEDGE); + + set_irq_type(devdata->platform->irq, IRQT_NOEDGE); ts_interrupt_main(devdata, 0, regs); return IRQ_HANDLED; } @@ -818,7 +843,7 @@ tsc2101_ts_setup(dev); tsc2101_ts_enable(devdata); - set_irq_type(devdata->platform->irq,IRQT_FALLING); + set_irq_type(devdata->platform->irq, IRQT_FALLING); /* Check there is no pending data */ tsc2101_readdata(devdata, &ts_data); Modified: linux4palm/linux/trunk/include/linux/soc/tsc2101.h =================================================================== --- linux4palm/linux/trunk/include/linux/soc/tsc2101.h 2007-02-27 02:48:01 UTC (rev 877) +++ linux4palm/linux/trunk/include/linux/soc/tsc2101.h 2007-02-27 03:12:35 UTC (rev 878) @@ -42,7 +42,3 @@ int irq; int (*pendown) (void); }; - - - - Modified: linux4palm/linux/trunk/sound/arm/pxa2xx-i2sound.h =================================================================== --- linux4palm/linux/trunk/sound/arm/pxa2xx-i2sound.h 2007-02-27 02:48:01 UTC (rev 877) +++ linux4palm/linux/trunk/sound/arm/pxa2xx-i2sound.h 2007-02-27 03:12:35 UTC (rev 878) @@ -55,8 +55,8 @@ #ifdef CONFIG_PM /* Power Management */ - int (*suspend) (pm_message_t state); - int (*resume) (void); + int (*suspend)(pm_message_t state); + int (*resume)(void); #endif }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2007-02-27 16:28:58
|
Revision: 883 http://svn.sourceforge.net/hackndev/?rev=883&view=rev Author: marex_z71 Date: 2007-02-27 08:28:55 -0800 (Tue, 27 Feb 2007) Log Message: ----------- l4p: Fix GPIOed and GPIOed-NG and make them a self-standing module available under DRIVERS->MISC, also remove them from palmld Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Kconfig linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Makefile linux4palm/linux/trunk/drivers/misc/Kconfig linux4palm/linux/trunk/drivers/misc/Makefile Added Paths: ----------- linux4palm/linux/trunk/drivers/misc/gpioed-ng.c linux4palm/linux/trunk/drivers/misc/gpioed.c Removed Paths: ------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/gpioed-ng.c linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/gpioed.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Kconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Kconfig 2007-02-27 13:58:12 UTC (rev 882) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Kconfig 2007-02-27 16:28:55 UTC (rev 883) @@ -21,17 +21,3 @@ config PALMLD_IDE tristate "Palm LifeDrive IDE driver" depends on MACH_XSCALE_PALMLD - -config GPIOED - tristate "GPIOED" - depends on MACH_XSCALE_PALMLD - default n - help - Gpioed: only for debuging and testing! - -config GPIOEDNG - tristate "GPIOEDNG" - depends on MACH_XSCALE_PALMLD - default n - help - Gpioed-ng: only for debuging and testing! Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Makefile =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Makefile 2007-02-27 13:58:12 UTC (rev 882) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Makefile 2007-02-27 16:28:55 UTC (rev 883) @@ -7,6 +7,4 @@ obj-$(CONFIG_PALMLD_USB) += palmld_usb.o obj-$(CONFIG_PALMLD_IDE) += palmld_ide.o obj-$(CONFIG_PM) += palmld_pm.o -obj-$(CONFIG_GPIOED) += gpioed.o -obj-$(CONFIG_GPIOEDNG) += gpioed-ng.o Deleted: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/gpioed-ng.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/gpioed-ng.c 2007-02-27 13:58:12 UTC (rev 882) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/gpioed-ng.c 2007-02-27 16:28:55 UTC (rev 883) @@ -1,175 +0,0 @@ -#include <linux/module.h> -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/proc_fs.h> - -#include <linux/interrupt.h> -#include <asm/irq.h> -#include <asm/mach/arch.h> -#include <asm/mach/map.h> -#include <asm/mach-types.h> -#include <asm/hardware.h> -#include <linux/sched.h> -#include <linux/workqueue.h> -#include <asm/arch/pxa-regs.h> -#include <asm/arch/irqs.h> -#include <asm/uaccess.h> - -#include <linux/debugfs.h> -#include <linux/seq_file.h> - -#define PROCFS_NAME "gpio" -#define DEBUGFS_NAME "gpio" - -static struct proc_dir_entry *proc_intf; -static struct dentry *debugfs_intf; - -#define PROCFS_MAX_SIZE 20 - -static char procfs_buffer[PROCFS_MAX_SIZE]; -static unsigned long procfs_buffer_size = 0; - -#define GPIO_TEST(reg, gp) (reg(gp) & GPIO_bit(gp)) -static int dfs_show(struct seq_file *s, void *_) -{ - int i,afn; - seq_printf(s, "GPIO lines status:\n"); - - for(i=0;i<121;i++) { - afn = (GAFR(i) & (0x3 << (((i) & 0xf)*2))) >> (((i) & 0xf)*2); - seq_printf(s, "%s%d: %s %s %s %s %lx\n", - i<10?"0":"", - i, - GPIO_TEST(GPLR, i)?"*":" ", - GPIO_TEST(GPDR, i)?"->":"<-", - GPIO_TEST(GRER, i)?"_/":" ", - GPIO_TEST(GFER, i)?"\\_":" ", - afn); - - } - - return 0; -} - -static int dfs_open(struct inode *inode, struct file *file) -{ - return single_open(file, dfs_show, inode->u.generic_ip); -} - -static struct file_operations debug_fops = { - .open = dfs_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - -static void gpio_set(int id, int on) -{ - do { - if (on) - GPSR(id) = GPIO_bit(id); - else - GPCR(id) = GPIO_bit(id); - } while (0); -} - -void set_afn(int gpio, int fn) -{ - int gafr; - gafr = GAFR(gpio) & ~(0x3 << (((gpio) & 0xf)*2)); - GAFR(gpio) = gafr | (fn << (((gpio) & 0xf)*2)); -} - -void handle_request() -{ - char *p = NULL; - unsigned long id = simple_strtoul(procfs_buffer+2, &p, 10); - switch(procfs_buffer[0]) { - case 'L': - gpio_set(id, 1); - printk(KERN_ERR "GPIOed: GPIO %lu set high\n", id); - break; - case 'l': - gpio_set(id, 0); - printk(KERN_ERR "GPIOed: GPIO %lu set low\n", id); - break; - case 'd': - GPDR(id) &= ~(GPIO_bit(id)); - break; - case 'D': - GPDR(id) |= GPIO_bit(id); - break; - case '0': - set_afn(id, 0); - break; - case '1': - set_afn(id, 1); - break; - case '2': - set_afn(id, 2); - break; - default: - printk(KERN_ERR "GPIOed: Unknown request\n"); - break; - } -} - - -int procfile_write(struct file *file, const char *buffer, unsigned long count, void *data) -{ - procfs_buffer_size = count; - if (procfs_buffer_size > PROCFS_MAX_SIZE ) { - procfs_buffer_size = PROCFS_MAX_SIZE; - } - - /* write data to the buffer */ - if ( copy_from_user(procfs_buffer, buffer, procfs_buffer_size) ) { - return -EFAULT; - } - - handle_request(); - - return procfs_buffer_size; -} - - -static int __init gpioed_init(void) -{ - proc_intf = create_proc_entry(PROCFS_NAME, 0644, NULL); - if (proc_intf == NULL) { - remove_proc_entry(PROCFS_NAME, &proc_root); - printk(KERN_ALERT "Error: Could not initialize /proc/%s\n", PROCFS_NAME); - return -ENOMEM; - } - - /*proc_intf->read_proc = procfile_read;*/ - proc_intf->write_proc = procfile_write; - proc_intf->owner = THIS_MODULE; - proc_intf->mode = S_IFREG | S_IRUGO; - proc_intf->uid = 0; - proc_intf->gid = 0; - proc_intf->size = 37; - - debugfs_intf = debugfs_create_file(DEBUGFS_NAME, S_IRUGO, NULL, NULL, &debug_fops); - - printk(KERN_INFO "/proc/%s created\n", PROCFS_NAME); - - return 0; -} - -static void __exit gpioed_exit(void) -{ - debugfs_remove(debugfs_intf); - remove_proc_entry(PROCFS_NAME, &proc_root); - printk(KERN_INFO "/proc/%s removed\n", PROCFS_NAME); -} - - -/*** Some more stuff ***/ -module_init(gpioed_init); -module_exit(gpioed_exit); - -MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Vladimir \"Farcaller\" Pouzanov <far...@gm...>"); -MODULE_DESCRIPTION("GPIO editor for PXA26x, second edition"); - Deleted: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/gpioed.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/gpioed.c 2007-02-27 13:58:12 UTC (rev 882) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/gpioed.c 2007-02-27 16:28:55 UTC (rev 883) @@ -1,227 +0,0 @@ -/*** Basic includes ***/ -#include <linux/module.h> -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/proc_fs.h> -#include <linux/irq.h> - -#include <linux/interrupt.h> -#include <asm/irq.h> -#include <asm/mach/arch.h> -#include <asm/mach/map.h> -#include <asm/mach-types.h> -#include <asm/hardware.h> -#include <linux/sched.h> -#include <linux/workqueue.h> -#include <asm/arch/pxa-regs.h> -#include <asm/arch/irqs.h> -#include <asm/uaccess.h> - -/*** GPIO macros ***/ -#define GET_PALMT3_GPIO(gpio) \ - (GPLR(GPIO_NR_PALMT3_ ## gpio) & GPIO_bit(GPIO_NR_PALMT3_ ## gpio)) - -#define SET_PALMT3_GPIO(gpio, setp) \ - do { \ - if (setp) \ - GPSR(GPIO_NR_PALMT3_ ## gpio) = GPIO_bit(GPIO_NR_PALMT3_ ## gpio); \ - else \ - GPCR(GPIO_NR_PALMT3_ ## gpio) = GPIO_bit(GPIO_NR_PALMT3_ ## gpio); \ - } while (0) - -#define SET_PALMT3_GPIO_N(gpio, setp) \ - do { \ - if (setp) \ - GPCR(GPIO_NR_PALMT3_ ## gpio) = GPIO_bit(GPIO_NR_PALMT3_ ## gpio); \ - else \ - GPSR(GPIO_NR_PALMT3_ ## gpio) = GPIO_bit(GPIO_NR_PALMT3_ ## gpio); \ - } while (0) - -#define GET_GPIO_REG(reg,gpio) (GP##reg(gpio) & GPIO_bit(gpio)) -#define GET_GPIO(gpio) GET_GPIO_REG(LR, gpio) - -/*** /proc interface ***/ -static struct proc_dir_entry *proc_intf; -#define procfs_name "gpioed" -#define PROCFS_MAX_SIZE 20 - -static char procfs_buffer[PROCFS_MAX_SIZE]; -static unsigned long procfs_buffer_size = 0; - -int procfile_read(char *buffer, char **buffer_location, off_t offset, int buffer_length, int *eof, void *data) -{ - int ret; - - if (offset > 0) { - /* we have finished to read, return 0 */ - ret = 0; - } else { - /* fill the buffer, return the buffer size */ - ret = sprintf(buffer, "HelloWorld!\n"); - } - return ret; -} - -void handle_request(void); - -int procfile_write(struct file *file, const char *buffer, unsigned long count, void *data) -{ - procfs_buffer_size = count; - if (procfs_buffer_size > PROCFS_MAX_SIZE ) { - procfs_buffer_size = PROCFS_MAX_SIZE; - } - - /* write data to the buffer */ - if ( copy_from_user(procfs_buffer, buffer, procfs_buffer_size) ) { - return -EFAULT; - } - - handle_request(); - - return procfs_buffer_size; -} - -/*** IRQ (GPIO) handling ***/ -static struct workqueue_struct *my_workqueue; -#define MY_WORK_QUEUE_NAME "GPIOed" - -static void handle_gpio(void* irq) -{ - int gpn = (int)irq; - printk(KERN_ERR "*** GPIO *** %d *** is *** %s ***\n", gpn, GET_GPIO(gpn) ? "high" : "low "); -} - -irqreturn_t gpio_irq(int irq, void *dev_id, struct pt_regs *regs) -{ - static int initialised = 0; - static struct work_struct task; - - if (initialised == 0) { - INIT_WORK(&task, handle_gpio); - initialised = 1; - } else { - PREPARE_WORK(&task, handle_gpio, dev_id); - } - - queue_work(my_workqueue, &task); - - return IRQ_HANDLED; -} - -/*** GPIO R/W ***/ -static int gpio_get(int id) -{ - return GET_GPIO(id); -} - -static void gpio_set(int id, int on) -{ - do { - if (on) - GPSR(id) = GPIO_bit(id); - else - GPCR(id) = GPIO_bit(id); - } while (0); -} - -static int gpio_watch(int x) -{ - int ret; - ret = request_irq (IRQ_GPIO(x), gpio_irq, SA_SAMPLE_RANDOM, "test_handler", (void*)x); - set_irq_type (IRQ_GPIO(x), IRQT_BOTHEDGE); - if(ret!=0) { - printk(KERN_ERR "GPIOed: failed to register for GPIO %d\n", x); - return 1; - } else { - printk(KERN_ERR "GPIOed: Registered GPIO %d\n", x); - return 0; - } -} - -/*** Request handler ***/ -void handle_request() -{ - char *p = NULL; - unsigned long base = 10; - unsigned long id; - - if((procfs_buffer[0] == 'P') || (procfs_buffer[0] == 'V')) - base = 16; - id = simple_strtoul(procfs_buffer+2, &p, base); - switch(procfs_buffer[0]) { - case 'r': - printk(KERN_ERR "GPIOed: GPIO %lu is %s\n", id, gpio_get(id)?"high":"low "); - break; - case 's': - gpio_watch(id); - break; - case 'h': - gpio_set(id, 1); - printk(KERN_ERR "GPIOed: GPIO %lu set high\n", id); - break; - case 'l': - gpio_set(id, 0); - printk(KERN_ERR "GPIOed: GPIO %lu set low\n", id); - break; - case 'd': - printk(KERN_ERR "GPIOed: GPIO %lu is %s\n", id, GET_GPIO_REG(DR,id)?"output":"input"); - break; - - case 'P': - printk(KERN_ERR "GPIOed: P-V for 0x%x is 0x%x\n", id, (unsigned int)phys_to_virt(id)); - break; - case 'V': - printk(KERN_ERR "GPIOed: V-P for 0x%x is 0x%x\n", id, (unsigned int)virt_to_phys(id)); - break; - case 'D': - base = *((unsigned int*)id); - printk(KERN_ERR "GPIOed: 0x%x = 0x%x\n", id, base); - break; - default: - printk(KERN_ERR "GPIOed: Unknown request\n"); - break; - } -} - -/*** init&exit ***/ -static int __init gpioed_init(void) -{ - my_workqueue = create_workqueue(MY_WORK_QUEUE_NAME); - - proc_intf = create_proc_entry(procfs_name, 0644, NULL); - if (proc_intf == NULL) { - remove_proc_entry(procfs_name, &proc_root); - printk(KERN_ALERT "Error: Could not initialize /proc/%s\n", - procfs_name); - return -ENOMEM; - } - - proc_intf->read_proc = procfile_read; - proc_intf->write_proc = procfile_write; - proc_intf->owner = THIS_MODULE; - proc_intf->mode = S_IFREG | S_IRUGO; - proc_intf->uid = 0; - proc_intf->gid = 0; - proc_intf->size = 37; - - printk(KERN_INFO "/proc/%s created\n", procfs_name); - - return 0; -} - -static void __exit gpioed_exit(void) -{ - destroy_workqueue(my_workqueue); - remove_proc_entry(procfs_name, &proc_root); - printk(KERN_INFO "/proc/%s removed\n", procfs_name); -} - - -/*** Some more stuff ***/ -module_init(gpioed_init); -module_exit(gpioed_exit); - -MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Vladimir \"Farcaller\" Pouzanov <far...@gm...>"); -MODULE_DESCRIPTION("GPIO editor for PXA26x"); - Modified: linux4palm/linux/trunk/drivers/misc/Kconfig =================================================================== --- linux4palm/linux/trunk/drivers/misc/Kconfig 2007-02-27 13:58:12 UTC (rev 882) +++ linux4palm/linux/trunk/drivers/misc/Kconfig 2007-02-27 16:28:55 UTC (rev 883) @@ -34,6 +34,20 @@ Say Y here to enable monitoring of battery and charger using sysfs interface. +config GPIOED + tristate "GPIOED" + depends on ARCH_PXA + default n + help + Gpioed: only for debuging and testing! + +config GPIOEDNG + tristate "GPIOEDNG" + depends on ARCH_PXA + default n + help + Gpioed-ng: only for debuging and testing! + menu "Multimedia Capabilities Port drivers" config MCP Modified: linux4palm/linux/trunk/drivers/misc/Makefile =================================================================== --- linux4palm/linux/trunk/drivers/misc/Makefile 2007-02-27 13:58:12 UTC (rev 882) +++ linux4palm/linux/trunk/drivers/misc/Makefile 2007-02-27 16:28:55 UTC (rev 883) @@ -13,6 +13,8 @@ obj-$(CONFIG_BATTCHARGE_MONITOR) += battchargemon.o +obj-$(CONFIG_GPIOED) += gpioed.o +obj-$(CONFIG_GPIOEDNG) += gpioed-ng.o obj-$(CONFIG_MCP) += mcp-core.o obj-$(CONFIG_MCP_SA1100) += mcp-sa1100.o Added: linux4palm/linux/trunk/drivers/misc/gpioed-ng.c =================================================================== --- linux4palm/linux/trunk/drivers/misc/gpioed-ng.c (rev 0) +++ linux4palm/linux/trunk/drivers/misc/gpioed-ng.c 2007-02-27 16:28:55 UTC (rev 883) @@ -0,0 +1,175 @@ +#include <linux/module.h> +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/proc_fs.h> + +#include <linux/interrupt.h> +#include <asm/irq.h> +#include <asm/mach/arch.h> +#include <asm/mach/map.h> +#include <asm/mach-types.h> +#include <asm/hardware.h> +#include <linux/sched.h> +#include <linux/workqueue.h> +#include <asm/arch/pxa-regs.h> +#include <asm/arch/irqs.h> +#include <asm/uaccess.h> + +#include <linux/debugfs.h> +#include <linux/seq_file.h> + +#define PROCFS_NAME "gpio" +#define DEBUGFS_NAME "gpio" + +static struct proc_dir_entry *proc_intf; +static struct dentry *debugfs_intf; + +#define PROCFS_MAX_SIZE 20 + +static char procfs_buffer[PROCFS_MAX_SIZE]; +static unsigned long procfs_buffer_size = 0; + +#define GPIO_TEST(reg, gp) (reg(gp) & GPIO_bit(gp)) +static int dfs_show(struct seq_file *s, void *_) +{ + int i,afn; + seq_printf(s, "GPIO lines status:\n"); + + for(i=0;i<121;i++) { + afn = (GAFR(i) & (0x3 << (((i) & 0xf)*2))) >> (((i) & 0xf)*2); + seq_printf(s, "%s%d: %s %s %s %s %08x\n", + i<10?"0":"", + i, + GPIO_TEST(GPLR, i)?"*":" ", + GPIO_TEST(GPDR, i)?"->":"<-", + GPIO_TEST(GRER, i)?"_/":" ", + GPIO_TEST(GFER, i)?"\\_":" ", + afn); + + } + + return 0; +} + +static int dfs_open(struct inode *inode, struct file *file) +{ + return single_open(file, dfs_show, inode->i_private); +} + +static struct file_operations debug_fops = { + .open = dfs_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + +static void gpio_set(int id, int on) +{ + do { + if (on) + GPSR(id) = GPIO_bit(id); + else + GPCR(id) = GPIO_bit(id); + } while (0); +} + +void set_afn(int gpio, int fn) +{ + int gafr; + gafr = GAFR(gpio) & ~(0x3 << (((gpio) & 0xf)*2)); + GAFR(gpio) = gafr | (fn << (((gpio) & 0xf)*2)); +} + +void handle_request(void) +{ + char *p = NULL; + unsigned long id = simple_strtoul(procfs_buffer+2, &p, 10); + switch(procfs_buffer[0]) { + case 'L': + gpio_set(id, 1); + printk(KERN_ERR "GPIOed: GPIO %lu set high\n", id); + break; + case 'l': + gpio_set(id, 0); + printk(KERN_ERR "GPIOed: GPIO %lu set low\n", id); + break; + case 'd': + GPDR(id) &= ~(GPIO_bit(id)); + break; + case 'D': + GPDR(id) |= GPIO_bit(id); + break; + case '0': + set_afn(id, 0); + break; + case '1': + set_afn(id, 1); + break; + case '2': + set_afn(id, 2); + break; + default: + printk(KERN_ERR "GPIOed: Unknown request\n"); + break; + } +} + + +int procfile_write(struct file *file, const char *buffer, unsigned long count, void *data) +{ + procfs_buffer_size = count; + if (procfs_buffer_size > PROCFS_MAX_SIZE ) { + procfs_buffer_size = PROCFS_MAX_SIZE; + } + + /* write data to the buffer */ + if ( copy_from_user(procfs_buffer, buffer, procfs_buffer_size) ) { + return -EFAULT; + } + + handle_request(); + + return procfs_buffer_size; +} + + +static int __init gpioed_init(void) +{ + proc_intf = create_proc_entry(PROCFS_NAME, 0644, NULL); + if (proc_intf == NULL) { + remove_proc_entry(PROCFS_NAME, &proc_root); + printk(KERN_ALERT "Error: Could not initialize /proc/%s\n", PROCFS_NAME); + return -ENOMEM; + } + + /*proc_intf->read_proc = procfile_read;*/ + proc_intf->write_proc = procfile_write; + proc_intf->owner = THIS_MODULE; + proc_intf->mode = S_IFREG | S_IRUGO; + proc_intf->uid = 0; + proc_intf->gid = 0; + proc_intf->size = 37; + + debugfs_intf = debugfs_create_file(DEBUGFS_NAME, S_IRUGO, NULL, NULL, &debug_fops); + + printk(KERN_INFO "/proc/%s created\n", PROCFS_NAME); + + return 0; +} + +static void __exit gpioed_exit(void) +{ + debugfs_remove(debugfs_intf); + remove_proc_entry(PROCFS_NAME, &proc_root); + printk(KERN_INFO "/proc/%s removed\n", PROCFS_NAME); +} + + +/*** Some more stuff ***/ +module_init(gpioed_init); +module_exit(gpioed_exit); + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Vladimir \"Farcaller\" Pouzanov <far...@gm...>"); +MODULE_DESCRIPTION("GPIO editor for PXA26x, second edition"); + Added: linux4palm/linux/trunk/drivers/misc/gpioed.c =================================================================== --- linux4palm/linux/trunk/drivers/misc/gpioed.c (rev 0) +++ linux4palm/linux/trunk/drivers/misc/gpioed.c 2007-02-27 16:28:55 UTC (rev 883) @@ -0,0 +1,210 @@ +/*** Basic includes ***/ +#include <linux/module.h> +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/proc_fs.h> +#include <linux/irq.h> + +#include <linux/interrupt.h> +#include <asm/irq.h> +#include <asm/mach/arch.h> +#include <asm/mach/map.h> +#include <asm/mach-types.h> +#include <asm/hardware.h> +#include <linux/sched.h> +#include <linux/workqueue.h> +#include <asm/arch/pxa-regs.h> +#include <asm/arch/irqs.h> +#include <asm/uaccess.h> + +#define GET_GPIO_REG(reg,gpio) (GP##reg(gpio) & GPIO_bit(gpio)) +#define GET_GPIO(gpio) GET_GPIO_REG(LR, gpio) + +/*** /proc interface ***/ +static struct proc_dir_entry *proc_intf; +#define procfs_name "gpioed" +#define PROCFS_MAX_SIZE 20 + +static char procfs_buffer[PROCFS_MAX_SIZE]; +static unsigned long procfs_buffer_size = 0; +unsigned int gpioed_irq; + +int procfile_read(char *buffer, char **buffer_location, off_t offset, int buffer_length, int *eof, void *data) +{ + int ret; + + if (offset > 0) { + /* we have finished to read, return 0 */ + ret = 0; + } else { + /* fill the buffer, return the buffer size */ + ret = sprintf(buffer, "HelloWorld!\n"); + } + return ret; +} + +void handle_request(void); + +int procfile_write(struct file *file, const char *buffer, unsigned long count, void *data) +{ + procfs_buffer_size = count; + if (procfs_buffer_size > PROCFS_MAX_SIZE ) { + procfs_buffer_size = PROCFS_MAX_SIZE; + } + + /* write data to the buffer */ + if ( copy_from_user(procfs_buffer, buffer, procfs_buffer_size) ) { + return -EFAULT; + } + + handle_request(); + + return procfs_buffer_size; +} + +/*** IRQ (GPIO) handling ***/ +static struct workqueue_struct *my_workqueue; +#define MY_WORK_QUEUE_NAME "GPIOed" + +static void handle_gpio(struct work_struct *work) +{ + printk(KERN_ERR "*** GPIO *** %d *** is *** %s ***\n", + gpioed_irq, GET_GPIO(gpioed_irq) ? "high" : "low "); +} + +irqreturn_t gpio_irq(int irq, void *dev_id) +{ + static int initialised = 0; + struct work_struct gpioed_ws; + + gpioed_irq=(int)irq; + + if (initialised == 0) { + INIT_WORK(&gpioed_ws, handle_gpio); + initialised = 1; + } else { + PREPARE_WORK(&gpioed_ws, handle_gpio); + } + + queue_work(my_workqueue, &gpioed_ws); + + return IRQ_HANDLED; +} + +/*** GPIO R/W ***/ +static int gpio_get(int id) +{ + return GET_GPIO(id); +} + +static void gpio_set(int id, int on) +{ + do { + if (on) + GPSR(id) = GPIO_bit(id); + else + GPCR(id) = GPIO_bit(id); + } while (0); +} + +static int gpio_watch(int x) +{ + int ret; + ret = request_irq (IRQ_GPIO(x), gpio_irq, SA_SAMPLE_RANDOM, "test_handler", (void*)x); + set_irq_type (IRQ_GPIO(x), IRQT_BOTHEDGE); + if(ret!=0) { + printk(KERN_ERR "GPIOed: failed to register for GPIO %d\n", x); + return 1; + } else { + printk(KERN_ERR "GPIOed: Registered GPIO %d\n", x); + return 0; + } +} + +/*** Request handler ***/ +void handle_request() +{ + char *p = NULL; + unsigned long base = 10; + unsigned long id; + + if((procfs_buffer[0] == 'P') || (procfs_buffer[0] == 'V')) + base = 16; + id = simple_strtoul(procfs_buffer+2, &p, base); + switch(procfs_buffer[0]) { + case 'r': + printk(KERN_ERR "GPIOed: GPIO %lu is %s\n", id, gpio_get(id)?"high":"low "); + break; + case 's': + gpio_watch(id); + break; + case 'h': + gpio_set(id, 1); + printk(KERN_ERR "GPIOed: GPIO %lu set high\n", id); + break; + case 'l': + gpio_set(id, 0); + printk(KERN_ERR "GPIOed: GPIO %lu set low\n", id); + break; + case 'd': + printk(KERN_ERR "GPIOed: GPIO %lu is %s\n", id, GET_GPIO_REG(DR,id)?"output":"input"); + break; + + case 'P': + printk(KERN_ERR "GPIOed: P-V for 0x%lu is 0x%x\n", id, (unsigned int)phys_to_virt(id)); + break; + case 'V': + printk(KERN_ERR "GPIOed: V-P for 0x%lu is 0x%x\n", id, (unsigned int)virt_to_phys(&id)); + break; + case 'D': + base = *((unsigned int*)id); + printk(KERN_ERR "GPIOed: 0x%lu = 0x%lu\n", id, base); + break; + default: + printk(KERN_ERR "GPIOed: Unknown request\n"); + break; + } +} + +/*** init&exit ***/ +static int __init gpioed_init(void) +{ + my_workqueue = create_workqueue(MY_WORK_QUEUE_NAME); + + proc_intf = create_proc_entry(procfs_name, 0644, NULL); + if (proc_intf == NULL) { + remove_proc_entry(procfs_name, &proc_root); + printk(KERN_ALERT "Error: Could not initialize /proc/%s\n", + procfs_name); + return -ENOMEM; + } + + proc_intf->read_proc = procfile_read; + proc_intf->write_proc = procfile_write; + proc_intf->owner = THIS_MODULE; + proc_intf->mode = S_IFREG | S_IRUGO; + proc_intf->uid = 0; + proc_intf->gid = 0; + proc_intf->size = 37; + + printk(KERN_INFO "/proc/%s created\n", procfs_name); + + return 0; +} + +static void __exit gpioed_exit(void) +{ + destroy_workqueue(my_workqueue); + remove_proc_entry(procfs_name, &proc_root); + printk(KERN_INFO "/proc/%s removed\n", procfs_name); +} + + +/*** Some more stuff ***/ +module_init(gpioed_init); +module_exit(gpioed_exit); + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Vladimir \"Farcaller\" Pouzanov <far...@gm...>"); +MODULE_DESCRIPTION("GPIO editor for PXA2xx"); + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sle...@us...> - 2007-03-10 00:20:35
|
Revision: 903 http://svn.sourceforge.net/hackndev/?rev=903&view=rev Author: sleep_walker Date: 2007-03-09 16:20:31 -0800 (Fri, 09 Mar 2007) Log Message: ----------- l4p: RTC Palm problem fix candidate Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/Kconfig linux4palm/linux/trunk/drivers/rtc/Kconfig linux4palm/linux/trunk/drivers/rtc/rtc-lib.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/Kconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/Kconfig 2007-03-10 00:13:47 UTC (rev 902) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/Kconfig 2007-03-10 00:20:31 UTC (rev 903) @@ -184,13 +184,6 @@ to work around certain bootloaders overwriting them during resume. -config PXA_RTC_EPOCH - int "PXA RTC epoch year" - default "1970" - help - The default Linux epoch Jan 1st 1970, however to - operate alongside PalmOS nicely, change this to 1904. - config PXA_SUSPEND_SAVE_EXTRA_REGS bool help Modified: linux4palm/linux/trunk/drivers/rtc/Kconfig =================================================================== --- linux4palm/linux/trunk/drivers/rtc/Kconfig 2007-03-10 00:13:47 UTC (rev 902) +++ linux4palm/linux/trunk/drivers/rtc/Kconfig 2007-03-10 00:20:31 UTC (rev 903) @@ -37,6 +37,13 @@ The RTC device that will be used as the source for the system time, usually rtc0. +config RTC_EPOCH + int "RTC epoch year" + default "1970" + help + The default Linux epoch Jan 1st 1970, however to + operate alongside PalmOS nicely, change this to 1904. + config RTC_DEBUG bool "RTC debug support" depends on RTC_CLASS = y Modified: linux4palm/linux/trunk/drivers/rtc/rtc-lib.c =================================================================== --- linux4palm/linux/trunk/drivers/rtc/rtc-lib.c 2007-03-10 00:13:47 UTC (rev 902) +++ linux4palm/linux/trunk/drivers/rtc/rtc-lib.c 2007-03-10 00:20:31 UTC (rev 903) @@ -28,6 +28,12 @@ #define LEAPS_THRU_END_OF(y) ((y)/4 - (y)/100 + (y)/400) #define LEAP_YEAR(year) ((!(year % 4) && (year % 100)) || !(year % 400)) +#ifdef CONFIG_RTC_EPOCH +#define EPOCH_YEAR CONFIG_RTC_EPOCH +#else +#define EPOCH_YEAR 1970 +#endif + /* * The number of days in the month. */ @@ -46,8 +52,14 @@ } EXPORT_SYMBOL(rtc_year_days); +#define EPOCH_YEAR_DAYS_DIFFERENCE ((1970 - EPOCH_YEAR) * 365 - LEAPS_THRU_END_OF(EPOCH_YEAR - 1)) + + /* * Convert seconds since 01-01-1970 00:00:00 to Gregorian date. + + * Added support for other years than 1970 + * needed for example for Palm PDAs */ void rtc_time_to_tm(unsigned long time, struct rtc_time *tm) { @@ -57,12 +69,14 @@ time -= days * 86400; /* day of the week, 1970-01-01 was a Thursday */ - tm->tm_wday = (days + 4) % 7; + /* and between 1970-01-01 and EPOCH_YEAR was EPOCH_YEAR_DAYS_DIFFERENCE days */ + tm->tm_wday = (days + EPOCH_YEAR_DAYS_DIFFERENCE + 4) % 7; - year = 1970 + days / 365; - days -= (year - 1970) * 365 - + LEAPS_THRU_END_OF(year - 1) - - LEAPS_THRU_END_OF(1970 - 1); + year = EPOCH_YEAR + days / 365; + days -= (year - EPOCH_YEAR) * 365 + + LEAPS_THRU_END_OF(year - 1) + - LEAPS_THRU_END_OF(EPOCH_YEAR - 1); + if (days < 0) { year -= 1; days += 365 + LEAP_YEAR(year); @@ -93,8 +107,7 @@ */ int rtc_valid_tm(struct rtc_time *tm) { - if (tm->tm_year < 70 - || ((unsigned)tm->tm_mon) >= 12 + if (((unsigned)tm->tm_mon) >= 12 || tm->tm_mday < 1 || tm->tm_mday > rtc_month_days(tm->tm_mon, tm->tm_year + 1900) || ((unsigned)tm->tm_hour) >= 24 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z7...@us...> - 2007-03-19 00:35:46
|
Revision: 920 http://svn.sourceforge.net/hackndev/?rev=920&view=rev Author: z72ka Date: 2007-03-18 12:35:13 -0700 (Sun, 18 Mar 2007) Log Message: ----------- palmz72: Make irda to work - found IR SD GPIO and rewritten IRDA init to pxafcpi - power management, found GPIO for blank screen, blank screen is used for better and nice resume LCD Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpio_map.txt linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-gpio.h Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpio_map.txt =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpio_map.txt 2007-03-18 19:18:56 UTC (rev 919) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpio_map.txt 2007-03-18 19:35:13 UTC (rev 920) @@ -1,5 +1,5 @@ GPIO pin Level Dir Function -GPIO_0 0 I 00 POWER detect +GPIO_0 0 I 00 Low POWER detect? GPIO_1 1 I 00 GPIO_2 1 O 00 SYS_EN GPIO_3 1 O 00 @@ -13,12 +13,12 @@ GPIO_11 0 I 00 GPIO_12 1 I 00 USB_PULLUP GPIO_13 0 I 02 KP_DKIN7 // Voice Memo button -GPIO_14 0 I 00 +GPIO_14 0 I 00 SD card inserted GPIO_15 0 I 00 USB_DETECT GPIO_16 1 O 02 PWM_OUT0 GPIO_17 1 O 00 Bluetooth: 1 when enabled in POS GPIO_18 0 O 00 -GPIO_19 1 O 00 +GPIO_19 1 O 00 Screen goes white when 0 GPIO_20 1 O 00 GPIO_21 0 O 00 GPIO_22 0 O 00 @@ -48,7 +48,7 @@ GPIO_46 1 I 02 STD_RXD GPIO_47 0 O 01 STD_TXD GPIO_48 1 I 01 CIF_DD5 -GPIO_49 0 O 00 +GPIO_49 0 O 00 IR_SD GPIO_50 1 I 01 CIF_DD3 GPIO_51 1 I 01 CIF_DD2 GPIO_52 1 I 01 CIF_DD4 Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c 2007-03-18 19:18:56 UTC (rev 919) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c 2007-03-18 19:35:13 UTC (rev 920) @@ -21,6 +21,7 @@ #include <linux/platform_device.h> #include <linux/fb.h> #include <linux/irq.h> +#include <linux/delay.h> #include <asm/arch/audio.h> #include <asm/arch/hardware.h> @@ -30,7 +31,6 @@ #include <asm/arch/pxa27x_keyboard.h> #include <asm/arch/pxa-pm_ll.h> #include <asm/arch/pxapwm-bl.h> -#include <asm/arch/irda.h> #include <asm/arch/serial.h> #include <linux/gpio_keys.h> @@ -208,64 +208,40 @@ /******** * IRDA * ********/ -/* -static void -palmz72_irda_configure (struct uart_pxa_port *up, int enable) -{ - // Switch STUART RX/TX pins to SIR - pxa_gpio_mode( GPIO_NR_PALMZ72_STD_RXD_MD ); - pxa_gpio_mode( GPIO_NR_PALMZ72_STD_TXD_MD ); - // make sure FIR ICP is off - ICCR0 = 0; - if (enable) { - // configure STUART to for SIR - STISR = STISR_XMODE | STISR_RCVEIR | STISR_RXPL; - GPSR(91) = GPIO_bit(91); - } else { - STISR = 0; - } -} - -static void -palmz72_irda_set_txrx (struct uart_pxa_port *up, int txrx) +static void palmz72_irda_transceiver_mode(struct device *dev, int mode) { - unsigned old_stisr = STISR; - unsigned new_stisr = old_stisr; + unsigned long flags; + + local_irq_save(flags); - if (txrx & PXA_SERIAL_TX) { - // Ignore RX if TX is set - txrx &= PXA_SERIAL_TX; - new_stisr |= STISR_XMITIR; - } else - new_stisr &= ~STISR_XMITIR; + if (mode & IR_SIRMODE){ + printk (KERN_INFO "IRDA: setting mode to SIR\n"); + } + else if (mode & IR_FIRMODE){ + printk (KERN_INFO "IRDA: setting mode to FIR\n"); + } + if (mode & IR_OFF){ + printk (KERN_INFO "IRDA: turning OFF\n"); + SET_PALMZ72_GPIO(IR_SD, 1); + } + else { + printk (KERN_INFO "IRDA: turning ON\n"); + SET_PALMZ72_GPIO(IR_SD, 0); + SET_PALMZ72_GPIO(ICP_TXD_MD, 1); + mdelay(30); + SET_PALMZ72_GPIO(ICP_TXD_MD, 0); + } - if (txrx & PXA_SERIAL_RX) - new_stisr |= STISR_RCVEIR; - else - new_stisr &= ~STISR_RCVEIR; - - if (new_stisr != old_stisr) { - while (!(STLSR & LSR_TEMT)) - ; - STISR = new_stisr; - } + local_irq_restore(flags); } -static int -palmz72_irda_get_txrx (struct uart_pxa_port *up) -{ - return ((STISR & STISR_XMITIR) ? PXA_SERIAL_TX : 0) | - ((STISR & STISR_RCVEIR) ? PXA_SERIAL_RX : 0); -} - -static struct platform_pxa_serial_funcs palmz72_pxa_irda_funcs = { - .configure = palmz72_irda_configure, - .set_txrx = palmz72_irda_set_txrx, - .get_txrx = palmz72_irda_get_txrx, +static struct pxaficp_platform_data palmz72_ficp_platform_data = { + .transceiver_cap = IR_SIRMODE | IR_FIRMODE | IR_OFF, + .transceiver_mode = palmz72_irda_transceiver_mode, }; -*/ + /************************* * AC97 audio controller * *************************/ @@ -373,7 +349,6 @@ &palmz72_pm, &palmz72_backlight, &palmz72_keypad, - //&palmz72_pxa_irda_funcs #ifdef CONFIG_GPIO_KEYS &palmz72_pxa_keys, #endif @@ -408,8 +383,8 @@ set_pxa_fb_info( &palmz72_lcd_screen ); pxa_set_mci_info( &palmz72_mci_platform_data ); - pxa_set_udc_info(&palmz72_udc_mach_info ); - //stuart_device.dev.platform_data = &palmz72_pxa_irda_funcs; + pxa_set_udc_info( &palmz72_udc_mach_info ); + pxa_set_ficp_info( &palmz72_ficp_platform_data ); platform_add_devices( devices, ARRAY_SIZE(devices) ); } 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-18 19:18:56 UTC (rev 919) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c 2007-03-18 19:35:13 UTC (rev 920) @@ -46,7 +46,7 @@ /* Wakeup by keyboard :) */ PKWR = 0xe0001; - /* Enabled Deep-Sleep mode ?? */ + /* Enabled Deep-Sleep mode */ PCFR |= PCFR_DS; /* Low power mode */ @@ -61,6 +61,8 @@ /* Turn off LCD power */ SET_PALMZ72_GPIO(LCD_POWER,0); + /* Turn screen off */ + SET_PALMZ72_GPIO(SCREEN,0); /* Turn off USB power */ SET_PALMZ72_GPIO(USB_POWER,0); @@ -85,6 +87,8 @@ /* Turn on LCD power */ SET_PALMZ72_GPIO(LCD_POWER,1); + /* Turn screen on */ + SET_PALMZ72_GPIO(SCREEN,1); /* Turn on USB power */ SET_PALMZ72_GPIO(USB_POWER,1); Modified: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-gpio.h =================================================================== --- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-gpio.h 2007-03-18 19:18:56 UTC (rev 919) +++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-gpio.h 2007-03-18 19:35:13 UTC (rev 920) @@ -40,14 +40,16 @@ #define GPIO_NR_PALMZ72_LED_MD (GPIO_NR_PALMZ72_LED | GPIO_ALT_FN_1_OUT) -/* Serial */ +/* IRDA */ -#define GPIO_NR_PALMZ72_STD_RXD 46 -#define GPIO_NR_PALMZ72_STD_TXD 47 -#define GPIO_NR_PALMZ72_STD_RXD_MD (GPIO_NR_PALMZ72_STD_RXD | GPIO_ALT_FN_2_IN) -#define GPIO_NR_PALMZ72_STD_TXD_MD (GPIO_NR_PALMZ72_STD_TXD | GPIO_ALT_FN_1_OUT) +#define GPIO_NR_PALMZ72_IR_SD 49 +#define GPIO_NR_PALMZ72_ICP_RXD 46 +#define GPIO_NR_PALMZ72_ICP_TXD 47 +#define GPIO_NR_PALMZ72_ICP_RXD_MD (GPIO_NR_PALMZ72_ICP_RXD | GPIO_ALT_FN_1_IN) +#define GPIO_NR_PALMZ72_ICP_TXD_MD (GPIO_NR_PALMZ72_ICP_TXD | GPIO_ALT_FN_2_OUT) + /* Wolfson WM9712 */ #define GPIO_NR_PALMZ72_WM9712_IRQ 27 @@ -75,6 +77,7 @@ #define GPIO_NR_PALMZ72_GPIO_RESET 1 #define IRQ_GPIO_PALMZ72_GPIO_RESET IRQ_GPIO(GPIO_NR_PALMZ72_GPIO_RESET) +#define GPIO_NR_PALMZ72_SCREEN 19 //screen on when this GPIO is 1 /* Utility macros */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |