summaryrefslogtreecommitdiff
path: root/drivers/media/rc
AgeCommit message (Collapse)Author
2016-02-16[media] rc-core: don't lock device at rc_register_device()Mauro Carvalho Chehab
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>
2016-02-02[media] rc/nuvoton_cir: fix locking issue when calling nvt_disable_cirHeiner Kallweit
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>
2016-02-02[media] rc/nuvoton_cir: fix locking issue when calling nvt_enable_wakeHeiner Kallweit
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>
2016-02-02[media] rc/nuvoton_cir: fix locking issue with nvt_enable_cirHeiner Kallweit
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>
2016-02-01[media] media: rc: nuvoton-cir: improve locking in both interrupt handlersHeiner Kallweit
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>
2016-02-01[media] media: rc: nuvoton-cir: fix interrupt handlingHeiner Kallweit
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>
2016-02-01[media] media: rc: nuvoton-cir: fix wakeup interrupt bitsHeiner Kallweit
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>
2016-02-01[media] media: rc: nuvoton-cir: add locking to calls of nvt_enable_wakeHeiner Kallweit
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>
2016-02-01[media] media: rc: nuvoton-cir: improve nvt_hw_detectHeiner Kallweit
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>
2016-01-25[media] nuvoton-cir: fix setting ioport base addressHeiner Kallweit
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>
2016-01-25[media] nuvoton-cir: remove unneeded call to nvt_set_cir_irenHeiner Kallweit
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>
2016-01-25[media] nuvoton-cir: remove unneeded EFM operation in nvt_cir_isrHeiner Kallweit
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>
2016-01-25[media] nuvoton-cir: improve logical device handlingHeiner Kallweit
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>
2016-01-25[media] nuvoton-cir: factor out logical device enablingHeiner Kallweit
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>
2016-01-25[media] nuvoton-cir: use IR_DEFAULT_TIMEOUT and consider SAMPLE_PERIODHeiner Kallweit
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>
2016-01-25[media] nuvoton-cir: fix clearing wake fifoHeiner Kallweit
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>
2016-01-25[media] nuvoton-cir: factor out logical device disablingHeiner Kallweit
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>
2016-01-25[media] nuvoton-cir: simplify nvt_cir_tx_inactiveHeiner Kallweit
Simplify nvt_cir_tx_inactive. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-25[media] nuvoton-cir: simplify nvt_select_logical_ devHeiner Kallweit
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>
2016-01-25[media] nuvoton-cir: use request_muxed_region for accessing EFM registersHeiner Kallweit
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>
2016-01-25[media] media: rc: raw: improve FIFO handlingHeiner Kallweit
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>
2016-01-25[media] media: rc: nuvoton: mark wakeup-related resourcesHeiner Kallweit
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>
2015-12-23[media] rc: sunxi-cir: Initialize the spinlock properlyChen-Yu Tsai
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>
2015-12-21[media] ir-lirc-codec.c: don't leak lirc->drv-rbufMauro Carvalho Chehab
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>
2015-12-03[media] media: rc: remove unneeded codeHeiner Kallweit
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>
2015-11-19[media] media: rc: move check whether a protocol is enabled to the coreHeiner Kallweit
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>
2015-11-19[media] media: rc: load decoder modules on-demandHeiner Kallweit
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>
2015-11-19[media] media: rc: constify struct proto_namesHeiner Kallweit
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>
2015-11-19[media] media: rc: preparation for on-demand decoder module loadingHeiner Kallweit
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>
2015-11-19[media] media: rc: fix decoder module unloadingHeiner Kallweit
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>
2015-11-19[media] media: rc-core: simplify logging in rc_register_deviceHeiner Kallweit
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>
2015-11-19[media] media: rc: nuvoton-cir: replace nvt_pr with dev_ functionsHeiner Kallweit
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>
2015-11-19[media] media: rc: nuvoton-cir: switch chip detection message to info levelHeiner Kallweit
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>
2015-11-19[media] media: rc: nuvoton-cir: simplify debug codeHeiner Kallweit
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>
2015-11-19[media] media: rc: nuvoton-cir: add support for the NCT6779DHeiner Kallweit
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>
2015-11-19[media] media: rc: nuvoton-cir: make nvt_hw_detect voidHeiner Kallweit
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>
2015-11-19[media] media: rc: nuvoton-cir: improve chip detectionHeiner Kallweit
Make the chip detection code more similar to the one used for the same chips in watchdog/w83627hf_wdt.c and hwmon/w83627ehf.c. Apart from better maintainability we gain - unified naming of chips (e.g. 677C -> NCT6776F) - driver works with all revisions of the chips (least 4 bits of id are masked) Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-19[media] media: rc: nuvoton-cir: switch resource handling to devm functionsHeiner Kallweit
Switch to managed resource handling using the devm_ functions. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-19[media] media: rc: nuvoton-cir: remove unneeded lockHeiner Kallweit
chip_major / chip_minor are accessed sequentially in probe only. Therefore no lock is needed. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-19[media] media: rc: nuvoton-cir: remove unneeded IRQ_RETVAL usageHeiner Kallweit
Using IRQ_RETVAL is unneeded here. IRQ_NONE / IRQ_HANDLED can be returned directly. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-19[media] media: rc: ir-sharp-decoder: add support for Denon variant of the ↵Heiner Kallweit
protocol Denon also uses the Sharp protocol, however with different check bits. It would have been also possible to add this as a separate protocol but this may not be worth the effort. Successfully tested with a Denon RC-1002 remote control. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-19[media] rc-core: Remove 'struct timeval' usageTina Ruchandani
streamzap uses 'struct timeval' to store the start time of a signal for gap tracking. struct timeval uses a 32-bit seconds representation which will overflow in year 2038 and beyond. Replace struct timeval with ktime_t which uses a 64-bit seconds representation and is 2038 safe. This patch uses ktime_get_real() preserving the use of wall-clock time in the original code. Signed-off-by: Tina Ruchandani <ruchandani.tina@gmail.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-19[media] rc: allow rc modules to be loaded if rc-main is not a moduleRussell King
rc-main mistakenly uses #ifdef MODULE to determine whether it should load the rc keymap modules. This symbol is only defined if rc-main is being built as a module itself, and bears no relation to whether the rc keymaps are modules. Fix this to use CONFIG_MODULES instead. Fixes: 631493ecacd8 ("[media] rc-core: merge rc-map.c into rc-main.c") Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-19[media] rc: gpio-ir-recv: add timeout on idleEric Nelson
Many decoders require a trailing space (period without IR illumination) to be delivered before completing a decode. Since the gpio-ir-recv driver only delivers events on gpio transitions, a single IR symbol (caused by a quick touch on an IR remote) will not be properly decoded without the use of a timer to flush the tail end state of the IR receiver. This patch initializes and uses a timer and the timeout field of rcdev to complete the stream and allow decode. The timeout can be overridden through the use of the LIRC_SET_REC_TIMEOUT ioctl. Signed-off-by: Eric Nelson <eric@nelint.com> Acked-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-19[media] media: st-rc: remove misuse of IRQF_NO_SUSPEND flagSudeep Holla
The device is set as wakeup capable using proper wakeup API but the driver misuses IRQF_NO_SUSPEND to set the interrupt as wakeup source which is incorrect. This patch removes the use of IRQF_NO_SUSPEND flags replacing it with enable_irq_wake instead. Cc: Srinivas Kandagatla <srinivas.kandagatla@gmail.com> Cc: Maxime Coquelin <maxime.coquelin@st.com> Cc: Patrice Chotard <patrice.chotard@st.com> Cc: linux-arm-kernel@lists.infradead.org Cc: kernel@stlinux.com Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-17[media] include/media: move platform_data to linux/platform_data/mediaMauro Carvalho Chehab
Let's not mix platform_data headers with the core headers. Instead, let's create a subdir at linux/platform_data and move the headers to that common place, adding it to MAINTAINERS. The headers were moved with: mkdir include/linux/platform_data/media/; git mv include/media/gpio-ir-recv.h include/media/ir-rx51.h include/media/mmp-camera.h include/media/omap1_camera.h include/media/omap4iss.h include/media/s5p_hdmi.h include/media/si4713.h include/media/sii9234.h include/media/smiapp.h include/media/soc_camera.h include/media/soc_camera_platform.h include/media/timb_radio.h include/media/timb_video.h include/linux/platform_data/media/ And the references fixed with this script: MAIN_DIR="linux/platform_data/" PREV_DIR="media/" DIRS="media/" echo "Checking affected files" >&2 for i in $DIRS; do for j in $(find include/$MAIN_DIR/$i -type f -name '*.h'); do n=`basename $j` git grep -l $n done done|sort|uniq >files && ( echo "Handling files..." >&2; echo "for i in \$(cat files|grep -v Documentation); do cat \$i | \\"; ( cd include/$MAIN_DIR; for j in $DIRS; do for i in $(ls $j); do echo "perl -ne 's,(include [\\\"\\<])$PREV_DIR($i)([\\\"\\>]),\1$MAIN_DIR$j\2\3,; print \$_' |\\"; done; done; echo "cat > a && mv a \$i; done"; ); echo "Handling documentation..." >&2; echo "for i in MAINTAINERS \$(cat files); do cat \$i | \\"; ( cd include/$MAIN_DIR; for j in $DIRS; do for i in $(ls $j); do echo " perl -ne 's,include/$PREV_DIR($i)\b,include/$MAIN_DIR$j\1,; print \$_' |\\"; done; done; echo "cat > a && mv a \$i; done" ); ) >script && . ./script Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
2015-10-22[media] ir-hix5hd2: drop the use of IRQF_NO_SUSPENDSudeep Holla
This driver doesn't claim the IR transmitter to be wakeup source. It even disables the clock and the IR during suspend-resume cycle. This patch removes yet another misuse of IRQF_NO_SUSPEND. Cc: Patrice Chotard <patrice.chotard@st.com> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Guoxiong Yan <yanguoxiong@huawei.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-05Merge tag 'media/v4.3-1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - new DVB frontend drivers: ascot2e, cxd2841er, horus3a, lnbh25 - new HDMI capture driver: tc358743 - new driver for NetUP DVB new boards (netup_unidvb) - IR support for DVBSky cards (smipcie-ir) - Coda driver has gain macroblock tiling support - Renesas R-Car gains JPEG codec driver - new DVB platform driver for STi boards: c8sectpfe - added documentation for the media core kABI to device-drivers DocBook - lots of driver fixups, cleanups and improvements * tag 'media/v4.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (297 commits) [media] c8sectpfe: Remove select on undefined LIBELF_32 [media] i2c: fix platform_no_drv_owner.cocci warnings [media] cx231xx: Use wake_up_interruptible() instead of wake_up_interruptible_nr() [media] tc358743: only queue subdev notifications if devnode is set [media] tc358743: add missing Kconfig dependency/select [media] c8sectpfe: Use %pad to print 'dma_addr_t' [media] DocBook media: Fix typo "the the" in xml files [media] tc358743: make reset gpio optional [media] tc358743: set direction of reset gpio using devm_gpiod_get [media] dvbdev: document most of the functions/data structs [media] dvb_frontend.h: document the struct dvb_frontend [media] dvb-frontend.h: document struct dtv_frontend_properties [media] dvb-frontend.h: document struct dvb_frontend_ops [media] dvb: Use DVBFE_ALGO_HW where applicable [media] dvb_frontend.h: document struct analog_demod_ops [media] dvb_frontend.h: Document struct dvb_tuner_ops [media] Docbook: Document struct analog_parameters [media] dvb_frontend.h: get rid of dvbfe_modcod [media] add documentation for struct dvb_tuner_info [media] dvb_frontend: document dvb_frontend_tune_settings ...
2015-08-19Revert "[media] rc: rc-ir-raw: Add scancode encoder callback"David Härdeman
This reverts commit 9869da5bacc5c9b865a183bd36c04be76cdd325d. 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>
2015-08-19Revert "[media] rc: rc-ir-raw: Add Manchester encoder (phase encoder) helper"David Härdeman
This reverts commit 1d971d927efa2e10194c96ed0475b6d6054342d8. 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>