Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: Remote control for Hauppauge Nova-t



> Can you please send the patch -- it sounds like I have the same remote as
you?

Hi,

See below for my budget-ci patch.  This is against 2.6-test9 and does a
couple of things.

First I tried to make the repeat rate somewhat variable because I wanted
faster button presses.
Second I documented the existing buttons for the grey remote and tried to
come up with some generic stuff.  I also added some keypresses for use with
MythTv.  These work for me, but you may want to customise for you.  I also
tried to add compile time flags

Ideally I should have just tried to port the stuff which allows run time
alteration of keymaps, but in the meantime perhaps this is useful for
someone.  Perhaps the codes for the standard grey remote are worth commiting
to CVS?

Thanks and good luck

Ed W


--- budget-ci.c.bak     2003-11-11 08:57:32.000000000 +0000
+++ budget-ci.c 2003-11-11 14:28:34.000000000 +0000
@@ -49,6 +49,8 @@
 #define GPIO_IRQHI 0x10
 #define GPIO_INPUT 0x00

+#define KEY_REPEAT 125
+
 void gpio_set(struct saa7146_dev* saa, u8 pin, u8 data)
 {
         u32 value = 0;
@@ -138,13 +140,17 @@
 #endif


+/* Choose remote type*/
+#define HAUPPAUGE_GREY_REMOTE_MYTHTV


+/* Generic Remotes */
 /* from reading the following remotes:
    Zenith Universal 7 / TV Mode 807 / VCR Mode 837
    Hauppauge (from NOVA-CI-s box product)
    i've taken a "middle of the road" approach and note the differences
 */
+#ifdef GENERIC_REMOTE
 static  u16 key_map[64] = {
        /* 0x0X */
        KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8,
@@ -193,8 +199,108 @@
        KEY_TUNER,              /* VCR mode on Zenith */
        0,
 };
+#endif
+
+
+/* For Nova-T with grey remote */
+/* Generic Keybindings Lirc, etc */
+#ifdef HAUPPAUGE_GREY_REMOTE_GENERIC
+static  u16 key_map[64] = {
+       /* 0x0X */
+       KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8,
+       KEY_9,
+       0,
+       KEY_RED,
+       KEY_OPTION, /* Reserved: No label */
+       KEY_MENU, /* Menu */
+       0,
+       KEY_MUTE,
+       /* 0x1X */
+       KEY_VOLUMEUP, KEY_VOLUMEDOWN,
+       0, 0, 0,
+       0, 0, 0,
+       0, 0, 0,
+       0, 0, 0,
+       KEY_FORWARD, // Skip forward
+       KEY_ESC, /* Back/Exit */
+       /* 0x2X */
+       KEY_CHANNELUP, KEY_CHANNELDOWN, //
+       0, 0,
+       KEY_BACK, // Skip back
+       KEY_ENTER,
+       0, 0, 0,
+       KEY_BLUE,
+       0, 0, 0, 0,
+       KEY_GREEN,
+       0,
+       /* 0x3X */
+       KEY_PAUSE,
+       0,
+       KEY_REWIND,
+       0,
+       KEY_FASTFORWARD,
+       KEY_PLAY,
+       KEY_STOP,
+       KEY_RECORD,
+       KEY_YELLOW,
+       0, 0,
+       KEY_SPACE, /* Go */
+       KEY_F, /* Full Screen */
+       KEY_POWER, /* On/Off */
+       0, 0,
+};
+#endif


+/* For Nova-T with grey remote */
+/* MythTv keybindings (www.mythtv.org) */
+#ifdef HAUPPAUGE_GREY_REMOTE_MYTHTV
+static  u16 key_map[64] = {
+       /* 0x0X */
+       KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8,
+       KEY_9,
+       0,
+       KEY_QUESTION, // Red
+       KEY_W, /* Reserved: No label */
+       KEY_M, /* Menu */
+       0,
+       KEY_E, // Mute
+       /* 0x1X */
+       KEY_RIGHT, KEY_LEFT, //
+       0, 0, 0,
+       0, 0, 0,
+       0, 0, 0,
+       0, 0, 0,
+       KEY_PAGEDOWN, // Skip forward
+       KEY_ESC, /* Back/Exit */
+       /* 0x2X */
+       KEY_UP, KEY_DOWN, //
+       0, 0,
+       KEY_PAGEUP, // Skip Back
+       KEY_ENTER, // Enter
+       0, 0, 0,
+       KEY_U, // Blue
+       0, 0, 0, 0,
+       KEY_SLASH, // Green
+       0,
+       /* 0x3X */
+       KEY_P, // Pause
+       0,
+       KEY_LEFT, // Rewind
+       0,
+       KEY_RIGHT, // Fast Forward
+       KEY_P, // Play
+       KEY_S, // Stop
+       KEY_R, // Record
+       KEY_J, //  Yellow
+       0, 0,
+       KEY_SPACE, /* Go */
+       KEY_I, /* Full Screen */
+       KEY_POWER, /* On/Off */
+       0, 0,
+};
+#endif
+
 static void msp430_ir_debounce (unsigned long data)
 {
        struct input_dev *dev = (struct input_dev *) data;
@@ -205,7 +311,7 @@
        }

        dev->rep[0] = 0;
-       dev->timer.expires = jiffies + HZ * 350 / 1000;
+       dev->timer.expires = jiffies + HZ * KEY_REPEAT / 1000;
        add_timer(&dev->timer);
        input_event(dev, EV_KEY, key_map[dev->repeat_key], 2);  /* REPEAT */
 }
@@ -242,7 +348,7 @@
                /* Zenith remote _always_ sends 2 sequences */
                dev->rep[0] = ~0;
                /* 350 milliseconds */
-               dev->timer.expires = jiffies + HZ * 350 / 1000;
+               dev->timer.expires = jiffies + HZ * KEY_REPEAT / 1000;
                /* MAKE */
                input_event(dev, EV_KEY, key_map[code], !0);
                add_timer(&dev->timer);



-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index