~ubuntu-branches/ubuntu/trusty/v4l-utils/trusty

« back to all changes in this revision

Viewing changes to debian/patches/keytable-add-protocols.diff

  • Committer: Package Import Robot
  • Author(s): Gregor Jasny
  • Date: 2012-10-09 18:38:05 UTC
  • mfrom: (11.1.15 sid)
  • Revision ID: package-import@ubuntu.com-20121009183805-v1m5kb2a1i97rw9y
* Imported Upstream version 0.8.9
  - libv4lconvert: Various Pixart JPEG fixes
  - libv4lconvert: Add more notebooks to the upside down device table
  - keytable: Add support for Sanyo IR and RC-5-SZ protocol
  - keytable: Add missing buttons in shipped keytables (LP: #1054122)
  - v4l2-compliance, v4l-ctl, qv4l2: Sync with development branch
* Drop 32bit cross compiled libraries

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Author: Mauro Carvalho Chehab <mchehab@redhat.com>
2
 
Author: Gregor Jasny <gjasny@googlemail.com>
3
 
Description: Add Sanyo and RC-5-SZ protocol
4
 
 
5
 
--- a/utils/keytable/keytable.c
6
 
+++ b/utils/keytable/keytable.c
7
 
@@ -86,6 +86,8 @@
8
 
        JVC             = 1 << 3,
9
 
        SONY            = 1 << 4,
10
 
        LIRC            = 1 << 5,
11
 
+       SANYO           = 1 << 6,
12
 
+       RC_5_SZ         = 1 << 7,
13
 
        OTHER           = 1 << 31,
14
 
 };
15
 
 
16
 
@@ -110,7 +112,7 @@
17
 
        "  SYSDEV   - the ir class as found at /sys/class/rc\n"
18
 
        "  TABLE    - a file with a set of scancode=keycode value pairs\n"
19
 
        "  SCANKEY  - a set of scancode1=keycode1,scancode2=keycode2.. value pairs\n"
20
 
-       "  PROTOCOL - protocol name (nec, rc-5, rc-6, other) to be enabled\n"
21
 
+       "  PROTOCOL - protocol name (nec, rc-5, rc-6, jvc, sony, sanyo, rc-5-sz, lirc, other) to be enabled\n"
22
 
        "  DELAY    - Delay before repeating a keystroke\n"
23
 
        "  PERIOD   - Period to repeat a keystroke\n"
24
 
        "  CFGFILE  - configuration file that associates a driver/table name with a keymap file\n"
25
 
@@ -225,6 +227,10 @@
26
 
                                                        ch_proto |= JVC;
27
 
                                                else if (!strcasecmp(p,"sony"))
28
 
                                                        ch_proto |= SONY;
29
 
+                                               else if (!strcasecmp(p,"sanyo"))
30
 
+                                                       ch_proto |= SANYO;
31
 
+                                               else if (!strcasecmp(p,"rc-5-sz"))
32
 
+                                                       ch_proto |= RC_5_SZ;
33
 
                                                else if (!strcasecmp(p,"other") || !strcasecmp(p,"unknown"))
34
 
                                                        ch_proto |= OTHER;
35
 
                                                else {
36
 
@@ -454,8 +460,12 @@
37
 
                                ch_proto |= JVC;
38
 
                        else if (!strcasecmp(p,"sony"))
39
 
                                ch_proto |= SONY;
40
 
+                       else if (!strcasecmp(p,"sanyo"))
41
 
+                               ch_proto |= SANYO;
42
 
                        else if (!strcasecmp(p,"lirc"))
43
 
                                ch_proto |= LIRC;
44
 
+                       else if (!strcasecmp(p,"rc-5-sz"))
45
 
+                               ch_proto |= RC_5_SZ;
46
 
                        else
47
 
                                goto err_inval;
48
 
                        p = strtok(NULL, ",;");
49
 
@@ -725,6 +735,10 @@
50
 
                        proto |= JVC;
51
 
                else if (!strcmp(p, "sony"))
52
 
                        proto |= SONY;
53
 
+               else if (!strcmp(p, "sanyo"))
54
 
+                       proto |= SANYO;
55
 
+               else if (!strcmp(p, "rc-5-sz"))
56
 
+                       proto |= RC_5_SZ;
57
 
                else
58
 
                        proto |= OTHER;
59
 
 
60
 
@@ -765,6 +779,12 @@
61
 
        if (rc_dev->current & SONY)
62
 
                fprintf(fp, "sony ");
63
 
 
64
 
+       if (rc_dev->current & SANYO)
65
 
+               fprintf(fp, "sanyo ");
66
 
+
67
 
+       if (rc_dev->current & RC_5_SZ)
68
 
+               fprintf(fp, "rc-5-sz ");
69
 
+
70
 
        if (rc_dev->current & OTHER)
71
 
                fprintf(fp, "unknown ");
72
 
 
73
 
@@ -885,8 +905,12 @@
74
 
                        proto = JVC;
75
 
                else if (!strcmp(p, "sony"))
76
 
                        proto = SONY;
77
 
+               else if (!strcmp(p, "sanyo"))
78
 
+                       proto = SANYO;
79
 
                else if (!strcmp(p, "lirc"))    /* Only V2 has LIRC support */
80
 
                        proto = LIRC;
81
 
+               else if (!strcmp(p, "rc-5-sz"))
82
 
+                       proto = RC_5_SZ;
83
 
                else
84
 
                        proto = OTHER;
85
 
 
86
 
@@ -934,9 +958,15 @@
87
 
        if (rc_dev->current & SONY)
88
 
                fprintf(fp, "+sony\n");
89
 
 
90
 
+       if (rc_dev->current & SANYO)
91
 
+               fprintf(fp, "+sanyo\n");
92
 
+
93
 
        if (rc_dev->current & LIRC)
94
 
                fprintf(fp, "+lirc\n");
95
 
 
96
 
+       if (rc_dev->current & RC_5_SZ)
97
 
+               fprintf(fp, "+rc-5-sz\n");
98
 
+
99
 
        if (rc_dev->current & OTHER)
100
 
                fprintf(fp, "+unknown\n");
101
 
 
102
 
@@ -960,8 +990,12 @@
103
 
                fprintf (stderr, "JVC ");
104
 
        if (proto & SONY)
105
 
                fprintf (stderr, "SONY ");
106
 
+       if (proto & SANYO)
107
 
+               fprintf (stderr, "SANYO ");
108
 
        if (proto & LIRC)
109
 
                fprintf (stderr, "LIRC ");
110
 
+       if (proto & RC_5_SZ)
111
 
+               fprintf (stderr, "RC-5-SZ ");
112
 
        if (proto & OTHER)
113
 
                fprintf (stderr, "other ");
114
 
 }