Gentoo Archives: gentoo-commits

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