summaryrefslogtreecommitdiffstats
path: root/drivers/media/IR
Commit message (Collapse)AuthorAgeFilesLines
...
* V4L/DVB: IR keymap: Add print button for HP OEM version of MCE remoteAndy Walls2010-08-091-0/+2
| | | | | | | | | | | | | This patch adds a defintion for the "Print" button found on HP OEM versions of the MCE remote. All of the other keys found on the HP OEM version of the remote match the other keys as already defined. Because, who doesn't need "remote printing", while one is sitting on the couch across from one's PC? ;) Signed-off-by: Andy Walls <awalls@md.metrocast.net> Acked-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR: Port ene driver to new IR subsystem and enable itMaxim Levitsky2010-08-094-401/+258Star
| | | | | Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: STAGING: remove lirc_ene0100 driverMaxim Levitsky2010-08-092-0/+1416
| | | | | | | | Add latest unported version of this driver to media/IR. Next patch will port it to ir core. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR: report unknown scancodes the in-kernel decoders foundMaxim Levitsky2010-08-091-0/+8
| | | | | | | This way it is possible to use evtest to create keymap for unknown remote. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR: extend interfaces to support more device settingsMaxim Levitsky2010-08-092-19/+94
| | | | | | | | | LIRC: add new IOCTL that enables learning mode (wide band receiver) Still missing features: carrier report & timeout reports. Will need to pack these into ir_raw_event Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR: add helper function for hardware with small o/b bufferMaxim Levitsky2010-08-093-1/+86
| | | | | | | | | | | | | | | | | Some ir input devices have small buffer, and interrupt the host each time it is full (or half full) Add a helper that automaticly handles timeouts, and also automaticly merges samples of same time (space-space) Such samples might be placed by hardware because size of sample in the buffer is small (a byte for example). Also remove constness from ir_dev_props, because it now contains timeout settings that driver might want to change Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Acked-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR: Allow not to compile keymaps inMaxim Levitsky2010-08-095-46/+27Star
| | | | | | | | | Currently, ir device registration fails if keymap requested by driver is not found. Fix that by always compiling in the empty keymap, and using it as a failback. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Acked-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR: NECX: support repeatMaxim Levitsky2010-08-092-2/+23
| | | | | | | | This adds support for repeat detecting for NECX variant Tested with uneversal remote Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR: nec decoder: fix repeatMaxim Levitsky2010-08-091-1/+1
| | | | | | | | | | | | Repeat space is 4 units, not 8. Current code would never trigger a repeat. However that isn't true for NECX, so repeat there must be handled differently. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Reviewed-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR: JVC: make repeat workMaxim Levitsky2010-08-091-1/+13
| | | | | | | | Currently, jvc decoder will attempt misdetect next press as a repeat of last keypress, therefore second keypress isn't detected. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR: replace workqueue with kthreadMaxim Levitsky2010-08-092-12/+32
| | | | | | | | | | | | | | It is perfectly possible to have ir_raw_event_work running concurently on two cpus, thus we must protect it from that situation. This stems from the fact that if hardware sends short packets of samples we might end up queueing the work item more times that nessesary. Such job isn't well suited for a workqueue, so use a kernel thread. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR: replace spinlock with mutexMaxim Levitsky2010-08-091-14/+14
| | | | | | | | | Some handlers (lirc for example) allocates memory on initialization, doing so in atomic context is cumbersome. Fixes warning about sleeping function in atomic context. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR: minor fixesMaxim Levitsky2010-08-093-9/+12
| | | | | | | | | * lirc: Don't propagate reset event to userspace * lirc: Remove strange logic from lirc that would make first sample always be pulse * Make TO_US macro actualy print what it should. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR: Kconfig fixesMaxim Levitsky2010-08-091-3/+7
| | | | | | | | | Move IR drives below separate menu. This allows to disable them. Also correct a typo. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR: put newly ported streamzap driver in proper homeJarod Wilson2010-08-093-0/+754
| | | | | | | | | Moves drivers/staging/lirc/lirc_streamzap.c to drivers/media/IR/streamzap.c, along with making the requisite Kconfig and Makefile changes. Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: staging/lirc: port lirc_streamzap to ir-coreJarod Wilson2010-08-092-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This ports lirc_streamzap.c over to ir-core in-place, to be followed by a patch moving the driver over to drivers/media/IR/streamzap.c and enabling the proper Kconfig bits. Presently, the in-kernel keymap doesn't work, as the stock Streamzap remote uses an RC-5-like, but not-quite-RC-5 protocol, which the in-kernel RC-5 decoder doesn't cope with. The remote can be used right now with the lirc bridge driver though, and other remotes (at least an RC-6(A) MCE remote) work perfectly with the driver. I'll take a look at making the existing RC-5 decoder cope with this odd duck, possibly implement another standalone decoder engine, or just throw up my hands and say "meh, use lirc"... But the driver itself should be perfectly sound. Remaining items on the streamzap TODO list: - add LIRC_SET_REC_TIMEOUT-alike support - add LIRC_GET_M{AX,IN}_TIMEOUT-alike support - add LIRC_GET_REC_RESOLUTION-alike support All of the above should be trivial to add. There are patches pending to add this support to ir-core from Maxim Levitsky, and I'll take care of these once his patches get integrated. None of them are currently essential though. Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR/mceusb: less generic callback name and remove cruftJarod Wilson2010-08-091-4/+2Star
| | | | | Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR/mceusb: remove bad ir_input_dev useJarod Wilson2010-08-091-14/+1Star
| | | | | | | | | | | | | The ir_input_dev gets filled in by __ir_input_register, the one allocated in mceusb_init_input_dev was being overwritten by the correct one shortly after it was initialized (ultimately resulting in a memory leak). This bug was inherited from imon.c, and was pointed out to me by Maxim Levitsky. v2: fix incorrect dev arg to dev_dbg Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR/imon: remove bad ir_input_dev useJarod Wilson2010-08-091-15/+0Star
| | | | | | | | | | | | | | The ir_input_dev gets filled in by __ir_input_register, the one allocated in imon_init_idev was being overwritten by the correct one shortly after it was initialized (ultimately resulting in a memory leak). Additionally, there was an ill-advised memcpy into that extraneous ir_input_dev which gets fixed by this. Ill-advised memcpy pointed out by Dmitry Torokhov, bad usage of ir_input_dev pointed out by Maxim Levitsky. Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR/imon: remove incorrect calls to input_free_deviceJarod Wilson2010-08-091-4/+1Star
| | | | | | | | | Per Dmitry Torokhov, following input_unregister_device with an input_free_device is forbidden, the former is sufficient alone. Acked-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: sms: Convert IR support to use the Remote Controller coreMauro Carvalho Chehab2010-08-021-2/+3
| | | | | | | | | | | | | | | | | | | Rewrites the siano IR implementation. The previous implementation were non-standard. As such, it has issues if more than one device registers IR, as there used to have some static constants used during protocol decoding phase. Also, it used to implement its on RAW decoder, and only for RC5. The new code uses RC core subsystem for handling IR. This brings several new features to the driver, including: - Allow to dynamically replace the IR keycodes; - Supports all existing raw decoders (JVC, NEC, RC-5, RC-6, SONY); - Supports lirc dev; - Doesn't have race conditions when more than one sms IR is registered; - The code size for the IR implementation is very small; - it exports the IR features via /sys/class/rc. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: standardize names at rc-dib0700 tablesMauro Carvalho Chehab2010-08-022-12/+12
| | | | | | | Use a more standard way to name those tables, as they're currently used by the script that coverts those tables to be loaded via userspace. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: dib0700: break keytable into NEC and RC-5 variantsMauro Carvalho Chehab2010-08-023-83/+129
| | | | | | | | Instead of having one big keytable with 2 protocols inside, break it into two separate tables, being one for NEC and another for RC-5 variants, and properly identify what variant should be used at the boards entries. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: Add a keymap file with dib0700 tableMauro Carvalho Chehab2010-08-022-0/+315
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: media/IR: testing the wrong variableDan Carpenter2010-08-021-1/+1
| | | | | | | | | There is a typo here. We meant to test "rbuf" instead of "drv". We already tested "drv" earlier. Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR/lirc: use memdup_user instead of copy_from_userJarod Wilson2010-08-021-8/+3Star
| | | | | Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR/lirc: make lirc userspace and staging modules buildableJarod Wilson2010-08-023-227/+2Star
| | | | | | | | | | | | The lirc userspace needs all the current ioctls defined, and we need to put the header files in places out-of-tree and/or staging lirc drivers (which I plan to prep soon) can easily build with. I've actually tested this in a tree w/all the lirc drivers queued up to be submitted for staging. I'm also reasonably sure that Andy Walls is going to need most of the ioctls anyway for his cx23888 IR driver work. Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: drivers/media: Remove unnecessary casts of private_dataJoe Perches2010-08-021-3/+3
| | | | | | | Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Jarod Wilson <jarod@redhat.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR/mceusb: more streamlining of device initJarod Wilson2010-08-021-16/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Spent a while last night getting device initialization packet captures under Windows for all generations of devices. There are a few places where we were doing things differently, and few things we were doing that we don't need to do, particularly on gen3 hardware, and I *think* one of those things is what was locking up my pinnacle hw from time to time -- at least, its been perfectly well behaved every time its been plugged in since making this change. First up, we're adding a bit more to the gen1 init routine here. Its not absolutely necessary, the hardware works the same both with and without it, but I'd like to be consistent w/Windows here. Second, DEVICE_RESET is never called when initializing either of my gen3 devices, its only called for gen1 and gen2. The bits in the gen3 init after removing that, are safe (and interesting) to run on all hardware, so there's no more gen3-specific init done, there's instead a generic mceusb_get_parameters() that is run for all hardware. Third, the gen3 flag isn't needed. We only care if hardware is gen3 during probe, so I've dropped that from the device flags struct. Successfully tested on all three generations of mceusb hardware. Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR/mceusb: remove unused vars from gen1 initMauro Carvalho Chehab2010-08-021-2/+1Star
| | | | | | | | | | | | Prior init unification/simplification patch made these unused, forgot to remove them, so this silences: drivers/media/IR/mceusb.c: In function ‘mceusb_gen1_init’: drivers/media/IR/mceusb.c:769: warning: unused variable ‘partial’ drivers/media/IR/mceusb.c:768: warning: unused variable ‘i’ Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: lirc: use unlocked_ioctlArnd Bergmann2010-08-023-12/+10Star
| | | | | | | | | | New code should not rely on the big kernel lock, so use the unlocked_ioctl file operation in lirc. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Tested-by: Jarod Wilson <jarod@redhat.com> Acked-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR: jvc-decoder needs BITREVERSERandy Dunlap2010-08-021-0/+1
| | | | | | | | | | | ir-jvc-decoder uses bitreverse interfaces, so it should select BITREVERSE. ir-jvc-decoder.c:(.text+0x550bc): undefined reference to `byte_rev_table' ir-jvc-decoder.c:(.text+0x550c6): undefined reference to `byte_rev_table' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR/lirc_dev: fix locking in lirc_dev_fop_readJarod Wilson2010-08-021-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Wed, Jul 07, 2010 at 02:52:58PM +0200, Jiri Slaby wrote: > Hi, > > stanse found a locking error in lirc_dev_fop_read: > if (mutex_lock_interruptible(&ir->irctl_lock)) > return -ERESTARTSYS; > ... > while (written < length && ret == 0) { > if (mutex_lock_interruptible(&ir->irctl_lock)) { #1 > ret = -ERESTARTSYS; > break; > } > ... > } > > remove_wait_queue(&ir->buf->wait_poll, &wait); > set_current_state(TASK_RUNNING); > mutex_unlock(&ir->irctl_lock); #2 > > If lock at #1 fails, it beaks out of the loop, with the lock unlocked, > but there is another "unlock" at #2. This should do the trick. Completely untested beyond compiling, but its not exactly a complicated fix, and in practice, I'm not aware of anyone ever actually tripping that locking bug, so there's zero functional change in typical use here. Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR/mceusb: unify and simplify different gen device initJarod Wilson2010-08-021-43/+7Star
| | | | | | | | | | | | | Started out as an effort to try to tackle the last remaining issue I'm having with this damned pinnacle device getting wedged the first time its plugged in after an indeterminate length of not being plugged in. Didn't get that solved yet, but did streamline the init code a bit more and remove some superfluous gunk. Nukes a completely unneeded call to usb_device_init() and several lines of overly complex crap in the gen1 device init path. Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR/imon: auto-configure another 0xffdc device variantJarod Wilson2010-08-021-0/+1
| | | | | | | | | | | | | | | | | Per Pieter Hoekstra: I have a Antec Fusion with a iMON Lcd and I get the following error: imon 6-1:1.0: Unknown 0xffdc device, defaulting to VFD and iMON IR (id 0x9e) The driver is functional if I load it like this: (I do not use a remote for it) modprobe imon display_type=1 (On Mythbuntu 10.04/2.6.32) This device is a lcd-type with support for a MCE remote. Looking at the source code, this device (0x9e) is the same as id 0x9f. Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR: add empty lirc pseudo-keymapJarod Wilson2010-08-022-0/+42
| | | | | Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR: add ir-core to lirc userspace decoder bridge driverJarod Wilson2010-08-026-0/+310
| | | | | | | | | | v2: copy of buffer data from userspace done inside this plugin/driver, keeping the actual drivers minimal, and more flexible in what we can deliver to them later on (they may be fed from within kernelspace later on, by an in-kernel IR encoder). Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR: add lirc device interfaceJarod Wilson2010-08-024-0/+999
| | | | | | | v2: currently unused ioctls are included, but #if 0'd out Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR/mceusb: add tx callback functions and wire upJarod Wilson2010-08-021-10/+138
| | | | | | | | | | mchehab: merged with IR/mceusb: userspace buffer copy moved out of driver Userspace buffer copy moved out of driver and into lirc bridge driver [mchehab@redhat.com: merged the patch to avoid compilation errors with allyesconfig ] Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR/mceusb: kill pinnacle-device-specific nonsenseJarod Wilson2010-08-021-49/+14Star
| | | | | | | | | | | | I have pinnacle hardware now. None of this pinnacle-specific crap is at all necessary (in fact, some of it needed to be removed to actually make it work). The only thing unique about this device is that it often transfers inbound data w/a header of 0x90, meaning 16 bytes of IR data following it, so I had to make adjustments for that, and now its working perfectly fine. Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR/mceusb: misc cleanups and init fixesJarod Wilson2010-08-021-69/+69
| | | | | | | | | | | | | | | | | | | | | | | The first-gen mceusb device init code, while mostly functional, had a few issues in it. This patch does the following: 1) removes use of magic numbers 2) eliminates mapping of memory from stack 3) makes debug spew translator functional Additionally, this clean-up revealed that we cannot read the proper default tx blaster bitmask from the device, we do actually have to initialize it ourselves, which requires use of a somewhat gross list-based mask inversion check. This patch also removes the entirely unnecessary use of struct ir_input_state. Also supersedes two earlier patches that also touched on first-gen cleanup, but were partially botched. This one actually compiles, works, etc., I swear. ;) Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR/mceusb: use the proper ir-core device unregister functionJarod Wilson2010-08-021-1/+1
| | | | | | | | | Was using input_unregister_device directly, instead of using ir_input_unregister, which tears down a bunch of other things in addition to eventually calling input_unregister_device. Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: IR/imon: use the proper ir-core device unregister functionJarod Wilson2010-08-021-2/+2
| | | | | | | | | Was using input_unregister_device directly, instead of using ir_input_unregister, which tears down a bunch of other things in addition to eventually calling input_unregister_device. Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: media/IR: nec-decoder needs to select BITREVRandy Dunlap2010-08-021-0/+1
| | | | | | | | | | | | | Fix ir-nec-decoder build: it uses bitrev library code, so select BITREVERSE in its Kconfig. ir-nec-decoder.c:(.text+0x1a2517): undefined reference to `byte_rev_table' ir-nec-decoder.c:(.text+0x1a2526): undefined reference to `byte_rev_table' ir-nec-decoder.c:(.text+0x1a2530): undefined reference to `byte_rev_table' ir-nec-decoder.c:(.text+0x1a2539): undefined reference to `byte_rev_table' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: ir-core: move decoding state to ir_raw_event_ctrlDavid Härdeman2010-08-027-464/+118Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves the state from each raw decoder into the ir_raw_event_ctrl struct. This allows the removal of code like this: spin_lock(&decoder_lock); list_for_each_entry(data, &decoder_list, list) { if (data->ir_dev == ir_dev) break; } spin_unlock(&decoder_lock); return data; which is currently run for each decoder on each event in order to get the client-specific decoding state data. In addition, ir decoding modules and ir driver module load order is now independent. Centralizing the data also allows for a nice code reduction of about 30% per raw decoder as client lists and client registration callbacks are no longer necessary (but still kept around for the benefit of the lirc decoder). Out-of-tree modules can still use a similar trick to what the raw decoders did before this patch until they are merged. Signed-off-by: David Härdeman <david@hardeman.nu> Acked-by: Jarod Wilson <jarod@redhat.com> Tested-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: ir-core: allow specifying multiple protocols at one open/writeMauro Carvalho Chehab2010-08-021-46/+46
| | | | | | | | | | With this change, it is now possible to do something like: su -c 'echo "none +rc-5 +nec" > /sys/class/rc/rc1/protocols' This prevents the need of multiple opens, one for each protocol change, and makes userspace application easier. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: ir-core: Add support for disabling all protocolsMauro Carvalho Chehab2010-08-021-9/+18
| | | | | | | | | Writing "none" to /dev/class/rc/rc*/protocols will disable all protocols. This allows an easier setup, from userspace, as userspace applications don't need to disable protocol per protocol, before enabling a different set of protocols. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: ir-core: Rename sysfs protocols nomenclature to rc-5 and rc-6Mauro Carvalho Chehab2010-08-021-2/+2
| | | | | | | | | | | | While rc-5 and rc-6 protocols are generally abreviated as "rc5" and "rc6", previous sysfs nodes uses rc-5 and rc-6 for the Philips protocols. This is consistent with the protocol nomenclature given by the original Philips spec: "Remote control system RC-5" (doc. Nr. 9398 706 23011). Also, rc5 is the name of a widely known cryptography protocol. So, the better is to keep referring to those protocols as "rc-5" and "rc-6". Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: ir-core: Remove magic numbers at the sysfs logicMauro Carvalho Chehab2010-08-021-51/+32Star
| | | | | | | | | Instead of using "magic" sizes for protocol names, replace them by an array, and use strlen(). No functional changes. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB: ir-core: centralize sysfs raw decoder enabling/disablingDavid Härdeman2010-08-028-462/+232Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the current logic, each raw decoder needs to add a copy of the exact same sysfs code. This is both unnecessary and also means that (re)loading an IR driver after raw decoder modules have been loaded won't work as expected. This patch moves that logic into ir-raw-event and adds a single sysfs file per device. Reading that file returns something like: "rc5 [rc6] nec jvc [sony]" (with enabled protocols in [] brackets) Writing either "+protocol" or "-protocol" to that file will enable or disable the according protocol decoder. An additional benefit is that the disabling of a decoder will be remembered across module removal/insertion so a previously disabled decoder won't suddenly be activated again. The default setting is to enable all decoders. This is also necessary for the next patch which moves even more decoder state into the central raw decoding structs. Signed-off-by: David Härdeman <david@hardeman.nu> Acked-by: Jarod Wilson <jarod@redhat.com> Tested-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>