aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-input.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx88/cx88-input.c')
-rw-r--r--drivers/media/video/cx88/cx88-input.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c
index 78a63b7dd380..72b630a91f41 100644
--- a/drivers/media/video/cx88/cx88-input.c
+++ b/drivers/media/video/cx88/cx88-input.c
@@ -70,14 +70,33 @@ MODULE_PARM_DESC(ir_debug, "enable debug messages [IR]");
70static void cx88_ir_handle_key(struct cx88_IR *ir) 70static void cx88_ir_handle_key(struct cx88_IR *ir)
71{ 71{
72 struct cx88_core *core = ir->core; 72 struct cx88_core *core = ir->core;
73 u32 gpio, data; 73 u32 gpio, data, auxgpio;
74 74
75 /* read gpio value */ 75 /* read gpio value */
76 gpio = cx_read(ir->gpio_addr); 76 gpio = cx_read(ir->gpio_addr);
77 if (core->board == CX88_BOARD_NPGTECH_REALTV_TOP10FM) {
78 /* This board apparently uses a combination of 2 GPIO
79 to represent the keys. Additionally, the second GPIO
80 can be used for parity.
81
82 Example:
83
84 for key "5"
85 gpio = 0x758, auxgpio = 0xe5 or 0xf5
86 for key "Power"
87 gpio = 0x758, auxgpio = 0xed or 0xfd
88 */
89
90 auxgpio = cx_read(MO_GP1_IO);
91 /* Take out the parity part */
92 gpio+=(gpio & 0x7fd) + (auxgpio & 0xef);
93 } else
94 auxgpio = gpio;
95
77 if (ir->polling) { 96 if (ir->polling) {
78 if (ir->last_gpio == gpio) 97 if (ir->last_gpio == auxgpio)
79 return; 98 return;
80 ir->last_gpio = gpio; 99 ir->last_gpio = auxgpio;
81 } 100 }
82 101
83 /* extract data */ 102 /* extract data */
@@ -172,12 +191,13 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
172 ir_type = IR_TYPE_RC5; 191 ir_type = IR_TYPE_RC5;
173 ir->sampling = 1; 192 ir->sampling = 1;
174 break; 193 break;
194 case CX88_BOARD_WINFAST_DTV2000H:
175 case CX88_BOARD_WINFAST2000XP_EXPERT: 195 case CX88_BOARD_WINFAST2000XP_EXPERT:
176 ir_codes = ir_codes_winfast; 196 ir_codes = ir_codes_winfast;
177 ir->gpio_addr = MO_GP0_IO; 197 ir->gpio_addr = MO_GP0_IO;
178 ir->mask_keycode = 0x8f8; 198 ir->mask_keycode = 0x8f8;
179 ir->mask_keyup = 0x100; 199 ir->mask_keyup = 0x100;
180 ir->polling = 1; /* ms */ 200 ir->polling = 50; /* ms */
181 break; 201 break;
182 case CX88_BOARD_IODATA_GVBCTV7E: 202 case CX88_BOARD_IODATA_GVBCTV7E:
183 ir_codes = ir_codes_iodata_bctv7e; 203 ir_codes = ir_codes_iodata_bctv7e;
@@ -228,6 +248,12 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
228 ir_type = IR_TYPE_PD; 248 ir_type = IR_TYPE_PD;
229 ir->sampling = 0xff00; /* address */ 249 ir->sampling = 0xff00; /* address */
230 break; 250 break;
251 case CX88_BOARD_NPGTECH_REALTV_TOP10FM:
252 ir_codes = ir_codes_npgtech;
253 ir->gpio_addr = MO_GP0_IO;
254 ir->mask_keycode = 0xfa;
255 ir->polling = 50; /* ms */
256 break;
231 } 257 }
232 258
233 if (NULL == ir_codes) { 259 if (NULL == ir_codes) {