aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/cx88
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2014-04-03 19:31:30 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-07-23 20:50:48 -0400
commit120703f9eb32033f0e39bdc552c0273c8ab45f33 (patch)
tree427e55aad9dcfcb91e99b98d508e6fb407e8f600 /drivers/media/pci/cx88
parentaf3a4a9bbeb00df3e42e77240b4cdac5479812f9 (diff)
[media] rc-core: document the protocol type
Right now the protocol information is not preserved, rc-core gets handed a scancode but has no idea which protocol it corresponds to. This patch (which required reading through the source/keymap for all drivers, not fun) makes the protocol information explicit which is important documentation and makes it easier to e.g. support multiple protocols with one decoder (think rc5 and rc-streamzap). The information isn't used yet so there should be no functional changes. [m.chehab@samsung.com: rebased, added cxusb and removed bad whitespacing] Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/pci/cx88')
-rw-r--r--drivers/media/pci/cx88/cx88-input.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/drivers/media/pci/cx88/cx88-input.c b/drivers/media/pci/cx88/cx88-input.c
index 779fc630327a..9bf48ca619c7 100644
--- a/drivers/media/pci/cx88/cx88-input.c
+++ b/drivers/media/pci/cx88/cx88-input.c
@@ -130,25 +130,41 @@ static void cx88_ir_handle_key(struct cx88_IR *ir)
130 130
131 data = (data << 4) | ((gpio_key & 0xf0) >> 4); 131 data = (data << 4) | ((gpio_key & 0xf0) >> 4);
132 132
133 rc_keydown(ir->dev, data, 0); 133 rc_keydown(ir->dev, RC_TYPE_UNKNOWN, data, 0);
134
135 } else if (ir->core->boardnr == CX88_BOARD_PROLINK_PLAYTVPVR ||
136 ir->core->boardnr == CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO) {
137 /* bit cleared on keydown, NEC scancode, 0xAAAACC, A = 0x866b */
138 u16 addr;
139 u8 cmd;
140 u32 scancode;
141
142 addr = (data >> 8) & 0xffff;
143 cmd = (data >> 0) & 0x00ff;
144 scancode = RC_SCANCODE_NECX(addr, cmd);
145
146 if (0 == (gpio & ir->mask_keyup))
147 rc_keydown_notimeout(ir->dev, RC_TYPE_NEC, scancode, 0);
148 else
149 rc_keyup(ir->dev);
134 150
135 } else if (ir->mask_keydown) { 151 } else if (ir->mask_keydown) {
136 /* bit set on keydown */ 152 /* bit set on keydown */
137 if (gpio & ir->mask_keydown) 153 if (gpio & ir->mask_keydown)
138 rc_keydown_notimeout(ir->dev, data, 0); 154 rc_keydown_notimeout(ir->dev, RC_TYPE_UNKNOWN, data, 0);
139 else 155 else
140 rc_keyup(ir->dev); 156 rc_keyup(ir->dev);
141 157
142 } else if (ir->mask_keyup) { 158 } else if (ir->mask_keyup) {
143 /* bit cleared on keydown */ 159 /* bit cleared on keydown */
144 if (0 == (gpio & ir->mask_keyup)) 160 if (0 == (gpio & ir->mask_keyup))
145 rc_keydown_notimeout(ir->dev, data, 0); 161 rc_keydown_notimeout(ir->dev, RC_TYPE_UNKNOWN, data, 0);
146 else 162 else
147 rc_keyup(ir->dev); 163 rc_keyup(ir->dev);
148 164
149 } else { 165 } else {
150 /* can't distinguish keydown/up :-/ */ 166 /* can't distinguish keydown/up :-/ */
151 rc_keydown_notimeout(ir->dev, data, 0); 167 rc_keydown_notimeout(ir->dev, RC_TYPE_UNKNOWN, data, 0);
152 rc_keyup(ir->dev); 168 rc_keyup(ir->dev);
153 } 169 }
154} 170}
@@ -329,6 +345,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
329 * 002-T mini RC, provided with newer PV hardware 345 * 002-T mini RC, provided with newer PV hardware
330 */ 346 */
331 ir_codes = RC_MAP_PIXELVIEW_MK12; 347 ir_codes = RC_MAP_PIXELVIEW_MK12;
348 rc_type = RC_BIT_NEC;
332 ir->gpio_addr = MO_GP1_IO; 349 ir->gpio_addr = MO_GP1_IO;
333 ir->mask_keyup = 0x80; 350 ir->mask_keyup = 0x80;
334 ir->polling = 10; /* ms */ 351 ir->polling = 10; /* ms */
@@ -416,7 +433,6 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
416 break; 433 break;
417 case CX88_BOARD_TWINHAN_VP1027_DVBS: 434 case CX88_BOARD_TWINHAN_VP1027_DVBS:
418 ir_codes = RC_MAP_TWINHAN_VP1027_DVBS; 435 ir_codes = RC_MAP_TWINHAN_VP1027_DVBS;
419 rc_type = RC_BIT_NEC;
420 ir->sampling = 0xff00; /* address */ 436 ir->sampling = 0xff00; /* address */
421 break; 437 break;
422 } 438 }