Sascha Sommer [Sun, 8 Jan 2012 19:41:22 +0000 (16:41 -0300)]
[media] em28xx: Fix tuner_type for Terratec Cinergy 200 USB
The card definition of the Terratec Cinergy 200 USB uses the
wrong tuner type. Therefore some channels are currently missing.
Attached patch fixes this problem.
Signed-off-by: Sascha Sommer <saschasommer@freenet.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sascha Sommer [Sun, 8 Jan 2012 19:54:28 +0000 (16:54 -0300)]
[media] em28xx: increase maxwidth for em2800
The MaxPacketSize for em2800 based devices is too small to capture at full resolution.
Therefore scale down when the maximum frame size is selected.
The previous workaround that simply reduced the X resolution cannot be used
because it crops a part of the input as
the em2800 can only scale down with a factor of 0.5.
Sascha Sommer [Sun, 8 Jan 2012 19:32:09 +0000 (16:32 -0300)]
[media] em28xx: Do not modify EM28XX_R06_I2C_CLK for em2800
writing the EM28XX_R06_I2C_CLK register leads to the problem that the
i2c bus on the Terratec Cinergy 200 USB is no longer usable when the
system is rebooted.
The device needs to be unplugged in order to bring it back to life.
Attached patch conditionally disables the write in
em28xx_pre_card_setup() like it is already done in em28xx_card_setup().
Signed-off-by: Sascha Sommer <saschasommer@freenet.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] em28xx: simplify argument passing to em28xx_init_dev()
The 'struct em28xx *' pointer was passed by reference to the
em28xx_init_dev() function, for no reason. Instead, just pass it by
value, which is much more logical and simple.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jonathan Nieder [Sat, 7 Jan 2012 07:11:27 +0000 (04:11 -0300)]
[media] af9005, af9015: use symbolic names for USB id table indices
The af9005_properties and af9015_properties tables make use of USB ids
from the USB id tables with hardcoded indices, as in
"&af9015_usb_table[30]". Adding new entries before the end breaks
such references, so everyone has had to carefully tiptoe to only add
entries at the end of the list.
In the spirit of "dw2102: use symbolic names for dw2102_table
indices", use C99-style initializers with symbolic names for each
index to avoid this. In the new regime, properties tables referring
to the USB ids have names like "&af9015_usb_table[CINERGY_T_STICK_RC]"
that do not change meaning when items in the USB id table are
reordered.
[media] cx231xx: use URB_NO_TRANSFER_DMA_MAP on URBs allocated with usb_alloc_urb()
URBs allocated with usb_alloc_urb() are allocated from DMA-coherent
areas, and therefore it is not necessary to call dma_map_single() on
such buffers. Worst, on ARM, calling dma_map_single() on a
DMA-coherent buffer will trigger a BUG_ON() in
arch/arm/mm/dma-mapping.c.
Therefore, we mark all URBs allocated with usb_alloc_urb() with the
URB_NO_TRANSFER_DMA_MAP transfer_flags, so that the USB core does not
do dma_map_single()/dma_unmap_single() on those buffers.
This is similar to 882787ff8fdeb0be790547ee9b22b281095e95da for the
gspca driver, and has already been discussed on the linux-media list
in the past:
http://www.mail-archive.com/linux-media@vger.kernel.org/msg37086.html.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] cx231xx: simplify argument passing to cx231xx_init_dev()
The 'struct cx231xx *' pointer was passed by reference to the
cx231xx_init_dev() function, for no reason. Instead, just pass it by
value, which is much more logical and simple.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The driver were using DEV_MISCONFIGURED on some places, and
DEV_DISCONNECTED on others. In a matter of fact, DEV_MISCONFIGURED
were set only during the usb disconnect callback, with
was confusing.
Also, the alsa driver never checks if the device is present,
before doing some dangerous things.
Remove DEV_MISCONFIGURED, replacing it by DEV_DISCONNECTED.
Also, fixes the other usecases for DEV_DISCONNECTED.
There are several weirdness at the unregister logic.
First of all, IR has a poll thread. This thread needs to be
removed, as it uses some resources associated to the main driver.
So, the driver needs to explicitly unregister the I2C client for
ir-kbd-i2c.
If, for some reason, the driver needs to wait for a close()
to happen, not all memories will be freed, because the free
logic were in the wrong place.
Also, v4l2_device_unregister() seems to be called too early,
as devices are still using it.
Finally, even with the device disconnected, there is one
USB function call that will still try to talk with it.
[media] cx231xx-input: stop polling if the device got removed.
If the device got removed, stops polling it. Also, un-registers
it at input/evdev, as it won't work anymore. We can't free the
IR structure yet, as the ir_remove method will be called later.
The problem was that cx231xx_usb_disconnect() was not doing anything
because the test:
if (!dev->udev)
return;
was reached (i.e, dev->udev was NULL).
This is due to the fact that the 'dev' pointer placed as intfdata into
the usb_interface structure had the wrong value, because
cx231xx_probe() was doing the usb_set_intfdata() on the wrong
usb_interface structure. For some reason, cx231xx_probe() was doing
the following:
static int cx231xx_usb_probe(struct usb_interface *interface,
const struct usb_device_id *id)
{
struct usb_interface *lif = NULL;
[...]
/* store the current interface */
lif = interface;
[...]
/* store the interface 0 back */
lif = udev->actconfig->interface[0];
[...]
usb_set_intfdata(lif, dev);
[...]
retval = v4l2_device_register(&interface->dev, &dev->v4l2_dev);
[...]
}
So, the usb_set_intfdata() was done on udev->actconfig->interface[0]
and not on the 'interface' passed as argument to the ->probe() and
->disconnect() hooks. Later on, v4l2_device_register() was
initializing the intfdata of the correct usb_interface structure as a
pointer to the v4l2_device structure.
Upon unregistration, the ->disconnect() hook was getting the intfdata
of the usb_interface passed as argument... and casted it to a 'struct
cx231xx *' while it was in fact a 'struct v4l2_device *'.
The correct fix seems to just be to set the intfdata on the proper
interface from the beginning. Now, loading/unloading/reloading the
driver allows to use the device properly.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
the build failed with :
CC [M] drivers/media/dvb/dvb-core/dvb_ca_en50221.o
In file included from arch/x86/include/asm/uaccess.h:573:0,
from include/linux/poll.h:14,
from drivers/media/dvb/dvb-core/dvbdev.h:27,
from drivers/media/dvb/dvb-core/dvb_ca_en50221.h:27,
from drivers/media/dvb/dvb-core/dvb_ca_en50221.c:41:
In function "copy_from_user", inlined from "dvb_ca_en50221_io_write" at drivers/media/dvb/dvb-core/dvb_ca_en50221.c:1314:26: arch/x86/include/asm/uaccess_32.h:211:26: error: call to "copy_from_user_overflow" declared with attribute error: copy_from_user() buffer size is not provably correct
Jonathan Nieder [Fri, 6 Jan 2012 17:40:26 +0000 (14:40 -0300)]
[media] dm1105: release dvbnet on frontend attachment failure
The patch "dm1105: handle errors from dvb_net_init" moved the
initialization of dvbnet to before frontend attachment but forgot
to adjust the error handling when frontend attachment fails.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jonathan Nieder [Fri, 6 Jan 2012 17:26:41 +0000 (14:26 -0300)]
[media] dvb-bt8xx: convert printks to pr_err()
This module does some printks with the loglevel missing.
pr_err() takes care of adding the KERN_ERR tag and the module name.
So we can simplify the code and add the missing printk loglevel by
using it.
Also add a #define pr_fmt() to make this work, and remove a few
unnecessary periods at the end of messages and bump the loglevel of
"Unknown bttv card type" from KERN_WARNING to KERN_ERR while at it.
This code is wrong as I should have coded it as SYS_DVBC, instead of
SYS_DVBS & friends. Anyway, this check has other problems
1) it does some "magic" by assuming that all QAM modulations are below
QAM_AUTO;
2) it checks modulation parameters only for one delivery system.
Or the core should check invalid parameters for all delivery
systems, or it should let the frontend drivers do it;
3) frontend drivers should already be checking for invalid parameters
(most of them do it, anyway);
4) not all modulations are mapped at fe->ops.info.caps, so it is not
even possible to check for the valid modulations inside the core
for some delivery systems;
5) The core check is incomplete anyway: it only checks for a few
parameters. If moved into the core other parameters like bandwidth
and fec should also be checked;
6) 2nd gen DVB-C uses OFDM. So, that test would fail for it.
Dan Carpenter [Thu, 5 Jan 2012 05:27:57 +0000 (02:27 -0300)]
[media] V4L/DVB: v4l2-ioctl: integer overflow in video_usercopy()
If ctrls->count is too high the multiplication could overflow and
array_size would be lower than expected. Mauro and Hans Verkuil
suggested that we cap it at 1024. That comes from the maximum
number of controls with lots of room for expantion.
Dan Carpenter [Thu, 5 Jan 2012 05:24:00 +0000 (02:24 -0300)]
[media] saa7134: use correct array offset
Smatch complains that i can be one passed the end of the array if we
don't hit the break statement. We should be using the "audio" here like
we do in the other places.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] xc3028: fix center frequency calculation for DTV78 firmware
This patch replaces the previous one proposed in the thread "xc3028:
force reload of DTV7 firmware in VHF band with Zarlink demodulator",
at the linux-media@vger.kernel.org ML.
The problem is that the firmware DTV78 works fine in UHF band (8 MHz
bandwidth) but is not working at all in VHF band (7 MHz bandwidth).
Reading the comments inside the code, I figured out that the real
problem could be connected to the formula used to calculate the center
frequency offset in VHF band.
In fact, removing this adjustment fixes the problem:
[media] it913x changed firmware loader for chip version 2 types
On Thu, 2011-12-15 at 16:42 +0000, Malcolm Priestley wrote:
> > [ 1103.536156] it913x: Chip Version=ec Chip Type=5830
> > [ 1104.336178] it913x: Dual mode=92 Remote=92 Tuner Type=92
> > [ 1106.248116] dvb-usb: found a 'ITE 9135(9006) Generic' in cold state,
> > will try to load a firmware
> > [ 1106.253773] dvb-usb: downloading firmware from file
> > 'dvb-usb-it9135-02.fw'
> > [ 1106.452123] it913x: FRM Starting Firmware Download
> > [ 1130.756039] it913x: FRM Firmware Download Failed (ffffff92)
> > [ 1130.956168] it913x: Chip Version=79 Chip Type=5823
> > [ 1131.592192] it913x: DEV it913x Error
> > [ 1131.592271] usbcore: registered new interface driver it913x
> >
> > No frontend is generated anyway.
>
> Looks like the the firmware is not at all compatible with your device.
>
> Have you applied the patch cleanly to the latest media_build?
>
> These appear to be new version of the 9006. A supplier is sending me one
> of these devices.
>
> As a last resort see if the device works with dvb-usb-it9137-01.fw
>
> You will have force to use this firmware
> dvb-usb-it913x firmware=1
Here is a modified firmware loader for version 2 types.
The firmware must be as in original
./dvb_get_firmware it9135
Don Kramer [Mon, 2 Jan 2012 19:15:44 +0000 (16:15 -0300)]
[media] [resend] em28xx: Add Plextor ConvertX PX-AV100U to em28xx-cards.c
Adds support for the Plextor ConvertX PX-AV100U, which uses the
eMPIA EM2820 chip. The device has a device_id of '0x093b, 0xa003'. I
am using the existing EM2820_BOARD_PINNACLE_DVC_90 board profile, as
the Pinnacle Dazzle DVC 90/100/101/107, Kaiser Baas Video to DVD
maker, and Kworld DVD Maker 2 were already mapped to it. Some more
background on the device and my testing can be found at
http://www.donkramer.net/plextor_122710.pdf
Signed-off-by: Don Kramer <dgkramer@comcast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] [BUG] it913x ver 1.20. PID filter problems
Fixes issues with PID filter
Stalling of some channels when PID is on.
PID filter not turning off fully.
PID filter can now turn on and off each index.
Removed PID_RST from it913x_pid_filter_ctrl.
Replaced with PID_EN removed from it913x_pid_filter
[media] v4l: Add VIDIOC_LOG_STATUS support for sub-device nodes
The VIDIOC_LOG_STATUS ioctl allows to dump the current status of a driver
to the kernel log. Currently this ioctl is only available at video device
nodes and the subdevs rely on the host driver to expose their core.log_status
operation to user space.
This patch adds VIDIOC_LOG_STATUS support at the sub-device nodes,
for standalone subdevs that expose their own /dev entry.
[media] s5p-fimc: Prevent lock up caused by incomplete H/W initialization
The following ioctl sequence causes fimc_dma_run() to start processing without
complete scaler and DMA initialization which causes missing interrupt and
blocking on DQBUF:
S_FMT, STREAMON, QBUF, DQBUF, STREAMOFF, STREAMON, QBUF, DQBUF.
Fix this regression caused by moving pm_runtime* calls to start/stop_streaming
callback by making sure the fimc_m2m_resume() is always invoked when expected.
Reported-by: Tomasz Stanislawski <t.stanislaws@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jonathan Nieder [Sat, 31 Dec 2011 11:19:56 +0000 (08:19 -0300)]
[media] firedtv: handle errors from dvb_net_init
It is not common for dvb_net_init to fail, but after the patch
"dvb_net_init: return -errno on error" it can fail due to running out
of memory. Handle this.
From an audit of dvb_net_init callers.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Reviewed-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jonathan Nieder [Sat, 31 Dec 2011 11:08:45 +0000 (08:08 -0300)]
[media] dm1105: handle errors from dvb_net_init
Clean up and error out if dvb_net_init fails (for example due to
ENOMEM). This involves moving the dvb_net_init call to before
frontend_init to make cleaning up a little easier.
From an audit of dvb_net_init callers, now that dvb_net_init lets
callers know about errors.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jonathan Nieder [Sat, 31 Dec 2011 10:58:34 +0000 (07:58 -0300)]
[media] dvb-bt8xx: use goto based exception handling
Repeating the same cleanup code in each error handling path makes life
unnecessarily difficult for reviewers, who much check each instance of
the same copy+pasted code separately. A "goto" to the end of the
function is more maintainable and conveys the intent more clearly.
While we're touching this code, also lift some assignments from "if"
conditionals for simplicity.
No functional change intended.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jonathan Nieder [Sat, 31 Dec 2011 10:56:11 +0000 (07:56 -0300)]
[media] videobuf-dvb: avoid spurious ENOMEM when CONFIG_DVB_NET=n
videobuf_dvb_register_bus relies on dvb_net_init to set dvbnet->dvbdev
on success, but ever since commit fcc8e7d8c0e2 ("dvb_net: Simplify the
code if DVB NET is not defined"), ->dvbdev is left unset when
networking support is disabled. Therefore in such configurations
videobuf_dvb_register_bus always returns failure, tripping
little-tested error handling paths and preventing the device from
being initialized and used.
Now that dvb_net_init returns a nonzero value on error, we can use
that as a more reliable error indication. Do so.
Now your card be used with CONFIG_DVB_NET=n, and the kernel will pass
on a more useful error code describing what happened when
CONFIG_DVB_NET=y but dvb_net_init fails due to resource exhaustion.
Reported-by: David Fries <David@Fries.net> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jonathan Nieder [Sat, 31 Dec 2011 10:54:16 +0000 (07:54 -0300)]
[media] DVB: dvb_net_init: return -errno on error
dvb_net_init unconditionally returns 0. Callers such as
videobuf_dvb_register_frontend examine dvbnet->dvbdev instead of the
return value to tell whether the operation succeeded. If it has been
set to a valid pointer, success; if it was left equal to NULL,
failure.
Alas, there is an edge case where that logic does not work as well:
when network support has been compiled out (CONFIG_DVB_NET=n), we want
dvb_net_init and related operations to behave as no-ops and always
succeed, but there is no appropriate value to which to set dvb->dvbdev
to indicate this.
Let dvb_net_init return a meaningful error code, as preparation for
adapting callers to look at that instead.
The only immediate impact of this patch should be to make the few
callers that already check for an error code from dvb_net_init behave
a little more sensibly when it fails.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans Verkuil [Tue, 13 Dec 2011 08:44:42 +0000 (05:44 -0300)]
[media] vpif_capture.c: v4l2_device_register() is called too late in vpif_probe()
The function v4l2_device_register() is called too late in vpif_probe().
This meant that vpif_obj.v4l2_dev is accessed before it is initialized
which caused a crash.
This used to work in the past, but video_register_device() is now actually
using the v4l2_dev pointer.
Note that vpif_display.c doesn't have this bug, there v4l2_device_register()
is called at the beginning of vpif_probe.
Jonathan Corbet [Fri, 30 Dec 2011 17:13:41 +0000 (14:13 -0300)]
[media] marvell-cam: Make suspend/resume work on MMP2
Somehow I didn't ever quite get around to implementing suspend/resume on
the MMP2 platform; this patch fixes that little oversight. A bit of core
work was necessary to do the right thing in the s/g DMA case.
Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Holger Nelson [Wed, 28 Dec 2011 21:55:41 +0000 (18:55 -0300)]
[media] em28xx: Reworked probe code to get rid of some hacks
Reworked device probing to get rid of hacks to guess the maximum size of
dvb iso transfer packets. The new code also selects the first alternate
config which supports the largest possible iso transfers for dvb.
[mchehab@redhat.com: Fix a few checkpatch.pl CodingStyle compliants] Signed-off-by: Holger Nelson <hnelson@hnelson.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Holger Nelson [Sat, 24 Dec 2011 02:15:32 +0000 (23:15 -0300)]
[media] em28xx: Add Terratec Cinergy HTC USB XS to em28xx-cards.c
This adds support for the Terratec Cinergy HTC USB XS which is similar to
the Terratec H5 by adding the USB-ids to the table. According to
http://linux.terratec.de it uses the same ICs and DVB-C works for me
using the firmware of the H5.
Signed-off-by: Holger Nelson <hnelson@hnelson.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Jonathan Nieder [Fri, 23 Dec 2011 22:00:45 +0000 (19:00 -0300)]
[media] dw2102: use symbolic names for dw2102_table indices
dw2102_properties et al refer to entries in the USB-id table using
hard-coded indices, as in "&dw2102_table[6]", which means adding new
entries before the end of the list has the potential to introduce bugs
in code elsewhere in the file.
Use C99-style initializers with symbolic names for each index to avoid
this. This way, other device tables wanting to reuse the USB ids can
use expressions like "&dw2102_table[TEVII_S630]" that do not change as
the entries in the table are reordered.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Julia Lawall [Fri, 23 Dec 2011 16:39:34 +0000 (13:39 -0300)]
[media] drivers/staging/media/as102/as102_usb_drv.c: shift position of allocation code
The conditional after the kzalloc says that the tested expression should
never be true, but if it were, the allocated data would have to be freed.
This change just moves the allocation below the test, to avoid any
possibility of the problem.
A simplified version of the semantic match that finds the problem is as
follows: (http://coccinelle.lip6.fr)
// <smpl>
@r exists@
local idexpression x;
statement S;
identifier f1;
position p1,p2;
expression *ptr != NULL;
@@
x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
<... when != x
when != if (...) { <+...x...+> }
x->f1
...>
(
return \(0\|<+...x...+>\|ptr\);
|
return@p2 ...;
)
vpbe_dev needs to be freed before leaving the function in an error case.
A simplified version of the semantic match that finds the problem is as
follows: (http://coccinelle.lip6.fr)
// <smpl>
@r exists@
local idexpression x;
statement S;
identifier f1;
position p1,p2;
expression *ptr != NULL;
@@
x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
<... when != x
when != if (...) { <+...x...+> }
x->f1
...>
(
return \(0\|<+...x...+>\|ptr\);
|
return@p2 ...;
)
Dan Carpenter [Thu, 22 Dec 2011 05:29:07 +0000 (02:29 -0300)]
[media] Staging: dt3155v4l: update to newer API
I changed the function definitions for dt3155_queue_setup() to match the
newer API. The dt3155_start_streaming() function didn't do anything so
I just removed it.
This silences the following gcc warnings:
drivers/staging/media/dt3155v4l/dt3155v4l.c:307:2: warning: initialization from incompatible pointer type [enabled by default]
drivers/staging/media/dt3155v4l/dt3155v4l.c:307:2: warning: (near initialization for ‘q_ops.queue_setup’) [enabled by default]
drivers/staging/media/dt3155v4l/dt3155v4l.c:311:2: warning: initialization from incompatible pointer type [enabled by default]
drivers/staging/media/dt3155v4l/dt3155v4l.c:311:2: warning: (near initialization for ‘q_ops.start_streaming’) [enabled by default]
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Lei Wen [Tue, 22 Nov 2011 14:04:29 +0000 (11:04 -0300)]
[media] soc-camera: change order of removing device
As our general practice, we use stream off before we close
the video node. So that the drivers its stream off function
would be called before its remove function.
But for the case for ctrl+c, the program would be force closed.
We have no chance to call that vb2 stream off from user space,
but directly call the remove function in soc_camera.
In that common code of soc_camera:
ici->ops->remove(icd);
if (ici->ops->init_videobuf2)
vb2_queue_release(&icd->vb2_vidq);
It would first call the device remove function, then release vb2,
in which stream off function is called. Thus it create different
order for the driver.
This patch change the order to make driver see the same sequence
to make it happy.
[media] mt9m111: properly implement .s_crop and .s_fmt(), reset on STREAMON
mt9m111 camera sensors support cropping and scaling. The current
implementation is broken. For example, .s_crop() sets output frame sizes
instead of the input cropping window. This patch adds a proper implementation
of these methods. Besides it adds a sensor-disable and -enable operations
on first open() and last close() respectively, to save power while closed and
to return the camera to the default power-on state.
[media] soc-camera: remove redundant parameter from .set_bus_param()
The "pixfmt" parameter of the struct soc_camera_host_ops::set_bus_param()
method is redundant, because at the time, when this method is called,
pixfmt is guaranteed to be equal to icd->current_fmt->host_fmt->fourcc.
Remove this parameter and update all drivers accordingly.
Hans de Goede [Wed, 4 Jan 2012 22:46:53 +0000 (19:46 -0300)]
[media] pwc: Properly fill all fields on try_fmt
Before this patch the resulting values from a try_fmt were different then
those from a s_fmt with the same parameters. try_fmt simply did not
touch / fill some values like bytesperline at all.
This patch also corrects bytesperline to the proper value for a planar
format such as the YUV420P format the pwc driver produces, which is
the bytesperline value for the biggest plane, rather then those
of all planes added together.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Wed, 4 Jan 2012 19:58:44 +0000 (16:58 -0300)]
[media] pwc: Remove software emulation of arbritary resolutions
The pwc driver claims to support any resolution between 160x120
and 640x480, but emulates this by simply drawing a black border
around the image. Userspace can draw its own black border if it
really wants one.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Sat, 31 Dec 2011 13:52:02 +0000 (10:52 -0300)]
[media] pwc: Remove dead snapshot code
The in kernel version of the pwc driver has never supported snapshot
mode, and now that we no longer support the pixfmt.priv abuse there also
no longer is a way for userspace to request it, rendering all the code in
question dead (never called), so remove it.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Sun, 9 Oct 2011 20:22:00 +0000 (17:22 -0300)]
[media] pwc: Read new preset values when changing awb control to a preset
So that events get generated for the new red + blue bal values when switching
to a preset. This allows apps to solely rely on events instead of needing
to do a query + g_ctrl on all controls when a control with the update flag
set is gets set or gets an event.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Sun, 9 Oct 2011 12:16:46 +0000 (09:16 -0300)]
[media] pwc: Rework locking
While testing gtk-v4l's new ctrl event code, I hit the following deadlock
in the pwc driver:
Thread 1:
-Does a VIDIOC_G_CTRL
-video2_ioctl takes the modlock
-video2_ioctl calls v4l2_g_ctrl
-v4l2_g_ctrl takes the ctrl_handler lock
-v4l2_g_ctrl calls pwc_g_volatile_ctrl
-pwc_g_volatile_ctrl releases the modlock as the usb transfer can take a
significant amount of time and we don't want to block DQBUF / QBUF too long
Thread 2:
-Does a VIDIOC_FOO_CTRL
-video2_ioctl takes the modlock
-video2_ioctl calls v4l2_foo_ctrl
-v4l2_foo_ctrl blocks while trying to take the ctrl_handler lock
Thread 1:
-Blocks while trying to re-take the modlock, as its caller will eventually
unlock that
Now we have thread 1 waiting for the modlock while holding the ctrl_handler
lock and thread 2 waiting for the ctrl_handler lock while holding the
modlock -> deadlock.
Conclusion:
1) We cannot unlock modlock from pwc_s_ctrl / pwc_g_volatile_ctrl,
but this can cause QBUF / DQBUF to block for up to a full second
2) After evaluating various option I came to the conclusion that pwc should
stop using the v4l2 core locking, and instead do its own locking
Thus this patch stops pwc using the v4l2 core locking, and replaces that with
it doing its own locking where necessary.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Tue, 19 Jul 2011 10:14:22 +0000 (07:14 -0300)]
[media] pwc: Use v4l2-device and v4l2-fh
This is a preperation patch for adding support for control events. Actually
enabling support for control events will be done in a separate patch, as that
depends on the necessary poll changes going upstream
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Hans de Goede [Sun, 1 Jan 2012 16:45:43 +0000 (13:45 -0300)]
[media] gscpa_ov519: Fix the bandwidth calc for enabling compression
Somehow the code has ended up assuming 1400 packets/sec which of course
is wrong for usb1 devices like the ov511 cameras. usb1 only does 1000
(isoc) packets / sec.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Theodore Kilgore [Tue, 13 Dec 2011 21:09:15 +0000 (18:09 -0300)]
[media] gspca: Add jl2005bcd sub driver
Written by Theodore Kilgore
With minor changes by Hans de Goede:
-Code style fixes
-Correct the verbose level on various PDEBUG messages
-Make error messages use pr_err instead of PDEBUG
-Document the jl20 pixel format
Signed-off-by: Theodore Kilgore <kilgota@auburn.edu> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* tag 'v3.2': (83 commits)
Linux 3.2
minixfs: misplaced checks lead to dentry leak
ptrace: ensure JOBCTL_STOP_SIGMASK is not zero after detach
ptrace: partially fix the do_wait(WEXITED) vs EXIT_DEAD->EXIT_ZOMBIE race
Revert "rtc: Expire alarms after the time is set."
[CIFS] default ntlmv2 for cifs mount delayed to 3.3
cifs: fix bad buffer length check in coalesce_t2
Revert "rtc: Disable the alarm in the hardware"
hung_task: fix false positive during vfork
security: Fix security_old_inode_init_security() when CONFIG_SECURITY is not set
fix CAN MAINTAINERS SCM tree type
mwifiex: fix crash during simultaneous scan and connect
b43: fix regression in PIO case
ath9k: Fix kernel panic in AR2427 in AP mode
CAN MAINTAINERS update
net: fsl: fec: fix build for mx23-only kernel
sch_qfq: fix overflow in qfq_update_start()
drm/radeon/kms/atom: fix possible segfault in pm setup
gspca: Fix falling back to lower isoc alt settings
futex: Fix uninterruptible loop due to gate_area
...
[media] davinci vpbe: add VENC block changes to enable dm365 and dm355
This patch implements necessary changes for enabling dm365 and
dm355 hardware for vpbe. The patch contains additional HD mode
support for dm365 (720p60, 1080i30) and appropriate register
modifications based on version numbers.
VPBE_VERSION_2 = dm365 specific
VPBE_VERSION_3 = dm355 specific
[media] davinci vpbe: add dm365 and dm355 specific OSD changes
Add OSD block changes to enable dm365 and dm355 for vpbe driver.
Changes are based on version number of OSD, which have incremental
changes over 644x OSD hardware interms of few registers.
VPBE_VERSION_2 = dm365 specific
VPBE_VERSION_3 = dm355 specific