aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/cx88
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2012-10-11 18:11:54 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-10-27 09:49:51 -0400
commitc003ab1bedf028db15b0185b683d5c387204e8f5 (patch)
tree00f608e80e897589492eb2274c46ffb9fde769cf /drivers/media/pci/cx88
parent304ce75dd501d84d33dbca3c544e903f1d3377f7 (diff)
[media] rc-core: add separate defines for protocol bitmaps and numbers
The RC_TYPE_* defines are currently used both where a single protocol is expected and where a bitmap of protocols is expected. Functions like rc_keydown() and functions which add/remove entries to the keytable want a single protocol. Future userspace APIs would also benefit from numeric protocols (rather than bitmap ones). Keytables are smaller if they can use a small(ish) integer rather than a bitmap. Other functions or struct members (e.g. allowed_protos, enabled_protocols, etc) accept multiple protocols and need a bitmap. Using different types reduces the risk of programmer error. Using a protocol enum whereever possible also makes for a more future-proof user-space API as we don't need to worry about a sufficient number of bits being available (e.g. in structs used for ioctl() calls). The use of both a number and a corresponding bit is dalso one in e.g. the input subsystem as well (see all the references to set/clear bit when changing keytables for example). This patch separate the different usages in preparation for upcoming patches. Where a single protocol is expected, enum rc_type is used; where one or more protocol(s) are expected, something like u64 is used. The patch has been rewritten so that the format of the sysfs "protocols" file is no longer altered (at the loss of some detail). The file itself should probably be deprecated in the future though. Signed-off-by: David Härdeman <david@hardeman.nu> Cc: Andy Walls <awalls@md.metrocast.net> Cc: Maxim Levitsky <maximlevitsky@gmail.com> Cc: Antti Palosaari <crope@iki.fi> Cc: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/pci/cx88')
-rw-r--r--drivers/media/pci/cx88/cx88-input.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/pci/cx88/cx88-input.c b/drivers/media/pci/cx88/cx88-input.c
index ebf448c48ca3..f29e18c72f44 100644
--- a/drivers/media/pci/cx88/cx88-input.c
+++ b/drivers/media/pci/cx88/cx88-input.c
@@ -248,7 +248,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
248 struct cx88_IR *ir; 248 struct cx88_IR *ir;
249 struct rc_dev *dev; 249 struct rc_dev *dev;
250 char *ir_codes = NULL; 250 char *ir_codes = NULL;
251 u64 rc_type = RC_TYPE_OTHER; 251 u64 rc_type = RC_BIT_OTHER;
252 int err = -ENOMEM; 252 int err = -ENOMEM;
253 u32 hardware_mask = 0; /* For devices with a hardware mask, when 253 u32 hardware_mask = 0; /* For devices with a hardware mask, when
254 * used with a full-code IR table 254 * used with a full-code IR table
@@ -416,7 +416,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
416 break; 416 break;
417 case CX88_BOARD_TWINHAN_VP1027_DVBS: 417 case CX88_BOARD_TWINHAN_VP1027_DVBS:
418 ir_codes = RC_MAP_TWINHAN_VP1027_DVBS; 418 ir_codes = RC_MAP_TWINHAN_VP1027_DVBS;
419 rc_type = RC_TYPE_NEC; 419 rc_type = RC_BIT_NEC;
420 ir->sampling = 0xff00; /* address */ 420 ir->sampling = 0xff00; /* address */
421 break; 421 break;
422 } 422 }
@@ -592,7 +592,7 @@ void cx88_i2c_init_ir(struct cx88_core *core)
592 case CX88_BOARD_LEADTEK_PVR2000: 592 case CX88_BOARD_LEADTEK_PVR2000:
593 addr_list = pvr2000_addr_list; 593 addr_list = pvr2000_addr_list;
594 core->init_data.name = "cx88 Leadtek PVR 2000 remote"; 594 core->init_data.name = "cx88 Leadtek PVR 2000 remote";
595 core->init_data.type = RC_TYPE_UNKNOWN; 595 core->init_data.type = RC_BIT_UNKNOWN;
596 core->init_data.get_key = get_key_pvr2000; 596 core->init_data.get_key = get_key_pvr2000;
597 core->init_data.ir_codes = RC_MAP_EMPTY; 597 core->init_data.ir_codes = RC_MAP_EMPTY;
598 break; 598 break;
@@ -613,7 +613,7 @@ void cx88_i2c_init_ir(struct cx88_core *core)
613 /* Hauppauge XVR */ 613 /* Hauppauge XVR */
614 core->init_data.name = "cx88 Hauppauge XVR remote"; 614 core->init_data.name = "cx88 Hauppauge XVR remote";
615 core->init_data.ir_codes = RC_MAP_HAUPPAUGE; 615 core->init_data.ir_codes = RC_MAP_HAUPPAUGE;
616 core->init_data.type = RC_TYPE_RC5; 616 core->init_data.type = RC_BIT_RC5;
617 core->init_data.internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; 617 core->init_data.internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
618 618
619 info.platform_data = &core->init_data; 619 info.platform_data = &core->init_data;