summaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/mceusb.c
Commit message (Collapse)AuthorAgeFilesLines
* media: rc: mceusb: add support for 15f4:0135Oleh Kravchenko2017-10-311-0/+9
| | | | | | | | Astrometa T2hybrid (15f4:0135) has IR on Interface 0. Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: rc: mceusb: add support for 1b80:d3b2Oleh Kravchenko2017-10-311-0/+9
| | | | | | | | | | Evromedia USB Full Hybrid Full HD (1b80:d3b2) has IR on Interface 0. Remote controller supplied with this tuner fully compatible with RC_MAP_MSI_DIGIVOX_III. Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] media: rc: constify usb_device_idArvind Yadav2017-10-041-1/+1
| | | | | | | | | | usb_device_id are not supposed to change at runtime. All functions working with usb_device_id provided by <linux/usb.h> work with const usb_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* media: rc: rename RC_TYPE_* to RC_PROTO_* and RC_BIT_* to RC_PROTO_BIT_*Sean Young2017-08-201-1/+1
| | | | | | | | | RC_TYPE is confusing and it's just the protocol. So rename it. Suggested-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Sean Young <sean@mess.org> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: mceusb: do not read data parameters unless requiredSean Young2017-08-201-19/+17Star
| | | | | | | | | This causes out-of-bounds read on device probe. BUG: KASAN: slab-out-of-bounds in mceusb_dev_printdata+0xdc/0x830 [mceusb] Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: rc-core: rename input_name to device_nameSean Young2017-08-201-1/+1
| | | | | | | | | | | | | | | | | | When an ir-spi is registered, you get this message. rc rc0: Unspecified device as /devices/platform/soc/3f215080.spi/spi_master/spi32766/spi32766.128/rc/rc0 "Unspecified device" refers to input_name, which makes no sense for IR TX only devices. So, rename to device_name. Also make driver_name const char* so that no casts are needed anywhere. Now ir-spi reports: rc rc0: IR SPI as /devices/platform/soc/3f215080.spi/spi_master/spi32766/spi32766.128/rc/rc0 Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] mceusb: drop redundant urb reinitialisationJohan Hovold2017-06-071-3/+0Star
| | | | | | | | | | Drop a since commit e1159cb35712 ("[media] mceusb: remove pointless mce_flush_rx_buffer function") redundant reinitialisation of two urb fields immediately after they have been initialised. Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] mceusb: fix memory leaks in error pathJohan Hovold2017-06-071-0/+2
| | | | | | | | | | | | | Fix urb and transfer-buffer leaks in an urb-submission error path which may be hit when a device is disconnected. Fixes: 66e89522aff7 ("V4L/DVB: IR: add mceusb IR receiver driver") Cc: stable <stable@vger.kernel.org> # 2.6.36 Cc: Jarod Wilson <jarod@redhat.com> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] mceusb: TX -EPIPE (urb status = -32) lockup fixA Sun2017-06-061-19/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Once IR blasting or mceusb device commands fail with mce_async_callback() TX -EPIPE error, all subsequent TX to device then fail with the same error. ... [ 249.986174] mceusb 1-1.2:1.0: requesting 38000 HZ carrier [ 249.986210] mceusb 1-1.2:1.0: send request called (size=0x4) [ 249.986256] mceusb 1-1.2:1.0: send request complete (res=0) [ 249.986403] mceusb 1-1.2:1.0: Error: request urb status = -32 (TX HALT) [ 249.999885] mceusb 1-1.2:1.0: send request called (size=0x3) [ 249.999929] mceusb 1-1.2:1.0: send request complete (res=0) [ 250.000013] mceusb 1-1.2:1.0: Error: request urb status = -32 (TX HALT) [ 250.019830] mceusb 1-1.2:1.0: send request called (size=0x21) [ 250.019868] mceusb 1-1.2:1.0: send request complete (res=0) [ 250.020007] mceusb 1-1.2:1.0: Error: request urb status = -32 (TX HALT) ... Fault simulation/injection is by executing the following USB operation in a mceusb instrumented driver, prior to TX I/O. retval = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0), USB_REQ_SET_FEATURE, USB_RECIP_ENDPOINT, USB_ENDPOINT_HALT, usb_pipeendpoint(ir->pipe_out), NULL, 0, USB_CTRL_SET_TIMEOUT); dev_dbg(ir->dev, "set halt retval, %d", retval); After setting halt state for the TX endpoint, perform an lirc "irsend" to generate TX traffic to device. After the TX HALT, the patch restores subsequent TX to working state. ... [ 508.009638] mceusb 1-1.2:1.0: send request called (size=0x3) [ 508.009697] mceusb 1-1.2:1.0: send request complete (res=0) [ 508.009847] mce_async_callback() [ 508.009864] mceusb 1-1.2:1.0: Error: request urb status = -32 (TX HALT) [ 508.009890] mceusb 1-1.2:1.0: kevent 0 scheduled [ 508.021552] mceusb 1-1.2:1.0: send request called (size=0x21) [ 508.021598] mceusb 1-1.2:1.0: send request complete (res=0) [ 508.021963] mce_async_callback() [ 508.021981] mceusb 1-1.2:1.0: tx data: 84 b0 0c 8c 0c 84 8c 0c 8c 0c 84 8c 0c 8c 0c 84 98 0c 98 0c 84 98 0c 8c 0c 84 8c 0c 8c 0c 81 8c 80 (length=33) [ 508.021997] mceusb 1-1.2:1.0: Raw IR data, 0 pulse/space samples [ 508.066627] mceusb 1-1.2:1.0: send request called (size=0x3) [ 508.066669] mceusb 1-1.2:1.0: send request complete (res=0) [ 508.066841] mce_async_callback() [ 508.066858] mceusb 1-1.2:1.0: tx data: 9f 08 03 (length=3) ... Signed-off-by: A Sun <as1033x@comcast.net> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] mceusb: RX -EPIPE (urb status = -32) lockup failure fixA Sun2017-06-061-1/+73
| | | | | | | | | | | | | | | | | | | RX -EPIPE failure with infinite loop and flooding of [ 2851.966506] mceusb 1-1.2:1.0: Error: urb status = -32 log message at 8000 messages per second. Bug trigger appears to be normal, but heavy, IR receiver use. Driver and Linux host become unusable after error. Also seen at https://sourceforge.net/p/lirc/mailman/message/34886165/ Fix: Message reports RX usb halt (stall) condition requiring usb_clear_halt() call in non-interrupt context to recover. Add driver workqueue call to perform this recovery based on method in use for the usbnet device driver. Signed-off-by: A Sun <as1033x@comcast.net> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] mceusb: fix inaccurate debug buffer dumps, and misleading debug messagesA Sun2017-06-061-14/+15
| | | | | | | | | | Some dev_dbg messages are misleading. Some dev_dbg messages have inconsistent formatting. mceusb_dev_printdata() prints incorrect range of bytes (0 to len) in buffer which the driver will actually process next. Signed-off-by: A Sun <as1033x@comcast.net> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] mceusb: sporadic RX truncation corruption fixA Sun2017-06-061-2/+7
| | | | | | | | | | | | | | | | | | | Intermittent RX truncation and loss of IR received data. This resulted in receive stream synchronization errors where driver attempted to incorrectly parse IR data (eg 0x90 below) as command response. [ 3969.139898] mceusb 1-1.2:1.0: processed IR data [ 3969.151315] mceusb 1-1.2:1.0: rx data: 00 90 (length=2) [ 3969.151321] mceusb 1-1.2:1.0: Unknown command 0x00 0x90 [ 3969.151336] mceusb 1-1.2:1.0: rx data: 98 0a 8d 0a 8e 0a 8e 0a 8e 0a 8e 0a 9a 0a 8e 0a 0b 3a 8e 00 80 41 59 00 00 (length=25) [ 3969.151341] mceusb 1-1.2:1.0: Raw IR data, 24 pulse/space samples [ 3969.151348] mceusb 1-1.2:1.0: Storing space with duration 500000 Bug trigger appears to be normal, but heavy, IR receiver use. Signed-off-by: A Sun <as1033x@comcast.net> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] mceusb: fix NULL-deref at probeJohan Hovold2017-03-241-2/+2
| | | | | | | | | | | | | Make sure to check for the required out endpoint to avoid dereferencing a NULL-pointer in mce_request_packet should a malicious device lack such an endpoint. Note that this path is hit during probe. Fixes: 66e89522aff7 ("V4L/DVB: IR: add mceusb IR receiver driver") Cc: stable <stable@vger.kernel.org> # 2.6.36 Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] rc-main: assign driver type during allocationAndi Shyti2017-01-301-2/+1Star
| | | | | | | | | | | | | | | | | | | The driver type can be assigned immediately when an RC device requests to the framework to allocate the device. This is an 'enum rc_driver_type' data type and specifies whether the device is a raw receiver or scancode receiver. The type will be given as parameter to the rc_allocate_device device. Change accordingly all the drivers calling rc_allocate_device() so that the device type is specified during the rc device allocation. Whenever the device type is not specified, it will be set as RC_DRIVER_SCANCODE which was the default '0' value. Suggested-by: Sean Young <sean@mess.org> Signed-off-by: Andi Shyti <andi.shyti@samsung.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] rc: raw IR drivers cannot handle cec, unknown or otherSean Young2017-01-301-1/+1
| | | | | | | | | | | | unknown and other are for IR protocols for which we have no decoder, so the raw IR drivers have no chance of generating them. cec is not an IR protocol. Signed-off-by: Sean Young <sean@mess.org> Cc: Jiri Kosina <jikos@kernel.org> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com> Cc: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] mceusb: LIRC_SET_SEND_CARRIER returns 0 on successSean Young2017-01-301-2/+2
| | | | | | | | | LIRC_SET_SEND_CARRIER ioctl should not return the carrier used, it should return 0. 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] media: Drop FSF's postal address from the source code filesSakari Ailus2017-01-271-4/+0Star
| | | | | | | | | | | | | | | | | | | | | Drop the FSF's postal address from the source code files that typically contain mostly the license text. Of the 628 removed instances, 578 are outdated. The patch has been created with the following command without manual edits: git grep -l "675 Mass Ave\|59 Temple Place\|51 Franklin St" -- \ drivers/media/ include/media|while read i; do i=$i perl -e ' open(F,"< $ENV{i}"); $a=join("", <F>); $a =~ s/[ \t]*\*\n.*You should.*\n.*along with.*\n.*(\n.*USA.*$)?\n//m && $a =~ s/(^.*)Or, (point your browser to) /$1To obtain the license, $2\n$1/m; close(F); open(F, "> $ENV{i}"); print F $a; close(F);'; done Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
* [media] mceusb: remove pointless mce_flush_rx_buffer functionSean Young2016-11-231-46/+31Star
| | | | | | | | | | This function just submits the urb much like mceusb_dev_resume; removing it simplifies mce_request_packet. Also add missing usb_kill_urb to mce_dev_probe. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] mceusb: remove useless debug messageSean Young2016-11-231-20/+1Star
| | | | | | | | Such debug message has a logic to track the IR status, but it doesn't provide much info. So, get rid of it. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] rc: don't break long linesMauro Carvalho Chehab2016-10-211-3/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to the 80-cols restrictions, and latter due to checkpatch warnings, several strings were broken into multiple lines. This is not considered a good practice anymore, as it makes harder to grep for strings at the source code. As we're right now fixing other drivers due to KERN_CONT, we need to be able to identify what printk strings don't end with a "\n". It is a way easier to detect those if we don't break long lines. So, join those continuation lines. The patch was generated via the script below, and manually adjusted if needed. </script> use Text::Tabs; while (<>) { if ($next ne "") { $c=$_; if ($c =~ /^\s+\"(.*)/) { $c2=$1; $next =~ s/\"\n$//; $n = expand($next); $funpos = index($n, '('); $pos = index($c2, '",'); if ($funpos && $pos > 0) { $s1 = substr $c2, 0, $pos + 2; $s2 = ' ' x ($funpos + 1) . substr $c2, $pos + 2; $s2 =~ s/^\s+//; $s2 = ' ' x ($funpos + 1) . $s2 if ($s2 ne ""); print unexpand("$next$s1\n"); print unexpand("$s2\n") if ($s2 ne ""); } else { print "$next$c2\n"; } $next=""; next; } else { print $next; } $next=""; } else { if (m/\"$/) { if (!m/\\n\"$/) { $next=$_; next; } } } print $_; } </script> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] rc: make s_tx_carrier consistentSean Young2016-07-151-1/+1
| | | | | | | LIRC_SET_SEND_CARRIER should return 0 on success or -errno. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] rc: make s_tx_mask consistentSean Young2016-07-151-0/+6
| | | | | | | | | When s_tx_mask is given an invalid bitmask, the number of transmitters should be returned. See the LIRC_SET_TRANSMITTER_MASK lirc ioctl documentation. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.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] mceusb: use %*ph for small buffer dumpsMauro Carvalho Chehab2016-03-101-3/+2Star
| | | | | | | | | 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] mceusb: fix usbdev leakAlexey Khoroshilov2014-09-231-5/+6
| | | | | | | | | | | | | | mceusb_init_rc_dev() does usb_get_dev(), but there is no any usb_put_dev() in the driver. The patch tries to straighten logic. It moves usb_get_dev() directly to mceusb_dev_probe() and adds usb_put_dev() to an error path and to mceusb_dev_disconnect(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] mceusb: add support for more cx231xx devicesMatthias Schwarzott2014-09-231-0/+4
| | | | | | | | | | | | Add support for the si2161-based cx231xx devices: [2040:b138] Hauppauge WinTV HVR-900-H (model 111xxx) [2040:b139] Hauppauge WinTV HVR-901-H (model 1114xx) They're similar to the already supported: [2040:b130] Hauppauge WinTV 930C-HD (model 1113xx) Signed-off-by: Matthias Schwarzott <zzam@gentoo.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] mceusb: select default keytable based on vendorMauro Carvalho Chehab2014-07-271-6/+17
| | | | | | | | | | | | | | | | Some vendors have their on keymap table that are used on all (or almost all) models for that vendor. So, instead of specifying the keymap table per USB ID, let's use the Vendor ID's table by default. At the end, this will mean less code to be added when newer devices for those vendors are added. Of course, if rc_map is specified per board, it takes precedence. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] mceusb: add support for newer cx231xx devicesMauro Carvalho Chehab2014-07-271-0/+8
| | | | | | | | | | | | Add support for the si2165-based cx231xx devices: [2013:025e] PCTV QuatroStick 522e [2013:0259] PCTV QuatroStick 521e [2040:b131] Hauppauge WinTV 930C-HD (model 1114xx) They're similar to the already supported: [2040:b130] Hauppauge WinTV 930C-HD (model 1113xx) Signed-off-by: Mauro Carvalho Chehab <m.chehab@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] fix mceusb endpoint type identification/handlingMatt DeVillier2014-05-251-30/+35
| | | | | | | | | | | | | | Change the I/O endpoint handling of the mceusb driver to respect the endpoint type reported by device (bulk/interrupt), rather than treating all endpoints as type interrupt, which breaks devices using bulk endpoints when connected to a xhci controller. Accordingly, change the function calls to initialize an endpoint's transfer pipe and urb handlers to use the correct function based on the endpoint type. [m.chehab@samsung.com: Fix merge conflicts and compilation breakage] Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Tested-by: Sean Young <sean@mess.org> 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] mceusb: improve error loggingSean Young2014-02-041-97/+85Star
| | | | | | | | | | | | A number of recent bug reports involve usb_submit_urb() failing which was only reported with debug parameter on. In addition, remove custom debug function. [m.chehab@samsung.com: patch rebased, as one of the patches on this series need changes] Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] mceusb: Add Hauppauge WinTV-HVR-930C HDMatthias Schwarzott2013-12-101-0/+10
| | | | | | | | | | | | | Add usb id of Hauppauge WinTV-HVR-930C HD to mceusb RC driver. This device has no IR transmitter (according to eeprom content decoded by tveeprom). Set the rc mapping to Hauppauge, every key of the deliviered remote control works correctly. [m.chehab@samsung.com: fix merge conflicts and unmangled whitespace] Signed-off-by: Matthias Schwarzott <zzam@gentoo.org> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] mceusb: add some missing cmd sizesWilliam Steidtmann2013-04-161-2/+9
| | | | | | | | | | | | Fix mceusb_cmdsize() which returns incorrect datasize=0 for sub-commands MCE_RSP_GETPORTSTATUS, MCE_RSP_GETWAKESOURCE, MCE_RSP_EQDEVDETAILS, MCE_RSP_EQEMVER, and MCE_RSP_EQIRNUMPORTS. While here, change mceusb_cmdsize() name to reflect that it returns data size not cmd size. Signed-off-by: William Steidtmann <billstei@hbci.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] mceusb: move check earlier to make smatch happyDan Carpenter2013-02-131-4/+4
| | | | | | | | | Smatch complains that "cmdbuf[cmdcount - length]" might go past the end of the array. It's an easy warning to silence by moving the limit check earlier. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] mceusb: make transmit work on HP transceiverSean Young2013-02-081-14/+11Star
| | | | | | | | This transceiver expects the set IR TX ports and IR data as seperate packets, like the Windows driver does. Remove unnecessary kzalloc. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] mceusb: make transmit work on the Philips IR transceiverSean Young2013-02-081-5/+3Star
| | | | | | | | | The GET_REVISION command puts the device in an unresponsive state, although it continues to report any IR activity. Note that GET_REVISION command is not documented, nor is any possible response to it parsed. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* Drivers: media: remove __dev* attributes.Greg Kroah-Hartman2013-01-041-4/+4
| | | | | | | | | | | | | | | CONFIG_HOTPLUG is going away as an option. As a result, the __dev* markings need to be removed. This change removes the use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit from these drivers. Based on patches originally written by Bill Pemberton, but redone by me in order to handle some of the coding style issues better, by hand. Cc: Bill Pemberton <wfp5p@virginia.edu> Cc: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* [media] rc-core: add separate defines for protocol bitmaps and numbersDavid Härdeman2012-10-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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] mceusb: Optimize DIV_ROUND_CLOSEST callJean Delvare2012-09-181-1/+1
| | | | | | | | | | | | DIV_ROUND_CLOSEST is faster if the compiler knows it will only be dealing with unsigned dividends. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Mauro Carvalho Chehab <mchehab@infradead.org> Tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] rc-core: move timeout and checks to lircDavid Härdeman2012-08-141-18/+0Star
| | | | | | | | | | | | | | | | | 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: do not wake up rc thread unless there is something to doSean Young2012-08-131-3/+7
| | | | | | | | | | | The TechnoTrend USB IR Receiver sends 125 ISO URBs per second, even when there is no IR activity. Reduce the number of wake ups from the other drivers too. This saves about 0.25ms/s on a 2.4GHz Core 2 according to powertop. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] Minor cleanups for MCE USBSean Young2012-07-311-8/+5Star
| | | | | | Signed-off-by: Sean Young <sean@mess.org> Cc: Jarod Wilson <jarod@wilsonet.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] mceusb: Add Twisted Melon USB IDsMark Lord2012-07-311-0/+7
| | | | | | | Add USB identifiers for MCE compatible I/R transceivers from Twisted Melon. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] drivers/media: add missing __devexit_p() annotationsArnd Bergmann2012-05-151-1/+1
| | | | | | | | | | Drivers that refer to a __devexit function in an operations structure need to annotate that pointer with __devexit_p so replace it with a NULL pointer when the section gets discarded. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] v4l/dvb: fix compiler warningsHans Verkuil2012-05-141-2/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | media_build/v4l/drxk_hard.c: In function 'DownloadMicrocode': media_build/v4l/drxk_hard.c:1388:6: warning: variable 'BlockCRC' set but not used [-Wunused-but-set-variable] media_build/v4l/drxk_hard.c:1384:6: warning: variable 'Drain' set but not used [-Wunused-but-set-variable] media_build/v4l/drxk_hard.c:1383:6: warning: variable 'Flags' set but not used [-Wunused-but-set-variable] media_build/v4l/lmedm04.c: In function 'lme2510_probe': media_build/v4l/lmedm04.c:1208:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable] media_build/v4l/hopper_cards.c: In function 'hopper_irq_handler': media_build/v4l/hopper_cards.c:68:26: warning: variable 'lstat' set but not used [-Wunused-but-set-variable] media_build/v4l/mantis_cards.c: In function 'mantis_irq_handler': media_build/v4l/mantis_cards.c:76:26: warning: variable 'lstat' set but not used [-Wunused-but-set-variable] media_build/v4l/mantis_dma.c: In function 'mantis_dma_stop': media_build/v4l/mantis_dma.c:202:16: warning: variable 'mask' set but not used [-Wunused-but-set-variable] media_build/v4l/mantis_dma.c:202:6: warning: variable 'stat' set but not used [-Wunused-but-set-variable] media_build/v4l/mantis_evm.c: In function 'mantis_hifevm_work': media_build/v4l/mantis_evm.c:44:17: warning: variable 'gpif_mask' set but not used [-Wunused-but-set-variable] media_build/v4l/stb0899_drv.c: In function 'stb0899_init_calc': media_build/v4l/stb0899_drv.c:640:5: warning: variable 'agc1cn' set but not used [-Wunused-but-set-variable] media_build/v4l/stb0899_drv.c: In function 'stb0899_diseqc_init': media_build/v4l/stb0899_drv.c:830:13: warning: variable 'f22_rx' set but not used [-Wunused-but-set-variable] media_build/v4l/stb0899_drv.c:826:31: warning: variable 'tx_data' set but not used [-Wunused-but-set-variable] media_build/v4l/stv0900_sw.c: In function 'stv0900_track_optimization': media_build/v4l/stv0900_sw.c:838:26: warning: variable 'rolloff' set but not used [-Wunused-but-set-variable] media_build/v4l/ir-sanyo-decoder.c: In function 'ir_sanyo_decode': media_build/v4l/ir-sanyo-decoder.c:59:14: warning: variable 'not_address' set but not used [-Wunused-but-set-variable] media_build/v4l/mceusb.c: In function 'mceusb_dev_printdata': media_build/v4l/mceusb.c:523:46: warning: variable 'data5' set but not used [-Wunused-but-set-variable] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] mceusb: add Formosa device ID 0xe042Jarod Wilson2012-03-191-0/+2
| | | | | | | Yet another device ID that has started showing up in the wild. Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* module_param: make bool parameters really bool (drivers & misc)Rusty Russell2012-01-131-2/+2
| | | | | | | | | | | | module_param(bool) used to counter-intuitively take an int. In fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy trick. It's time to remove the int/unsigned int option. For this version it'll simply give a warning, but it'll break next kernel version. Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* USB: convert drivers/media/* to use module_usb_driver()Greg Kroah-Hartman2011-11-181-19/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This converts the drivers in drivers/media/* to use the module_usb_driver() macro which makes the code smaller and a bit simpler. Added bonus is that it removes some unneeded kernel log messages about drivers loading and/or unloading. Cc: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: Luca Risolia <luca.risolia@studio.unibo.it> Cc: Jean-Francois Moine <moinejf@free.fr> Cc: Frank Zago <frank@zago.net> Cc: Olivier Lorin <o.lorin@laposte.net> Cc: Erik Andren <erik.andren@gmail.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Brian Johnson <brijohn@gmail.com> Cc: Leandro Costantino <lcostantino@gmail.com> Cc: Antoine Jacquet <royale@zerezo.com> Cc: Jarod Wilson <jarod@redhat.com> Cc: Florian Mickler <florian@mickler.org> Cc: Antti Palosaari <crope@iki.fi> Cc: Michael Krufky <mkrufky@kernellabs.com> Cc: "David Härdeman" <david@hardeman.nu> Cc: Florent Audebert <florent.audebert@anevia.com> Cc: Sam Doshi <sam@metal-fish.co.uk> Cc: Manu Abraham <manu@linuxtv.org> Cc: Olivier Grenie <olivier.grenie@dibcom.fr> Cc: Patrick Boettcher <patrick.boettcher@dibcom.fr> Cc: "Igor M. Liplianin" <liplianin@me.by> Cc: Derek Kelly <user.vdr@gmail.com> Cc: Malcolm Priestley <tvboxspy@gmail.com> Cc: Steven Toth <stoth@kernellabs.com> Cc: "André Weidemann" <Andre.Weidemann@web.de> Cc: Martin Wilks <m.wilks@technisat.com> Cc: Tejun Heo <tj@kernel.org> Cc: Jose Alberto Reguero <jareguero@telefonica.net> Cc: David Henningsson <david.henningsson@canonical.com> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: Joe Perches <joe@perches.com> Cc: Jesper Juhl <jj@chaosbits.net> Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi> Cc: Hans Verkuil <hans.verkuil@cisco.com> Cc: Alexey Khoroshilov <khoroshilov@ispras.ru> Cc: Anssi Hannula <anssi.hannula@iki.fi> Cc: Rafi Rubin <rafi@seas.upenn.edu> Cc: Dan Carpenter <error27@gmail.com> Cc: Paul Bender <pebender@gmail.com> Cc: Devin Heitmueller <dheitmueller@kernellabs.com> Cc: "Márcio A Alves" <froooozen@gmail.com> Cc: Julia Lawall <julia@diku.dk> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Chris Rankin <rankincj@yahoo.com> Cc: Lee Jones <lee.jones@canonical.com> Cc: Andy Walls <awalls@md.metrocast.net> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Mike Frysinger <vapier@gentoo.org> Cc: Dean Anderson <linux-dev@sensoray.com> Cc: Pete Eberlein <pete@sensoray.com> Cc: Arvydas Sidorenko <asido4@gmail.com> Cc: Andrea Anacleto <andreaanacleto@libero.it> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>