diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-12 09:17:44 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-12 09:17:44 +0300 |
commit | 47c62e4be78303ef52ffa8134026919d0890c5a9 (patch) | |
tree | c0ece2346076651da1f9fb33261d89f43b711be9 /drivers/media/rc/rc-ir-raw.c | |
parent | 2c487121e3c4f87e82cff493872675bde52e47fc (diff) | |
parent | c3152592e70bbf023ec106ee9ea271e9060bc09a (diff) | |
download | linux-47c62e4be78303ef52ffa8134026919d0890c5a9.tar.xz |
Merge tag 'media/v4.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media updates from Mauro Carvalho Chehab:
"The part of patches for Kernel 4.5. There's nothing really big here:
- driver-specific headers for media devices were moved to separate
directories, in order to make clear what headers belong to the core
kABI and require documentation
- Platform data for media drivers were moved from include/media to
include/linux/platform_data/media
- add a driver for cs3308 8-channel volume control, used on some
high-end capture boards
- lirc.h kAPI header were added at include/uapi/linux
- Driver cleanups, new board additions and improvements"
* tag 'media/v4.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (204 commits)
[media] rc: sunxi-cir: Initialize the spinlock properly
[media] rtl2832: do not filter out slave TS null packets
[media] rtl2832: print reg number on error case
[media] rtl28xxu: return demod reg page from driver cache
[media] coda: enable MPEG-2 ES decoding
[media] coda: don't start streaming without queued buffers
[media] coda: hook up vidioc_prepare_buf
[media] coda: relax coda_jpeg_check_buffer for trailing bytes
[media] coda: make to_coda_video_device static
[media] s5p-mfc: remove volatile attribute from MFC register addresses
[media] s5p-mfc: merge together s5p_mfc_hw_call and s5p_mfc_hw_call_void
[media] s5p-mfc: use spinlock to protect MFC context
[media] s5p-mfc: remove unnecessary callbacks
[media] s5p-mfc: make queue cleanup code common
[media] s5p-mfc: use one implementation of s5p_mfc_get_new_ctx
[media] s5p-mfc: constify s5p_mfc_codec_ops structures
[media] au8522: Avoid memory leak for device config data
[media] ir-lirc-codec.c: don't leak lirc->drv-rbuf
[media] uvcvideo: small cleanup in uvc_video_clock_update()
[media] uvcvideo: Fix reading the current exposure value of UVC
...
Diffstat (limited to 'drivers/media/rc/rc-ir-raw.c')
-rw-r--r-- | drivers/media/rc/rc-ir-raw.c | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/drivers/media/rc/rc-ir-raw.c b/drivers/media/rc/rc-ir-raw.c index ad260520a9d4..c69807fe2fef 100644 --- a/drivers/media/rc/rc-ir-raw.c +++ b/drivers/media/rc/rc-ir-raw.c @@ -59,7 +59,9 @@ static int ir_raw_event_thread(void *data) mutex_lock(&ir_raw_handler_lock); list_for_each_entry(handler, &ir_raw_handler_list, list) - handler->decode(raw->dev, ev); + if (raw->dev->enabled_protocols & handler->protocols || + !handler->protocols) + handler->decode(raw->dev, ev); raw->prev_ev = ev; mutex_unlock(&ir_raw_handler_lock); } @@ -246,6 +248,14 @@ static int change_protocol(struct rc_dev *dev, u64 *rc_type) return 0; } +static void ir_raw_disable_protocols(struct rc_dev *dev, u64 protocols) +{ + mutex_lock(&dev->lock); + dev->enabled_protocols &= ~protocols; + dev->enabled_wakeup_protocols &= ~protocols; + mutex_unlock(&dev->lock); +} + /* * Used to (un)register raw event clients */ @@ -337,33 +347,16 @@ EXPORT_SYMBOL(ir_raw_handler_register); void ir_raw_handler_unregister(struct ir_raw_handler *ir_raw_handler) { struct ir_raw_event_ctrl *raw; + u64 protocols = ir_raw_handler->protocols; mutex_lock(&ir_raw_handler_lock); list_del(&ir_raw_handler->list); - if (ir_raw_handler->raw_unregister) - list_for_each_entry(raw, &ir_raw_client_list, list) + list_for_each_entry(raw, &ir_raw_client_list, list) { + ir_raw_disable_protocols(raw->dev, protocols); + if (ir_raw_handler->raw_unregister) ir_raw_handler->raw_unregister(raw->dev); - available_protocols &= ~ir_raw_handler->protocols; + } + available_protocols &= ~protocols; mutex_unlock(&ir_raw_handler_lock); } EXPORT_SYMBOL(ir_raw_handler_unregister); - -void ir_raw_init(void) -{ - /* Load the decoder modules */ - - load_nec_decode(); - load_rc5_decode(); - load_rc6_decode(); - load_jvc_decode(); - load_sony_decode(); - load_sanyo_decode(); - load_sharp_decode(); - load_mce_kbd_decode(); - load_lirc_codec(); - load_xmp_decode(); - - /* If needed, we may later add some init code. In this case, - it is needed to change the CONFIG_MODULE test at rc-core.h - */ -} |