1 |
zzam 08/10/12 19:55:53 |
2 |
|
3 |
Added: lirc-0.8.4-imon-pad2keys.patch |
4 |
Log: |
5 |
Version bumped. This adds Kernel 2.6.27 compatibility. Added driver options irlink, commandir, ite8709 and samsung, Bug #221727. Removed portaudio patch. Shorten description of lirc-0.8.0-r8. |
6 |
(Portage version: 2.2_rc12/cvs/Linux 2.6.25-tuxonice-r6 i686) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 app-misc/lirc/files/lirc-0.8.4-imon-pad2keys.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-misc/lirc/files/lirc-0.8.4-imon-pad2keys.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-misc/lirc/files/lirc-0.8.4-imon-pad2keys.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: lirc-0.8.4-imon-pad2keys.patch |
15 |
=================================================================== |
16 |
diff -ruN lirc-0.8.3pre3-orig/drivers/lirc_imon/lirc_imon.c lirc-0.8.3pre3/drivers/lirc_imon/lirc_imon.c |
17 |
--- lirc-0.8.3pre3-orig/drivers/lirc_imon/lirc_imon.c 2008-04-28 22:15:54.281654857 +0200 |
18 |
+++ lirc-0.8.3pre3/drivers/lirc_imon/lirc_imon.c 2008-04-28 22:16:51.381649620 +0200 |
19 |
@@ -73,9 +73,9 @@ |
20 |
|
21 |
|
22 |
#define MOD_AUTHOR "Venky Raju <dev@×××××.ws>" |
23 |
-#define MOD_DESC "Driver for Soundgraph iMON MultiMedia IR/VFD" |
24 |
+#define MOD_DESC "Driver for Soundgraph iMON MultiMedia IR/VFD w/imon pad2keys patch" |
25 |
#define MOD_NAME "lirc_imon" |
26 |
-#define MOD_VERSION "0.3" |
27 |
+#define MOD_VERSION "0.3p2k" |
28 |
|
29 |
#define VFD_MINOR_BASE 144 /* Same as LCD */ |
30 |
#define DEVFS_MODE (S_IFCHR | S_IRUSR | S_IWUSR | \ |
31 |
@@ -91,6 +91,7 @@ |
32 |
#define TRUE 1 |
33 |
#define FALSE 0 |
34 |
|
35 |
+#define CURSOR_LIMIT 16 |
36 |
|
37 |
/* ------------------------------------------------------------ |
38 |
* P R O T O T Y P E S |
39 |
@@ -177,6 +178,10 @@ |
40 |
atomic_t busy; /* write in progress */ |
41 |
int status; /* status of tx completion */ |
42 |
} tx; |
43 |
+ |
44 |
+ int key_x; |
45 |
+ int key_y; |
46 |
+ int last_count; /* number of times pressed */ |
47 |
}; |
48 |
|
49 |
#define LOCK_CONTEXT down(&context->sem) |
50 |
@@ -248,6 +253,9 @@ |
51 |
static int is_lcd; /* If LIRC_IMON_LCD not defined, default to non-LCD */ |
52 |
#endif |
53 |
|
54 |
+/* pad2keys module parameter. pad2keys patch active? */ |
55 |
+static int pad2keys_active = 0; |
56 |
+ |
57 |
#if !defined(KERNEL_2_5) |
58 |
|
59 |
#define MAX_DEVICES 4 /* In case there's more than one iMON device */ |
60 |
@@ -271,6 +279,7 @@ |
61 |
|
62 |
MODULE_AUTHOR(MOD_AUTHOR); |
63 |
MODULE_DESCRIPTION(MOD_DESC); |
64 |
+MODULE_VERSION(MOD_VERSION); /* MBr: was missing */ |
65 |
MODULE_LICENSE("GPL"); |
66 |
MODULE_DEVICE_TABLE(usb, imon_usb_id_table); |
67 |
|
68 |
@@ -287,6 +296,9 @@ |
69 |
"1=yes (default:no)"); |
70 |
#endif |
71 |
|
72 |
+module_param (pad2keys_active, int, 0); |
73 |
+MODULE_PARM_DESC (pad2keys_active, "pad2keys patch active: 0=no, 1=yes (default: no)"); |
74 |
+ |
75 |
static inline void delete_context(struct imon_context *context) |
76 |
{ |
77 |
if (context->vfd_supported) |
78 |
@@ -766,6 +778,11 @@ |
79 |
context->rx.initial_space = 1; |
80 |
context->rx.prev_bit = 0; |
81 |
|
82 |
+ /* init pad context for pad2keys */ |
83 |
+ context ->key_x = 0; |
84 |
+ context ->key_y = 0; |
85 |
+ context ->last_count = 0; |
86 |
+ |
87 |
usb_fill_int_urb(context->rx_urb, context->dev, |
88 |
usb_rcvintpipe(context->dev, |
89 |
context->rx_endpoint->bEndpointAddress), |
90 |
@@ -915,6 +932,94 @@ |
91 |
|
92 |
if (context->ir_onboard_decode) { |
93 |
/* The signals have been decoded onboard the iMON controller */ |
94 |
+ |
95 |
+ if (pad2keys_active) |
96 |
+ { |
97 |
+ /* imon pad2keys patch |
98 |
+ * |
99 |
+ * make PAD and mouse buttons available for use with VDR, |
100 |
+ * based on pad-mouse-emu patch from venky's forum |
101 |
+ * |
102 |
+ * last change: M.Brakemeier 2007-10-14 |
103 |
+ * |
104 |
+ * generated PAD key codes: |
105 |
+ * Mouse_N 0x690281B7 |
106 |
+ * Mouse_S 0x688291B7 |
107 |
+ * Mouse_W 0x6A8281B7 |
108 |
+ * Mouse_E 0x688A81B7 |
109 |
+ * |
110 |
+ * mouse buttons (non-synthetic): |
111 |
+ * MouseRightClick 0x688481B7 |
112 |
+ * MouseLeftClick 0x688301B7 |
113 |
+ */ |
114 |
+ if((buf[0] & 0x40) && |
115 |
+ !(buf[1] & 0x01 || buf[1] >> 2 & 0x01)) |
116 |
+ { |
117 |
+ int rel_x = (buf[1] & 0x08) | (buf[1] & 0x10) >> 2 | (buf[1] & 0x20) >> 4 | (buf[1] & 0x40) >> 6; |
118 |
+ int rel_y = (buf[2] & 0x08) | (buf[2] & 0x10) >> 2 | (buf[2] & 0x20) >> 4 | (buf[2] & 0x40) >> 6; |
119 |
+ |
120 |
+ if(buf[0] & 0x02) |
121 |
+ rel_x |= ~0x10+1; |
122 |
+ if(buf[0] & 0x01) |
123 |
+ rel_y |= ~0x10+1; |
124 |
+ |
125 |
+ /* keyboard direction key emulation */ |
126 |
+ if( context->last_count > 32 ) |
127 |
+ { /* Hopefully eliminate drift*/ |
128 |
+ context->last_count=0; |
129 |
+ context->key_y=0; |
130 |
+ context->key_x=0; |
131 |
+ } |
132 |
+ context->last_count++; |
133 |
+ |
134 |
+ /* limit decoded events */ |
135 |
+ if(abs(context->key_x) > CURSOR_LIMIT || abs(context->key_y) > CURSOR_LIMIT ) |
136 |
+ { |
137 |
+ if(abs(context->key_y ) > abs(context->key_x)) |
138 |
+ { /* mouse s/n */ |
139 |
+ if(context->key_y > 0 && rel_y > 0) |
140 |
+ { /* mouse s */ |
141 |
+ buf[0] = 0x68; |
142 |
+ buf[1] = 0x82; |
143 |
+ buf[2] = 0x91; |
144 |
+ } |
145 |
+ else if(context->key_y < 0 && rel_y < 0) |
146 |
+ { /* mouse n */ |
147 |
+ buf[0] = 0x69; |
148 |
+ buf[1] = 0x02; |
149 |
+ buf[2] = 0x81; |
150 |
+ } |
151 |
+ } |
152 |
+ else |
153 |
+ { /* mouse e/w*/ |
154 |
+ if(context->key_x > 0 && rel_x > 0 ) |
155 |
+ { /* mouse e */ |
156 |
+ buf[0] = 0x68; |
157 |
+ buf[1] = 0x8A; |
158 |
+ buf[2] = 0x81; |
159 |
+ } |
160 |
+ else if(context->key_x < 0 && rel_x < 0 ) |
161 |
+ { /* mouse w */ |
162 |
+ buf[0] = 0x6A; |
163 |
+ buf[1] = 0x82; |
164 |
+ buf[2] = 0x81; |
165 |
+ } |
166 |
+ } |
167 |
+ } |
168 |
+ else |
169 |
+ { |
170 |
+ context->key_x += rel_x; |
171 |
+ context->key_y += rel_y; |
172 |
+ |
173 |
+ return; /* discard those key codes */ |
174 |
+ } |
175 |
+ } |
176 |
+ /* a key was pressed, reset count */ |
177 |
+ context->key_x = 0; |
178 |
+ context->key_y = 0; |
179 |
+ context->last_count = 0; |
180 |
+ } |
181 |
+ |
182 |
lirc_buffer_write_1(context->plugin->rbuf, buf); |
183 |
wake_up(&context->plugin->rbuf->wait_poll); |
184 |
return; |
185 |
diff -ruN lirc-0.8.3pre3-orig/drivers/lirc_imon/lirc_imon.c.rej lirc-0.8.3pre3/drivers/lirc_imon/lirc_imon.c.rej |
186 |
--- lirc-0.8.3pre3-orig/drivers/lirc_imon/lirc_imon.c.rej 1970-01-01 01:00:00.000000000 +0100 |
187 |
+++ lirc-0.8.3pre3/drivers/lirc_imon/lirc_imon.c.rej 2008-04-28 22:16:02.941653915 +0200 |
188 |
@@ -0,0 +1,26 @@ |
189 |
+*************** |
190 |
+*** 271,280 **** |
191 |
+ |
192 |
+ MODULE_AUTHOR(MOD_AUTHOR); |
193 |
+ MODULE_DESCRIPTION(MOD_DESC); |
194 |
+ MODULE_LICENSE("GPL"); |
195 |
+ MODULE_DEVICE_TABLE(usb, imon_usb_id_table); |
196 |
+ module_param(debug, int, 0); |
197 |
+ MODULE_PARM_DESC(debug, "Debug messages: 0=no, 1=yes(default: no)"); |
198 |
+ |
199 |
+ static inline void delete_context(struct imon_context *context) |
200 |
+ { |
201 |
+--- 279,291 ---- |
202 |
+ |
203 |
+ MODULE_AUTHOR(MOD_AUTHOR); |
204 |
+ MODULE_DESCRIPTION(MOD_DESC); |
205 |
++ MODULE_VERSION(MOD_VERSION); /* MBr: was missing */ |
206 |
+ MODULE_LICENSE("GPL"); |
207 |
+ MODULE_DEVICE_TABLE(usb, imon_usb_id_table); |
208 |
+ module_param(debug, int, 0); |
209 |
+ MODULE_PARM_DESC(debug, "Debug messages: 0=no, 1=yes(default: no)"); |
210 |
++ module_param (pad2keys_active, int, 0); |
211 |
++ MODULE_PARM_DESC (pad2keys_active, "pad2keys patch active: 0=no, 1=yes (default: no)"); |
212 |
+ |
213 |
+ static inline void delete_context(struct imon_context *context) |
214 |
+ { |
215 |
diff -ruN lirc-0.8.3pre3-orig/remotes/imon/lircd.conf.imon-pad2keys lirc-0.8.3pre3/remotes/imon/lircd.conf.imon-pad2keys |
216 |
--- lirc-0.8.3pre3-orig/remotes/imon/lircd.conf.imon-pad2keys 1970-01-01 01:00:00.000000000 +0100 |
217 |
+++ lirc-0.8.3pre3/remotes/imon/lircd.conf.imon-pad2keys 2008-04-28 22:16:02.941653915 +0200 |
218 |
@@ -0,0 +1,88 @@ |
219 |
+# Please make this file available to others |
220 |
+# by sending it to <lirc@×××××××××.de> |
221 |
+# |
222 |
+# this config file was generated |
223 |
+# using lirc-0.8.3pre1 (imon w/pad2keys patch) |
224 |
+# |
225 |
+# contributed by M.Brakemeier |
226 |
+# |
227 |
+# brand: SoundGraph |
228 |
+# model no. of remote control: iMON-PAD |
229 |
+# devices being controlled by this remote: |
230 |
+# |
231 |
+ |
232 |
+begin remote |
233 |
+ |
234 |
+ name iMON-PAD |
235 |
+ bits 32 |
236 |
+ eps 30 |
237 |
+ aeps 100 |
238 |
+ |
239 |
+ one 0 0 |
240 |
+ zero 0 0 |
241 |
+ gap 235965 |
242 |
+ min_repeat 1 |
243 |
+ toggle_bit 0 |
244 |
+ |
245 |
+ begin codes |
246 |
+ AppExit 0x288195B7 |
247 |
+ Power 0x289115B7 |
248 |
+ Record 0x298115B7 |
249 |
+ Play 0x2A8115B7 |
250 |
+ Open 0x29B1D5B7 |
251 |
+ Rewind 0x2A8195B7 |
252 |
+ Pause 0x2A9115B7 |
253 |
+ FastForward 0x2B8115B7 |
254 |
+ PrevChapter 0x2B9115B7 |
255 |
+ Stop 0x2B9715B7 |
256 |
+ NextChapter 0x298195B7 |
257 |
+ Esc 0x2BB715B7 |
258 |
+ Eject 0x299395B7 |
259 |
+ AppLauncher 0x29B715B7 |
260 |
+ MultiMon 0x2AB195B7 |
261 |
+ TaskSwitcher 0x2A9395B7 |
262 |
+ Mute 0x2B9595B7 |
263 |
+ Vol+ 0x28A395B7 |
264 |
+ Vol- 0x28A595B7 |
265 |
+ Ch+ 0x289395B7 |
266 |
+ Ch- 0x288795B7 |
267 |
+ Timer 0x2B8395B7 |
268 |
+ 1 0x28B595B7 |
269 |
+ 2 0x2BB195B7 |
270 |
+ 3 0x28B195B7 |
271 |
+ 4 0x2A8595B7 |
272 |
+ 5 0x299595B7 |
273 |
+ 6 0x2AA595B7 |
274 |
+ 7 0x2B9395B7 |
275 |
+ 8 0x2A8515B7 |
276 |
+ 9 0x2AA115B7 |
277 |
+ 0 0x2BA595B7 |
278 |
+ ShiftTab 0x28B515B7 |
279 |
+ Tab 0x29A115B7 |
280 |
+ Red 0x2B8515B7 # MyMovie |
281 |
+ Green 0x299195B7 # MyMusic |
282 |
+ Blue 0x2BA115B7 # MyPhoto |
283 |
+ Yellow 0x28A515B7 # MyTV |
284 |
+ Bookmark 0x288515B7 |
285 |
+ Thumbnail 0x2AB715B7 |
286 |
+ AspectRatio 0x29A595B7 |
287 |
+ FullScreen 0x2AA395B7 |
288 |
+ Purple 0x29A395B7 # MyDVD |
289 |
+ Menu 0x2BA395B7 |
290 |
+ Caption 0x298595B7 |
291 |
+ Language 0x2B8595B7 |
292 |
+ MouseKeyboard 0x299115B7 |
293 |
+ SelectSpace 0x2A9315B7 |
294 |
+ MouseMenu 0x28B715B7 |
295 |
+ MouseRightClick 0x688481B7 |
296 |
+ Enter 0x28A195B7 |
297 |
+ MouseLeftClick 0x688301B7 |
298 |
+ WindowsKey 0x2B8195B7 |
299 |
+ Backspace 0x28A115B7 |
300 |
+ Mouse_N 0x690281B7 |
301 |
+ Mouse_S 0x688291B7 |
302 |
+ Mouse_W 0x6A8281B7 |
303 |
+ Mouse_E 0x688A81B7 |
304 |
+ end codes |
305 |
+ |
306 |
+end remote |