You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(26) |
Sep
(22) |
Oct
(55) |
Nov
(24) |
Dec
(30) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(68) |
Feb
(85) |
Mar
(54) |
Apr
(12) |
May
(52) |
Jun
(75) |
Jul
(116) |
Aug
(71) |
Sep
(54) |
Oct
|
Nov
(2) |
Dec
|
From: <bob...@us...> - 2007-01-13 11:31:49
|
Revision: 757 http://svn.sourceforge.net/hackndev/?rev=757&view=rev Author: bobofdoom Date: 2007-01-13 03:31:46 -0800 (Sat, 13 Jan 2007) Log Message: ----------- palmt650: Added reset of phone module on boot. Modified Paths: -------------- linux4palm/linux/trunk/drivers/leds/leds-palmt650.c Modified: linux4palm/linux/trunk/drivers/leds/leds-palmt650.c =================================================================== --- linux4palm/linux/trunk/drivers/leds/leds-palmt650.c 2007-01-13 09:43:38 UTC (rev 756) +++ linux4palm/linux/trunk/drivers/leds/leds-palmt650.c 2007-01-13 11:31:46 UTC (rev 757) @@ -147,6 +147,12 @@ /* enable red LED + keypad control, possibly GPIO related reg. */ asic6_write(0x12, 0xe3); + /* FIXME: should be moved to seperate phone driver */ + printk("Attempting to reset phone module...\n"); + asic6_write(0x48, asic6_read(0x48) & ~0x40); + msleep(5); + asic6_write(0x48, asic6_read(0x48) | 0x40); + return ret; vibra_err: led_classdev_unregister(&palmt650_keypad_led); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bob...@us...> - 2007-01-13 09:43:41
|
Revision: 756 http://svn.sourceforge.net/hackndev/?rev=756&view=rev Author: bobofdoom Date: 2007-01-13 01:43:38 -0800 (Sat, 13 Jan 2007) Log Message: ----------- tools: Added primitive (on-device) phone console tool. Added Paths: ----------- linux4palm/tools/phone/ linux4palm/tools/phone/atcons.py Added: linux4palm/tools/phone/atcons.py =================================================================== --- linux4palm/tools/phone/atcons.py (rev 0) +++ linux4palm/tools/phone/atcons.py 2007-01-13 09:43:38 UTC (rev 756) @@ -0,0 +1,85 @@ +#!/usr/bin/env python +# +# Experimental AT command console for the Treo 650 GSM +# + +import serial, sys, threading, termios, tty + +import os,sys +import sys +import termios + +FILTER=''.join([(len(repr(chr(x)))==3) and chr(x) or '.' for x in range(256)]) + +def dump(src, length=8): + N=0; result='' + while src: + s,src = src[:length],src[length:] + hexa = ' '.join(["%02X"%ord(x) for x in s]) + s = s.translate(FILTER) + result += "%04X %-*s %s\n" % (N, length*3, hexa, s) + N+=length + return result + +def getchar(): + ''' + Equivale al comando getchar() di C + http://www.bigbold.com/snippets/posts/show/3084 + ''' + + fd = sys.stdin.fileno() + + if os.isatty(fd): + + old = termios.tcgetattr(fd) + new = termios.tcgetattr(fd) + new[3] = new[3] & ~termios.ICANON & ~termios.ECHO + new[6] [termios.VMIN] = 1 + new[6] [termios.VTIME] = 0 + + try: + termios.tcsetattr(fd, termios.TCSANOW, new) + termios.tcsendbreak(fd,0) + ch = os.read(fd,7) + + finally: + termios.tcsetattr(fd, termios.TCSAFLUSH, old) + else: + ch = os.read(fd,7) + + return(ch) + + +readbuf = '' + +def read_thread(ser): + global readbuf + while 1: + c = ser.read() + readbuf += c + if c != '\r': + sys.stdout.write(c) + sys.stdout.flush() + +def main(): + if len(sys.argv) > 1: + port = sys.argv[1] + else: + port = '/dev/ttyS0' + ser = serial.Serial(port, 460800) #460800) + try: + ser.setRTS(1) + except IOError, e: + print 'Unable set RTS high:', e + t = threading.Thread(target=read_thread, args=(ser,)) + t.setDaemon(True) + t.start() + + while 1: + c = getchar() + if c == '\x01': print dump(readbuf); continue + if c == '\x7f': c = chr(8) # send BS not DEL + if c == '\n': ser.write('\r') + ser.write(c) + +if __name__ == '__main__': main() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bob...@us...> - 2007-01-13 08:19:54
|
Revision: 755 http://svn.sourceforge.net/hackndev/?rev=755&view=rev Author: bobofdoom Date: 2007-01-13 00:19:53 -0800 (Sat, 13 Jan 2007) Log Message: ----------- tools: Added treo debug bootloader wrapper tool. Added Paths: ----------- linux4palm/tools/treodebug.py Added: linux4palm/tools/treodebug.py =================================================================== --- linux4palm/tools/treodebug.py (rev 0) +++ linux4palm/tools/treodebug.py 2007-01-13 08:19:53 UTC (rev 755) @@ -0,0 +1,121 @@ +#!/usr/bin/env python +# +# Requires pyserial (see http://pyserial.sf.net/) +# +import serial, readline, atexit, sys + +# Register addresses +GPLR = [0xA8E00000, 0xA8E00004, 0xA8E00008, 0xA8E00100] +GPDR = [0xA8E0000C, 0xA8E00010, 0xA8E00014, 0xA8E0010C] +GPSR = [0xA8E00018, 0xA8E0001C, 0xA8E00020, 0xA8E00118] +GPCR = [0xA8E00024, 0xA8E00028, 0xA8E0002c, 0xA8E00124] +GRER = [0xA8E00030, 0xA8E00034, 0xA8E00038, 0xA8E00130] +GFER = [0xA8E0003C, 0xA8E00040, 0xA8E00044, 0xA8E0013C] +GEDR = [0xA8E00048, 0xA8E0004C, 0xA8E00050, 0xA8E00148] +GAFR = [0xA8E00054, 0xA8E00058, 0xA8E0005c, 0xA8E00060, + 0xA8E00064, 0xA8E00068, 0xA8E0006c, 0xA8E00070] + +def openhist(): + import os + histfile = os.path.join(os.environ["HOME"], ".treodebughist") + try: + readline.read_history_file(histfile) + except IOError: + pass + atexit.register(readline.write_history_file, histfile) + del os, histfile + + +def dumpmem(start, count): + f = file('treodump.bin','wb') + ser.write('mb %x %x\r\n' % (start, count)) + written = 0 + while written < count: + line = ser.readline().strip() + print line + if len(line) < 9 or line[8] != ':': continue + bits = line.split() + bin = ''.join([chr(int(x,16)) for x in bits[1:9] + bits[10:18]]) + written += len(bin) + f.write(bin) + + f.close() + + +def gpiotable(): + try: + import gpio_wiki_tool + except LibraryError: + print 'Unable to load gpio_wiki_tool.py' + return + + def readreg(reg): + ser.write('mw %x 1\r\n' % reg) + for line in ser.readlines(): + print line.strip() + if len(line) >= 9 and line[8] == ':': + code = '-' + i = 1 + while code == '-': + code = line.split()[i] + i+= 1 + return int(code, 16) + break + + gpio_wiki_tool.GPLR = map(readreg, GPLR) + gpio_wiki_tool.GPDR = map(readreg, GPDR) + gpio_wiki_tool.GRER = map(readreg, GRER) + gpio_wiki_tool.GFER = map(readreg, GFER) + gpio_wiki_tool.GAFR = map(readreg, GAFR) + gpio_wiki_tool.main() + +def loadimg(fn): + import struct + try: + f = file(fn, 'rb') + except IOError, e: + print 'Unable to open', fn + print e + return + + i = 0xa1000000 + while 1: + buf = f.read(4) + if buf == '': break + while len(buf) < 4: + buf += '\0' + + dat, = struct.unpack('<I', buf) + ser.write('mw %x 1 %x\r\n' % (i, dat)) + if i % 0x100 == 0: + lines = ser.readlines() + print ''.join(lines).replace('\r','') + i+=4 + +def docmd(ser, buf): + words = buf.split() + if buf == 'exit': sys.exit(0) + if words[0] == 'dump': return dumpmem(int(words[1],16), int(words[2],16)) + if words[0] == 'gpiotable': return gpiotable() + if words[0] == 'loadimg': return loadimg(' '.join(words[1:])) + + ser.write(buf + '\r\n') + +def main(): + global ser + openhist() + ser = serial.Serial('/dev/ttyUSB0', 115200, timeout=0.01) + try: + while 1: + lines = ser.readlines() + print ''.join(lines).replace('\r','') + buf = raw_input() + docmd(ser, buf) + finally: + ser.close() + + + + + +if __name__ == '__main__': main() Property changes on: linux4palm/tools/treodebug.py ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bob...@us...> - 2007-01-13 08:17:05
|
Revision: 754 http://svn.sourceforge.net/hackndev/?rev=754&view=rev Author: bobofdoom Date: 2007-01-13 00:17:00 -0800 (Sat, 13 Jan 2007) Log Message: ----------- gpio wiki tool: Added automated naming of alternate functions. Modified Paths: -------------- linux4palm/tools/gpio_wiki_tool.py Modified: linux4palm/tools/gpio_wiki_tool.py =================================================================== --- linux4palm/tools/gpio_wiki_tool.py 2007-01-11 12:10:39 UTC (rev 753) +++ linux4palm/tools/gpio_wiki_tool.py 2007-01-13 08:17:00 UTC (rev 754) @@ -7,20 +7,21 @@ gpio_count = 120 # GPIO direction registers -GPDR = [0xC3EF001CL, 0xFF22AB53L, 0x9B1CFFFFL, 0x01F7E785L] +#GPDR = [0xC3EF001CL, 0xFF22AB53L, 0x9B1CFFFFL, 0x01F7E785L] +GPDR = [0xcf9905fc, 0xff623ba1, 0x93ccffff, 0x007dff81] # GPIO alternate function registers (go 0_L, 0_U, 1_L, 1_U ...) -GAFR = [0x08000000L, 0xA51A8002L, 0x69989940L, 0x69989940L, 0x0AAAAAAAL, 0x08040C08L, - 0x010A950CL, 0x00001400L] +GAFR = [0x0e0000000L, 0xA500001aL, 0x00088052L, 0xaaa04959L, 0x22AAAAAAL, 0x45440f08L, + 0x56aa95ff, 0x00001401L] # GPIO level registers GPLR = [0x051BA5FFL, 0x65FD5FBCL, 0x42FB2D93L, 0x0066138DL] # GPIO rising edge detect -GRER = [0x08004800L, 0L, 0x04000000L, 0x00000800L] +GRER = [0x0020c800L, 0L, 0x04000000L, 0x00000000L] # GPIO falling edge detect -GFER = [0x0000C400L, 0x00000080L, 0L, 0x00000800L] +GFER = [0x00208000L, 0x00000000L, 0L, 0x00000000L] # End of data @@ -43,7 +44,7 @@ if get_bit(n, GFER): ed += 'FE ' if not ed: ed = ' ' - comment = ' ' + comment = AF_NAMES.get((n, direc, int(af)), ' ') # print print "||'''" + str(n) + "'''||" + direc + "||" + level + "||" + af + "||" + ed + "||" + comment + "||" @@ -63,4 +64,147 @@ * Function - description""" +# note this list doesn't contain all pxa270 alternate functions +AF_NAMES = { +( 1, "In", 1): "RTS", +( 6, "Out", 1): "MMCCLK", +( 7, "Out", 1): "48MHz", +( 8, "Out", 1): "MMCCS0", +( 9, "Out", 1): "MMCCS1", +( 10, "Out", 1): "RTCCLK", +( 11, "Out", 1): "3_6MHz", +( 12, "Out", 1): "32KHz", +( 13, "Out", 2): "MBGNT", +( 14, "In", 1): "MBREQ", +( 15, "Out", 2): "nCS_1", +( 16, "Out", 2): "PWM0", +( 17, "Out", 2): "PWM1", +( 17, "In", 2): "CIF_DD<6>", +( 18, "In", 1): "RDY", +( 19, "In", 1): "DREQ1", +( 20, "In", 1): "DREQ0", +( 23, "Out", 2): "SCLK", +( 24, "Out", 2): "SFRM", +( 25, "Out", 2): "STXD", +( 26, "In", 1): "SRXD", +( 27, "In", 1): "SEXTCLK", +( 28, "In", 1): "BITCLK_AC97", +( 28, "In", 2): "BITCLK_In_I2S", +( 28, "Out", 1): "BITCLK_Out_I2S", +( 29, "In", 1): "SDATA_In_AC97", +( 29, "In", 2): "SDATA_In_I2S", +( 30, "Out", 2): "SDATA_Out_AC97", +( 30, "Out", 1): "SDATA_Out_I2S", +( 31, "Out", 1): "SYNC_I2S", +( 31, "Out", 2): "SYNC_AC97", +( 32, "In", 1): "SDATA_In1_AC97", +( 32, "Out", 1): "SYSCLK_I2S", +( 32, "Out", 2): "MMCCLK", +( 33, "Out", 2): "nCS_5", +( 34, "In", 1): "FFRXD", +( 34, "Out", 2): "MMCCS0", +( 35, "In", 1): "FFCTS", +( 36, "In", 1): "FFDCD", +( 37, "In", 1): "FFDSR", +( 38, "In", 1): "FFRI", +( 39, "Out", 1): "MMCCS1", +( 39, "Out", 2): "FFTXD", +( 40, "Out", 2): "FFDTR", +( 41, "Out", 2): "FFRTS", +( 42, "In", 1): "BTRXD", +( 42, "In", 3): "HWRXD", +( 43, "Out", 2): "BTTXD", +( 43, "Out", 3): "HWTXD", +( 44, "In", 1): "BTCTS", +( 44, "In", 3): "HWCTS", +( 45, "Out", 2): "BTRTS", +( 45, "Out", 3): "HWRTS", +( 45, "Out", 1): "SYSCLK_AC97", +( 46, "In", 1): "ICPRXD", +( 46, "In", 2): "STRXD", +( 47, "Out", 2): "ICPTXD", +( 47, "Out", 1): "STTXD", +( 48, "In", 1): "CIF_DD<5>", +( 48, "Out", 2): "nPOE", +( 48, "Out", 1): "HWTXD", +( 49, "Out", 2): "nPWE", +( 49, "In", 1): "HWRXD", +( 50, "Out", 2): "nPIOR", +( 50, "In", 1): "DD_CIF<3>", #PXA250: "HWCTS", +( 51, "In", 1): "DD_CIF<2>", +( 51, "Out", 2): "nPIOW", +( 51, "Out", 1): "HWRTS", +( 52, "In", 1): "DD_CIF<4>", +( 52, "Out", 2): "nPCE_1", +( 53, "Out", 2): "nPCE_2", +( 53, "Out", 1): "MMCCLK", +( 54, "Out", 1): "MMCCLK", +( 54, "Out", 2): "nPCE_2", +( 54, "Out", 2): "pSKTSEL", +( 55, "Out", 2): "nPREG", +( 55, "In", 1): "DD_CIF<1>", +( 56, "In", 1): "nPWAIT", +( 57, "In", 1): "nIOIS16", +( 58, "Out", 2): "LDD_0", +( 59, "Out", 2): "LDD_1", +( 60, "Out", 2): "LDD_2", +( 61, "Out", 2): "LDD_3", +( 62, "Out", 2): "LDD_4", +( 63, "Out", 2): "LDD_5", +( 64, "Out", 2): "LDD_6", +( 65, "Out", 2): "LDD_7", +( 66, "Out", 2): "LDD_8", +( 66, "In", 1): "MBREQ", +( 67, "Out", 2): "LDD_9", +( 67, "Out", 1): "MMCCS0", +( 68, "Out", 2): "LDD_10", +( 68, "Out", 1): "MMCCS1", +( 69, "Out", 2): "LDD_11", +( 69, "Out", 1): "MMCCLK", +( 70, "Out", 2): "LDD_12", +( 70, "Out", 1): "RTCCLK", +( 71, "Out", 2): "LDD_13", +( 71, "Out", 1): "3_6MHz", +( 72, "Out", 2): "LDD_14", +( 72, "Out", 1): "32kHz", +( 73, "Out", 2): "LDD_15", +( 73, "Out", 1): "MBGNT", +( 74, "Out", 2): "LCD_FCLK", +( 75, "Out", 2): "LCD_LCLK", +( 76, "Out", 2): "LCD_PCLK", +( 77, "Out", 2): "LCD_ACBIAS", +( 78, "Out", 2): "nCS_2", +( 79, "Out", 2): "nCS_3", +( 79, "Out", 1): "pSKTSEL", +( 80, "Out", 2): "nCS_4", +( 81, "Out", 1): "NSSP_CLK_Out", +( 81, "In", 1): "NSSP_CLK_In", +( 81, "In", 2): "DD_CIF<0>", +( 82, "Out", 1): "NSSP_FRM_Out", +( 82, "In", 1): "NSSP_FRM_In", +( 83, "Out", 1): "NSSP_TX", +( 83, "In", 2): "NSSP_RX", +( 84, "Out", 1): "NSSP_TX", +( 84, "In", 3): "CIF_FV", +( 84, "In", 2): "NSSP_RX", +( 85, "In", 3): "CIF_LV", +( 85, "Out", 1): "nPCE_1", +( 89, "Out", 1): "AC97_SYSCLK", +( 91, "In", 1): "KP_MKIN<6>", +( 92, "Out", 1): "MMCDAT0", +( 93, "In", 1): "KP_MKIN<0>", +(104, "Out", 1): "pSKTSEL", +(109, "Out", 1): "MMCDAT1", +(110, "Out", 1): "MMCDAT2", +(110, "Out", 1): "MMCCS0", +(111, "Out", 1): "MMCDAT3", +(110, "Out", 1): "MMCCS1", +(112, "Out", 1): "MMCCMD", +(113, "Out", 1): "I2S_SYSCLK", +(113, "Out", 2): "AC97_RESET_N", +(117, "Out", 1): "I2CSCL", +(118, "In", 1): "I2CSDA", +(118, "Out", 1): "I2CSDA", +} + if __name__ == '__main__': main() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hol...@us...> - 2007-01-11 12:10:48
|
Revision: 753 http://svn.sourceforge.net/hackndev/?rev=753&view=rev Author: holger_bocklet Date: 2007-01-11 04:10:39 -0800 (Thu, 11 Jan 2007) Log Message: ----------- minor cleanup for ptc_ucb1400 and enabled backlight-control Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.c linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.h Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c 2007-01-10 17:49:39 UTC (rev 752) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/palmtc.c 2007-01-11 12:10:39 UTC (rev 753) @@ -22,13 +22,14 @@ #include <asm/arch/pxa-dmabounce.h> #include <asm/arch/pxafb.h> #include <asm/arch/pxa-regs.h> +#include <asm/arch/pxapwm-bl.h> #include "../generic.h" #include "palmtc-gpio.h" #define DEBUG -static void palm_backlight_power(int on) +static void palmtc_backlight_power(int on) { if(on) { PWM_CTRL1 = 0x1; @@ -55,7 +56,7 @@ .lccr0 = 0x07B008F9, .lccr3 = 0x04700004, - .pxafb_backlight_power = palm_backlight_power, + .pxafb_backlight_power = palmtc_backlight_power, }; @@ -95,7 +96,17 @@ }; +/* Backlight ***/ +static struct pxapwmbl_platform_data palmtc_backlight_data = { + .pwm = 1, + .max_intensity = 0x100, //120 + .default_intensity = 0x50, //11a + .limit_mask = 0x7F, + .prescaler = 1, // 7 + .period = 0x12B, // 16c +}; + static pxa2xx_audio_ops_t palmtc_audio_ops = { /* .startup = palmld_audio_startup, @@ -105,7 +116,14 @@ */ }; +static struct platform_device palmtc_backlight = { + .name = "pxapwm-bl", + .dev = { + .platform_data = &palmtc_backlight_data, + }, +}; + static struct platform_device palmtc_ac97_device = { .name = "pxa2xx-ac97", .id = -1, @@ -121,6 +139,7 @@ static struct platform_device *devices[] __initdata = { &palmtc_ac97_device, &palmtc_keyboard_device, + &palmtc_backlight, }; static void __init palmtc_init(void) Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.c 2007-01-10 17:49:39 UTC (rev 752) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.c 2007-01-11 12:10:39 UTC (rev 753) @@ -79,7 +79,7 @@ }; #ifdef CONFIG_APM -#define APM_MIN_INTERVAL 500 +#define APM_MIN_INTERVAL 1000 struct ucb1400 *ucb_static_copy; struct mutex apm_mutex; struct apm_power_info info_cache; @@ -356,10 +356,15 @@ info->battery_status = APM_BATTERY_STATUS_CRITICAL; } } - info->battery_life = ((battery - UCB_BATT_CRITICAL) * 125) / 100; - if (info->battery_life>100) + info->battery_life = ((battery - UCB_BATT_CRITICAL) / (UCB_BATT_HIGH-UCB_BATT_CRITICAL) ) * 100; //battery_life = % + if (info->battery_life>100) { info->battery_life=100; - info->time = info->battery_life * 6; + } else { + if (info->battery_life<0) { + info->battery_life=0; + } + } + info->time = info->battery_life * UCB_BATT_DURATION / 100; info->units = APM_UNITS_MINS; info_cache.ac_line_status=info->ac_line_status; Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.h =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.h 2007-01-10 17:49:39 UTC (rev 752) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.h 2007-01-11 12:10:39 UTC (rev 753) @@ -115,11 +115,8 @@ #define UCB_TS_FUZZ 15 #define UCB_BATT_HIGH 560 // adc "ticks" not mV ! -#define UCB_BATT_HIGH_MIN_MUL 20000 // multiplikator adc-ticks => minutes -#define UCB_BATT_NORM_MIN_MUL 1073 // multiplikator adc-ticks => minutes #define UCB_BATT_LOW 490 -#define UCB_BATT_LOW_MIN_MUL 2941 // multiplikator adc-ticks => minutes #define UCB_BATT_CRITICAL 480 -#define UCB_BATT_LIFE 600 // battery duration in minutes -#define UCB_ADC_TIMEOUT 100 +#define UCB_BATT_DURATION 600 // battery duration in minutes +#define UCB_ADC_TIMEOUT 50 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z7...@us...> - 2007-01-10 17:49:44
|
Revision: 752 http://svn.sourceforge.net/hackndev/?rev=752&view=rev Author: z72ka Date: 2007-01-10 09:49:39 -0800 (Wed, 10 Jan 2007) Log Message: ----------- Palmz72: added GPIOs about bluetooth Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpio_map.txt Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpio_map.txt =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpio_map.txt 2007-01-10 17:48:09 UTC (rev 751) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpio_map.txt 2007-01-10 17:49:39 UTC (rev 752) @@ -16,7 +16,7 @@ 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_17 1 O 00 Bluetooth: 1 when enabled in POS GPIO_18 0 O 00 GPIO_19 1 O 00 GPIO_20 1 O 00 @@ -82,7 +82,7 @@ GPIO_80 1 I 00 GPIO_81 1 I 02 CIF_DD0 GPIO_82 0 O 00 -GPIO_83 0 O 00 +GPIO_83 0 O 00 Bluetooth: 1 when enabled in POS GPIO_84 1 I 03 CIF_FV GPIO_85 1 I 03 CIF_LV GPIO_86 1 I 00 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z7...@us...> - 2007-01-10 17:48:56
|
Revision: 751 http://svn.sourceforge.net/hackndev/?rev=751&view=rev Author: z72ka Date: 2007-01-10 09:48:09 -0800 (Wed, 10 Jan 2007) Log Message: ----------- Palmz72: added pxamci, SD/MMC irq Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c 2007-01-10 17:45:12 UTC (rev 750) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c 2007-01-10 17:48:09 UTC (rev 751) @@ -56,6 +56,46 @@ #define IR_TRANSCEIVER_OFF \ SET_HX4700_GPIO_N(IR_ON, 0) + +/** + * SD/MMC card controller + */ + +static int palmz72_mci_init(struct device *dev, irqreturn_t (*palmz72_detect_int)(int, void *, struct pt_regs *), void *data) +{ + int err; + + /** + * Setup an interrupt for detecting card insert/remove events + */ + set_irq_type(IRQ_GPIO_PALMZ72_SD_DETECT_N, IRQT_BOTHEDGE); + err = request_irq(IRQ_GPIO_PALMZ72_SD_DETECT_N, palmz72_detect_int, + SA_INTERRUPT, "SD/MMC card detect", data); + + if(err) { + printk(KERN_ERR "palmz72_mci_init: cannot request SD/MMC card detect IRQ\n"); + return -1; + } + + + printk("palmz72_mci_init: irq registered\n"); + + return 0; +} + +static void palmz72_mci_exit(struct device *dev, void *data) +{ + free_irq(IRQ_GPIO_PALMZ72_SD_DETECT_N, data); +} + +static struct pxamci_platform_data palmz72_mci_platform_data = { + .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, + .init = palmz72_mci_init, + /* .setpower = palmz72_mci_setpower, */ + .exit = palmz72_mci_exit, + +}; + /* * LED */ static struct platform_device palmz72led_device = { @@ -324,6 +364,7 @@ break; } set_pxa_fb_info(&palmz72lcd); + 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; platform_add_devices( devices, ARRAY_SIZE(devices) ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z7...@us...> - 2007-01-10 17:45:22
|
Revision: 750 http://svn.sourceforge.net/hackndev/?rev=750&view=rev Author: z72ka Date: 2007-01-10 09:45:12 -0800 (Wed, 10 Jan 2007) Log Message: ----------- Palmz72: added SD/MMC GPIO detect Modified Paths: -------------- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-gpio.h Modified: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-gpio.h =================================================================== --- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-gpio.h 2007-01-10 13:51:00 UTC (rev 749) +++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-gpio.h 2007-01-10 17:45:12 UTC (rev 750) @@ -62,10 +62,15 @@ #define GPIO_NR_PALMZ72_USB_PULLUP 76 // just to try.. seems to work #define IRQ_GPIO_PALMZ72_USB_DETECT IRQ_GPIO(GPIO_NR_PALMZ72_USB_DETECT) -/* Testing */ +/* Power */ -#define GPIO_NR_PALMZ72_POWER_DETECT 12 // older 4 +#define GPIO_NR_PALMZ72_POWER_DETECT 12 // AC power and USB +/* SD/MMC */ + +#define GPIO_NR_PALMZ72_SD_DETECT_N 14 +#define IRQ_GPIO_PALMZ72_SD_DETECT_N IRQ_GPIO(GPIO_NR_PALMZ72_SD_DETECT_N) + /* Utility macros */ #define GET_PALMZ72_GPIO(gpio) \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2007-01-10 13:51:03
|
Revision: 749 http://svn.sourceforge.net/hackndev/?rev=749&view=rev Author: satadru Date: 2007-01-10 05:51:00 -0800 (Wed, 10 Jan 2007) Log Message: ----------- palmt680: updated default config for Palm Treo 680. Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/configs/palmt680_defconfig Modified: linux4palm/linux/trunk/arch/arm/configs/palmt680_defconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/configs/palmt680_defconfig 2007-01-10 13:44:55 UTC (rev 748) +++ linux4palm/linux/trunk/arch/arm/configs/palmt680_defconfig 2007-01-10 13:51:00 UTC (rev 749) @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.17-hnd0 -# Mon Jan 8 02:51:24 2007 +# Mon Jan 8 17:02:00 2007 # CONFIG_ARM=y CONFIG_MMU=y @@ -16,6 +16,7 @@ # CONFIG_EXPERIMENTAL=y CONFIG_BROKEN_ON_SMP=y +CONFIG_LOCK_KERNEL=y CONFIG_INIT_ENV_ARG_LIMIT=32 # @@ -29,8 +30,9 @@ # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y # CONFIG_AUDIT is not set -# CONFIG_IKCONFIG is not set +CONFIG_IKCONFIG=y # CONFIG_MINIMAL_OOPS is not set +CONFIG_IKCONFIG_PROC=y # CONFIG_RELAY is not set CONFIG_INITRAMFS_SOURCE="" CONFIG_UID16=y @@ -202,11 +204,10 @@ # # Kernel Features # -# CONFIG_PREEMPT is not set -# CONFIG_NO_IDLE_HZ is not set +CONFIG_PREEMPT=y +CONFIG_NO_IDLE_HZ=y CONFIG_HZ=100 -CONFIG_AEABI=y -CONFIG_OABI_COMPAT=y +# CONFIG_AEABI is not set # CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set CONFIG_SELECT_MEMORY_MODEL=y CONFIG_FLATMEM_MANUAL=y @@ -248,6 +249,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 @@ -846,7 +848,13 @@ CONFIG_EXT2_FS=y # CONFIG_EXT2_FS_XATTR is not set # CONFIG_EXT2_FS_XIP is not set -# CONFIG_EXT3_FS is not set +CONFIG_EXT3_FS=y +CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_POSIX_ACL is not set +# CONFIG_EXT3_FS_SECURITY is not set +CONFIG_JBD=y +# CONFIG_JBD_DEBUG is not set +CONFIG_FS_MBCACHE=y # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set # CONFIG_FS_POSIX_ACL is not set This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2007-01-10 13:44:57
|
Revision: 748 http://svn.sourceforge.net/hackndev/?rev=748&view=rev Author: satadru Date: 2007-01-10 05:44:55 -0800 (Wed, 10 Jan 2007) Log Message: ----------- palmt680: updated keyboard layout for Palm Treo 680. Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmt680/palmt680.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmt680/palmt680.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmt680/palmt680.c 2007-01-10 11:24:16 UTC (rev 747) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmt680/palmt680.c 2007-01-10 13:44:55 UTC (rev 748) @@ -6,6 +6,8 @@ * Author: * * Based on palmt650.c by Alex Osborne <bob...@gm...> + * Treo680 keymaps updated by Satadru Pramanik <sa...@um...> + * Based upon major assistance from Alex Osborne. * */ @@ -190,16 +192,16 @@ .nr_cols = 7, .keycodes = { { /* row 0 */ - KEY_O, // "O" - KEY_LEFT, // "5-Way Left" }, + KEY_F4, // "Red/Off/Power" + KEY_LEFT, // "5-Way Left" }, KEY_RIGHTSHIFT, // "Alternate" }, KEY_L, // "L" }, KEY_A, // "A" }, KEY_Q, // "Q" }, - KEY_RIGHTCTRL, // "Right Shift" }, + KEY_P, // "P" }, }, { /* row 1 */ - KEY_P, // "P" }, - KEY_RIGHT, // "5-Way Right" }, + KEY_RIGHTCTRL, // "Menu" }, + KEY_RIGHT, // "5-Way Right" }, KEY_LEFTSHIFT, //"Left Shift" }, KEY_Z, // "Z" }, KEY_S, // "S" }, @@ -215,8 +217,8 @@ -1, // "Unused" }, }, { /* row 3 */ KEY_F2, // "Calendar" }, - KEY_DOWN, // "5-Way Down" }, - KEY_SPACE, // "Space" }, + KEY_DOWN, // "5-Way Down" }, + KEY_SPACE, // "Space" }, KEY_C, // "C" }, KEY_F, // "F" }, KEY_R, // "R" }, @@ -224,21 +226,21 @@ }, { /* row 4 */ KEY_F3, // "Mail" }, KEY_SELECT, // "5-Way Center" }, - KEY_HOME, // "Unused" }, + KEY_RIGHTALT, // "Alt" }, KEY_V, // "V" }, KEY_G, // "G" }, KEY_T, // "T" }, -1, // "Unused" }, }, { /* row 5 */ - KEY_F4, // "Off" }, + KEY_HOME, // "Home" }, KEY_VOLUMEUP, // "Volume Up" }, - KEY_DOT, // "." }, + KEY_DOT, // "." }, KEY_B, // "B" }, KEY_H, // "H" }, KEY_Y, // "Y" }, -1, // "Unused" }, }, { /* row 6 */ - KEY_F5, // "Mute" }, + KEY_F5, // "Side Activate" }, KEY_VOLUMEDOWN, // "Volume Down" }, KEY_KPENTER, // "Return" }, KEY_N, // "N" }, @@ -246,9 +248,9 @@ KEY_U, // "U" }, -1, // "Unused" }, }, { /* row 7 */ - KEY_RIGHTALT, // "Alt" }, - KEY_MENU, // "Unused" }, - KEY_BACKSPACE, // "P" }, + KEY_F6, // "Green/Call" }, + KEY_O, // "O" }, + KEY_BACKSPACE, // "Backspace" }, KEY_M, // "M" KEY_K, // "K" KEY_I, // "I" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hol...@us...> - 2007-01-10 11:24:22
|
Revision: 747 http://svn.sourceforge.net/hackndev/?rev=747&view=rev Author: holger_bocklet Date: 2007-01-10 03:24:16 -0800 (Wed, 10 Jan 2007) Log Message: ----------- ptc_ucb1400 fix hang with apm-battery Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.c linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.h Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.c 2007-01-08 11:43:37 UTC (rev 746) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.c 2007-01-10 11:24:16 UTC (rev 747) @@ -30,6 +30,8 @@ #include <linux/device.h> #include <linux/string.h> #include <linux/ctype.h> +#include <linux/time.h> +#include <linux/mutex.h> #include <asm/delay.h> #include <asm/arch/hardware.h> @@ -61,22 +63,31 @@ ac97_t *ac97; struct input_dev *idev; struct task_struct *thread; - wait_queue_head_t pen_irq_wait; - wait_queue_head_t adc_irq_wait; + //wait_queue_head_t pen_irq_wait; + //wait_queue_head_t adc_irq_wait; int pen_irq; int adc_irq; struct workqueue_struct *palmtc_ucb1400_workqueue; struct work_struct palmtc_ucb1400_work; struct completion thr_init; struct completion thr_exit; - struct semaphore adc_sem; + struct completion pen_irq_wait; + struct completion adc_irq_wait; + struct mutex adc_mutex; + struct mutex ucb_reg_mutex; u8 last_status; }; #ifdef CONFIG_APM +#define APM_MIN_INTERVAL 500 struct ucb1400 *ucb_static_copy; + struct mutex apm_mutex; + struct apm_power_info info_cache; + unsigned long cache_tstamp; #endif +//static struct timeval t; + struct ts_reading { u16 p; u16 x; @@ -89,7 +100,7 @@ // Pen sampling frequency (Hz) while touched. // more is not possible cause jiffies are at 100Hz in mach-pxa (why ???) -static int cont_rate = 100; +static int cont_rate = 80; module_param(cont_rate, int, 0); MODULE_PARM_DESC(cont_rate, "Sampling rate while pen down (Hz). Not more than ~100Hz on T|C"); @@ -120,17 +131,22 @@ * can only be called from process context, not interrupt * context. */ -void ucb1400_adc_enable(struct ucb1400 *ucb) +int ucb1400_adc_enable(struct ucb1400 *ucb) { u16 val=0; - down(&ucb->adc_sem); + + if (unlikely(mutex_lock_interruptible(&ucb->adc_mutex))) + return -ERESTARTSYS; ucb1400_reg_write(ucb, UCB_ADC_CR, UCB_ADC_ENA); - val=ucb1400_reg_read(ucb, UCB_CSR2); - ucb1400_reg_write(ucb, UCB_CSR2, val | UCB_ADC_FILTER_ENA); - + mutex_lock(&ucb->ucb_reg_mutex); val=ucb1400_reg_read(ucb, UCB_IE_RIS); ucb1400_reg_write(ucb, UCB_IE_RIS, val | UCB_IE_ADC); + val=ucb1400_reg_read(ucb, UCB_IE_FAL); + ucb1400_reg_write(ucb, UCB_IE_FAL, val | UCB_IE_ADC); + mutex_unlock(&ucb->ucb_reg_mutex); + + return 0; } @@ -143,11 +159,17 @@ void ucb1400_adc_disable(struct ucb1400 *ucb) { u16 val=0; + + mutex_lock(&ucb->ucb_reg_mutex); val &= ~UCB_ADC_ENA; ucb1400_reg_write(ucb, UCB_ADC_CR, val); val=ucb1400_reg_read(ucb, UCB_IE_RIS); ucb1400_reg_write(ucb, UCB_IE_RIS, val & (~UCB_IE_ADC)); - up(&ucb->adc_sem); + val=ucb1400_reg_read(ucb, UCB_IE_FAL); + ucb1400_reg_write(ucb, UCB_IE_FAL, val & (~UCB_IE_ADC)); + mutex_unlock(&ucb->ucb_reg_mutex); + + mutex_unlock(&ucb->adc_mutex); } @@ -161,9 +183,10 @@ * This function currently sleeps waiting for the conversion to * complete (2 frames max without sync). */ -unsigned int ucb1400_adc_read(struct ucb1400 *ucb, int adc_channel) +unsigned int ucb1400_adc_read(struct ucb1400 *ucb, u16 adc_channel) { unsigned int val; + //unsigned long tstamp, sleep_time; adc_channel |= UCB_ADC_ENA; @@ -171,15 +194,38 @@ ucb1400_reg_write(ucb, UCB_ADC_CR, adc_channel | UCB_ADC_START); ucb->adc_irq=FALSE; + val = ucb1400_reg_read(ucb, UCB_ADC_DATA); + if ( !(val & UCB_ADC_DATA_VALID)) { + wait_for_completion_interruptible_timeout(&ucb->adc_irq_wait,UCB_ADC_TIMEOUT); + val = ucb1400_reg_read(ucb, UCB_ADC_DATA); + +/* ucb->adc_irq=FALSE; wait_event_interruptible( ucb->adc_irq_wait, ucb->adc_irq); - ucb->adc_irq=FALSE; + sleep_time=UCB_ADC_TIMEOUT; + tstamp=jiffies; + wait_event_interruptible_timeout( ucb->adc_irq_wait, (ucb->adc_irq) || + (((unsigned long)((long)jiffies - (long)tstamp)) >= sleep_time) , sleep_time); +*/ + if (likely(ucb->adc_irq)) { + ucb->adc_irq=FALSE; + } else { + //do_gettimeofday(&t); + //DBG("adc read timeout: %ld %ld\n",t.tv_sec,t.tv_usec); + printk(KERN_ERR "%s: read error (timeout on adc%1u), value:0x%x\n", + __FUNCTION__,(adc_channel&0x0c)>>2, val); + + } - val = ucb1400_reg_read(ucb, UCB_ADC_DATA); - + if (unlikely ( !(val & UCB_ADC_DATA_VALID) ) ){ + printk(KERN_ERR "%s: read error (data invalid on adc%1u), value:0x%x\n", + __FUNCTION__,(adc_channel&0x0c)>>2, val); + } + } return val & UCB_ADC_DATA_MASK; } + // create sysfs-entries for adc+gpio #define UCB1400_SYSFS_ATTR_SHOW(name,input); \ static ssize_t ucb1400_sysfs_##name##_show(struct device *dev, struct device_attribute *attr, char *buf) \ @@ -220,24 +266,27 @@ if (!(isdigit(buf[1]))) return -EINVAL; io_nr=simple_strtol(buf+1, NULL, 10); + + mutex_lock(&ucb->ucb_reg_mutex); val=ucb1400_reg_read(ucb, UCB_IO_DIR); ucb1400_reg_write(ucb, UCB_IO_DIR, val | (1 << io_nr)); // set output val=ucb1400_reg_read(ucb, UCB_IO_DATA); ucb1400_reg_write(ucb, UCB_IO_DATA, val & (~(1 << io_nr))); // unset bit + mutex_unlock(&ucb->ucb_reg_mutex); } else { if (strlen(buf)>2) return -EINVAL; if (!(isdigit(buf[0]))) return -EINVAL; io_nr=simple_strtol(buf, NULL, 10); + mutex_lock(&ucb->ucb_reg_mutex); val=ucb1400_reg_read(ucb, UCB_IO_DIR); ucb1400_reg_write(ucb, UCB_IO_DIR, val | (1 << io_nr)); // set output val=ucb1400_reg_read(ucb, UCB_IO_DATA); ucb1400_reg_write(ucb, UCB_IO_DATA, val | (1 << io_nr)); // set bit + mutex_unlock(&ucb->ucb_reg_mutex); } - val1=ucb1400_reg_read(ucb, UCB_IO_DIR); - val2=ucb1400_reg_read(ucb, UCB_IO_DATA); return 2; } static DEVICE_ATTR(gpio, 0664, ucb1400_sysfs_io_show, ucb1400_sysfs_io_store); @@ -246,8 +295,26 @@ static void palmtc_get_power_status(struct apm_power_info *info) { struct ucb1400 *ucb=ucb_static_copy; - u16 battery=0; + u16 battery, a,b,c; + int i; + + if (mutex_lock_interruptible(&apm_mutex)) + return; + //do_gettimeofday(&t); + //DBG("apm-call sem-down: %ld %ld\n",t.tv_sec,t.tv_usec); + + // if last call with hardware-read is < 5 Sek just return cached info + if ( ((unsigned long)((long)jiffies - (long)cache_tstamp) ) < APM_MIN_INTERVAL ) { + info->ac_line_status = info_cache.ac_line_status; + info->battery_status = info_cache.battery_status; + info->battery_flag = info_cache.battery_flag; + info->battery_life = info_cache.battery_life; + info->time = info_cache.time; + mutex_unlock(&apm_mutex); + return; + } + //DBG("apm-call read\n"); info->battery_flag = 0; battery=ucb1400_reg_read(ucb, UCB_IO_DATA); if (battery & UCB_IO_0) { @@ -258,11 +325,22 @@ info->ac_line_status = APM_AC_OFFLINE; } - while ( || - ucb1400_adc_enable(ucb); + if (ucb1400_adc_enable(ucb)) + return; + battery=ucb1400_adc_read(ucb, UCB_ADC_INP_AD0); + for (i=0;(i<3);i++) { + a=ucb1400_adc_read(ucb, UCB_ADC_INP_AD0); + b=ucb1400_adc_read(ucb, UCB_ADC_INP_AD0); + c=ucb1400_adc_read(ucb, UCB_ADC_INP_AD0); + if ((a==b) && (b==c)) { + battery=c; + break; + } else { + battery=(a+b+c+battery)/4; + } + } ucb1400_adc_disable(ucb); - DBG("batt: %u\n",battery); if (battery > UCB_BATT_HIGH) { info->battery_flag |= APM_BATTERY_FLAG_HIGH; @@ -282,8 +360,16 @@ if (info->battery_life>100) info->battery_life=100; info->time = info->battery_life * 6; - //info->battery_life = ((info->time * 100) / UCB_BATT_LIFE); info->units = APM_UNITS_MINS; + + info_cache.ac_line_status=info->ac_line_status; + info_cache.battery_status=info->battery_status; + info_cache.battery_flag=info->battery_flag; + info_cache.battery_life=info->battery_life; + info_cache.time=info->time; + cache_tstamp=jiffies; + + mutex_unlock(&apm_mutex); } #endif @@ -316,6 +402,8 @@ u16 val; // clear remaining ints + mutex_lock(&ucb->ucb_reg_mutex); + val=ucb1400_reg_read(ucb, UCB_IE_STATUS); ucb1400_reg_write(ucb, UCB_IE_CLEAR, val); @@ -331,6 +419,7 @@ val=ucb1400_reg_read(ucb, UCB_IE_RIS); ucb1400_reg_write(ucb, UCB_IE_RIS, val & (~UCB_IE_TSPX) & (~UCB_IE_TSMX)); //ucb1400_reg_write(ucb, UCB_IE_RIS, val & (~UCB_IE_TSPX)); + //DBG("ts irq-off"); } else { @@ -354,6 +443,8 @@ UCB_TS_CR_TSMY_GND | UCB_TS_CR_TSPY_GND | UCB_TS_CR_MODE_INT); } + mutex_unlock(&ucb->ucb_reg_mutex); + //DBG("ts irqcontrol: fal: 0x%x ris: 0x%x\n",ucb1400_reg_read(ucb, UCB_IE_FAL),ucb1400_reg_read(ucb, UCB_IE_RIS)); } @@ -420,15 +511,18 @@ } -static void ucb1400_ts_take_reading(struct ucb1400 *ucb, struct ts_reading *ts) +static int ucb1400_ts_take_reading(struct ucb1400 *ucb, struct ts_reading *ts) { - ucb1400_adc_enable(ucb); + //ucb1400_adc_enable(ucb); + if (ucb1400_adc_enable(ucb)) + return -ERESTARTSYS; ts->x = ucb1400_ts_read_xpos(ucb); ts->y = ucb1400_ts_read_ypos(ucb); ts->p = ucb1400_ts_read_pressure(ucb); ucb1400_adc_disable(ucb); + return 0; } // ISR for ac97, shared with pxa2xx-ac97, and later with ucb1400-gpio and ucb1400-adc @@ -438,7 +532,7 @@ struct ucb1400 *ucb = (struct ucb1400 *) devid; status=GSR; - if (status & GSR_GSCI) { + if (likely(status & GSR_GSCI)) { GSR&=GSR_GSCI; queue_work(ucb->palmtc_ucb1400_workqueue, &ucb->palmtc_ucb1400_work); @@ -455,28 +549,33 @@ struct ucb1400 *ucb = (struct ucb1400 *) data; u16 val,val1,val2; - // check which irq + //mutex_trylock(&ucb->ucb_reg_mutex); don't: this delays irqs ! + // check which irq and clear val=ucb1400_reg_read(ucb, UCB_IE_STATUS); + ucb1400_reg_write(ucb, UCB_IE_CLEAR, val); val1=ucb1400_reg_read(ucb, UCB_IE_EXTRA); - // clear irqs - ucb1400_reg_write(ucb, UCB_IE_CLEAR, val); ucb1400_reg_write(ucb, UCB_IE_EXTRA, val1); + //mutex_unlock(&ucb->ucb_reg_mutex); - if (val & UCB_IE_TSPX) { + //if ((val & UCB_IE_ADC) && (ucb->adc_irq==FALSE)) { + if ((val & UCB_IE_ADC) ) { + ucb->adc_irq=TRUE; + complete(&ucb->adc_irq_wait); + //wake_up_interruptible(&ucb->adc_irq_wait); + } + //if ((val & UCB_IE_TSPX) && (ucb->pen_irq==FALSE)) { + if ((val & UCB_IE_TSPX)) { ucb->pen_irq=TRUE; - //DBG("irq_wq: TS\n"); - wake_up_interruptible(&ucb->pen_irq_wait); + complete(&ucb->pen_irq_wait); + //do_gettimeofday(&t); + //DBG("irq_wq_TS: %ld %ld\n",t.tv_sec,t.tv_usec); + //wake_up_interruptible(&ucb->pen_irq_wait); } - if (val & UCB_IE_ADC) { - ucb->adc_irq=TRUE; - //DBG("irq_wq: ADC\n"); - wake_up_interruptible(&ucb->adc_irq_wait); - } if (val & UCB_IE_IO) { //show it val1=ucb1400_reg_read(ucb, UCB_IO_DIR); val2=ucb1400_reg_read(ucb, UCB_IO_DATA); - //DBG("gpio_irq: irq: 0x%u dir: %u data: %u\n",val,val1,val2); + DBG("gpio_irq: irq: 0x%u dir: %u data: %u\n",val,val1,val2); } } @@ -488,7 +587,7 @@ { unsigned long sleep_time; int pen_was_down=FALSE; - unsigned long tstamp; // timestamp (jiffies) + //unsigned long tstamp; // timestamp (jiffies) struct ts_reading ts_values; struct ucb1400 *ucb = (struct ucb1400 *) data; @@ -512,21 +611,27 @@ /* touch reader loop */ while (ucb->thread) { ucb->pen_irq=FALSE; - wait_event_interruptible( ucb->pen_irq_wait, ucb->pen_irq); + //do_gettimeofday(&t); + //DBG("kthread-1: %ld %ld\n",t.tv_sec,t.tv_usec); + //wait_event_interruptible( ucb->pen_irq_wait, ucb->pen_irq); + wait_for_completion_interruptible(&ucb->pen_irq_wait); if (ucb->thread) { // are we still alive? do { ucb1400_ts_mode_int(ucb, 0); // int off / clear int - ucb1400_ts_take_reading(ucb, &ts_values); + if (! (ucb1400_ts_take_reading(ucb, &ts_values))) { + ucb1400_ts_mode_int(ucb, UCB_IE_RIS); //int on rising edge=wait for penup ucb1400_ts_report_event(ucb, ts_values); pen_was_down=TRUE; //DBG("kthread x: %d y: %d p: %d\n",ts_values.x,ts_values.y,ts_values.p); - tstamp=jiffies; + //tstamp=jiffies; // This marco needs a TRUE condition to return, Timeout alone without TRUE does NOT return, // so make up a TRUE when timeout. A bit bloated though .... ucb->pen_irq=FALSE; - wait_event_interruptible_timeout( ucb->pen_irq_wait, (ucb->pen_irq) || - (((unsigned long)((long)jiffies - (long)tstamp)) >= sleep_time) , sleep_time); + wait_for_completion_interruptible_timeout(&ucb->pen_irq_wait,sleep_time); + //wait_event_interruptible_timeout( ucb->pen_irq_wait, (ucb->pen_irq) || + // (((unsigned long)((long)jiffies - (long)tstamp)) >= sleep_time) , sleep_time); + } } while(! ucb->pen_irq); if (ucb->thread) @@ -596,9 +701,14 @@ ucb1400_reg_write(ucb, UCB_IE_EXTRA, val); // start reader-thread for touchscreen + ucb->pen_irq=FALSE; + ucb->adc_irq=FALSE; init_completion(&ucb->thr_init); init_completion(&ucb->thr_exit); - init_waitqueue_head(&ucb->pen_irq_wait); + init_completion(&ucb->pen_irq_wait); + mutex_init(&ucb->ucb_reg_mutex); + //init_MUTEX(&ucb->ucb_reg_sem); + //init_waitqueue_head(&ucb->pen_irq_wait); //ucb1400_ts_mode_int(ucb, 0); ret = kernel_thread(ucb1400_ts_read_thread, ucb, CLONE_KERNEL); if (ret > 0) { @@ -614,8 +724,14 @@ INIT_WORK(&ucb->palmtc_ucb1400_work, palmtc_ucb1400_irq_queuework, ucb); //adc - init_waitqueue_head(&ucb->adc_irq_wait); - sema_init(&ucb->adc_sem, 1); + val=ucb1400_reg_read(ucb, UCB_CSR2); + ucb1400_reg_write(ucb, UCB_CSR2, val | UCB_ADC_FILTER_ENA); + + //init_waitqueue_head(&ucb->adc_irq_wait); + init_completion(&ucb->adc_irq_wait); + mutex_init(&ucb->adc_mutex); + //init_MUTEX(&ucb->adc_sem); + //sema_init(&ucb->adc_sem, 1); // get our share of AC97-Bus interrupt err = request_irq(IRQ_AC97, ucb1400_irq, SA_SHIRQ, "ucb1400", ucb); @@ -653,8 +769,18 @@ device_create_file(dev, &dev_attr_gpio); #ifdef CONFIG_APM + //sema_init(&apm_sem, 1); + info_cache.ac_line_status=APM_AC_UNKNOWN; + info_cache.battery_status=APM_BATTERY_STATUS_UNKNOWN; + info_cache.battery_flag=APM_BATTERY_FLAG_UNKNOWN; + info_cache.battery_life=-1; + info_cache.time=-1; + info_cache.units=APM_UNITS_MINS; + cache_tstamp=0; + //init_MUTEX(&apm_sem); + mutex_init(&apm_mutex); + ucb_static_copy=ucb; //sorry for this, apm-power-function doesnt have a parm to pass dev... apm_get_power_status = palmtc_get_power_status; - ucb_static_copy=ucb; //sorry for this, apm-power-function doesnt have a parm to pass dev... #endif @@ -664,7 +790,9 @@ if (ucb->thread) { ucb->thread = NULL; ucb->pen_irq = TRUE; - wake_up_interruptible(&ucb->pen_irq_wait); + complete_all(&ucb->pen_irq_wait); + complete_all(&ucb->adc_irq_wait); + //wake_up_interruptible(&ucb->pen_irq_wait); wait_for_completion(&ucb->thr_exit); } rollback2: @@ -690,6 +818,9 @@ #ifdef CONFIG_APM apm_get_power_status = NULL;; #endif + ucb->adc_irq = TRUE; + complete_all(&ucb->adc_irq_wait); + //wake_up_interruptible(&ucb->adc_irq_wait); // disable "GPIO"-int in pxa-ac97 if we found it disabled if ((ucb->last_status & GCR_GIE) == 0) @@ -700,14 +831,12 @@ ucb1400_reg_write(ucb, UCB_CSR1, val); } - ucb->adc_irq = TRUE; - wake_up_interruptible(&ucb->adc_irq_wait); - //stop kthread if (ucb->thread) { ucb->thread = NULL; ucb->pen_irq = TRUE; - wake_up_interruptible(&ucb->pen_irq_wait); + complete_all(&ucb->pen_irq_wait); + //wake_up_interruptible(&ucb->pen_irq_wait); wait_for_completion(&ucb->thr_exit); } Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.h =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.h 2007-01-08 11:43:37 UTC (rev 746) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtc/ptc_ucb1400.h 2007-01-10 11:24:16 UTC (rev 747) @@ -43,7 +43,7 @@ #define UCB_IE_TSMX (1 << 13) #define UCB_IE_TCLIP (1 << 14) #define UCB_IE_ACLIP (1 << 15) -#define UCB_IE_IO (0x1FF) +#define UCB_IE_IO (0x3FF) #define UCB_TC_B_VOICE_ENA (1 << 3) #define UCB_TC_B_CLIP (1 << 4) @@ -89,8 +89,8 @@ #define UCB_ADC_FILTER_ENA (1 << 12) -#define UCB_ADC_DATA_MASK 0x3ff -#define UCB_ADC_DATA_VALID (1 << 15) +#define UCB_ADC_DATA_MASK 0x3ff +#define UCB_ADC_DATA_VALID (1 << 15) #define UCB_ID_1400 0x4304 @@ -122,3 +122,4 @@ #define UCB_BATT_CRITICAL 480 #define UCB_BATT_LIFE 600 // battery duration in minutes +#define UCB_ADC_TIMEOUT 100 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z7...@us...> - 2007-01-08 11:43:39
|
Revision: 746 http://svn.sourceforge.net/hackndev/?rev=746&view=rev Author: z72ka Date: 2007-01-08 03:43:37 -0800 (Mon, 08 Jan 2007) Log Message: ----------- Palmz72: LED GPIO 88, Voice Memo btn is GPIO 13 Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpio_map.txt Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpio_map.txt =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpio_map.txt 2007-01-08 10:43:42 UTC (rev 745) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpio_map.txt 2007-01-08 11:43:37 UTC (rev 746) @@ -12,7 +12,7 @@ GPIO_10 1 I 00 GPIO_11 0 I 00 GPIO_12 1 I 00 -GPIO_13 0 I 02 KP_DKIN7 // ??? +GPIO_13 0 I 02 KP_DKIN7 // Voice Memo button GPIO_14 0 I 00 GPIO_15 0 I 00 USB_PULLUP GPIO_16 1 O 02 PWM_OUT0 @@ -87,7 +87,7 @@ GPIO_85 1 I 03 CIF_LV GPIO_86 1 I 00 GPIO_87 0 I 00 -GPIO_88 0 O 00 +GPIO_88 0 O 00 LED GPIO_89 0 O 01 AC97_SYSCLK GPIO_90 0 O 00 GPIO_91 1 O 00 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z7...@us...> - 2007-01-08 10:43:44
|
Revision: 745 http://svn.sourceforge.net/hackndev/?rev=745&view=rev Author: z72ka Date: 2007-01-08 02:43:42 -0800 (Mon, 08 Jan 2007) Log Message: ----------- Added LED support for Zire72 Modified Paths: -------------- linux4palm/linux/trunk/drivers/leds/Makefile Modified: linux4palm/linux/trunk/drivers/leds/Makefile =================================================================== --- linux4palm/linux/trunk/drivers/leds/Makefile 2007-01-08 10:37:52 UTC (rev 744) +++ linux4palm/linux/trunk/drivers/leds/Makefile 2007-01-08 10:43:42 UTC (rev 745) @@ -14,6 +14,7 @@ obj-$(CONFIG_LEDS_H2200) += h2200_leds.o obj-$(CONFIG_LEDS_MAGICIAN) += leds-magician.o obj-$(CONFIG_LEDS_PALMLD) += leds-palmld.o +obj-$(CONFIG_LEDS_PALMZ72) += led-palmz72.o obj-$(CONFIG_LEDS_PALMT650) += leds-palmt650.o # LED Triggers This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z7...@us...> - 2007-01-08 10:37:54
|
Revision: 744 http://svn.sourceforge.net/hackndev/?rev=744&view=rev Author: z72ka Date: 2007-01-08 02:37:52 -0800 (Mon, 08 Jan 2007) Log Message: ----------- Updated keypad, in previous have I test row.. sorry Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c 2007-01-08 10:32:25 UTC (rev 743) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c 2007-01-08 10:37:52 UTC (rev 744) @@ -122,12 +122,6 @@ KEY_S, /* ?? */ KEY_LEFT, /* D-PAD LEFT */ }, - { - /* row 4 */ - KEY_5, /* D-PAD RIGHT */ - KEY_6, /* ?? */ - KEY_7, /* D-PAD LEFT */ - }, }, .gpio_modes = { GPIO_NR_PALMZ72_KP_MKIN0_MD, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z7...@us...> - 2007-01-08 10:32:28
|
Revision: 743 http://svn.sourceforge.net/hackndev/?rev=743&view=rev Author: z72ka Date: 2007-01-08 02:32:25 -0800 (Mon, 08 Jan 2007) Log Message: ----------- Updated default config, gpio and gpioed-ng as modules Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/configs/palmz72_defconfig Modified: linux4palm/linux/trunk/arch/arm/configs/palmz72_defconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/configs/palmz72_defconfig 2007-01-08 10:29:22 UTC (rev 742) +++ linux4palm/linux/trunk/arch/arm/configs/palmz72_defconfig 2007-01-08 10:32:25 UTC (rev 743) @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.17-hnd0 -# Thu Oct 12 20:26:28 2006 +# Linux kernel version: 2.6.17-hnd0-z72 +# Sun Jan 7 19:51:33 2007 # CONFIG_ARM=y CONFIG_MMU=y @@ -141,11 +141,16 @@ # CONFIG_ARCH_ROVERP1 is not set # CONFIG_ARCH_ROVERP5P is not set # CONFIG_MACH_XSCALE_PALMLD is not set +# CONFIG_MACH_XSCALE_PALMTREO650 is not set +# CONFIG_MACH_XSCALE_TREO680 is not set # CONFIG_MACH_TUNGE2 is not set # CONFIG_MACH_T3XSCALE is not set # CONFIG_MACH_XSCALE_PALMTT5 is not set # CONFIG_MACH_XSCALE_PALMTX is not set CONFIG_MACH_PALMZ72=y +CONFIG_PALMZ72_AC97=y +CONFIG_GPIOED=m +CONFIG_GPIOEDNG=m # CONFIG_MACH_OMAP_PALMTC is not set # CONFIG_PXA_SHARPSL is not set CONFIG_PXA27x=y @@ -252,8 +257,10 @@ # # Power management options # -# CONFIG_PM is not set -# CONFIG_APM is not set +CONFIG_PM=y +CONFIG_PM_LEGACY=y +# CONFIG_PM_DEBUG is not set +CONFIG_APM=y # # Networking @@ -327,20 +334,21 @@ # # CONFIG_NET_PKTGEN is not set # CONFIG_HAMRADIO is not set -CONFIG_IRDA=m +CONFIG_IRDA=y # # IrDA protocols # # CONFIG_IRLAN is not set -CONFIG_IRCOMM=m -CONFIG_IRDA_ULTRA=y +# CONFIG_IRNET is not set +# CONFIG_IRCOMM is not set +# CONFIG_IRDA_ULTRA is not set # # IrDA options # -CONFIG_IRDA_CACHE_LAST_LSAP=y -CONFIG_IRDA_FAST_RR=y +# CONFIG_IRDA_CACHE_LAST_LSAP is not set +# CONFIG_IRDA_FAST_RR is not set # CONFIG_IRDA_DEBUG is not set # @@ -350,7 +358,7 @@ # # SIR device drivers # -CONFIG_IRTTY_SIR=m +CONFIG_IRTTY_SIR=y # # Dongle support @@ -369,21 +377,23 @@ # # FIR device drivers # -# CONFIG_PXA_FICP is not set -CONFIG_BT=m +CONFIG_PXA_FICP=y +CONFIG_BT=y # CONFIG_BT_L2CAP is not set # CONFIG_BT_SCO is not set # # Bluetooth device drivers # -# CONFIG_BT_HCIUART is not set +CONFIG_BT_HCIUART=y +# CONFIG_BT_HCIUART_H4 is not set +# CONFIG_BT_HCIUART_BCSP is not set # CONFIG_BT_HCIVHCI is not set -CONFIG_IEEE80211=m +CONFIG_IEEE80211=y # 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=y # CONFIG_IEEE80211_SOFTMAC_DEBUG is not set CONFIG_WIRELESS_EXT=y @@ -396,7 +406,7 @@ # CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y -CONFIG_FW_LOADER=m +# CONFIG_FW_LOADER is not set # # Connector - unified userspace <-> kernelspace linker @@ -421,10 +431,12 @@ # Block devices # # CONFIG_BLK_DEV_COW_COMMON is not set -CONFIG_BLK_DEV_LOOP=m +CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set -# CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y # CONFIG_CDROM_PKTCDVD is not set # CONFIG_ATA_OVER_ETH is not set @@ -501,7 +513,15 @@ # Wan interfaces # # CONFIG_WAN is not set -# CONFIG_PPP is not set +CONFIG_PPP=y +# CONFIG_PPP_MULTILINK is not set +# CONFIG_PPP_FILTER is not set +# CONFIG_PPP_ASYNC is not set +# CONFIG_PPP_SYNC_TTY is not set +# CONFIG_PPP_DEFLATE is not set +# CONFIG_PPP_BSDCOMP is not set +# CONFIG_PPP_MPPE is not set +# CONFIG_PPPOE is not set # CONFIG_SLIP is not set # CONFIG_SHAPER is not set # CONFIG_NETCONSOLE is not set @@ -544,20 +564,10 @@ # CONFIG_KEYBOARD_STOWAWAY is not set CONFIG_KEYBOARD_PXA27x=y # CONFIG_KEYBOARD_PALMIR is not set +CONFIG_KEYBOARD_PALMWK=y # 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 -# CONFIG_TOUCHSCREEN_MK712 is not set -CONFIG_TOUCHSCREEN_WM97XX=m -# CONFIG_TOUCHSCREEN_WM9705 is not set -CONFIG_TOUCHSCREEN_WM9712=y -# CONFIG_TOUCHSCREEN_WM9713 is not set -CONFIG_TOUCHSCREEN_WM97XX_PXA=y -CONFIG_TOUCHSCREEN_WM97XX_ACC=y +# CONFIG_INPUT_TOUCHSCREEN is not set # CONFIG_INPUT_MISC is not set # @@ -565,7 +575,7 @@ # CONFIG_SERIO=y CONFIG_SERIO_SERPORT=y -CONFIG_SERIO_LIBPS2=y +# CONFIG_SERIO_LIBPS2 is not set # CONFIG_SERIO_RAW is not set # CONFIG_GAMEPORT is not set @@ -674,7 +684,8 @@ # # Misc devices # -# CONFIG_BATTERY_MONITOR is not set +CONFIG_BATTERY_MONITOR=y +# CONFIG_BATTCHARGE_MONITOR is not set # # Multimedia Capabilities Port drivers @@ -684,15 +695,19 @@ # # LED devices # -# CONFIG_NEW_LEDS is not set +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y # # LED drivers # +CONFIG_LEDS_PALMZ72=y # # LED Triggers # +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_TIMER=y # # Multimedia devices @@ -719,7 +734,7 @@ # CONFIG_FB_IMAGEON is not set # CONFIG_FB_S1D13XXX is not set CONFIG_FB_PXA=y -# CONFIG_FB_PXA_PARAMETERS is not set +CONFIG_FB_PXA_PARAMETERS=y # CONFIG_FB_VIRTUAL is not set # @@ -744,7 +759,10 @@ # # Logo configuration # -# CONFIG_LOGO is not set +CONFIG_LOGO=y +# CONFIG_LOGO_LINUX_MONO is not set +# CONFIG_LOGO_LINUX_VGA16 is not set +CONFIG_LOGO_LINUX_CLUT224=y CONFIG_BACKLIGHT_LCD_SUPPORT=y CONFIG_BACKLIGHT_CLASS_DEVICE=y CONFIG_BACKLIGHT_DEVICE=y @@ -755,30 +773,30 @@ # # Sound # -CONFIG_SOUND=m +CONFIG_SOUND=y # # Advanced Linux Sound Architecture # -CONFIG_SND=m -CONFIG_SND_TIMER=m -CONFIG_SND_PCM=m +CONFIG_SND=y +CONFIG_SND_TIMER=y +CONFIG_SND_PCM=y # CONFIG_SND_SEQUENCER is not set CONFIG_SND_OSSEMUL=y -# CONFIG_SND_MIXER_OSS is not set -CONFIG_SND_PCM_OSS=m +CONFIG_SND_MIXER_OSS=y +CONFIG_SND_PCM_OSS=y 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_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 # # Generic devices # -CONFIG_SND_AC97_CODEC=m -CONFIG_SND_AC97_BUS=m +CONFIG_SND_AC97_CODEC=y +CONFIG_SND_AC97_BUS=y # CONFIG_SND_DUMMY is not set # CONFIG_SND_MTPAV is not set # CONFIG_SND_SERIAL_U16550 is not set @@ -787,9 +805,9 @@ # # ALSA ARM devices # -CONFIG_SND_PXA2xx_I2SOUND=m -CONFIG_SND_PXA2XX_PCM=m -CONFIG_SND_PXA2XX_AC97=m +# CONFIG_SND_PXA2xx_I2SOUND is not set +CONFIG_SND_PXA2XX_PCM=y +CONFIG_SND_PXA2XX_AC97=y # # Open Sound System @@ -811,13 +829,13 @@ # # USB Gadget Support # -CONFIG_USB_GADGET=m +CONFIG_USB_GADGET=y # 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=m +CONFIG_USB_PXA27X=y # CONFIG_USB_PXA27X_DMA is not set # CONFIG_USB_GADGET_GOKU is not set # CONFIG_USB_GADGET_MQ11XX is not set @@ -828,19 +846,19 @@ # CONFIG_USB_GADGET_DUALSPEED is not set # CONFIG_USB_ZERO is not set CONFIG_USB_ETH=m -# CONFIG_USB_ETH_RNDIS is not set -CONFIG_USB_GADGETFS=m +CONFIG_USB_ETH_RNDIS=y +# CONFIG_USB_GADGETFS is not set # CONFIG_USB_FILE_STORAGE is not set -CONFIG_USB_G_SERIAL=m +# CONFIG_USB_G_SERIAL is not set # CONFIG_USB_G_CHAR is not set # # MMC/SD Card support # -CONFIG_MMC=m +CONFIG_MMC=y # CONFIG_MMC_DEBUG is not set -CONFIG_MMC_BLOCK=m -CONFIG_MMC_PXA=m +CONFIG_MMC_BLOCK=y +CONFIG_MMC_PXA=y # CONFIG_MMC_TMIO is not set # CONFIG_MMC_SAMCOP is not set # CONFIG_MMC_ASIC3 is not set @@ -869,7 +887,7 @@ # # File systems # -CONFIG_EXT2_FS=m +CONFIG_EXT2_FS=y # CONFIG_EXT2_FS_XATTR is not set # CONFIG_EXT2_FS_XIP is not set # CONFIG_EXT3_FS is not set @@ -883,8 +901,8 @@ # CONFIG_INOTIFY is not set # CONFIG_QUOTA is not set CONFIG_DNOTIFY=y -# CONFIG_AUTOFS_FS is not set -# CONFIG_AUTOFS4_FS is not set +CONFIG_AUTOFS_FS=y +CONFIG_AUTOFS4_FS=y # CONFIG_FUSE_FS is not set # @@ -896,9 +914,9 @@ # # DOS/FAT/NT Filesystems # -CONFIG_FAT_FS=m -CONFIG_MSDOS_FS=m -CONFIG_VFAT_FS=m +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y CONFIG_FAT_DEFAULT_CODEPAGE=437 CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" # CONFIG_NTFS_FS is not set @@ -924,7 +942,7 @@ # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set # CONFIG_CRAMFS is not set -CONFIG_SQUASHFS=m +CONFIG_SQUASHFS=y CONFIG_SQUASHFS_EMBEDDED=y CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 # CONFIG_SQUASHFS_VMALLOC is not set @@ -938,8 +956,16 @@ # # Network File Systems # -# CONFIG_NFS_FS is not set +CONFIG_NFS_FS=m +# CONFIG_NFS_V3 is not set +# CONFIG_NFS_V4 is not set +# CONFIG_NFS_DIRECTIO is not set # CONFIG_NFSD is not set +CONFIG_LOCKD=m +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=m +# CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -956,9 +982,9 @@ # # Native Language Support # -CONFIG_NLS=m +CONFIG_NLS=y CONFIG_NLS_DEFAULT="iso8859-1" -CONFIG_NLS_CODEPAGE_437=m +CONFIG_NLS_CODEPAGE_437=y # CONFIG_NLS_CODEPAGE_737 is not set # CONFIG_NLS_CODEPAGE_775 is not set # CONFIG_NLS_CODEPAGE_850 is not set @@ -971,7 +997,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=m +CONFIG_NLS_CODEPAGE_866=y # CONFIG_NLS_CODEPAGE_869 is not set # CONFIG_NLS_CODEPAGE_936 is not set # CONFIG_NLS_CODEPAGE_950 is not set @@ -982,8 +1008,8 @@ # CONFIG_NLS_CODEPAGE_1250 is not set # CONFIG_NLS_CODEPAGE_1251 is not set # CONFIG_NLS_ASCII is not set -CONFIG_NLS_ISO8859_1=m -# CONFIG_NLS_ISO8859_2 is not set +CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_ISO8859_2=y # CONFIG_NLS_ISO8859_3 is not set # CONFIG_NLS_ISO8859_4 is not set # CONFIG_NLS_ISO8859_5 is not set @@ -993,9 +1019,9 @@ # 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=m +CONFIG_NLS_KOI8_R=y # CONFIG_NLS_KOI8_U is not set -CONFIG_NLS_UTF8=m +CONFIG_NLS_UTF8=y # # Profiling support @@ -1011,7 +1037,7 @@ # CONFIG_DEBUG_KERNEL is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_DEBUG_BUGVERBOSE is not set -# CONFIG_DEBUG_FS is not set +CONFIG_DEBUG_FS=y CONFIG_FRAME_POINTER=y # CONFIG_UNWIND_INFO is not set # CONFIG_DEBUG_USER is not set @@ -1038,4 +1064,4 @@ # CONFIG_CRC16 is not set CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set -CONFIG_ZLIB_INFLATE=m +CONFIG_ZLIB_INFLATE=y This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z7...@us...> - 2007-01-08 10:29:24
|
Revision: 742 http://svn.sourceforge.net/hackndev/?rev=742&view=rev Author: z72ka Date: 2007-01-08 02:29:22 -0800 (Mon, 08 Jan 2007) Log Message: ----------- LED, TS via AC97 driver, updated Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c 2007-01-08 10:27:39 UTC (rev 741) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c 2007-01-08 10:29:22 UTC (rev 742) @@ -5,6 +5,7 @@ * Vladimir "Farcaller" Pouzanov <far...@gm...> * Sergey Lapin <sla...@gm...> * Alex Osborne <bob...@gm...> + * Jan Herman <2h...@se...> */ #include <linux/kernel.h> @@ -36,6 +37,7 @@ #include <asm/arch/irda.h> #include <asm/arch/mmc.h> #include <asm/arch/palmz72-gpio.h> +#include <asm/arch/pxa_camera.h> #include <sound/driver.h> #include <sound/core.h> @@ -54,9 +56,14 @@ #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) +/* * LED */ +static struct platform_device palmz72led_device = { + .name = "palmz72-led", + .id = -1, +}; + + static int palmz72_udc_is_connected(void) { int ret = !(GET_GPIO(GPIO_NR_PALMZ72_USB_DETECT)); @@ -90,41 +97,47 @@ * Keypad */ -static struct pxa27x_keyboard_platform_data palmld_kbd_data = { +static struct pxa27x_keyboard_platform_data palmz72_kbd_data = { .nr_rows = 4, .nr_cols = 3, .keycodes = { { /* row 0 */ - -1, /* unused */ - KEY_P, /* Folder */ - KEY_ENTER, /* Nav up */ + KEY_POWER, /* Power KEY */ + KEY_F13, /* Photos */ + KEY_ENTER, /* DPAD Center*/ }, { /* row 1 */ - KEY_T, /* Picture */ - KEY_C, /* Star */ - KEY_M, /* Nav right */ + KEY_F9, /* Calendar*/ + KEY_F10, /* Contacts */ + KEY_F12, /* Media */ }, { /* row 2 */ - KEY_UP, /* Home */ - -1, /* Voice memo */ - KEY_DOWN, /* Nav down */ + KEY_UP, /* D-PAD UP*/ + KEY_V, /* unused */ + KEY_DOWN, /* D-PAD DOWN */ }, { /* row 3 */ - KEY_RIGHT, /* Rotate display */ - KEY_ENTER, /* Nav centre */ - KEY_LEFT, /* Nav left */ + KEY_RIGHT, /* D-PAD RIGHT */ + KEY_S, /* ?? */ + KEY_LEFT, /* D-PAD LEFT */ }, - + { + /* row 4 */ + KEY_5, /* D-PAD RIGHT */ + KEY_6, /* ?? */ + KEY_7, /* D-PAD LEFT */ + }, }, .gpio_modes = { - GPIO_NR_ZIRE72_KP_MKIN0_MD, - GPIO_NR_ZIRE72_KP_MKIN1_MD, - GPIO_NR_ZIRE72_KP_MKIN2_MD, - GPIO_NR_ZIRE72_KP_MKIN3_MD, - GPIO_NR_ZIRE72_KP_MKOUT0_MD, - GPIO_NR_ZIRE72_KP_MKOUT1_MD, - GPIO_NR_ZIRE72_KP_MKOUT2_MD, + GPIO_NR_PALMZ72_KP_MKIN0_MD, + GPIO_NR_PALMZ72_KP_MKIN1_MD, + GPIO_NR_PALMZ72_KP_MKIN2_MD, + GPIO_NR_PALMZ72_KP_MKIN3_MD, + GPIO_NR_PALMZ72_KP_MKOUT0_MD, + GPIO_NR_PALMZ72_KP_MKOUT1_MD, + GPIO_NR_PALMZ72_KP_MKOUT2_MD, + }, }; @@ -132,7 +145,7 @@ .name = "pxa27x-keyboard", .id = -1, .dev = { - .platform_data = &palmld_kbd_data, + .platform_data = &palmz72_kbd_data, }, }; @@ -196,42 +209,46 @@ } - 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, }; -#if 0 /** * AC97 audio controller */ + static pxa2xx_audio_ops_t palmz72_audio_ops = { - /* +/* .startup = palmz72_audio_startup, .shutdown = mst_audio_shutdown, .suspend = mst_audio_suspend, .resume = mst_audio_resume, - */ +*/ }; + + static struct platform_device palmz72_ac97 = { .name = "pxa2xx-ac97", .id = -1, .dev = { .platform_data = &palmz72_audio_ops }, }; -#endif + +#if 0 + /* touchscreen */ + static struct platform_device palmz72_touch = { .name = "wm97xx", .id = -1, }; - +#endif /** * Backlight */ @@ -240,7 +257,7 @@ #define PALMZ72_DEFAULT_INTENSITY 0x7E #define PALMZ72_LIMIT_MASK 0x7F -static struct pxapwmbl_platform_data palmld_backlight_data = { +static struct pxapwmbl_platform_data palmz72_backlight_data = { .pwm = 0, .max_intensity = PALMZ72_MAX_INTENSITY, .default_intensity = PALMZ72_DEFAULT_INTENSITY, @@ -252,15 +269,16 @@ static struct platform_device palmz72_backlight = { .name = "pxapwm-bl", .dev = { - .platform_data = &palmld_backlight_data, + .platform_data = &palmz72_backlight_data, }, }; static struct platform_device *devices[] __initdata = { -// &palmz72_ac97, - &palmz72_touch, + &palmz72_ac97, + //&palmz72_touch, &palmz72_backlight, - &palmz72_keypad, + &palmz72_keypad, + &palmz72led_device, }; /* framebuffer */ @@ -289,18 +307,18 @@ // disable 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 + 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); - pxa_gpio_mode(GPIO_NR_ZIRE72_LED_MD); // testing // GPSR(91) = GPIO_bit(91); - LED_ON; switch(palmz72lcd.bpp) { @@ -321,12 +339,13 @@ palmlz72_irda_set_txrx (NULL, PXA_SERIAL_TX); #endif #endif - LED_OFF; +// LED_OFF; } MACHINE_START(PALMZ72, "Palm Zire 72") - /* Maintainer: Vladimir Pouzanov <far...@gm...> */ + /* Maintainer: Vladimir Pouzanov <far...@gm...> */ /* Maintainer: Sergey Lapin <sla...@gm...> */ + /* Maintainer: Jan Herman <2h...@se...> */ .boot_params = 0xa0000100, .phys_io = 0x40000000, .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z7...@us...> - 2007-01-08 10:27:42
|
Revision: 741 http://svn.sourceforge.net/hackndev/?rev=741&view=rev Author: z72ka Date: 2007-01-08 02:27:39 -0800 (Mon, 08 Jan 2007) Log Message: ----------- Added gpioed and gpioed-ng for developing (as modules) Modified Paths: -------------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Makefile Added Paths: ----------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpioed-ng.c linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpioed.c Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig 2007-01-08 10:24:30 UTC (rev 740) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig 2007-01-08 10:27:39 UTC (rev 741) @@ -4,3 +4,26 @@ select KEYBOARD_PXA27x help This enables support for Palm Zire 72 handheld. + +config PALMZ72_AC97 + tristate "Palm Zire 72 AC97 Driver" + depends on MACH_PALMZ72 + default y if MACH_PALMZ72 + help + Enable support for WM9712 touchscreen and battery driver for + the PalmOne Zire 72 PDA + +config GPIOED + tristate "GPIOED" + depends on MACH_PALMZ72 + default n + help + Only for debuging and testing + +config GPIOEDNG + tristate "GPIOEDNG" + depends on MACH_PALMZ72 + default n + help + Gpioed-ng only for debugging and testing + \ No newline at end of file Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Makefile =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Makefile 2007-01-08 10:24:30 UTC (rev 740) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Makefile 2007-01-08 10:27:39 UTC (rev 741) @@ -3,3 +3,6 @@ # obj-$(CONFIG_MACH_PALMZ72) += palmz72.o +obj-$(CONFIG_PALMZ72_AC97) += palmz72_ac97.o +obj-$(CONFIG_GPIOED) += gpioed.o +obj-$(CONFIG_GPIOEDNG) += gpioed-ng.o Added: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpioed-ng.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpioed-ng.c (rev 0) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpioed-ng.c 2007-01-08 10:27:39 UTC (rev 741) @@ -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 %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"); + Added: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpioed.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpioed.c (rev 0) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/gpioed.c 2007-01-08 10:27:39 UTC (rev 741) @@ -0,0 +1,226 @@ +/*** Basic includes ***/ +#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> + +/*** 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, dev_id); + 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"); + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z7...@us...> - 2007-01-08 10:24:31
|
Revision: 740 http://svn.sourceforge.net/hackndev/?rev=740&view=rev Author: z72ka Date: 2007-01-08 02:24:30 -0800 (Mon, 08 Jan 2007) Log Message: ----------- New touchcscreen/battery driver Added Paths: ----------- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_ac97.c Added: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_ac97.c =================================================================== --- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_ac97.c (rev 0) +++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_ac97.c 2007-01-08 10:24:30 UTC (rev 740) @@ -0,0 +1,552 @@ +/* + * linux/arch/arm/mach-pxa/palmz72/palmz72_ac97.c + * + * Touchscreen/battery driver for Palm Zire 72 WM9712 AC97 codec + * Author: Jan Herman <2h...@se...> + * Based on palmld_ac97.c code from Alex Osborne + * + */ + + +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/init.h> +#include <linux/interrupt.h> +#include <linux/input.h> +#include <linux/device.h> +#include <linux/workqueue.h> +#include <linux/battery.h> + +#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 <sound/driver.h> +#include <sound/core.h> +#include <sound/pcm.h> +#include <sound/initval.h> +#include <sound/ac97_codec.h> +#include <asm/arch/palmz72-ac97.h> +#include <asm/arch/palmz72-gpio.h> +#include <asm/arch/palmz72-init.h> + + +#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 300 + +#define DIG2_INIT 0x0001 /* initial value for digitiser2 reg */ + +#define DEFAULT_PRESSURE_TRESHOLD 47200 /* default pressure treshold for pen up/down */ +#define DEFAULT_X_AXIS_FUZZ 5 /* default x axis noise treshold */ +#define DEFAULT_Y_AXIS_FUZZ 40 /* default y axis noise treshold */ +#define PRESSURE_FUZZ 4 /* default pressure noise treshold */ + +#define palmz72_ac97_WORK_QUEUE_NAME "palmz72_ac97_workqueue" + + +/* module parameters */ + +static int ptrsh = DEFAULT_PRESSURE_TRESHOLD; +module_param(ptrsh, int, 0); +MODULE_PARM_DESC(ptrsh, "pressure treshold for pen up/down"); + +static int dbglvl = 0; // debug disabled +module_param(dbglvl, int, 0); +MODULE_PARM_DESC(dbglvl, "debug level (0 is disabled)"); + +static int xdjtrsh = DEFAULT_X_AXIS_FUZZ; +module_param(xdjtrsh, int, 0); +MODULE_PARM_DESC(xdjtrsh, "treshold for x axis jitter"); + +static int ydjtrsh = DEFAULT_Y_AXIS_FUZZ; +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); + +static struct workqueue_struct *palmz72_ac97_workqueue; +static struct work_struct palmz72_ac97_irq_task; + +struct input_dev *palmz72_ac97_input; +struct device *palmz72_ac97_dev; + +static ac97_t *ac97; + +static int battery_registered = 0; +static unsigned long last_battery_update = 0; +static int current_voltage; +static int previous_voltage; +static u16 d2base; + +/* + * ac97 codec + */ + +void wm97xx_gpio_func(int gpio, int func) +{ + int GEn; + GEn = ac97->bus->ops->read(ac97, 0x56); + if(func) + GEn |= gpio; + else + GEn &= ~gpio; + ac97->bus->ops->write(ac97, 0x56, GEn); +} + + +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); + GPn = ac97->bus->ops->read(ac97, 0x4e); + GSn = ac97->bus->ops->read(ac97, 0x50); + GWn = ac97->bus->ops->read(ac97, 0x52); + + if(config) + GCn |= gpio; + else + GCn &= ~gpio; + + if(polarity) + GPn |= gpio; + else + GPn &= ~gpio; + + if(sticky) + GSn |= gpio; + else + GSn &= ~gpio; + + if(wakeup) + GWn |= gpio; + else + GWn &= ~gpio; + + ac97->bus->ops->write(ac97, 0x4c, GCn); + ac97->bus->ops->write(ac97, 0x4e, GPn); + ac97->bus->ops->write(ac97, 0x50, GSn); + ac97->bus->ops->write(ac97, 0x52, GWn); +} + + +static void wm97xx_set_digitiser_power(int value) +{ + ac97->bus->ops->write(ac97, AC97_WM97XX_DIGITISER2, d2base | value); +} + + +/* + * note: for the TX there's some code that gets enabled in linux/sound/pxa2xx-ac97.c + * (ifdef CONFIG_MACH_PALMZ72) that tries to implement some recommended procedure for + * reading/writing reg 0x54 from a Intel's document + * (PXA27x Specification Update: 28007109.pdf sec.: E54) + */ + +static int palmz72_ac97_take_reading(int adcsel) +{ + + int timeout = 15; + u16 r76 = 0; + u16 r7a; + + 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 + udelay ((3 * AC97_LINK_FRAME) + 167); + + // wait for POLL to go low + while((ac97->bus->ops->read(ac97, 0x76) & 0x8000) && timeout){ + udelay(AC97_LINK_FRAME); + timeout--; + } + + if (timeout == 0){ + printk("palmz72_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("palmz72_ac97: discarding reading -> wrong ADC source\n"); + return 0; + } + + return (int) r7a; + +} + + +static void palmz72_ac97_pendown(void) +{ + int xread, yread, pressure; + int valid_coords=0, btn_pressed = 0; + + /* take readings until the pen goes up */ + do { + /* take readings */ + xread = palmz72_ac97_take_reading(WM97XX_ADCSEL_X); + yread = palmz72_ac97_take_reading(WM97XX_ADCSEL_Y); + pressure = palmz72_ac97_take_reading(WM97XX_ADCSEL_PRES); + + // printk("Pressure is %d:\n", pressure); + + valid_coords = (xread & 0xfff) && (yread & 0xfff) && (pressure & 0xfff); + + if(valid_coords && (pressure < ptrsh)) { + btn_pressed = 1; + input_report_key(palmz72_ac97_input, BTN_TOUCH, 1); + input_report_abs(palmz72_ac97_input, ABS_X, xread & 0xfff); + input_report_abs(palmz72_ac97_input, ABS_Y, yread & 0xfff); + input_report_abs(palmz72_ac97_input, ABS_PRESSURE, pressure & 0xfff); + input_sync(palmz72_ac97_input); + + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(HZ/100); + set_current_state(TASK_RUNNING); + } + } while( valid_coords ); + + + if (btn_pressed) { + input_report_key(palmz72_ac97_input, BTN_TOUCH, 0); + input_report_abs(palmz72_ac97_input, ABS_X, 0); + input_report_abs(palmz72_ac97_input, ABS_Y, 0); + input_report_abs(palmz72_ac97_input, ABS_PRESSURE, 0); + input_sync(palmz72_ac97_input); + } + +} + + +static void palmz72_ac97_irq_work(void *data) +{ + u16 levels; + u16 polarity; + + levels = ac97->bus->ops->read(ac97, 0x54); + polarity = ac97->bus->ops->read(ac97, 0x4e); + + if(polarity & levels & WM97XX_GPIO_13) { + // power up digitiser: + down(&digitiser_sem); + wm97xx_set_digitiser_power(WM97XX_PRP_DET_DIG); + + palmz72_ac97_pendown(); + + /* power down digitiser to conserve power */ + wm97xx_set_digitiser_power(WM97XX_PRP_DET); + ac97->bus->ops->write(ac97, 0x4e, polarity & ~WM97XX_GPIO_13); + up(&digitiser_sem); + } + else { + ac97->bus->ops->write(ac97, 0x4e, polarity | WM97XX_GPIO_13); + } + + ac97->bus->ops->write(ac97, 0x54, levels & ~WM97XX_GPIO_13); + + udelay(1); + up(&queue_sem); + enable_irq(IRQ_GPIO_PALMZ72_WM9712_IRQ); +} + + +static irqreturn_t palmz72_ac97_irq_handler(int irq, void *dev_id, struct pt_regs *regs) +{ + if (down_trylock(&queue_sem) == 0){ + disable_irq(IRQ_GPIO_PALMZ72_WM9712_IRQ); + queue_work(palmz72_ac97_workqueue, &palmz72_ac97_irq_task); + } + + return IRQ_HANDLED; +} + +/* battery */ + + +void palmz72_battery_read_adc(int force) +{ + u16 vread; + + if(!force && ((last_battery_update + 10 *HZ) > jiffies)) + return; + + if(down_trylock(&battery_update_mutex)) + return; + + down(&digitiser_sem); + wm97xx_set_digitiser_power(WM97XX_PRP_DET_DIG); + vread = palmz72_ac97_take_reading(WM97XX_ADCSEL_BMON); + wm97xx_set_digitiser_power(WM97XX_PRP_DET); + up(&digitiser_sem); + + previous_voltage = current_voltage; + current_voltage = vread & 0xfff; + last_battery_update = jiffies; + + up(&battery_update_mutex); +} + + +int palmz72_battery_min_voltage(struct battery *b) +{ + return PALMZ72_BAT_MIN_VOLTAGE; +} + + +int palmz72_battery_max_voltage(struct battery *b) +{ + return PALMZ72_BAT_MAX_VOLTAGE; /* mV */ +} + +// V-batt = ADCSEL_BMON * 1,889 + 767,8 [mV] + +int palmz72_battery_get_voltage(struct battery *b) +{ + if (battery_registered){ + palmz72_battery_read_adc(0); + //printk("Battery [mV]: %d\n", current_voltage + PALMZ72_BMON_TO_VBATT ); + return current_voltage * 1889/1000 + 7678/10; + } + else{ + printk("palmz72_battery: cannot get voltage -> battery driver unregistered\n"); + return 0; + } +} + + +int palmz72_battery_get_status(struct battery *b) +{ + int ac_connected = GET_GPIO(GPIO_NR_PALMZ72_POWER_DETECT); + int usb_connected = !GET_GPIO(GPIO_NR_PALMZ72_USB_DETECT); + + if (current_voltage <= 0) + return BATTERY_STATUS_UNKNOWN; + + if (ac_connected || usb_connected){ + // TODO: ok maybe this is too stupid ... to be reviewed + if ( ( current_voltage > previous_voltage ) || (current_voltage <= PALMZ72_BAT_MAX_VOLTAGE) ) + return BATTERY_STATUS_CHARGING; + return BATTERY_STATUS_NOT_CHARGING; + } + else + return BATTERY_STATUS_DISCHARGING; +} + + +struct battery palmz72_battery = { + .name = "palmz72_battery", + .id = "battery0", + .get_min_voltage = palmz72_battery_min_voltage, + .get_max_voltage = palmz72_battery_max_voltage, + .get_voltage = palmz72_battery_get_voltage, + .get_status = palmz72_battery_get_status, +}; + + + + +static int __init palmz72_ac97_probe(struct device *dev) +{ + int err; + u16 d2 = DIG2_INIT; // init d1 too? + + if(!machine_is_palmz72()) + return -ENODEV; + + ac97 = to_ac97_t(dev); + + set_irq_type(IRQ_GPIO_PALMZ72_WM9712_IRQ, IRQT_RISING); + + err = request_irq(IRQ_GPIO_PALMZ72_WM9712_IRQ, palmz72_ac97_irq_handler, + SA_INTERRUPT, "WM9712 pendown IRQ", dev); + + if(err) { + printk(KERN_ERR "palmz72_ac97_probe: cannot request pen down IRQ\n"); + return -1; + } + + /* reset levels */ + ac97->bus->ops->write(ac97, 0x54, 0); + + /* disable digitiser to save power, enable pen-down detect */ + 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(WM97XX_GPIO_2, WM97XX_GPIO_OUT, WM97XX_GPIO_POL_HIGH, + WM97XX_GPIO_NOTSTICKY, WM97XX_GPIO_NOWAKE); + wm97xx_gpio_func(WM97XX_GPIO_2, 0); + + /* enable pen detect interrupt */ + wm97xx_gpio_mode(WM97XX_GPIO_13, WM97XX_GPIO_OUT, 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 */ + palmz72_ac97_input = input_allocate_device(); + if (palmz72_ac97_input == NULL){ + printk ("palmz72_ac97_probe: cannot allocate input device\n"); + return -ENOMEM; + } + + palmz72_ac97_input->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); + + palmz72_ac97_input->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); + input_set_abs_params(palmz72_ac97_input, ABS_X, X_AXIS_MIN, X_AXIS_MAX, xdjtrsh, 0); + input_set_abs_params(palmz72_ac97_input, ABS_Y, Y_AXIS_MIN, Y_AXIS_MAX, ydjtrsh, 0); + input_set_abs_params(palmz72_ac97_input, ABS_PRESSURE, PRESSURE_MIN, PRESSURE_MAX, PRESSURE_FUZZ, 0); + + palmz72_ac97_input->name = "palmz72 touchscreen"; + palmz72_ac97_input->dev = dev; + palmz72_ac97_input->id.bustype = BUS_HOST; + input_register_device(palmz72_ac97_input); + + /* register battery */ + + if(battery_class_register(&palmz72_battery)) { + printk(KERN_ERR "palmz72_ac97_probe: could not register battery class\n"); + } + else{ + battery_registered = 1; + } + + /* setup work queue */ + palmz72_ac97_workqueue = create_workqueue(palmz72_ac97_WORK_QUEUE_NAME); + INIT_WORK(&palmz72_ac97_irq_task, palmz72_ac97_irq_work, dev); + + up(&queue_sem); + return 0; +} + +static int palmz72_ac_is_connected (void){ + int ret = !(GET_GPIO(GPIO_NR_PALMZ72_POWER_DETECT)); + if (ret) + ret = 1; + else + ret = 0; + + return ret; +} + +/* APM */ +static void palmz72_apm_get_power_status(struct apm_power_info *info) +{ + int min, max, curr, percent; + + curr = palmz72_battery_get_voltage(NULL); + min = palmz72_battery_min_voltage(NULL); + max = palmz72_battery_max_voltage(NULL); + + curr = curr - min; + if (curr < 0) curr = 0; + max = max - min; + + percent = curr*100/max; + + info->battery_life = percent; + + info->ac_line_status = palmz72_ac_is_connected() ? APM_AC_ONLINE : APM_AC_OFFLINE; + + if (info->ac_line_status) { + info->battery_status = APM_BATTERY_STATUS_CHARGING; + } else { + if (percent > 50) + info->battery_status = APM_BATTERY_STATUS_HIGH; + else if (percent < 5) + info->battery_status = APM_BATTERY_STATUS_CRITICAL; + else + info->battery_status = APM_BATTERY_STATUS_LOW; + } + + info->time = percent * PALMZ72_MAX_LIFE_MINS/100; + info->units = APM_UNITS_MINS; +} + +typedef void (*apm_get_power_status_t)(struct apm_power_info*); + +int set_apm_get_power_status(apm_get_power_status_t t) +{ + apm_get_power_status = t; + + return 0; +} + + +/* end of APM implementing */ + +static int palmz72_ac97_remove (struct device *dev) +{ + // TODO: stop running tasks if any? + + battery_class_unregister(&palmz72_battery); + ac97 = NULL; + input_unregister_device(palmz72_ac97_input); + return 0; +} + + +static struct device_driver palmz72_ac97_driver = { + .name = "palmz72_ac97 (WM9712)", + .bus = &ac97_bus_type, + .owner = THIS_MODULE, + .probe = palmz72_ac97_probe, + .remove = palmz72_ac97_remove, + +#ifdef CONFIG_PM + .suspend = NULL, + .resume = NULL, +#endif +}; + + +static int __init palmz72_ac97_init(void) +{ + driver_register(&palmz72_ac97_driver); + +/* register battery to APM layer */ +#ifdef CONFIG_PM + apm_get_power_status = palmz72_apm_get_power_status; + return 0; +#endif + +} + + +static void __exit palmz72_ac97_exit(void) +{ + driver_unregister(&palmz72_ac97_driver); +} + + +module_init(palmz72_ac97_init); +module_exit(palmz72_ac97_exit); + +MODULE_AUTHOR ("Jan Herman <2h...@se...>"); +MODULE_DESCRIPTION ("WM9712 AC97 codec support for PalmOne Zire 72"); +MODULE_LICENSE ("GPL"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z7...@us...> - 2007-01-08 10:22:05
|
Revision: 739 http://svn.sourceforge.net/hackndev/?rev=739&view=rev Author: z72ka Date: 2007-01-08 02:21:59 -0800 (Mon, 08 Jan 2007) Log Message: ----------- Added support for Zire72 LED Modified Paths: -------------- linux4palm/linux/trunk/drivers/leds/Kconfig Added Paths: ----------- linux4palm/linux/trunk/drivers/leds/led-palmz72.c Modified: linux4palm/linux/trunk/drivers/leds/Kconfig =================================================================== --- linux4palm/linux/trunk/drivers/leds/Kconfig 2007-01-08 10:10:11 UTC (rev 738) +++ linux4palm/linux/trunk/drivers/leds/Kconfig 2007-01-08 10:21:59 UTC (rev 739) @@ -82,6 +82,12 @@ help This option enables support for the LEDs on Palm LifeDrive. +config LEDS_PALMZ72 + tristate "LED Support for PalmOne Zire 72" + depends LEDS_CLASS && MACH_PALMZ72 + help + This option enables support for the LED on PalmOne Zire72. + config LEDS_PALMT650 tristate "LED Support for Palm Treo 650" depends LEDS_CLASS && MACH_XSCALE_PALMTREO650 Added: linux4palm/linux/trunk/drivers/leds/led-palmz72.c =================================================================== --- linux4palm/linux/trunk/drivers/leds/led-palmz72.c (rev 0) +++ linux4palm/linux/trunk/drivers/leds/led-palmz72.c 2007-01-08 10:21:59 UTC (rev 739) @@ -0,0 +1,96 @@ +/* + * Palm Zire72 LED Driver + * + * Author: Jan Herman <2h...@se...> + + * Based on driver from Marek Vasut (Palm Life Drive LED 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/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/palmz72-gpio.h> +#include <asm/arch/hardware.h> +#include <asm/arch/pxa-regs.h> +#include <asm/hardware/scoop.h> + + +static void palmz72led_green_set(struct led_classdev *led_cdev, enum led_brightness value) +{ + if (value) + SET_PALMZ72_GPIO(LED,1); + else + SET_PALMZ72_GPIO(LED,0); +} + +static struct led_classdev palmz72_green_led = { + .name = "led", + .brightness_set = palmz72led_green_set, +}; + +#ifdef CONFIG_PM +static int palmz72led_suspend(struct platform_device *dev, pm_message_t state) +{ + led_classdev_suspend(&palmz72_green_led); + return 0; +} + +static int palmz72led_resume(struct platform_device *dev) +{ + led_classdev_resume(&palmz72_green_led); + return 0; +} +#endif + +static int palmz72led_probe(struct platform_device *pdev) +{ + int ret; + ret = led_classdev_register(&pdev->dev, &palmz72_green_led); + if (ret < 0) + led_classdev_unregister(&palmz72_green_led); + + return ret; +} + +static int palmz72led_remove(struct platform_device *pdev) +{ + led_classdev_unregister(&palmz72_green_led); + return 0; +} + +static struct platform_driver palmz72led_driver = { + .probe = palmz72led_probe, + .remove = palmz72led_remove, +#ifdef CONFIG_PM + .suspend = palmz72led_suspend, + .resume = palmz72led_resume, +#endif + .driver = { + .name = "palmz72-led", + }, +}; + +static int __init palmz72led_init(void) +{ + return platform_driver_register(&palmz72led_driver); +} + +static void __exit palmz72led_exit(void) +{ + platform_driver_unregister(&palmz72led_driver); +} + +module_init(palmz72led_init); +module_exit(palmz72led_exit); + +MODULE_AUTHOR("Jan Herman <2h...@se...>"); +MODULE_DESCRIPTION("Palm Zire72 LED driver"); +MODULE_LICENSE("GPL"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z7...@us...> - 2007-01-08 10:10:14
|
Revision: 738 http://svn.sourceforge.net/hackndev/?rev=738&view=rev Author: z72ka Date: 2007-01-08 02:10:11 -0800 (Mon, 08 Jan 2007) Log Message: ----------- Added support for 4-row Palm IR keyboard Modified Paths: -------------- linux4palm/linux/trunk/drivers/net/irda/sir_dev.c Modified: linux4palm/linux/trunk/drivers/net/irda/sir_dev.c =================================================================== --- linux4palm/linux/trunk/drivers/net/irda/sir_dev.c 2007-01-08 10:01:18 UTC (rev 737) +++ linux4palm/linux/trunk/drivers/net/irda/sir_dev.c 2007-01-08 10:10:11 UTC (rev 738) @@ -322,7 +322,14 @@ int palmirkbd_receive(void *dev, const unsigned char *cp, size_t count); #endif +#ifdef CONFIG_KEYBOARD_PALMWK +/* NOTE: this is a hack so that we can use the palm keyboard and IRDA at the same + * time. It should not be included in any official-ish kernel tree. + */ +int palmwk_receive(void *dev, const unsigned char *cp, size_t count); +#endif + /***************************************************************************/ void sirdev_enable_rx(struct sir_dev *dev) @@ -546,6 +553,13 @@ */ if(palmirkbd_receive(dev, cp, count)) return 0; #endif + + #ifdef CONFIG_KEYBOARD_PALMWK + /* NOTE: this is a hack so that we can use the palm keyboard and IRDA at the same + * time. It should not be included in any official-ish kernel tree. + */ + if(palmwk_receive(dev, cp, count)) return 0; + #endif if (!dev || !dev->netdev) { IRDA_WARNING("%s(), not ready yet!\n", __FUNCTION__); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z7...@us...> - 2007-01-08 10:01:21
|
Revision: 737 http://svn.sourceforge.net/hackndev/?rev=737&view=rev Author: z72ka Date: 2007-01-08 02:01:18 -0800 (Mon, 08 Jan 2007) Log Message: ----------- Added basic driver for 4-row Palm IR keyboard Modified Paths: -------------- linux4palm/linux/trunk/drivers/input/keyboard/Kconfig linux4palm/linux/trunk/drivers/input/keyboard/Makefile Modified: linux4palm/linux/trunk/drivers/input/keyboard/Kconfig =================================================================== --- linux4palm/linux/trunk/drivers/input/keyboard/Kconfig 2007-01-08 09:56:01 UTC (rev 736) +++ linux4palm/linux/trunk/drivers/input/keyboard/Kconfig 2007-01-08 10:01:18 UTC (rev 737) @@ -213,4 +213,10 @@ This enables basic support for the 5-row Palm Universal Wireless Keyboard. +config KEYBOARD_PALMWK + tristate "Palm 4-row IR Keyboard" + depends on IRTTY_SIR + help + This enables basic support for the 4-row Palm Wireless Keyboard. + endif Modified: linux4palm/linux/trunk/drivers/input/keyboard/Makefile =================================================================== --- linux4palm/linux/trunk/drivers/input/keyboard/Makefile 2007-01-08 09:56:01 UTC (rev 736) +++ linux4palm/linux/trunk/drivers/input/keyboard/Makefile 2007-01-08 10:01:18 UTC (rev 737) @@ -19,3 +19,4 @@ obj-$(CONFIG_KEYBOARD_PXA27x) += pxa27x_keyboard.o obj-$(CONFIG_KEYBOARD_STOWAWAY) += stowaway.o obj-$(CONFIG_KEYBOARD_PALMIR) += palmirkbd.o +obj-$(CONFIG_KEYBOARD_PALMWK) += palmwk.o This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z7...@us...> - 2007-01-08 09:56:04
|
Revision: 736 http://svn.sourceforge.net/hackndev/?rev=736&view=rev Author: z72ka Date: 2007-01-08 01:56:01 -0800 (Mon, 08 Jan 2007) Log Message: ----------- Added basic driver for 4-row Palm IR keyboard Added Paths: ----------- linux4palm/linux/trunk/drivers/input/keyboard/palmwk.c Added: linux4palm/linux/trunk/drivers/input/keyboard/palmwk.c =================================================================== --- linux4palm/linux/trunk/drivers/input/keyboard/palmwk.c (rev 0) +++ linux4palm/linux/trunk/drivers/input/keyboard/palmwk.c 2007-01-08 09:56:01 UTC (rev 736) @@ -0,0 +1,254 @@ +/* + * linux/drivers/input/keyboard/palmwk.c + * + * A 4-row Palm Wireless Keyboard driver + * Author: Jan Herman <2h...@se...> + * + * This driver is light modified from original + * "Basic 5-row driver" from Alex Osborne <bob...@gm...> + */ + +#include <linux/module.h> +#include <linux/kernel.h> +#include <linux/tty.h> +#include <linux/init.h> +#include <linux/input.h> + +#define STATE_OUTSIDE 0 +#define STATE_BEGIN 1 +#define STATE_SCANCODE 2 +#define STATE_CRC 3 + +#define XBOF 0xff +#define BOF 0xc0 +#define EOF 0xc1 + +#define MASK_CODE 0x7f +#define MASK_KEYUP 0x80 + +static unsigned char keycode_table[] = { +// Normal Fn_Blue Fn_Green ScanCode + 0, 0, 0, /* 0 */ + 0, 0, 0, /* 1 */ + 0, 0, 0, /* 2 */ + KEY_Z, KEY_OK, 0, /* 3 */ + 0, 0, 0, /* 4 */ + 0, 0, 0, /* 5 */ + 0, 0, 0, /* 6 */ + 0, 0, 0, /* 7 */ + 0, 0, 0, /* 8 */ + KEY_Q, KEY_1, KEY_F1, /* 9 */ + KEY_W, KEY_2, KEY_F2, /* 10 */ + KEY_E, KEY_3, KEY_F3, /* 11 */ + KEY_R, KEY_4, KEY_F4, /* 12 */ + KEY_T, KEY_5, KEY_F5, /* 13 */ + KEY_Y, KEY_6, KEY_F6, /* 14 */ + 0, 0, 0, /* 15 */ + KEY_X, 0, 0, /* 16 */ + KEY_A, 0, 0, /* 17 */ + KEY_S, 0, 0, /* 18 */ + KEY_D, 0, 0, /* 19 */ + KEY_F, 0, 0, /* 20 */ + KEY_G, 0, 0, /* 21 */ + KEY_H, 0, 0, /* 22 */ + KEY_SPACE, 0, 0, /* 23 */ + KEY_CAPSLOCK, 0, 0, /* 24 */ + 0, 0, 0, /* 25 */ + KEY_RIGHTCTRL, 0, 0, /* 26 */ + KEY_TAB, 0, 0, /* 27 */ + 0, 0, 0, /* 28 */ + 0, 0, 0, /* 29 */ + 0, 0, 0, /* 30 */ + 0, 0, 0, /* 31 */ + 0, 0, 0, /* 32 */ + 0, 0, 0, /* 33 */ + KEY_RIGHTMETA, 0, 0, /* 34 */ + KEY_LEFTALT, 0, 0, /* 35 */ + KEY_LEFTMETA, 0, 0, /* 36 */ + 0, 0, 0, /* 37 */ + 0, 0, 0, /* 38 */ + 0, 0, 0, /* 39 */ + 0, 0, 0, /* 40 */ + 0, 0, 0, /* 41 */ + 0, 0, 0, /* 42 */ + 0, 0, 0, /* 43 */ + KEY_C, KEY_CANCEL, 0, /* 44 */ + KEY_V, 0, 0, /* 45 */ + KEY_B, 0, 0, /* 46 */ + KEY_N, KEY_NEW, 0, /* 47 */ + 0, 0, 0, /* 48 */ + 0, 0, 0, /* 49 */ + KEY_BACKSPACE, 0, 0, /* 50 */ + 0, 0, 0, /* 51 */ + 0, 0, 0, /* 52 */ + 0, 0, 0, /* 53 */ + 0, 0, 0, /* 54 */ + KEY_SPACE, 0, 0, /* 55 */ + KEY_MINUS, KEY_LEFTBRACE, KEY_F11, /* 56 */ + KEY_EQUAL, KEY_RIGHTBRACE, KEY_F12, /* 57 */ + KEY_SLASH, KEY_BACKSLASH, 0, /* 58 */ + 0, 0, 0, /* 59 */ + KEY_U, KEY_7, KEY_F7, /* 60 */ + KEY_I, KEY_8, KEY_F8, /* 61 */ + KEY_O, KEY_9, KEY_F9, /* 62 */ + KEY_P, KEY_0, KEY_F10, /* 63 */ + 0, 0, 0, /* 64 */ + 0, 0, 0, /* 65 */ + 0, 0, 0, /* 66 */ + 0, 0, 0, /* 67 */ + KEY_J, KEY_HOME, 0, /* 68 */ + KEY_K, KEY_MENU, 0, /* 69 */ + KEY_L, KEY_BOOKMARKS, 0, /* 70 */ + KEY_SEMICOLON, 0, 0, /* 71 */ + KEY_UP, 0, KEY_PAGEUP, /* 72 */ + 0, 0, 0, /* 73 */ + 0, 0, 0, /* 74 */ + 0, 0, 0, /* 75 */ + KEY_M, KEY_DELETE, KEY_KPPLUS, /* 76 */ + KEY_COMMA, 0, KEY_KPMINUS, /* 77 */ + KEY_DOT, KEY_SEND, 0, /* 78 */ + 0, 0, 0, /* 79 */ + KEY_DELETE, 0, 0, /* 80 */ + KEY_LEFT, 0, KEY_HOME, /* 81 */ + KEY_DOWN, 0, KEY_PAGEDOWN, /* 82 */ + KEY_RIGHT, 0, KEY_END, /* 83 */ + 0, 0, 0, /* 84 */ + 0, 0, 0, /* 85 */ + KEY_APOSTROPHE, 0, 0, /* 86 */ + KEY_ENTER, 0, 0, /* 87 */ + KEY_LEFTSHIFT, 0, 0, /* 88 */ + KEY_RIGHTSHIFT, 0, 0, /* 89 */ + 0, 0, 0, /* 90 */ + 0, 0, 0, /* 91 */ + 0, 0, 0, /* 92 */ + 0, 0, 0, /* 93 */ + 0, 0, 0, /* 94 */ + 0, 0, 0, /* 95 */ + 0, 0, 0, /* 96 */ + 0, 0, 0, /* 97 */ + 0, 0, 0, /* 98*/ + 0, 0, 0, /* 99 */ + 0, 0, 0, /* 100 */ + 0, 0, 0, /* 101 */ + 0, 0, 0, /* 102 */ + 0, 0, 0, /* 103 */ + 0, 0, 0, /* 104 */ + 0, 0, 0, /* 105 */ + 0, 0, 0, /* 106 */ + 0, 0, 0, /* 107 */ + 0, 0, 0, /* 108 */ + 0, 0, 0, /* 109 */ + 0, 0, 0, /* 110 */ + 0, 0, 0, /* 111 */ + 0, 0, 0, /* 112 */ + 0, 0, 0, /* 113 */ + 0, 0, 0, /* 114 */ + 0, 0, 0, /* 115 */ + 0, 0, 0, /* 116 */ + 0, 0, 0, /* 117 */ + 0, 0, 0, /* 118 */ + +}; + +struct input_dev *palmwk_dev; +int state = STATE_OUTSIDE; +int fn_pressed = 0; +int fn2_pressed = 0; + +void palmwk_process_scancode(unsigned char data) +{ + int code = data & MASK_CODE; + int keyup = data & MASK_KEYUP; + int key = 0; + + if(fn_pressed) key = keycode_table[code*3 + 1]; + if(fn2_pressed) key = keycode_table[code*3 + 2]; + if(!key) key = keycode_table[code*3]; + + + if(!key) { + printk("palmwk_process_scancode: invalid scancode %d\n", code); + return; + } + + input_report_key(palmwk_dev, key, !keyup); + if(key == KEY_RIGHTMETA) fn_pressed = !keyup; /* Blue Fn key */ + if(key == KEY_LEFTMETA) fn2_pressed = !keyup; /* Green Fn key */ +} + +void palmwk_process_byte(unsigned char data) +{ + /* at any stage, c1 means end of frame */ + if(data == EOF) { + state = STATE_OUTSIDE; + return; + } + + switch(state) { + case STATE_OUTSIDE: + if(data == XBOF) + state = STATE_BEGIN; + break; + + case STATE_BEGIN: + if(data == BOF) + state = STATE_SCANCODE; + else + state = STATE_OUTSIDE; + break; + + case STATE_SCANCODE: + palmwk_process_scancode(data); + state = STATE_CRC; + break; + + case STATE_CRC: + /* todo: process this */ + break; + } +} + + +int palmwk_receive(void *dev, const unsigned char *cp, size_t count) +{ + int i; + + for(i=0; i<count; i++) { + palmwk_process_byte(cp[i]); + } + + return 0; +} +EXPORT_SYMBOL(palmwk_receive); + +static int __init palmwk_init(void) +{ + int i, key; + + palmwk_dev = input_allocate_device(); + + for(i=0; i<(127*3); i++) { + if((key = keycode_table[i])) { + palmwk_dev->keybit[LONG(key)] |= BIT(key); + } + } + + palmwk_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); + palmwk_dev->name = "Palm wireless keyboard"; + palmwk_dev->id.bustype = BUS_HOST; + + return input_register_device(palmwk_dev); +} + +static void __exit palmwk_exit(void) +{ + input_unregister_device(palmwk_dev); +} + + +module_init(palmwk_init); +module_exit(palmwk_exit); + +MODULE_AUTHOR ("Jan Herman <2h...@se...>"); +MODULE_DESCRIPTION ("Palm 4-row Wireless Keyboard driver"); +MODULE_LICENSE ("GPL"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z7...@us...> - 2007-01-08 09:53:50
|
Revision: 735 http://svn.sourceforge.net/hackndev/?rev=735&view=rev Author: z72ka Date: 2007-01-08 01:53:47 -0800 (Mon, 08 Jan 2007) Log Message: ----------- Updated GPIO definitions, unified definitions, configuring LED as output Modified Paths: -------------- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-gpio.h Modified: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-gpio.h =================================================================== --- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-gpio.h 2007-01-08 09:44:42 UTC (rev 734) +++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-gpio.h 2007-01-08 09:53:47 UTC (rev 735) @@ -1,51 +1,73 @@ /* - * * include/asm-arm/arch-pxa/palmld-gpio.h + * * include/asm-arm/arch-pxa/palmz72-gpio.h * * * * Authors: Alex Osborne <bob...@gm...> - * * + * * Jan Herman <2h...@se...> * */ + #ifndef _PALMZ72_GPIO_H_ #define _PALMZ72_GPIO_H_ #include <asm/arch/pxa-regs.h> -#define GPIO_NR_ZIRE72_KP_MKIN0 100 /* folder, up */ -#define GPIO_NR_ZIRE72_KP_MKIN1 101 /* picture, star, right */ -#define GPIO_NR_ZIRE72_KP_MKIN2 102 /* voice memo, home, down */ -#define GPIO_NR_ZIRE72_KP_MKIN3 97 /* voice memo, home, down */ +/* Keypad */ -#define GPIO_NR_ZIRE72_KP_MKOUT0 103 -#define GPIO_NR_ZIRE72_KP_MKOUT1 104 -#define GPIO_NR_ZIRE72_KP_MKOUT2 105 +#define GPIO_NR_PALMZ72_KP_MKIN0 100 /* folder, up */ +#define GPIO_NR_PALMZ72_KP_MKIN1 101 /* picture, star, right */ +#define GPIO_NR_PALMZ72_KP_MKIN2 102 /* voice memo, home, down */ +#define GPIO_NR_PALMZ72_KP_MKIN3 97 /* voice memo, home, down */ +#define GPIO_NR_PALMZ72_KP_DKIN7 13 /* Voice button */ -#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) -#define GPIO_NR_ZIRE72_KP_MKIN1_MD (GPIO_NR_ZIRE72_KP_MKIN1 | GPIO_ALT_FN_1_IN) -#define GPIO_NR_ZIRE72_KP_MKIN2_MD (GPIO_NR_ZIRE72_KP_MKIN2 | GPIO_ALT_FN_1_IN) +#define GPIO_NR_PALMZ72_KP_MKOUT0 103 +#define GPIO_NR_PALMZ72_KP_MKOUT1 104 +#define GPIO_NR_PALMZ72_KP_MKOUT2 105 +#define GPIO_NR_PALMZ72_KP_MKOUT7 41 -#define GPIO_NR_ZIRE72_KP_MKOUT0_MD (GPIO_NR_ZIRE72_KP_MKOUT0 | GPIO_ALT_FN_2_OUT) -#define GPIO_NR_ZIRE72_KP_MKOUT1_MD (GPIO_NR_ZIRE72_KP_MKOUT1 | GPIO_ALT_FN_2_OUT) -#define GPIO_NR_ZIRE72_KP_MKOUT2_MD (GPIO_NR_ZIRE72_KP_MKOUT2 | GPIO_ALT_FN_2_OUT) +#define GPIO_NR_PALMZ72_KP_MKIN0_MD (GPIO_NR_PALMZ72_KP_MKIN0 | GPIO_ALT_FN_1_IN) +#define GPIO_NR_PALMZ72_KP_MKIN1_MD (GPIO_NR_PALMZ72_KP_MKIN1 | GPIO_ALT_FN_1_IN) +#define GPIO_NR_PALMZ72_KP_MKIN2_MD (GPIO_NR_PALMZ72_KP_MKIN2 | GPIO_ALT_FN_1_IN) +#define GPIO_NR_PALMZ72_KP_MKIN3_MD (GPIO_NR_PALMZ72_KP_MKIN3 | GPIO_ALT_FN_3_IN) +#define GPIO_NR_PALMZ72_KP_DKIN7_MD (GPIO_NR_PALMZ72_KP_DKIN7 | GPIO_ALT_FN_3_IN) //testing +#define GPIO_NR_PALMZ72_KP_MKOUT0_MD (GPIO_NR_PALMZ72_KP_MKOUT0 | GPIO_ALT_FN_2_OUT) +#define GPIO_NR_PALMZ72_KP_MKOUT1_MD (GPIO_NR_PALMZ72_KP_MKOUT1 | GPIO_ALT_FN_2_OUT) +#define GPIO_NR_PALMZ72_KP_MKOUT2_MD (GPIO_NR_PALMZ72_KP_MKOUT2 | GPIO_ALT_FN_2_OUT) +#define GPIO_NR_PALMZ72_KP_MKOUT7_MD (GPIO_NR_PALMZ72_KP_MKOUT7 | GPIO_ALT_FN_2_OUT) //testing + + +/* LED */ + +#define GPIO_NR_PALMZ72_LED 88 +#define GPIO_NR_PALMZ72_LED_MD (GPIO_NR_PALMZ72_LED | GPIO_ALT_FN_1_OUT) + + +/* Serial */ + #define GPIO_NR_PALMZ72_STD_RXD 42 /* IRDA ??*/ #define GPIO_NR_PALMZ72_STD_TXD 43 #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) + +/* Wolfson WM9712 */ + #define GPIO_NR_PALMZ72_WM9712_IRQ 27 +/* USB */ + #define GPIO_NR_PALMZ72_USB_DETECT 15 -#define GPIO_NR_PALMZ72_USB_POWER 95 +#define GPIO_NR_PALMZ72_USB_POWER 95 #define GPIO_NR_PALMZ72_USB_PULLUP 76 // just to try.. seems to work -#define IRQ_GPIO_PALMZ72_USB_DETECT IRQ_GPIO(GPIO_NR_PALMT5_USB_DETECT) +#define IRQ_GPIO_PALMZ72_USB_DETECT IRQ_GPIO(GPIO_NR_PALMZ72_USB_DETECT) +/* Testing */ +#define GPIO_NR_PALMZ72_POWER_DETECT 12 // older 4 /* Utility macros */ + #define GET_PALMZ72_GPIO(gpio) \ (GPLR(GPIO_NR_PALMZ72_ ## gpio) & GPIO_bit(GPIO_NR_PALMZ72_ ## gpio)) @@ -78,5 +100,6 @@ GPCR(gpio) = GPIO_bit(gpio); \ } while (0) -#endif /* _ZIRE72_GPIO_H_ */ +#endif +/* _PALMZ72_GPIO_H_ */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z7...@us...> - 2007-01-08 09:44:55
|
Revision: 734 http://svn.sourceforge.net/hackndev/?rev=734&view=rev Author: z72ka Date: 2007-01-08 01:44:42 -0800 (Mon, 08 Jan 2007) Log Message: ----------- Added initial definitions for Zire72 Added Paths: ----------- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-init.h Added: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-init.h =================================================================== --- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-init.h (rev 0) +++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-init.h 2007-01-08 09:44:42 UTC (rev 734) @@ -0,0 +1,38 @@ +/* + * palmz72-init.h + * + * Init values for PalmOne Zire 72 Handheld Computer + * + * Author: Jan Herman <2h...@se...> + * + * + * 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. + * + * + * + */ + +#ifndef _INCLUDE_PALMZ72_INIT_H_ + +#define _INCLUDE_PALMZ72_INIT_H_ + +// TOUCHSCREEN + +#define AC97_LINK_FRAME 21 + + +// BATTERY + +#define PALMZ72_BAT_MAX_VOLTAGE 4100 // 4.09V current voltage at max charge as from PalmOS +#define PALMZ72_BAT_MIN_VOLTAGE 3670 // 3.67V critical voltage as from Zlauncher +#define PALMZ72_BAT_MAX_CURRENT 0 // unknokn +#define PALMZ72_BAT_MIN_CURRENT 0 // unknown +#define PALMZ72_BAT_MAX_CHARGE 1 // unknown +#define PALMZ72_BAT_MIN_CHARGE 1 // unknown +#define PALMZ72_BAT_MEASURE_DELAY (HZ * 1) +#define PALMZ72_MAX_LIFE_MINS 240 // my Zire72 on-life in minutes + + +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <z7...@us...> - 2007-01-08 09:43:09
|
Revision: 733 http://svn.sourceforge.net/hackndev/?rev=733&view=rev Author: z72ka Date: 2007-01-08 01:42:13 -0800 (Mon, 08 Jan 2007) Log Message: ----------- Added include for Zire72 AC97 codec Added Paths: ----------- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-ac97.h Added: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-ac97.h =================================================================== --- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-ac97.h (rev 0) +++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmz72-ac97.h 2007-01-08 09:42:13 UTC (rev 733) @@ -0,0 +1,108 @@ +/* + * Definitions for the Zire 72 WM9712 AC97 codec + * Based upon wm97xx.h by Liam Girdwood, Wolfson Microelectronics + */ + +#ifndef _PALMZ72_AC97_H_ +#define _PALMZ72_AC97_H_ + + +#define AC97_ADD_FUNC 0x58 /* Additional functions */ + +/* + * WM97xx AC97 Touchscreen registers + */ +#define AC97_WM97XX_DIGITISER1 0x76 +#define AC97_WM97XX_DIGITISER2 0x78 +#define AC97_WM97XX_DIGITISER_RD 0x7a +#define AC97_WM9713_DIG1 0x74 +#define AC97_WM9713_DIG2 AC97_WM97XX_DIGITISER1 +#define AC97_WM9713_DIG3 AC97_WM97XX_DIGITISER2 + +/* + * WM97xx GPGIO states + */ +#define WM97XX_GPIO_OUT 0 +#define WM97XX_GPIO_IN 1 +#define WM97XX_GPIO_POL_HIGH 1 +#define WM97XX_GPIO_POL_LOW 0 +#define WM97XX_GPIO_STICKY 1 +#define WM97XX_GPIO_NOTSTICKY 0 +#define WM97XX_GPIO_WAKE 1 +#define WM97XX_GPIO_NOWAKE 0 + +/* + * WM97xx register bits + */ +#define WM97XX_POLL 0x8000 /* initiate a polling measurement */ +#define WM97XX_ADCSEL_X 0x1000 /* x coord measurement */ +#define WM97XX_ADCSEL_Y 0x2000 /* y coord measurement */ +#define WM97XX_ADCSEL_PRES 0x3000 /* pressure measurement */ +#define WM97XX_ADCSEL_COMP1 0x4000 /* aux1 measurement */ +#define WM97XX_ADCSEL_COMP2 0x5000 /* aux2 measurement */ +#define WM97XX_ADCSEL_BMON 0x6000 /* aux3 measurement */ +#define WM97XX_ADCSEL_WIPER 0x7000 /* aux4 measurement */ +#define WM97XX_ADCSEL_MASK 0x7000 +#define WM97XX_COO 0x0800 /* enable coordinate mode */ +#define WM97XX_CTC 0x0400 /* enable continuous mode */ +#define WM97XX_CM_RATE_93 0x0000 /* 93.75Hz continuous rate */ +#define WM97XX_CM_RATE_187 0x0100 /* 187.5Hz continuous rate */ +#define WM97XX_CM_RATE_375 0x0200 /* 375Hz continuous rate */ +#define WM97XX_CM_RATE_750 0x0300 /* 750Hz continuous rate */ +#define WM97XX_CM_RATE_8K 0x00f0 /* 8kHz continuous rate */ +#define WM97XX_CM_RATE_12K 0x01f0 /* 12kHz continuous rate */ +#define WM97XX_CM_RATE_24K 0x02f0 /* 24kHz continuous rate */ +#define WM97XX_CM_RATE_48K 0x03f0 /* 48kHz continuous rate */ +#define WM97XX_CM_RATE_MASK 0x03f0 +#define WM97XX_RATE(i) (((i & 3) << 8) | ((i & 4) ? 0xf0 : 0)) +#define WM97XX_DELAY(i) ((i << 4) & 0x00f0) /* sample delay times */ +#define WM97XX_DELAY_MASK 0x00f0 +#define WM97XX_SLEN 0x0008 /* slot read back enable */ +#define WM97XX_SLT(i) ((i - 5) & 0x7) /* touchpanel slot selection (5-11) */ +#define WM97XX_SLT_MASK 0x0007 +#define WM97XX_PRP_DETW 0x4000 /* pen detect on, digitiser off, wake up */ +#define WM97XX_PRP_DET 0x8000 /* pen detect on, digitiser off, no wake up */ +#define WM97XX_PRP_DET_DIG 0xc000 /* pen detect on, digitiser on */ +#define WM97XX_RPR 0x2000 /* wake up on pen down */ +#define WM97XX_PEN_DOWN 0x8000 /* pen is down */ +#define WM97XX_ADCSRC_MASK 0x7000 /* ADC source mask */ + +#define WM97XX_AUX_ID1 0x8001 +#define WM97XX_AUX_ID2 0x8002 +#define WM97XX_AUX_ID3 0x8003 +#define WM97XX_AUX_ID4 0x8004 + +/* Codec GPIO's */ +#define WM97XX_MAX_GPIO 16 +#define WM97XX_GPIO_1 (1 << 1) +#define WM97XX_GPIO_2 (1 << 2) +#define WM97XX_GPIO_3 (1 << 3) +#define WM97XX_GPIO_4 (1 << 4) +#define WM97XX_GPIO_5 (1 << 5) +#define WM97XX_GPIO_6 (1 << 6) +#define WM97XX_GPIO_7 (1 << 7) +#define WM97XX_GPIO_8 (1 << 8) +#define WM97XX_GPIO_9 (1 << 9) +#define WM97XX_GPIO_10 (1 << 10) +#define WM97XX_GPIO_11 (1 << 11) +#define WM97XX_GPIO_12 (1 << 12) +#define WM97XX_GPIO_13 (1 << 13) +#define WM97XX_GPIO_14 (1 << 14) +#define WM97XX_GPIO_15 (1 << 15) + +/* WM9712 Bits */ +#define WM9712_45W 0x1000 /* set for 5-wire touchscreen */ +#define WM9712_PDEN 0x0800 /* measure only when pen down */ +#define WM9712_WAIT 0x0200 /* wait until adc is read before next sample */ +#define WM9712_PIL 0x0100 /* current used for pressure measurement. set 400uA else 200uA */ +#define WM9712_MASK_HI 0x0040 /* hi on mask pin (47) stops conversions */ +#define WM9712_MASK_EDGE 0x0080 /* rising/falling edge on pin delays sample */ +#define WM9712_MASK_SYNC 0x00c0 /* rising/falling edge on mask initiates sample */ +#define WM9712_RPU(i) (i&0x3f) /* internal pull up on pen detect (64k / rpu) */ +#define WM9712_PD(i) (0x1 << i) /* power management */ +#define WM9712_ADCSEL_COMP1 0x4000 /* COMP1/AUX1 measurement (pin29) */ +#define WM9712_ADCSEL_COMP2 0x5000 /* COMP2/AUX2 measurement (pin30) */ +#define WM9712_ADCSEL_BMON 0x6000 /* BMON/AUX3 measurement (pin31) */ +#define WM9712_ADCSEL_WIPER 0x7000 /* WIPER/AUX4 measurement (pin12) */ + +#endif /* _PALMZ72_AC97_H_ */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |