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

Revert "[media] rc: rc-loopback: Add loopback of filter scancodes"

This reverts commit 2e4ebde269236da2a41183522127715b6d9d80ce.

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
8abfebdb 23f28f2a

-36
-36
drivers/media/rc/rc-loopback.c
··· 26 26 #include <linux/device.h> 27 27 #include <linux/module.h> 28 28 #include <linux/sched.h> 29 - #include <linux/slab.h> 30 29 #include <media/rc-core.h> 31 30 32 31 #define DRIVER_NAME "rc-loopback" ··· 176 177 return 0; 177 178 } 178 179 179 - static int loop_set_wakeup_filter(struct rc_dev *dev, 180 - struct rc_scancode_filter *sc_filter) 181 - { 182 - static const unsigned int max = 512; 183 - struct ir_raw_event *raw; 184 - int ret; 185 - int i; 186 - 187 - /* fine to disable filter */ 188 - if (!sc_filter->mask) 189 - return 0; 190 - 191 - /* encode the specified filter and loop it back */ 192 - raw = kmalloc_array(max, sizeof(*raw), GFP_KERNEL); 193 - ret = ir_raw_encode_scancode(dev->enabled_wakeup_protocols, sc_filter, 194 - raw, max); 195 - /* still loop back the partial raw IR even if it's incomplete */ 196 - if (ret == -ENOBUFS) 197 - ret = max; 198 - if (ret >= 0) { 199 - /* do the loopback */ 200 - for (i = 0; i < ret; ++i) 201 - ir_raw_event_store(dev, &raw[i]); 202 - ir_raw_event_handle(dev); 203 - 204 - ret = 0; 205 - } 206 - 207 - kfree(raw); 208 - 209 - return ret; 210 - } 211 - 212 180 static int __init loop_init(void) 213 181 { 214 182 struct rc_dev *rc; ··· 195 229 rc->map_name = RC_MAP_EMPTY; 196 230 rc->priv = &loopdev; 197 231 rc->driver_type = RC_DRIVER_IR_RAW; 198 - rc->encode_wakeup = true; 199 232 rc->allowed_protocols = RC_BIT_ALL; 200 233 rc->timeout = 100 * 1000 * 1000; /* 100 ms */ 201 234 rc->min_timeout = 1; ··· 209 244 rc->s_idle = loop_set_idle; 210 245 rc->s_learning_mode = loop_set_learning_mode; 211 246 rc->s_carrier_report = loop_set_carrier_report; 212 - rc->s_wakeup_filter = loop_set_wakeup_filter; 213 247 214 248 loopdev.txmask = RXMASK_REGULAR; 215 249 loopdev.txcarrier = 36000;