aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-input.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-input.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-input.c52
1 files changed, 5 insertions, 47 deletions
diff --git a/drivers/media/video/em28xx/em28xx-input.c b/drivers/media/video/em28xx/em28xx-input.c
index e3894b68c4e..10da2fd8d98 100644
--- a/drivers/media/video/em28xx/em28xx-input.c
+++ b/drivers/media/video/em28xx/em28xx-input.c
@@ -30,11 +30,7 @@
30 30
31#include "em28xx.h" 31#include "em28xx.h"
32 32
33static unsigned int disable_ir = 0; 33static unsigned int ir_debug;
34module_param(disable_ir, int, 0444);
35MODULE_PARM_DESC(disable_ir,"disable infrared remote support");
36
37static unsigned int ir_debug = 0;
38module_param(ir_debug, int, 0644); 34module_param(ir_debug, int, 0644);
39MODULE_PARM_DESC(ir_debug,"enable debug messages [IR]"); 35MODULE_PARM_DESC(ir_debug,"enable debug messages [IR]");
40 36
@@ -43,7 +39,7 @@ MODULE_PARM_DESC(ir_debug,"enable debug messages [IR]");
43 39
44/* ----------------------------------------------------------------------- */ 40/* ----------------------------------------------------------------------- */
45 41
46static int get_key_terratec(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) 42int em28xx_get_key_terratec(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
47{ 43{
48 unsigned char b; 44 unsigned char b;
49 45
@@ -72,7 +68,7 @@ static int get_key_terratec(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
72} 68}
73 69
74 70
75static int get_key_em_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) 71int em28xx_get_key_em_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
76{ 72{
77 unsigned char buf[2]; 73 unsigned char buf[2];
78 unsigned char code; 74 unsigned char code;
@@ -103,7 +99,8 @@ static int get_key_em_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
103 return 1; 99 return 1;
104} 100}
105 101
106static int get_key_pinnacle_usb_grey(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) 102int em28xx_get_key_pinnacle_usb_grey(struct IR_i2c *ir, u32 *ir_key,
103 u32 *ir_raw)
107{ 104{
108 unsigned char buf[3]; 105 unsigned char buf[3];
109 106
@@ -125,45 +122,6 @@ static int get_key_pinnacle_usb_grey(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw
125 return 1; 122 return 1;
126} 123}
127 124
128/* ----------------------------------------------------------------------- */
129void em28xx_set_ir(struct em28xx * dev,struct IR_i2c *ir)
130{
131 if (disable_ir) {
132 ir->get_key=NULL;
133 return ;
134 }
135
136 /* detect & configure */
137 switch (dev->model) {
138 case (EM2800_BOARD_UNKNOWN):
139 break;
140 case (EM2820_BOARD_UNKNOWN):
141 break;
142 case (EM2800_BOARD_TERRATEC_CINERGY_200):
143 case (EM2820_BOARD_TERRATEC_CINERGY_250):
144 ir->ir_codes = ir_codes_em_terratec;
145 ir->get_key = get_key_terratec;
146 snprintf(ir->c.name, sizeof(ir->c.name), "i2c IR (EM28XX Terratec)");
147 break;
148 case (EM2820_BOARD_PINNACLE_USB_2):
149 ir->ir_codes = ir_codes_pinnacle_grey;
150 ir->get_key = get_key_pinnacle_usb_grey;
151 snprintf(ir->c.name, sizeof(ir->c.name), "i2c IR (EM28XX Pinnacle PCTV)");
152 break;
153 case (EM2820_BOARD_HAUPPAUGE_WINTV_USB_2):
154 ir->ir_codes = ir_codes_hauppauge_new;
155 ir->get_key = get_key_em_haup;
156 snprintf(ir->c.name, sizeof(ir->c.name), "i2c IR (EM2840 Hauppauge)");
157 break;
158 case (EM2820_BOARD_MSI_VOX_USB_2):
159 break;
160 case (EM2800_BOARD_LEADTEK_WINFAST_USBII):
161 break;
162 case (EM2800_BOARD_KWORLD_USB2800):
163 break;
164 }
165}
166
167/* ---------------------------------------------------------------------- 125/* ----------------------------------------------------------------------
168 * Local variables: 126 * Local variables:
169 * c-basic-offset: 8 127 * c-basic-offset: 8