Commit Graph

12993 Commits (1c852201a28601b1379857f615e99071211294c6)

Author SHA1 Message Date
Mauro Carvalho Chehab 959a119f86 [media] mb86a20s: implement get_frontend()
Reports the auto-detected parameters to userspace.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-10 22:35:29 -02:00
Mauro Carvalho Chehab 90bf3aab42 [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.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-10 22:35:28 -02:00
Thomas Petazzoni c53a8e951b [media] cx231xx: remove useless 'lif' variable in cx231xx_usb_probe()
Now that we set the intfdata on the right interface, the 'lif'
variable is useless.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-10 22:19:44 -02:00
Thomas Petazzoni a116a05cb4 [media] cx231xx: fix crash after load/unload/load of module
The following sequence of commands was triggering a kernel crash in
cdev_get():

 modprobe cx231xx
 rmmod cx231xx
 modprobe cx231xx
 v4l2grab -n 1

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>
2012-01-10 22:19:43 -02:00
Mauro Carvalho Chehab 624f0c1869 [media] dvb_ca_en50221: fix compilation breakage
As reported by Toralf:

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

Reported-by: Toralf Foerster <toralf.foerster@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-10 19:15:45 -02:00
Mario Ceresa 2f78604a43 [media] Added model Sveon STV40
Signed-off-by: Mario Ceresa <mrceresa@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-07 12:02:20 -02:00
Javier Martin ec2c4f3f93 [media] media: tvp5150: Add mbus_fmt callbacks
These callbacks allow a host video driver
to poll video formats supported by tvp5150.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-07 11:54:52 -02:00
Jonathan Nieder e99663417f [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>
2012-01-07 11:54:03 -02:00
Jonathan Nieder 6c59eefd58 [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.

Inspired-by: Mauro Carvalho Chehab <mchehab@redhat.com>

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-07 11:53:35 -02:00
Jonathan Nieder 3796554671 [media] dvb-bt8xx: use dprintk for debug statements
This way, the messages will be tagged with KERN_DEBUG and not clutter
the log from dmesg unless the "debug" module parameter is set.

[mchehab@redhat.com: whitespace fixes]
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-07 11:52:48 -02:00
Jonathan Nieder efd279ec3e [media] flexcop: CodingStyle fix: don't use "if ((ret = foo()) < 0)"
Lift assignments from "if" conditionals for readability.  No change
in functionality intended.

Suggested-by: Mauro Carvalho Chehab <mchehab@redhat.com>

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-07 11:51:00 -02:00
Stefan Ringel 722c90eb76 [media] cx23885: add Terratec Cinergy T PCIe dual
Signed-off-by: Stefan Ringel <linuxtv@stefanringel.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-07 11:47:33 -02:00
Mauro Carvalho Chehab b247377ace [media] dvb: remove bogus modulation check
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.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-07 11:47:32 -02:00
Mauro Carvalho Chehab c0fdbd3367 [media] drxk_hard: Remove dead code
As reported by Oliver, some old dead code were preserved there.

Thanks-to: Oliver endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-07 11:47:31 -02:00
Istvan Varga 84463d5ffa [media] Add support for two Leadtek Winfast TV 2000XP types
Add support for two new types of Leadtek Winfast TV 2000XP tuner

The author of this patch is Istvan Varga.
Only resending current reformated version against current git.

Signed-off-by: Miroslav Slugen <thunder.mmm@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-07 11:47:30 -02:00
Dan Carpenter 6c06108be5 [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.

$ grep V4L2_CID include/linux/videodev2.h | wc -l
211

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-07 11:47:22 -02:00
Dan Carpenter e82db75d06 [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>
2012-01-06 17:19:46 -02:00
Dan Carpenter 938ca36ef7 [media] af9013: change & to &&
This is just a cleanup, it doesn't change how the code works.  These
are compound conditions and not bitwise operations so it should be &&
and not &.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 17:17:43 -02:00
Miroslav Slugen 27b93d8a45 [media] cx88: Fix radio support for Leadtek DTV2000H J
Leadtek DTV2000H J has Philips a FMD1216MEX tuner,
and not a FMD1216ME.

Signed-off-by: Miroslav Slugen <thunder.mmm@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 17:16:34 -02:00
Gianluca Gennari 98ab8550ae [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:

		if ((priv->cur_fw.type & DTV78) && freq < 470000000)
			offset -= 500000;

This is coherent to what was implemented for the DTV7 firmware by an
Australian user:

		if (priv->cur_fw.type & DTV7)
			offset += 500000;

In the end, now the center frequency is the same for all firmwares
(DTV7, DTV8, DTV78) and doesn't depend on channel bandwidth.

The final code looks clean and simple, and there is no need for any
"magic" adjustment:

		if (priv->cur_fw.type & DTV6)
			offset = 1750000;
		else	/* DTV7 or DTV8 or DTV78 */
			offset = 2750000;

Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 17:13:48 -02:00
Fabio Estevam 0abffb9442 [media] drivers: media: radio: Fix dependencies for RADIO_WL128X
Fix the following build warning:

warning: (RADIO_WL128X) selects TI_ST which has unmet direct dependencies (MISC_DEVICES && NET && GPIOLIB)

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 13:17:50 -02:00
Fabio Estevam 2e6cbd2b08 [media] drivers: media: tuners: Fix dependency for MEDIA_TUNER_TEA5761
Fix the following build warning:

warning: (MEDIA_TUNER) selects MEDIA_TUNER_TEA5761 which has unmet direct
dependencies (MEDIA_SUPPORT && VIDEO_MEDIA && I2C && EXPERIMENTAL)

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 13:17:15 -02:00
Malcolm Priestley f0e07d7658 [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

dd if=dvb-usb-it9135.fw ibs=1 skip=12866 count=5817 of=dvb-usb-it9135-02.fw

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 13:14:54 -02:00
Gianluca Gennari 6a2329ad1c [media] af9013: Fix typo in get_frontend() function
This patch fixes an obvious typo in the get_frontend() function
of the af9013 driver, recently rewritten by Antti Palosaari.

Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 13:12:34 -02:00
Mauro Carvalho Chehab 283342954a [media] dvb-bt8xx: Fix a printk statement
By accident, I added an extra comma at the printk format argument.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 13:08:58 -02:00
Malcolm Priestley 82a0501473 [media] it913x-fe ver 1.13 add BER and UNC monitoring
Add BER monitoring with Pre-Viterbi error rate.

Add UCBLOCKS based on Aborted packets.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 13:08:02 -02:00
Malcolm Priestley 245900c4a7 [media] it913x ver 1.22 corrections to Tuner IDs
Correction to tuner ID 0x51.

Don't force tuner ID 0x60 unless eprom data zero.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 13:07:42 -02:00
Don Kramer 74e07f3e30 [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>
2012-01-06 13:07:17 -02:00
Malcolm Priestley fa52520cff [media] [BUG] it913x ver 1.21 Fixed for issue with 9006 and warm boot
Some channels appear weak signal after warm boot.

Because tuner id is not present in eprom 0x38 is
assigned.

9006 devices are now always assigned 0x60.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 13:05:32 -02:00
Malcolm Priestley d4d5a40710 [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

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 13:05:16 -02:00
Sylwester Nawrocki bcd158de94 [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.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.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>
2012-01-06 13:00:11 -02:00
Sylwester Nawrocki f664684a56 [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>
2012-01-06 12:59:42 -02:00
Jonathan Nieder f1d99f39fb [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>
2012-01-06 12:51:26 -02:00
Jonathan Nieder 60826f0269 [media] dvb-usb: handle errors from dvb_net_init
From an audit of dvb_net_init callers, now that that function
returns -errno on error.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 12:50:39 -02:00
Jonathan Nieder 5584c641be [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>
2012-01-06 12:50:17 -02:00
Jonathan Nieder 2dbbac3306 [media] dvb-bt8xx: handle errors from dvb_net_init
Clean up and error out if dvb_net_init fails (for example when
running out of memory).

From an audit of dvb_net_init callers, now that dvb_net_init
has learned to return a nonzero value from time to time.

[mchehab.redhat.com: codingstyle fix: printk() should include KERN_ facility level]
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 12:49:18 -02:00
Jonathan Nieder 01732ebaac [media] flexcop: handle errors from dvb_net_init
Bail out if dvb_net_init encounters an error (for example an
out-of-memory condition), now that it reports them.

[mchehab@redhat.com: CodingStyle fix: don't use  "if ((ret = foo()) < 0)"]
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 12:46:58 -02:00
Jonathan Nieder 42702de248 [media] ttusb-budget: use goto for exception handling
Avoid some repetition by adopting the usual "goto err" idiom for error
handling.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 12:44:22 -02:00
Jonathan Nieder e4b8537c97 [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>
2012-01-06 12:43:34 -02:00
Jonathan Nieder 5c96ebb7ce [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 fcc8e7d8c0 ("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>
2012-01-06 12:42:19 -02:00
Jonathan Nieder 58fae6739f [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>
2012-01-06 12:40:46 -02:00
Malcolm Priestley ed3189cf98 [media] it913x ver 1.18 Turn pid filter off by caps option only
Turn the pid filter off by caps option only.

This is so the full stream is passed to demuxer and not limited
by pid count.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 11:53:47 -02:00
Hans Verkuil d2f7a1a246 [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.

Signed-off-by: Georgios Plakaris <gplakari@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Manjunath Hadli <Manjunath.hadli@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 11:48:22 -02:00
Jonathan Corbet bb0a896e3d [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>
2012-01-06 11:39:38 -02:00
Malcolm Priestley 4c316b55fe [media] lmedm04 DM04/QQBOX ver 1.91 turn pid filter off by caps option only
Turn the pid filter off by caps option only.

This is so the full stream is passed to demuxer and not limited
by pid count.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 11:39:01 -02:00
Holger Nelson 8ab3362665 [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>
2012-01-06 11:37:07 -02:00
Gareth Williams 4d28d3d997 [media] Added USB Id & configuration array for Honestech Vidbox NW03
Adds support for the Honestech Vidbox NW03 USB capture device.

Signed-off-by: Gareth Williams <gareth@garethwilliams.me.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 11:27:33 -02:00
Holger Nelson 6c3b906cc9 [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>
2012-01-06 11:22:25 -02:00
Jonathan Nieder 27351b139c [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>
2012-01-06 11:17:36 -02:00
Julia Lawall 75e5ac7ea5 [media] drivers/media/video/davinci/vpbe.c: introduce missing kfree
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 ...;
)

@script:python@
p1 << r.p1;
p2 << r.p2;
@@

print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 11:13:05 -02:00
Javier Martin ccd1a499c1 [media] media i.MX27 camera: Fix field_count handling
To properly detect frame loss the driver must keep
track of a frame_count.

Furthermore, field_count use was erroneous because
in progressive format this must be incremented twice.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 11:02:14 -02:00
Javier Martin f410991dcf [media] i.MX27 camera: add support for YUV420 format
This patch uses channel 2 of the eMMa-PrP to convert
format provided by the sensor to YUV420.

This format is very useful since it is used by the
internal H.264 encoder.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 11:02:07 -02:00
Josh Wu d8ec0961ce [media] atmel-isi: add code to enable/disable ISI_MCK clock
This patch
- add ISI_MCK clock enable/disable code.
- change field name in isi_platform_data structure

Signed-off-by: Josh Wu <josh.wu@atmel.com>
[g.liakhovetski@gmx.de: fix label names]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 11:01:11 -02:00
Lei Wen 48ecf9fe8f [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.

Signed-off-by: Lei Wen <leiwen@marvell.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 11:00:55 -02:00
Guennadi Liakhovetski da673e603b [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.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 11:00:40 -02:00
Guennadi Liakhovetski a650bf1eff [media] mt9m111: power down most circuits when suspended
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 11:00:35 -02:00
Guennadi Liakhovetski 47921932f3 [media] mt9m111: cleanly separate register contexts
Cleanly separating register contexts A and B will allow us to configure
the contexts independently.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 11:00:29 -02:00
Guennadi Liakhovetski 8843d119ea [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.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 11:00:23 -02:00
Hans de Goede 31e582e926 [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>
2012-01-06 10:48:00 -02:00
Hans de Goede 5bbe18d74f [media] pwc: Get rid of compression module parameter
Instead of making this a module parameter, automatically fallback to
higher compression settings if there is not enough bandwidth.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 10:47:37 -02:00
Hans de Goede 795e6eb326 [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>
2012-01-06 10:46:46 -02:00
Hans de Goede a08d2c7271 [media] pwc: Remove driver specific ioctls
This stems from the v4l1 era, with v4l2 everything can be done with
standardized v4l2 API calls.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 10:46:05 -02:00
Hans de Goede dc8a7e83aa [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>
2012-01-06 10:45:47 -02:00
Hans de Goede 115f418bfa [media] pwc: Remove driver specific use of pixfmt.priv in the pwc driver
The .priv field never was intended for this, setting a framerate is
support using the standardized S_PARM ioctl.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 10:45:26 -02:00
Hans de Goede 1516524ff2 [media] pwc: Remove driver specific sysfs interface
Setting pan/tilt should be done with v4l2 controls, like with other
cams. The button is available as a standard input device

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 10:45:03 -02:00
Hans de Goede 6807cfcb9d [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>
2012-01-06 10:44:42 -02:00
Hans de Goede c20d78cde3 [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>
2012-01-06 10:44:17 -02:00
Hans de Goede f4af65958a [media] pwc: Make auto white balance speed and delay available as v4l2 controls
Currently auto white balance speed and delay are only available through custom
ioctls, which are deprecated and will be going away in 3.3 .

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 10:42:44 -02:00
Hans de Goede 32c67ecc4a [media] pwc: Properly mark device_hint as unused in all probe error paths
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 10:42:03 -02:00
Hans de Goede 76ae853844 [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>
2012-01-06 10:41:42 -02:00
Hans de Goede ee186fd96a [media] gscpa_t613: Add support for the camera button
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 10:41:09 -02:00
Hans de Goede 0218d53a12 [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>
2012-01-06 10:40:54 -02:00
Hans de Goede 4d6454dbae [media] gspca_pac7302: Add usb-id for 145f:013c
Reported by: Grzegorz Woźniak

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 10:40:26 -02:00
Hans de Goede 3870ed3aed [media] gspca_sonixb: Fix exposure control min/max value for coarse expo sensors
This got broken by some gscpa core fixes, this patch restores the proper
min/max values for these controls.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 10:40:05 -02:00
Theodore Kilgore fe3449a4aa [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>
2012-01-06 10:39:45 -02:00
Mauro Carvalho Chehab b35009a9a7 Merge tag 'v3.2' into staging/for_v3.3
* 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
  ...
2012-01-06 10:18:43 -02:00
Manjunath Hadli 194ed21925 [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

Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 10:09:26 -02:00
Manjunath Hadli 4be5444550 [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

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 10:00:56 -02:00
Manjunath Hadli 9a7f95ad1c [media] davinci vpbe: add dm365 VPBE display driver changes
This patch implements the core additions to the display driver,
mainly controlling the VENC and other encoders for dm365.
This patch also includes addition of amplifier subdevice to the
vpbe driver and interfacing with venc subdevice.

Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 09:42:46 -02:00
Hans de Goede d80dd5d036 [media] gscpa - sn9c20x: Add sd_isoc_init ensuring enough bw when i420 fmt
When using the SN9C20X_I420 fmt the sn9c20x needs more bandwidth
than our regular bandwidth calculations reserve.

This patch adds a sd_isoc_init function, which forces the use of a specific
altsetting when using the SN9C20X_I420 fmt.

This fixes the bottom 10-30% of the image getting corrupted when using
the SN9C20X_I420 fmt (which is the default fmt).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 09:08:55 -02:00
Hans de Goede eb3fb7c963 [media] gspca: Add a need_max_bandwidth flag to sd_desc
Some cameras will pretty much entirely fill all the image buffers all the
time even though they are using compression.

This patch adds a flag to sd_desc, which drivers for such cameras can set.

When this flag is set the bandwidth calculation code will no longer
assume that the image buffer size is a worst case and less bandwidth than
imagebufsize * fps will be used on average.

This patch sets this new flag for 3 drivers:
* For spca561 (for rev12a cameras) and nw80x cams as these simply don't work
  when given less bandwidth than imagebufsize * fps.
* For sn9c20x cameras, because these show severy jpeg artifacts when
  given less bandwidth than imagebufsize * fps and since these are usb2
  cameras there is plenty bandwidth anyways.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 09:07:49 -02:00
Hans de Goede 51e23be284 [media] gspca - main: isoc mode devices are never low speed
Quoting from the official usb 20 spec:
"5.6.4 Isochronous Transfer Bus Access Constraints

Isochronous transfers can only be used by full-speed and high-speed devices."

This means that for code paths which are isoc mode only, we don't need to
check for the device being low speed, simplifying the code.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 09:05:32 -02:00
Hans de Goede 2d39059a65 [media] gspca - main: Avoid clobbering all bandwidth when mic in webcam
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 09:05:01 -02:00
Hans de Goede 5dae603d84 [media] gspca: Check dev->actconfig rather than dev->config
Check dev->actconfig rather than dev->config when checking various
configuration things. dev->config points to the array of configs for the
device so dev->config->foo boils down to dev->config[0].foo and the first
config is not necessarily always the active config.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 09:04:17 -02:00
Hans de Goede 1153f04dea [media] gspca - main: Take numerator into account in fps calculations
In case we ever get sub drivers which do 7.5 fps and express this as
15 / 2 fps.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 09:02:07 -02:00
Hans de Goede d0d3435b21 [media] gspca - main: Correct use of interval in bandwidth calculation
The calculated bandwidth should not be multiplied by the interval, but be
divided by it. Also bInterbval should be interpreted as a power of 2
for isochronous endpoints.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 09:01:18 -02:00
Hans de Goede 66957b8646 [media] gspca - main: rename build_ep_tb to build_isoc_ep_tb
After the "gspca: Fix bulk mode cameras no longer working (regression fix)"
patch build_ep_tb is no longer being called for bulk endpoints.

This patch renames build_ep_tb to build_isoc_ep_tb to make clear it should
only be called for isoc mode cameras.

This patch also:
- drops the no longer needed xfer parameter
- removes a check for bulk mode from the build_isoc_ep_tb code

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 09:00:46 -02:00
Jean-François Moine 18bef42c2d [media] gspca - main: Change the bandwidth estimation of isochronous transfer
Having:
- a mean image size of 0.375 time the max compressed image size and
- a frame rate of 30 fps for small images or with USB 2.0/3.0
seems more realistic and gives less image freezes.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 08:52:54 -02:00
Jose Alberto Reguero 965b37a477 [media] gspca - ov534_9: New sensor ov5621 and webcam 05a9:1550
This path add support to "OmniVision Technologies, Inc. VEHO Filmscanner".

Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06 08:51:02 -02:00
Gareth Williams 2a5fc873d6 [media] Add AC97 8384:7650 for some versions of EMP202
Fix detection of EMP202 audio chip. Some versions have an id of
0x83847650 instead of 0xffffffff

Honestech Vidbox NW03 has a EMP202 audio chip with a different Vendor ID.

Apparently, it is the same with the Gadmei ITV380:
http://linuxtv.org/wiki/index.php/Gadmei_USB_TVBox_UTV380

Signed-off-by: Gareth Williams <gareth@garethwilliams.me.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-05 19:31:39 -02:00
Malcolm Priestley 53844c4fc7 [media] it913x add support for IT9135 9006 devices
Support for IT1935 9006 devices.

9006 have version 2 type chip.

9006 devices should use dvb-usb-it9135-02.fw firmware.

On the device tested the tuner id was set to 0 which meant
the driver used tuner id 0x38. The device functioned normally.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-05 19:30:03 -02:00
Mauro Carvalho Chehab 6cb393c822 [media] drxk_hard: fix locking issues when changing the delsys
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-05 16:44:10 -02:00
Mauro Carvalho Chehab fa4b2a171d [media] drxk: create only one frontend for both DVB-C and DVB-T
Instead of creating two DVB frontend entries for the same device,
create just one entry, and fill the delivery_system according with
the supported standards.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-05 16:44:09 -02:00
Mauro Carvalho Chehab 9348393aaf [media] drxk: remove ops.info.frequency_stepsize from DVB-C
ops.info.frequency_stepsize is used only for DVB-T & friends. For
DVB-C, the step size is calculated using the symbol rate.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-05 16:44:08 -02:00
Mauro Carvalho Chehab 37fa53c6a1 [media] dvb_frontend: improve documentation on set_delivery_system()
While this patch change some things, the updated fields there are
used just on printk, so it shouldn't cause any functional changes.

Yet, this routine is a little complex, so explain a little more
how it works.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-05 16:44:07 -02:00
Mauro Carvalho Chehab 9474c5e63f [media] dvb_frontend: Update the dynamic info->type
Instead of changing the ops.info.type struct, updates only
the data that will be returned to userspace.

Also add some debug messages to help tracking such issues.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-05 16:44:06 -02:00
Mauro Carvalho Chehab 6c4b78cbe6 [media] dvb_frontend: regression fix: add a missing inc inside the loop
without it, the loop will run forever!

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-05 16:43:04 -02:00
Stefan Ringel eeecd0caaf [media] mt2063: fix get_if_frequency call
[mchehab@redhat.com: patch rebased to apply]
Signed-off-by: Stefan Ringel <linuxtv@stefanringel.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-05 11:06:12 -02:00
Mauro Carvalho Chehab 3308e2b53a [media] cx25840: Fix compilation for i386 architecture
WARNING: "__udivdi3" [/home/v4l/new_build/v4l/cx25840.ko] undefined!

64 bits division need to call do_div & friends, in order to allow
it to compile with 32 bits kernels

Cc: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-05 11:06:11 -02:00
Steven Toth 51ada787b8 [media] cx25840: Added g_std support to the video decoder driver
Making the detected video standard available to the core driver
and for user query.

Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-05 06:57:32 -02:00