Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Revert "[media] rc: rc-core: Add support for encode_wakeup drivers"

This reverts commit 0d830b2d1295fee82546d57185da5a6604f11ae2.

The current code is not mature enough, the API should allow a single
protocol to be specified. Also, the current code contains heuristics
that will depend on module load order.

Signed-off-by: David Härdeman <david@hardeman.nu>
Acked-by: Antti Seppälä <a.seppala@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

David Härdeman and committed by
Mauro Carvalho Chehab
3a03b86f 8abfebdb

+1 -27
-1
drivers/media/rc/rc-core-priv.h
··· 189 189 * Routines from rc-raw.c to be used internally and by decoders 190 190 */ 191 191 u64 ir_raw_get_allowed_protocols(void); 192 - u64 ir_raw_get_encode_protocols(void); 193 192 int ir_raw_event_register(struct rc_dev *dev); 194 193 void ir_raw_event_unregister(struct rc_dev *dev); 195 194 int ir_raw_handler_register(struct ir_raw_handler *ir_raw_handler);
-17
drivers/media/rc/rc-ir-raw.c
··· 30 30 static DEFINE_MUTEX(ir_raw_handler_lock); 31 31 static LIST_HEAD(ir_raw_handler_list); 32 32 static u64 available_protocols; 33 - static u64 encode_protocols; 34 33 35 34 static int ir_raw_event_thread(void *data) 36 35 { ··· 236 237 u64 protocols; 237 238 mutex_lock(&ir_raw_handler_lock); 238 239 protocols = available_protocols; 239 - mutex_unlock(&ir_raw_handler_lock); 240 - return protocols; 241 - } 242 - 243 - /* used internally by the sysfs interface */ 244 - u64 245 - ir_raw_get_encode_protocols(void) 246 - { 247 - u64 protocols; 248 - 249 - mutex_lock(&ir_raw_handler_lock); 250 - protocols = encode_protocols; 251 240 mutex_unlock(&ir_raw_handler_lock); 252 241 return protocols; 253 242 } ··· 450 463 list_for_each_entry(raw, &ir_raw_client_list, list) 451 464 ir_raw_handler->raw_register(raw->dev); 452 465 available_protocols |= ir_raw_handler->protocols; 453 - if (ir_raw_handler->encode) 454 - encode_protocols |= ir_raw_handler->protocols; 455 466 mutex_unlock(&ir_raw_handler_lock); 456 467 457 468 return 0; ··· 466 481 list_for_each_entry(raw, &ir_raw_client_list, list) 467 482 ir_raw_handler->raw_unregister(raw->dev); 468 483 available_protocols &= ~ir_raw_handler->protocols; 469 - if (ir_raw_handler->encode) 470 - encode_protocols &= ~ir_raw_handler->protocols; 471 484 mutex_unlock(&ir_raw_handler_lock); 472 485 } 473 486 EXPORT_SYMBOL(ir_raw_handler_unregister);
+1 -6
drivers/media/rc/rc-main.c
··· 865 865 } else { 866 866 enabled = dev->enabled_wakeup_protocols; 867 867 allowed = dev->allowed_wakeup_protocols; 868 - if (dev->encode_wakeup && !allowed) 869 - allowed = ir_raw_get_encode_protocols(); 870 868 } 871 869 872 870 mutex_unlock(&dev->lock); ··· 1406 1408 path ? path : "N/A"); 1407 1409 kfree(path); 1408 1410 1409 - if (dev->driver_type == RC_DRIVER_IR_RAW || dev->encode_wakeup) { 1411 + if (dev->driver_type == RC_DRIVER_IR_RAW) { 1410 1412 /* Load raw decoders, if they aren't already */ 1411 1413 if (!raw_init) { 1412 1414 IR_dprintk(1, "Loading raw decoders\n"); 1413 1415 ir_raw_init(); 1414 1416 raw_init = true; 1415 1417 } 1416 - } 1417 - 1418 - if (dev->driver_type == RC_DRIVER_IR_RAW) { 1419 1418 /* calls ir_register_device so unlock mutex here*/ 1420 1419 mutex_unlock(&dev->lock); 1421 1420 rc = ir_raw_event_register(dev);
-3
include/media/rc-core.h
··· 74 74 * @input_dev: the input child device used to communicate events to userspace 75 75 * @driver_type: specifies if protocol decoding is done in hardware or software 76 76 * @idle: used to keep track of RX state 77 - * @encode_wakeup: wakeup filtering uses IR encode API, therefore the allowed 78 - * wakeup protocols is the set of all raw encoders 79 77 * @allowed_protocols: bitmask with the supported RC_BIT_* protocols 80 78 * @enabled_protocols: bitmask with the enabled RC_BIT_* protocols 81 79 * @allowed_wakeup_protocols: bitmask with the supported RC_BIT_* wakeup protocols ··· 134 136 struct input_dev *input_dev; 135 137 enum rc_driver_type driver_type; 136 138 bool idle; 137 - bool encode_wakeup; 138 139 u64 allowed_protocols; 139 140 u64 enabled_protocols; 140 141 u64 allowed_wakeup_protocols;