summaryrefslogtreecommitdiff
path: root/library
authorllornkcor <llornkcor>2002-04-24 19:37:47 (UTC)
committer llornkcor <llornkcor>2002-04-24 19:37:47 (UTC)
commitfeaa245515b0746f6f70f590411c38e0a54c88ee (patch) (unidiff)
tree352ab6e61ea8e773d9f08f77db0ca36984c62c1d /library
parent17eb865ad8248b1f47c565b074b9b6bbbd44935b (diff)
downloadopie-feaa245515b0746f6f70f590411c38e0a54c88ee.zip
opie-feaa245515b0746f6f70f590411c38e0a54c88ee.tar.gz
opie-feaa245515b0746f6f70f590411c38e0a54c88ee.tar.bz2
enable keyclicks and touchsound on zaurus
Diffstat (limited to 'library') (more/less context) (ignore whitespace changes)
-rw-r--r--library/custom-sharp.h33
1 files changed, 18 insertions, 15 deletions
diff --git a/library/custom-sharp.h b/library/custom-sharp.h
index f65d474..08f8a6f 100644
--- a/library/custom-sharp.h
+++ b/library/custom-sharp.h
@@ -39,7 +39,7 @@
39#define SHARP_DEV_IOCTL_COMMAND_START 0x5680 39#define SHARP_DEV_IOCTL_COMMAND_START 0x5680
40 40
41/* --- for SHARP_BUZZER device --- */ 41/* --- for SHARP_BUZZER device --- */
42 #defineSHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) 42#define SHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START)
43#define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) 43#define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START)
44#define SHARP_BUZZER_SETVOLUME (SHARP_BUZZER_IOCTL_START+1) 44#define SHARP_BUZZER_SETVOLUME (SHARP_BUZZER_IOCTL_START+1)
45#define SHARP_BUZZER_GETVOLUME (SHARP_BUZZER_IOCTL_START+2) 45#define SHARP_BUZZER_GETVOLUME (SHARP_BUZZER_IOCTL_START+2)
@@ -70,6 +70,9 @@
70} 70}
71 71
72#define CUSTOM_SOUND_ALARM CUSTOM_BUZZER( SHARP_BUZ_SCHEDULE_ALARM ) 72#define CUSTOM_SOUND_ALARM CUSTOM_BUZZER( SHARP_BUZ_SCHEDULE_ALARM )
73#define CUSTOM_SOUND_KEYCLICK CUSTOM_BUZZER( SHARP_BUZ_KEYSOUND )
74#define CUSTOM_SOUND_TOUCH CUSTOM_BUZZER( SHARP_BUZ_TOUCHSOUND )
75
73 76
74#include <sys/ioctl.h> 77#include <sys/ioctl.h>
75#include <asm/sharp_char.h> 78#include <asm/sharp_char.h>
@@ -97,14 +100,14 @@ static void sig_handler(int sig) \
97{ \ 100{ \
98 switch (sig) { \ 101 switch (sig) { \
99 case SIGHUP: \ 102 case SIGHUP: \
100 memstate = VeryLow; \ 103 memstate = VeryLow; \
101 break; \ 104 break; \
102 case SIGUSR1: \ 105 case SIGUSR1: \
103 memstate = Normal; \ 106 memstate = Normal; \
104 break; \ 107 break; \
105 case SIGUSR2: \ 108 case SIGUSR2: \
106 memstate = Low; \ 109 memstate = Low; \
107 break; \ 110 break; \
108 } \ 111 } \
109} \ 112} \
110static void initMemalerter() \ 113static void initMemalerter() \
@@ -114,13 +117,13 @@ static void initMemalerter() \
114 sa.sa_handler = sig_handler; \ 117 sa.sa_handler = sig_handler; \
115 sa.sa_flags = SA_RESTART; \ 118 sa.sa_flags = SA_RESTART; \
116 if (sigaction(SIGHUP, &sa, NULL) < 0) { \ 119 if (sigaction(SIGHUP, &sa, NULL) < 0) { \
117 return; \ 120 return; \
118 } \ 121 } \
119 if (sigaction(SIGUSR1, &sa, NULL) < 0) { \ 122 if (sigaction(SIGUSR1, &sa, NULL) < 0) { \
120 return; \ 123 return; \
121 } \ 124 } \
122 if (sigaction(SIGUSR2, &sa, NULL) < 0) { \ 125 if (sigaction(SIGUSR2, &sa, NULL) < 0) { \
123 return; \ 126 return; \
124 } \ 127 } \
125 FILE *fo = fopen("/proc/sys/vm/freepg_signal_proc", "w"); \ 128 FILE *fo = fopen("/proc/sys/vm/freepg_signal_proc", "w"); \
126 \ 129 \
@@ -136,12 +139,12 @@ static void initMemalerter() \
136 sharp_kbdctl_modifstat st; \ 139 sharp_kbdctl_modifstat st; \
137 int dev = ::open("/dev/sharp_kbdctl", O_RDWR); \ 140 int dev = ::open("/dev/sharp_kbdctl", O_RDWR); \
138 if( dev >= 0 ) { \ 141 if( dev >= 0 ) { \
139 memset(&st, 0, sizeof(st)); \ 142 memset(&st, 0, sizeof(st)); \
140 st.which = 3; \ 143 st.which = 3; \
141 int ret = ioctl(dev, SHARP_KBDCTL_GETMODIFSTAT, (char*)&st); \ 144 int ret = ioctl(dev, SHARP_KBDCTL_GETMODIFSTAT, (char*)&st); \
142 if( !ret ) \ 145 if( !ret ) \
143 numLock = (bool)st.stat; \ 146 numLock = (bool)st.stat; \
144 ::close(dev); \ 147 ::close(dev); \
145 } \ 148 } \
146 return numLock; \ 149 return numLock; \
147} 150}