Commit Graph

12210 Commits (6d6b77f163c7eabedbba00ed2abb7d4a570bff76)

Author SHA1 Message Date
Thierry Reding 4d37ece757 [media] tuner/xc2028: Add I2C flush callback
When loading the firmware, complete each chunk by sending an I2C flush
command to the frontend. Some devices like the tm6000 seem to require
this to properly flush the I2C buffers.

The current code in tm6000 executes the flush command once after each
I2C transfer, which slows down the firmware loading especially when
loading large BASE type images.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-31 15:03:22 -03:00
Sakari Ailus 69d232ae8e [media] omap3isp: ccdc: Use generic frame sync event instead of private HS_VS event
The ccdc block in the omap3isp produces events whenever it starts receiving
a new frame. A private HS_VS event was used for this previously. Now, the
generic V4L2_EVENT_FRAME_SYNC event is being used for the purpose.

This patch also provides the frame sequence number to user space.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-29 12:38:51 -03:00
Jose Alberto Reguero c9f88aa976 [media] ttusb2: add support for the dvb-t part of CT-3650 v3
Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 11:44:49 -03:00
istvan_v@mailbox.hu 84b271488d [media] cx88: notch filter control fixes
This patch reduces the number of available choices for the notch filter type control
so that the standard-specific filter types cannot be selected. It is now limited to
being either 0 (4xFsc, the default) or 1 (square pixel optimized).
The patch also removes the initialization of this control from cx88_reset(), since
that is already done by init_controls(), which is called by cx8800_initdev().

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 11:21:16 -03:00
Joe Perches 2b50763a0b [media] tda18212: Use standard logging, remove tda18212_priv.h
Use the more current logging styles with pr_fmt.
Remove now unnecessary private include.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 11:20:45 -03:00
Joe Perches be85fefecb [media] tda18271: Use printk extension %pV
Deduplicate printk formats to save ~20KB text.

$ size drivers/media/common/tuners/tda18271*o.*
   text	   data	    bss	    dec	    hex	filename
  10747	     56	   1920	  12723	   31b3	drivers/media/common/tuners/tda18271-common.o.new
  18889	     56	   3112	  22057	   5629	drivers/media/common/tuners/tda18271-common.o.old
  20561	    204	   4264	  25029	   61c5	drivers/media/common/tuners/tda18271-fe.o.new
  31093	    204	   6000	  37297	   91b1	drivers/media/common/tuners/tda18271-fe.o.old
   3681	   6760	    440	  10881	   2a81	drivers/media/common/tuners/tda18271-maps.o.new
   5631	   6760	    680	  13071	   330f	drivers/media/common/tuners/tda18271-maps.o.old

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 11:19:43 -03:00
Antti Palosaari f68baeff45 [media] af9015: use logic or instead of sum numbers
Style issue.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 11:14:43 -03:00
Antti Palosaari 4c0cfa24f7 [media] af9015: map remote for Leadtek WinFast DTV2000DS
Thanks to Thomas Gutzler for reporting this.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Cc: Thomas Gutzler <thomas.gutzler@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 11:14:32 -03:00
Antti Palosaari e36454376a [media] em28xx: use MFE lock for PCTV nanoStick T2 290e
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 11:14:22 -03:00
Julia Lawall eb28dc39d3 [media] drivers/media/dvb/dvb-usb/usb-urb.c: adjust array index
Convert array index from the loop bound to the loop index.

A simplified version of the semantic patch that fixes this problem is as

// <smpl>
@@
expression e1,e2,ar;
@@

for(e1 = 0; e1 < e2; e1++) { <...
  ar[
- e2
+ e1
  ]
  ...> }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 11:14:15 -03:00
Julian Scheel 93165b7774 [media] Add support for new revision of KNC 1 DVB-C cards. Using tda10024 instead of tda10023, which is compatible to tda10023 driver
Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 10:41:46 -03:00
Malcolm Priestley f6d8735493 [media] it913x: Driver for Kworld UB499-2T (id 1b80:e409) v1.05
Driver for Kworld UB499-2T (id 1b80:e409)

The device driver has been named it913x, so that support for other family members
can be added later.

TODOs
Firmware support for other it913x devices.
Remote control support, there are two known types.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
[mchehab@redhat.com: Fix a merge conflict]
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 10:35:21 -03:00
Malcolm Priestley 3dbbf82f49 [media] it913x_fe: frontend and tuner driver v1.05
Fronted and Tuner Driver for ITE IT913x Series with inital support for
IT9137 integrated demodulator and tuner device.

The driver is loosely based on AF9035 series. However, support is not intended for
this device specificity.

The IT9137 tuner has been tested on UHF bands, but VHF has only been simulated.

Possible TODO the tuner sections may be separated from the main driver. All future devices
should use the it913x_fe_script_loader for other tuner devices.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
[mchehab@redhat.com: Fix an issue at the Kconfig help]
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 10:29:20 -03:00
Doron Cohen ea3709435c [media] siano: apply debug flag to module level
Siano modules already had sms_dbg flag which is a module parameter which
sets the debug mode so module prints messages to dmesg for debugging.
The variable was static therefore apply only to the file which defines
the module. In modules as smsmdtv.ko that contain a few files, the debug
flag applied only for functions in that main file.
flag was changed to be non-static and therefore can be accessed by all
module files (although it is still not exported out of the module).

Signed-off-by: Doron Cohen <doronc@siano-ms.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 09:56:06 -03:00
Jarod Wilson fda516b72a [media] mceusb: update version, copyright, author
Add note about recent updates coming from Microsoft's publicly available
specs on Windows Media Center remotes and receivers/transmitters.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 08:57:01 -03:00
Jarod Wilson e217fb43c4 [media] mceusb: report actual tx frequencies
Rather than dumping out hex values, lets print the actual calculated
frequency and period the hardware has been configured for. After this

[ 2643.276215] mceusb 3-1:1.0: tx data: 9f 07 (length=2)
[ 2643.276218] mceusb 3-1:1.0: Get carrier mode and freq
[ 2643.277206] mceusb 3-1:1.0: rx data: 9f 06 01 42 (length=4)
[ 2643.277209] mceusb 3-1:1.0: Got carrier of 37037 Hz (period 27us)

Matches up perfectly with the table in Microsoft's docs.

Of course, I've noticed on one of my devices that the MS-recommended
default value of 1 for carrier pre-scaler and 66 for carrier period was
butchered, and instead of converting 66 to hex (0x42 like above), they
put in 0x66, so the hardware reports a default carrier of 24390Hz.
Fortunately, I guess, this particular device is rx-only, but I wouldn't
put it past other hw to screw up here too.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 08:56:39 -03:00
Jarod Wilson b71969bee2 [media] mceusb: flash LED (emu v2+ only) to signal end of init
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 08:55:33 -03:00
Jarod Wilson a411e83944 [media] mceusb: get misc port data from hardware
According to the specs, you can read the number of tx ports, number of
rx sensors, which tx ports have cables plugged into them, and which rx
sensors are active. In practice, most of my devices do seem to report
sane values for tx ports and rx sensors (but not all -- one without any
tx ports reports having them), and most report the active sensor
correctly, but only one of eight reports cabled tx ports correctly. So
for the most part, this is just for informational purposes.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 08:55:02 -03:00
Jarod Wilson ab1072eba9 [media] mceusb: query device for firmware emulator version
Supposedly, there are essentially three different classes of devices
that are compatible with Microsoft's specs. First are the "legacy"
devices, which are built using Microsoft-provided hardware specs and
firmware. Second are "emulator" devices, which are built using custom
hardware and firmware, written to emulate Microsoft's firmware. Third
are "port" devices, which have their own device driver and firmware,
which provides compatible data to higher levels of the stack.

>From what I can tell, things like nuvoton-cir and fintek-cir are
essentially "port" devices -- their raw IR buffer format is very similar
to that of the mceusb devices. Now, within the mceusb driver, we have
three different "generations", which at first, seemed like maybe they
mapped to emulator versions. Unfortuantely, every single device I have
responds "illegal command" to the query to get firmware emulator version
from the hardware, which means they're either all emulator version 1, or
they're legacy devices, and our different "generations" aren't at all
related here. Though in theory, its possible the gen1 devices are
"legacy" devices and the rest are emulator v1. There are some useful
features of the v2 interface I was hoping to play with, but alas...

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 08:53:15 -03:00
Jarod Wilson 4840b788ad [media] mceusb: issue device resume cmd when needed
According to MS docs, the device firmware may halt after receiving an
unknown instruction, but that it should be possible to tell the firmware
to continue running by simply sending a device resume command. So lets
do that.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 08:51:27 -03:00
Jarod Wilson fa3348980a [media] mceusb: set wakeup bits for IR-based resume
Its not uncommon for folks to force these bits enabled, because people
do want to wake their htpc kit via their remote. Lets just set the bits
for 'em.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 08:50:31 -03:00
Jarod Wilson 417c0a23b7 [media] mceusb: give hardware time to reply to cmds
Sometimes the init routine is blasting commands out to the hardware
faster than it can reply. Throw a brief delay in there to give the
hardware a chance to reply before we send the next command.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 08:49:30 -03:00
Jarod Wilson a6fbd3b77a [media] mceusb: command/response updates from MS docs
I was recently pointed to the document titled
Windows-Media-Center-RC-IR-Collection-Green-Button-Specification-03-08-2011-V2.pdf
which as of this writing, is publicly available from
download.microsoft.com. It covers a LOT of the gaps in the mceusb
driver, which to this point, was written almost entirely by
reverse-engineering. First up, I'm updating the defines for all the MCE
commands and responses to match their names in the spec. More to come...

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-27 08:48:05 -03:00
Ohad Ben-Cohen 6c32df437c omap: iommu: omapify 'struct iommu' and exposed API
Prepend 'omap_' to OMAP's 'struct iommu' and exposed API, to prevent
namespace pollution and generally to improve readability of the code
that still uses the driver directly.

Update the users as needed as well.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2011-08-26 11:46:01 +02:00
Ohad Ben-Cohen fcf3a6ef4a omap: iommu/iovmm: move to dedicated iommu folder
Move OMAP's iommu drivers to the dedicated iommu drivers folder.

While OMAP's iovmm (virtual memory manager) driver does not strictly
belong to the iommu drivers folder, move it there as well, because
it's by no means OMAP-specific (in concept. technically it is still
coupled with OMAP's iommu).

Eventually, iovmm will be completely replaced with the generic,
iommu-based, dma-mapping API.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2011-08-26 11:46:00 +02:00
Ohad Ben-Cohen f626b52d4a omap: iommu: migrate to the generic IOMMU API
Migrate OMAP's iommu driver to the generic IOMMU API, so users can stay
generic, and any generic IOMMU functionality can be developed once
in the generic framework.

Migrate omap's iovmm (virtual memory manager) to the generic IOMMU API,
and adapt omap3isp as needed, so the latter won't break.

The plan is to eventually remove iovmm completely by replacing it
with the (upcoming) IOMMU-based DMA-API.

Tested on OMAP3 (with omap3isp) and OMAP4 (with rpmsg/remoteproc).

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2011-08-26 11:46:00 +02:00
Jean Pihet cc74998618 PM QoS: Minor clean-ups
- Misc fixes to improve code readability:
  * rename struct pm_qos_request_list to struct pm_qos_request,
  * rename pm_qos_req parameter to req in internal code,
    consistenly use req in the API parameters,
  * update the in-kernel API callers to the new parameters names,
  * rename of fields names (requests, list, node, constraints)

Signed-off-by: Jean Pihet <j-pihet@ti.com>
Acked-by: markgross <markgross@thegnar.org>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-08-25 15:35:12 +02:00
Jean Pihet e8db0be124 PM QoS: Move and rename the implementation files
The PM QoS implementation files are better named
kernel/power/qos.c and include/linux/pm_qos.h.

The PM QoS support is compiled under the CONFIG_PM option.

Signed-off-by: Jean Pihet <j-pihet@ti.com>
Acked-by: markgross <markgross@thegnar.org>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-08-25 15:35:03 +02:00
Jiri Pirko afc4b13df1 net: remove use of ndo_set_multicast_list in drivers
replace it by ndo_set_rx_mode

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-08-17 20:22:03 -07:00
Jose Alberto Reguero 2d84ca215f [media] tda827x: improve recection with limit frequencies
tda827x is currently taking the demod IF frequency into account while
seeking for the proper tuner range. This is wrong, as the demod IF
frequency has nothing to do with the tuner PLL.

Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-07 09:32:16 -03:00
Luiz Ramos d1520c58eb [media] Fix wrong register mask in gspca/sonixj.c
Hello,

When migrating from Slackware 13.1 to 13.37 (kernel 2.6.33.x to
2.6.37.6), there was some sort of regression with the external webcam
installed at the notebook (0x45:6128, SN9C325+OM6802).

In the version 2.6.37.6, the images got *very* dark, making the webcam
almost unusable, unless if used with direct sunlight.

Tracing back what happened, I concluded that changeset 0e4d413af
caused some sort of odd effects - including this - to this specific model.

Signed-off-by: Luiz Carlos Ramos <lramos.prof@yahoo.com.br>
Acked-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-07 09:03:04 -03:00
Jarod Wilson 47a09b082f [media] imon: rate-limit send_packet spew
There are folks with flaky imon hardware out there that doesn't always
respond to requests to write to their displays for some reason, which
can flood logs quickly when something like lcdproc is trying to
constantly update the display, so lets rate-limit all that error spew.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-06 10:46:45 -03:00
Ming Lei d59a7b1dbc [media] uvcvideo: Set alternate setting 0 on resume if the bus has been reset
If the bus has been reset on resume, set the alternate setting to 0.
This should be the default value, but some devices crash or otherwise
misbehave if they don't receive a SET_INTERFACE request before any other
video control request.

Microdia's 0c45:6437 camera has been found to require this change or it
will stop sending video data after resume.

uvc_video.c]

Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-06 10:42:15 -03:00
Mauro Carvalho Chehab 9bed77ee2f [media] tuner_xc2028: Allow selection of the frequency adjustment code for XC3028
This device is not using the proper demod IF. Instead of using the
IF macro, it is specifying a IF frequency. This doesn't work, as xc3028
needs to load an specific SCODE for the tuner. In this case, there's
no IF table for 5 MHz.

Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-06 09:52:47 -03:00
Andy Shevchenko 31ee95ec2d [media] adp1653: check error code of adp1653_init_controls
Potentially the adp1653_init_controls could return an error. In our case the
error was ignored, meanwhile it means incorrect initialization of V4L2
controls. Additionally we have to free control handler structures in case of
apd1653_init_controls or media_entity_init failure.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-06 09:43:57 -03:00
Andy Shevchenko 572064280e [media] adp1653: check platform_data before usage
The driver requires platform_data to be present. That's why we need to check
and fail in case of the absence of necessary data.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-06 09:42:50 -03:00
Olivier Grenie 680417bb31 [media] dib0700: correct error message
The goal of this patch is to correct a previous patch. In case of error,
the err() function should be used instead of dprintk() function.

