Re: [PATCH] SMM BIOS on Dell i8100

From: Marcel J.E. Mol (marcel@mesa.nl)
Date: Tue Nov 06 2001 - 17:46:55 EST


Massimo,
Here is a small patch to sort of implement autorepeat for the volume buttons.
It just adds a -r | --repeat <count> option to i8kbuttons. With the
default timeout and -r 1 I get a reasonable autorepeat function.
The name/docs might not be optimal but I leave that to you if you choose
to include the patch. It is agains i8kutils-1.2.

-Marcel
--- i8kbuttons.1.org Tue Nov 6 22:30:56 2001
+++ i8kbuttons.1 Tue Nov 6 22:33:47 2001
@@ -36,6 +36,11 @@
 \fB\-t\fR, \fB\-\-timeout\fR <\fImilliseconds\fP>
 Specifies the interval in milliseconds at which the daemon checks the
 button status. Useful values are in the range of 50\-200. Default is 100.
+.TP
+\fB\-r\fR, \fB\-\-repeat\fR <\fIcount\fP>
+Enables autorepeat (0 is off is default). While holding down one of the volume
+buttons, the volume is changed every count timeoutintervals. So with -t 100 -r 2
+it will change every 200 milliseconds.
 .LP
 .SH "FILES"
 .LP
--- i8kbuttons.c.org Tue Nov 6 22:18:09 2001
+++ i8kbuttons.c Tue Nov 6 22:24:08 2001
@@ -89,6 +89,7 @@
     printf(" -d|--down <command>\n");
     printf(" -m|--mute <command>\n");
     printf(" -t|--timeout <milliseconds>\n");
+ printf(" -r|--repeat <count>\n");
     printf("\n");
 }
 
@@ -97,6 +98,8 @@
 {
     int fd, status;
     int timeout = POLL_TIMEOUT;
+ int repeat = 0;
+ int autorpt = 0;
     int last = 0;
     char *progname;
     struct timespec req;
@@ -137,6 +140,11 @@
             }
             continue;
         }
+ if ((strcmp(argv[0],"-r")==0) || (strcmp(argv[0],"--repeat")==0)) {
+ if (argc < 2) break;
+ autorpt = atoi(argv[1]);
+ continue;
+ }
         break;
     }
     if (argc > 0) {
@@ -162,8 +170,10 @@
         DPRINTF("%d\n", status);
 
         if (status == last) {
- continue;
+ if (!autorpt || (repeat++ < autorpt))
+ continue;
         }
+ repeat = 0;
         last = status;
 
         switch (status) {

-- 
     ======--------         Marcel J.E. Mol                MESA Consulting B.V.
    =======---------        ph. +31-(0)6-54724868          P.O. Box 112
    =======---------        marcel@mesa.nl                 2630 AC  Nootdorp
__==== www.mesa.nl ---____U_n_i_x______I_n_t_e_r_n_e_t____ The Netherlands ____
 They couldn't think of a number,           Linux user 1148  --  counter.li.org
    so they gave me a name!  -- Rupert Hine  --  www.ruperthine.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Nov 07 2001 - 21:00:32 EST