summaryrefslogtreecommitdiffstats
path: root/drivers/media/rc
Commit message (Collapse)AuthorAgeFilesLines
* [media] drivers/media/rc: postpone kfree(rc_dev)Max Kellermann2016-05-071-1/+6
| | | | | | | CONFIG_DEBUG_KOBJECT_RELEASE found this bug. Signed-off-by: Max Kellermann <max@duempel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] mceusb: add support for SMK eHome receiverOlli Salonen2016-05-071-0/+3
| | | | | | | | Add USB ID of SMK RXX6000 series IR receiver. Often branded as Lenovo receiver. Signed-off-by: Olli Salonen <olli.salonen@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] mceusb: add support for Adaptec eHome receiverOlli Salonen2016-05-071-0/+3
| | | | | | | New USB ID for Adaptec eHome receiver in some HP laptops. Signed-off-by: Olli Salonen <olli.salonen@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: rc: remove unneeded mutex in rc_register_deviceHeiner Kallweit2016-05-071-2/+0
| | | | | | | | | Access to dev->initialized is atomic and dev->initialized isn't accessed in any other code protected by this mutex. Therefore we don't need to get the mutex here. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] ati_remote: avoid fragile snprintf useRasmus Villemoes2016-05-071-7/+4
| | | | | | | | | | Passing overlapping source and destination to snprintf is fragile. Replace with a single (mostly) equivalent call. If one wants to preserve the space preceding udev->product whether or not there was a manufacturer, just remove udev->manufacturer from the && expression. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] mceusb: use %*ph for small buffer dumpsMauro Carvalho Chehab2016-03-101-3/+2
| | | | | | | | | It makes the printk cleaner. As a side efect, it also fixes those smatch warnings: drivers/media/rc/mceusb.c:590 mceusb_dev_printdata() warn: argument 6 to %02x specifier has type 'char' drivers/media/rc/mceusb.c:590 mceusb_dev_printdata() warn: argument 7 to %02x specifier has type 'char' Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: rc: nuvoton: switch attribute wakeup_data to textHeiner Kallweit2016-03-051-32/+53
| | | | | | | | | | | | | | | | Switch attribute wakeup_data from binary to a text attribute. This makes it easier to handle in userspace and allows to use the output of tools like mode2 almost as is to set a wakeup sequence. Changing to a text format and values in microseconds also makes the userspace interface independent of the setting of SAMPLE_PERIOD in the driver. In addition document the new sysfs attribute in Documentation/ABI/testing/sysfs-class-rc-nuvoton. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] rc: sunxi-cir: support module autoloadingEmilio López2016-03-031-0/+1
| | | | | | | | | | | MODULE_DEVICE_TABLE() is missing, so the module isn't auto-loading on systems supporting infrared. This commit adds the missing line so it works out of the box when built as a module and running on a sunxi system with an infrared receiver. Signed-off-by: Emilio López <emilio.lopez@collabora.co.uk> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] igorplugusb: fix leaks in error pathSean Young2016-03-031-5/+12
| | | | | | | | | Since rc_allocate_device() uses kmalloc, it can returns NULL, so need to check, otherwise, NULL derefenrece can happen. Reported-by: Insu Yun <wuninsu@gmail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] Fix AverMedia RM-KS remote keymapPhilippe Valembois2016-03-031-28/+28
| | | | | | | | | Fix AverMedia RM-KS keymap using user guide to meet LinuxTV wiki rules. The remote command didn't seem to change in itself since its creation: it's just to make keys more standard and remove the FIXME. Signed-off-by: Philippe Valembois <lephilousophe@users.sourceforge.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: rc: nuvoton: support reading / writing wakeup sequence via sysfsHeiner Kallweit2016-03-032-0/+88
| | | | | | | | | | | | | | | | | This patch adds a binary attribute /sys/class/rc/rc?/wakeup_data which allows to read / write the wakeup sequence. In combination with the core extension for exposing the most recent raw packet this allows to easily define and set a wakeup sequence. At least on my Zotac CI321 the BIOS resets the wakeup sequence at each boot to a factory default. Therefore I use a udev rule SUBSYSTEM=="rc", DRIVERS=="nuvoton-cir", ACTION=="add", RUN+="<script>" with the script basically doing cat <stored wakeup sequence> >/sys${DEVPATH}/wakeup_data Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] rc-core: allow calling rc_open with device not initializedMauro Carvalho Chehab2016-03-031-26/+21
| | | | | | | | | | | | | | | | | | The device initialization completes only after calling input_register_device(). However, rc_open() can be called while the device is being registered by the input/evdev core. So, we can't expect that rc_dev->initialized to be true. Change the logic to don't require initialized == true at rc_open and change the type of initialized to be atomic. this way, we can check for it earlier where it is really needed, without needing to lock the mutex just for testing it. Tested with nuvoton_cir driver on a NUC5i7RYB with CIR integrated on it. Reported-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] lirc_dev: avoid double mutex unlockMauro Carvalho Chehab2016-03-011-2/+5
| | | | | | | | | We can only unlock if mutex_lock() succeeds. Fixes the following warning: drivers/media/rc/lirc_dev.c:535 lirc_dev_fop_close() error: double unlock 'mutex:&lirc_dev_lock' Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] ati_remote: Put timeouts at the accel arrayMauro Carvalho Chehab2016-03-011-20/+27
| | | | | | | | | | | | | | Instead of having the timeouts hardcoded, and getting only the accel value from the array, put everything in the same place. That simplifies the logic. As a side effect, it also cleans several smatch errors: include/linux/jiffies.h:359:41: error: strange non-value function or array include/linux/jiffies.h:361:42: error: strange non-value function or array (one per time_after/time_before line) Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] rc-core: don't lock device at rc_register_device()Mauro Carvalho Chehab2016-02-161-19/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mutex lock at rc_register_device() was added by commit 08aeb7c9a42a ("[media] rc: add locking to fix register/show race"). It is meant to avoid race issues when trying to open a sysfs file while the RC register didn't complete. Adding a lock there causes troubles, as detected by the Kernel lock debug instrumentation at the Kernel: ====================================================== [ INFO: possible circular locking dependency detected ] 4.5.0-rc3+ #46 Not tainted ------------------------------------------------------- systemd-udevd/2681 is trying to acquire lock: (s_active#171){++++.+}, at: [<ffffffff8171a115>] kernfs_remove_by_name_ns+0x45/0xa0 but task is already holding lock: (&dev->lock){+.+.+.}, at: [<ffffffffa0724def>] rc_register_device+0xb2f/0x1450 [rc_core] which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&dev->lock){+.+.+.}: [<ffffffff8124817d>] lock_acquire+0x13d/0x320 [<ffffffff822de966>] mutex_lock_nested+0xb6/0x860 [<ffffffffa0721f2b>] show_protocols+0x3b/0x3f0 [rc_core] [<ffffffff81cdaba5>] dev_attr_show+0x45/0xc0 [<ffffffff8171f1b3>] sysfs_kf_seq_show+0x203/0x3c0 [<ffffffff8171a6a1>] kernfs_seq_show+0x121/0x1b0 [<ffffffff81617c71>] seq_read+0x2f1/0x1160 [<ffffffff8171c911>] kernfs_fop_read+0x321/0x460 [<ffffffff815abc20>] __vfs_read+0xe0/0x3d0 [<ffffffff815ae90e>] vfs_read+0xde/0x2d0 [<ffffffff815b1d01>] SyS_read+0x111/0x230 [<ffffffff822e8636>] entry_SYSCALL_64_fastpath+0x16/0x76 -> #0 (s_active#171){++++.+}: [<ffffffff81244f24>] __lock_acquire+0x4304/0x5990 [<ffffffff8124817d>] lock_acquire+0x13d/0x320 [<ffffffff81717d3a>] __kernfs_remove+0x58a/0x810 [<ffffffff8171a115>] kernfs_remove_by_name_ns+0x45/0xa0 [<ffffffff81721592>] remove_files.isra.0+0x72/0x190 [<ffffffff8172174b>] sysfs_remove_group+0x9b/0x150 [<ffffffff81721854>] sysfs_remove_groups+0x54/0xa0 [<ffffffff81cd97d0>] device_remove_attrs+0xb0/0x140 [<ffffffff81cdb27c>] device_del+0x38c/0x6b0 [<ffffffffa0724b8b>] rc_register_device+0x8cb/0x1450 [rc_core] [<ffffffffa1326a7b>] dvb_usb_remote_init+0x66b/0x14d0 [dvb_usb] [<ffffffffa1321c81>] dvb_usb_device_init+0xf21/0x1860 [dvb_usb] [<ffffffffa13517dc>] dib0700_probe+0x14c/0x410 [dvb_usb_dib0700] [<ffffffff81dbb1dd>] usb_probe_interface+0x45d/0x940 [<ffffffff81ce7e7a>] driver_probe_device+0x21a/0xc30 [<ffffffff81ce89b1>] __driver_attach+0x121/0x160 [<ffffffff81ce21bf>] bus_for_each_dev+0x11f/0x1a0 [<ffffffff81ce6cdd>] driver_attach+0x3d/0x50 [<ffffffff81ce5df9>] bus_add_driver+0x4c9/0x770 [<ffffffff81cea39c>] driver_register+0x18c/0x3b0 [<ffffffff81db6e98>] usb_register_driver+0x1f8/0x440 [<ffffffffa074001e>] dib0700_driver_init+0x1e/0x1000 [dvb_usb_dib0700] [<ffffffff810021b1>] do_one_initcall+0x141/0x300 [<ffffffff8144d8eb>] do_init_module+0x1d0/0x5ad [<ffffffff812f27b6>] load_module+0x6666/0x9ba0 [<ffffffff812f5fe8>] SyS_finit_module+0x108/0x130 [<ffffffff822e8636>] entry_SYSCALL_64_fastpath+0x16/0x76 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&dev->lock); lock(s_active#171); lock(&dev->lock); lock(s_active#171); *** DEADLOCK *** 3 locks held by systemd-udevd/2681: #0: (&dev->mutex){......}, at: [<ffffffff81ce8933>] __driver_attach+0xa3/0x160 #1: (&dev->mutex){......}, at: [<ffffffff81ce8941>] __driver_attach+0xb1/0x160 #2: (&dev->lock){+.+.+.}, at: [<ffffffffa0724def>] rc_register_device+0xb2f/0x1450 [rc_core] In this specific case, some error happened during device init, causing IR to be disabled. Let's fix it by adding a var that will tell when the device is initialized. Any calls before that will return a -EINVAL. That should prevent the race issues. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] rc/nuvoton_cir: fix locking issue when calling nvt_disable_cirHeiner Kallweit2016-02-021-8/+6
| | | | | | | | | | nvt_disable_cir calls nvt_disable_logical_dev (that may sleep) and is called from contexts holding a spinlock. Fix this and remove the unneeded clearing of CIR_IREN as this is done in nvt_cir_disable already. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] rc/nuvoton_cir: fix locking issue when calling nvt_enable_wakeHeiner Kallweit2016-02-021-6/+10
| | | | | | | | nvt_enable_wake calls nvt_select_logical_dev (that may sleep) and is called from contexts holding a spinlock. Fix this. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] rc/nuvoton_cir: fix locking issue with nvt_enable_cirHeiner Kallweit2016-02-021-18/+15
| | | | | | | | | | nvt_enable_cir calls nvt_enable_logical_dev (that may sleep) while holding a spinlock. This patch fixes this and moves the content of nvt_enable_cir to nvt_open as this is the only caller. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: rc: nuvoton-cir: improve locking in both interrupt handlersHeiner Kallweit2016-02-011-12/+12
| | | | | | | | Extend the locking to protect more critical actions like register accesses in the interrupt handlers. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: rc: nuvoton-cir: fix interrupt handlingHeiner Kallweit2016-02-011-17/+12
| | | | | | | | | | | | | | | | | | | | Only handle an interrupt if at least one combination of event bit and related interrupt bit is set. Previously it was just checked that at least one event bit and at least one interrupt bit are set. This fixes issues like the following which was caused by interrupt sharing: An interrupt intended for nvt_cir_isr was handled by nvt_cir_wake_isr first and because status bit CIR_WAKE_IRSTS_IR_PENDING was set the wake fifo was accidently cleared. This patch also fixes the bug that nvt_cir_wake_isr returned IRQ_HANDLED even if it detected that the (shared) interrupt was meant for another handler. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: rc: nuvoton-cir: fix wakeup interrupt bitsHeiner Kallweit2016-02-011-4/+1
| | | | | | | | Most likely a copy & paste error. The wakeup interrupt supports less triggering events. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: rc: nuvoton-cir: add locking to calls of nvt_enable_wakeHeiner Kallweit2016-02-011-6/+12
| | | | | | | Add locking to nvt_enable_wake calls. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: rc: nuvoton-cir: improve nvt_hw_detectHeiner Kallweit2016-02-012-5/+15
| | | | | | | | | Check for the case that no Nuvoton chip is found on either EFM port. Also move the position of nvt_efm_disable to reduce the time the EFM ports are locked. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] nuvoton-cir: fix setting ioport base addressHeiner Kallweit2016-01-251-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | At least on Zotac CI321 ACPI provides an ioport range for the wake up part but accessing these ioports has no effect. Instead the ioport base address is set to another value already (0xa20 in my case) and accessing this ioport range works. Therefore set a new ioport base address only if the current ioport base address is 0 (register reset default). The need to use the existing base address instead of trying to set an own one doesn't seem to be limited to this specific device as other drivers like hwmon/nct6775 do it the same way. This change was successfully tested on the mentioned device. And the change should be generic enough to not break the driver for other chips (however due to lack of appropriate hardware I wasn't able to test this). [mchehab@osg.samsung.com: Tested on Intel NUC NUC5i7RYB with BIOS version RYBDWi35.86A.0350.2015.0812.1722] Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Tested-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] nuvoton-cir: remove unneeded call to nvt_set_cir_irenHeiner Kallweit2016-01-251-3/+0
| | | | | | | | Calling nvt_set_cir_iren separately is not needed as this is done by nvt_cir_regs_init. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] nuvoton-cir: remove unneeded EFM operation in nvt_cir_isrHeiner Kallweit2016-01-251-4/+0
| | | | | | | | Selecting the logical device in the interrupt handler is not needed as no configuration register is accessed. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] nuvoton-cir: improve logical device handlingHeiner Kallweit2016-01-251-9/+13
| | | | | | | | | | | | Only enable the logical devices after the registers have been initialized. The call to nvt_enable_logical_dev in nvt_resume is not needed as this is done implicitely by nvt_cir_regs_init now. [mchehab@osg.samsung.com: fixed multiline comment to kernel CodingStyle] Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] nuvoton-cir: factor out logical device enablingHeiner Kallweit2016-01-251-11/+11
| | | | | | | Factor out enabling of a logical device. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] nuvoton-cir: use IR_DEFAULT_TIMEOUT and consider SAMPLE_PERIODHeiner Kallweit2016-01-251-2/+2
| | | | | | | | | Switch to using the recently introduced IR default timeout value (IR_DEFAULT_TIMEOUT) and consider the value of SAMPLE_PERIOD when calculating the limit count register value. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] nuvoton-cir: fix clearing wake fifoHeiner Kallweit2016-01-251-1/+9
| | | | | | | | | | | | | At least on NVT6779D clearing the wake fifo works in learning mode only (although this condition is not mentioned in the chip spec). Setting the clear fifo bit has no effect in wake up mode. Even if clearing the wake fifo should work in wake up mode on other chips this workaround doesn't hurt. If needed the caller of nvt_clear_cir_wake_fifo has to take care of locking. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] nuvoton-cir: factor out logical device disablingHeiner Kallweit2016-01-251-12/+11
| | | | | | | Factor out disabling of a logical device. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] nuvoton-cir: simplify nvt_cir_tx_inactiveHeiner Kallweit2016-01-251-4/+1
| | | | | | | Simplify nvt_cir_tx_inactive. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] nuvoton-cir: simplify nvt_select_logical_ devHeiner Kallweit2016-01-251-2/+1
| | | | | | | Use nvt_cr_write to simplify nvt_select_logical_ dev. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] nuvoton-cir: use request_muxed_region for accessing EFM registersHeiner Kallweit2016-01-251-1/+8
| | | | | | | | | | The two EFM ioports are accessed by drivers for other parts of the Nuvoton Super-IO chips too. Therefore access to these ioports needs to be protected by using request_muxed_region (like it's implemented e.g. in hwmon/nct6775 already). Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: rc: raw: improve FIFO handlingHeiner Kallweit2016-01-252-16/+13
| | | | | | | | | | | | | | | | | | | | | | | | | The FIFO is used for ir_raw_event records, however for some historic reason the FIFO is used on a per byte basis. IMHO this adds unneeded complexity. Therefore set up the FIFO for ir_raw_event records. This also allows to define the FIFO statically as part of ir_raw_event_ctrl instead of having to allocate the FIFO dynamically. In addition: - When writing into the FIFO and it's full return ENOSPC instead of ENOMEM thus making it easier to tell between "FIFO full" and "Dynamic memory allocation failed" when the error is propagated to a higher level. Also add an error message. - When reading from the FIFO check whether it's empty. This is not strictly needed here but kfifo_out is annotated "must check" anyway. Successfully tested it with the nuvoton-cir driver. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: rc: nuvoton: mark wakeup-related resourcesHeiner Kallweit2016-01-251-2/+2
| | | | | | | | | When requesting resources use different names for the normal and the wakeup part. This makes it easier to interpret the output of e.g. /proc/interrupts and /proc/ioports. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] rc: sunxi-cir: Initialize the spinlock properlyChen-Yu Tsai2015-12-231-0/+2
| | | | | | | | | | | | | | | The driver allocates the spinlock but fails to initialize it correctly. The kernel reports a BUG indicating bad spinlock magic when spinlock debugging is enabled. Call spin_lock_init() on it to initialize it correctly. Fixes: b4e3e59fb59c ("[media] rc: add sunxi-ir driver") Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] ir-lirc-codec.c: don't leak lirc->drv-rbufMauro Carvalho Chehab2015-12-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As reported by kmemleak: unreferenced object 0xffff8802adae0ba0 (size 192): comm "modprobe", pid 3024, jiffies 4296503588 (age 324.368s) hex dump (first 32 bytes): 00 00 00 00 ad 4e ad de ff ff ff ff 00 00 00 00 .....N.......... ff ff ff ff ff ff ff ff c0 48 25 a0 ff ff ff ff .........H%..... backtrace: [<ffffffff82278c8e>] kmemleak_alloc+0x4e/0xb0 [<ffffffff8153c08c>] kmem_cache_alloc_trace+0x1ec/0x280 [<ffffffffa0250f0d>] ir_lirc_register+0x8d/0x7a0 [ir_lirc_codec] [<ffffffffa07372b8>] ir_raw_event_register+0x318/0x4b0 [rc_core] [<ffffffffa07351ed>] rc_register_device+0xf2d/0x1450 [rc_core] [<ffffffffa13c5451>] au0828_rc_register+0x7d1/0xa10 [au0828] [<ffffffffa13b0dc2>] au0828_usb_probe+0x6c2/0xcf0 [au0828] [<ffffffff81d7619d>] usb_probe_interface+0x45d/0x940 [<ffffffff81ca7004>] driver_probe_device+0x454/0xd90 [<ffffffff81ca7a61>] __driver_attach+0x121/0x160 [<ffffffff81ca141f>] bus_for_each_dev+0x11f/0x1a0 [<ffffffff81ca5d4d>] driver_attach+0x3d/0x50 [<ffffffff81ca5039>] bus_add_driver+0x4c9/0x770 [<ffffffff81ca944c>] driver_register+0x18c/0x3b0 [<ffffffff81d71e58>] usb_register_driver+0x1f8/0x440 [<ffffffffa13680b7>] 0xffffffffa13680b7 0xf3d is in ir_lirc_register (drivers/media/rc/ir-lirc-codec.c:348). 343 drv = kzalloc(sizeof(struct lirc_driver), GFP_KERNEL); 344 if (!drv) 345 return rc; 346 347 rbuf = kzalloc(sizeof(struct lirc_buffer), GFP_KERNEL); 348 if (!rbuf) 349 goto rbuf_alloc_failed; 350 351 rc = lirc_buffer_init(rbuf, sizeof(int), LIRCBUF_SIZE); 352 if (rc) Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: rc: remove unneeded codeHeiner Kallweit2015-12-033-20/+1
| | | | | | | | Now that that the decoder modules are loaded on-demand we can move loading the lirc module to rc_register_device directly and remove unneeded functions and comments. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
* [media] media: rc: move check whether a protocol is enabled to the coreHeiner Kallweit2015-11-1910-31/+3
| | | | | | | | | | Checking whether a protocol is enabled and calling the related decoder functions should be done by the rc core, not the protocol handlers. Properly handle lirc considering that no protocol bit is set for lirc. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: rc: load decoder modules on-demandHeiner Kallweit2015-11-192-74/+0
| | | | | | | Remove code for unconditional decoder module loading (except lirc). Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: rc: constify struct proto_namesHeiner Kallweit2015-11-191-2/+2
| | | | | | | Declare struct proto_names and its member name as const. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: rc: preparation for on-demand decoder module loadingHeiner Kallweit2015-11-191-13/+59
| | | | | | | | | | | Prepare on-demand decoder module loading by adding a module_name member to struct proto_names and introducing the related load function. After this patch of the series the decoder modules are still loaded unconditionally. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: rc: fix decoder module unloadingHeiner Kallweit2015-11-191-3/+14
| | | | | | | | | | Currently, if a decoder module is unloadad, the respective protocol is still shown as enabled (if it was enabled before). Fix this by resetting the respective protocol bits if a decoder module is unloaded. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: rc-core: simplify logging in rc_register_deviceHeiner Kallweit2015-11-191-4/+2
| | | | | | | | | | | Simplify the logging. I had some doubts about using the elvis operator as it's GNU extension. However GNU extensions are explicitely allowed and this operator is used at several places in the kernel code. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: rc: nuvoton-cir: replace nvt_pr with dev_ functionsHeiner Kallweit2015-11-192-10/+8
| | | | | | | | Replace nvt_pr with the respective dev_ functions thus slightly simplifying the code. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: rc: nuvoton-cir: switch chip detection message to info levelHeiner Kallweit2015-11-191-2/+3
| | | | | | | | Switch the info about the detected chip type from debug to info level as it might be useful not only for debugging purposes. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: rc: nuvoton-cir: simplify debug codeHeiner Kallweit2015-11-191-3/+2
| | | | | | | | Instead of explicitely checking debug use nvt_dbg like in other parts of the driver thus simplifying the code. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: rc: nuvoton-cir: add support for the NCT6779DHeiner Kallweit2015-11-192-1/+3
| | | | | | | | Add support for the NCT6779D. It's found e.g. on the Zotac CI321 mini-pc and I successfully tested it on this device. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: rc: nuvoton-cir: make nvt_hw_detect voidHeiner Kallweit2015-11-191-6/+2
| | | | | | | nvt_hw_detect always returns 0, therefore make it return void. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
OpenPOWER on IntegriCloud