[mchehab@redhat.com: as I've replaced dprintk by deb_info, on the the
 previous patch, to avoid breaking bisect, I had to fix a merge conflict
 on this one]
Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-06 09:40:09 -03:00
Olivier Grenie bff469f416 [media] dib0700: protect the dib0700 buffer access
This patch protects the common buffer access inside the dib0700 in order
to manage concurrent access. This protection is done using mutex.

Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Florian Mickler <florian@mickler.org>
Cc: stable@kernel.org
Signed-off-by: Javier Marcet <javier@marcet.info>
Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr>
Signed-off-by: Patrick Boettcher <patrick.boettcher@dibcom.fr>
[mchehab@redhat.com: dprint requires 3 arguments. Replaced by dib_info]
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-06 09:31:36 -03:00
Patrick Boettcher 79fcce3230 [media] DiBcom: protect the I2C bufer access
This patch protects the I2C buffer access in order to manage concurrent
access. This protection is done using mutex.
Furthermore, for the dib9000, if a pid filtering command is
received during the tuning, this pid filtering command is delayed to
avoid any concurrent access issue.

Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Florian Mickler <florian@mickler.org>
Cc: stable@kernel.org
Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr>
Signed-off-by: Patrick Boettcher <Patrick.Boettcher@dibcom.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-08-06 09:25:15 -03:00
Mauro Carvalho Chehab a5f2db539b v4l2-ioctl: properly return -EINVAL when parameters are wrong
Whan an ioctl is implemented, but the parameters are invalid,
the error code should be -EINVAL. However, if the ioctl is
not defined, it should return -ENOTTY instead.

Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-31 09:37:56 -03:00
Antti Palosaari 449d1a0ad1 [media] anysee: use multi-frontend (MFE)
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-31 01:42:40 -03:00
Antti Palosaari 9bd9e3bd2c [media] dvb-usb: multi-frontend support (MFE)
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-31 01:41:32 -03:00
Antti Palosaari bfd4500c9a [media] dvb-usb: prepare for multi-frontend support (MFE)
Change adapter FE pointer as array of FE pointers.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-31 01:26:41 -03:00
Mauro Carvalho Chehab 6d51477470 [media] em28xx: Fix IR unregister logic
The input stop() callback already calls the em28xx_ir_stop method.
Calling it again causes an oops.

Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-31 00:51:11 -03:00
Mauro Carvalho Chehab b05681b917 [media] rc-main: Fix device de-registration logic
rc unregister logic were deadly broken, preventing some drivers to
be removed. Among the broken things, rc_dev_uevent() is being called
during device_del(), causing a data filling on an area that it is
not ready anymore.

Also, some drivers have a stop callback defined, that needs to be called
before data removal, as it stops data polling.

Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-31 00:50:56 -03:00
Erik Andrén eaceba650d [media] gspca-stv06xx: Triple frame rate by decreasing the scan rate
Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-31 00:50:37 -03:00
Erik Andrén d6c5441f62 [media] gspca-stv06xx: Remove writes to read-only registers
Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-31 00:50:31 -03:00
Erik Andrén a0917ca4d7 [media] gspca-stv06xx: Fix sensor init indentation
No functional changes on this patch.

Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-31 00:50:24 -03:00
Erik Andrén 46fecfaf78 [media] gspca-stv06xx: Simplify stv_init struct and vv6410 bridge init
Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-31 00:50:20 -03:00
Erik Andrén f9ada374f0 [media] gspca-stv06xx: Simplify register writes by avoiding special data structures
Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-31 00:50:14 -03:00
Linus Torvalds 664a41b8a9 Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (430 commits)
  [media] ir-mce_kbd-decoder: include module.h for its facilities
  [media] ov5642: include module.h for its facilities
  [media] em28xx: Fix DVB-C maxsize for em2884
  [media] tda18271c2dd: Fix saw filter configuration for DVB-C @6MHz
  [media] v4l: mt9v032: Fix Bayer pattern
  [media] V4L: mt9m111: rewrite set_pixfmt
  [media] V4L: mt9m111: fix missing return value check mt9m111_reg_clear
  [media] V4L: initial driver for ov5642 CMOS sensor
  [media] V4L: sh_mobile_ceu_camera: fix Oops when USERPTR mapping fails
  [media] V4L: soc-camera: remove soc-camera bus and devices on it
  [media] V4L: soc-camera: un-export the soc-camera bus
  [media] V4L: sh_mobile_csi2: switch away from using the soc-camera bus notifier
  [media] V4L: add media bus configuration subdev operations
  [media] V4L: soc-camera: group struct field initialisations together
  [media] V4L: soc-camera: remove now unused soc-camera specific PM hooks
  [media] V4L: pxa-camera: switch to using standard PM hooks
  [media] NetUP Dual DVB-T/C CI RF: force card hardware revision by module param
  [media] Don't OOPS if videobuf_dvb_get_frontend return NULL
  [media] NetUP Dual DVB-T/C CI RF: load firmware according card revision
  [media] omap3isp: Support configurable HS/VS polarities
  ...

Fix up conflicts:
 - arch/arm/mach-omap2/board-rx51-peripherals.c:
     cleanup regulator supply definitions in mach-omap2
   vs
     OMAP3: RX-51: define vdds_csib regulator supply
 - drivers/staging/tm6000/tm6000-alsa.c (trivial)
2011-07-30 00:08:53 -07:00
Stephen Rothwell ee2ce3a0b4 [media] ir-mce_kbd-decoder: include module.h for its facilities
drivers/media/rc/ir-mce_kbd-decoder.c:446:16: error: expected declaration specifiers or '...' before string constant
drivers/media/rc/ir-mce_kbd-decoder.c:446:1: warning: data definition has no type or storage class
drivers/media/rc/ir-mce_kbd-decoder.c:446:1: warning: type defaults to 'int' in declaration of 'MODULE_LICENSE'
drivers/media/rc/ir-mce_kbd-decoder.c:446:16: warning: function declaration isn't a prototype
drivers/media/rc/ir-mce_kbd-decoder.c:447:15: error: expected declaration specifiers or '...' before string constant
drivers/media/rc/ir-mce_kbd-decoder.c:447:1: warning: data definition has no type or storage class
drivers/media/rc/ir-mce_kbd-decoder.c:447:1: warning: type defaults to 'int' in declaration of 'MODULE_AUTHOR'
drivers/media/rc/ir-mce_kbd-decoder.c:447:15: warning: function declaration isn't a prototype
drivers/media/rc/ir-mce_kbd-decoder.c:448:20: error: expected declaration specifiers or '...' before string constant
drivers/media/rc/ir-mce_kbd-decoder.c:448:1: warning: data definition has no type or storage class
drivers/media/rc/ir-mce_kbd-decoder.c:448:1: warning: type defaults to 'int' in declaration of 'MODULE_DESCRIPTION'
drivers/media/rc/ir-mce_kbd-decoder.c:448:20: warning: function declaration isn't a prototype

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-29 12:54:38 -03:00
Stephen Rothwell d208c97c93 [media] ov5642: include module.h for its facilities
drivers/media/video/ov5642.c:985:1: warning: data definition has no type or storage class
drivers/media/video/ov5642.c:985:1: warning: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE'
drivers/media/video/ov5642.c:985:1: warning: parameter names (without types) in function declaration
drivers/media/video/ov5642.c: In function 'ov5642_mod_init':
drivers/media/video/ov5642.c:998:9: error: 'THIS_MODULE' undeclared (first use in this function)
drivers/media/video/ov5642.c:998:9: note: each undeclared identifier is reported only once for each function it appears in
drivers/media/video/ov5642.c: At top level:
drivers/media/video/ov5642.c:1009:20: error: expected declaration specifiers or '...' before string constant
drivers/media/video/ov5642.c:1009:1: warning: data definition has no type or storage class
drivers/media/video/ov5642.c:1009:1: warning: type defaults to 'int' in declaration of 'MODULE_DESCRIPTION'
drivers/media/video/ov5642.c:1009:20: warning: function declaration isn't a prototype
drivers/media/video/ov5642.c:1010:15: error: expected declaration specifiers or '...' before string constant
drivers/media/video/ov5642.c:1010:1: warning: data definition has no type or storage class
drivers/media/video/ov5642.c:1010:1: warning: type defaults to 'int' in declaration of 'MODULE_AUTHOR'
drivers/media/video/ov5642.c:1010:15: warning: function declaration isn't a prototype
drivers/media/video/ov5642.c:1011:16: error: expected declaration specifiers or '...' before string constant
drivers/media/video/ov5642.c:1011:1: warning: data definition has no type or storage class
drivers/media/video/ov5642.c:1011:1: warning: type defaults to 'int' in declaration of 'MODULE_LICENSE'
drivers/media/video/ov5642.c:1011:16: warning: function declaration isn't a prototype
drivers/media/video/ov5642.c: In function 'ov5642_mod_init':
drivers/media/video/ov5642.c:999:1: warning: control reaches end of non-void function

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-29 12:54:36 -03:00
Mauro Carvalho Chehab f7acc4bb86 [media] em28xx: Fix DVB-C maxsize for em2884
The logic at em28xx_isoc_dvb_max_packetsize() sucks, at least for newer
the needed packet size. Yet, it is better than nothing.

Rewrite the code in order to change the default to 752 for em2884 and
newer chips and provide a better way to handle per-chipset specifics.

For em2874, the current default should be enough, as the only em2874
board is currently a 1-seg ISDB-T board, so, it needs only a limited
amount of bandwidth.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-28 17:09:54 -03:00
Mauro Carvalho Chehab cf845297d5 [media] tda18271c2dd: Fix saw filter configuration for DVB-C @6MHz
Currently, the driver assumes that all QAM carriers are spaced with
8MHz. This is wrong, and may decrease QoS on Countries like Brazil,
that have DVB-C carriers with 6MHz-spaced.

Fortunately, both ITU-T J-83 and EN 300 429 specifies a way to
associate the symbol rate with the bandwidth needed for it.

For ITU-T J-83 2007 annex A, the maximum symbol rate for 6 MHz is:
	6 MHz / 1.15 = 5217391 Bauds
For  ITU-T J-83 2007 annex C, the maximum symbol rate for 6 MHz is:
	6 MHz / 1.13 = 5309735 Bauds.

As this tuner is currently used only for DRX-K, and it is currently
hard-coded to annex A, I've opted to use the roll-off factor of 0.15,
instead of 0.13.

If we ever support annex C, the better would be to add a DVB S2API
call to allow changing between Annex A and C, and add the 0.13 roll-off
factor to it.

This code is currently being used on other frontends, so I think we
should later add a core function with this code, to warrant that
it will be properly implemented everywhere.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-28 17:09:46 -03:00
Laurent Pinchart 86cf786c04 [media] v4l: mt9v032: Fix Bayer pattern
Compute crop rectangle boundaries to ensure a GRBG Bayer pattern.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:10 -03:00
Michael Grzeschik 7c58e7d06c [media] V4L: mt9m111: rewrite set_pixfmt
added new bit offset defines,
more supported BE colour formats
and also support BGR565 swapped pixel formats

removed pixfmt helper functions and option flags
setting the configuration register directly in set_pixfmt

added reg_mask function

reg_mask is basically the same as clearing & setting registers,
but it is more convenient and faster (saves one rw cycle).

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Philipp Wiesner <p.wiesner@phytec.de>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
[g.liakhovetski@gmx.de: remove Bayer swap, forward-port, rename macros]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:10 -03:00
Michael Grzeschik 9c56cbf9aa [media] V4L: mt9m111: fix missing return value check mt9m111_reg_clear
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:09 -03:00
Bastian Hecht b52a851d91 [media] V4L: initial driver for ov5642 CMOS sensor
This is an initial driver release for the Omnivision 5642 CMOS sensor.

Signed-off-by: Bastian Hecht <hechtb@gmail.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:09 -03:00
Guennadi Liakhovetski cb74cf5349 [media] V4L: sh_mobile_ceu_camera: fix Oops when USERPTR mapping fails
If vb2_dma_contig_get_userptr() fails on a videobuffer, driver's
.buf_init() method will not be called and the list will not be
initialised. Trying to remove an uninitialised element from a list leads
to a NULL-dereference.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Tested-by: Bastian Hecht <hechtb@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:09 -03:00
Guennadi Liakhovetski 7dfff95366 [media] V4L: soc-camera: remove soc-camera bus and devices on it
Now that v4l2 subdevices have got their own device objects, having
one more device in soc-camera clients became redundant and confusing.
This patch removes those devices and the soc-camera bus, they used to
reside on.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:08 -03:00
Guennadi Liakhovetski d33b290a14 [media] V4L: soc-camera: un-export the soc-camera bus
The soc-camera bus is now completely local again.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:08 -03:00
Guennadi Liakhovetski 6b526fed0e [media] V4L: sh_mobile_csi2: switch away from using the soc-camera bus notifier
This moves us one more step closer to eliminating the soc-camera bus
and devices on it. Besides, as a side effect, CSI-2 runtime PM on
sh-mobile secomes finer grained now: we only have to power on the
interface, when the device nodes are open.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:08 -03:00
Guennadi Liakhovetski 7a05dfedde [media] V4L: soc-camera: group struct field initialisations together
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:08 -03:00
Guennadi Liakhovetski 033d7463f8 [media] V4L: soc-camera: remove now unused soc-camera specific PM hooks
soc-camera host drivers shall be implementing their PM, using standard
kernel methods, soc-camera specific hooks can die.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:07 -03:00
Guennadi Liakhovetski 7254026ced [media] V4L: pxa-camera: switch to using standard PM hooks
The pxa-camera driver doesn't need soc-camera specific PM callbacks,
switch it to using the standard PM hooks instead.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:07 -03:00
Abylay Ospan 2d12421dd3 [media] NetUP Dual DVB-T/C CI RF: force card hardware revision by module param
Currently available two hardware revision:
0x1	firmware filename: dvb-netup-altera-01.fw
0x4	firmware filename: dvb-netup-altera-04.fw

Signed-off-by: Abylay Ospan <aospan@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:07 -03:00
Abylay Ospan e66131cee5 [media] Don't OOPS if videobuf_dvb_get_frontend return NULL
Signed-off-by: Abylay Ospan <aospan@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:07 -03:00
Abylay Ospan b8f0d306b7 [media] NetUP Dual DVB-T/C CI RF: load firmware according card revision
Currently available two hardware revision:
0x1	firmware filename: dvb-netup-altera-01.fw
0x4	firmware filename: dvb-netup-altera-04.fw

Signed-off-by: Abylay Ospan <aospan@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:07 -03:00
Laurent Pinchart 1752cd5d3e [media] omap3isp: Support configurable HS/VS polarities
Add two fields to the ISP parallel platform data to set the HS and VS
signals polarities.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:07 -03:00
Kalle Jokiniemi 65d76488f6 [media] OMAP3: ISP: Add regulator control for omap34xx
The current omap3isp driver is missing regulator handling
for CSIb complex in omap34xx based devices. This patch
adds a mechanism for this to the omap3isp driver.

Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@nokia.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:06 -03:00
Amber Jain 118314c016 [media] V4l2: OMAP: VOUT: Minor Cleanup, removing the unnecessary code
Minor changes to remove the unused code from omap_vout driver.

Signed-off-by: Amber Jain <amber@ti.com>
Signed-off-by: Samreen <samreen@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:06 -03:00
Amber Jain 72915e851d [media] V4L2: OMAP: VOUT: dma map and unmap v4l2 buffers in qbuf and dqbuf
Add support to map the buffer using dma_map_single during qbuf which inturn
calls cache flush and unmap the same during dqbuf. This is done to prevent
the artifacts seen because of cache-coherency issues on OMAP4

Signed-off-by: Amber Jain <amber@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:06 -03:00
Amber Jain 5251dd6c07 [media] V4L2: OMAP: VOUT: isr handling extended for DPI and HDMI interface
Extending the omap vout isr handling for:
- HDMI interface.

These are the new interfaces added to OMAP4 DSS.

Signed-off-by: Amber Jain <amber@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:06 -03:00
archit taneja 445e258fa2 [media] OMAP_VOUT: Create separate file for VRFB related API's
Introduce omap_vout_vrfb.c and omap_vout_vrfb.h, for all VRFB related API's,
making OMAP_VOUT driver independent from VRFB. This is required for OMAP4 DSS,
since OMAP4 doesn't have VRFB block.

