Dan Carpenter [Tue, 14 Aug 2012 06:03:35 +0000 (03:03 -0300)]
[media] stk1160: remove unneeded check
"card" is a valid pointer here because we checked snd_card_create() for
error returns. Checking after a dereference makes the static checkers
complain.
Dan Carpenter [Tue, 14 Aug 2012 05:58:56 +0000 (02:58 -0300)]
[media] mem2mem_testdev: unlock and return error code properly
We recently added locking to this function, but there was an error path
which accidentally returned holding a lock. Also we returned zero on
failure on some paths instead of the error code.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Dan Carpenter [Tue, 14 Aug 2012 05:51:20 +0000 (02:51 -0300)]
[media] it913x-fe: use ARRAY_SIZE() as a cleanup
This code looks suspicious, but it turns out that "nv" is an array of u8
so sizeof() is the same as ARRAY_SIZE(). Using ARRAY_SIZE() is more
readable though.
[media] V4L: soc-camera: add selection API host operations
Add .get_selection() and .set_selection() soc-camera host driver
operations. Additionally check, that the user is not trying to change the
output sizes during a running capture.
[media] ov772x: Make to_ov772x convert from v4l2_subdev to ov772x_priv
Conversion from i2c_client to ov772x_priv is only needed in a single
location, while conversion from v4l2_subdev to ov772x_priv is needed in
several locations. Perform the former manually, and use to_ov772x for
the later.
[media] ov772x: Select the default format at probe time
The format and window size are only initialized during the first g_fmt
call. This leaves the device in an inconsistent state after
initialization, which will cause problems when implementing pad
operations. Move the format and window size initialization to probe
time.
[media] soc-camera: Push probe-time power management to drivers
Several client drivers access the hardware at probe time, for instance
to read the probe chip ID. Such chips need to be powered up when being
probed.
soc-camera handles this by powering chips up in the soc-camera probe
implementation. However, this will break with non soc-camera hosts that
don't perform the same operations.
Fix the problem by pushing the power up/down from the soc-camera core
down to individual drivers on a needs basis.
[media] soc-camera: Add and use soc_camera_power_[on|off]() helper functions
Instead of forcing all soc-camera drivers to go through the mid-layer to
handle power management, create soc_camera_power_[on|off]() functions
that can be called from the subdev .s_power() operation to manage
regulators and platform-specific power handling. This allows non
soc-camera hosts to use soc-camera-aware clients.
[media] soc-camera: Continue the power off sequence if one of the steps fails
Powering off a device is a "best effort" task: failure to execute one of
the steps should not prevent the next steps to be executed. For
instance, an I2C communication error when putting the chip in stand-by
mode should not prevent the more agressive next step of turning the
chip's power supply off.
[media] soc_camera: Don't call .s_power() during probe
The .s_power() call only covers the .g_mbus_fmt() operation call.
Several clients required to be powered on to retrieve the current mbus
format but have now been fixed. The .s_power() call is thus not needed
anymore and can be removed.
[media] b2c2: fix driver's build due to the lack of pci DMA code
Fix a one-character typo at the makefile.
drivers/built-in.o: In function `flexcop_pci_remove':
flexcop-pci.c:(.text+0x20d1a28): undefined reference to `flexcop_dma_free'
flexcop-pci.c:(.text+0x20d1a3e): undefined reference to `flexcop_dma_free'
drivers/built-in.o: In function `flexcop_pci_stream_control':
flexcop-pci.c:(.text+0x20d2396): undefined reference to `flexcop_dma_config'
flexcop-pci.c:(.text+0x20d23b3): undefined reference to `flexcop_dma_config'
flexcop-pci.c:(.text+0x20d23cf): undefined reference to `flexcop_dma_config_timer'
flexcop-pci.c:(.text+0x20d23f5): undefined reference to `flexcop_dma_xfer_control'
flexcop-pci.c:(.text+0x20d244c): undefined reference to `flexcop_dma_control_timer_irq'
flexcop-pci.c:(.text+0x20d24b0): undefined reference to `flexcop_dma_control_timer_irq'
flexcop-pci.c:(.text+0x20d2507): undefined reference to `flexcop_dma_xfer_control'
drivers/built-in.o: In function `flexcop_pci_probe':
flexcop-pci.c:(.text+0x20d28d2): undefined reference to `flexcop_dma_allocate'
flexcop-pci.c:(.text+0x20d2907): undefined reference to `flexcop_dma_allocate'
flexcop-pci.c:(.text+0x20d2923): undefined reference to `flexcop_dma_free'
Javier Martin [Thu, 26 Jul 2012 10:20:36 +0000 (07:20 -0300)]
[media] Schedule removal of i.MX25 support in mx2_camera.c
Support for i.MX25 in mx2_camera.c has been broken
for a year. Furthermore, i.MX25 video capture HW
doesn't have much in common with i.MX27. A separate
driver would be desirable.
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Manoel Pinheiro [Thu, 19 May 2011 17:16:57 +0000 (14:16 -0300)]
[media] saa7134-dvb: Fix kworld sbtvd I2C gate control
The correct place to put i2c_gate_ctrl is before calling tda18271_attach,
because the driver tda18271 will use it to enable or disable the i2c-bus
from the demodulator to the tuner.
And thus eliminate the error message: "Unknown device (255) detected
@ 1-00c0, device not supported" in the driver tda18271.
In the device kworld_sbtvd (hybrid analog and digital TV) the control
of the i2c-bus to tuner is done in the analog demodulator and not in
the digital demodulator.
David Härdeman [Thu, 28 Apr 2011 14:14:03 +0000 (11:14 -0300)]
[media] rc-core: move timeout and checks to lirc
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] lmedm04: fix data usage past the end of the buffer
On Mon, 2012-08-13 at 19:58 +0300, Dan Carpenter wrote:
> Hello Mauro Carvalho Chehab,
>
> The patch db6651a9ebb3: "[media] lmedm04: fix build" from Aug 12,
> 2012, leads to the following warning:
> drivers/media/dvb/dvb-usb-v2/lmedm04.c:769 lme2510_download_firmware()
> error: usb_control_msg() 'data' too small (128 vs 265)
>
> 737 data = kzalloc(128, GFP_KERNEL);
> ^^^
> data is 128 bytes.
Michael Krufky [Mon, 21 May 2012 20:47:15 +0000 (17:47 -0300)]
[media] DVB: improve handling of TS packets containing a raised TEI bit
When the TEI bit is raised, we should not trust any of the contents of
the packet in question, including but not limited to its PID number.
Considering that we don't trust the PID number of this packet, we should
not proceed to check the packet counter (if dvb_demux_tscheck is set).
We should expect to see at least one discontinuity after a bad packet is
received, so any time a TEI is detected, a following TS packet counter
mismatch is to be expected.
There is no real reason to ever allow bad packets to pass through the
kernel demux, other than for purposes of attempting error correction via
software or statistical information.
However, since we have always passed these bad packets though the demux,
we should not change this default behavior.
Without altering module options, this patch merely prevents the
TS packet counter check on packets containing a raised TEI.
If module option dvb_demux_feed_err_pkts is set to 0, the kernel demux
will drop these error packets entirely, preventing any possibility of
corruption caused by userspace programs that are expecting valid data.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
These double "const" were introduced in v2.6.37-rc1~64^2~464 (V4L/DVB:
drivers/media: Make static data tables and strings const, 2010-08-25).
The address of an array is already immutable by definition, so for
what it's worth, with or without a clarified commit message,
[mchehab@redhat.com: Tested with "gcc -s" (version 4.7.0):
the produced asm is indeed equal before and after this patch] Signed-off-by: Emil Goode <emilgoode@gmail.com> Acked-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] frontend.h, Docbook: Improve status documentation
No functional changes. It just improves the description of the frontend
status, using Documentation/kernel-doc-nano-HOWTO.txt for the status
enumeration, and a table inside the DocBook.
Timo Kokkonen [Fri, 10 Aug 2012 09:16:36 +0000 (06:16 -0300)]
[media] media: rc: Introduce RX51 IR transmitter driver
This is the driver for the IR transmitter diode found on the Nokia
N900 (also known as RX51) device. The driver is mostly the same as
found in the original 2.6.28 based kernel that comes with the device.
The following modifications have been made compared to the original
driver version:
- Adopt to the changes that has happen in the kernel during the past
five years, such as the change in the include paths
- The OMAP DM-timers require much more care nowadays. The timers need
to be enabled and disabled or otherwise many actions fail. Timers
must not be freed without first stopping them or otherwise the timer
cannot be requested again.
The code has been tested with sending IR codes with N900 device
running Debian userland. The device receiving the codes was Anysee
DVB-C USB receiver.
Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi> Cc: Tony Lindgren <tony@atomide.com> Cc: linux-omap@vger.kernel.org Cc: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andy Shevchenko [Tue, 7 Aug 2012 15:43:07 +0000 (12:43 -0300)]
[media] gspca: use %*ph to print small buffers
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] dvb: get rid of fe_ioctl_override callback
This callback were meant to allow overriding a FE callback, before its
call, but it is not really needed, as the callback can be intercepted
after tuner attachment.
Worse than that, only DVBv3 calls are intercepted this way, so a DVBv5
application will produce different effects than a DVBv3 one.
So, get rid of it.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Acked-by: Antti Palosaari <crope@iki.fi> Reviewed-by: Antti Palosaari <crope@iki.fi>
Julia Lawall [Tue, 31 Jul 2012 08:21:36 +0000 (05:21 -0300)]
[media] drivers/media/radio/radio-si4713.c: use devm_ functions
The various devm_ functions allocate memory that is released when a driver
detaches. This patch uses these functions for data that is allocated in
the probe function of a platform device and is only freed in the remove
function.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Julia Lawall [Tue, 31 Jul 2012 08:21:35 +0000 (05:21 -0300)]
[media] drivers/media/radio/radio-wl1273.c: use devm_ functions
The various devm_ functions allocate memory that is released when a driver
detaches. This patch uses these functions for data that is allocated in
the probe function of a platform device and is only freed in the remove
function.
In two cases, the original memory allocation function was kmalloc, which
has been changed to a zeroing allocation to benefit from the devm function.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Julia Lawall [Tue, 31 Jul 2012 08:21:37 +0000 (05:21 -0300)]
[media] drivers/media/radio/radio-timb.c: use devm_ functions
The various devm_ functions allocate memory that is released when a driver
detaches. This patch uses these functions for data that is allocated in
the probe function of a platform device and is only freed in the remove
function.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sean Young [Mon, 13 Aug 2012 11:59:48 +0000 (08:59 -0300)]
[media] saa7134: simplify timer activation
This simplies the code and resolves a possible race condition between
ir_raw_decode_timer_end() and saa7134_raw_decode_irq().
If the interrupt handler is called after ir_raw_decode_timer_end()
calls ir_raw_event_handle() but before clearing ir->active, then the
timer won't be rearmed.
Compile tested only.
Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sean Young [Mon, 13 Aug 2012 11:59:47 +0000 (08:59 -0300)]
[media] rc: do not wake up rc thread unless there is something to do
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>
Sean Young [Mon, 13 Aug 2012 11:59:46 +0000 (08:59 -0300)]
[media] rc: Add support for the TechnoTrend USB IR Receiver
This driver adds support for TechnoTrend USB IR Receiver. It is a complete
rewrite of the staging/media/lirc/lirc_ttusbir driver. It adds more
accurate sample reporting and led control.
Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sean Young [Mon, 13 Aug 2012 11:59:45 +0000 (08:59 -0300)]
[media] iguanair: fix receiver overflow
The Pioneer CU-700 remote causes receiver overflows if you hold down any
button. The remote does not send NEC IR repeats, it repeats the entire
NEC code after 20ms.
The iguanair hardware advertises an interval of 10 which just not enough;
with 100 URBs per second and at most 7 edges per URB, we handle at most
700 edges per second. The remote generates about 900.
Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Antti Palosaari [Mon, 13 Aug 2012 01:27:08 +0000 (22:27 -0300)]
[media] rtl28xxu: generalize streaming control
Move rtl2831u LED from streaming control to power control. It
changes LED behavior slightly but who cares :)
After that same streaming control can be used for both rtl2831u
and rtl2832u.
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Stefan Muenzel [Sat, 28 Jul 2012 22:49:14 +0000 (19:49 -0300)]
[media] uvcvideo: Support 10bit, 12bit and alternate 8bit greyscale formats
The SPCAM SP620U camera uses the alternate "Y8 " GUID for the 8-bit
greyscale format, and supports a 12-bit greyscale format. Add support
for those in the driver, as well as for 10-bit greyscale formats.
Ezequiel García [Sat, 11 Aug 2012 17:32:57 +0000 (14:32 -0300)]
[media] media: Add stk1160 new driver (easycap replacement)
This driver adds support for stk1160 usb bridge as used in some
video/audio usb capture devices.
It is a complete rewrite of staging/media/easycap driver and
it's meant as a replacement.
As stk1160 allows communication with an ac97 codec chip, this
driver allows to register a control-only sound card to allow the user
to access ac97 controls.
Two devices have been used for testing:
* 1-cvbs video and 1-audio ac97 input,
* 4-cvbs inputs
Both of these devices reports with the same id [05e1:0408],
so the driver tries to support a superset of the capabilities.
By using keep_buffers module parameter it's possible to prevent
the driver from releasing urb buffers when streaming is stopped.
The usage of this parameter can avoid memory fragmentation that may
cause the driver to stop working on low memory systems.
A similar mechanism is implemented in em28xx driver (see commit 86d38d).