3 * handle saa7134 IR remotes via linux kernel input layer.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include <linux/module.h>
22 #include <linux/moduleparam.h>
23 #include <linux/init.h>
24 #include <linux/delay.h>
25 #include <linux/sched.h>
26 #include <linux/interrupt.h>
27 #include <linux/input.h>
29 #include "saa7134-reg.h"
32 static unsigned int disable_ir = 0;
33 module_param(disable_ir, int, 0444);
34 MODULE_PARM_DESC(disable_ir,"disable infrared remote support");
36 static unsigned int ir_debug = 0;
37 module_param(ir_debug, int, 0644);
38 MODULE_PARM_DESC(ir_debug,"enable debug messages [IR]");
40 #define dprintk(fmt, arg...) if (ir_debug) \
41 printk(KERN_DEBUG "%s/ir: " fmt, dev->name , ## arg)
42 #define i2cdprintk(fmt, arg...) if (ir_debug) \
43 printk(KERN_DEBUG "%s/ir: " fmt, ir->c.name , ## arg)
45 /* ---------------------------------------------------------------------- */
47 static IR_KEYTAB_TYPE flyvideo_codes[IR_KEYTAB_SIZE] = {
59 [ 14 ] = KEY_TUNER, // Air/Cable
60 [ 17 ] = KEY_VIDEO, // Video
61 [ 21 ] = KEY_AUDIO, // Audio
62 [ 0 ] = KEY_POWER, // Pover
63 [ 2 ] = KEY_ZOOM, // Fullscreen
64 [ 27 ] = KEY_MUTE, // Mute
65 [ 20 ] = KEY_VOLUMEUP,
66 [ 23 ] = KEY_VOLUMEDOWN,
67 [ 18 ] = KEY_CHANNELUP, // Channel +
68 [ 19 ] = KEY_CHANNELDOWN, // Channel -
69 [ 6 ] = KEY_AGAIN, // Recal
70 [ 16 ] = KEY_KPENTER, // Enter
72 [ 26 ] = KEY_F22, // Stereo
73 [ 24 ] = KEY_EDIT, // AV Source
76 static IR_KEYTAB_TYPE cinergy_codes[IR_KEYTAB_SIZE] = {
89 [ 0x0b ] = KEY_PROG1, // app
90 [ 0x0c ] = KEY_ZOOM, // zoom/fullscreen
91 [ 0x0d ] = KEY_CHANNELUP, // channel
92 [ 0x0e ] = KEY_CHANNELDOWN, // channel-
93 [ 0x0f ] = KEY_VOLUMEUP,
94 [ 0x10 ] = KEY_VOLUMEDOWN,
95 [ 0x11 ] = KEY_TUNER, // AV
96 [ 0x12 ] = KEY_NUMLOCK, // -/--
97 [ 0x13 ] = KEY_AUDIO, // audio
102 [ 0x18 ] = KEY_RIGHT,
104 [ 0x1a ] = BTN_RIGHT,
105 [ 0x1b ] = KEY_WWW, // text
106 [ 0x1c ] = KEY_REWIND,
107 [ 0x1d ] = KEY_FORWARD,
108 [ 0x1e ] = KEY_RECORD,
110 [ 0x20 ] = KEY_PREVIOUSSONG,
111 [ 0x21 ] = KEY_NEXTSONG,
112 [ 0x22 ] = KEY_PAUSE,
116 /* Alfons Geser <a.geser@cox.net>
117 * updates from Job D. R. Borges <jobdrb@ig.com.br> */
118 static IR_KEYTAB_TYPE eztv_codes[IR_KEYTAB_SIZE] = {
120 [ 1 ] = KEY_TV, // DVR
121 [ 21 ] = KEY_DVD, // DVD
122 [ 23 ] = KEY_AUDIO, // music
123 // DVR mode / DVD mode / music mode
125 [ 27 ] = KEY_MUTE, // mute
126 [ 2 ] = KEY_LANGUAGE, // MTS/SAP / audio / autoseek
127 [ 30 ] = KEY_SUBTITLE, // closed captioning / subtitle / seek
128 [ 22 ] = KEY_ZOOM, // full screen
129 [ 28 ] = KEY_VIDEO, // video source / eject / delall
130 [ 29 ] = KEY_RESTART, // playback / angle / del
131 [ 47 ] = KEY_SEARCH, // scan / menu / playlist
132 [ 48 ] = KEY_CHANNEL, // CH surfing / bookmark / memo
134 [ 49 ] = KEY_HELP, // help
135 [ 50 ] = KEY_MODE, // num/memo
136 [ 51 ] = KEY_ESC, // cancel
138 [ 12 ] = KEY_UP, // up
139 [ 16 ] = KEY_DOWN, // down
140 [ 8 ] = KEY_LEFT, // left
141 [ 4 ] = KEY_RIGHT, // right
142 [ 3 ] = KEY_SELECT, // select
144 [ 31 ] = KEY_REWIND, // rewind
145 [ 32 ] = KEY_PLAYPAUSE, // play/pause
146 [ 41 ] = KEY_FORWARD, // forward
147 [ 20 ] = KEY_AGAIN, // repeat
148 [ 43 ] = KEY_RECORD, // recording
149 [ 44 ] = KEY_STOP, // stop
150 [ 45 ] = KEY_PLAY, // play
151 [ 46 ] = KEY_SHUFFLE, // snapshot / shuffle
164 [ 42 ] = KEY_VOLUMEUP,
165 [ 17 ] = KEY_VOLUMEDOWN,
166 [ 24 ] = KEY_CHANNELUP, // CH.tracking up
167 [ 25 ] = KEY_CHANNELDOWN, // CH.tracking down
169 [ 19 ] = KEY_KPENTER, // enter
170 [ 33 ] = KEY_KPDOT, // . (decimal dot)
173 static IR_KEYTAB_TYPE avacssmart_codes[IR_KEYTAB_SIZE] = {
174 [ 30 ] = KEY_POWER, // power
175 [ 28 ] = KEY_SEARCH, // scan
176 [ 7 ] = KEY_SELECT, // source
178 [ 22 ] = KEY_VOLUMEUP,
179 [ 20 ] = KEY_VOLUMEDOWN,
180 [ 31 ] = KEY_CHANNELUP,
181 [ 23 ] = KEY_CHANNELDOWN,
196 [ 3 ] = KEY_TUNER, // tv/fm
197 [ 4 ] = KEY_REWIND, // fm tuning left or function left
198 [ 12 ] = KEY_FORWARD, // fm tuning right or function right
205 [ 14 ] = KEY_MENU, // function
206 [ 19 ] = KEY_AGAIN, // recall
207 [ 29 ] = KEY_RESTART, // reset
208 [ 26 ] = KEY_SHUFFLE, // snapshot/shuffle
211 [ 13 ] = KEY_F21, // mts
212 [ 15 ] = KEY_F22, // min
215 /* Alex Hermann <gaaf@gmx.net> */
216 static IR_KEYTAB_TYPE md2819_codes[IR_KEYTAB_SIZE] = {
228 [ 32 ] = KEY_TV, // TV/FM
229 [ 16 ] = KEY_CD, // CD
230 [ 48 ] = KEY_TEXT, // TELETEXT
231 [ 0 ] = KEY_POWER, // POWER
233 [ 8 ] = KEY_VIDEO, // VIDEO
234 [ 4 ] = KEY_AUDIO, // AUDIO
235 [ 12 ] = KEY_ZOOM, // FULL SCREEN
237 [ 18 ] = KEY_SUBTITLE, // DISPLAY - ???
238 [ 50 ] = KEY_REWIND, // LOOP - ???
239 [ 2 ] = KEY_PRINT, // PREVIEW - ???
241 [ 42 ] = KEY_SEARCH, // AUTOSCAN
242 [ 26 ] = KEY_SLEEP, // FREEZE - ???
243 [ 58 ] = KEY_SHUFFLE, // SNAPSHOT - ???
244 [ 10 ] = KEY_MUTE, // MUTE
246 [ 38 ] = KEY_RECORD, // RECORD
247 [ 22 ] = KEY_PAUSE, // PAUSE
248 [ 54 ] = KEY_STOP, // STOP
249 [ 6 ] = KEY_PLAY, // PLAY
251 [ 46 ] = KEY_RED, // <RED>
252 [ 33 ] = KEY_GREEN, // <GREEN>
253 [ 14 ] = KEY_YELLOW, // <YELLOW>
254 [ 1 ] = KEY_BLUE, // <BLUE>
256 [ 30 ] = KEY_VOLUMEDOWN, // VOLUME-
257 [ 62 ] = KEY_VOLUMEUP, // VOLUME+
258 [ 17 ] = KEY_CHANNELDOWN, // CHANNEL/PAGE-
259 [ 49 ] = KEY_CHANNELUP // CHANNEL/PAGE+
262 static IR_KEYTAB_TYPE videomate_tv_pvr_codes[IR_KEYTAB_SIZE] = {
271 [ 8 ] = KEY_PLAYPAUSE,
272 [ 15 ] = KEY_FORWARD,
274 [ 2 ] = KEY_PREVIOUS,
287 [ 34 ] = KEY_CHANNEL,
289 [ 18 ] = KEY_VOLUMEUP,
290 [ 21 ] = KEY_VOLUMEDOWN,
291 [ 16 ] = KEY_CHANNELUP,
292 [ 19 ] = KEY_CHANNELDOWN,
307 [ 32 ] = KEY_LANGUAGE,
311 /* Michael Tokarev <mjt@tls.msk.ru>
312 http://www.corpit.ru/mjt/beholdTV/remote_control.jpg
313 keytable is used by MANLI MTV00[12] and BeholdTV 40[13] at
314 least, and probably other cards too.
315 The "ascii-art picture" below (in comments, first row
316 is the keycode in hex, and subsequent row(s) shows
317 the button labels (several variants when appropriate)
318 helps to descide which keycodes to assign to the buttons.
320 static IR_KEYTAB_TYPE manli_codes[IR_KEYTAB_SIZE] = {
326 [ 0x1c ] = KEY_RADIO, /*XXX*/
327 [ 0x12 ] = KEY_POWER,
352 [ 0x0a ] = KEY_AGAIN, /*XXX KEY_REWIND? */
354 [ 0x17 ] = KEY_DIGITS, /*XXX*/
371 [ 0x0b ] = KEY_UP, /*XXX KEY_SCROLLUP? */
372 [ 0x18 ] = KEY_LEFT, /*XXX KEY_BACK? */
373 [ 0x16 ] = KEY_OK, /*XXX KEY_SELECT? KEY_ENTER? */
374 [ 0x0c ] = KEY_RIGHT, /*XXX KEY_FORWARD? */
375 [ 0x15 ] = KEY_DOWN, /*XXX KEY_SCROLLDOWN? */
381 [ 0x11 ] = KEY_TV, /*XXX*/
382 [ 0x0d ] = KEY_MODE, /*XXX there's no KEY_STEREO */
391 [ 0x0f ] = KEY_AUDIO,
392 [ 0x1b ] = KEY_VOLUMEUP,
393 [ 0x1a ] = KEY_CHANNELUP,
394 [ 0x0e ] = KEY_SLEEP, /*XXX maybe KEY_PAUSE */
395 [ 0x1f ] = KEY_VOLUMEDOWN,
396 [ 0x1e ] = KEY_CHANNELDOWN,
402 [ 0x19 ] = KEY_RECORD, /*XXX*/
408 /* Mike Baikov <mike@baikov.com> */
409 static IR_KEYTAB_TYPE gotview7135_codes[IR_KEYTAB_SIZE] = {
423 [ 115] = KEY_AGAIN, /* LOOP */
425 [ 97 ] = KEY_PRINT, /* PREVIEW */
427 [ 32 ] = KEY_CHANNELUP,
428 [ 64 ] = KEY_CHANNELDOWN,
429 [ 24 ] = KEY_VOLUMEDOWN,
430 [ 80 ] = KEY_VOLUMEUP,
433 [ 123] = KEY_SHUFFLE, /* SNAPSHOT */
439 [ 25 ] = KEY_FORWARD,
442 [ 82 ] = KEY_F21, /* LIVE TIMESHIFT */
443 [ 26 ] = KEY_F22, /* MIN TIMESHIFT */
444 [ 58 ] = KEY_F23, /* TIMESHIFT */
445 [ 112] = KEY_F24, /* NORMAL TIMESHIFT */
448 static IR_KEYTAB_TYPE ir_codes_purpletv[IR_KEYTAB_SIZE] = {
451 [ 0x10 ] = KEY_BACKSPACE, /* Recall */
463 [ 0x12 ] = KEY_KPDOT, /* 100+ */
465 [ 0x7 ] = KEY_VOLUMEUP,
466 [ 0xb ] = KEY_VOLUMEDOWN,
467 [ 0x1a ] = KEY_KPPLUS,
468 [ 0x18 ] = KEY_KPMINUS,
471 [ 0xf ] = KEY_CHANNELUP,
472 [ 0x13 ] = KEY_CHANNELDOWN,
475 [ 0x1b ] = KEY_VIDEO, /* Video source */
476 [ 0x49 ] = KEY_LANGUAGE, /* MTS Select */
477 [ 0x19 ] = KEY_SEARCH, /* Auto Scan */
479 [ 0x4b ] = KEY_RECORD,
481 [ 0x45 ] = KEY_PAUSE, /* Pause */
483 [ 0x40 ] = KEY_FORWARD, /* Forward ? */
484 [ 0x42 ] = KEY_REWIND, /* Backward ? */
488 static IR_KEYTAB_TYPE ir_codes_pinnacle[IR_KEYTAB_SIZE] = {
490 [ 0x4a ] = KEY_POWER,
494 [ 0x3d ] = KEY_PRINT,
497 [ 0x04 ] = KEY_GREEN,
498 [ 0x11 ] = KEY_YELLOW,
501 [ 0x2d ] = KEY_VOLUMEUP,
502 [ 0x1e ] = KEY_VOLUMEDOWN,
506 [ 0x16 ] = KEY_CHANNELUP,
507 [ 0x17 ] = KEY_CHANNELDOWN,
512 [ 0x23 ] = KEY_RIGHT,
513 [ 0x0d ] = KEY_SELECT,
518 [ 0x07 ] = KEY_REFRESH,
521 [ 0x29 ] = KEY_RECORD,
523 [ 0x4b ] = KEY_PAUSE,
524 [ 0x4d ] = KEY_REWIND,
526 [ 0x4e ] = KEY_FORWARD,
527 [ 0x53 ] = KEY_PREVIOUS,
542 [ 0x74 ] = KEY_CHANNEL,
543 [ 0x0a ] = KEY_BACKSPACE,
546 /* Mapping for the 28 key remote control as seen at
547 http://www.sednacomputer.com/photo/cardbus-tv.jpg
548 Pavel Mihaylov <bin@bash.info> */
549 static IR_KEYTAB_TYPE pctv_sedna_codes[IR_KEYTAB_SIZE] = {
561 [ 0x0a ] = KEY_AGAIN, /* Recall */
562 [ 0x0b ] = KEY_CHANNELUP,
563 [ 0x0c ] = KEY_VOLUMEUP,
564 [ 0x0d ] = KEY_MODE, /* Stereo */
566 [ 0x0f ] = KEY_PREVIOUSSONG,
568 [ 0x11 ] = KEY_TUNER, /* Source */
569 [ 0x12 ] = KEY_POWER,
571 [ 0x15 ] = KEY_CHANNELDOWN,
572 [ 0x18 ] = KEY_VOLUMEDOWN,
573 [ 0x19 ] = KEY_SHUFFLE, /* Snapshot */
574 [ 0x1a ] = KEY_NEXTSONG,
575 [ 0x1b ] = KEY_TEXT, /* Time Shift */
576 [ 0x1c ] = KEY_RADIO, /* FM Radio */
577 [ 0x1d ] = KEY_RECORD,
578 [ 0x1e ] = KEY_PAUSE,
582 /* -------------------- GPIO generic keycode builder -------------------- */
584 static int build_key(struct saa7134_dev *dev)
586 struct saa7134_ir *ir = dev->remote;
589 /* rising SAA7134_GPIO_GPRESCAN reads the status */
590 saa_clearb(SAA7134_GPIO_GPMODE3,SAA7134_GPIO_GPRESCAN);
591 saa_setb(SAA7134_GPIO_GPMODE3,SAA7134_GPIO_GPRESCAN);
593 gpio = saa_readl(SAA7134_GPIO_GPSTATUS0 >> 2);
595 if (ir->last_gpio == gpio)
597 ir->last_gpio = gpio;
600 data = ir_extract_bits(gpio, ir->mask_keycode);
601 dprintk("build_key gpio=0x%x mask=0x%x data=%d\n",
602 gpio, ir->mask_keycode, data);
604 if ((ir->mask_keydown && (0 != (gpio & ir->mask_keydown))) ||
605 (ir->mask_keyup && (0 == (gpio & ir->mask_keyup)))) {
606 ir_input_keydown(ir->dev, &ir->ir, data, data);
608 ir_input_nokey(ir->dev, &ir->ir);
613 /* --------------------- Chip specific I2C key builders ----------------- */
615 static int get_key_purpletv(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
620 if (1 != i2c_master_recv(&ir->c,&b,1)) {
621 i2cdprintk("read error\n");
625 /* no button press */
638 /* The new pinnacle PCTV remote (with the colored buttons)
640 * Ricardo Cerqueira <v4l@cerqueira.org>
643 static int get_key_pinnacle(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
646 unsigned int start = 0,parity = 0,code = 0;
649 if (4 != i2c_master_recv(&ir->c,b,4)) {
650 i2cdprintk("read error\n");
654 for (start = 0; start<4; start++) {
655 if (b[start] == 0x80) {
657 parity=b[(start+2)%4];
666 if (ir->old == parity)
672 /* Reduce code value to fit inside IR_KEYTAB_SIZE
674 * this is the only value that results in 42 unique
683 i2cdprintk("Pinnacle PCTV key %02x\n", code);
689 void saa7134_input_irq(struct saa7134_dev *dev)
691 struct saa7134_ir *ir = dev->remote;
697 static void saa7134_input_timer(unsigned long data)
699 struct saa7134_dev *dev = (struct saa7134_dev*)data;
700 struct saa7134_ir *ir = dev->remote;
701 unsigned long timeout;
704 timeout = jiffies + (ir->polling * HZ / 1000);
705 mod_timer(&ir->timer, timeout);
708 int saa7134_input_init1(struct saa7134_dev *dev)
710 struct saa7134_ir *ir;
711 struct input_dev *input_dev;
712 IR_KEYTAB_TYPE *ir_codes = NULL;
713 u32 mask_keycode = 0;
714 u32 mask_keydown = 0;
717 int ir_type = IR_TYPE_OTHER;
719 if (dev->has_remote != SAA7134_REMOTE_GPIO)
724 /* detect & configure */
725 switch (dev->board) {
726 case SAA7134_BOARD_FLYVIDEO2000:
727 case SAA7134_BOARD_FLYVIDEO3000:
728 case SAA7134_BOARD_FLYTVPLATINUM_FM:
729 case SAA7134_BOARD_FLYTVPLATINUM_MINI2:
730 ir_codes = flyvideo_codes;
731 mask_keycode = 0xEC00000;
732 mask_keydown = 0x0040000;
734 case SAA7134_BOARD_CINERGY400:
735 case SAA7134_BOARD_CINERGY600:
736 case SAA7134_BOARD_CINERGY600_MK3:
737 ir_codes = cinergy_codes;
738 mask_keycode = 0x00003f;
739 mask_keyup = 0x040000;
741 case SAA7134_BOARD_ECS_TVP3XP:
742 case SAA7134_BOARD_ECS_TVP3XP_4CB5:
743 ir_codes = eztv_codes;
744 mask_keycode = 0x00017c;
745 mask_keyup = 0x000002;
748 case SAA7134_BOARD_KWORLD_XPERT:
749 case SAA7134_BOARD_AVACSSMARTTV:
750 ir_codes = avacssmart_codes;
751 mask_keycode = 0x00001F;
752 mask_keyup = 0x000020;
755 case SAA7134_BOARD_MD2819:
756 case SAA7134_BOARD_KWORLD_VSTREAM_XPERT:
757 case SAA7134_BOARD_AVERMEDIA_305:
758 case SAA7134_BOARD_AVERMEDIA_307:
759 case SAA7134_BOARD_AVERMEDIA_STUDIO_305:
760 case SAA7134_BOARD_AVERMEDIA_STUDIO_307:
761 case SAA7134_BOARD_AVERMEDIA_GO_007_FM:
762 ir_codes = md2819_codes;
763 mask_keycode = 0x0007C8;
764 mask_keydown = 0x000010;
766 /* Set GPIO pin2 to high to enable the IR controller */
767 saa_setb(SAA7134_GPIO_GPMODE0, 0x4);
768 saa_setb(SAA7134_GPIO_GPSTATUS0, 0x4);
770 case SAA7134_BOARD_KWORLD_TERMINATOR:
771 ir_codes = avacssmart_codes;
772 mask_keycode = 0x00001f;
773 mask_keyup = 0x000060;
776 case SAA7134_BOARD_MANLI_MTV001:
777 case SAA7134_BOARD_MANLI_MTV002:
778 case SAA7134_BOARD_BEHOLD_409FM:
779 ir_codes = manli_codes;
780 mask_keycode = 0x001f00;
781 mask_keyup = 0x004000;
784 case SAA7134_BOARD_SEDNA_PC_TV_CARDBUS:
785 ir_codes = pctv_sedna_codes;
786 mask_keycode = 0x001f00;
787 mask_keyup = 0x004000;
790 case SAA7134_BOARD_GOTVIEW_7135:
791 ir_codes = gotview7135_codes;
792 mask_keycode = 0x0003EC;
793 mask_keyup = 0x008000;
794 mask_keydown = 0x000010;
797 case SAA7134_BOARD_VIDEOMATE_TV_PVR:
798 case SAA7134_BOARD_VIDEOMATE_TV_GOLD_PLUSII:
799 ir_codes = videomate_tv_pvr_codes;
800 mask_keycode = 0x00003F;
801 mask_keyup = 0x400000;
804 case SAA7134_BOARD_VIDEOMATE_DVBT_300:
805 case SAA7134_BOARD_VIDEOMATE_DVBT_200:
806 ir_codes = videomate_tv_pvr_codes;
807 mask_keycode = 0x003F00;
808 mask_keyup = 0x040000;
811 if (NULL == ir_codes) {
812 printk("%s: Oops: IR config error [card=%d]\n",
813 dev->name, dev->board);
817 ir = kzalloc(sizeof(*ir), GFP_KERNEL);
818 input_dev = input_allocate_device();
819 if (!ir || !input_dev) {
821 input_free_device(input_dev);
825 /* init hardware-specific stuff */
826 ir->mask_keycode = mask_keycode;
827 ir->mask_keydown = mask_keydown;
828 ir->mask_keyup = mask_keyup;
829 ir->polling = polling;
831 /* init input device */
832 snprintf(ir->name, sizeof(ir->name), "saa7134 IR (%s)",
833 saa7134_boards[dev->board].name);
834 snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0",
837 ir_input_init(input_dev, &ir->ir, ir_type, ir_codes);
838 input_dev->name = ir->name;
839 input_dev->phys = ir->phys;
840 input_dev->id.bustype = BUS_PCI;
841 input_dev->id.version = 1;
842 if (dev->pci->subsystem_vendor) {
843 input_dev->id.vendor = dev->pci->subsystem_vendor;
844 input_dev->id.product = dev->pci->subsystem_device;
846 input_dev->id.vendor = dev->pci->vendor;
847 input_dev->id.product = dev->pci->device;
849 input_dev->cdev.dev = &dev->pci->dev;
854 init_timer(&ir->timer);
855 ir->timer.function = saa7134_input_timer;
856 ir->timer.data = (unsigned long)dev;
857 ir->timer.expires = jiffies + HZ;
858 add_timer(&ir->timer);
861 input_register_device(ir->dev);
865 void saa7134_input_fini(struct saa7134_dev *dev)
867 if (NULL == dev->remote)
870 if (dev->remote->polling)
871 del_timer_sync(&dev->remote->timer);
872 input_unregister_device(dev->remote->dev);
877 void saa7134_set_i2c_ir(struct saa7134_dev *dev, struct IR_i2c *ir)
880 dprintk("Found supported i2c remote, but IR has been disabled\n");
885 switch (dev->board) {
886 case SAA7134_BOARD_PINNACLE_PCTV_110i:
887 snprintf(ir->c.name, sizeof(ir->c.name), "Pinnacle PCTV");
888 ir->get_key = get_key_pinnacle;
889 ir->ir_codes = ir_codes_pinnacle;
891 case SAA7134_BOARD_UPMOST_PURPLE_TV:
892 snprintf(ir->c.name, sizeof(ir->c.name), "Purple TV");
893 ir->get_key = get_key_purpletv;
894 ir->ir_codes = ir_codes_purpletv;
897 dprintk("Shouldn't get here: Unknown board %x for I2C IR?\n",dev->board);
902 /* ----------------------------------------------------------------------