Added new enum vout_rotation_type and "rotation_type" member to omapvideo_info,
this is initialized based on the arch type in omap_vout_probe. The rotation_type
var is now used to choose between vrfb and non-vrfb calls.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:06 -03:00
archit taneja b366888a90 [media] OMAP_VOUT: CLEANUP: Make rotation related helper functions more descriptive
Rename rotation_enabled() and rotate_90_or_270() to is_rotation_enabled()
and is_rotation_90_or_270() to make them more descriptive.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:05 -03:00
archit taneja a137ac870b [media] OMAP_VOUT: CLEANUP: Move generic functions and macros to common files
Move the inline functions rotate_90_or_270(), rotation_enabled(), and
calc_rotation() from omap_vout.c to omap_voutdef.h.

Move the independent functions omap_vout_alloc_buffer() and
omap_vout_free_buffer() to omap_voutlib.c.

Remove extern identifier from function definitions in omap_voutlib.h

Add static identifier to functions that are used locally in omap_vout.c

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:05 -03:00
Amber Jain e213e438ce [media] OMAP2: V4L2: Remove GFP_DMA allocation as ZONE_DMA is not configured on OMAP
Remove GFP_DMA from the __get_free_pages() call from omap24xxcam as ZONE_DMA
is not configured on OMAP. Earlier the page allocator used to return a page
from ZONE_NORMAL even when GFP_DMA is passed and CONFIG_ZONE_DMA is disabled.
As a result of commit a197b59ae6, page allocator
returns null in such a scenario with a warning emitted to kernel log.

Signed-off-by: Amber Jain <amber@ti.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:05 -03:00
Amber Jain e831599cb8 [media] V4L2: omap_vout: Remove GFP_DMA allocation as ZONE_DMA is not configured on OMAP
Remove GFP_DMA from the __get_free_pages() call from omap_vout as ZONE_DMA
is not configured on OMAP. Earlier the page allocator used to return a page
from ZONE_NORMAL even when GFP_DMA is passed and CONFIG_ZONE_DMA is disabled.
As a result of commit a197b59ae6, page allocator
returns null in such a scenario with a warning emitted to kernel log.

Signed-off-by: Amber Jain <amber@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:05 -03:00
Kirill Smelkov 949d926458 [media] uvcvideo: Add FIX_BANDWIDTH quirk to HP Webcam on HP Mini 5103 netbook
The camera there identifies itself as being manufactured by Cheng Uei
Precision Industry Co., Ltd (Foxlink), and product is titled as "HP
Webcam [2 MP Fixed]".

I was trying to get 2 USB video capture devices to work simultaneously,
and noticed that the above mentioned webcam always requires packet size
= 3072 bytes per micro frame (~= 23.4 MB/s isoc bandwidth), which is far
more than enough to get standard NTSC 640x480x2x30 = ~17.6 MB/s isoc
bandwidth.

As there are alt interfaces with smaller MxPS

    T:  Bus=01 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#=  2 Spd=480  MxCh= 0
    D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
    P:  Vendor=05c8 ProdID=0403 Rev= 1.06
    S:  Manufacturer=Foxlink
    S:  Product=HP Webcam [2 MP Fixed]
    S:  SerialNumber=200909240102
    C:* #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=500mA
    A:  FirstIf#= 0 IfCount= 2 Cls=0e(video) Sub=03 Prot=00
    I:* If#= 0 Alt= 0 #EPs= 1 Cls=0e(video) Sub=01 Prot=00 Driver=uvcvideo
    E:  Ad=83(I) Atr=03(Int.) MxPS=  16 Ivl=4ms
    I:* If#= 1 Alt= 0 #EPs= 0 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
    I:  If#= 1 Alt= 1 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
    E:  Ad=81(I) Atr=05(Isoc) MxPS= 128 Ivl=125us
    I:  If#= 1 Alt= 2 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
    E:  Ad=81(I) Atr=05(Isoc) MxPS= 512 Ivl=125us
    I:  If#= 1 Alt= 3 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
    E:  Ad=81(I) Atr=05(Isoc) MxPS=1024 Ivl=125us
    I:  If#= 1 Alt= 4 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
    E:  Ad=81(I) Atr=05(Isoc) MxPS=1536 Ivl=125us
    I:  If#= 1 Alt= 5 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
    E:  Ad=81(I) Atr=05(Isoc) MxPS=2048 Ivl=125us
    I:  If#= 1 Alt= 6 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
    E:  Ad=81(I) Atr=05(Isoc) MxPS=2688 Ivl=125us
    I:  If#= 1 Alt= 7 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
    E:  Ad=81(I) Atr=05(Isoc) MxPS=3072 Ivl=125us

UVC_QUIRK_FIX_BANDWIDTH helps here and NTSC video can be served with
MxPS=2688 i.e. 20.5 MB/s isoc bandwidth.

In terms of microframe time allocation, before the quirk NTSC video
required 60 usecs / microframe and 53 usecs / microframe after.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:05 -03:00
Devin Heitmueller d749fb663e [media] au8522: set signal field to 100% when signal present
The signal state field in G_TUNER is typically scaled from 0-100%.  Since we
don't know the signal level, we really would prefer the field to contain 100%
than 1/256, which in many utilities (such as v4l2-ctl) rounds to 0% even when
a signal is actually present.

This patch makes the behavior consistent with other drivers.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:05 -03:00
Devin Heitmueller de99d5328c [media] cx231xx: Provide signal lock status in G_INPUT
Make use of the signal state registers to properly populate the signal lock
registers in the cx231xx driver.

This allows applications to know whether there is a signal present even in
devices which lack a tuner (since such apps typically won't call G_TUNER if
no tuner is present).

[mchehab@redhat.com: Fix CodingStyle: don't use {} for one-line if's]
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:04 -03:00
Devin Heitmueller 44ecf1df94 [media] cx231xx: Fix power ramping issue
On platforms that have CONFIG_HZ set to 100, the power ramp time effectively
ends up being 10ms.  However, on those that have a higher CONFIG_HZ, the time
ends up *actually* being 5ms, which doesn't allow enough time for the hardware
to be fully powered up before attempting to address it via i2c.

Change the constant to 10ms, which is long enough for the hardware to power
up, and won't really be anymore time than it was previously on platforms
with CONFIG_HZ being 100.

Credit goes to Mauro Carvalho Chehab and Gerd Hoffmann who previously
investigated this issue.

Tested with the Hauppauge USBLive 2, with which the problem was readily
reproducible after setting CONFIG_HZ to 1000.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:04 -03:00
Devin Heitmueller 992299e84a [media] Fix regression introduced which broke the Hauppauge USBLive 2
The following patch addresses the regression introduced in the cx231xx
driver which stopped the Hauppauge USBLive2 from working.

Confirmed working by both myself and the user who reported the issue
on the KernelLabs blog (Robert DeLuca).

At some point during refactoring of the cx231xx driver, the USBLive 2 device
became broken.  This patch results in the device working again.

Thanks to Robert DeLuca for sponsoring this work.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Cc: Robert DeLuca <robertdeluca@me.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:04 -03:00
Stephan Lachowsky c0c5e71e46 [media] uvcvideo: Fix control mapping for devices with multiple chains
The search for matching extension units fails to take account of the
current chain.  In the case where you have two distinct video chains,
both containing an XU with the same GUID but different unit ids, you
will be unable to perform a mapping on the second chain because entity
on the first chain will always be found first

Fix this by only searching the current chain when performing a control
mapping.  This is analogous to the search used by uvc_find_control(),
and is the correct behaviour.

Signed-off-by: Stephan Lachowsky <stephan.lachowsky@maxim-ic.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:04 -03:00
Sergei Shtylyov fa14001480 [media] bt8xx: use pci_dev->subsystem_{vendor|device}
The driver reads PCI subsystem IDs from the PCI configuration registers while
they are already stored by the PCI subsystem in the 'subsystem_{vendor|device}'
fields of 'struct pci_dev'...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:04 -03:00
Mauro Carvalho Chehab 119faf90ed [media] drxk: Fix the logic that selects between DVB-C annex A and C
Fix the DRX-K logic that selects between DVB-C annex A and C

Fix a typo where DVB-C annex type is set via setEnvParameters, but
the driver, uses, instead, setParamParameters[2].

While here, cleans up the code, fixing a bad identation at the fallback
code for other types of firmware, and put the multiple-line comments
into the Linux CodingStyle.

Acked-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:04 -03:00
Mauro Carvalho Chehab f07a0bc111 [media] drxk: Fix read debug message
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:03 -03:00
Mauro Carvalho Chehab e716adacef [media] drxk: Fix error return code during drxk init
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:03 -03:00
Mauro Carvalho Chehab ab12f41f62 [media] drxk: Remove goto/break after return
After return, we don't need any other statement to change the
function flux ;)

Reported-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:03 -03:00
Mauro Carvalho Chehab 320ed23ebf [media] drxk: Fix a bug at some switches that broke DVB-T
The error propagation changeset c23bf4402 broke the DVB-T
code.

The legacy way for propagate errors was:

do {
	status = foo_func()
	if (status < 0)
		break;
} while (0);
return status;

However, on a few places, it was doing:
do {
	switch(foo) {
	case bar:
		status = foo_func()
		if (status < 0)
			break;
		break;
	}
	switch(foo2) {
	case bar:
		status = foo_func()
		if (status < 0)
			break;
		break;
	}
	...
} while (0);
return (status)

The inner error break were not working, as it were breaking only
the switch, instead of the do. The solution used were to do a
s/break/goto error/ at the inner breaks, but preserving the last
break. Onfortunately, on a few switches, the replacement were
applied also to the final break for the case statements.

Fix the broken logic, by reverting them to break, where pertinent,
in order to fix DVB-T support.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:03 -03:00
Mauro Carvalho Chehab c4c3a3d32a [media] Remove the double symbol increment hack from drxk_hard
Both ngene and ddbrige calls dvb_attach once for drxk_attach.
The logic used there, and by tda18271c2dd driver is different
from similar logic on other frontends.

The right fix is to change them to use the same logic, but,
while we don't do that, we need to patch em28xx-dvb in order
to do cope with ngene/ddbridge magic.

While here, document why drxk_t_release should do nothing.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:03 -03:00
Mauro Carvalho Chehab 33ba28eebc [media] em28xx: Add other Terratec H5 USB ID's
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:02 -03:00
Mauro Carvalho Chehab 106ff9e013 Revert "[media] DVB: dvb_frontend: off by one in dtv_property_dump()"
This reverts commit a3e4adf274f86b2363fedaa964297cb38526cef0.

As pointed by Andread Oberritter <obi@linuxtv.org>:

	That's wrong, because the array size is DTV_MAX_COMMAND + 1.
	Using the ARRAY_SIZE macro instead might reduce the confusion.

Also, changeset 3995223038 already fixed this issue.

Reported-by: Andread Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:02 -03:00
istvan_v@mailbox.hu bded70d296 [media] cx88: implemented luma notch filter control
The following patch adds a new control that makes it possible to set the
luma notch filter type to finetune picture quality.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:01 -03:00
istvan_v@mailbox.hu eea16e3661 [media] cx88: implemented sharpness control
This patch implements support for a sharpness control, using the luma
peaking filter feature of cx2388x.

[mchehab@redhat.com: use cx_andor instead of cx_write]
Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:01 -03:00
Tomasz Stanislawski fef1c8d018 [media] v4l: s5p-tv: add TV Mixer driver for Samsung S5P platform
Add driver for TV Mixer on Samsung platforms from S5P family.
Mixer is responsible for merging images from three layers and
passing result to the output.

Drivers are using:
- v4l2 framework
- videobuf2
- runtime PM

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:01 -03:00
Tomasz Stanislawski 9a498400fe [media] v4l: s5p-tv: add SDO driver for Samsung S5P platform
Add drivers for Standard Definition output (SDO) on Samsung platforms
from S5P family. The driver provides control over streaming analog TV
via Composite connector.

Driver is using:
- v4l2 framework
- runtime PM

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:01 -03:00
Tomasz Stanislawski a52074ee7a [media] v4l: s5p-tv: add drivers for HDMI on Samsung S5P platform
Add drivers for HDMI outputs on Samsung platforms from S5P family.

Drivers are using:
- v4l2 framework
- runtime PM

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:01 -03:00
Devin Heitmueller 243bf1a24d [media] cx88: properly maintain decoder config when using MPEG encoder
The cx88 driver would force core->input to always be zero when doing the
the request_acquire().  While it wasn't actually changing the input register
in the hardware, the driver makes decision based on the current input.  In
particular, it decides whether to do things like enabling the comb filter
when on a composite input but disabling it on s-video.  So for example, on
the HVR-1300, using the s-video input with the MPEG encoder would end up with
the video decoder core configured as though the input type were composite.

In short, the driver state did not match the hardware state.

This patch does two things:

1.  It forces the input to zero only if actually switching to DVB mode.  This
prevents the input from changing when the blackbird driver opens the device.

2.  Keep track of what the input was set to when switching to DVB, and reset
it back when done.  This eliminates a condition where for example the user
had the analog side of the board set to capture on the s-video input, then
he used DVB for a bit, then the analog input would unexpectedly be set to
the tuner input.

This work was sponsored by Anevia S.A.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Cc: Florent Audebert <florent.audebert@anevia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:00 -03:00
Kamil Debski af93574678 [media] MFC: Add MFC 5.1 V4L2 driver
Multi Format Codec 5.1 is a hardware video coding acceleration
module found in the S5PV210 and Exynos4 Samsung SoCs. It is
capable of handling a range of video codecs and this driver
provides a V4L2 interface for video decoding and encoding.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Jeongtae Park <jtp.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:56:00 -03:00
Jarod Wilson c53f9f00e5 [media] redrat3: improve compat with lirc userspace decode
This is admittedly a bit of a hack, but if we change our timeout value
to something longer and fudge our synthesized trailing space sample
based on the initial pulse sample, rc-core decode continues to work just
fine with both rc-6 and rc-5, and now lirc userspace decode shows proper
repeats for both of those protocols as well. Also tested NEC
successfully with both decode options.

We do still need a reset timer callback using the hardware's timeout
value to make sure we actually process samples correctly, regardless of
our somewhat hacky timeout and synthesized trailer above.

This also adds a missing del_timer_sync call to the module unload path.

CC: Chris Dodge <chris@redrat.co.uk>
CC: Andrew Vincer <andrew.vincer@redrat.co.uk>
CC: Stephen Cox <scox_nz@yahoo.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:59 -03:00
Jarod Wilson 2c594ffae4 [media] redrat3: cap duration in the right place
Trying to cap duration before multiplying it was obviously wrong.

CC: Chris Dodge <chris@redrat.co.uk>
CC: Andrew Vincer <andrew.vincer@redrat.co.uk>
CC: Stephen Cox <scox_nz@yahoo.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:59 -03:00
Jarod Wilson 68b2a69d10 [media] redrat3: sending extra trailing space was useless
We already add a trailing space, this wasn't doing anything useful, and
actually confused lirc userspace a bit. Rip it out.

CC: Chris Dodge <chris@redrat.co.uk>
CC: Andrew Vincer <andrew.vincer@redrat.co.uk>
CC: Stephen Cox <scox_nz@yahoo.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:59 -03:00
Jarod Wilson f5f2cc646a [media] rc-core support for Microsoft IR keyboard/mouse
This is a custom IR protocol decoder, for the RC-6-ish protocol used by
the Microsoft Remote Keyboard, apparently developed internally at
Microsoft, and officially dubbed MCIR-2, per their March 2011 remote and
transceiver requirements and specifications document, which also touches
on this IR keyboard/mouse device.

Its a standard keyboard with embedded thumb stick mouse pointer and
mouse buttons, along with a number of media keys. The media keys are
standard RC-6, identical to the signals from the stock MCE remotes, and
will be handled as such. The keyboard and mouse signals will be decoded
and delivered to the system by an input device registered specifically
by this driver.

Successfully tested with multiple mceusb-driven transceivers, as well as
with fintek-cir and redrat3 hardware. Essentially, any raw IR hardware
with enough sampling resolution should be able to use this decoder,
nothing about it is at all receiver-hardware-specific.

This work is inspired by lirc_mod_mce:

