summaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/ir-lirc-codec.c
Commit message (Collapse)AuthorAgeFilesLines
* media: rc: move ir-lirc-codec.c contents into lirc_dev.cSean Young2017-12-141-623/+0Star
| | | | | | | | | | Since removing the lirc kapi, ir-lirc-codec.c only contains lirc fops so the file name is no longer correct. By moving its content into lirc_dev.c the ugly extern struct lirc_fops is not longer needed, and everything lirc related is in one file. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: lirc: scancode rc devices should have a lirc device tooSean Young2017-12-141-4/+15
| | | | | | | | | | | | Now that the lirc interface supports scancodes, RC scancode devices can also have a lirc device. The only receiving feature they will have enabled is LIRC_CAN_REC_SCANCODE. Note that CEC devices have no lirc device, since they can be controlled from their /dev/cecN chardev. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: lirc: implement reading scancodeSean Young2017-12-141-15/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements LIRC_MODE_SCANCODE reading from the lirc device. The scancode can be read from the input device too, but with this interface you get the rc protocol, keycode, toggle and repeat status in addition to just the scancode. int main() { int fd, mode, rc; fd = open("/dev/lirc0", O_RDWR); mode = LIRC_MODE_SCANCODE; if (ioctl(fd, LIRC_SET_REC_MODE, &mode)) { // kernel too old or lirc does not support transmit } struct lirc_scancode scancode; while (read(fd, &scancode, sizeof(scancode)) == sizeof(scancode)) { printf("protocol:%d scancode:0x%x toggle:%d repeat:%d\n", scancode.rc_proto, scancode.scancode, !!(scancode.flags & LIRC_SCANCODE_FLAG_TOGGLE), !!(scancode.flags & LIRC_SCANCODE_FLAG_REPEAT)); } close(fd); } Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: lirc: remove last remnants of lirc kapiSean Young2017-12-141-37/+4Star
| | | | | | | | | | | | rc-core has replaced the lirc kapi many years ago, and now with the last driver ported to rc-core, we can finally remove it. Note this has no effect on userspace. All future IR drivers should use the rc-core api. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: lirc: remove name from lirc_devSean Young2017-12-141-2/+0Star
| | | | | | | This is a duplicate of rcdev->driver_name. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: lirc: create rc-core open and close lirc functionsSean Young2017-12-141-2/+57
| | | | | | | | Replace the generic kernel lirc api with ones which use rc-core, further reducing the lirc_dev members. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: lirc: move lirc_dev->attached to rc_dev->registeredSean Young2017-12-141-6/+10
| | | | | | | | This is done to further remove the lirc kernel api. Ensure that every fops checks for this. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: lirc: use kfifo rather than lirc_buffer for raw IRSean Young2017-12-141-14/+67
| | | | | | | | | | Since the only mode lirc devices can handle is raw IR, handle this in a plain kfifo. Remove lirc_buffer since this is no longer needed. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: lirc: merge lirc_dev_fop_ioctl and ir_lirc_ioctlSean Young2017-12-141-32/+47
| | | | | | | | | | | Calculate lirc features when necessary, and add LIRC_{S,G}ET_REC_MODE cases to ir_lirc_ioctl. This makes lirc_dev_fop_ioctl() unnecessary since all cases are already handled by ir_lirc_ioctl(). Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: lirc: validate scancode for transmitSean Young2017-12-141-0/+10
| | | | | | | Ensure we reject an attempt to transmit invalid scancodes. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: lirc: lirc interface should not be a raw decoderSean Young2017-12-141-99/+36Star
| | | | | | | | | | | | | | | | | | The lirc user interface exists as a raw decoder, which does not make much sense for transmit-only devices. In addition, we want to have lirc char devices for devices which do not use raw IR, i.e. scancode only devices. Note that rc-code, lirc_dev, ir-lirc-codec are now calling functions of each other, so they've been merged into one module rc-core to avoid circular dependencies. Since ir-lirc-codec no longer exists as separate codec module, there is no need for RC_DRIVER_IR_RAW_TX type drivers to call ir_raw_event_register(). Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: lirc: use the correct carrier for scancode transmitSean Young2017-12-141-11/+18
| | | | | | | If the lirc device supports it, set the carrier for the protocol. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: lirc: implement scancode sendingSean Young2017-12-141-27/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a new lirc mode: scancode. Any device which can send raw IR can now also send scancodes. int main() { int mode, fd = open("/dev/lirc0", O_RDWR); mode = LIRC_MODE_SCANCODE; if (ioctl(fd, LIRC_SET_SEND_MODE, &mode)) { // kernel too old or lirc does not support transmit } struct lirc_scancode scancode = { .scancode = 0x1e3d, .rc_proto = RC_PROTO_RC5, }; write(fd, &scancode, sizeof(scancode)); close(fd); } The other fields of lirc_scancode must be set to 0. Note that toggle (rc5, rc6) and repeats (nec) are not implemented. Nor is there a method for holding down a key for a period. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: lirc: remove LIRCCODE and LIRC_GET_LENGTHSean Young2017-12-141-1/+0Star
| | | | | | | | | LIRCCODE is a lirc mode where a driver produces driver-dependent codes for receive and transmit. No driver uses this any more. The LIRC_GET_LENGTH ioctl was used for this mode only. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: rc: fix kernel-doc parameter namesMauro Carvalho Chehab2017-11-301-2/+2
| | | | | | | | | | | | | | | | | | | | There are several parameters there that are named wrong, as reported by those warnings: drivers/media/rc/ir-sharp-decoder.c:47: warning: No description found for parameter 'ev' drivers/media/rc/ir-sharp-decoder.c:47: warning: Excess function parameter 'duration' description in 'ir_sharp_decode' drivers/media/rc/ir-sanyo-decoder.c:56: warning: No description found for parameter 'ev' drivers/media/rc/ir-sanyo-decoder.c:56: warning: Excess function parameter 'duration' description in 'ir_sanyo_decode' drivers/media/rc/ir-xmp-decoder.c:43: warning: No description found for parameter 'ev' drivers/media/rc/ir-xmp-decoder.c:43: warning: Excess function parameter 'duration' description in 'ir_xmp_decode' drivers/media/rc/ir-jvc-decoder.c:47: warning: No description found for parameter 'ev' drivers/media/rc/ir-jvc-decoder.c:47: warning: Excess function parameter 'duration' description in 'ir_jvc_decode' drivers/media/rc/ir-lirc-codec.c:34: warning: No description found for parameter 'dev' drivers/media/rc/ir-lirc-codec.c:34: warning: No description found for parameter 'ev' drivers/media/rc/ir-lirc-codec.c:34: warning: Excess function parameter 'input_dev' description in 'ir_lirc_decode' drivers/media/rc/ir-lirc-codec.c:34: warning: Excess function parameter 'duration' description in 'ir_lirc_decode' Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: rc: check for integer overflowSean Young2017-10-111-3/+6
| | | | | | | | | The ioctl LIRC_SET_REC_TIMEOUT would set a timeout of 704ns if called with a timeout of 4294968us. Cc: <stable@vger.kernel.org> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] media: lirc_dev: merge struct irctl into struct lirc_devDavid Härdeman2017-10-041-8/+7Star
| | | | | | | | | | | | | | | The use of two separate structs (lirc_dev aka lirc_driver and irctl) makes it much harder to follow the proper lifetime of the various structs and necessitates hacks such as keeping a copy of struct lirc_dev inside struct irctl. Merging the two structs means that lirc_dev can properly manage the lifetime of the resulting struct and simplifies the code at the same time. [mchehab@s-opensource.com: fix merge conflict] Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: lirc_dev: introduce lirc_allocate_device and lirc_free_deviceDavid Härdeman2017-10-041-1/+1
| | | | | | | | | | | | | | | | | | | Introduce two new functions so that the API for lirc_dev matches that of the rc-core and input subsystems. This means that lirc_dev structs are managed using the usual four functions: lirc_allocate_device lirc_free_device lirc_register_device lirc_unregister_device The functions are pretty simplistic at this point, later patches will put more flesh on the bones of both. Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Sean Young <sean@mess.org>
* [media] media: rename struct lirc_driver to struct lirc_devDavid Härdeman2017-10-041-26/+26
| | | | | | | | | This is in preparation for the later patches which do away with struct irctl entirely. Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: lirc_dev: remove support for manually specifying minor numberDavid Härdeman2017-10-041-6/+3Star
| | | | | | | | | | | | All users of lirc_register_driver() uses dynamic minor allocation, therefore we can remove the ability to explicitly request a given number. This changes the function prototype of lirc_unregister_driver() to also take a struct lirc_driver pointer as the sole argument. Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* media: lirc: LIRC_GET_REC_RESOLUTION should return microsecondsSean Young2017-07-261-1/+1
| | | | | | | | | | | | | | Since commit e8f4818895b3 ("[media] lirc: advertise LIRC_CAN_GET_REC_RESOLUTION and improve") lircd uses the ioctl LIRC_GET_REC_RESOLUTION to determine the shortest pulse or space that the hardware can detect. This breaks decoding in lirc because lircd expects the answer in microseconds, but nanoseconds is returned. Cc: <stable@vger.kernel.org> # v2.6.36+ Reported-by: Derek <user.vdr@gmail.com> Tested-by: Derek <user.vdr@gmail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] lirc_dev: remove unused set_use_inc/set_use_decDavid Härdeman2017-06-061-2/+0Star
| | | | | | | | | Since there are no users of this functionality, it can be removed altogether. Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] lirc_dev: remove pointless functionsDavid Härdeman2017-06-061-12/+2Star
| | | | | | | | | drv->set_use_inc and drv->set_use_dec are already optional so we can remove all dummy functions. Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] ir-lirc-codec: let lirc_dev handle the lirc_bufferDavid Härdeman2017-05-181-18/+7Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | ir_lirc_register() currently creates its own lirc_buffer before passing the lirc_driver to lirc_register_driver(). When a module is later unloaded, ir_lirc_unregister() gets called which performs a call to lirc_unregister_driver() and then free():s the lirc_buffer. The problem is that: a) there can still be a userspace app holding an open lirc fd when lirc_unregister_driver() returns; and b) the lirc_buffer contains "wait_queue_head_t wait_poll" which is potentially used as long as any userspace app is still around. The result is an oops which can be triggered quite easily by a userspace app monitoring its lirc fd using epoll() and not closing the fd promptly on device removal. The minimalistic fix is to let lirc_dev create the lirc_buffer since lirc_dev will then also free the buffer once it believes it is safe to do so. Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] lirc: advertise LIRC_CAN_GET_REC_RESOLUTION and improveSean Young2017-03-241-1/+7
| | | | | | | | This feature was never set. The ioctl should fail if no resolution is set. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] lirc: return ENOTTY when device does support ioctlSean Young2017-03-241-0/+6
| | | | | | | If timeouts or carrier range is not supported, return proper error. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] lirc: return ENOTTY when ioctl is not supportedSean Young2017-03-241-10/+10
| | | | | | | | We shouldn't be using ENOSYS when a feature is not available. I've tested lirc; nothing is broken as far as I can make out. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] lirc: LIRC_GET_MIN_TIMEOUT should be in rangeSean Young2017-01-311-1/+1
| | | | | | | | LIRC_SET_REC_TIMEOUT can fail if the value returned by LIRC_GET_MIN_TIMEOUT is set due to rounding errors. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] lirc: fix transmit-only read featuresSean Young2017-01-311-2/+3
| | | | | | | | An RC device which is transmit-only shouldn't have the LIRC_CAN_REC_MODE2 feature. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] lirc: LIRC_{G,S}ET_SEND_MODE fail if device cannot transmitSean Young2017-01-301-2/+8
| | | | | | | | | | These ioctls should not succeed if the device cannot send. Also make it clear that these ioctls should return the lirc mode, although the actual value does not change. Signed-off-by: Sean Young <sean@mess.org> Reviewed-by: Andi Shyti <andi.shyti@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] redrat3: make hardware timeout configurableSean Young2016-07-151-1/+4
| | | | | | | | Instead of hardcoding a timeout, let userspace change it dynamically by adding a s_timeout ops. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.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] rc-core: remove the LIRC "protocol"David Härdeman2015-07-061-4/+1Star
| | | | | | | | | | | | The LIRC protocol was always a bad fit and if we're ever going to expose protocol numbers in a user-space API, it'd be better to get rid of the LIRC "protocol" first. The sysfs API is kept backwards compatible by always listing the lirc protocol as present and enabled. Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media/rc: Send sync space information on the lirc deviceAustin Lund2014-11-041-3/+9
| | | | | | | | | | | | | Userspace expects to see a long space before the first pulse is sent on the lirc device. Currently, if a long time has passed and a new packet is started, the lirc codec just returns and doesn't send anything. This makes lircd ignore many perfectly valid signals unless they are sent in quick sucession. When a reset event is delivered, we cannot know anything about the duration of the space. But it should be safe to assume it has been a long time and we just set the duration to maximum. Signed-off-by: Austin Lund <austin.lund@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] rc-core: remove protocol arraysDavid Härdeman2014-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The basic API of rc-core used to be: dev = rc_allocate_device(); dev->x = a; dev->y = b; dev->z = c; rc_register_device(); which is a pretty common pattern in the kernel, after the introduction of protocol arrays the API looks something like: dev = rc_allocate_device(); dev->x = a; rc_set_allowed_protocols(dev, RC_BIT_X); dev->z = c; rc_register_device(); There's no real need for the protocols to be an array, so change it back to be consistent (and in preparation for the following patches). [m.chehab@samsung.com: added missing changes at some files] Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] rc: abstract access to allowed/enabled protocolsJames Hogan2014-03-111-1/+1
| | | | | | | | | | | The allowed and enabled protocol masks need to be expanded to be per filter type in order to support wakeup filter protocol selection. To ease that process abstract access to the rc_dev::allowed_protos and rc_dev::enabled_protocols members with inline functions. Signed-off-by: James Hogan <james.hogan@imgtec.com> Reviewed-by: Antti Seppälä <a.seppala@gmail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] media: lirc: Allow lirc dev to talk to rc deviceSrinivas Kandagatla2013-07-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The use case is simple, if any rc device has allowed protocols = RC_TYPE_LIRC and map_name = RC_MAP_LIRC set, the driver open will be never called. The reason for this is, all of the key maps except lirc have some KEYS in there map, so during rc_register_device process these keys are matched against the input drivers and open is performed, so for the case of RC_MAP_EMPTY, a vt/keyboard is matched and the driver open is performed. In case of lirc, there is no match and result is that there is no open performed, however the lirc-dev will go ahead and create a /dev/lirc0 node. Now when lircd/mode2 opens this device, no data is available because the driver was never opened. Other case pointed by Sean Young, As rc device gets opened via the input interface. If the input device is never opened (e.g. embedded with no console) then the rc open is never called and lirc will not work either. So that's another case. lirc_dev seems to have no link with actual rc device w.r.t open/close. This patch adds rc_dev pointer to lirc_driver structure for cases like this, so that it can do the open/close of the real driver in accordance to lircd/mode2 open/close. Without this patch its impossible to open a rc device which has RC_TYPE_LIRC ad RC_MAP_LIRC set. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] lirc: validate transmission ir dataSean Young2013-07-301-1/+10
| | | | | | | | | The lirc interface allows 255 u32 spaces and pulses, which are usec. If the driver can handle this (e.g. winbond-cir) you can produce hours of meaningless IR data and there is no method of interrupting it. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* Merge branch 'for-linus' of ↵Linus Torvalds2013-05-021-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull VFS updates from Al Viro, Misc cleanups all over the place, mainly wrt /proc interfaces (switch create_proc_entry to proc_create(), get rid of the deprecated create_proc_read_entry() in favor of using proc_create_data() and seq_file etc). 7kloc removed. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (204 commits) don't bother with deferred freeing of fdtables proc: Move non-public stuff from linux/proc_fs.h to fs/proc/internal.h proc: Make the PROC_I() and PDE() macros internal to procfs proc: Supply a function to remove a proc entry by PDE take cgroup_open() and cpuset_open() to fs/proc/base.c ppc: Clean up scanlog ppc: Clean up rtas_flash driver somewhat hostap: proc: Use remove_proc_subtree() drm: proc: Use remove_proc_subtree() drm: proc: Use minor->index to label things, not PDE->name drm: Constify drm_proc_list[] zoran: Don't print proc_dir_entry data in debug reiserfs: Don't access the proc_dir_entry in r_open(), r_start() r_show() proc: Supply an accessor for getting the data from a PDE's parent airo: Use remove_proc_subtree() rtl8192u: Don't need to save device proc dir PDE rtl8187se: Use a dir under /proc/net/r8180/ proc: Add proc_mkdir_data() proc: Move some bits from linux/proc_fs.h to linux/{of.h,signal.h,tty.h} proc: Move PDE_NET() to fs/proc/proc_net.c ...
| * constify a bunch of struct file_operations instancesAl Viro2013-04-091-1/+1
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | [media] rc-core: don't treat dev->rc_map.rc_type as a bitmapDavid Härdeman2013-03-231-1/+1
|/ | | | | | | | | | | | | | store_protocols() treats dev->rc_map.rc_type as a bitmap which is wrong for two reasons. First of all, it is pretty bogus to change the protocol type of the keymap just because the hardware has been asked to decode a different protocol. Second, dev->rc_map.rc_type is an enum (i.e. a single protocol) as pointed out by James Hogan <james.hogan@imgtec.com>. Fix both issues by introducing a separate enabled_protocols member to struct rc_dev. Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] rc-core: add separate defines for protocol bitmaps and numbersDavid Härdeman2012-10-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RC_TYPE_* defines are currently used both where a single protocol is expected and where a bitmap of protocols is expected. Functions like rc_keydown() and functions which add/remove entries to the keytable want a single protocol. Future userspace APIs would also benefit from numeric protocols (rather than bitmap ones). Keytables are smaller if they can use a small(ish) integer rather than a bitmap. Other functions or struct members (e.g. allowed_protos, enabled_protocols, etc) accept multiple protocols and need a bitmap. Using different types reduces the risk of programmer error. Using a protocol enum whereever possible also makes for a more future-proof user-space API as we don't need to worry about a sufficient number of bits being available (e.g. in structs used for ioctl() calls). The use of both a number and a corresponding bit is dalso one in e.g. the input subsystem as well (see all the references to set/clear bit when changing keytables for example). This patch separate the different usages in preparation for upcoming patches. Where a single protocol is expected, enum rc_type is used; where one or more protocol(s) are expected, something like u64 is used. The patch has been rewritten so that the format of the sysfs "protocols" file is no longer altered (at the loss of some detail). The file itself should probably be deprecated in the future though. Signed-off-by: David Härdeman <david@hardeman.nu> Cc: Andy Walls <awalls@md.metrocast.net> Cc: Maxim Levitsky <maximlevitsky@gmail.com> Cc: Antti Palosaari <crope@iki.fi> Cc: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] rc-core: fix return codes in ir_lirc_ioctl()Dan Carpenter2012-10-061-2/+2
| | | | | | | | These should be -ENOSYS because not -EINVAL. Reported-by: Sean Young <sean@mess.org> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] rc: fix buffer overrunSean Young2012-09-151-1/+1
| | | | | | | | | | "[media] rc-core: move timeout and checks to lirc" introduced a buffer overrun by passing the number of bytes, rather than the number of samples, to the transmit function. Signed-off-by: Sean Young <sean@mess.org> Acked-by: David Härdeman <david@hardeman.nu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] rc-core: move timeout and checks to lircDavid Härdeman2012-08-141-4/+29
| | | | | | | | | | | | | | | | | The lirc TX functionality expects the process which writes (TX) data to the lirc dev to sleep until the actual data has been transmitted by the hardware. Since the same timeout calculation is duplicated in more than one driver (and would have to be duplicated in even more drivers as they gain TX support), it makes sense to move this timeout calculation to the lirc layer instead. At the same time, centralize some of the sanity checks. Signed-off-by: David Härdeman <david@hardeman.nu> Cc: Jarod Wilson <jwilson@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] rc: transmit on device which does not support it should failSean Young2012-08-131-1/+1
| | | | | | | Currently write() will return 0 if an IR device does not support sending. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* Merge branch 'modsplit-Oct31_2011' of ↵Linus Torvalds2011-11-071-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits) Revert "tracing: Include module.h in define_trace.h" irq: don't put module.h into irq.h for tracking irqgen modules. bluetooth: macroize two small inlines to avoid module.h ip_vs.h: fix implicit use of module_get/module_put from module.h nf_conntrack.h: fix up fallout from implicit moduleparam.h presence include: replace linux/module.h with "struct module" wherever possible include: convert various register fcns to macros to avoid include chaining crypto.h: remove unused crypto_tfm_alg_modname() inline uwb.h: fix implicit use of asm/page.h for PAGE_SIZE pm_runtime.h: explicitly requires notifier.h linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h miscdevice.h: fix up implicit use of lists and types stop_machine.h: fix implicit use of smp.h for smp_processor_id of: fix implicit use of errno.h in include/linux/of.h of_platform.h: delete needless include <linux/module.h> acpi: remove module.h include from platform/aclinux.h miscdevice.h: delete unnecessary inclusion of module.h device_cgroup.h: delete needless include <linux/module.h> net: sch_generic remove redundant use of <linux/module.h> net: inet_timewait_sock doesnt need <linux/module.h> ... Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in - drivers/media/dvb/frontends/dibx000_common.c - drivers/media/video/{mt9m111.c,ov6650.c} - drivers/mfd/ab3550-core.c - include/linux/dmaengine.h
| * drivers/media: Add module.h to all files using it implicitlyPaul Gortmaker2011-11-011-0/+1
| | | | | | | | | | | | | | | | A pending cleanup will mean that module.h won't be implicitly everywhere anymore. Make sure the modular drivers in clocksource are actually calling out for <module.h> explicitly in advance. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
* | [media] rc/ir-lirc-codec: cleanup __user tagsDan Carpenter2011-10-111-4/+5
|/ | | | | | | | The code here treated user pointers correctly, but the __user tags weren't used correctly so it caused Sparse warnings: Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] rc-core: lirc use unsigned intDavid Härdeman2011-07-271-6/+9
| | | | | | | | | Durations can never be negative, so it makes sense to consistently use unsigned int for LIRC transmission. Contrary to the initial impression, this shouldn't actually change the userspace API. Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>