aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/tm6000/tm6000-input.c
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2017-08-07 16:20:58 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-08-20 10:02:48 -0400
commit6d741bfed5ed06ed42a16d30f1ed7afdcaf7f092 (patch)
treeba80456506b89d858a91daddde92237b93fabe1c /drivers/media/usb/tm6000/tm6000-input.c
parenta9a249a2c997506a64eaee22f1458fda893f62a8 (diff)
media: rc: rename RC_TYPE_* to RC_PROTO_* and RC_BIT_* to RC_PROTO_BIT_*
RC_TYPE is confusing and it's just the protocol. So rename it. Suggested-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Sean Young <sean@mess.org> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/usb/tm6000/tm6000-input.c')
-rw-r--r--drivers/media/usb/tm6000/tm6000-input.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/media/usb/tm6000/tm6000-input.c b/drivers/media/usb/tm6000/tm6000-input.c
index 83e33aef0105..91889ad9cdd7 100644
--- a/drivers/media/usb/tm6000/tm6000-input.c
+++ b/drivers/media/usb/tm6000/tm6000-input.c
@@ -66,7 +66,7 @@ struct tm6000_IR {
66 struct urb *int_urb; 66 struct urb *int_urb;
67 67
68 /* IR device properties */ 68 /* IR device properties */
69 u64 rc_type; 69 u64 rc_proto;
70}; 70};
71 71
72void tm6000_ir_wait(struct tm6000_core *dev, u8 state) 72void tm6000_ir_wait(struct tm6000_core *dev, u8 state)
@@ -103,13 +103,13 @@ static int tm6000_ir_config(struct tm6000_IR *ir)
103 * IR, in order to discard such decoding 103 * IR, in order to discard such decoding
104 */ 104 */
105 105
106 switch (ir->rc_type) { 106 switch (ir->rc_proto) {
107 case RC_BIT_NEC: 107 case RC_PROTO_BIT_NEC:
108 leader = 900; /* ms */ 108 leader = 900; /* ms */
109 pulse = 700; /* ms - the actual value would be 562 */ 109 pulse = 700; /* ms - the actual value would be 562 */
110 break; 110 break;
111 default: 111 default:
112 case RC_BIT_RC5: 112 case RC_PROTO_BIT_RC5:
113 leader = 900; /* ms - from the NEC decoding */ 113 leader = 900; /* ms - from the NEC decoding */
114 pulse = 1780; /* ms - The actual value would be 1776 */ 114 pulse = 1780; /* ms - The actual value would be 1776 */
115 break; 115 break;
@@ -117,12 +117,12 @@ static int tm6000_ir_config(struct tm6000_IR *ir)
117 117
118 pulse = ir_clock_mhz * pulse; 118 pulse = ir_clock_mhz * pulse;
119 leader = ir_clock_mhz * leader; 119 leader = ir_clock_mhz * leader;
120 if (ir->rc_type == RC_BIT_NEC) 120 if (ir->rc_proto == RC_PROTO_BIT_NEC)
121 leader = leader | 0x8000; 121 leader = leader | 0x8000;
122 122
123 dprintk(2, "%s: %s, %d MHz, leader = 0x%04x, pulse = 0x%06x \n", 123 dprintk(2, "%s: %s, %d MHz, leader = 0x%04x, pulse = 0x%06x \n",
124 __func__, 124 __func__,
125 (ir->rc_type == RC_BIT_NEC) ? "NEC" : "RC-5", 125 (ir->rc_proto == RC_PROTO_BIT_NEC) ? "NEC" : "RC-5",
126 ir_clock_mhz, leader, pulse); 126 ir_clock_mhz, leader, pulse);
127 127
128 /* Remote WAKEUP = enable, normal mode, from IR decoder output */ 128 /* Remote WAKEUP = enable, normal mode, from IR decoder output */
@@ -162,24 +162,24 @@ static void tm6000_ir_keydown(struct tm6000_IR *ir,
162{ 162{
163 u8 device, command; 163 u8 device, command;
164 u32 scancode; 164 u32 scancode;
165 enum rc_type protocol; 165 enum rc_proto protocol;
166 166
167 if (len < 1) 167 if (len < 1)
168 return; 168 return;
169 169
170 command = buf[0]; 170 command = buf[0];
171 device = (len > 1 ? buf[1] : 0x0); 171 device = (len > 1 ? buf[1] : 0x0);
172 switch (ir->rc_type) { 172 switch (ir->rc_proto) {
173 case RC_BIT_RC5: 173 case RC_PROTO_BIT_RC5:
174 protocol = RC_TYPE_RC5; 174 protocol = RC_PROTO_RC5;
175 scancode = RC_SCANCODE_RC5(device, command); 175 scancode = RC_SCANCODE_RC5(device, command);
176 break; 176 break;
177 case RC_BIT_NEC: 177 case RC_PROTO_BIT_NEC:
178 protocol = RC_TYPE_NEC; 178 protocol = RC_PROTO_NEC;
179 scancode = RC_SCANCODE_NEC(device, command); 179 scancode = RC_SCANCODE_NEC(device, command);
180 break; 180 break;
181 default: 181 default:
182 protocol = RC_TYPE_OTHER; 182 protocol = RC_PROTO_OTHER;
183 scancode = RC_SCANCODE_OTHER(device << 8 | command); 183 scancode = RC_SCANCODE_OTHER(device << 8 | command);
184 break; 184 break;
185 } 185 }
@@ -311,7 +311,7 @@ static void tm6000_ir_stop(struct rc_dev *rc)
311 cancel_delayed_work_sync(&ir->work); 311 cancel_delayed_work_sync(&ir->work);
312} 312}
313 313
314static int tm6000_ir_change_protocol(struct rc_dev *rc, u64 *rc_type) 314static int tm6000_ir_change_protocol(struct rc_dev *rc, u64 *rc_proto)
315{ 315{
316 struct tm6000_IR *ir = rc->priv; 316 struct tm6000_IR *ir = rc->priv;
317 317
@@ -320,7 +320,7 @@ static int tm6000_ir_change_protocol(struct rc_dev *rc, u64 *rc_type)
320 320
321 dprintk(2, "%s\n",__func__); 321 dprintk(2, "%s\n",__func__);
322 322
323 ir->rc_type = *rc_type; 323 ir->rc_proto = *rc_proto;
324 324
325 tm6000_ir_config(ir); 325 tm6000_ir_config(ir);
326 /* TODO */ 326 /* TODO */
@@ -409,7 +409,7 @@ int tm6000_ir_init(struct tm6000_core *dev)
409 struct tm6000_IR *ir; 409 struct tm6000_IR *ir;
410 struct rc_dev *rc; 410 struct rc_dev *rc;
411 int err = -ENOMEM; 411 int err = -ENOMEM;
412 u64 rc_type; 412 u64 rc_proto;
413 413
414 if (!enable_ir) 414 if (!enable_ir)
415 return -ENODEV; 415 return -ENODEV;
@@ -433,7 +433,7 @@ int tm6000_ir_init(struct tm6000_core *dev)
433 ir->rc = rc; 433 ir->rc = rc;
434 434
435 /* input setup */ 435 /* input setup */
436 rc->allowed_protocols = RC_BIT_RC5 | RC_BIT_NEC; 436 rc->allowed_protocols = RC_PROTO_BIT_RC5 | RC_PROTO_BIT_NEC;
437 /* Needed, in order to support NEC remotes with 24 or 32 bits */ 437 /* Needed, in order to support NEC remotes with 24 or 32 bits */
438 rc->scancode_mask = 0xffff; 438 rc->scancode_mask = 0xffff;
439 rc->priv = ir; 439 rc->priv = ir;
@@ -455,8 +455,8 @@ int tm6000_ir_init(struct tm6000_core *dev)
455 usb_make_path(dev->udev, ir->phys, sizeof(ir->phys)); 455 usb_make_path(dev->udev, ir->phys, sizeof(ir->phys));
456 strlcat(ir->phys, "/input0", sizeof(ir->phys)); 456 strlcat(ir->phys, "/input0", sizeof(ir->phys));
457 457
458 rc_type = RC_BIT_UNKNOWN; 458 rc_proto = RC_PROTO_BIT_UNKNOWN;
459 tm6000_ir_change_protocol(rc, &rc_type); 459 tm6000_ir_change_protocol(rc, &rc_proto);
460 460
461 rc->device_name = ir->name; 461 rc->device_name = ir->name;
462 rc->input_phys = ir->phys; 462 rc->input_phys = ir->phys;