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: <ph...@us...> - 2007-02-14 09:14:28
|
Revision: 809
http://svn.sourceforge.net/hackndev/?rev=809&view=rev
Author: phiren
Date: 2007-02-14 01:14:26 -0800 (Wed, 14 Feb 2007)
Log Message:
-----------
Fixing borken import
Removed Paths:
-------------
.tsk.c.swp
Deleted: .tsk.c.swp
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ph...@us...> - 2007-02-14 09:08:14
|
Revision: 808
http://svn.sourceforge.net/hackndev/?rev=808&view=rev
Author: phiren
Date: 2007-02-14 01:08:12 -0800 (Wed, 14 Feb 2007)
Log Message:
-----------
Touchscreen Keyboard: Initial import
Added Paths:
-----------
tsk/
tsk/.messagease.h.swp
tsk/.tsk.c.swp
tsk/branches/
tsk/tags/
tsk/trunk/
tsk/trunk/messagease.h
tsk/trunk/tsk.c
Added: tsk/.messagease.h.swp
===================================================================
(Binary files differ)
Property changes on: tsk/.messagease.h.swp
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: tsk/.tsk.c.swp
===================================================================
(Binary files differ)
Property changes on: tsk/.tsk.c.swp
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: tsk/trunk/messagease.h
===================================================================
--- tsk/trunk/messagease.h (rev 0)
+++ tsk/trunk/messagease.h 2007-02-14 09:08:12 UTC (rev 808)
@@ -0,0 +1,88 @@
+/*
+ * messagease.h -- Layout of the left-hand MessagEase stamp
+ *
+ * Author: Scott Mansell <ph...@gm...>
+ *
+ * This file is released under the GPL version 2
+ *
+ * The MessagEase layout is Copyright © 2005 EXideas
+ */
+
+#ifndef MESSAGease_LAYOUT
+#define MESSAGease_LAYOUT
+
+#define BOX_Y 4
+#define BOX_X 9
+
+static int lookup[ 35 * 9 ];
+
+static struct {
+ int box;
+ int direction;
+ int value; } data[] = {
+// LetterPad
+{ 32, 0, 30 }, /* A */
+{ 32, 5, 47 }, // v
+{ 33, 0, 49 }, /* N */
+{ 33, 6, 38 }, // l
+{ 34, 0, 23 }, /* I */
+{ 34, 7, 45 }, // x
+{ 23, 0, 35 }, /* H */
+{ 23, 4, 37 }, // k
+{ 24, 0, 24 }, /* O */
+{ 24, 1, 16 }, // q
+{ 24, 2, 22 }, // u
+{ 24, 3, 25 }, // p
+{ 24, 4, 48 }, // b
+{ 24, 5, 36 }, // j
+{ 24, 6, 32 }, // d
+{ 24, 7, 34 }, // g
+{ 24, 8, 46 }, // c
+{ 25, 0, 19 }, /* R */
+{ 25, 2, 54 }, // shift
+{ 25, 8, 50 }, // m
+{ 14, 0, 20 }, /* T */
+{ 14, 3, 21 }, // y
+{ 15, 0, 18 }, /* E */
+{ 15, 2, 17 }, // w
+{ 15, 4, 44 }, // z
+{ 15, 7, 51 }, // ,
+{ 15, 6, 52 }, // .
+{ 16, 0, 31 }, /* S */
+{ 16, 1, 33 }, // f
+// Number pad
+{ 28, 0, 2 }, // 1
+{ 29, 0, 3 }, // 2
+{ 30, 0, 4 }, // 3
+{ 19, 0, 5 }, // 4
+{ 20, 0, 6 }, // 5
+{ 21, 0, 7 }, // 6
+{ 10, 0, 8 }, // 7
+{ 11, 0, 9 }, // 8
+{ 15, 7, 51}, // ,
+{ 15, 6, 52}, // .
+{ 12, 0, 10}, // 9
+{ 2, 0, 11 }, // 0
+// Whitespace
+{ 3, 0, 57 }, // Space
+{ 4, 0, 57 }, // Space
+{ 5, 0, 57 }, // Space
+{ 6, 0, 57 }, // Space
+{13, 0, 57 }, // Space
+{13, 5, 28 }, // Return
+{13, 6, 28 }, // Return
+{13, 7, 28 }, // Return
+{ 3, 4, 15 }, // Tab
+{ 4, 4, 15 }, // Tab
+{ 5, 4, 15 }, // Tab
+{ 6, 4, 15 }, // Tab
+{ 7, 0, 14 }, // Backspace
+{ 6, 8, 14 }, // Backspace
+{ 5, 8, 14 }, // Backspace
+{ 4, 8, 14 }, // Backspace
+{ 3, 8, 14 }, // Backspace
+{31, 0, 58 }, // Caps lock
+{27, 0, 0}}; // ESC
+
+
+#endif
Added: tsk/trunk/tsk.c
===================================================================
--- tsk/trunk/tsk.c (rev 0)
+++ tsk/trunk/tsk.c 2007-02-14 09:08:12 UTC (rev 808)
@@ -0,0 +1,163 @@
+/*
+ * tsk.c
+ *
+ * Touchscreen Keyboard: creates a virtual keyboard on your touchscreen
+ *
+ * Author: Scott Mansell <ph...@gm...>
+ *
+ * This file has been released under the GPL version 2
+ */
+
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <linux/input.h>
+#include <linux/uinput.h>
+
+#define absX 0
+#define absY 1
+#define absZ 24
+#define DOWN 192
+
+#include "messagease.h"
+
+//You will need to calibrate, the digitizer to the sticker
+//Sorry, later I will include a feature to do this automaticly
+#define TOP 1180 //Top of sticker
+#define BOTTOM 200 // Bottom of sticker
+#define LEFT 240 // Left side of sticker
+#define RIGHT 3760 // Right side
+
+//Don't touch these, they automaticly adjust to the above settings
+#define HEIGHT (int) ((TOP-BOTTOM)/BOX_Y)
+#define WIDTH (int) ((RIGHT-LEFT)/BOX_X)
+
+int box(int startx, int starty, int endx, int endy)
+{
+ int start = ((startx - LEFT) / WIDTH + (starty - BOTTOM) / HEIGHT * BOX_X);
+ if (start > BOX_X*BOX_Y)
+ return -1;
+ int end = ((endx - LEFT) / WIDTH + (endy - BOTTOM) / HEIGHT * BOX_X);
+ int ret = start*9;
+ switch( start-end )
+ {
+ case 1: //Mid left
+ ret += 8;
+ break;
+ case 0: //Mid
+ break;
+ case -1: // Mid right
+ ret += 4;
+ break;
+ case (BOX_X - 1): //Bot right
+ ret += 5;
+ break;
+ case (BOX_X): //Bot mid
+ ret += 6;
+ break;
+ case (BOX_X + 1): //Bot left
+ ret += 7;
+ break;
+ case (BOX_X * -1 + 1): //Top left
+ ret += 1;
+ break;
+ case (BOX_X * -1): // Top Mid
+ ret += 2;
+ break;
+ case (BOX_X * -1 - 1): // Top Right
+ ret += 3;
+ break;
+ default: // To far...
+ ret = -1;
+ }
+ return ret;
+}
+
+int main (int argc, char* argv[])
+{
+ struct input_event ev;
+ struct input_event event;
+ int x;
+ int y;
+ int z;
+ int i;
+ int startx;
+ int starty;
+
+ //Seting up uinput
+ struct uinput_user_dev uidev;
+ int ctr;
+ int uinput = open("/dev/input/uinput",O_WRONLY | O_NDELAY);
+ if (uinput == -1)
+ {
+ printf("Error: Could not open uinput driver.\n");
+ return 1;
+ }
+ memset(&uidev, 0, sizeof(uidev));
+ strncpy(uidev.name, "SerKBD", UINPUT_MAX_NAME_SIZE);
+ uidev.id.bustype = BUS_RS232;
+ uidev.id.vendor = 0x00;
+ uidev.id.product = 0x00;
+ uidev.id.version = 0x00;
+ ioctl (uinput, UI_SET_EVBIT, EV_KEY);
+ ioctl (uinput, UI_SET_EVBIT, EV_REP);
+ for (i = 0; i <= (BOX_X * BOX_Y * 9 + 0); i++) {
+ ioctl(uinput, UI_SET_KEYBIT, i);
+ }
+ write (uinput, &uidev, sizeof(uidev));
+ if (ioctl(uinput, UI_DEV_CREATE)) {
+ perror ("failed to create uinput device");
+ return 1;
+ }
+ //End of setting up uinput
+
+ //Setup Lookup table
+ memset(&lookup, 0, sizeof(lookup)); // Zero the lookup table
+ for (i = 0; i<(sizeof(data) / (sizeof data[0])); i++)
+ lookup[(data[i].box * 9 + data[i].direction)] = data[i].value;
+ //open the touch screen for input
+ int touch = open("/dev/input/event1", O_RDONLY); //Right now hardcoded to event1
+ if(touch == -1){
+ printf("Error, Could not open touchscreen");
+ return 1;}
+ do { // Main program loop
+ do { // We loop through the events reading x, y and pressure values untill we get a blank event.
+ read(touch, &ev, sizeof(struct input_event)); //Read from event interface
+ if (ev.type == 3)
+ switch(ev.code)
+ {
+ case absX:
+ x = ev.value;
+ break;
+ case absY:
+ y = ev.value;
+ break;
+ case absZ: // Pen pressure
+ z = ev.value;
+ }
+ } while (ev.type != 0);
+ if(z == DOWN) // If the pen has just been put down, then we record the start x and y cordnates.
+ {
+ startx = x;
+ starty = y;
+ z = 1; // Clear z so we don't record startx and starty untill the pen goes down again
+ }
+ if(z == 0) // Pen up
+ {
+ z = 1; //clear z again
+ int code = box(startx, starty, x, y);
+ if (code != -1 && lookup[code] != 0)
+ {
+ event.type = EV_KEY; //indicates the keyboard event
+ event.code = lookup[code]; //Key value
+ event.value = 1; //amount of key
+ write (uinput, &event, sizeof event);
+ event.value = 0; //amount of key
+ write (uinput, &event, sizeof event);
+ }
+ }
+ } while(1);
+ return 1; //Right now we will never get here.
+;}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ph...@us...> - 2007-02-14 09:00:43
|
Revision: 807
http://svn.sourceforge.net/hackndev/?rev=807&view=rev
Author: phiren
Date: 2007-02-14 01:00:41 -0800 (Wed, 14 Feb 2007)
Log Message:
-----------
Initial import
Added Paths:
-----------
.messagease.h.swp
.tsk.c.swp
branches/
tags/
trunk/
trunk/messagease.h
trunk/tsk.c
Added: .messagease.h.swp
===================================================================
(Binary files differ)
Property changes on: .messagease.h.swp
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: .tsk.c.swp
===================================================================
(Binary files differ)
Property changes on: .tsk.c.swp
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/messagease.h
===================================================================
--- trunk/messagease.h (rev 0)
+++ trunk/messagease.h 2007-02-14 09:00:41 UTC (rev 807)
@@ -0,0 +1,85 @@
+/*
+ * messagease.h -- Layout of the left messagease stamp (numbers on the right)
+ *
+ * Author: Scott Mansell <ph...@gm...>
+ * This file is a mess. There has to be a better way
+ */
+
+#ifndef MESSAGease_LAYOUT
+#define MESSAGease_LAYOUT
+
+#define BOX_Y 4
+#define BOX_X 9
+
+static int lookup[ 35 * 9 ];
+
+static struct {
+ int box;
+ int direction;
+ int value; } data[] = {
+// LetterPad
+{ 32, 0, 30 }, /* A */
+{ 32, 5, 47 }, // v
+{ 33, 0, 49 }, /* N */
+{ 33, 6, 38 }, // l
+{ 34, 0, 23 }, /* I */
+{ 34, 7, 45 }, // x
+{ 23, 0, 35 }, /* H */
+{ 23, 4, 37 }, // k
+{ 24, 0, 24 }, /* O */
+{ 24, 1, 16 }, // q
+{ 24, 2, 22 }, // u
+{ 24, 3, 25 }, // p
+{ 24, 4, 48 }, // b
+{ 24, 5, 36 }, // j
+{ 24, 6, 32 }, // d
+{ 24, 7, 34 }, // g
+{ 24, 8, 46 }, // c
+{ 25, 0, 19 }, /* R */
+{ 25, 2, 54 }, // shift
+{ 25, 8, 50 }, // m
+{ 14, 0, 20 }, /* T */
+{ 14, 3, 21 }, // y
+{ 15, 0, 18 }, /* E */
+{ 15, 2, 17 }, // w
+{ 15, 4, 44 }, // z
+{ 15, 7, 51 }, // ,
+{ 15, 6, 52 }, // .
+{ 16, 0, 31 }, /* S */
+{ 16, 1, 33 }, // f
+// Number pad
+{ 28, 0, 2 }, // 1
+{ 29, 0, 3 }, // 2
+{ 30, 0, 4 }, // 3
+{ 19, 0, 5 }, // 4
+{ 20, 0, 6 }, // 5
+{ 21, 0, 7 }, // 6
+{ 10, 0, 8 }, // 7
+{ 11, 0, 9 }, // 8
+{ 15, 7, 51}, // ,
+{ 15, 6, 52}, // .
+{ 12, 0, 10}, // 9
+{ 2, 0, 11 }, // 0
+// Whitespace
+{ 3, 0, 57 }, // Space
+{ 4, 0, 57 }, // Space
+{ 5, 0, 57 }, // Space
+{ 6, 0, 57 }, // Space
+{13, 0, 57 }, // Space
+{13, 5, 28 }, // Return
+{13, 6, 28 }, // Return
+{13, 7, 28 }, // Return
+{ 3, 4, 15 }, // Tab
+{ 4, 4, 15 }, // Tab
+{ 5, 4, 15 }, // Tab
+{ 6, 4, 15 }, // Tab
+{ 7, 0, 14 }, // Backspace
+{ 6, 8, 14 }, // Backspace
+{ 5, 8, 14 }, // Backspace
+{ 4, 8, 14 }, // Backspace
+{ 3, 8, 14 }, // Backspace
+{31, 0, 58 }, // Caps lock
+{27, 0, 0}}; // ESC
+
+
+#endif
Added: trunk/tsk.c
===================================================================
--- trunk/tsk.c (rev 0)
+++ trunk/tsk.c 2007-02-14 09:00:41 UTC (rev 807)
@@ -0,0 +1,163 @@
+/*
+ * tsk.c
+ *
+ * Touchscreen Keyboard: creates a virtual keyboard on your touchscreen
+ *
+ * Author: Scott Mansell <ph...@gm...>
+ *
+ * This file has been released under the GPL version 2
+ */
+
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <linux/input.h>
+#include <linux/uinput.h>
+
+#define absX 0
+#define absY 1
+#define absZ 24
+#define DOWN 192
+
+#include "messagease.h"
+
+//You will need to calibrate, the digitizer to the sticker
+//Sorry, later I will include a feature to do this automaticly
+#define TOP 1180 //Top of sticker
+#define BOTTOM 200 // Bottom of sticker
+#define LEFT 240 // Left side of sticker
+#define RIGHT 3760 // Right side
+
+//Don't touch these, they automaticly adjust to the above settings
+#define HEIGHT (int) ((TOP-BOTTOM)/BOX_Y)
+#define WIDTH (int) ((RIGHT-LEFT)/BOX_X)
+
+int box(int startx, int starty, int endx, int endy)
+{
+ int start = ((startx - LEFT) / WIDTH + (starty - BOTTOM) / HEIGHT * BOX_X);
+ if (start > BOX_X*BOX_Y)
+ return -1;
+ int end = ((endx - LEFT) / WIDTH + (endy - BOTTOM) / HEIGHT * BOX_X);
+ int ret = start*9;
+ switch( start-end )
+ {
+ case 1: //Mid left
+ ret += 8;
+ break;
+ case 0: //Mid
+ break;
+ case -1: // Mid right
+ ret += 4;
+ break;
+ case (BOX_X - 1): //Bot right
+ ret += 5;
+ break;
+ case (BOX_X): //Bot mid
+ ret += 6;
+ break;
+ case (BOX_X + 1): //Bot left
+ ret += 7;
+ break;
+ case (BOX_X * -1 + 1): //Top left
+ ret += 1;
+ break;
+ case (BOX_X * -1): // Top Mid
+ ret += 2;
+ break;
+ case (BOX_X * -1 - 1): // Top Right
+ ret += 3;
+ break;
+ default: // To far...
+ ret = -1;
+ }
+ return ret;
+}
+
+int main (int argc, char* argv[])
+{
+ struct input_event ev;
+ struct input_event event;
+ int x;
+ int y;
+ int z;
+ int i;
+ int startx;
+ int starty;
+
+ //Seting up uinput
+ struct uinput_user_dev uidev;
+ int ctr;
+ int uinput = open("/dev/input/uinput",O_WRONLY | O_NDELAY);
+ if (uinput == -1)
+ {
+ printf("Error: Could not open uinput driver.\n");
+ return 1;
+ }
+ memset(&uidev, 0, sizeof(uidev));
+ strncpy(uidev.name, "SerKBD", UINPUT_MAX_NAME_SIZE);
+ uidev.id.bustype = BUS_RS232;
+ uidev.id.vendor = 0x00;
+ uidev.id.product = 0x00;
+ uidev.id.version = 0x00;
+ ioctl (uinput, UI_SET_EVBIT, EV_KEY);
+ ioctl (uinput, UI_SET_EVBIT, EV_REP);
+ for (i = 0; i <= (BOX_X * BOX_Y * 9 + 0); i++) {
+ ioctl(uinput, UI_SET_KEYBIT, i);
+ }
+ write (uinput, &uidev, sizeof(uidev));
+ if (ioctl(uinput, UI_DEV_CREATE)) {
+ perror ("failed to create uinput device");
+ return 1;
+ }
+ //End of setting up uinput
+
+ //Setup Lookup table
+ memset(&lookup, 0, sizeof(lookup)); // Zero the lookup table
+ for (i = 0; i<(sizeof(data) / (sizeof data[0])); i++)
+ lookup[(data[i].box * 9 + data[i].direction)] = data[i].value;
+ //open the touch screen for input
+ int touch = open("/dev/input/event1", O_RDONLY); //Right now hardcoded to event1
+ if(touch == -1){
+ printf("Error, Could not open touchscreen");
+ return 1;}
+ do { // Main program loop
+ do { // We loop through the events reading x, y and pressure values untill we get a blank event.
+ read(touch, &ev, sizeof(struct input_event)); //Read from event interface
+ if (ev.type == 3)
+ switch(ev.code)
+ {
+ case absX:
+ x = ev.value;
+ break;
+ case absY:
+ y = ev.value;
+ break;
+ case absZ: // Pen pressure
+ z = ev.value;
+ }
+ } while (ev.type != 0);
+ if(z == DOWN) // If the pen has just been put down, then we record the start x and y cordnates.
+ {
+ startx = x;
+ starty = y;
+ z = 1; // Clear z so we don't record startx and starty untill the pen goes down again
+ }
+ if(z == 0) // Pen up
+ {
+ z = 1; //clear z again
+ int code = box(startx, starty, x, y);
+ if (code != -1 && lookup[code] != 0)
+ {
+ event.type = EV_KEY; //indicates the keyboard event
+ event.code = lookup[code]; //Key value
+ event.value = 1; //amount of key
+ write (uinput, &event, sizeof event);
+ event.value = 0; //amount of key
+ write (uinput, &event, sizeof event);
+ }
+ }
+ } while(1);
+ return 1; //Right now we will never get here.
+;}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ph...@us...> - 2007-02-14 07:27:25
|
Revision: 806
http://svn.sourceforge.net/hackndev/?rev=806&view=rev
Author: phiren
Date: 2007-02-13 23:27:22 -0800 (Tue, 13 Feb 2007)
Log Message:
-----------
Buttons, keyboard and gpioed for zire31
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/Kconfig
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/Makefile
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31-gpio.h
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31.c
Added Paths:
-----------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/gpioed-ng.c
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/gpioed.c
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31_buttons.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/Kconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/Kconfig 2007-02-13 16:54:05 UTC (rev 805)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/Kconfig 2007-02-14 07:27:22 UTC (rev 806)
@@ -4,3 +4,27 @@
help
Say Y here if you are going to run this kernel on a Palm Zire 31.
+config PALMZ31_BUTTONS
+ tristate "Palm Zire 31 buttons driver"
+ depends on MACH_ZIRE31
+ default y
+ help
+ This driver translates button presses on a Palm
+ Tungsten E2 to Linux input subsystem events.
+
+
+config GPIOED
+ tristate "GPIOED"
+ depends on MACH_ZIRE31
+ default n
+ help
+ Gpioed: only for debuging and testing!
+
+
+config GPIOEDNG
+ tristate "GPIOEDNG"
+ depends on MACH_ZIRE31
+ default n
+ help
+ Gpioed-ng: only for debuging and testing!
+
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/Makefile
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/Makefile 2007-02-13 16:54:05 UTC (rev 805)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/Makefile 2007-02-14 07:27:22 UTC (rev 806)
@@ -2,4 +2,7 @@
# Makefile for Palm Zire 31 support
#
-obj-$(CONFIG_MACH_ZIRE31) += palmz31.o
+obj-$(CONFIG_MACH_ZIRE31) += palmz31.o
+obj-$(CONFIG_PALMZ31_BUTTONS) += palmz31_buttons.o
+obj-$(CONFIG_GPIOED) += gpioed.o
+obj-$(CONFIG_GPIOEDNG) += gpioed-ng.o
Added: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/gpioed-ng.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/gpioed-ng.c (rev 0)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/gpioed-ng.c 2007-02-14 07:27:22 UTC (rev 806)
@@ -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/palmz31/gpioed.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/gpioed.c (rev 0)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/gpioed.c 2007-02-14 07:27:22 UTC (rev 806)
@@ -0,0 +1,278 @@
+/*** 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) (GPLR(gpio) & GPIO_bit(gpio))
+#define GET_GPIOD(gpio) (GPDR(gpio) & GPIO_bit(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 gpio_info(char *buffer);
+
+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 = gpio_info(buffer);
+ //ret = sprintf(buffer, "HelloWorld!\n");
+ }
+ return ret;
+}
+
+int gpio_info(char *buffer)
+// output all knowen infomation about the gpios to /proc/gpioed
+{
+ int i;
+ int ret;
+ sprintf(buffer, "Infomation about gpios:\n| Gpio | Direction | State |\n");
+ for(i=0; i<85; i++)
+ {
+ sprintf(buffer, "%s| %2i ", buffer, i);
+ if(GET_GPIOD(i) == 0) //In
+ sprintf(buffer, "%s| In ",buffer);
+ else //Out
+ sprintf(buffer, "%s| Out ",buffer);
+ if(GET_GPIO(i) == 0) //Low
+ sprintf(buffer, "%s| Low |\n", buffer);
+ else //high
+ sprintf(buffer, "%s| High |\n", buffer);
+ }
+ ret = sprintf(buffer, "%s---------------------------\n Alternate Functions:\n 0L: %X 0U: %X 1L: %X 1U: %X 2L: %X 2U: %X\n", buffer, GAFR0_L, GAFR0_U, GAFR1_L, GAFR1_U, GAFR2_L, GAFR2_U);
+
+ 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;
+ }
+}
+
+void set_afn(int gpio, int fn)
+{
+ int gafr;
+ gafr = GAFR(gpio) & ~(0x3 << (((gpio) & 0xf)*2));
+ GAFR(gpio) = gafr | (fn << (((gpio) & 0xf)*2));
+}
+
+
+/*** 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;
+ case 'o':
+ GPDR(id) &= ~(GPIO_bit(id));
+ break;
+ case 'i':
+ 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;
+ }
+}
+
+/*** init&exit ***/
+static int __init gpioed_init(void)
+{
+ my_workqueue = create_workqueue(MY_WORK_QUEUE_NAME);
+
+ proc_intf = create_proc_entry(procfs_name, 0644, NULL);
+ if (proc_intf == NULL) {
+ remove_proc_entry(procfs_name, &proc_root);
+ printk(KERN_ALERT "Error: Could not initialize /proc/%s\n",
+ procfs_name);
+ return -ENOMEM;
+ }
+
+ proc_intf->read_proc = procfile_read;
+ proc_intf->write_proc = procfile_write;
+ proc_intf->owner = THIS_MODULE;
+ proc_intf->mode = S_IFREG | S_IRUGO;
+ proc_intf->uid = 0;
+ proc_intf->gid = 0;
+ proc_intf->size = 37;
+
+ printk(KERN_INFO "/proc/%s created\n", procfs_name);
+
+ return 0;
+}
+
+static void __exit gpioed_exit(void)
+{
+ destroy_workqueue(my_workqueue);
+ remove_proc_entry(procfs_name, &proc_root);
+ printk(KERN_INFO "/proc/%s removed\n", procfs_name);
+}
+
+
+/*** Some more stuff ***/
+module_init(gpioed_init);
+module_exit(gpioed_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Vladimir \"Farcaller\" Pouzanov <far...@gm...>");
+MODULE_DESCRIPTION("GPIO editor for PXA26x");
+
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31-gpio.h
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31-gpio.h 2007-02-13 16:54:05 UTC (rev 805)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31-gpio.h 2007-02-14 07:27:22 UTC (rev 806)
@@ -10,7 +10,9 @@
#include <asm/arch/pxa-regs.h>
-// This should let us get usb working
-#define GPIO_NR_PALMLD_USB_DETECT 4
+#define GPIO_NR_PALMTC_EARPHONE_DETECT 12
+#define GPIO_NR_PALMLD_POWER_DETECT 9
+#define GPIO_NR_PALMLD_USB_DETECT 7
+#define GPIO_NR_PALMZ31_USB_POWER 53
#endif
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31.c 2007-02-13 16:54:05 UTC (rev 805)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31.c 2007-02-14 07:27:22 UTC (rev 806)
@@ -29,6 +29,9 @@
#include <sound/initval.h>
#include <sound/ac97_codec.h>
+#include <linux/interrupt.h>
+#include <asm/irq.h>
+
#include "../generic.h"
#include "palmz31-gpio.h"
#define DEBUG
@@ -52,20 +55,81 @@
.dev = { .platform_data = &palmld_audio_ops },
};
+/**
+ * Buttons
+ */
+
+struct platform_device palmz31_buttons = {
+ .name = "palmz31-buttons",
+ .id =-1,
+};
+
+/**
+ * USB
+ */
+static struct workqueue_struct *my_workqueue;
+ #define MY_WORK_QUEUE_NAME "Palmz31"
+static void palmz31_usb_power(void* irq)
+{
+ int gpn = (int)irq;
+
+ if ((GPLR(gpn) & GPIO_bit(gpn)) == 0) // If USB detect is low
+ //turn USB power off
+ GPCR(GPIO_NR_PALMZ31_USB_POWER) = GPIO_bit(GPIO_NR_PALMZ31_USB_POWER);
+ else // Else USB detect is high
+ //Turn USB power on
+ GPSR(GPIO_NR_PALMZ31_USB_POWER) = GPIO_bit(GPIO_NR_PALMZ31_USB_POWER);
+}
+
+static irqreturn_t palmz31_usb_irq(int irq, void *dev_id, struct pt_regs *regs)
+{
+ static struct work_struct task;
+
+ INIT_WORK(&task, palmz31_usb_power, dev_id);
+ queue_work(my_workqueue, &task);
+
+ return IRQ_HANDLED;
+}
+
+static int palmz31_usb_init()
+{
+ int ret;
+ printk(KERN_ERR "Setting up USB...");
+ // First set the USB power gpio to 'Out'
+ GPDR(GPIO_NR_PALMZ31_USB_POWER) |= GPIO_bit(GPIO_NR_PALMZ31_USB_POWER);
+ // Make sure USB is off, to save power
+ GPSR(GPIO_NR_PALMZ31_USB_POWER) = GPIO_bit(GPIO_NR_PALMZ31_USB_POWER);
+ // Then attach a interupt to USB detect
+ ret = request_irq (IRQ_GPIO(GPIO_NR_PALMLD_USB_DETECT), palmz31_usb_irq, 0, "Detect USB", NULL);
+ if(ret!=0){ //Check if it worked
+ printk(KERN_ERR "Whoops: Can't attach irq to USB detect");
+ return 1; }
+ else
+ {
+ printk(KERN_ERR "Attached irq to USB detect");
+ return 0;
+ }
+}
+
static struct platform_device *devices[] __initdata = {
&palmld_ac97,
+ &palmz31_buttons,
};
+/**
+ * Backlight
+ */
+
static void zire31_backlight_power(int on)
{
/* TODO */
if(on) {
- PWM_CTRL1 = 0x1;
- PWM_PWDUTY1 = 0x50;
- PWM_PERVAL1 = 0x12b;
- CKEN |= CKEN1_PWM1;
+ // PWM_CTRL1 = 0x1;
+ // PWM_PWDUTY1 = 0x50;
+ // PWM_PERVAL1 = 0x12b;
+ // CKEN |= CKEN1_PWM1;
} else
- CKEN &= ~CKEN1_PWM1;
+ CKEN &= ~3;
}
static struct pxafb_mach_info zire31_lcd __initdata = {
@@ -92,7 +156,7 @@
set_pxa_fb_info(&zire31_lcd);
GCR &= ~GCR_PRIRDY_IEN;
-
+ palmz31_usb_init();
platform_add_devices(devices, ARRAY_SIZE(devices));
}
Added: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31_buttons.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31_buttons.c (rev 0)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31_buttons.c 2007-02-14 07:27:22 UTC (rev 806)
@@ -0,0 +1,148 @@
+/*
+ * linux/arch/arm/mach-pxa/palmz31/palmz31-buttons.c
+ *
+ * Button driver for Palm Zire 31
+ *
+ * Author: Scott Mansell <ph...@gm...>
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/input.h>
+#include <linux/device.h>
+#include <linux/platform_device.h>
+#include <asm/irq.h>
+#include <asm/mach/irq.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>
+
+#define GET_GPIO(gpio) (GPLR(gpio) & GPIO_bit(gpio))
+
+#define MAX_BUTTONS 23
+
+struct input_dev *button_dev;
+static struct device_driver palmz31_buttons_driver;
+
+static struct {
+ int keycode;
+ char *desc;
+} palmz31_buttons[MAX_BUTTONS] = {
+ { -1, NULL }, /* GPIO 0 */
+ { -1, NULL },
+ { -1, "Power" },
+ { -1, NULL },
+ { -1, NULL },
+ { -1, NULL }, /* GPIO 5 */
+ { -1, NULL },
+ { -1, NULL },
+ { -1, NULL },
+ { -1, NULL },
+ { -1, NULL }, /* GPIO 10 */
+ { KEY_LEFTSHIFT,"Contacts" },
+ { -1, NULL },
+ { KEY_PAGEUP, "Calander" },
+ { KEY_ENTER, "Center" },
+ { -1, NULL }, /* GPIO 15 */
+ { -1, NULL },
+ { -1, NULL },
+ { -1, NULL },
+ { KEY_LEFT, "Left" },
+ { KEY_RIGHT, "Right" }, /* GPIO 20 */
+ { KEY_DOWN, "Down" },
+ { KEY_UP, "Up" }
+};
+
+static irqreturn_t palmz31_keypad_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
+{
+ input_report_key(button_dev, palmz31_buttons[IRQ_TO_GPIO(irq)].keycode,
+ GET_GPIO(IRQ_TO_GPIO(irq)) ? 0 : 1);
+ return IRQ_HANDLED;
+}
+
+static int palmz31_buttons_probe(struct device *dev)
+{
+ int err = 0;
+ int i;
+
+ //if(!machine_is_tunge2())
+ // return -ENODEV;
+
+ button_dev = input_allocate_device();
+ button_dev->evbit[0] = BIT(EV_KEY);
+ for(i=0;i<MAX_BUTTONS;i++) {
+ if(palmz31_buttons[i].keycode >= 0) {
+ button_dev->keybit[LONG(palmz31_buttons[i].keycode)] |=
+ BIT(palmz31_buttons[i].keycode);
+ }
+ }
+ button_dev->name = "Palm Zire 31 buttons";
+ button_dev->id.bustype = BUS_HOST;
+ input_register_device(button_dev);
+
+ for(i=0;i<MAX_BUTTONS;i++) {
+ if(palmz31_buttons[i].keycode >= 0) {
+ err += request_irq(IRQ_GPIO(i),
+ palmz31_keypad_irq_handler,
+ SA_SAMPLE_RANDOM | SA_INTERRUPT,
+ "keypad", (void*)i);
+ set_irq_type(IRQ_GPIO(i), IRQT_BOTHEDGE);
+ }
+ }
+
+ if(err) {
+ printk("err = %d\n", err);
+ }
+
+ return 0;
+}
+
+static int palmz31_buttons_remove (struct device *dev)
+{
+ int i;
+ for(i=0;i<MAX_BUTTONS;i++) {
+ if(palmz31_buttons[i].keycode >= 0) {
+ free_irq(IRQ_GPIO(i), (void*)i);
+ }
+ }
+ return 0;
+}
+
+static struct device_driver palmz31_buttons_driver = {
+ .name = "palmz31-buttons",
+ .bus = &platform_bus_type,
+ .probe = palmz31_buttons_probe,
+ .remove = palmz31_buttons_remove,
+#ifdef CONFIG_PM
+ .suspend = NULL,
+ .resume = NULL,
+#endif
+};
+
+static int __init palmz31_buttons_init(void)
+{
+ //if(!machine_is_tunge2())
+ // return -ENODEV;
+
+ return driver_register(&palmz31_buttons_driver);
+}
+
+static void __exit palmz31_buttons_exit(void)
+{
+ input_unregister_device(button_dev);
+ driver_unregister(&palmz31_buttons_driver);
+}
+
+module_init(palmz31_buttons_init);
+module_exit(palmz31_buttons_exit);
+
+MODULE_AUTHOR ("Scott Mansell <ph...@gm...");
+MODULE_DESCRIPTION ("Button support for Palm Zire 31");
+MODULE_LICENSE ("GPL");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bal...@us...> - 2007-02-13 16:54:14
|
Revision: 805
http://svn.sourceforge.net/hackndev/?rev=805&view=rev
Author: balrog-kun
Date: 2007-02-13 08:54:05 -0800 (Tue, 13 Feb 2007)
Log Message:
-----------
TX: Fix Kconfig formatting so that vim syntax colouring catches on.
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig 2007-02-13 16:51:56 UTC (rev 804)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig 2007-02-13 16:54:05 UTC (rev 805)
@@ -1,40 +1,39 @@
menuconfig MACH_XSCALE_PALMTX
- bool "Palm TX"
- select PXA27x
- help
- This enables support for Palm TX handheld.
- Note: this is in a very early stage.
+ bool "Palm TX"
+ select PXA27x
+ help
+ This enables support for Palm TX handheld.
+ Note: this is in a very early stage.
config PALMTX_AC97
- tristate "Palm TX AC97 driver"
- depends on MACH_XSCALE_PALMTX
+ tristate "Palm TX AC97 driver"
+ depends on MACH_XSCALE_PALMTX
default y if MACH_XSCALE_PALMTX
- help
- AC97 codec for Palm TX.
- Enable support for WM9712 touchscreen and battery for
- the Palm TX PDA
+ help
+ AC97 codec for Palm TX.
+ Enable support for WM9712 touchscreen and battery for
+ the Palm TX PDA
config PALMTX_LCD
tristate "Palm TX LCD driver"
select LCD_CLASS_DEVICE
- depends on MACH_XSCALE_PALMTX
- default y if MACH_XSCALE_PALMTX
- help
- LCD driver for Palm TX.
- Enable support for switching the Palm TX LCD on/off
+ depends on MACH_XSCALE_PALMTX
+ default y if MACH_XSCALE_PALMTX
+ help
+ LCD driver for Palm TX.
+ Enable support for switching the Palm TX LCD on/off
config PALMTX_PCMCIA
- tristate "Palm TX PCMCIA driver"
- depends on MACH_XSCALE_PALMTX
- default y if MACH_XSCALE_PALMTX
- help
- PCMCIA driver for Palm TX
+ tristate "Palm TX PCMCIA driver"
+ depends on MACH_XSCALE_PALMTX
+ default y if MACH_XSCALE_PALMTX
+ help
+ PCMCIA driver for Palm TX
-
config PALMTX_DEBUG
bool "Debug output for Palm TX"
depends on MACH_XSCALE_PALMTX
default n
help
- Enable core debug output for Palm TX modules.
+ Enable core debug output for Palm TX modules.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bal...@us...> - 2007-02-13 16:52:03
|
Revision: 804
http://svn.sourceforge.net/hackndev/?rev=804&view=rev
Author: balrog-kun
Date: 2007-02-13 08:51:56 -0800 (Tue, 13 Feb 2007)
Log Message:
-----------
TX: Fix lcd Kconfig dependency.
Maybe palmtx_lcd.c should be automatically enabled if LCD_CLASS_DEVICE && MACH_XSCALE_PALMTX are selected.
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig 2007-02-12 23:45:10 UTC (rev 803)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmtx/Kconfig 2007-02-13 16:51:56 UTC (rev 804)
@@ -16,7 +16,7 @@
config PALMTX_LCD
tristate "Palm TX LCD driver"
- select BACKLIGHT_LCD_SUPPORT
+ select LCD_CLASS_DEVICE
depends on MACH_XSCALE_PALMTX
default y if MACH_XSCALE_PALMTX
help
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bal...@us...> - 2007-02-12 23:45:12
|
Revision: 803
http://svn.sourceforge.net/hackndev/?rev=803&view=rev
Author: balrog-kun
Date: 2007-02-12 15:45:10 -0800 (Mon, 12 Feb 2007)
Log Message:
-----------
All: Globals are bad. At least use "static".
Modified Paths:
--------------
linux4palm/linux/trunk/drivers/input/keyboard/palmirkbd.c
linux4palm/linux/trunk/drivers/input/keyboard/palmwk.c
Modified: linux4palm/linux/trunk/drivers/input/keyboard/palmirkbd.c
===================================================================
--- linux4palm/linux/trunk/drivers/input/keyboard/palmirkbd.c 2007-02-10 16:27:40 UTC (rev 802)
+++ linux4palm/linux/trunk/drivers/input/keyboard/palmirkbd.c 2007-02-12 23:45:10 UTC (rev 803)
@@ -148,11 +148,11 @@
};
-struct input_dev *palmirkbd_dev;
-int state = STATE_OUTSIDE;
-int fn_pressed = 0;
+static struct input_dev *palmirkbd_dev;
+static int state = STATE_OUTSIDE;
+static int fn_pressed = 0;
-void palmirkbd_process_scancode(unsigned char data)
+static void palmirkbd_process_scancode(unsigned char data)
{
int code = data & MASK_CODE;
int keyup = data & MASK_KEYUP;
@@ -176,7 +176,7 @@
if(key == KEY_RIGHTMETA) fn_pressed = !keyup;
}
-void palmirkbd_process_byte(unsigned char data)
+static void palmirkbd_process_byte(unsigned char data)
{
/* at any stage, c1 means end of frame */
if(data == EOF) {
Modified: linux4palm/linux/trunk/drivers/input/keyboard/palmwk.c
===================================================================
--- linux4palm/linux/trunk/drivers/input/keyboard/palmwk.c 2007-02-10 16:27:40 UTC (rev 802)
+++ linux4palm/linux/trunk/drivers/input/keyboard/palmwk.c 2007-02-12 23:45:10 UTC (rev 803)
@@ -150,12 +150,12 @@
};
-struct input_dev *palmwk_dev;
-int state = STATE_OUTSIDE;
-int fn_pressed = 0;
-int fn2_pressed = 0;
+static struct input_dev *palmwk_dev;
+static int state = STATE_OUTSIDE;
+static int fn_pressed = 0;
+static int fn2_pressed = 0;
-void palmwk_process_scancode(unsigned char data)
+static void palmwk_process_scancode(unsigned char data)
{
int code = data & MASK_CODE;
int keyup = data & MASK_KEYUP;
@@ -176,7 +176,7 @@
if(key == KEY_LEFTMETA) fn2_pressed = !keyup; /* Green Fn key */
}
-void palmwk_process_byte(unsigned char data)
+static void palmwk_process_byte(unsigned char data)
{
/* at any stage, c1 means end of frame */
if(data == EOF) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2007-02-10 16:27:44
|
Revision: 802
http://svn.sourceforge.net/hackndev/?rev=802&view=rev
Author: marex_z71
Date: 2007-02-10 08:27:40 -0800 (Sat, 10 Feb 2007)
Log Message:
-----------
l4p: fix LD LCD margins (so it?\194?\180s 2px:2px on left and right, not 1px:3px)
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c 2007-02-09 23:33:53 UTC (rev 801)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c 2007-02-10 16:27:40 UTC (rev 802)
@@ -265,10 +265,10 @@
/* fixme: these are the margins PalmOS has set,
* they seem to work but could be better.
*/
- .left_margin = 31,
- .right_margin = 3,
+ .left_margin = 32,
+ .right_margin = 1,
.upper_margin = 7, //5,
- .lower_margin = 8, //3,
+ .lower_margin = 1, //3,
.sync = FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2007-02-09 23:33:56
|
Revision: 801
http://svn.sourceforge.net/hackndev/?rev=801&view=rev
Author: marex_z71
Date: 2007-02-09 15:33:53 -0800 (Fri, 09 Feb 2007)
Log Message:
-----------
l4p: PalmLD IrDA support - seems to work quite well
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/configs/palmld_defconfig
linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c
linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-gpio.h
Modified: linux4palm/linux/trunk/arch/arm/configs/palmld_defconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/configs/palmld_defconfig 2007-02-09 19:52:41 UTC (rev 800)
+++ linux4palm/linux/trunk/arch/arm/configs/palmld_defconfig 2007-02-09 23:33:53 UTC (rev 801)
@@ -389,7 +389,7 @@
#
# FIR device drivers
#
-# CONFIG_PXA_FICP is not set
+CONFIG_PXA_FICP=m
CONFIG_BT=m
CONFIG_BT_L2CAP=m
CONFIG_BT_SCO=m
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c 2007-02-09 19:52:41 UTC (rev 800)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c 2007-02-09 23:33:53 UTC (rev 801)
@@ -13,6 +13,7 @@
#include <linux/platform_device.h>
#include <linux/fb.h>
#include <linux/input.h>
+#include <linux/delay.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -23,6 +24,7 @@
#include <asm/arch/mmc.h>
#include <asm/arch/pxafb.h>
#include <asm/arch/pxa-regs.h>
+#include <asm/arch/irda.h>
#include <asm/arch/palmld-gpio.h>
#include <asm/arch/pxa27x_keyboard.h>
#include <asm/arch/pxapwm-bl.h>
@@ -118,81 +120,39 @@
* IRDA
*/
-/* Uncomment the following line to get serial console via SIR work from
- * the very early booting stage. This is not useful for end-user.
- */
-// #define EARLY_SIR_CONSOLE
-
-#define IR_TRANSCEIVER_ON \
- SET_HX4700_GPIO_N(IR_ON, 1)
-
-#define IR_TRANSCEIVER_OFF \
- SET_HX4700_GPIO_N(IR_ON, 0)
-
-
-static void
-palmld_irda_configure (struct uart_pxa_port *up, int enable)
+static void palmld_irda_transceiver_mode(struct device *dev, int mode)
{
- /* Switch STUART RX/TX pins to SIR */
- pxa_gpio_mode( GPIO_NR_PALMLD_STD_RXD_MD );
- pxa_gpio_mode( GPIO_NR_PALMLD_STD_TXD_MD );
+ unsigned long flags;
- /* make sure FIR ICP is off */
- ICCR0 = 0;
+ local_irq_save(flags);
- if (enable) {
- /* configure STUART to for SIR */
- STISR = STISR_XMODE | STISR_RCVEIR | STISR_RXPL;
- //IR_TRANSCEIVER_ON;
- } else {
- STISR = 0;
- //IR_TRANSCEIVER_OFF;
- }
-}
+ if (mode & IR_SIRMODE){
+ printk (KERN_INFO "palmld_irda: setting mode to SIR\n");
+ }
+ else if (mode & IR_FIRMODE){
+ printk (KERN_INFO "palmld_irda: setting mode to FIR\n");
+ }
+ if (mode & IR_OFF){
+ printk (KERN_INFO "palmld_irda: turning tranceiver OFF\n");
+ SET_PALMLD_GPIO(IR_DISABLE, 1);
+ }
+ else {
+ printk (KERN_INFO "palmld_irda: turning tranceiver ON\n");
+ SET_PALMLD_GPIO(IR_DISABLE, 0);
+ SET_PALMLD_GPIO(ICP_TXD_MD, 1);
+ mdelay(30);
+ SET_PALMLD_GPIO(ICP_TXD_MD, 0);
+ }
-static void
-palmld_irda_set_txrx (struct uart_pxa_port *up, int txrx)
-{
- unsigned old_stisr = STISR;
- unsigned new_stisr = old_stisr;
-
- if (txrx & PXA_SERIAL_TX) {
- /* Ignore RX if TX is set */
- txrx &= PXA_SERIAL_TX;
- new_stisr |= STISR_XMITIR;
- } else
- new_stisr &= ~STISR_XMITIR;
-
- if (txrx & PXA_SERIAL_RX)
- new_stisr |= STISR_RCVEIR;
- else
- new_stisr &= ~STISR_RCVEIR;
-
- if (new_stisr != old_stisr) {
- while (!(STLSR & LSR_TEMT))
- ;
- //IR_TRANSCEIVER_OFF;
- STISR = new_stisr;
- //IR_TRANSCEIVER_ON;
- }
+ local_irq_restore(flags);
}
-static int
-palmld_irda_get_txrx (struct uart_pxa_port *up)
-{
- return ((STISR & STISR_XMITIR) ? PXA_SERIAL_TX : 0) |
- ((STISR & STISR_RCVEIR) ? PXA_SERIAL_RX : 0);
-}
-
-
-static struct platform_pxa_serial_funcs palmld_pxa_irda_funcs = {
- .configure = palmld_irda_configure,
- .set_txrx = palmld_irda_set_txrx,
- .get_txrx = palmld_irda_get_txrx,
+static struct pxaficp_platform_data palmld_ficp_platform_data = {
+ .transceiver_cap = IR_SIRMODE | IR_FIRMODE | IR_OFF,
+ .transceiver_mode = palmld_irda_transceiver_mode,
};
-
/* platform */
/*
@@ -369,12 +329,7 @@
set_pxa_fb_info( &palmld_lcd );
pxa_set_mci_info( &palmld_mci_platform_data );
platform_add_devices( devices, ARRAY_SIZE(devices) );
-
- stuart_device.dev.platform_data = &palmld_pxa_irda_funcs;
-#ifdef EARLY_SIR_CONSOLE
- palmld_irda_configure (NULL, 1);
- palmld_irda_set_txrx (NULL, PXA_SERIAL_TX);
-#endif
+ pxa_set_ficp_info( &palmld_ficp_platform_data );
}
MACHINE_START(XSCALE_PALMLD, "Palm LifeDrive")
Modified: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-gpio.h
===================================================================
--- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-gpio.h 2007-02-09 19:52:41 UTC (rev 800)
+++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-gpio.h 2007-02-09 23:33:53 UTC (rev 801)
@@ -21,6 +21,7 @@
/* Palm LifeDrive GPIOs */
+#define GPIO_NR_PALMLD_GPIO_RESET 1
#define GPIO_NR_PALMLD_USB_DETECT 3
#define GPIO_NR_PALMLD_POWER_DETECT 4
#define GPIO_NR_PALMLD_HOTSYNC_BUTTON_N 10
@@ -31,8 +32,9 @@
#define GPIO_NR_PALMLD_WM9712_IRQ 27
-#define GPIO_NR_PALMLD_STD_RXD 46 /* IRDA */
-#define GPIO_NR_PALMLD_STD_TXD 47
+#define GPIO_NR_PALMLD_IR_DISABLE 40 /* IRDA */
+#define GPIO_NR_PALMLD_ICP_RXD 46
+#define GPIO_NR_PALMLD_ICP_TXD 47
#define GPIO_NR_PALMLD_GREEN_LED 52
@@ -52,18 +54,19 @@
#define GPIO_NR_PALMLD_IDE_PWEN 115
-#define GPIO_NR_PALMLD_STD_RXD_MD (GPIO_NR_PALMLD_STD_RXD | GPIO_ALT_FN_2_IN)
-#define GPIO_NR_PALMLD_STD_TXD_MD (GPIO_NR_PALMLD_STD_TXD | GPIO_ALT_FN_1_OUT)
-
#define GPIO_NR_PALMLD_KP_MKIN3_MD (GPIO_NR_PALMLD_KP_MKIN3 | GPIO_ALT_FN_3_IN)
#define GPIO_NR_PALMLD_KP_MKIN0_MD (GPIO_NR_PALMLD_KP_MKIN0 | GPIO_ALT_FN_1_IN)
#define GPIO_NR_PALMLD_KP_MKIN1_MD (GPIO_NR_PALMLD_KP_MKIN1 | GPIO_ALT_FN_1_IN)
#define GPIO_NR_PALMLD_KP_MKIN2_MD (GPIO_NR_PALMLD_KP_MKIN2 | GPIO_ALT_FN_1_IN)
-#define GPIO_NR_PALMLD_KP_MKOUT0_MD (GPIO_NR_PALMLD_KP_MKOUT0 | GPIO_ALT_FN_2_OUT)
-#define GPIO_NR_PALMLD_KP_MKOUT1_MD (GPIO_NR_PALMLD_KP_MKOUT1 | GPIO_ALT_FN_2_OUT)
-#define GPIO_NR_PALMLD_KP_MKOUT2_MD (GPIO_NR_PALMLD_KP_MKOUT2 | GPIO_ALT_FN_2_OUT)
+#define GPIO_NR_PALMLD_KP_MKOUT0_MD (GPIO_NR_PALMLD_KP_MKOUT0 | GPIO_ALT_FN_2_OUT)
+#define GPIO_NR_PALMLD_KP_MKOUT1_MD (GPIO_NR_PALMLD_KP_MKOUT1 | GPIO_ALT_FN_2_OUT)
+#define GPIO_NR_PALMLD_KP_MKOUT2_MD (GPIO_NR_PALMLD_KP_MKOUT2 | GPIO_ALT_FN_2_OUT)
+#define GPIO_NR_PALMLD_ICP_RXD_MD (GPIO_NR_PALMLD_ICP_RXD | GPIO_ALT_FN_1_IN)
+#define GPIO_NR_PALMLD_ICP_TXD_MD (GPIO_NR_PALMLD_ICP_TXD | GPIO_ALT_FN_2_OUT)
+
+#define IRQ_GPIO_PALMLD_GPIO_RESET IRQ_GPIO(GPIO_NR_PALMLD_GPIO_RESET)
#define IRQ_GPIO_PALMLD_SD_DETECT_N IRQ_GPIO(GPIO_NR_PALMLD_SD_DETECT_N)
#define IRQ_GPIO_PALMLD_WM9712_IRQ IRQ_GPIO(GPIO_NR_PALMLD_WM9712_IRQ)
#define IRQ_GPIO_PALMLD_IDE_IRQ IRQ_GPIO(GPIO_NR_PALMLD_IDE_IRQ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mar...@us...> - 2007-02-09 19:52:44
|
Revision: 800
http://svn.sourceforge.net/hackndev/?rev=800&view=rev
Author: marex_z71
Date: 2007-02-09 11:52:41 -0800 (Fri, 09 Feb 2007)
Log Message:
-----------
l4p: added gpioed and gpioed-ng to palmld
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/configs/palmld_defconfig
linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Kconfig
linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Makefile
Added Paths:
-----------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/gpioed-ng.c
linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/gpioed.c
Modified: linux4palm/linux/trunk/arch/arm/configs/palmld_defconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/configs/palmld_defconfig 2007-02-09 19:12:01 UTC (rev 799)
+++ linux4palm/linux/trunk/arch/arm/configs/palmld_defconfig 2007-02-09 19:52:41 UTC (rev 800)
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.17-hnd0
-# Fri Feb 9 19:41:27 2007
+# Fri Feb 9 20:37:32 2007
#
CONFIG_ARM=y
CONFIG_MMU=y
@@ -142,6 +142,8 @@
CONFIG_PALMLD_PCMCIA=m
# CONFIG_PALMLD_USB is not set
CONFIG_PALMLD_IDE=m
+CONFIG_GPIOED=m
+CONFIG_GPIOEDNG=m
# CONFIG_MACH_XSCALE_PALMTREO650 is not set
# CONFIG_MACH_XSCALE_TREO680 is not set
# CONFIG_MACH_T700WX is not set
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Kconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Kconfig 2007-02-09 19:12:01 UTC (rev 799)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Kconfig 2007-02-09 19:52:41 UTC (rev 800)
@@ -21,3 +21,17 @@
config PALMLD_IDE
tristate "Palm LifeDrive IDE driver"
depends on MACH_XSCALE_PALMLD
+
+config GPIOED
+ tristate "GPIOED"
+ depends on MACH_XSCALE_PALMLD
+ default n
+ help
+ Gpioed: only for debuging and testing!
+
+config GPIOEDNG
+ tristate "GPIOEDNG"
+ depends on MACH_XSCALE_PALMLD
+ default n
+ help
+ Gpioed-ng: only for debuging and testing!
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Makefile
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Makefile 2007-02-09 19:12:01 UTC (rev 799)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/Makefile 2007-02-09 19:52:41 UTC (rev 800)
@@ -7,3 +7,6 @@
obj-$(CONFIG_PALMLD_USB) += palmld_usb.o
obj-$(CONFIG_PALMLD_IDE) += palmld_ide.o
obj-$(CONFIG_PM) += palmld_pm.o
+obj-$(CONFIG_GPIOED) += gpioed.o
+obj-$(CONFIG_GPIOEDNG) += gpioed-ng.o
+
Added: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/gpioed-ng.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/gpioed-ng.c (rev 0)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/gpioed-ng.c 2007-02-09 19:52:41 UTC (rev 800)
@@ -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/palmld/gpioed.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/gpioed.c (rev 0)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/gpioed.c 2007-02-09 19:52:41 UTC (rev 800)
@@ -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: <mar...@us...> - 2007-02-09 19:12:20
|
Revision: 799
http://svn.sourceforge.net/hackndev/?rev=799&view=rev
Author: marex_z71
Date: 2007-02-09 11:12:01 -0800 (Fri, 09 Feb 2007)
Log Message:
-----------
l4p: update palmld defconfig
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/configs/palmld_defconfig
Modified: linux4palm/linux/trunk/arch/arm/configs/palmld_defconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/configs/palmld_defconfig 2007-02-08 20:03:13 UTC (rev 798)
+++ linux4palm/linux/trunk/arch/arm/configs/palmld_defconfig 2007-02-09 19:12:01 UTC (rev 799)
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.17-hnd0
-# Sun Oct 1 12:34:11 2006
+# Fri Feb 9 19:41:27 2007
#
CONFIG_ARM=y
CONFIG_MMU=y
@@ -142,12 +142,16 @@
CONFIG_PALMLD_PCMCIA=m
# CONFIG_PALMLD_USB is not set
CONFIG_PALMLD_IDE=m
+# CONFIG_MACH_XSCALE_PALMTREO650 is not set
+# CONFIG_MACH_XSCALE_TREO680 is not set
+# CONFIG_MACH_T700WX 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 is not set
# CONFIG_MACH_OMAP_PALMTC is not set
+# CONFIG_MACH_ZIRE31 is not set
# CONFIG_PXA_SHARPSL is not set
CONFIG_PXA27x=y
CONFIG_PXA_RTC_EPOCH=1904
@@ -262,10 +266,8 @@
#
# Power management options
#
-CONFIG_PM=y
-CONFIG_PM_LEGACY=y
-CONFIG_PM_DEBUG=y
-CONFIG_APM=y
+# CONFIG_PM is not set
+# CONFIG_APM is not set
#
# Networking
@@ -386,13 +388,34 @@
# FIR device drivers
#
# CONFIG_PXA_FICP is not set
-# CONFIG_BT is not set
+CONFIG_BT=m
+CONFIG_BT_L2CAP=m
+CONFIG_BT_SCO=m
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+# CONFIG_BT_BNEP_MC_FILTER is not set
+# CONFIG_BT_BNEP_PROTO_FILTER is not set
+# CONFIG_BT_HIDP is not set
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+# CONFIG_BT_HCIUART_BCSP is not set
+# CONFIG_BT_HCIDTL1 is not set
+# CONFIG_BT_HCIBT3C is not set
+# CONFIG_BT_HCIBLUECARD is not set
+# CONFIG_BT_HCIBTUART is not set
+# CONFIG_BT_HCIVHCI is not set
CONFIG_IEEE80211=m
# CONFIG_IEEE80211_DEBUG is not set
CONFIG_IEEE80211_CRYPT_WEP=m
# CONFIG_IEEE80211_CRYPT_CCMP is not set
# CONFIG_IEEE80211_CRYPT_TKIP is not set
-# CONFIG_IEEE80211_SOFTMAC is not set
+CONFIG_IEEE80211_SOFTMAC=m
+# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
CONFIG_WIRELESS_EXT=y
#
@@ -549,10 +572,7 @@
#
# CONFIG_AIRO_CS is not set
# CONFIG_PCMCIA_WL3501 is not set
-CONFIG_HOSTAP=m
-CONFIG_HOSTAP_FIRMWARE=y
-CONFIG_HOSTAP_FIRMWARE_NVRAM=y
-CONFIG_HOSTAP_CS=m
+# CONFIG_HOSTAP is not set
# CONFIG_ACX is not set
CONFIG_NET_WIRELESS=y
@@ -614,8 +634,9 @@
# CONFIG_KEYBOARD_XTKBD is not set
# CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_KEYBOARD_STOWAWAY is not set
+CONFIG_KEYBOARD_PXA27x=y
CONFIG_KEYBOARD_PALMIR=y
-CONFIG_KEYBOARD_PXA27X=y
+# CONFIG_KEYBOARD_PALMWK is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set
CONFIG_INPUT_TOUCHSCREEN=y
@@ -627,8 +648,7 @@
# 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_TOUCHSCREEN_WM97XX_PXA is not set
# CONFIG_INPUT_MISC is not set
#
@@ -650,7 +670,11 @@
#
# Serial drivers
#
-# CONFIG_SERIAL_8250 is not set
+CONFIG_SERIAL_8250=m
+# CONFIG_SERIAL_8250_CS is not set
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
#
# Non-8250 serial port support
@@ -742,6 +766,7 @@
# Misc devices
#
CONFIG_BATTERY_MONITOR=y
+# CONFIG_BATTCHARGE_MONITOR is not set
#
# Multimedia Capabilities Port drivers
@@ -751,15 +776,20 @@
#
# LED devices
#
-# CONFIG_NEW_LEDS is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=m
#
# LED drivers
#
+CONFIG_LEDS_PALMLD=m
#
# LED Triggers
#
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=m
+CONFIG_LEDS_TRIGGER_IDE_DISK=y
#
# Multimedia devices
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hap...@us...> - 2007-02-08 20:03:20
|
Revision: 798
http://svn.sourceforge.net/hackndev/?rev=798&view=rev
Author: happy-slapin
Date: 2007-02-08 12:03:13 -0800 (Thu, 08 Feb 2007)
Log Message:
-----------
z72: Allows battery driver to be compiled in kernel.
Btw, testing for module mode is required.
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c 2007-02-04 23:18:05 UTC (rev 797)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c 2007-02-08 20:03:13 UTC (rev 798)
@@ -202,6 +202,10 @@
#endif
static int __init palmz72_wm97xx_init(void)
{
+#ifndef MODULE
+ int ret;
+#endif
+
/* register battery to APM layer */
bat.battery_registered = 0;
@@ -216,6 +220,12 @@
apm_get_power_status_orig = apm_get_power_status;
apm_get_power_status = palmz72_apm_get_power_status;
#endif
+#ifndef MODULE
+ /* If we're in kernel, we could accidentally be run before wm97xx
+ and thus have panic */
+ if((ret = bus_register(&wm97xx_bus_type)) < 0)
+ return ret;
+#endif
return driver_register(&palmz72_wm97xx_driver);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hap...@us...> - 2007-02-04 23:18:08
|
Revision: 797
http://svn.sourceforge.net/hackndev/?rev=797&view=rev
Author: happy-slapin
Date: 2007-02-04 15:18:05 -0800 (Sun, 04 Feb 2007)
Log Message:
-----------
z72: battery - disabled annoying message
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c 2007-02-04 18:58:07 UTC (rev 796)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c 2007-02-04 23:18:05 UTC (rev 797)
@@ -74,7 +74,6 @@
bat.previous_voltage = bat.current_voltage;
bat.current_voltage = wm97xx_read_aux_adc(bat.wm, WM97XX_AUX_ID3);
bat.last_battery_update = jiffies;
- printk("Battery [mV]: %d\n", bat.current_voltage * 1889/1000 + 7678/10 );
return bat.current_voltage * 1889/1000 + 7678/10;
}
else{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hap...@us...> - 2007-02-04 18:58:09
|
Revision: 796
http://svn.sourceforge.net/hackndev/?rev=796&view=rev
Author: happy-slapin
Date: 2007-02-04 10:58:07 -0800 (Sun, 04 Feb 2007)
Log Message:
-----------
z72: defconfig
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-02-04 08:14:03 UTC (rev 795)
+++ linux4palm/linux/trunk/arch/arm/configs/palmz72_defconfig 2007-02-04 18:58:07 UTC (rev 796)
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.17-hnd0
-# Thu Jan 18 12:36:38 2007
+# Sat Feb 3 23:56:17 2007
#
CONFIG_ARM=y
CONFIG_MMU=y
@@ -143,23 +143,24 @@
# CONFIG_MACH_XSCALE_PALMLD is not set
# CONFIG_MACH_XSCALE_PALMTREO650 is not set
# CONFIG_MACH_XSCALE_TREO680 is not set
+# CONFIG_MACH_T700WX 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_PALMZ72_PM=y
+CONFIG_PALMZ72_BATTERY=m
CONFIG_GPIOED=m
CONFIG_GPIOEDNG=m
# CONFIG_MACH_OMAP_PALMTC is not set
+# CONFIG_MACH_ZIRE31 is not set
# CONFIG_PXA_SHARPSL is not set
CONFIG_PXA27x=y
CONFIG_PXA_RTC_EPOCH=1970
# CONFIG_SA1100_H3100 is not set
# CONFIG_SA1100_H3600 is not set
# CONFIG_SA1100_H3800 is not set
-# CONFIG_GPIO_KEYS is not set
#
# Linux As Bootloader
@@ -212,7 +213,8 @@
CONFIG_PREEMPT=y
# CONFIG_NO_IDLE_HZ is not set
CONFIG_HZ=100
-# CONFIG_AEABI is not set
+CONFIG_AEABI=y
+CONFIG_OABI_COMPAT=y
# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_FLATMEM_MANUAL=y
@@ -254,7 +256,6 @@
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_AOUT is not set
# CONFIG_BINFMT_MISC is not set
-# CONFIG_ARTHUR is not set
#
# Power management options
@@ -336,7 +337,7 @@
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_HAMRADIO is not set
-CONFIG_IRDA=y
+CONFIG_IRDA=m
#
# IrDA protocols
@@ -360,7 +361,7 @@
#
# SIR device drivers
#
-CONFIG_IRTTY_SIR=y
+CONFIG_IRTTY_SIR=m
#
# Dongle support
@@ -379,24 +380,23 @@
#
# FIR device drivers
#
-CONFIG_PXA_FICP=y
-CONFIG_BT=y
+CONFIG_PXA_FICP=m
+CONFIG_BT=m
# CONFIG_BT_L2CAP is not set
# CONFIG_BT_SCO is not set
#
# Bluetooth device drivers
#
-CONFIG_BT_HCIUART=y
+CONFIG_BT_HCIUART=m
# CONFIG_BT_HCIUART_H4 is not set
# CONFIG_BT_HCIUART_BCSP is not set
-# CONFIG_BT_HCIBCM203X is not set
# CONFIG_BT_HCIVHCI is not set
-CONFIG_IEEE80211=y
+CONFIG_IEEE80211=m
# CONFIG_IEEE80211_DEBUG is not set
-# CONFIG_IEEE80211_CRYPT_WEP is not set
-# CONFIG_IEEE80211_CRYPT_CCMP is not set
-CONFIG_IEEE80211_SOFTMAC=y
+CONFIG_IEEE80211_CRYPT_WEP=m
+CONFIG_IEEE80211_CRYPT_CCMP=m
+CONFIG_IEEE80211_SOFTMAC=m
# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
CONFIG_WIRELESS_EXT=y
@@ -544,10 +544,7 @@
#
# Userland interfaces
#
-CONFIG_INPUT_MOUSEDEV=y
-CONFIG_INPUT_MOUSEDEV_PSAUX=y
-CONFIG_INPUT_MOUSEDEV_SCREEN_X=320
-CONFIG_INPUT_MOUSEDEV_SCREEN_Y=320
+# CONFIG_INPUT_MOUSEDEV is not set
# CONFIG_INPUT_JOYDEV is not set
CONFIG_INPUT_TSDEV=y
CONFIG_INPUT_TSDEV_SCREEN_X=320
@@ -567,10 +564,20 @@
# CONFIG_KEYBOARD_STOWAWAY is not set
CONFIG_KEYBOARD_PXA27x=y
# CONFIG_KEYBOARD_PALMIR is not set
-CONFIG_KEYBOARD_PALMWK=y
+CONFIG_KEYBOARD_PALMWK=m
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set
-# CONFIG_INPUT_TOUCHSCREEN 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=y
+# CONFIG_TOUCHSCREEN_WM9705 is not set
+CONFIG_TOUCHSCREEN_WM9712=y
+# CONFIG_TOUCHSCREEN_WM9713 is not set
+# CONFIG_TOUCHSCREEN_WM97XX_PXA is not set
# CONFIG_INPUT_MISC is not set
#
@@ -1076,7 +1083,31 @@
#
# Cryptographic options
#
-# CONFIG_CRYPTO is not set
+CONFIG_CRYPTO=y
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_MD4 is not set
+# CONFIG_CRYPTO_MD5 is not set
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_WP512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_SERPENT is not set
+CONFIG_CRYPTO_AES=m
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
+CONFIG_CRYPTO_ARC4=m
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_TEST is not set
#
# Hardware crypto devices
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ph...@us...> - 2007-02-04 08:14:08
|
Revision: 795
http://svn.sourceforge.net/hackndev/?rev=795&view=rev
Author: phiren
Date: 2007-02-04 00:14:03 -0800 (Sun, 04 Feb 2007)
Log Message:
-----------
initramfs, sound and touchscreen added for Palm zire 31
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/configs/palmz31_defconfig
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31.c
Modified: linux4palm/linux/trunk/arch/arm/configs/palmz31_defconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/configs/palmz31_defconfig 2007-02-03 21:40:24 UTC (rev 794)
+++ linux4palm/linux/trunk/arch/arm/configs/palmz31_defconfig 2007-02-04 08:14:03 UTC (rev 795)
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.17-hnd0
-# Fri Feb 2 17:11:17 2007
+# Sun Feb 4 20:58:45 2007
#
CONFIG_ARM=y
CONFIG_MMU=y
@@ -32,7 +32,9 @@
# CONFIG_IKCONFIG is not set
# CONFIG_MINIMAL_OOPS is not set
# CONFIG_RELAY is not set
-CONFIG_INITRAMFS_SOURCE=""
+CONFIG_INITRAMFS_SOURCE="usr/zire31initramfs/"
+CONFIG_INITRAMFS_ROOT_UID=1000
+CONFIG_INITRAMFS_ROOT_GID=1000
CONFIG_UID16=y
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_EMBEDDED=y
@@ -220,7 +222,7 @@
#
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_CMDLINE="mem=64m root=/dev/nfs rw nfsroot=/tc ip=:::255.255.255.0::usb0:dhcp init=/linuxrc console=tty0"
+CONFIG_CMDLINE="mem=16m init=/linuxrc"
# CONFIG_XIP_KERNEL is not set
#
@@ -463,7 +465,9 @@
#
# CONFIG_INPUT_MOUSEDEV is not set
# CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_TSDEV=y
+CONFIG_INPUT_TSDEV_SCREEN_X=160
+CONFIG_INPUT_TSDEV_SCREEN_Y=160
CONFIG_INPUT_EVDEV=y
# CONFIG_INPUT_EVBUG is not set
@@ -473,7 +477,17 @@
# CONFIG_INPUT_KEYBOARD is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set
-# CONFIG_INPUT_TOUCHSCREEN 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=y
+# CONFIG_TOUCHSCREEN_WM9705 is not set
+CONFIG_TOUCHSCREEN_WM9712=y
+# CONFIG_TOUCHSCREEN_WM9713 is not set
+# CONFIG_TOUCHSCREEN_WM97XX_PXA is not set
# CONFIG_INPUT_MISC is not set
#
@@ -672,9 +686,46 @@
#
# Sound
#
-# CONFIG_SOUND is not set
+CONFIG_SOUND=y
#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=y
+CONFIG_SND_TIMER=y
+CONFIG_SND_PCM=y
+# CONFIG_SND_SEQUENCER is not set
+# CONFIG_SND_MIXER_OSS is not set
+# CONFIG_SND_PCM_OSS is not set
+# CONFIG_SND_DYNAMIC_MINORS is not set
+# CONFIG_SND_SUPPORT_OLD_API is not set
+# CONFIG_SND_VERBOSE_PROCFS is not set
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+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
+# CONFIG_SND_MPU401 is not set
+
+#
+# ALSA ARM devices
+#
+# CONFIG_SND_PXA2xx_I2SOUND is not set
+CONFIG_SND_PXA2XX_PCM=y
+CONFIG_SND_PXA2XX_AC97=y
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+
+#
# USB support
#
CONFIG_USB_ARCH_HAS_HCD=y
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31.c 2007-02-03 21:40:24 UTC (rev 794)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31.c 2007-02-04 08:14:03 UTC (rev 795)
@@ -22,14 +22,50 @@
#include <asm/arch/pxa-regs.h>
#include <asm/arch/pxapwm-bl.h>
+#include <asm/arch/audio.h>
+#include <sound/driver.h>
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/initval.h>
+#include <sound/ac97_codec.h>
+
#include "../generic.h"
#include "palmz31-gpio.h"
#define DEBUG
+/**
+ * AC97 audio controller
+ */
+static pxa2xx_audio_ops_t palmld_audio_ops = {
+ /*
+ .startup = palmld_audio_startup,
+ .shutdown = mst_audio_shutdown,
+ .suspend = mst_audio_suspend,
+ .resume = mst_audio_resume,
+ */
+};
+
+static struct platform_device palmld_ac97 = {
+ .name = "pxa2xx-ac97",
+ .id = -1,
+ .dev = { .platform_data = &palmld_audio_ops },
+};
+
+static struct platform_device *devices[] __initdata = {
+ &palmld_ac97,
+};
+
static void zire31_backlight_power(int on)
{
/* TODO */
+ if(on) {
+ PWM_CTRL1 = 0x1;
+ PWM_PWDUTY1 = 0x50;
+ PWM_PERVAL1 = 0x12b;
+ CKEN |= CKEN1_PWM1;
+ } else
+ CKEN &= ~CKEN1_PWM1;
}
static struct pxafb_mach_info zire31_lcd __initdata = {
@@ -41,8 +77,8 @@
.left_margin = 30,
.right_margin = 7,
.vsync_len = 1,
- .upper_margin = 6,
- .lower_margin = 7,
+ .upper_margin = 0,
+ .lower_margin = 0,
.sync = FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT,
.lccr0 = 0x00100079,
@@ -56,6 +92,8 @@
set_pxa_fb_info(&zire31_lcd);
GCR &= ~GCR_PRIRDY_IEN;
+
+ platform_add_devices(devices, ARRAY_SIZE(devices));
}
MACHINE_START(ZIRE31, "Zire 31")
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hap...@us...> - 2007-02-03 21:40:26
|
Revision: 794
http://svn.sourceforge.net/hackndev/?rev=794&view=rev
Author: happy-slapin
Date: 2007-02-03 13:40:24 -0800 (Sat, 03 Feb 2007)
Log Message:
-----------
z72: final version of battery driver
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c 2007-02-03 02:09:26 UTC (rev 793)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c 2007-02-03 21:40:24 UTC (rev 794)
@@ -72,7 +72,7 @@
{
if (bat.battery_registered){
bat.previous_voltage = bat.current_voltage;
- bat.current_voltage = wm97xx_read_aux_adc(bat.wm, TS_BMON);
+ bat.current_voltage = wm97xx_read_aux_adc(bat.wm, WM97XX_AUX_ID3);
bat.last_battery_update = jiffies;
printk("Battery [mV]: %d\n", bat.current_voltage * 1889/1000 + 7678/10 );
return bat.current_voltage * 1889/1000 + 7678/10;
@@ -125,7 +125,7 @@
static void
palmz72_wm97xx_shutdown(struct device *dev)
{
-#ifdef CONFIG_APM
+#if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE)
apm_get_power_status = apm_get_power_status_orig;
#endif
}
@@ -165,7 +165,7 @@
return ret;
}
-#ifdef CONFIG_APM
+#if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE)
/* APM status query callback implementation */
static void palmz72_apm_get_power_status(struct apm_power_info *info)
@@ -213,7 +213,7 @@
bat.battery_registered = 1;
printk("Battery registered\n");
}
-#ifdef CONFIG_APM
+#if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE)
apm_get_power_status_orig = apm_get_power_status;
apm_get_power_status = palmz72_apm_get_power_status;
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hap...@us...> - 2007-02-03 02:09:28
|
Revision: 793
http://svn.sourceforge.net/hackndev/?rev=793&view=rev
Author: happy-slapin
Date: 2007-02-02 18:09:26 -0800 (Fri, 02 Feb 2007)
Log Message:
-----------
ALL: forgot to add include :)
Modified Paths:
--------------
linux4palm/linux/trunk/include/linux/wm97xx.h
Modified: linux4palm/linux/trunk/include/linux/wm97xx.h
===================================================================
--- linux4palm/linux/trunk/include/linux/wm97xx.h 2007-02-03 02:07:36 UTC (rev 792)
+++ linux4palm/linux/trunk/include/linux/wm97xx.h 2007-02-03 02:09:26 UTC (rev 793)
@@ -1,3 +1,4 @@
+
/*
* Register bits and API for Wolfson WM97xx series of codecs
*/
@@ -101,6 +102,7 @@
#define WM9713_COO 0x0001 /* enable coordinate mode */
#define WM9713_PDEN 0x0800 /* measure only when pen down */
#define WM9713_ADCSEL_MASK 0x00fe /* ADC selection mask */
+#define WM9713_WAIT 0x0200 /* coordinate wait */
/* AUX ADC ID's */
#define TS_COMP1 0x0
@@ -150,7 +152,7 @@
#define RC_PENDOWN 0x00000008
/* The wm97xx driver provides a private API for writing platform-specific
- * drivers.
+ * drivers.
*/
/* The structure used to return arch specific sampled data into */
@@ -203,6 +205,7 @@
#define WM97XX_DIG_STOP 0x2
#define WM97XX_PHY_INIT 0x3
#define WM97XX_AUX_PREPARE 0x4
+#define WM97XX_DIG_RESTORE 0x5
struct wm97xx;
extern struct wm97xx_codec_drv wm97xx_codec;
@@ -212,6 +215,7 @@
*/
struct wm97xx_codec_drv {
u16 id;
+ char *name;
int (*poll_sample) (struct wm97xx *, int adcsel, int *sample); /* read 1 sample */
int (*poll_touch) (struct wm97xx *, struct wm97xx_data *); /* read X,Y,[P] in poll */
int (*digitiser_ioctl) (struct wm97xx *, int cmd);
@@ -219,12 +223,32 @@
};
+/* Machine specific and accelerated touch operations */
+struct wm97xx_mach_ops {
+
+ /* accelerated touch readback - coords are transmited on AC97 link */
+ int acc_enabled;
+ void (*acc_pen_up) (struct wm97xx *);
+ int (*acc_pen_down) (struct wm97xx *);
+ int (*acc_startup) (struct wm97xx *);
+ void (*acc_shutdown) (struct wm97xx *);
+
+ /* pre and post sample - can be used to minimise any analog noise */
+ void (*pre_sample) (int); /* function to run before sampling */
+ void (*post_sample) (int); /* function to run after sampling */
+};
+
struct wm97xx {
- u16 dig[3], id; /* Cached codec registers */
+ u16 dig[3], id, gpio[6], misc; /* Cached codec registers */
+ u16 dig_save[3]; /* saved during aux reading */
struct wm97xx_codec_drv *codec; /* attached codec driver*/
struct input_dev* input_dev; /* touchscreen input device */
ac97_t *ac97; /* ALSA codec access */
struct device *dev; /* ALSA device */
+ struct device *battery_dev;
+ struct device *touch_dev;
+ struct wm97xx_mach_ops *mach_ops;
+ struct mutex codec_mutex;
struct completion ts_init;
struct completion ts_exit;
struct task_struct *ts_task;
@@ -240,20 +264,6 @@
unsigned pen_probably_down:1; /* used in polling mode */
};
-/*
- * Misc wm97xx devices for aux adc, gpio, etc
- */
-struct wm97xx_misc_dev {
- int (*probe)(struct wm97xx *wm);
- void (*remove)(struct wm97xx *wm);
- int (*suspend)(struct wm97xx *wm, pm_message_t state);
- int (*resume)(struct wm97xx *wm);
- struct list_head list;
-};
-
-int wm97xx_register_misc_dev(struct wm97xx_misc_dev* mdev);
-void wm97xx_unregister_misc_dev(struct wm97xx_misc_dev* mdev);
-
/* Codec GPIO access (not supported on WM9705)
* This can be used to set/get codec GPIO and Virtual GPIO status.
*/
@@ -267,16 +277,15 @@
wm97xx_gpio_wake_t wake);
/* codec AC97 IO access */
-int wm97xx_reg_read(struct wm97xx *wm, u16 reg);
+int wm97xx_reg_read(struct wm97xx *wm, u16 reg);
void wm97xx_reg_write(struct wm97xx *wm, u16 reg, u16 val);
/* aux adc readback */
int wm97xx_read_aux_adc(struct wm97xx *wm, u16 adcsel);
-/* continuous touch interface */
-void wm97xx_acc_pen_up (struct wm97xx* wm);
-int wm97xx_acc_pen_down (struct wm97xx* wm);
-int wm97xx_acc_startup(struct wm97xx* wm);
-void wm97xx_acc_shutdown(struct wm97xx* wm);
+/* machine ops */
+int wm97xx_register_mach_ops(struct wm97xx *, struct wm97xx_mach_ops *);
+void wm97xx_unregister_mach_ops(struct wm97xx *);
+extern struct bus_type wm97xx_bus_type;
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hap...@us...> - 2007-02-03 02:07:41
|
Revision: 792
http://svn.sourceforge.net/hackndev/?rev=792&view=rev
Author: happy-slapin
Date: 2007-02-02 18:07:36 -0800 (Fri, 02 Feb 2007)
Log Message:
-----------
z72: Cleaned up a bit
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c 2007-02-02 23:47:44 UTC (rev 791)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c 2007-02-03 02:07:36 UTC (rev 792)
@@ -47,6 +47,10 @@
struct palmz72_battery_dev bat;
+#if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE)
+/* original APM hook */
+static void (*apm_get_power_status_orig)(struct apm_power_info *info);
+#endif
int palmz72_battery_min_voltage(struct battery *b)
{
@@ -115,18 +119,39 @@
static int palmz72_wm97xx_remove(struct device *dev)
{
-// struct wm97xx *wm = dev->driver_data;
return 0;
}
+static void
+palmz72_wm97xx_shutdown(struct device *dev)
+{
+#ifdef CONFIG_APM
+ apm_get_power_status = apm_get_power_status_orig;
+#endif
+}
+
+static int
+palmz72_wm97xx_suspend(struct device *dev, pm_message_t state)
+{
+ return 0;
+}
+
+static int
+palmz72_wm97xx_resume(struct device *dev)
+{
+ return 0;
+}
+
+
static struct device_driver palmz72_wm97xx_driver = {
.name = "wm97xx-touchscreen",
.bus = &wm97xx_bus_type,
.owner = THIS_MODULE,
.probe = palmz72_wm97xx_probe,
.remove = palmz72_wm97xx_remove,
- .suspend = NULL,
- .resume = NULL
+ .suspend = palmz72_wm97xx_suspend,
+ .resume = palmz72_wm97xx_resume,
+ .shutdown = palmz72_wm97xx_shutdown
};
static int palmz72_ac_is_connected (void){
@@ -189,6 +214,7 @@
printk("Battery registered\n");
}
#ifdef CONFIG_APM
+ apm_get_power_status_orig = apm_get_power_status;
apm_get_power_status = palmz72_apm_get_power_status;
#endif
return driver_register(&palmz72_wm97xx_driver);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hap...@us...> - 2007-02-02 23:37:57
|
Revision: 790
http://svn.sourceforge.net/hackndev/?rev=790&view=rev
Author: happy-slapin
Date: 2007-02-02 15:37:44 -0800 (Fri, 02 Feb 2007)
Log Message:
-----------
z72: New battery infrastructure
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Makefile
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig 2007-02-02 09:01:13 UTC (rev 789)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig 2007-02-02 23:37:44 UTC (rev 790)
@@ -5,14 +5,6 @@
help
This enables support for PalmOne 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 PALMZ72_PM
tristate "Palm Zire 72 Power Management support"
depends on MACH_PALMZ72
@@ -22,10 +14,12 @@
config PALMZ72_BATTERY
tristate "Palm Zire 72 Battery support"
- depends on MACH_PALMZ72 && TOUCHSCREEN_WM97XX
- default n
+ select TOUCHSCREEN_WM97XX
+ depends on MACH_PALMZ72
+ default m
help
Enable support for PalmOne Zire 72 battery to APM.
+ ATM use it only as module, otherwise it hangs.
config GPIOED
tristate "GPIOED"
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Makefile
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Makefile 2007-02-02 09:01:13 UTC (rev 789)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Makefile 2007-02-02 23:37:44 UTC (rev 790)
@@ -3,7 +3,6 @@
#
obj-$(CONFIG_MACH_PALMZ72) += palmz72.o
-obj-$(CONFIG_PALMZ72_AC97) += palmz72_ac97.o
obj-$(CONFIG_PALMZ72_PM) += palmz72_pm.o
obj-$(CONFIG_PALMZ72_BATTERY) += palmz72_battery.o
obj-$(CONFIG_GPIOED) += gpioed.o
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c 2007-02-02 09:01:13 UTC (rev 789)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c 2007-02-02 23:37:44 UTC (rev 790)
@@ -1,9 +1,9 @@
/************************************************************************
- * linux/arch/arm/mach-pxa/palmz72/palmz72_ac97.c *
+ * linux/arch/arm/mach-pxa/palmz72/palmz72_battery.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 *
+ * Authos: Jan Herman <2h...@se...> *
+ * Sergey Lapin <sl...@ha...> *
* *
************************************************************************/
@@ -32,75 +32,22 @@
#include <sound/pcm.h>
#include <sound/initval.h>
#include <linux/wm97xx.h>
-//#include <sound/wm9712.h>
#include <asm/arch/palmz72-gpio.h>
#include <asm/arch/palmz72-init.h>
-#define palmz72_ac97_WORK_QUEUE_NAME "palmz72_ac97_workqueue"
-
-
-/*********************
- * Module parameters *
- *********************/
-static DECLARE_MUTEX(battery_update_mutex);
-
-//static struct work_struct palmz72_ac97_irq_task;
-
-//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;
-
-
-
-//EXPERIMENTAL DRIVER...
-
-/***********
- * Battery *
- ***********/
-
-
-void palmz72_battery_read_adc(unsigned long data)
+struct palmz72_battery_dev
{
- //unsigned long data;
- u16 vread;
- //int force;
-
- struct wm97xx *wm = (struct wm97xx*) data;
- //struct wm97xx* wm;
+ struct wm97xx * wm;
+ int battery_registered;
+ int current_voltage;
+ int previous_voltage;
+ u32 last_battery_update;
+};
- //if(wm == NULL) {
- // printk("Batt update error: struct wm97xx* wm is null!\n");
- // return;
- //}
+struct palmz72_battery_dev bat;
- //if(!force && ((last_battery_update + 10 *HZ) > jiffies))
- // return;
- //
- //if(down_trylock(&battery_update_mutex))
- // return;
-
- //aux_waiting:1;
- //vread = wm97xx_read_aux_adc(wm, WM97XX_AUX_ID3);
- vread = 1680; // THIS MUST READ AUX_ID3 on WM9712 -- for slapin.. other of battery works
-
- previous_voltage = current_voltage;
- current_voltage = vread & 0xfff;
- last_battery_update = jiffies;
-
- printk("Battery: %d\n", current_voltage);
-
- up(&battery_update_mutex);
-}
-
-
int palmz72_battery_min_voltage(struct battery *b)
{
return PALMZ72_BAT_MIN_VOLTAGE;
@@ -119,10 +66,12 @@
int palmz72_battery_get_voltage(struct battery *b)
{
- if (battery_registered){
- palmz72_battery_read_adc(0);
- printk("Battery [mV]: %d\n", current_voltage * 1889/1000 + 7678/10 );
- return current_voltage * 1889/1000 + 7678/10;
+ if (bat.battery_registered){
+ bat.previous_voltage = bat.current_voltage;
+ bat.current_voltage = wm97xx_read_aux_adc(bat.wm, TS_BMON);
+ bat.last_battery_update = jiffies;
+ printk("Battery [mV]: %d\n", bat.current_voltage * 1889/1000 + 7678/10 );
+ return bat.current_voltage * 1889/1000 + 7678/10;
}
else{
printk("palmz72_battery: cannot get voltage -> battery driver unregistered\n");
@@ -136,11 +85,11 @@
int ac_connected = GET_GPIO(GPIO_NR_PALMZ72_POWER_DETECT);
int usb_connected = !GET_GPIO(GPIO_NR_PALMZ72_USB_DETECT);
- if (current_voltage <= 0)
+ if (bat.current_voltage <= 0)
return BATTERY_STATUS_UNKNOWN;
if (ac_connected || usb_connected){
- if ( ( current_voltage > previous_voltage ) || (current_voltage <= PALMZ72_BAT_MAX_VOLTAGE) )
+ if ( ( bat.current_voltage > bat.previous_voltage ) || (bat.current_voltage <= PALMZ72_BAT_MAX_VOLTAGE) )
return BATTERY_STATUS_CHARGING;
return BATTERY_STATUS_NOT_CHARGING;
}
@@ -148,7 +97,6 @@
return BATTERY_STATUS_DISCHARGING;
}
-
struct battery palmz72_battery = {
.name = "palmz72_battery",
.id = "battery0",
@@ -158,8 +106,29 @@
.get_status = palmz72_battery_get_status,
};
+static int palmz72_wm97xx_probe(struct device *dev)
+{
+ struct wm97xx *wm = dev->driver_data;
+ bat.wm = wm;
+ return 0;
+}
+static int palmz72_wm97xx_remove(struct device *dev)
+{
+// struct wm97xx *wm = dev->driver_data;
+ return 0;
+}
+static struct device_driver palmz72_wm97xx_driver = {
+ .name = "wm97xx-touchscreen",
+ .bus = &wm97xx_bus_type,
+ .owner = THIS_MODULE,
+ .probe = palmz72_wm97xx_probe,
+ .remove = palmz72_wm97xx_remove,
+ .suspend = NULL,
+ .resume = NULL
+};
+
static int palmz72_ac_is_connected (void){
/* when charger is plugged in and USB is not connected, then status is ONLINE */
int ret = (!(GET_GPIO(GPIO_NR_PALMZ72_USB_PULLUP)) && !(GET_GPIO(GPIO_NR_PALMZ72_USB_DETECT)));;
@@ -171,17 +140,16 @@
return ret;
}
-/*******
- * APM *
- *******/
-
+#ifdef CONFIG_APM
+
+/* APM status query callback implementation */
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 = palmz72_battery_get_voltage(&palmz72_battery);
+ min = palmz72_battery_min_voltage(&palmz72_battery);
+ max = palmz72_battery_max_voltage(&palmz72_battery);
curr = curr - min;
if (curr < 0) curr = 0;
@@ -207,50 +175,36 @@
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)
+#endif
+static int __init palmz72_wm97xx_init(void)
{
- apm_get_power_status = t;
+ /* register battery to APM layer */
+ bat.battery_registered = 0;
- return 0;
-}
-
-
-/* end of APM implementing */
-
-
-
-static int __init palmz72_ac97_init(void)
-{
-
-/* register battery to APM layer */
-
- if(battery_class_register(&palmz72_battery)) {
- printk(KERN_ERR "palmz72_ac97_probe: could not register battery class\n");
- }
- else{
- battery_registered = 1;
- printk("Battery registered\n");
- }
-#ifdef CONFIG_PM
- apm_get_power_status = palmz72_apm_get_power_status;
- return 0;
+ if(battery_class_register(&palmz72_battery)) {
+ printk(KERN_ERR "palmz72_ac97_probe: could not register battery class\n");
+ }
+ else {
+ bat.battery_registered = 1;
+ printk("Battery registered\n");
+ }
+#ifdef CONFIG_APM
+ apm_get_power_status = palmz72_apm_get_power_status;
#endif
-
+ return driver_register(&palmz72_wm97xx_driver);
}
-
-static void __exit palmz72_ac97_exit(void)
+static void __exit palmz72_wm97xx_exit(void)
{
- driver_unregister(&palmz72_battery);
+/* TODO - recover APM callback to original state */
+ battery_class_unregister(&palmz72_battery);
+ driver_unregister(&palmz72_wm97xx_driver);
}
+module_init(palmz72_wm97xx_init);
+module_exit(palmz72_wm97xx_exit);
-module_init(palmz72_ac97_init);
-module_exit(palmz72_ac97_exit);
-
-MODULE_AUTHOR ("Jan Herman <2h...@se...>");
-MODULE_DESCRIPTION ("WM9712 battery support for PalmOne Zire 72");
-MODULE_LICENSE ("GPL");
+/* Module information */
+MODULE_AUTHOR("Sergey Lapin <sl...@ha...> Jan Herman <2h...@se...>");
+MODULE_DESCRIPTION("wm97xx battery driver for Palm 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-02-02 09:01:17
|
Revision: 789
http://svn.sourceforge.net/hackndev/?rev=789&view=rev
Author: z72ka
Date: 2007-02-02 01:01:13 -0800 (Fri, 02 Feb 2007)
Log Message:
-----------
Palmz72: Added dependency for BMON to WM97XX touchscreen
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig 2007-02-02 07:08:34 UTC (rev 788)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig 2007-02-02 09:01:13 UTC (rev 789)
@@ -22,10 +22,10 @@
config PALMZ72_BATTERY
tristate "Palm Zire 72 Battery support"
- depends on MACH_PALMZ72
- default y if MACH_PALMZ72
+ depends on MACH_PALMZ72 && TOUCHSCREEN_WM97XX
+ default n
help
- Battery.
+ Enable support for PalmOne Zire 72 battery to APM.
config GPIOED
tristate "GPIOED"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ph...@us...> - 2007-02-02 07:08:37
|
Revision: 788
http://svn.sourceforge.net/hackndev/?rev=788&view=rev
Author: phiren
Date: 2007-02-01 23:08:34 -0800 (Thu, 01 Feb 2007)
Log Message:
-----------
Added support for the Palm Zire 31
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/Kconfig
linux4palm/linux/trunk/arch/arm/mach-pxa/Makefile
Added Paths:
-----------
linux4palm/linux/trunk/arch/arm/configs/palmz31_defconfig
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/Kconfig
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/Makefile
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31-gpio.h
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31.c
Added: linux4palm/linux/trunk/arch/arm/configs/palmz31_defconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/configs/palmz31_defconfig (rev 0)
+++ linux4palm/linux/trunk/arch/arm/configs/palmz31_defconfig 2007-02-02 07:08:34 UTC (rev 788)
@@ -0,0 +1,925 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.17-hnd0
+# Fri Feb 2 17:11:17 2007
+#
+CONFIG_ARM=y
+CONFIG_MMU=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ARCH_MTD_XIP=y
+CONFIG_VECTORS_BASE=0xffff0000
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+# CONFIG_SWAP is not set
+# CONFIG_SYSVIPC is not set
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+# CONFIG_MINIMAL_OOPS is not set
+# CONFIG_RELAY is not set
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_UID16=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_EMBEDDED=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SHMEM=y
+CONFIG_USELIB=y
+CONFIG_CORE_DUMP=y
+# CONFIG_SLAB is not set
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_SLOB=y
+
+#
+# Loadable module support
+#
+# CONFIG_MODULES is not set
+
+#
+# Block layer
+#
+# CONFIG_BLK_DEV_IO_TRACE is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_AS is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_NOOP=y
+CONFIG_DEFAULT_IOSCHED="noop"
+
+#
+# System Type
+#
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_IOP3XX is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_L7200 is not set
+CONFIG_ARCH_PXA=y
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_OMAP is not set
+# CONFIG_ARCH_VERSATILE is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_AT91RM9200 is not set
+
+#
+# Intel PXA2xx Implementations
+#
+# CONFIG_ARCH_LUBBOCK is not set
+# CONFIG_MACH_LOGICPD_PXA270 is not set
+# CONFIG_MACH_MAINSTONE is not set
+# CONFIG_ARCH_PXA_IDP is not set
+# CONFIG_ARCH_ESERIES is not set
+# CONFIG_MACH_A620 is not set
+# CONFIG_MACH_A716 is not set
+# CONFIG_ARCH_H1900 is not set
+# CONFIG_ARCH_H2200 is not set
+# CONFIG_ARCH_H3900 is not set
+# CONFIG_MACH_H4000 is not set
+# CONFIG_MACH_H4700 is not set
+# CONFIG_MACH_HX2750 is not set
+# CONFIG_ARCH_H5400 is not set
+# CONFIG_MACH_HIMALAYA is not set
+# CONFIG_MACH_HTCUNIVERSAL is not set
+# CONFIG_MACH_HTCALPINE is not set
+# CONFIG_MACH_MAGICIAN is not set
+# CONFIG_MACH_HTCAPACHE is not set
+# CONFIG_MACH_BLUEANGEL is not set
+# CONFIG_MACH_HTCBEETLES is not set
+# CONFIG_ARCH_AXIMX5 is not set
+# CONFIG_ARCH_AXIMX3 is not set
+# CONFIG_ARCH_ROVERP1 is not set
+# 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_T700WX 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 is not set
+# CONFIG_MACH_OMAP_PALMTC is not set
+CONFIG_MACH_ZIRE31=y
+# CONFIG_PXA_SHARPSL is not set
+CONFIG_PXA25x=y
+CONFIG_PXA_RTC_EPOCH=1970
+# CONFIG_SA1100_H3100 is not set
+# CONFIG_SA1100_H3600 is not set
+# CONFIG_SA1100_H3800 is not set
+
+#
+# Linux As Bootloader
+#
+# CONFIG_LAB is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_XSCALE=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5T=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_TLB_V4WBI=y
+
+#
+# Processor Features
+#
+# CONFIG_ARM_THUMB is not set
+# CONFIG_ARMBOOT_PROC is not set
+CONFIG_XSCALE_PMU=y
+# CONFIG_KEXEC is not set
+
+#
+# Compaq/iPAQ Platforms
+#
+
+#
+# Compaq/iPAQ Drivers
+#
+
+#
+# Compaq/HP iPAQ Drivers
+#
+# CONFIG_IPAQ_HAMCOP is not set
+
+#
+# Bus support
+#
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+# CONFIG_PREEMPT is not set
+# CONFIG_NO_IDLE_HZ is not set
+CONFIG_HZ=100
+# CONFIG_AEABI is not set
+# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="mem=64m root=/dev/nfs rw nfsroot=/tc ip=:::255.255.255.0::usb0:dhcp init=/linuxrc console=tty0"
+# CONFIG_XIP_KERNEL is not set
+
+#
+# CPU Frequency scaling
+#
+# CONFIG_CPU_FREQ is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_NWFPE_XP is not set
+# CONFIG_FPE_FASTFPE is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_ARTHUR is not set
+
+#
+# Power management options
+#
+# CONFIG_PM is not set
+# CONFIG_APM is not set
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+# CONFIG_NETDEBUG is not set
+# CONFIG_PACKET is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+# CONFIG_IP_PNP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_DIAG is not set
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_BIC=y
+# CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETFILTER is not set
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_IEEE80211 is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+# CONFIG_FW_LOADER is not set
+# CONFIG_DEBUG_DRIVER is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# I2O device support
+#
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+
+#
+# PHY device support
+#
+
+#
+# Ethernet (10 or 100Mbit)
+#
+# CONFIG_NET_ETHERNET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+
+#
+# Ethernet (10000 Mbit)
+#
+
+#
+# Token Ring devices
+#
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_LIBPS2 is not set
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_PXA=y
+# CONFIG_SERIAL_PXA_CONSOLE is not set
+CONFIG_SERIAL_PXA_COUNT=4
+CONFIG_SERIAL_CORE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# L3 serial bus support
+#
+# CONFIG_L3 is not set
+
+#
+# Mice
+#
+# CONFIG_BUSMOUSE is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_SA1100_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_BITBANG=y
+CONFIG_SPI_PXA2XX=y
+
+#
+# SPI Protocol Masters
+#
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+# CONFIG_HWMON is not set
+# CONFIG_HWMON_VID is not set
+
+#
+# SoC drivers
+#
+# CONFIG_SOC_MQ11XX is not set
+# CONFIG_SOC_T7L66XB is not set
+# CONFIG_SOC_TC6387XB is not set
+# CONFIG_SOC_TC6393XB is not set
+# CONFIG_HTC_ASIC2 is not set
+# CONFIG_HTC_ASIC3 is not set
+
+#
+# Misc devices
+#
+# CONFIG_BATTERY_MONITOR is not set
+# CONFIG_BATTCHARGE_MONITOR is not set
+
+#
+# Multimedia Capabilities Port drivers
+#
+# CONFIG_MCP is not set
+
+#
+# LED devices
+#
+# CONFIG_NEW_LEDS is not set
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+CONFIG_VIDEO_V4L2=y
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+CONFIG_FB=y
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_FIRMWARE_EDID is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+# 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_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
+CONFIG_FONTS=y
+# CONFIG_FONT_8x8 is not set
+# CONFIG_FONT_8x16 is not set
+CONFIG_FONT_6x11=y
+# CONFIG_FONT_7x14 is not set
+# CONFIG_FONT_PEARL_8x8 is not set
+# CONFIG_FONT_ACORN_8x8 is not set
+# CONFIG_FONT_MINI_4x6 is not set
+# CONFIG_FONT_SUN8x16 is not set
+# CONFIG_FONT_SUN12x22 is not set
+# CONFIG_FONT_10x18 is not set
+
+#
+# Logo configuration
+#
+# CONFIG_LOGO is not set
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_DEVICE=y
+# CONFIG_BACKLIGHT_CORGI is not set
+CONFIG_BACKLIGHT_PXAPWM=y
+CONFIG_LCD_CLASS_DEVICE=y
+CONFIG_LCD_DEVICE=y
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+# CONFIG_USB_ARCH_HAS_OHCI is not set
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+# CONFIG_USB is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# USB Gadget Support
+#
+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=y
+CONFIG_USB_PXA2XX=y
+CONFIG_USB_PXA2XX_SMALL=y
+# CONFIG_USB_GADGET_PXA27X is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_MQ11XX is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+# CONFIG_USB_GADGET_DUALSPEED is not set
+# CONFIG_USB_ZERO is not set
+CONFIG_USB_ETH=y
+# CONFIG_USB_ETH_RNDIS is not set
+# CONFIG_USB_GADGETFS is not set
+# CONFIG_USB_FILE_STORAGE is not set
+# CONFIG_USB_G_SERIAL is not set
+# CONFIG_USB_G_CHAR is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# Real Time Clock
+#
+CONFIG_RTC_LIB=y
+# CONFIG_RTC_CLASS is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP 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
+# CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_INOTIFY is not set
+# CONFIG_QUOTA is not set
+# CONFIG_DNOTIFY is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+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
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+CONFIG_SQUASHFS=y
+# CONFIG_SQUASHFS_EMBEDDED is not set
+CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
+# CONFIG_SQUASHFS_VMALLOC is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_UNION_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+# 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=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+# 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
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+# CONFIG_9P_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+CONFIG_NLS_CODEPAGE_850=y
+CONFIG_NLS_CODEPAGE_852=y
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+CONFIG_NLS_ISO8859_15=y
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_UTF8 is not set
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_SMALLOOPS is not set
+CONFIG_DEBUG_KERNEL=y
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_DETECT_SOFTLOCKUP is not set
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_DEBUG_VM is not set
+CONFIG_FRAME_POINTER=y
+# CONFIG_UNWIND_INFO is not set
+# CONFIG_FORCED_INLINING is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_DEBUG_USER is not set
+# CONFIG_DEBUG_WAITQ is not set
+# CONFIG_DEBUG_ERRORS is not set
+# CONFIG_DEBUG_LL is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/Kconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/Kconfig 2007-01-31 20:14:56 UTC (rev 787)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/Kconfig 2007-02-02 07:08:34 UTC (rev 788)
@@ -51,6 +51,7 @@
source "arch/arm/mach-pxa/palmtx/Kconfig"
source "arch/arm/mach-pxa/palmz72/Kconfig"
source "arch/arm/mach-pxa/palmtc/Kconfig"
+source "arch/arm/mach-pxa/palmz31/Kconfig"
config PXA_SHARPSL
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/Makefile
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/Makefile 2007-01-31 20:14:56 UTC (rev 787)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/Makefile 2007-02-02 07:08:34 UTC (rev 788)
@@ -48,6 +48,7 @@
obj-$(CONFIG_MACH_PALMZ72) += palmz72/
obj-$(CONFIG_MACH_TUNGE2) += palmte2/
obj-$(CONFIG_MACH_OMAP_PALMTC) += ssp.o palmtc/
+obj-$(CONFIG_MACH_ZIRE31) += palmz31/
# Support for blinky lights
led-y := leds.o
Added: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/Kconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/Kconfig (rev 0)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/Kconfig 2007-02-02 07:08:34 UTC (rev 788)
@@ -0,0 +1,6 @@
+menuconfig MACH_ZIRE31
+ bool "Palm Zire 31"
+ select PXA25x
+ help
+ Say Y here if you are going to run this kernel on a Palm Zire 31.
+
Added: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/Makefile
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/Makefile (rev 0)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/Makefile 2007-02-02 07:08:34 UTC (rev 788)
@@ -0,0 +1,5 @@
+#
+# Makefile for Palm Zire 31 support
+#
+
+obj-$(CONFIG_MACH_ZIRE31) += palmz31.o
Added: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31-gpio.h
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31-gpio.h (rev 0)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31-gpio.h 2007-02-02 07:08:34 UTC (rev 788)
@@ -0,0 +1,16 @@
+/*
+ * palmz31-gpio.h
+ *
+ * Author: Scott Manell <ph...@gm...>
+ *
+ */
+
+#ifndef _ZIRE31_GPIO_H_
+#define _ZIRE31_GPIO_H_
+
+#include <asm/arch/pxa-regs.h>
+
+// This should let us get usb working
+#define GPIO_NR_PALMLD_USB_DETECT 4
+
+#endif
Added: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31.c (rev 0)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz31/palmz31.c 2007-02-02 07:08:34 UTC (rev 788)
@@ -0,0 +1,70 @@
+/*
+ * Hardware definitions for Palm Zire 31
+ *
+ * Author: Scott Mansell <ph...@gm...>
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <asm/mach/arch.h>
+#include <asm/mach-types.h>
+#include <asm/arch/hardware.h>
+#include <asm/mach/map.h>
+#include <asm/domain.h>
+
+#include <linux/device.h>
+#include <linux/platform_device.h>
+#include <linux/fb.h>
+
+#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 "palmz31-gpio.h"
+#define DEBUG
+
+
+static void zire31_backlight_power(int on)
+{
+ /* TODO */
+}
+
+static struct pxafb_mach_info zire31_lcd __initdata = {
+ .pixclock = 0,
+ .xres = 160,
+ .yres = 160,
+ .bpp = 16,
+ .hsync_len = 4,
+ .left_margin = 30,
+ .right_margin = 7,
+ .vsync_len = 1,
+ .upper_margin = 6,
+ .lower_margin = 7,
+ .sync = FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT,
+
+ .lccr0 = 0x00100079,
+ .lccr3 = 0x03403d30,
+
+ .pxafb_backlight_power = zire31_backlight_power,
+};
+
+static void __init zire31_int(void)
+{
+ set_pxa_fb_info(&zire31_lcd);
+
+ GCR &= ~GCR_PRIRDY_IEN;
+}
+
+MACHINE_START(ZIRE31, "Zire 31")
+ .phys_io = 0x40000000,
+ .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
+ .map_io = pxa_map_io,
+ .init_irq = pxa_init_irq,
+ .timer = &pxa_timer,
+ .init_machine = zire31_int
+MACHINE_END
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <z7...@us...> - 2007-01-31 20:16:02
|
Revision: 787
http://svn.sourceforge.net/hackndev/?rev=787&view=rev
Author: z72ka
Date: 2007-01-31 12:14:56 -0800 (Wed, 31 Jan 2007)
Log Message:
-----------
Palmz72: Added new experimental driver for battery monitor based on latest WM9712 driver
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/palmz72_battery.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig 2007-01-31 18:52:36 UTC (rev 786)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig 2007-01-31 20:14:56 UTC (rev 787)
@@ -19,6 +19,13 @@
default y if MACH_PALMZ72
help
Enable support for suspend/resume the PalmOne Zire 72 PDA.
+
+config PALMZ72_BATTERY
+ tristate "Palm Zire 72 Battery support"
+ depends on MACH_PALMZ72
+ default y if MACH_PALMZ72
+ help
+ Battery.
config GPIOED
tristate "GPIOED"
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Makefile
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Makefile 2007-01-31 18:52:36 UTC (rev 786)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Makefile 2007-01-31 20:14:56 UTC (rev 787)
@@ -5,5 +5,6 @@
obj-$(CONFIG_MACH_PALMZ72) += palmz72.o
obj-$(CONFIG_PALMZ72_AC97) += palmz72_ac97.o
obj-$(CONFIG_PALMZ72_PM) += palmz72_pm.o
+obj-$(CONFIG_PALMZ72_BATTERY) += palmz72_battery.o
obj-$(CONFIG_GPIOED) += gpioed.o
obj-$(CONFIG_GPIOEDNG) += gpioed-ng.o
Added: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c (rev 0)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_battery.c 2007-01-31 20:14:56 UTC (rev 787)
@@ -0,0 +1,256 @@
+/************************************************************************
+ * 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 <linux/wm97xx.h>
+//#include <sound/wm9712.h>
+#include <asm/arch/palmz72-gpio.h>
+#include <asm/arch/palmz72-init.h>
+
+
+#define palmz72_ac97_WORK_QUEUE_NAME "palmz72_ac97_workqueue"
+
+
+/*********************
+ * Module parameters *
+ *********************/
+static DECLARE_MUTEX(battery_update_mutex);
+
+//static struct work_struct palmz72_ac97_irq_task;
+
+//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;
+
+
+
+//EXPERIMENTAL DRIVER...
+
+/***********
+ * Battery *
+ ***********/
+
+
+void palmz72_battery_read_adc(unsigned long data)
+{
+ //unsigned long data;
+ u16 vread;
+ //int force;
+
+ struct wm97xx *wm = (struct wm97xx*) data;
+ //struct wm97xx* wm;
+
+ //if(wm == NULL) {
+ // printk("Batt update error: struct wm97xx* wm is null!\n");
+ // return;
+ //}
+
+ //if(!force && ((last_battery_update + 10 *HZ) > jiffies))
+ // return;
+ //
+ //if(down_trylock(&battery_update_mutex))
+ // return;
+
+ //aux_waiting:1;
+ //vread = wm97xx_read_aux_adc(wm, WM97XX_AUX_ID3);
+
+ vread = 1680; // THIS MUST READ AUX_ID3 on WM9712 -- for slapin.. other of battery works
+
+ previous_voltage = current_voltage;
+ current_voltage = vread & 0xfff;
+ last_battery_update = jiffies;
+
+ printk("Battery: %d\n", current_voltage);
+
+ 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 */
+}
+
+/*
+ This formula is based on battery life of my battery 1100mAh. Original battery in Zire72 is Li-On 920mAh
+ 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 * 1889/1000 + 7678/10 );
+ 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){
+ 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 palmz72_ac_is_connected (void){
+ /* when charger is plugged in and USB is not connected, then status is ONLINE */
+ int ret = (!(GET_GPIO(GPIO_NR_PALMZ72_USB_PULLUP)) && !(GET_GPIO(GPIO_NR_PALMZ72_USB_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 __init palmz72_ac97_init(void)
+{
+
+/* register battery to APM layer */
+
+ if(battery_class_register(&palmz72_battery)) {
+ printk(KERN_ERR "palmz72_ac97_probe: could not register battery class\n");
+ }
+ else{
+ battery_registered = 1;
+ printk("Battery registered\n");
+ }
+#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_battery);
+}
+
+
+module_init(palmz72_ac97_init);
+module_exit(palmz72_ac97_exit);
+
+MODULE_AUTHOR ("Jan Herman <2h...@se...>");
+MODULE_DESCRIPTION ("WM9712 battery 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: <hap...@us...> - 2007-01-31 18:52:39
|
Revision: 786
http://svn.sourceforge.net/hackndev/?rev=786&view=rev
Author: happy-slapin
Date: 2007-01-31 10:52:36 -0800 (Wed, 31 Jan 2007)
Log Message:
-----------
z72: Preparations for delayed resume
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c 2007-01-30 12:54:28 UTC (rev 785)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c 2007-01-31 18:52:36 UTC (rev 786)
@@ -24,11 +24,15 @@
#include <asm/arch/pxa-regs.h>
#include <asm/arch/palmz72-gpio.h>
+#include <asm/arch/pxa27x_keyboard.h>
+#define KPASMKP(col) (col/2==0 ? KPASMKP0 : col/2==1 ? KPASMKP1 : col/2==2 ? KPASMKP2 : KPASMKP3)
+#define KPASMKPx_MKC(row, col) (1 << (row + 16*(col%2)))
+
struct pm_save_data
{
int brightness;
- u32 jiffies;
+ u32 rcnr;
};
static struct pm_save_data pm_save_data;
@@ -36,24 +40,25 @@
#ifdef CONFIG_PM
static int palmz72_suspend(struct device *dev, pm_message_t state)
{
- /* Wake-Up on Voice memo button - GPIO 13 */
- PWER |= PWER_GPIO13 | PWER_RTC | PWER_WEP1;
+ /* Wake-Up on RTC event, etc. */
+ PWER |= PWER_RTC | PWER_WEP1;
/* Wakeup by keyboard :) */
- PKWR |= 0xe0000;
+ PKWR = 0xe0001;
- PRER |= PWER_GPIO13;
/* Enabled Deep-Sleep mode ?? */
PCFR |= PCFR_DS;
/* Low power mode */
PCFR |= PCFR_OPDE;
+
+ /* 3.6.8.1 */
+ while(!(OSCC & OSCC_OOK))
+ {}
/* Here are all of special for suspend PalmOne Zire 72 */
//printk("Palmz72_suspend: suspending...");
- SET_PALMZ72_GPIO(LED, 0);
-
/* Turn off LCD power */
SET_PALMZ72_GPIO(LCD_POWER,0);
/* Turn off USB power */
@@ -83,8 +88,6 @@
/* Turn on USB power */
SET_PALMZ72_GPIO(USB_POWER,1);
- SET_PALMZ72_GPIO(LED, 1);
-
return 0;
}
#else
@@ -108,41 +111,83 @@
.resume = palmz72_pxa_ll_pm_resume,
};
-static int (*pxa_pm_enter)(suspend_state_t state);
+static int (*pxa_pm_enter_orig)(suspend_state_t state);
+#define KBD_ROWS 4
+#define KBD_COLS 3
+#if 0
+static int check_buttons(void)
+{
+ int data = 0, row, col;
+ u32 storekpc = KPC;
+
+ data = GET_GPIO(GPIO_NR_PALMZ72_KP_DKIN7) && 1;
+
+ pxa_set_cken(CKEN19_KEYPAD, 1);
-static void zire72_goto_sleep(suspend_state_t state)
-{
- pxa_pm_enter(state);
+ KPC |= KBD_ROWS << 26;
+ KPC |= KBD_COLS << 23;
+
+ KPC &= ~(KPC_ASACT|KPC_AS|KPC_IMKP|KPC_DE|KPC_DIE|KPC_MIE);
+
+ /* Processing automatic scan once */
+ KPC |= KPC_ME | KPC_AS;
+
+ for (row=0; row < KBD_ROWS; row++) {
+ for (col=0; col < KBD_COLS; col++) {
+ data |= (KPASMKP(col) & KPASMKPx_MKC(row, col) && 1) << 2;
+ }
+ }
+
+
+// pxa_set_cken(CKEN19_KEYPAD, 0);
+ KPC = storekpc;
+ return data;
}
-
+#endif
static int zire72_enter_suspend(suspend_state_t state)
{
/* Here we should implement wakeup conditions
If we have none, just return 1 to continue
sleeping */
- if(PKSR & 0x00001) {
- printk(KERN_NOTICE "Returning from sleep due to GPIO13\n");
- return 0;
- }
- if(jiffies < ( pm_save_data.jiffies + msecs_to_jiffies(5000))) {
- if(!(PKSR & 0xe0001))
- pm_save_data.jiffies = jiffies;
- zire72_goto_sleep(state);
+ int data = 0;
+
+ /* Do not suspend on active keypress */
+#if 0
+ if(check_buttons())
return 1;
+#endif
+ pxa_pm_enter_orig(state);
+
+#if 0
+ if(!pm_save_data.rcnr) pm_save_data.rcnr = RCNR;
+ while(RCNR < ( pm_save_data.rcnr + 3)) {
+
+ /* If we release button, sleep back */
+ if(!(data = check_buttons())) {
+ pm_save_data.rcnr = 0;
+ return 1;
+ }
}
- if(PKSR & 0xe0001) {
- printk(KERN_NOTICE "Returning from sleep due to GPIOs 100-102 or 13\n");
- return 0;
- }
- return 1;
+#endif
+ printk(KERN_NOTICE "Returning from sleep due to GPIOs 100-102 or 13\n");
+ printk(KERN_NOTICE "RCNR = %u pm_save_data.rcnr = %u\n", RCNR, pm_save_data.rcnr);
+ printk(KERN_NOTICE "Keys pressed: %d\n", data);
+ pm_save_data.rcnr = 0;
+ return 0;
}
static int zire72_pxa_pm_enter(suspend_state_t state)
{
- pm_save_data.jiffies = jiffies;
- zire72_goto_sleep(state);
+ pm_save_data.rcnr = 0;
+#if 0
+ /* Do not suspend on active keypress */
+ if(check_buttons())
+ return 0;
+#endif
+ pxa_pm_enter_orig(state);
+
while (zire72_enter_suspend(state))
{}
return 0;
@@ -160,9 +205,6 @@
static int palmz72_pm_probe(struct device *dev)
{
- pm_save_data.jiffies = jiffies;
- pxa_pm_enter = pxa_pm_ops.enter;
- pm_set_ops(&zire72_pm_ops);
printk(KERN_NOTICE "PalmOne Zire72 power management driver registered\n");
return 0;
}
@@ -177,18 +219,20 @@
static int __init palmz72_pm_init(void)
{
+ pxa_pm_enter_orig = pxa_pm_ops.enter;
+ pxa_pm_ops.enter = zire72_pxa_pm_enter;
return driver_register(&palmz72_pm_driver);
}
static void __exit palmz72_pm_exit(void)
{
- pxa_pm_ops.enter = pxa_pm_enter;
+ pxa_pm_ops.enter = pxa_pm_enter_orig;
driver_unregister(&palmz72_pm_driver);
}
module_init(palmz72_pm_init);
module_exit(palmz72_pm_exit);
-MODULE_AUTHOR("Jan Herman <2h...@se...>");
+MODULE_AUTHOR("Jan Herman <2h...@se...>, Sergey Lapin <sla...@gm...>");
MODULE_DESCRIPTION("PalmOne Zire 72 power management driver");
MODULE_LICENSE("GPL");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hap...@us...> - 2007-01-30 12:54:30
|
Revision: 785
http://svn.sourceforge.net/hackndev/?rev=785&view=rev
Author: happy-slapin
Date: 2007-01-30 04:54:28 -0800 (Tue, 30 Jan 2007)
Log Message:
-----------
z72: Initial attempt to follow corgi steps with PM driver
z72: Added Zire 72 to line with MEM = STANDBY. Btw is this line really
working for other machines? Seems not... So I fixed hanging issue with
GPE.
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c
linux4palm/linux/trunk/arch/arm/mach-pxa/pxa27x.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c 2007-01-29 19:42:21 UTC (rev 784)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c 2007-01-30 12:54:28 UTC (rev 785)
@@ -1,8 +1,8 @@
/************************************************************************
* PalmOne Zire72 suspend/resume support *
* *
- * Authos: Jan Herman <2h...@se...> *
- * Sergey Lapin <sla...@gm...> *
+ * Authors: Jan Herman <2h...@se...> *
+ * Sergey Lapin <sla...@gm...> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License version 2 as *
@@ -18,17 +18,21 @@
#include <asm/mach-types.h>
#include <asm/hardware.h>
+#include <asm/arch/pm.h>
#include <asm/arch/pxa-pm_ll.h>
#include <asm/arch/hardware.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/palmz72-gpio.h>
-typedef struct
+struct pm_save_data
{
int brightness;
-} pm_save_data;
+ u32 jiffies;
+};
+static struct pm_save_data pm_save_data;
+
#ifdef CONFIG_PM
static int palmz72_suspend(struct device *dev, pm_message_t state)
{
@@ -42,13 +46,19 @@
/* Enabled Deep-Sleep mode ?? */
PCFR |= PCFR_DS;
+ /* Low power mode */
+ PCFR |= PCFR_OPDE;
+
/* Here are all of special for suspend PalmOne Zire 72 */
//printk("Palmz72_suspend: suspending...");
+ SET_PALMZ72_GPIO(LED, 0);
+
/* Turn off LCD power */
SET_PALMZ72_GPIO(LCD_POWER,0);
/* Turn off USB power */
SET_PALMZ72_GPIO(USB_POWER,0);
+
/* disable GPIO reset - DO NOT REMOVE! */
PCFR &= PCFR_GPR_EN;
@@ -59,7 +69,6 @@
static int palmz72_resume(struct device *dev)
{
-
/* Disabled Deep-Sleep mode ?? */
PCFR &= PCFR_DS;
@@ -73,6 +82,8 @@
SET_PALMZ72_GPIO(LCD_POWER,1);
/* Turn on USB power */
SET_PALMZ72_GPIO(USB_POWER,1);
+
+ SET_PALMZ72_GPIO(LED, 1);
return 0;
}
@@ -97,8 +108,61 @@
.resume = palmz72_pxa_ll_pm_resume,
};
+static int (*pxa_pm_enter)(suspend_state_t state);
+
+static void zire72_goto_sleep(suspend_state_t state)
+{
+ pxa_pm_enter(state);
+}
+
+static int zire72_enter_suspend(suspend_state_t state)
+{
+ /* Here we should implement wakeup conditions
+ If we have none, just return 1 to continue
+ sleeping */
+ if(PKSR & 0x00001) {
+ printk(KERN_NOTICE "Returning from sleep due to GPIO13\n");
+ return 0;
+ }
+ if(jiffies < ( pm_save_data.jiffies + msecs_to_jiffies(5000))) {
+ if(!(PKSR & 0xe0001))
+ pm_save_data.jiffies = jiffies;
+ zire72_goto_sleep(state);
+ return 1;
+ }
+ if(PKSR & 0xe0001) {
+ printk(KERN_NOTICE "Returning from sleep due to GPIOs 100-102 or 13\n");
+ return 0;
+ }
+ return 1;
+}
+
+
+static int zire72_pxa_pm_enter(suspend_state_t state)
+{
+ pm_save_data.jiffies = jiffies;
+ zire72_goto_sleep(state);
+
+ while (zire72_enter_suspend(state))
+ {}
+ return 0;
+}
+
+
+static struct pm_ops zire72_pm_ops = {
+ .pm_disk_mode = PM_DISK_FIRMWARE,
+ .prepare = pxa_pm_prepare,
+ .enter = zire72_pxa_pm_enter,
+ .finish = pxa_pm_finish,
+};
+
+extern struct pm_ops pxa_pm_ops;
+
static int palmz72_pm_probe(struct device *dev)
{
+ pm_save_data.jiffies = jiffies;
+ pxa_pm_enter = pxa_pm_ops.enter;
+ pm_set_ops(&zire72_pm_ops);
printk(KERN_NOTICE "PalmOne Zire72 power management driver registered\n");
return 0;
}
@@ -118,6 +182,7 @@
static void __exit palmz72_pm_exit(void)
{
+ pxa_pm_ops.enter = pxa_pm_enter;
driver_unregister(&palmz72_pm_driver);
}
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/pxa27x.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/pxa27x.c 2007-01-29 19:42:21 UTC (rev 784)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/pxa27x.c 2007-01-30 12:54:28 UTC (rev 785)
@@ -139,7 +139,7 @@
{
extern void pxa_cpu_standby(void);
extern void pxa_cpu_suspend(unsigned int);
-#if defined(MACH_XSCALE_PALMLD) || defined(MACH_XSCALE_PALMTX)
+#if defined(MACH_XSCALE_PALMLD) || defined(MACH_XSCALE_PALMTX) || defined(CONFIG_MACH_PALMZ72)
/* For safety. suspend_mem puts the device in an unresetable state.
* On TX one needs to desolder the battery to get out of it.
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hap...@us...> - 2007-01-29 19:57:13
|
Revision: 784
http://svn.sourceforge.net/hackndev/?rev=784&view=rev
Author: happy-slapin
Date: 2007-01-29 11:42:21 -0800 (Mon, 29 Jan 2007)
Log Message:
-----------
z72: Fixed header
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c 2007-01-29 19:17:25 UTC (rev 783)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_pm.c 2007-01-29 19:42:21 UTC (rev 784)
@@ -1,9 +1,9 @@
/************************************************************************
* PalmOne Zire72 suspend/resume support *
* *
- * Author: Jan Herman <2h...@se...> *
+ * Authos: Jan Herman <2h...@se...> *
+ * Sergey Lapin <sla...@gm...> *
* *
- * *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License version 2 as *
* published by the Free Software Foundation. *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|