diff options
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-input.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-input.c | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c index 8cfeb2bde90f..7f4212928e9f 100644 --- a/drivers/media/video/saa7134/saa7134-input.c +++ b/drivers/media/video/saa7134/saa7134-input.c | |||
@@ -52,6 +52,11 @@ module_param(repeat_period, int, 0644); | |||
52 | MODULE_PARM_DESC(repeat_period, "repeat period between " | 52 | MODULE_PARM_DESC(repeat_period, "repeat period between " |
53 | "keypresses when key is down"); | 53 | "keypresses when key is down"); |
54 | 54 | ||
55 | static unsigned int disable_other_ir; | ||
56 | module_param(disable_other_ir, int, 0644); | ||
57 | MODULE_PARM_DESC(disable_other_ir, "disable full codes of " | ||
58 | "alternative remotes from other manufacturers"); | ||
59 | |||
55 | #define dprintk(fmt, arg...) if (ir_debug) \ | 60 | #define dprintk(fmt, arg...) if (ir_debug) \ |
56 | printk(KERN_DEBUG "%s/ir: " fmt, dev->name , ## arg) | 61 | printk(KERN_DEBUG "%s/ir: " fmt, dev->name , ## arg) |
57 | #define i2cdprintk(fmt, arg...) if (ir_debug) \ | 62 | #define i2cdprintk(fmt, arg...) if (ir_debug) \ |
@@ -154,6 +159,45 @@ static int get_key_hvr1110(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) | |||
154 | return 1; | 159 | return 1; |
155 | } | 160 | } |
156 | 161 | ||
162 | |||
163 | static int get_key_beholdm6xx(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) | ||
164 | { | ||
165 | unsigned char data[12]; | ||
166 | u32 gpio; | ||
167 | |||
168 | struct saa7134_dev *dev = ir->c.adapter->algo_data; | ||
169 | |||
170 | /* rising SAA7134_GPIO_GPRESCAN reads the status */ | ||
171 | saa_clearb(SAA7134_GPIO_GPMODE3, SAA7134_GPIO_GPRESCAN); | ||
172 | saa_setb(SAA7134_GPIO_GPMODE3, SAA7134_GPIO_GPRESCAN); | ||
173 | |||
174 | gpio = saa_readl(SAA7134_GPIO_GPSTATUS0 >> 2); | ||
175 | |||
176 | if (0x400000 &~ gpio) | ||
177 | return 0; /* No button press */ | ||
178 | |||
179 | ir->c.addr = 0x5a >> 1; | ||
180 | |||
181 | if (12 != i2c_master_recv(&ir->c, data, 12)) { | ||
182 | i2cdprintk("read error\n"); | ||
183 | return -EIO; | ||
184 | } | ||
185 | /* IR of this card normally decode signals NEC-standard from | ||
186 | * - Sven IHOO MT 5.1R remote. xxyye718 | ||
187 | * - Sven DVD HD-10xx remote. xxyyf708 | ||
188 | * - BBK ... | ||
189 | * - mayby others | ||
190 | * So, skip not our, if disable full codes mode. | ||
191 | */ | ||
192 | if (data[10] != 0x6b && data[11] != 0x86 && disable_other_ir) | ||
193 | return 0; | ||
194 | |||
195 | *ir_key = data[9]; | ||
196 | *ir_raw = data[9]; | ||
197 | |||
198 | return 1; | ||
199 | } | ||
200 | |||
157 | void saa7134_input_irq(struct saa7134_dev *dev) | 201 | void saa7134_input_irq(struct saa7134_dev *dev) |
158 | { | 202 | { |
159 | struct card_ir *ir = dev->remote; | 203 | struct card_ir *ir = dev->remote; |
@@ -288,6 +332,16 @@ int saa7134_input_init1(struct saa7134_dev *dev) | |||
288 | case SAA7134_BOARD_MANLI_MTV001: | 332 | case SAA7134_BOARD_MANLI_MTV001: |
289 | case SAA7134_BOARD_MANLI_MTV002: | 333 | case SAA7134_BOARD_MANLI_MTV002: |
290 | case SAA7134_BOARD_BEHOLD_409FM: | 334 | case SAA7134_BOARD_BEHOLD_409FM: |
335 | case SAA7134_BOARD_BEHOLD_401: | ||
336 | case SAA7134_BOARD_BEHOLD_403: | ||
337 | case SAA7134_BOARD_BEHOLD_403FM: | ||
338 | case SAA7134_BOARD_BEHOLD_405: | ||
339 | case SAA7134_BOARD_BEHOLD_405FM: | ||
340 | case SAA7134_BOARD_BEHOLD_407: | ||
341 | case SAA7134_BOARD_BEHOLD_407FM: | ||
342 | case SAA7134_BOARD_BEHOLD_409: | ||
343 | case SAA7134_BOARD_BEHOLD_505FM: | ||
344 | case SAA7134_BOARD_BEHOLD_507_9FM: | ||
291 | ir_codes = ir_codes_manli; | 345 | ir_codes = ir_codes_manli; |
292 | mask_keycode = 0x001f00; | 346 | mask_keycode = 0x001f00; |
293 | mask_keyup = 0x004000; | 347 | mask_keyup = 0x004000; |
@@ -458,6 +512,12 @@ void saa7134_set_i2c_ir(struct saa7134_dev *dev, struct IR_i2c *ir) | |||
458 | ir->get_key = get_key_hvr1110; | 512 | ir->get_key = get_key_hvr1110; |
459 | ir->ir_codes = ir_codes_hauppauge_new; | 513 | ir->ir_codes = ir_codes_hauppauge_new; |
460 | break; | 514 | break; |
515 | case SAA7134_BOARD_BEHOLD_607_9FM: | ||
516 | case SAA7134_BOARD_BEHOLD_M6: | ||
517 | snprintf(ir->c.name, sizeof(ir->c.name), "BeholdTV"); | ||
518 | ir->get_key = get_key_beholdm6xx; | ||
519 | ir->ir_codes = ir_codes_behold; | ||
520 | break; | ||
461 | default: | 521 | default: |
462 | dprintk("Shouldn't get here: Unknown board %x for I2C IR?\n",dev->board); | 522 | dprintk("Shouldn't get here: Unknown board %x for I2C IR?\n",dev->board); |
463 | break; | 523 | break; |