The documentation there and code aided in understanding and decoding the
protocol, but the bulk of the code is actually borrowed more from the
existing in-kernel decoders than anything. I did recycle the keyboard
keycode table, a few defines, and some of the keyboard and mouse data
parsing bits from lirc_mod_mce though.

Special thanks to James Meyer for providing the hardware, and being
patient with me as I took forever to get around to writing this.

callback routine to ensure we don't get any stuck keys, and used
symbolic names for the keytable. Also cc'ing Florian this time, who I
believe is the original mod-mce author...

CC: Florian Demski <fdemski@users.sourceforge.net>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:59 -03:00
Emilio David Diaus Lopez a062d04bb9 [media] af9015: add support for Sveon STV22 [1b80:e401]
Signed-off-by: Emilio David Diaus Lopez <reality_es@yahoo.es>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:58 -03:00
Antti Palosaari 713d9b5d98 [media] af9015: remove 2nd I2C-adapter
It is useless. There is only one physical I2C-adapter.

2nd adapter was added originally due to some plans for allowing only one
demod to access bus at time. But I never implemented proper locking...

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:58 -03:00
Antti Palosaari 3509cbdfac [media] af9015: remove old FW based IR polling code
Remove old code which is not used anymore since IR code is read
directly from memory nowadays.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:58 -03:00
Antti Palosaari 709d92083a [media] af9015: add more I2C msg checks
Return EOPNOTSUPP for too long messages.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:57 -03:00
Antti Palosaari 16b2dc2a8b [media] af9015: small optimization
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:57 -03:00
Antti Palosaari ae81aab3fa [media] af9015: map remote for MSI DIGIVOX Duo
Reported-by: Jacek M. Holeczek <jacek.m.holeczek@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:56 -03:00
Juergen Lock 879b0d7957 [media] af9015: setup rc keytable for LC-Power LC-USB-DVBT
That's this tuner:

The credit card sized remote more or less works if I set remote=4,
so I added the hash to get it autodetected.  (`more or less' there
meaning sometimes buttons are `stuck on repeat', i.e. ir-keytable -t
keeps repeating the same scancode until i press another button.)

Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:56 -03:00
Jesper Juhl 8afe9119e2 [media] media, Micronas dvb-t: Fix mem leaks, don't needlessly zero mem, fix spelling
In drivers/media/dvb/frontends/drxd_hard.c::load_firmware() I see 3
small issues:

 1) When the 'fw' variable goes out of scope we'll leak the memory
 allocated to it by request_firmware() by neglecting to call
 release_firmware().

 2) After a successful request_firmware() we allocate fw->size bytes
 of memory using kzalloc() only to immediately overwrite all that
 memory with memcpy(), so asking for zeroed memory seems like wasted
 effort - just use kmalloc().

 3) In one of the error messages "no memory" lacks a space and is
 written as "nomemory".

This patch fixes all 3 issues.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:56 -03:00
Jarod Wilson 9b67693ccf [media] rc-rc6-mce: minor keymap updates
Microsoft's Windows Media Center specification and requirements doc from
2011.03.18 now refers to the former Power Toggle button as the Sleep
Toggle, and recommends using a new moon sleep icon for it. Its the same
key, but its apparently always been meant to put the system to sleep,
not power it off. Adjust accordingly. While we're here, lets also remove
the duplicate KEY_PLAYPAUSE entry.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:56 -03:00
Julia Lawall ef60e8f5d5 [media] drivers/media/video/cx231xx/cx231xx-cards.c: add missing kfree
Clear the cx231xx_devused variable and free dev in the error handling code,
as done in the error handling code nearby.

The semantic match that finds this problem is as follows:

// <smpl>
@r@
identifier x;
@@

kfree(x)

@@
identifier r.x;
expression E1!=0,E2,E3,E4;
statement S;
@@

