aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/rc-main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/rc/rc-main.c')
-rw-r--r--drivers/media/rc/rc-main.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index 11e2703ef1c4..f3244eba66c6 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -102,7 +102,7 @@ static struct rc_keymap empty_map = {
102 .map = { 102 .map = {
103 .scan = empty, 103 .scan = empty,
104 .size = ARRAY_SIZE(empty), 104 .size = ARRAY_SIZE(empty),
105 .ir_type = IR_TYPE_UNKNOWN, /* Legacy IR type */ 105 .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
106 .name = RC_MAP_EMPTY, 106 .name = RC_MAP_EMPTY,
107 } 107 }
108}; 108};
@@ -111,7 +111,7 @@ static struct rc_keymap empty_map = {
111 * ir_create_table() - initializes a scancode table 111 * ir_create_table() - initializes a scancode table
112 * @rc_tab: the ir_scancode_table to initialize 112 * @rc_tab: the ir_scancode_table to initialize
113 * @name: name to assign to the table 113 * @name: name to assign to the table
114 * @ir_type: ir type to assign to the new table 114 * @rc_type: ir type to assign to the new table
115 * @size: initial size of the table 115 * @size: initial size of the table
116 * @return: zero on success or a negative error code 116 * @return: zero on success or a negative error code
117 * 117 *
@@ -119,10 +119,10 @@ static struct rc_keymap empty_map = {
119 * memory to hold at least the specified number of elements. 119 * memory to hold at least the specified number of elements.
120 */ 120 */
121static int ir_create_table(struct ir_scancode_table *rc_tab, 121static int ir_create_table(struct ir_scancode_table *rc_tab,
122 const char *name, u64 ir_type, size_t size) 122 const char *name, u64 rc_type, size_t size)
123{ 123{
124 rc_tab->name = name; 124 rc_tab->name = name;
125 rc_tab->ir_type = ir_type; 125 rc_tab->rc_type = rc_type;
126 rc_tab->alloc = roundup_pow_of_two(size * sizeof(struct ir_scancode)); 126 rc_tab->alloc = roundup_pow_of_two(size * sizeof(struct ir_scancode));
127 rc_tab->size = rc_tab->alloc / sizeof(struct ir_scancode); 127 rc_tab->size = rc_tab->alloc / sizeof(struct ir_scancode);
128 rc_tab->scan = kmalloc(rc_tab->alloc, GFP_KERNEL); 128 rc_tab->scan = kmalloc(rc_tab->alloc, GFP_KERNEL);
@@ -372,7 +372,7 @@ static int ir_setkeytable(struct rc_dev *dev,
372 int rc; 372 int rc;
373 373
374 rc = ir_create_table(rc_tab, from->name, 374 rc = ir_create_table(rc_tab, from->name,
375 from->ir_type, from->size); 375 from->rc_type, from->size);
376 if (rc) 376 if (rc)
377 return rc; 377 return rc;
378 378
@@ -719,14 +719,14 @@ static struct {
719 u64 type; 719 u64 type;
720 char *name; 720 char *name;
721} proto_names[] = { 721} proto_names[] = {
722 { IR_TYPE_UNKNOWN, "unknown" }, 722 { RC_TYPE_UNKNOWN, "unknown" },
723 { IR_TYPE_RC5, "rc-5" }, 723 { RC_TYPE_RC5, "rc-5" },
724 { IR_TYPE_NEC, "nec" }, 724 { RC_TYPE_NEC, "nec" },
725 { IR_TYPE_RC6, "rc-6" }, 725 { RC_TYPE_RC6, "rc-6" },
726 { IR_TYPE_JVC, "jvc" }, 726 { RC_TYPE_JVC, "jvc" },
727 { IR_TYPE_SONY, "sony" }, 727 { RC_TYPE_SONY, "sony" },
728 { IR_TYPE_RC5_SZ, "rc-5-sz" }, 728 { RC_TYPE_RC5_SZ, "rc-5-sz" },
729 { IR_TYPE_LIRC, "lirc" }, 729 { RC_TYPE_LIRC, "lirc" },
730}; 730};
731 731
732#define PROTO_NONE "none" 732#define PROTO_NONE "none"
@@ -755,7 +755,7 @@ static ssize_t show_protocols(struct device *device,
755 return -EINVAL; 755 return -EINVAL;
756 756
757 if (dev->driver_type == RC_DRIVER_SCANCODE) { 757 if (dev->driver_type == RC_DRIVER_SCANCODE) {
758 enabled = dev->rc_tab.ir_type; 758 enabled = dev->rc_tab.rc_type;
759 allowed = dev->allowed_protos; 759 allowed = dev->allowed_protos;
760 } else { 760 } else {
761 enabled = dev->raw->enabled_protocols; 761 enabled = dev->raw->enabled_protocols;
@@ -813,7 +813,7 @@ static ssize_t store_protocols(struct device *device,
813 return -EINVAL; 813 return -EINVAL;
814 814
815 if (dev->driver_type == RC_DRIVER_SCANCODE) 815 if (dev->driver_type == RC_DRIVER_SCANCODE)
816 type = dev->rc_tab.ir_type; 816 type = dev->rc_tab.rc_type;
817 else if (dev->raw) 817 else if (dev->raw)
818 type = dev->raw->enabled_protocols; 818 type = dev->raw->enabled_protocols;
819 else { 819 else {
@@ -881,7 +881,7 @@ static ssize_t store_protocols(struct device *device,
881 881
882 if (dev->driver_type == RC_DRIVER_SCANCODE) { 882 if (dev->driver_type == RC_DRIVER_SCANCODE) {
883 spin_lock_irqsave(&dev->rc_tab.lock, flags); 883 spin_lock_irqsave(&dev->rc_tab.lock, flags);
884 dev->rc_tab.ir_type = type; 884 dev->rc_tab.rc_type = type;
885 spin_unlock_irqrestore(&dev->rc_tab.lock, flags); 885 spin_unlock_irqrestore(&dev->rc_tab.lock, flags);
886 } else { 886 } else {
887 dev->raw->enabled_protocols = type; 887 dev->raw->enabled_protocols = type;
@@ -1052,7 +1052,7 @@ int rc_register_device(struct rc_dev *dev)
1052 } 1052 }
1053 1053
1054 if (dev->change_protocol) { 1054 if (dev->change_protocol) {
1055 rc = dev->change_protocol(dev, rc_tab->ir_type); 1055 rc = dev->change_protocol(dev, rc_tab->rc_type);
1056 if (rc < 0) 1056 if (rc < 0)
1057 goto out_raw; 1057 goto out_raw;
1058 } 1058 }