(
if (<+...x...+>) S
|
if (...) { ... when != kfree(x)
               when != if (...) { ... kfree(x); ... }
               when != x = E3
* return E1;
}
... when != x = E2
if (...) { ... when != x = E4
 kfree(x); ... return ...; }
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:55 -03:00
Julia Lawall ee893e9adc [media] drivers/media/video: add missing kfree
Free the recently allocated qcam in each case.

The semantic match that finds this problem is as follows:

// <smpl>
@r@
identifier x;
@@

kfree(x)

@@
identifier r.x;
expression E1!=0,E2,E3,E4;
statement S;
@@

(
if (<+...x...+>) S
|
if (...) { ... when != kfree(x)
               when != if (...) { ... kfree(x); ... }
               when != x = E3
* return E1;
}
... when != x = E2
if (...) { ... when != x = E4
 kfree(x); ... return ...; }
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:55 -03:00
Dan Carpenter bca3ba7904 [media] DVB: dvb_frontend: off by one in dtv_property_dump()
If the tvp->cmd == DTV_MAX_COMMAND then we read past the end of the
array.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:55 -03:00
istvan_v@mailbox.hu 0cf8af57f1 [media] cx23885: added support for card 107d:6f39
This patch, based on code by Mirek Slugen, implements support for the
Leadtek WinFast PxDVR3200 H card with XC4000 tuner (107d:6f39).

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:55 -03:00
Jesper Juhl 0d334f7f7a [media] drivers/media: static should be at beginning of declaration
Make sure that the 'static' keywork is at the beginning of declaration
for drivers/media/video/omap/omap_vout.c

This gets rid of warnings like
when building with -Wold-style-declaration (and/or -Wextra which also
enables it).

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:54 -03:00
Jonathan Corbet 9f26392a6a [media] marvell-cam: clean up a couple of unused cam structure fields
Delete a couple of leftover fields whose time has passed.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:54 -03:00
Jonathan Corbet 7498469f61 [media] marvell-cam: Allow selection of supported buffer modes
The Marvell camera core can support all three videobuf2 buffer modes, which
is slick, but it also requires that all three modes be built and present,
even though only one is likely to be used.  This patch allows the supported
modes to be selected at configuration time, reducing the footprint of the
driver.  Prior to this patch, the MMP camera driver looked like this:

mmp_camera             19092  0
videobuf2_core         15542  1 mmp_camera
videobuf2_dma_sg        3173  1 mmp_camera
videobuf2_dma_contig     2188  1 mmp_camera
videobuf2_vmalloc       1718  1 mmp_camera
videobuf2_memops        2100  3 videobuf2_dma_sg,videobuf2_dma_contig,videobuf2_vmalloc

Afterward, instead, with scatter/gather only configured:

mmp_camera             16021  0
videobuf2_core         15542  1 mmp_camera
videobuf2_dma_sg        3173  1 mmp_camera
videobuf2_memops        2100  1 videobuf2_dma_sg

The total goes from 43,813 bytes to 36,836.

The emphasis has been on simplicity and minimal #ifdef use rather than on
squeezing out every possible byte of code.  For configuration, the driver
simply looks at which videobuf2 modes have been configured in and supports
them all; it's simplistic but should be good enough.

The cafe driver is set to support vmalloc and dma-contig; mmp supports only
dma-sg, since that's the only mode that really makes sense to use.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:54 -03:00
Jonathan Corbet 221a8248b9 [media] marvell-cam: power down mmp camera on registration failure
If registration does not work, we don't want to leave the sensor powered on.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:54 -03:00
Jonathan Corbet c9fb8bfaf1 [media] marvell-cam: remove {min,max}_buffers parameters
Somewhere along the way the code stopped actually paying any attention to
them, and I doubt anybody has ever made use of them.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:54 -03:00
Jonathan Corbet d43dae75cc [media] marvell-cam: core code reorganization
This code shows signs of having been mucked with over the last five years
or so; things were kind of mixed up.  This patch reorders functions into a
more rational organization which, with luck, will facilitate making the
buffer modes selectable at configuration time.  Code movement only: no
functional changes here.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:54 -03:00
Jonathan Corbet 983587c821 [media] marvell-cam: delete struct mcam_sio_buffer
This structure got passed over in the videobuf2 conversion; it has no
reason to exist now.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:53 -03:00
Jean Delvare 731884ba61 [media] tea5764: Fix module parameter permissions
The third parameter of module_param is supposed to represent sysfs
file permissions. A value of "1" leads to the following:

$ ls -l /sys/module/radio_tea5764/parameters/
total 0

I am changing it to "0" to align with the other module parameters in
this driver.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Fabio Belavenuto <belavenuto@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:53 -03:00
Carlos Corbacho dbe8740dde [media] Make Compro VideoMate Vista T750F actually work
Based on the work of John Newbigin, Davor Emard and others who contributed
on the mailing lists.

The previous 'support' for this card was a partial merge of John's changes
that, as far as I can tell, never actually got the thing working (no DVB-T,
analog tuner not initialised).

Initialise the analog tuner properly and hook up the DVB tuner and demodulator.

DVB-T and analog now work (though I can't tune every DVB channel, but I think
there's an issue with the aerial and signal boosters here that is causing
me problems).

Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:53 -03:00
Mauro Carvalho Chehab 01434faf6d tda18271c2dd: Fix compilation when module is not selected
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:53 -03:00
Mauro Carvalho Chehab ea4d03d138 [media] tda18271c2dd.h: Don't add the same symbol twice
Should be folded with the next patch when sending upstream

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:52 -03:00
Mauro Carvalho Chehab fd0b0814a4 [media] dvb: don't cause missing symbols for drxk/tda18271c2dd
If those demods are unselected, but a bridge driver requires them,
produce a runtime message, instead of missing symbols.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:52 -03:00
Mauro Carvalho Chehab f165f60d42 [media] drxk: remove a now unused variable
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:51 -03:00
Mauro Carvalho Chehab 8b9456ae04 [media] em28xx: Change firmware name for Terratec H5 DRX-K
Use a name convention for the firmware file that matches on the
current firmware namespacing. Also, add it to the firmware
download script.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:51 -03:00
Mauro Carvalho Chehab 5eee2bb270 [media] drxk: Add a fallback method for QAM parameter setting
The QAM standard is set using this scu_command:
	SCU_RAM_COMMAND_STANDARD_QAM |
	SCU_RAM_COMMAND_CMD_DEMOD_SET_PARAM

The driver implements a version that has 4 parameters, however,
Terratec H5 needs to break this into two separate commands, otherwise,
DVB-C doesn't work.

With this fix, scan is now properly working and getting the
channel list:
>>> tune to: 609000000:INVERSION_AUTO:5217000:FEC_3_4:QAM_256
>>> tuning status == 0x00
>>> tuning status == 0x07
>>> tuning status == 0x1f

0x0093 0x0026: pmt_pid 0x0758 (null) -- SporTV2 (running, scrambled)
0x0093 0x0027: pmt_pid 0x0748 (null) -- SporTV (running, scrambled)
0x0093 0x0036: pmt_pid 0x0768 (null) -- FX (running, scrambled)
0x0093 0x0052: pmt_pid 0x0788 (null) -- The History Channel (running, scrambled)

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:51 -03:00
Mauro Carvalho Chehab 7558977a4a [media] drxk: Improve the scu_command error message
Now, it outputs:

[10927.639641] drxk: SCU_RESULT_INVPAR while sending cmd 0x0203 with params:
[10927.646283] drxk: 02 00 00 00 10 00 07 00 03 02                    ..........

Better than ERROR -3. This happens with Terratec H5 firmware.

It adds 2 new error conditions, and something useful to track
what the heck is that.

I suspect that the scu_command is dependent on the firmware
revision.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:51 -03:00
Mauro Carvalho Chehab f1b829704c [media] drxk: Simplify the DVB-C set mode logic
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:50 -03:00
Mauro Carvalho Chehab cf694b141e [media] drxk: Fix driver removal
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:50 -03:00
Mauro Carvalho Chehab 90796acad0 [media] drxk: Improves the UIO handling
The driver is too limited: it assumes that UIO is used only for
controlling the antenna, and that only UIO-1 is in usage. However,
from Terratec H7 driver [1], 3 UIO's can be used. In fact, it seems
that H7 needs to use all 3. So, make the code generic enough to handle
the most complex scenario. For now, only antena GPIO can be specified,
but is is easier now to add the other GPIO/UIO needs.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:50 -03:00
Mauro Carvalho Chehab 9c6e182800 [media] drxk: Print detected configuration
DRX-K configuration is interesting when writing/testing
new devices. Add an info line showing the discovered info.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:50 -03:00
Mauro Carvalho Chehab 147e110bb6 [media] drxk: Fix the antenna switch logic
Terratec H5 doesn't require to switch mode, but generates
an error due to this logic. Also, GPIO's are board-dependent.

So, add it at the board config struct.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:50 -03:00
Mauro Carvalho Chehab d6a0540577 [media] drxk: change mode before calling the set mode routines
The set mode routines assume that state were changed to the
new mode, otherwise, they'll fail.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:50 -03:00
Mauro Carvalho Chehab be44eb283b [media] drxk: Proper handle/propagate the error codes
This driver is very big and complex. An error happening in the middle
of any initialization may cause the frontend to not work. So, it
needs to properly propagate error codes internally and to userspace.

Also, printing the error codes at the places it happened helps to
discover were's a bug at the code.

Before this change, a do { } while (0) loop and lots of breaks inside
were used to propagate errors. While this works, if there are
loops inside other loops, it could be easy to forget to add another
break, causing the error to not abort the function.

Also, as not all functions were reporting errors, it is hard to
discover why something failed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:49 -03:00
Mauro Carvalho Chehab f1fe1b75d6 [media] drxk: Allow to disable I2C Bridge control switch
On em28xx, tda18271C2 is accessible when the i2c port
is not touched. Touching on it breaks the driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:49 -03:00
Mauro Carvalho Chehab bbc70e647b [media] em28xx-i2c: Add a read after I2C write
All I2C logs we got for em28xx does that. With Terratec H5, at
400MHz speed, it seems that this is required, to avoid having
troubles at the I2C bus.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:49 -03:00
Mauro Carvalho Chehab e4f4f8758b [media] drxk: Add a parameter for the microcode name
The microcode firmware provided on Terratec H5 seems to be
different. Add a parameter to allow specifying a different
firmware per-device.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:49 -03:00
Mauro Carvalho Chehab fec528b77f [media] Add initial support for Terratec H5
Not working yet. There are some fixes at the DRX-K that are needed
for it to work.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:49 -03:00
Mauro Carvalho Chehab 39624f7ee8 [media] drxk: Print an error if firmware is not loaded
If something bad happens during firmware load, an error
should be printed at dmesg.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:49 -03:00
Mauro Carvalho Chehab bcd2ebb760 [media] drxk: Avoid OOPSes if firmware is corrupted
Don't read paste the buffer, if the firmware is corrupted.
Instead, print an error message.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:48 -03:00
Mauro Carvalho Chehab e076c92ed6 [media] drxk: Convert an #ifdef logic as a new config parameter
Instead of using #ifdef I2C_LONG_ADR for some devices, convert
it into a parameter. Terratec H5 logs from the original driver
seems to need this mode.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:48 -03:00
Mauro Carvalho Chehab 0fc55e81d3 [media] drxk: Move I2C address into a config structure
Currently, the only parameter to be configured is the I2C
address. However, Terratec H5 logs shows that it needs a different
setting for some things, and it has its own firmware.

So, move the addr into a config structure, in order to allow adding
the required configuration bits.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:48 -03:00
Mauro Carvalho Chehab 5e66b87840 [media] drxk: remove _0 from read/write routines
The normal 16-bits read routine is called as "Read16_0". This is
due to a flags that could optionally be passed. Yet, on no places
at the code, a flag is passed there.

The same happens with 16-bits write and 32-read/write routines,
and with WriteBlock.

Also, using flags, is an exception: there's no place currently using
flags, except for an #ifdef at WriteBlock.

Rename the function as just "read16", and the one that requires flags,
as "read16_flags".

This helps to see where the flags are used, and also avoid using
CamelCase on Kernel.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:48 -03:00
Mauro Carvalho Chehab 2da6750117 [media] drxk: Add debug printk's
This is a complex driver. Adding support for other devices with drxk
requires to be able to debug it and see where it is failing. So, add
optional printk messages to allow debugging it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:48 -03:00
Mauro Carvalho Chehab f3d40bd099 [media] tda18271c2dd: add tda18271c2dd prefix to the errors
It is hard to identify the origin for those errors without a
prefix to indicate which driver produced them:

[ 1390.220984] i2c_write error
[ 1390.224133] I2C Write error
[ 1391.284202] i2c_read error
[ 1392.288685] i2c_read error

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:48 -03:00
Mauro Carvalho Chehab e0e6ecaf3b [media] drxk: add drxk prefix to the errors
It is hard to identify the origin for those errors without a
prefix to indicate which driver produced them:

[ 1390.220984] i2c_write error
[ 1390.224133] I2C Write error
[ 1391.284202] i2c_read error
[ 1392.288685] i2c_read error

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:47 -03:00
Mauro Carvalho Chehab 28d45a5d29 [media] ddbridge: use linux/io.h, instead of asm/io.h
WARNING: Use #include <linux/io.h> instead of <asm/io.h>
+#include <asm/io.h>

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:46 -03:00
Mauro Carvalho Chehab 805e687434 [media] ddbridge: Avoid duplicated symbol definition
drivers/media/dvb/ddbridge/built-in.o: In function `my_dvb_dmx_ts_card_init':
/home/v4l/v4l/patchwork/drivers/media/dvb/ddbridge/ddbridge-core.c:718: multiple definition of `my_dvb_dmx_ts_card_init'
drivers/media/dvb/ngene/built-in.o:/home/v4l/v4l/patchwork/drivers/media/dvb/ngene/ngene-dvb.c:227: first defined here
drivers/media/dvb/ddbridge/built-in.o: In function `my_dvb_dmxdev_ts_card_init':
/home/v4l/v4l/patchwork/drivers/media/dvb/ddbridge/ddbridge-core.c:737: multiple definition of `my_dvb_dmxdev_ts_card_init'
drivers/media/dvb/ngene/built-in.o:/home/v4l/v4l/patchwork/drivers/media/dvb/ngene/ngene-dvb.c:246: first defined here

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:46 -03:00
Oliver Endriss f876502d9a [media] ddbridge: Allow compiling of the driver
Driver added to Makefile and Kconfig.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:45 -03:00
Oliver Endriss 4f1f310787 [media] ddbridge: Codingstyle fixes
Codingstyle fixes

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:45 -03:00
Ralph Metzler ccad04578f [media] ddbridge: Initial check-in
Driver support for Digital Devices ddbridge-based cards:
Octopus, Octopus mini, Octopus LE, cineS2(v6)
with DuoFlex S2 and/or DuoFlex CT tuners.

Driver was taken from ddbridge-0.6.1.tar.bz2.

Signed-off-by: Ralph Metzler <rmetzler@digitaldevices.de>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:45 -03:00
Mauro Carvalho Chehab 1bd09ddcff [media] drxk: fix warning: ‘status’ may be used uninitialized in this function
One of the problems of the old CHECK_ERROR is that it was hiding
the status parameter. Maybe due to that, on a few places, the return
code might lead to return incorrect status:

drivers/media/dvb/frontends/drxk_hard.c: In function ‘load_microcode.clone.0’:
drivers/media/dvb/frontends/drxk_hard.c:1281: warning: ‘status’ may be used uninitialized in this function
drivers/media/dvb/frontends/drxk_hard.c:1281: note: ‘status’ was declared here
drivers/media/dvb/frontends/drxk_hard.c: In function ‘GetLockStatus’:
drivers/media/dvb/frontends/drxk_hard.c:1792: warning: ‘status’ may be used uninitialized in this function
drivers/media/dvb/frontends/drxk_hard.c: In function ‘Start.clone.7’:
drivers/media/dvb/frontends/drxk_hard.c:1734: warning: ‘status’ may be used uninitialized in this function

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:45 -03:00
Mauro Carvalho Chehab e16cede5a8 [media] drxk: Return -EINVAL if an invalid bandwidth is used
drivers/media/dvb/frontends/drxk_hard.c: In function ‘SetDVBT’:
drivers/media/dvb/frontends/drxk_hard.c:3766: warning: enumeration value ‘BANDWIDTH_5_MHZ’ not handled in switch
drivers/media/dvb/frontends/drxk_hard.c:3766: warning: enumeration value ‘BANDWIDTH_10_MHZ’ not handled in switch
drivers/media/dvb/frontends/drxk_hard.c:3766: warning: enumeration value ‘BANDWIDTH_1_712_MHZ’ not handled in switch

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:45 -03:00
Mauro Carvalho Chehab 469ffe0836 [media] tda18271c2dd: Remove the CHK_ERROR macro
The CHK_ERROR macro does a flow control, violating chapter 12
of the Documentation/CodingStyle. Doing flow controls inside
macros is a bad idea, as it hides what's happening. It also
hides the var "status" with is also a bad idea.

The changes were done by this small perl script:
	my $blk=0;
	while (<>) {
		s/^\s+// if ($blk);
		$f =~ s/\s+$// if ($blk && /^\(/);
		$blk = 1 if (!m/\#/ && m/CHK_ERROR/);
		$blk=0 if ($blk && m/\;/);
		s/\n/ / if ($blk);
		$f.=$_;
	};
	$f=~ s,\n(\t+)CHK_ERROR\((.*)\)\;([^\n]*),\n\1status = \2;\3\n\1if (status < 0)\n\1\tbreak;,g;

	print $f;

And manually fixed.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:44 -03:00
Mauro Carvalho Chehab ea90f011fd [media] drxk: Remove the CHK_ERROR macro
The CHK_ERROR macro does a flow control, violating chapter 12
of the Documentation/CodingStyle. Doing flow controls inside
macros is a bad idea, as it hides what's happening. It also
hides the var "status" with is also a bad idea.

The changes were done by this small perl script:
	my $blk=0;
	while (<>) {
		s /^\s+// if ($blk);
		$f =~ s/\s+$// if ($blk && /^\(/);
		$blk = 1 if (!m/\#/ && m/CHK_ERROR/);
		$blk=0 if ($blk && m/\;/);
		s/\n/ / if ($blk);
		$f.=$_;
	};
	$f=~ s,\n(\t+)CHK_ERROR\((.*)\)\;([^\n]*),\n\1status = \2;\3\n\1if (status < 0)\n\1\tbreak;,g;
	print $f;

And manually fixed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:44 -03:00
Mauro Carvalho Chehab b01fbc10e3 [media] drxd/drxk: Don't export MulDiv32 symbol
/home/v4l/v4l/patchwork/drivers/media/dvb/frontends/drxk_hard.c:181: multiple definition of `MulDiv32'
drivers/media/dvb/frontends/drxd.o:/home/v4l/v4l/patchwork/drivers/media/dvb/frontends/drxd_hard.c:236: first defined here

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:44 -03:00
Oliver Endriss 36e3fc8957 [media] ngene: Strip dummy packets inserted by the driver
As the CI requires a continuous data stream, the driver inserts dummy
packets when necessary. Do not pass these packets to userspace anymore.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:44 -03:00
Oliver Endriss 3b2cfd6e1a [media] ngene: Update for latest cxd2099
Modifications for latest cxd2099.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:44 -03:00
Oliver Endriss a26c1b3e8b [media] ngene: Support DuoFlex CT attached to CineS2 and SaTiX-S2
Support DuoFlex CT with Digital Devices CineS2 and Mystique SaTiX-S2.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:43 -03:00
Oliver Endriss 6c50b666a5 [media] ngene: Fix name of Digital Devices PCIe/miniPCIe
Fix name of Digital Devices PCIe/miniPCIe.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:43 -03:00
Oliver Endriss d9396b8410 [media] ngene: Fix return code if no demux was found
Fix return code if no demux was found (cineS2_probe).

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:43 -03:00
Oliver Endriss 9143a437cc [media] ngene: Codingstyle fixes
Codingstyle fixes

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:43 -03:00
Ralph Metzler 9ca9efb077 [media] ngene: Support Digital Devices DuoFlex CT
Support Digital Devices DuoFlex CT with ngene.

Signed-off-by: Ralph Metzler <rmetzler@digitaldevices.de>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:42 -03:00
Oliver Endriss f678c3b69a [media] DRX-K, TDA18271c2: Add build support
Add both drivers to Makefile and Kconfig.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:41 -03:00
Oliver Endriss ebc7de220b [media] DRX-K: Tons of coding-style fixes
Tons of coding-style fixes

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:41 -03:00
Oliver Endriss 874f6518e7 [media] DRX-K: Shrink size of drxk_map.h
Deleted all unused symbold from drxk_map.h,
which reduced the size from 1.1M to 37K!

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:41 -03:00
Ralph Metzler 43dd07f758 [media] DRX-K: Initial check-in
Driver for the DRX-K DVB-C/T demodulator.

Signed-off-by: Ralph Metzler <rjkm@metzlerbros.de>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:41 -03:00
Oliver Endriss 0fe4462930 [media] tda18271c2dd: Lots of coding-style fixes
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:40 -03:00
Ralph Metzler e8783950f8 [media] tda18271c2dd: Initial check-in
Driver for the NXP TDA18271c2 silicon tuner.

Signed-off-by: Ralph Metzler <rjkm@metzlerbros.de>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:40 -03:00
Mauro Carvalho Chehab ebee4b589f [media] v4l2-ctrls: Fix a merge conflict
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:40 -03:00
Kamil Debski 064f50966e [media] v4l2-ctrl: add codec controls support to the control framework
Add support for the codec controls to the v4l2 control framework.

[mchehab@redhat.com: Fix merge conflicts and removed some hunks that were
 adding blank lines without a good reason]
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:40 -03:00
Sakari Ailus 13abadad17 [media] adp1653: Add driver for LED flash controller
This patch adds the driver for the adp1653 LED flash controller. This
controller supports a high power led in flash and torch modes and an
indicator light, sometimes also called privacy light.

The adp1653 is used on the Nokia N900.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Tuukka Toivonen <tuukkat76@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: David Cohen <dacohen@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:39 -03:00
Sakari Ailus 0b159acdd5 [media] v4l: Add a class and a set of controls for flash devices
Add a control class and a set of controls to support LED and Xenon flash
devices. An example of such a device is the adp1653.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:39 -03:00
Hans Verkuil b6d17a56c8 [media] vivi: add bitmask test control
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:38 -03:00
Hans Verkuil fa4d7096d1 [media] v4l2-ctrls: add new bitmask control type
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:38 -03:00
Hans Verkuil 1de5be5e91 [media] vivi: Fix sleep-in-atomic-context
Fix sleep-in-atomic-context bug in vivi:

Jun 28 18:14:39 tschai kernel: [   80.970478] BUG: sleeping function called from invalid context at kernel/mutex.c:271
Jun 28 18:14:39 tschai kernel: [   80.970483] in_atomic(): 0, irqs_disabled(): 1, pid: 2854, name: vivi-000
Jun 28 18:14:39 tschai kernel: [   80.970485] INFO: lockdep is turned off.
Jun 28 18:14:39 tschai kernel: [   80.970486] irq event stamp: 0
Jun 28 18:14:39 tschai kernel: [   80.970487] hardirqs last  enabled at (0): [<          (null)>]           (null)
Jun 28 18:14:39 tschai kernel: [   80.970490] hardirqs last disabled at (0): [<ffffffff8109a90b>] copy_process+0x61b/0x1440
Jun 28 18:14:39 tschai kernel: [   80.970495] softirqs last  enabled at (0): [<ffffffff8109a90b>] copy_process+0x61b/0x1440
Jun 28 18:14:39 tschai kernel: [   80.970498] softirqs last disabled at (0): [<          (null)>]           (null)
Jun 28 18:14:39 tschai kernel: [   80.970502] Pid: 2854, comm: vivi-000 Tainted: P            3.0.0-rc1-tschai #372
Jun 28 18:14:39 tschai kernel: [   80.970504] Call Trace:
Jun 28 18:14:39 tschai kernel: [   80.970509]  [<ffffffff81089be3>] __might_sleep+0xf3/0x130
Jun 28 18:14:39 tschai kernel: [   80.970512]  [<ffffffff8176967f>] mutex_lock_nested+0x2f/0x60
Jun 28 18:14:39 tschai kernel: [   80.970517]  [<ffffffffa0acee3e>] vivi_fillbuff+0x20e/0x3f0 [vivi]
Jun 28 18:14:39 tschai kernel: [   80.970520]  [<ffffffff81407004>] ? do_raw_spin_lock+0x54/0x150
Jun 28 18:14:39 tschai kernel: [   80.970524]  [<ffffffff8104ef5e>] ? read_tsc+0xe/0x20
Jun 28 18:14:39 tschai kernel: [   80.970528]  [<ffffffff810c9d87>] ? getnstimeofday+0x57/0xe0
Jun 28 18:14:39 tschai kernel: [   80.970531]  [<ffffffffa0acf1b1>] vivi_thread+0x191/0x2f0 [vivi]
Jun 28 18:14:39 tschai kernel: [   80.970534]  [<ffffffff81093aa0>] ? try_to_wake_up+0x2d0/0x2d0
Jun 28 18:14:39 tschai kernel: [   80.970537]  [<ffffffffa0acf020>] ? vivi_fillbuff+0x3f0/0x3f0 [vivi]
Jun 28 18:14:39 tschai kernel: [   80.970541]  [<ffffffff810bff46>] kthread+0xb6/0xc0
Jun 28 18:14:39 tschai kernel: [   80.970544]  [<ffffffff817743e4>] kernel_thread_helper+0x4/0x10
Jun 28 18:14:39 tschai kernel: [   80.970547]  [<ffffffff8176b4d4>] ? retint_restore_args+0x13/0x13
Jun 28 18:14:39 tschai kernel: [   80.970550]  [<ffffffff810bfe90>] ? __init_kthread_worker+0x70/0x70
Jun 28 18:14:39 tschai kernel: [   80.970552]  [<ffffffff817743e0>] ? gs_change+0x13/0x13

This bug was introduced in 2.6.39.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:38 -03:00
Hans Verkuil 639884a6d9 [media] v4l2-ctrls: always send an event if a control changed implicitly
By default no control events are sent to the application that caused the
control value or flags change (i.e. the control(s) passed to VIDIOC_S_CTRL
or VIDIOC_S_EXT_CTRLS). But if a change in one control causes a change in
another control that was not part of the control(s) in VIDIOC_S_CTRL or
S_EXT_CTRLS, then the application should be notified.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:38 -03:00
Hans Verkuil adf41b9bc3 [media] v4l2-ctrls.c: copy-and-paste error: user_to_new -> new_to_user
The new values were never copied to userspace due to this copy and paste
error. This was introduced during the rewrite of this part of the code in
commit 3219f8a362640b7e4b7e2187b1094c4e46d85aa0.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:37 -03:00
Hans de Goede e3aec98c1d [media] pwc: clean-up header files
Remove unused pwc-ioctl.h (the copy in include/media is used everywhere)
Remove almost empty pwc-uncompress.h, move single define to pwc.h

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:37 -03:00
Hans de Goede 51886df0ca [media] pwc: Enable power-management by default on tested models
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:55:37 -03:00
Hans de Goede 294e289602 [media] pwc: Add v4l2 controls for pan/tilt on Logitech QuickCam Orbit/Sphere
This makes the API for this:
1) v4l2 spec compliant
2) match that of the UVC Logitech QuickCam Sphere models

For now this operates in parellel to the sysfs interface for this, but the
intend is to deprecate the sysfs interface and remove it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:45 -03:00
Hans de Goede c11271349a [media] pwc: Allow dqbuf / read to complete while waiting for controls
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:45 -03:00
Hans de Goede 6c9cac89c0 [media] pwc: Replace control code with v4l2-ctrls framework
Also remove all the converting from native range to 0-65535 and back
that was going on. This is no longer needed now that we no longer support
v4l1.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:45 -03:00
Hans de Goede 04613c5e60 [media] pwc: properly allocate dma-able memory for ISO buffers
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:44 -03:00
Hans de Goede 4fba471e40 [media] pwc: Allow multiple opens
Allow multiple opens of the /dev/video node so that control panel apps
can be open to-gether with streaming apps.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:44 -03:00
Hans de Goede 6eba93573d [media] pwc: Move various initialization to driver load and / or stream start
Doing a bunch of initialization every time /dev/video is opened, and thus
for example when the udev rules probe for capabilities makes no sense,
do it at driver load, resp. stream start instead.

This is a preparation patch for allowing multiple opens of the /dev/video
node.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:44 -03:00
Hans de Goede 3b4d0ec791 [media] pwc: Make power-saving a per device option
as vcinterface must be set before calling pwc_camera_power()

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:44 -03:00
Hans de Goede 52a9254750 [media] pwc: Remove some unused PWC_INT_PIPE left overs
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:43 -03:00
Hans de Goede b824bb4b12 [media] pwc: Get rid of error_status and unplugged variables
Having 2 ways of tracking disconnection is too much, remove both and
instead simply set pdev->udev to NULL on disconnect. Also check for
pdev->udev being NULL in all possible entry paths.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:43 -03:00
Hans de Goede 1a4ede65f3 [media] pwc: Fix non CodingStyle compliant 3 space indent in pwc.h
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:43 -03:00
Hans de Goede 885fe18f55 [media] pwc: Replace private buffer management code with videobuf2
Looking at the pwc buffer management code has made it clear to me it needed
some serious fixing. Not only was there a ton of code duplication even
internally to pwc (read and mmap wait for frame code was duplicated), the
code also was outright buggy. With the worst offender being dqbuf, which
just round robin returned all the mmap buffers, without paying any attention
to them being queued by the app with qbuf or not. And qbuf itself was a noop.

So I set out to fix this and already had some cleanups in place when
I read Jonathan Corbet's lwn article on videobuf2, this inspired me to just
rip out the buffer management code and replace it with videobuf2, greatly
reducing the amount of code, and fixing all bugs in one go:

Many thanks to Jonathan for the timely article on this !

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:43 -03:00
Hans de Goede 5f40d91552 [media] pwc: remove __cplusplus guards from private header
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:43 -03:00
Hans de Goede c246412117 [media] pwc: Remove a bunch of bogus sanity checks / don't return EFAULT wrongly
The chances if any of these becoming NULL magically are 0% And if they
do become NULL oopsing is the right thing to do (so that the user logs a
bug with the kernel rather then with whatever app he was using).

Returning EFAULT to userspace should only be done when userspace supplies
a bad address, not on driver bugs / hw issues, so in the few cases where the
check is not bogus return something else.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:42 -03:00
Hans de Goede e7d712cc99 [media] gspca: s/strncpy/strlcpy/
Just like in userspace strncpy does not guarantee 0 termination. Use strlcpy
instead which does guarantee 0 termination.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:42 -03:00
Hans de Goede 2f2ea0f3f2 [media] gspca_sunplus: Fix streaming on logitech quicksmart 420
Don't issue a stream stop to the camera at the end of sd_start, this fixes
streaming with this particular model.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:42 -03:00
Hans de Goede c27cea03e7 [media] gspca: Add new se401 camera driver
Based on the old v4l1 camera by Jeroen Vreeken driver which recently got
removed from the kernel.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:41 -03:00
Hans de Goede fa4376d28e [media] gspca: reset image_len to 0 on LAST_PACKET when discarding frame
Reset image and image_len to NULL/0 on LAST_PACKET when we're in discard
frame mode, just like we do when not discarding the current frame.

The new se401 driver uses image_len for SOF/EOF detection and thus depends on
this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:39 -03:00
Jean-François Moine 0fdee88e54 [media] gspca - ov519: Fix a LED inversion
In the webcam 041e:405f, the LED is inverted.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:39 -03:00
Jean-François Moine b877a9a7fb [media] gspca - ov519: Fix sensor detection problems
The sensor of some webcams could not be detected due to timing problems
in sensor register reading. This patch adds bridge register readings
before sensor register reading.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:38 -03:00
Stefan Richter 686a9488cd [media] firedtv: change some -EFAULT returns to more fitting error codes
Mauro Carvalho Chehab wrote:
> I'm validating if all drivers are behaving equally with respect to the
> error codes returned to userspace, and double-checking with the API.
>
> On almost all places, -EFAULT code is used only to indicate when
> copy_from_user/copy_to_user fails. However, firedtv uses a lot of
> -EFAULT, where it seems to me that other error codes should be used
> instead (like -EIO for bus transfer errors and -EINVAL/-ERANGE for
> invalid/out of range parameters).

This concerns only the CI (CAM) related code of firedtv of which I know
little.  Let's just pass through the error returns of lower level I/O
code where applicable, and -EACCES (permission denied) when a seemingly
valid but negative FCP response or an unknown-to-firedtv CA message is
received.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Henrik Kurelid <henrik@kurelid.se>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:38 -03:00
Mauro Carvalho Chehab 7a286cc188 [media] return -ENOTTY for unsupported ioctl's at legacy drivers
Those drivers are not relying at the V4L2 core to handle the ioctl's.
So, we need to manually patch them every time a change goes to the
core.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-By: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:38 -03:00
Mauro Carvalho Chehab 9190d191b1 [media] v4l2 core: return -ENOTTY if an ioctl doesn't exist
Currently, -EINVAL is used to return either when an IOCTL is not
implemented, or if the ioctl was not implemented.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:38 -03:00
Mauro Carvalho Chehab 16d6c0b02c [media] dvb-bt8xx: Don't return -EFAULT when a device is not found
When a device (or their PCI structs) are not found, the error should
be -ENODEV. -EFAULT is reserved for errors while copying arguments
from/to userspace.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:37 -03:00
Mauro Carvalho Chehab 7464aa50c6 [media] nxt6000: i2c bus error should return -EIO
data from/to userspace. Don't mix it with I2C bus error (-EIO).

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:37 -03:00
Mauro Carvalho Chehab d316b5fba3 [media] siano: bad parameter is -EINVAL and not -EFAULT
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:36 -03:00
Jonathan Corbet 28720944d8 [media] marvell-cam: use S/G DMA by default
Scatter/gather DMA mode works nicely on this platform and is clearly the
best way of doing things.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:35 -03:00
Jonathan Corbet cbc4f3a277 [media] marvell-cam: Working s/g DMA
The core Marvell camera driver can now do scatter/gather DMA on controllers
which support that functionality.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:35 -03:00
Hans Verkuil 60c0732244 [media] v4l2-ctrls.c: add support for V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK
Normally no control events will go to the filehandle that called the
VIDIOC_S_CTRL/VIDIOC_S_EXT_CTRLS ioctls. This is to prevent a feedback
loop.

This can now be overridden by setting the new V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK
flag.

Based on suggestions from Mauro Carvalho Chehab <mchehab@redhat.com> and
Laurent Pinchart <laurent.pinchart@ideasonboard.com>.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:34 -03:00
Hans Verkuil 3f66f0ed31 [media] v4l2-ctrls/v4l2-events: small coding style cleanups
Thanks to Laurent Pinchart <laurent.pinchart@ideasonboard.com>.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:34 -03:00
Hans Verkuil 71c6c4c918 [media] v4l2-ctrls: v4l2_ctrl_handler_setup code simplification
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:32 -03:00
Hans Verkuil e64025850d [media] v4l2-ctrls: split try_or_set_ext_ctrls()
Split try_or_set_ext_ctrls() into a validate_ctrls() part ('Phase 1')
and merge the second part ('Phase 2') into try_set_ext_ctrls().

This makes a lot more sense and it also does the validation before
trying to try/set the controls.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:32 -03:00
Hans Verkuil eb5b16efb2 [media] v4l2-ctrls: improve discovery of controls of the same cluster
The implementation of VIDIOC_G/S/TRY_EXT_CTRLS in the control framework has
to figure out which controls in the control list belong to the same cluster.
Since controls belonging to the same cluster need to be handled as a unit,
this is important information.

It did that by going over the controls in the list and for each control that
belonged to a multi-control cluster it would walk the remainder of the list
to try and find controls that belong to that same cluster.

This approach has two disadvantages:

1) it was a potentially quadratic algorithm (although highly unlikely that
it would ever be that bad in practice).
2) it took place with the control handler's lock held.

Since we want to make it possible in the future to change control values
from interrupt context, doing a lot of work while holding a lock is not a
good idea.

In the new code the algorithm is no longer quadratic but linear in the
number of controls in the list. Also, it now can be done beforehand.

Another change that was made was to so the try and set at the same time.
Before when S_TRY_EXT_CTRLS was called it would 'try' the controls first,
and then it would 'set' them. The idea was that any 'try' errors would
prevent the 'set' from happening, thus avoiding having partially set
control lists.

However, this caused more problems than it solved because between the 'try'
and the 'set' changes might have happened, so it had to try a second time,
and since actual controls with a try_ctrl op are very rare (and those that
we have just adjust values and do not return an error), I've decided to
drop that two-stage approach and just combine try and set.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:31 -03:00
Hans Verkuil c12fcfd676 [media] v4l2-ctrls: don't initially set CH_VALUE for write-only controls
When sending the SEND_INITIAL event for write-only controls the
V4L2_EVENT_CTRL_CH_VALUE flag should not be set. It's meaningless.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:31 -03:00
Hans Verkuil 2151bdc887 [media] v4l2-event: add optional merge and replace callbacks
When the event queue for a subscribed event is full, then the oldest
event is dropped. It would be nice if the contents of that oldest
event could be merged with the next-oldest. That way no information is
lost, only intermediate steps are lost.

This patch adds optional replace() (called when only one kevent was allocated)
and merge() (called when more than one kevent was allocated) callbacks that
will be called to do this job.

These two callbacks are implemented for the V4L2_EVENT_CTRL event.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:31 -03:00
Hans Verkuil f1e393de38 [media] v4l2-event/ctrls/fh: allocate events per fh and per type instead of just per-fh
The driver had to decide how many events to allocate when the v4l2_fh struct
was created. It was possible to add more events afterwards, but there was no
way to ensure that you wouldn't miss important events if the event queue
would fill up for that filehandle.

In addition, once there were no more free events, any new events were simply
dropped on the floor.

For the control event in particular this made life very difficult since
control status/value changes could just be missed if the number of allocated
events and the speed at which the application read events was too low to keep
up with the number of generated events. The application would have no idea
what the latest state was for a control since it could have missed the latest
control change.

So this patch makes some major changes in how events are allocated. Instead
of allocating events per-filehandle they are now allocated when subscribing an
event. So for that particular event type N events (determined by the driver)
are allocated. Those events are reserved for that particular event type.
This ensures that you will not miss events for a particular type altogether.

In addition, if there are N events in use and a new event is raised, then
the oldest event is dropped and the new one is added. So the latest event
is always available.

This can be further improved by adding the ability to merge the state of
two events together, ensuring that no data is lost at all. This will be
added in the next patch.

This also makes it possible to allow the user to determine the number of
events that will be allocated. This is not implemented at the moment, but
would be trivial.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:31 -03:00
Hans Verkuil 77068d36d8 [media] v4l2-ctrls/event: remove struct v4l2_ctrl_fh, instead use v4l2_subscribed_event
The v4l2_ctrl_fh struct connected v4l2_ctrl with v4l2_fh so the control
would know which filehandles subscribed to it. However, it is much easier
to use struct v4l2_subscribed_event directly for that and get rid of that
intermediate struct.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:31 -03:00
Hans Verkuil 523f46d6ab [media] v4l2-events/fh: merge v4l2_events into v4l2_fh
Drivers that supported events used to be rare, but now that controls can also
raise events this will become much more common since almost all drivers have
controls.

This means that keeping struct v4l2_events as a separate struct make no more
sense. Merging it into struct v4l2_fh simplifies things substantially as it
is now an integral part of the filehandle struct.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:31 -03:00
Andrew Chew 95904d4b6a [media] V4L: ov9740: Add suspend/resume
On suspend, remember whether we are streaming or not, and at what frame format,
so that on resume, we can start streaming again.

Signed-off-by: Andrew Chew <achew@nvidia.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:30 -03:00
Andrew Chew e29c9bfb38 [media] V4L: ov9740: Reorder video and core ops
This is to avoid needing a forward declaration when ov9740_s_power() (in the
subsequent patch) calls ov9740_s_fmt().

Signed-off-by: Andrew Chew <achew@nvidia.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:29 -03:00
Andrew Chew 970aa9e04e [media] V4L: ov9740: Remove hardcoded resolution regs
Derive resolution-dependent register settings programmatically.

Signed-off-by: Andrew Chew <achew@nvidia.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:27 -03:00
Andrew Chew c4fdce5696 [media] V4L: ov9740: Fixed some settings
Based on vendor feedback, should issue a software reset at start of day.

Also, OV9740_ANALOG_CTRL15 needs to be changed so the sensor does not begin
streaming until it is ready (otherwise, results in a nonsense frame for the
initial frame).

Added a comment on using discontinuous clock.

Finally, OV9740_ISP_CTRL19 needs to be changed to really use YUYV ordering
(the previous value was for VYUY).

Signed-off-by: Andrew Chew <achew@nvidia.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:27 -03:00
Andrew Chew 5fec8b9002 [media] V4L: ov9740: Correct print in ov9740_reg_rmw()
The register width of the ov9740 is 16-bits, so correct the debug print
to reflect this.

Signed-off-by: Andrew Chew <achew@nvidia.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:25 -03:00
Andrew Chew c6aac9fcdd [media] V4L: ov9740: Cleanup hex casing inconsistencies
Made all hex number casing use lower-case throughout the entire driver
for consistency.

Signed-off-by: Andrew Chew <achew@nvidia.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:24 -03:00
Josh Wu 195ebc43bf [media] V4L: at91: add Atmel Image Sensor Interface (ISI) support
This patch is to enable Atmel Image Sensor Interface (ISI) driver support.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:23 -03:00
Guennadi Liakhovetski 8318a64b89 [media] V4L: soc-camera: remove several now unused soc-camera client operations
This patch removes .enum_input(), .suspend() and .resume() soc-camera
client operations.

Functionality, provided by .enum_input(), if needed, can be implemented
using the v4l2-subdev API.

As for .suspend() and .resume(), the only client driver, implementing
these methods has been mt9m111, and the only host driver, using them
has been pxa-camera. Now that both those drivers have been converted
to the standard subdev .s_power() operation, .suspend() and .resume()
can be removed.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:23 -03:00
Guennadi Liakhovetski 14c5ea9bb4 [media] V4L: mt9m111: switch to v4l2-subdev .s_power() method
Eliminate soc-camera specific .suspend() and .restore() methods in favour
of the standard v4l2-subdev .s_power() method

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:22 -03:00
Guennadi Liakhovetski 2768cbbba3 [media] V4L: mt9m111: propagate higher level abstraction down in functions
It is more convenient to propagate the higher level abstraction - the
struct mt9m111 object into functions and then retrieve a pointer to
the i2c client, if needed, than to do the reverse.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:22 -03:00
Guennadi Liakhovetski 4df4ada936 [media] V4L: tw9910: remove bogus ENUMINPUT implementation
tw9910 is a TV decoder, it doesn't have a tuner. Besides, the
.enum_input soc-camera operation is optional and normally not needed.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:22 -03:00
Guennadi Liakhovetski ff391d71bc [media] V4L: sh_mobile_ceu_camera: remove redundant calculations
soc_camera core now performs the standard .bytesperline and .sizeimage
calculations internally, no need to duplicate in drivers.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:22 -03:00
Guennadi Liakhovetski 28281a71eb [media] V4L: mx2_camera: .try_fmt shouldn't fail
If the user is requesting too large a frame, instead of failing
select an acceptable geometry, preserving the requested aspect ratio.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:22 -03:00
Guennadi Liakhovetski 497833c681 [media] V4L: pxa-camera: switch to using subdev .s_power() core operation
soc-camera specific .suspend() and .resume() methods are deprecated
and should be replaced by the subdev standard .s_power() operation.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:21 -03:00
Guennadi Liakhovetski 91401219c0 [media] V4L: pxa-camera: try to force progressive video format
The pxa-camera driver only supports progressive video so far. Passing
down to the client the same format, as what the user has requested can
result in interlaced video, even if the client supports both. This
patch avoids such cases.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:21 -03:00
Guennadi Liakhovetski a5c1cee0e6 [media] V4L: pxa_camera: remove redundant calculations
soc_camera core now performs the standard .bytesperline and .sizeimage
calculations internally, no need to duplicate in drivers.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:21 -03:00
Guennadi Liakhovetski 6523208758 [media] V4L: mx3_camera: remove redundant calculations
soc_camera core now performs the standard .bytesperline and .sizeimage
calculations internally, no need to duplicate in drivers.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:21 -03:00
Hans Verkuil 82a7c04944 [media] v4l2-ctrls: make manual_mode_value 8 bits and check against control range
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:21 -03:00
Hans Verkuil 2330fb8242 [media] v4l2-compat-ioctl32: add VIDIOC_DQEVENT support
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:20 -03:00
Hans Verkuil 5138870d68 [media] ivtv: add control event support
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:20 -03:00
Hans Verkuil c7a52f8dce [media] vivi: support control events
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:20 -03:00
Hans Verkuil ce7275747b [media] v4l2-ctrls: simplify event subscription
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:20 -03:00
Hans Verkuil 6e239399e5 [media] v4l2-ctrls: add control events
Whenever a control changes value or state an event is sent to anyone
that subscribed to it.

This functionality is useful for control panels but also for applications
that need to wait for (usually status) controls to change value.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:20 -03:00
Hans Verkuil ab892bac84 [media] v4l2-ctrls: add v4l2_fh pointer to the set control functions
When an application changes a control you want to generate an event.
However, you want to avoid sending such an event back to the application
(file handle) that caused the change.

Add the filehandle to the various set control functions.

The filehandle isn't used yet, but the control event patches will need
this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:19 -03:00
Hans Verkuil a1c894fba3 [media] vivi: add autogain/gain support to test the autocluster functionality
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:19 -03:00
Hans Verkuil 72d877cac0 [media] v4l2-ctrls: add v4l2_ctrl_auto_cluster to simplify autogain/gain scenarios
It is a bit tricky to handle autogain/gain type scenerios correctly. Such
controls need to be clustered and the V4L2_CTRL_FLAG_UPDATE should be set on
the autofoo controls. In addition, the manual controls should be marked
inactive when the automatic mode is on, and active when the manual mode is on.
This also requires specialized volatile handling.

The chances of drivers doing all these things correctly are pretty remote.
So a new v4l2_ctrl_auto_cluster function was added that takes care of these
issues.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:18 -03:00
Hans Verkuil ddac5c1079 [media] v4l2-ctrls: fix and improve volatile control handling
If you have a cluster of controls that is a mix of volatile and non-volatile
controls, then requesting the value of the volatile control would fail if the
master control of that cluster was non-volatile. The code assumed that the
volatile state of the master control was the same for all other controls in
the cluster.

This is now fixed.

In addition, it was clear from bugs in some drivers that it was confusing that
the ctrl->cur union had to be used in g_volatile_ctrl. Several drivers used the
'new' values instead. The framework was changed so that drivers now set the new
value instead of the current value.

This has an additional benefit as well: the volatile values are now only stored
in the 'new' value, leaving the current value alone. This is useful for
autofoo/foo control clusters where you want to have a 'foo' control act like a
volatile control if 'autofoo' is on, but as a normal control when it is off.

Since with this change the cur value is no longer overwritten when g_volatile_ctrl
is called, you can use it to remember the original 'foo' value. For example:

autofoo = 0, foo = 10 and foo is non-volatile.

Now autofoo is set to 1 and foo is marked volatile. Retrieving the foo value
will get the volatile value. Set autofoo back to 0, which marks foo as non-
volatile again, and retrieving foo will get the old current value of 10.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:17 -03:00
Hans Verkuil 18d171badf [media] v4l2-subdev: implement per-filehandle control handlers
To be consistent with v4l2-ioctl.c.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:17 -03:00
Hans Verkuil 2d28b686ad [media] v4l2-ioctl: add ctrl_handler to v4l2_fh
This is required to implement control events and is also needed to allow
for per-filehandle control handlers.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:17 -03:00
Hans Verkuil 7ebbc39fa0 [media] v4l2-ctrls: drivers should be able to ignore the READ_ONLY flag
When applications try to set READ_ONLY controls an error should
be returned. However, when drivers do that it should be accepted.

Those controls could reflect some driver status which the application
can't change but the driver obviously has to be able to change it.

This is needed among others for future HDMI status controls.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:17 -03:00
Hans Verkuil 37cd3b7368 [media] v4l2-ctrls: simplify error_idx handling
The lower-level prepare functions just set error_idx for each control that
might have an error. The high-level functions will override this with
cs->count in the get and set cases. Only try will keep the error_idx.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:16 -03:00
Hans Verkuil 54c911eb91 [media] v4l2-ctrls: introduce call_op define
Add the call_op define to safely call the control ops. This also allows
for controls without any ops such as the 'control class' controls.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:16 -03:00
Mauro Carvalho Chehab 29834c1ac7 [media] radio: Use the subsystem version control for VIDIOC_QUERYCAP
Just like the video drivers, the right thing to do is to use
the per-subsystem version control.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:16 -03:00
Mauro Carvalho Chehab 64dc3c1a90 [media] Stop using linux/version.h on the remaining video drivers
Standardize the remaining video drivers to return the API version
for the VIDIOC_QUERYCAP version, instead of a per-driver version.

Those drivers had the version updated more recently or are SoC
drivers. Even so, it doesn't sound a good idea to keep a per-driver
version control, so, let's use the per-subsystem version control
instead.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:16 -03:00
Mauro Carvalho Chehab b0eaab7657 [media] gspca: don't include linux/version.h
Instead of handling a per-driver driver version, use the
per-subsystem one.

As reviewed by Jean-Francois Moine <moinejf@free.fr>:
	- the 'info' may be simplified:

Reviewed-by: Jean-Francois Moine <moinejf@free.fr>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:15 -03:00
Mauro Carvalho Chehab fd3e582482 [media] uvcvideo: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
uvcvideo doesn't use vidioc_ioctl2. As the API is changing to use
a common version for all drivers, we need to expliticly fix this
driver.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:15 -03:00
Mauro Carvalho Chehab 6c13b45e57 [media] sn9c102: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
sn9c102 doesn't use vidioc_ioctl2. As the API is changing to use
a common version for all drivers, we need to expliticly fix this
driver.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:15 -03:00
Mauro Carvalho Chehab 083774d8b1 [media] pvrusb2: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
pvrusb2 doesn't use vidioc_ioctl2. As the API is changing to use
a common version for all drivers, we need to expliticly fix this
driver.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:15 -03:00
Mauro Carvalho Chehab 5204cebadd [media] et61x251: Use LINUX_VERSION_CODE for VIDIOC_QUERYCAP
et61x251 doesn't use vidioc_ioctl2. As the API is changing to use
a common version for all drivers, we need to expliticly fix this
driver.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:15 -03:00
Mauro Carvalho Chehab 3c2d464ee8 [media] ivtv,cx18: Use default version control for VIDIOC_QUERYCAP
After discussing with Andy Walls on irc, we've agreed that this
is the best thing to do. No regressions will be introduced, as 3.x.y
is greater then the current versions for cx18 and ivtv.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:14 -03:00
Mauro Carvalho Chehab 880c35c585 [media] pwc: Use the default version for VIDIOC_QUERYCAP
After discussing with Hans, change pwc to use the default version
control.

The only version ever used for pwc driver is 10.0.12, due to
commit 2b455db6d4.

Changing it to 3.x.y won't conflict with the old version.
There's no namespace conflicts in any predictable future.

Even on the remote far-away case where we might have a conflict,
it will be on just one specific stable Kernel release (Kernel 10.0.12),
if we ever have such stable release.

So, it is safe and consistent on using 3.x.y numering schema for
it.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:12 -03:00
Mauro Carvalho Chehab 1990d50b58 [media] Stop using linux/version.h on most video drivers
All the modified drivers didn't have any version increment since
Jan, 1 2011. Several of them didn't have any version increment
for a long time, even having new features and important bug fixes
happening.

As we're now filling the QUERYCAP version with the current Kernel
Release, we don't need to maintain a per-driver version control
anymore. So, let's just use the default.

In order to preserve the Kernel module version history, a
KERNEL_VERSION() macro were added to all modified drivers, and
the extraver number were incremented.

I opted to preserve the per-driver version control to a few
pwc, pvrusb2, s2255, s5p-fimc and sh_vou.

A few drivers are still using the legacy way to handle ioctl's.
So, we can't do such change on them, otherwise, they'll break.
Those are: uvc, et61x251 and sn9c102.

The rationale is that the per-driver version control seems to be
actively maintained on those.

Yet, I think that the better for them would be to just use the
default version numbering, instead of doing that by themselves.

While here, removed a few uneeded include linux/version.h

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:12 -03:00
Mauro Carvalho Chehab d35ebf9558 [media] drxd, siano: Remove unused include linux/version.h
Both drxd and siano drivers were including linux/version.h without
any reason. Probably, this is due to some compatibility code that
used to exist before having their support added into the Linux
Kernel.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:12 -03:00
Mauro Carvalho Chehab ae6db51546 [media] v4l2-ioctl: Add a default value for kernel version
Most drivers don't increase kernel versions as newer features are added or
bug fixes are solved. So, vidioc_querycap returned value for cap->version is
meaningless. Instead of keeping this situation forever, let's add a default
value matching the current Linux version.

Drivers that want to keep their own version control can still do it, as they
can override the default value for cap->version.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:12 -03:00
Jonathan Corbet a9b36e8507 [media] marvell-cam: implement contiguous DMA operation
The core driver can now operate in either vmalloc or dma-contig modes;
obviously the latter is preferable when it is supported.  Default is
currently vmalloc on all platforms; load the module with buffer_mode=1 for
contiguous DMA mode.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:11 -03:00
Jonathan Corbet 6c895d548c [media] marvell-cam: Don't spam the logs on frame loss
The sequence numbers already give that information if user space cares;
this is a frequent occurrence on slower machines, alas.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:11 -03:00
Jonathan Corbet 9d48a51c27 [media] marvell-cam: no need to initialize the DMA buffers
This was an old debugging thing from years ago.  It's only done at
initialization time, but it's still unnecessary; take it out.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:11 -03:00
Jonathan Corbet 362d45b23d [media] marvell-cam: include file cleanup
Put the includes into a slightly more readable ordering and get rid of a
few unneeded ones.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:11 -03:00
Jonathan Corbet b5210fd2c7 [media] marvell-cam: convert to videobuf2
This is a basic, naive conversion to the videobuf2 infrastructure, removing
a lot of code in the process.  For now, we're using vmalloc, which is
suboptimal, but it does match what the cafe driver did before.  In the cafe
case, it may have to stay that way just because memory is too tight to do
direct streaming; mmp-camera will be able to do better.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:11 -03:00
Manjunath Hadli 6783edbc83 [media] davinci vpbe: Build infrastructure for VPBE driver
This patch adds the build infra-structure for Davinci
VPBE dislay driver.

Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Acked-by: Muralidharan Karicheri <m-karicheri2@ti.com>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:10 -03:00
Manjunath Hadli 606b69e9b9 [media] davinci vpbe: VENC( Video Encoder) implementation
This patch adds the VENC or the Video encoder, which is responsible
for the blending of all source planes and timing generation for Video
modes like NTSC, PAL and other digital outputs. the VENC implementation
currently supports COMPOSITE and COMPONENT outputs and NTSC and PAL
resolutions through the analog DACs. The venc block is implemented
as a subdevice, allowing for additional external and internal encoders
of other kind to plug-in.

Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Acked-by: Muralidharan Karicheri <m-karicheri2@ti.com>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:10 -03:00
Manjunath Hadli ff0f23dd0e [media] davinci vpbe: OSD(On Screen Display) block
This patch implements the functionality of the OSD block
of the VPBE. The OSD in total supports 4 planes or Video
sources - 2 mainly RGB and 2 Video. The patch implements general
handling of all the planes, with specific emphasis on the Video
plane capabilities as the Video planes are supported through the
V4L2 driver.

Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Acked-by: Muralidharan Karicheri <m-karicheri2@ti.com>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:10 -03:00
Manjunath Hadli 66715cdc32 [media] davinci vpbe: VPBE display driver
This patch implements the core functionality of the display driver,
mainly controlling the VENC and other encoders, and acting as
the one point interface for the main V4L2 driver. This implements
the core of each of the V4L2 IOCTLs.

Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Acked-by: Muralidharan Karicheri <m-karicheri2@ti.com>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:09 -03:00
Manjunath Hadli a2c25b444e [media] davinci vpbe: V4L2 display driver for DM644X SoC
This is the display driver for Texas Instruments's DM644X family
SoC. This patch contains the main implementation of the driver with the
V4L2 interface. The driver implements the streaming model with
support for both kernel allocated buffers and user pointers. It also
implements all of the necessary IOCTLs necessary and supported by the
video display device.

Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Acked-by: Muralidharan Karicheri <m-karicheri2@ti.com>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:09 -03:00
Jiri Slaby 9a78efc8fb [media] DVB: dvb-net, make the kconfig text helpful
Telling the user they can disable an option if they want is not the
much useful. Describe what it is good for instead.

The text was derived from Mauro's email.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Hans Petter Selasky <hselasky@c2i.net>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Hans Petter Selasky <hselasky@c2i.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:09 -03:00
Greg Dietsche 3735edf9fd [media] dvb: remove unnecessary code
remove unnecessary code that matches this coccinelle pattern
	if (...)
		return ret;
	return ret;

Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:09 -03:00
Tejun Heo fe45e2551f [media] dvb-usb/technisat-usb2: don't use flush_scheduled_work()
flush_scheduled_work() is deprecated and scheduled to be removed.
technisat-usb2 already sync-cancels the only work item it uses and
there's no reason for it to call flush_scheduled_work().  Don't use
it.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:08 -03:00
Guennadi Liakhovetski 8c528d5e51 [media] media: DVB_NET must depend on DVB_CORE
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:07 -03:00
Andy Walls 9b3d8eccc3 [media] cx23885: Add IR Rx support for HVR-1270 boards
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:06 -03:00
Peter Moon de8ae0d516 [media] cx231xx: Add support for Hauppauge WinTV USB2-FM
This patch adds support for the "Hauppauge WinTV USB2-FM" Analog TV Stick.
It includes support for both the PAL and NTSC variants of the device.

Signed-off-by: Peter Moon <pomoon@gmail.com>
Reviewed-by: Devin Heitmueller <dheitmueller@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:06 -03:00
Justin P. Mattock c3f305aab4 [media] frontends/s5h1420: Change: clock_settting to clock_setting
Changes clock_settting to clock_setting.

Note: This could be intentionally set this way from the beginning and/or
is a typo.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:05 -03:00
istvan_v@mailbox.hu 79a5b9a2d9 [media] cx88: replaced duplicated code with function call
The following patch replaces code to reset the XC3028 tuner with a call
to the tuner reset callback.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:05 -03:00
istvan_v@mailbox.hu 8eb79c0b9b [media] cx88: added support for Leadtek WinFast DTV1800 H with XC4000 tuner
This patch implements support for the Leadtek WinFast DTV1800 H card with
XC4000 tuner (107d:6f38).

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:05 -03:00
istvan_v@mailbox.hu f271a3affa [media] cx88: added support for Leadtek WinFast DTV2000 H Plus
This patch implements support for the Leadtek WinFast DTV2000 H Plus card
with XC4000 tuner (107d:6f42).

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:05 -03:00
istvan_v@mailbox.hu c21973e8aa [media] cx88: added XC4000 tuner callback and DVB attach functions
Added functions for XC4000 tuner reset and attaching DVB frontend.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:04 -03:00
Mauro Carvalho Chehab 0db15d525d [media] em28xx: Mark Kworld 305 as validated
This board were used for testing the em28xx-alsa using a separate interface.
So, it is obviously validated ;)

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:04 -03:00
Mauro Carvalho Chehab 4f83e7b3ef [media] em28xx: Add support for devices with a separate audio interface
Some devices use a separate interface for the vendor audio class.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:04 -03:00
Mauro Carvalho Chehab dff0f8c279 [media] em28xx-audio: Some Alsa API fixes
Mark the alsa stream with SNDRV_PCM_INFO_BATCH,
as the timing to get audio streams can vary.

Also, add SNDRV_PCM_TRIGGER for pause/release.

while here, fix the stop indicator, to be sure that audio
will be properly released at the stop events.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:04 -03:00
Mauro Carvalho Chehab debb724149 [media] em28xx-audio: Properly report failures to start stream
If the audio stream fails for any reason, it should:
	1) Report an error via dmesg;
	2) Mark internally that the stream didn't started.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:04 -03:00
Mauro Carvalho Chehab 66cb6957d3 [media] em28xx-audio: add debug info for the volume control
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:04 -03:00
Mauro Carvalho Chehab 71d7d83edc [media] em28xx-audio: volumes are inverted
While here, fix volume mask to 5 bits

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:03 -03:00
Mauro Carvalho Chehab 43131a2ca6 [media] em28xx-audio: add support for mute controls
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:03 -03:00
Mauro Carvalho Chehab 850d24a5a8 [media] em28xx-alsa: add mixer support for AC97 volume controls
Export ac97 volume controls via mixer.

Pulseaudio will probably handle it very badly, as it has
no idea about how volumes are wired, and how are they
associated with each TV input. Those wirings are
card model dependent, and we don't have the wiring mappings
for each supported device.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:03 -03:00
Mauro Carvalho Chehab 5b89ecf989 [media] em28xx: Allow to compile it without RC/input support
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:03 -03:00
Mauro Carvalho Chehab 0f8a61fc42 [media] em28xx: Fix a wrong enum at the ac97 control tables
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:03 -03:00
Mauro Carvalho Chehab 00d2e7ad9d [media] em28xx: Don't initialize a var if won't be using it
Fixes most cases of initializing a var but not using it.

There are still 3 cases at em28xx-alsa, were those vars should
probably be used.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:02 -03:00
Jonathan Corbet 67a8dbbc4e [media] marvell-cam: Basic working MMP camera driver
Now we have a camera working over the marvell cam controller core.  It
works like the cafe driver and has all the same limitations, contiguous DMA
only being one of them.  But it's a start.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:01 -03:00
Jonathan Corbet 595a93a47a [media] marvell-cam: Allocate the i2c adapter in the platform driver
The upcoming mmp-camera driver will need an i2c_adapter structure allocated
externally, so change the core adapter to a pointer and require the
platform code to fill it in.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:01 -03:00
Jonathan Corbet 1c68f889c3 [media] marvell-cam: Right-shift i2c slave ID's in the cafe driver
This makes the cafe i2c implement consistent with the rest of Linux so that
the core can use the same slave ID everywhere.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:00 -03:00
Jonathan Corbet f8ff6a96cd [media] marvell-cam: Move Cafe-specific register definitions to cafe-driver.c
Nobody else ever needs to see these, so let's hide them.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:00 -03:00
Jonathan Corbet 9eefa7dc01 [media] marvell-cam: Remove the "untested" comment
This code is, indeed, tested :)

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:00 -03:00
Jonathan Corbet 2164b5af1d [media] marvell-cam: Pass sensor parameters from the platform
Depending on the controller, the ov7670 sensor may be told to work with a
different clock speed or to use the SMBUS protocol.  Remove the wired-in
code and pass that information from the platform layer.  The Cafe driver
now just assumes it's running on an OLPC XO 1; I do not believe it has ever
run anywhere else.

Cc: Daniel Drake <dsd@laptop.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:00 -03:00
Jonathan Corbet abfa3df36c [media] marvell-cam: Separate out the Marvell camera core
There will eventually be multiple users of the core camera controller, so
separate it from the bus/platform/i2c stuff.  I've tried to do the minimal
set of changes to get the driver functioning in this configuration; I did
clean up a bunch of old checkpatch gripes in the process.  This driver
works like the old one did on OLPC XO 1 systems.

Cc: Daniel Drake <dsd@laptop.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:00 -03:00
Jonathan Corbet f8fc729870 [media] marvell-cam: Move cafe-ccic into its own directory
This driver will soon become a family of drivers, so let's give it its own
place to live.  This move requires putting ov7670.h into include/media, but
there are no code changes.

Cc: Daniel Drake <dsd@laptop.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:00 -03:00
Andre Bartke 2c87d9db46 [media] drivers/media/video: fix memory leak of snd_cx18_init()
cxsc is not freed in the error case.

Signed-off-by: Andre Bartke <andre.bartke@gmail.com>
Cc: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:59 -03:00
Hans Petter Selasky 7ce338d9df [media] Correct and add some parameter descriptions
>From 70d02ce19f64fae4ceee563501e8462a76e17b91 Mon Sep 17 00:00:00 2001

Signed-off-by: Hans Petter Selasky <hselasky@c2i.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:59 -03:00
Hans Petter Selasky ed5d11d592 [media] Remove unused definitions which can cause conflict with definitions in usb/ch9.h
>From 0dd2949dfeae431ed4ffbd00fd14a10dc3747ad0 Mon Sep 17 00:00:00 2001

Signed-off-by: Hans Petter Selasky <hselasky@c2i.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:59 -03:00
Hans Petter Selasky 2c7988ab0e [media] Correct error code from -ENOMEM to -EINVAL.
Make sure the return value is set in all cases

>From 9b38a5c9878b5e4be2899ae291c4524f5f5fc218 Mon Sep 17 00:00:00 2001

Signed-off-by: Hans Petter Selasky <hselasky@c2i.net>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:59 -03:00
David Härdeman 5588dc2b02 [media] rc-core: lirc use unsigned int
Durations can never be negative, so it makes sense to consistently use
unsigned int for LIRC transmission. Contrary to the initial impression,
this shouldn't actually change the userspace API.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:59 -03:00
Sensoray Linux Development 8a8cc952d3 [media] s2255drv: firmware version update, vendor request change
removes obsolete comments. updates firmware versions. firmware vendor request simplified.

Signed-off-by: Dean Anderson <linux-dev@sensoray.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:58 -03:00
Mauro Carvalho Chehab 941830c927 [media] xc4000: make checkpatch.pl happy
Solve the ./scripts/checkpatch.pl compliants for the patches
that added xc4000 support, including a few changes at dib0700.

While here, remove a few printk noise by converting some msgs
into debug ones.

Cc: Istvan Varga <istvan_v@mailbox.hu>
Cc: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:40 -03:00
istvan_v@mailbox.hu 8edeb6eb1a [media] xc4000: removed card_type
Removed the use of 'card_type' from the tuner configuration structure, and
replaced it with separate parameters to set board-specific configuration.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Cc: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:40 -03:00
istvan_v@mailbox.hu 09f4634293 [media] xc4000: check firmware version
Enabled code to check if the version of the firmware reported by the hardware
is correct after uploading it.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:40 -03:00
istvan_v@mailbox.hu 7c8ec47a92 [media] dvb-usb/Kconfig: auto-select XC4000 tuner for dib0700
Automatically select the xc4000 module for dib0700 if the tuner selection is
not customized.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Cc: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:40 -03:00
istvan_v@mailbox.hu 341747bef5 [media] xc4000: code cleanup
Various coding style changes:
  - removed unused / commented out code
  - changed C++ style comments to C format
  - renamed functions and variables that included upper case letters in the name
  - removed tabs from module parameter descriptions
  - replaced the use of XC_RESULT_* with standard error codes

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Cc: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:40 -03:00
Istvan Varga 7db98fe66b [media] xc4000: detect also xc4100
Added code to detect the XC4100 chip, which is presumably an analog-only
"value" version of the XC4000. It is not sure, however, if any devices
using this have actually been produced and sold, so the patch may be
unneeded.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:39 -03:00
Istvan Varga 8f76afe8d7 [media] xc4000: removed redundant tuner reset
This patch causes the tuner reset command to be ignored in the firmware
code, since this only happens when the BASE/INIT1 firmware is loaded by
check_firmware(), and in that case check_firmware() already calls the
reset callback before starting to load the firmware.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:39 -03:00
Istvan Varga e75873c1f8 [media] xc4000: xc_tune_channel() cleanup
Minor coding changes related to the xc_tune_channel() function.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:39 -03:00
Istvan Varga 818a1776a4 [media] xc4000: implemented analog TV and radio
The following patch implements support for analog TV and FM radio.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:39 -03:00
Istvan Varga 923137a403 [media] xc4000: added audio_std module parameter
The 'audio_std' module parameter makes it possible to fine tune
some audio related aspects of the driver, like setting the exact
audio standard (NICAM, A2, etc.) to be used for some video standards.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:39 -03:00
Istvan Varga 30f544ec56 [media] xc4000: setting registers
This patch implements setting the registers in xc4000_set_params()
and xc4000_set_analog_params(). A new register is defined which enables
filtering of the composite video output (this is needed to avoid bad
picture quality with some boards).

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:38 -03:00
Istvan Varga f4312e2fd4 [media] xc4000: debug message improvements
The following patch makes a few minor changes to the printing
of debug messages, and reporting the tuner status. The 'debug'
module parameter can now be set from 0 to 2 to control the
verbosity of debug messages.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:38 -03:00
Istvan Varga 027fd36186 [media] xc4000: firmware initialization
This patch fixes/cleans up the loading of the firmware file when the
driver is loaded and initialized.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:36 -03:00
Istvan Varga 5272f6b1f4 [media] xc4000: implemented power management
The following patch implements the xc4000_sleep() function.
The 'no_powerdown' module parameter is now interpreted differently:
  - 0 uses a device-specific default
  - 1 disables power management like before
  - 2 enables power management

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:36 -03:00
Istvan Varga 0b4021321c [media] xc4000: added card_type
This patch adds support for selecting a card type in struct
xc4000_config, to allow for implementing some card specific code
in the driver.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:36 -03:00
Istvan Varga 595a83f49a [media] xc4000: check_firmware() cleanup
This patch makes the following fixes in check_firmware():
  - there is only one BASE and INIT1 firmware for XC4000
  - loading SCODE is needed also for FM radio

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:36 -03:00
Istvan Varga ffce6266c8 [media] xc4000: simplified load_scode
Removed unused code from load_scode() (all SCODE firmwares are
assumed to have the HAS_IF bit set).

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:34 -03:00
Istvan Varga 3db9570482 [media] xc4000: simplified seek_firmware()
This patch simplifies the code in seek_firmware().

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:34 -03:00
Istvan Varga fa285bc1bf [media] xc4000: added firmware_name parameter
The firmware_name module parameter makes it possible to set the firmware
file name. It defaults to "xc4000.fw" if not specified.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:34 -03:00
Istvan Varga 1368ceb266 [media] xc4000: fixed frequency error
The xc_get_frequency_error() function reported the frequency error
incorrectly. The data read from the hardware is a signed integer, in
15625 Hz units. The attached patch fixes the bug.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:34 -03:00
Istvan Varga 5614942bb0 [media] xc4000: added mutex
This patch adds a mutex to xc4000_priv, to protect the driver
from being accessed by multiple processes at the same time.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:34 -03:00
Istvan Varga f0ef7c88ca [media] xc4000: added support for 7 MHz DVB-T
The following patch implements support for DVB-T with 7 MHz bandwidth.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:34 -03:00
Istvan Varga 4911085fa3 [media] xc4000: updated standards table
This patch makes the following changes to the standards table:
  - added 'u16 int_freq' to struct XC_TV_STANDARD (needed for analog TV
    and radio, 0 for DVB-T)
  - added new standard for SECAM-D/K video with PAL-D/K audio
  - the 'int_freq' values are now specified in the table
  - changed VideoMode for NTSC and PAL-B/G standards

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:33 -03:00
Istvan Varga fbe4a29f2f [media] xc4000: code cleanup
This is the first of a set of patches that update the original xc4000
sources to my modified version. It removes some unused code, and makes
a few minor formatting changes.

[mchehab@redhat.com: re-add XC_TUNE_ANALOG/XC_TUNE_DIGITAL constants, to avoid compilation breakage]
Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:33 -03:00
Mauro Carvalho Chehab e3bb7c607f [media] xc4000: Fix a few bad whitespaces on it
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:33 -03:00
Devin Heitmueller 62956cedb5 [media] dib0700: remove notes from bringup of PCTV 340e
Remove some inline comments I had written from when I was computing the proper
dib7000p configuration to work with the xc4000.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Cc: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:33 -03:00
Devin Heitmueller b6cdb5bea3 [media] xc4000: cleanup dmesg logging
Remove some printk() calls added during driver development, and demote some
other messages to debug only (to reduce dmesg chatter).

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:33 -03:00
Devin Heitmueller 980029eb35 [media] xc4000: rename firmware image filename
Give the xc4000 firmware filename a filename that makes more sense for public
release.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:31 -03:00
Devin Heitmueller 4922cec59a [media] xc4000: turn off debug logging by default
Don't dump debug into to dmesg by default (something I had enabled during
bringup of the xc4000 driver).

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:31 -03:00
Devin Heitmueller 2df12510f9 [media] dib0700: make PCTV 340e work!
Fixup the PLL and AGC configs so that the 340e works (correcting errors I made
when I did the original config blindly).

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Cc: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:31 -03:00
Devin Heitmueller ed23db3227 [media] xc4000: get rid of hard-coded 8MHz firmware config
Remove a hack I had put in to force the firmware to be 8MHz, now setting
the firmware properly based on the target standard.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:31 -03:00
Devin Heitmueller f1c78d340f [media] dib0700: fixup PLL config for PCTV 340e
Based on a reference trace under Windows, reverse engineer the PLL config.
Note that the xtal is not yet setup, and the timf cannot be determined yet
because my reference trace doesn't actually achieve a signal lock.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Cc: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:30 -03:00
Devin Heitmueller 799ed11afe [media] xc4000: handle dib0700 broken i2c stretching
It was confirmed by DibCom that i2c stretching is broken in the i2c master
on the dib7700.  So we need to put a hack into the xc4000 driver to not
complain in certain very specific cases where we know i2c stretching occurs.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:30 -03:00
Devin Heitmueller 8583fc834e [media] xc4000: setup dib7000p AGC config for PCTV 340e
Setup a proper AGC config for the 340e, based on the Windows USB trace

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:30 -03:00
Devin Heitmueller fe83036476 [media] xc4000: use if_khz provided in xc4000_config
Remove hard-coded references to 5400, using the value passed in when the
xc4000 is attached.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:30 -03:00
Devin Heitmueller ee4c3cd67b [media] xc4000: continued cleanup of the firmware loading routine
Properly setup the standard firmware loading and scode loading, as well as
getting rid of a ton of dead code.  Note that I am getting a single i2c
error when the standard firmware sets the video standard, but everything else
seems to be loading properly now.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:29 -03:00