Commit Graph

257 Commits

Author SHA1 Message Date
Laurent Pinchart
50462eb065 V4L/DVB (13555): v4l: Use video_device_node_name() instead of the minor number
Instead of using the minor number in kernel log messages, use the device
node name as returned by the video_device_node_name() function. This
makes debug, informational and error messages easier to understand for
end users.

[mchehab.redhat.com: removed tm6000 changes as tm6000 is not ready yet for submission even on staging]

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16 00:17:57 -02:00
Laurent Pinchart
38c7c03603 V4L/DVB (13550): v4l: Use the new video_device_node_name function
Fix all device drivers to use the new video_device_node_name function.

This also strips kernel log messages from the "/dev/" prefix, has the device
node location is a userspace policy decision unknown to the kernel.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16 00:17:55 -02:00
Linus Torvalds
3e74683137 Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (345 commits)
  V4L/DVB (13542): ir-keytable: Allow dynamic table change
  V4L/DVB (13541): atbm8830: replace 64-bit division and floating point usage
  V4L/DVB (13540): ir-common: Cleanup get key evdev code
  V4L/DVB (13539): ir-common: add __func__ for debug messages
  V4L/DVB (13538): ir-common: Use a dynamic keycode table
  V4L/DVB (13537): ir: Prepare the code for dynamic keycode table allocation
  V4L/DVB (13536): em28xx: Use the full RC5 code on HVR-950 Remote Controller
  V4L/DVB (13535): ir-common: Add a hauppauge new table with the complete RC5 code
  V4L/DVB (13534): ir-common: Remove some unused fields/structs
  V4L/DVB (13533): ir: use dynamic tables, instead of static ones
  V4L/DVB (13532): ir-common: Add infrastructure to use a dynamic keycode table
  V4L/DVB (13531): ir-common: rename the debug routine to allow exporting it
  V4L/DVB (13458): go7007: subdev conversion
  V4L/DVB (13457): s2250: subdev conversion
  V4L/DVB (13456): s2250: Change module structure
  V4L/DVB (13528): em28xx: add support for em2800 VC211A card
  em28xx: don't reduce scale to half size for em2800
  em28xx: don't load audio modules when AC97 is mis-detected
  em28xx: em2800 chips support max width of 640
  V4L/DVB (13523): dvb-bt8xx: fix compile warning
  ...

Fix up trivial conflicts due to spelling fixes from the trivial tree in
	Documentation/video4linux/gspca.txt
	drivers/media/video/cx18/cx18-mailbox.h
2009-12-09 19:50:49 -08:00
Hans Verkuil
7f3ea4debb V4L/DVB (13478): cx18: remove bogus init call.
The cx18 av core implemented an init call for no good reason. It's now
turned into an internal function.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Reviewed-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:42:05 -02:00
Andy Walls
8352619043 V4L/DVB (13445): cx18: Use per cx18 instance init data for ir-kbd-i2c instead of const data
This change creates per cx18 instances of IR_i2c_init_data for handing over
initialization data to ir-kbd-i2c, since that module wants non-const data
even though it never modifies the data.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:41:57 -02:00
Andy Walls
543ae45a7f V4L/DVB (13434): cx18: Bump version number due to significant buffer handling changes.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:41:54 -02:00
Andy Walls
ad689d54f9 V4L/DVB (13433): cx18: Remove duplicate list traversal when processing incoming MDLs
Update the incoming MDL's buffers' bytesused and sync the buffers for the cpu
in one pass instead of two.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:41:53 -02:00
Andy Walls
127ce5f0ad V4L/DVB (13432): cx18: Adjust encoder VBI MDL size to be exactly frame's worth of VBI data
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:41:53 -02:00
Andy Walls
1047a83844 V4L/DVB (13431): cx18: Adjust an MDL's final buffer size to force encoder transfer size
The encoder was not honoring the MDL size sent in DE_SET_MDL mailbox commands.
This change adjusts the size of the last buffer in an MDL, as reported to the
firmware, so that the encoder will send the exact amount of bytes we specify
per MDL transfer.  This eliminates tearing in YUV playback when using
non-default YUV buffer sizes.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:41:52 -02:00
Andy Walls
22dce188ef V4L/DVB (13430): cx18: Fix YUV capture so that encoder passes a single frame per transfer
Fix YUV capture such that the encoder will pass one frame per transfer.  This
will allow the application to maintain frame alignment when a transfer from
the encoder is missed due to high system latency in service the CX23418 IRQ.

Also force YUV buffer sizes to be specified in multiples of 33.75 kB, the
smalled amount of buffer sizes need to store a complete set of HM12 4:2:0
macroblocks specifying 32 lines of the frame.  A full 60Hz/525 line
screen requires 15 * 33.75 kB per frame and a full 50Hz/625 line screen
requires 18 * 33.75 kB per frame so the default buffer size is 3 * 33.75 kB,
requiring exactly 5 or 6 buffers per MDL respectively.  The bytes needed per
frame and hence MDL need not be the bytes in an integer number of buffers.
However, if frame artifacts are seen with scaled screen sizes, the YUV buffer
size can be set 34 kB (33.75 kB) to get rid of the artifacts at the cost of more
copies between the kernel and userspace.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:41:52 -02:00
Andy Walls
52fcb3ecc6 V4L/DVB (13429): cx18: Add Memory Descriptor List (MDL) layer to buffer handling
Add a Memory Descriptor List (MDL) layer to buffer handling to implement
scatter-gather I/O.  Currently there is still only 1 buffer per MDL.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:41:51 -02:00
Andy Walls
fa655dda5c V4L/DVB (13428): cx18: Rename mdl_offset to mdl_base_idx or free_mdl_idx as appropriate
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:41:51 -02:00
Andy Walls
c37b11bf17 V4L/DVB (13427): cx18: Rename struct cx18_queue.buffers to struct cx18_queue.depth
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:41:51 -02:00
Andy Walls
f0076e60b5 V4L/DVB (13426): cx18: Rename struct cx18_mdl to struct cx18_mdl_ent
Rename type in anticipation of implementing a struct cx18_mdl type that
actually keeps track of a memory descriptor list.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:41:50 -02:00
Devin Heitmueller
48c511ed67 V4L/DVB (13331): mxl5005s: provide ability to override QAM gain for HVR-1600
The HVR-1600 doesn't use the standard mechanism for computing the gain when
in QAM mode, instead always forcing it to be 0x02.  Provide the ability to
override the algorithm on a per-board basis.

This change results in an improvement of 0.4-0.6 dB for QAM tuning.

This work was sponsored by ONELAN Limited.

Cc: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:41:23 -02:00
Devin Heitmueller
af5c8e1523 V4L/DVB (13329): s5h1409: provide HVR-1600 specific optimizations
Perform some optimization of the register configuration based on a trace
of the HVR-1600 Windows i2c traffic (and consultation with Steven Toth).
Note that some of these values may be able to be moved into the common driver,
but I am holding off on that until they can be tested with other boards.

This work was sponsored by ONELAN Limited.

Cc: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:41:22 -02:00
Peter Huewe
9710e7a77a V4L/DVB (13288): adding __init/__exit macros to various drivers
Trivial patch which adds the __init/__exit macros to the module_init/
module_exit functions of the following drivers in media video:
    drivers/media/video/ivtv/ivtv-driver.c
    drivers/media/video/cx18/cx18-driver.c
    drivers/media/video/davinci/dm355_ccdc.c
    drivers/media/video/davinci/dm644x_ccdc.c
    drivers/media/video/saa7164/saa7164-core.c
    drivers/media/video/saa7134/saa7134-core.c
    drivers/media/video/cx23885/cx23885-core.c

Cc: Hermann Pitton <hermann-pitton@arcor.de>
Acked-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Acked-by: Andy Walls <awalls@radix.net>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Muralidharan Karicheri <m-karicheri2@ti.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:41:12 -02:00
Adam Buchbinder
6070d81eb5 tree-wide: fix misspelling of "definition" in comments
"Definition" is misspelled "defintion" in several comments; this
patch fixes them. No code changes.

Signed-off-by: Adam Buchbinder <adam.buchbinder@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-12-04 23:41:47 +01:00
Peter Huewe
9d440a087b media/video: add __init/__exit macros to various drivers
Trivial patch which adds the __init/__exit macros to the module_init/
module_exit functions of the following drivers in media video:
    drivers/media/video/ivtv/ivtv-driver.c
    drivers/media/video/cx18/cx18-driver.c
    drivers/media/video/davinci/dm355_ccdc.c
    drivers/media/video/davinci/dm644x_ccdc.c
    drivers/media/video/saa7164/saa7164-core.c
    drivers/media/video/saa7134/saa7134-core.c
    drivers/media/video/cx23885/cx23885-core.c

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Acked-by: Andy Walls <awalls@radix.net>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Muralidharan Karicheri <m-karicheri2@ti.com>
Acked-By: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-11-09 09:40:58 +01:00
Hans Verkuil
6b5270d212 V4L/DVB (12725): v4l: warn when desired devnodenr is in use & add _no_warn function
Warn when the desired device node number is already in use, except when
the new video_register_device_no_warn function is called since in some
use-cases that warning is not relevant.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19 00:19:34 -03:00
Hans Verkuil
581644d9c9 V4L/DVB (12723): ivtv/cx18: replace 'kernel number' with 'device node number'.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19 00:19:29 -03:00
Hans Verkuil
53dacb1570 V4L/DVB (12540): v4l: simplify v4l2_i2c_new_subdev and friends
Rewrite v4l2_i2c_new_subdev as a simplified version of v4l2_i2c_new_subdev_cfg
and remove v4l2_i2c_new_probed_subdev and v4l2_i2c_new_probed_subdev_addr.

This simplifies this API substantially.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19 00:19:24 -03:00
Andy Walls
958411bc48 V4L/DVB (12884): cx18: Eliminate warning about discarding 'const' is assignment for IR init
i2c-kbd-i2c allows a bridge driver to pass information about IR configuration,
but uses a "void *" to pass along what is essentially constant data.  This
change casts a const * to a void * to remove the warning.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-19 00:14:07 -03:00
Andy Walls
78f2e672b3 V4L/DVB (12699): cx18: ir-kbd-i2c initialization data should point to a persistent object
ir-kbd-i2c's ir_probe() function can be called much later (i.e. at ir-kbd-i2c
module load), than the lifetime of a struct IR_i2c_init_data allocated off of
the stack in cx18_i2c_new_ir() at registration time.  Make sure we pass
a pointer to a persistent IR_i2c_init_data object at i2c registration time.

Thanks to Brian Rogers for pointing out a solution, and Dustin Mitchell for
testing against a 2.6.30 kernel.

Reported-by: Dustin Mitchell <soxslayer@gmail.com>
Reported-by: Brian Rogers <brian@xyzw.org>
Tested-by: Dustin Mitchell <soxslayer@gmail.com>
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:20:15 -03:00
Mauro Carvalho Chehab
715a223323 V4L/DVB (12595): common/ir: use a struct for keycode tables
Currently, V4L uses a scancode table whose index is the scancode and
the value is the keycode. While this works, it has some drawbacks:

1) It requires that the scancode to be at the range 00-7f;

2) keycodes should be masked on 7 bits in order for it to work;

3) due to the 7 bits approach, sometimes it is not possible to replace
the default keyboard to another one with a different encoding rule;

4) it is different than what is done with dvb-usb approach;

5) it requires a typedef for it to work. This is not a recommended
Linux CodingStyle.

This patch is part of a larger series of IR changes. It basically
replaces the IR_KEYTAB_TYPE tables by a structured table:
struct ir_scancode {
       u16     scancode;
       u32     keycode;
};

This is very close to what dvb does. So, a further integration with DVB
code will be easy.

While we've changed the tables, for now, the IR keycode handling is still
based on the old approach.

The only notable effect is the redution of about 35% of the ir-common
module size:

   text    data     bss     dec     hex filename
   6721   29208       4   35933    8c5d old/ir-common.ko
   5756   18040       4   23800    5cf8 new/ir-common.ko

In thesis, we could be using above u8 for scancode, reducing even more the size
of the module, but defining it as u16 is more convenient, since, on dvb, each
scancode has up to 16 bits, and we currently have a few troubles with rc5, as their
scancodes are defined with more than 8 bits.

This patch itself shouldn't be doing any functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:19:47 -03:00
Andy Walls
8ca955689a V4L/DVB (12367): cx18: Add i2c initialization for Z8F0811/Hauppage IR transceivers
This patch add support to the cx18 driver for setting up the
Z8F0811/Hauppauge IR Tx/Rx chip with the i2c binding model in newer
kernels.

Signed-off-by: Andy Walls <awalls@radix.net>
Reviewed-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:18:25 -03:00
Jean Delvare
e81516c58e V4L/DVB (12343): Stop defining I2C adapter IDs nobody uses
There is no point in defining I2C adapter IDs when no code is using
them. As this field might go away in the future, stop using it when
we don't need to.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:18:13 -03:00
Andy Walls
25a42e4d4a V4L/DVB (12207): cx18: Add an EEPROM dump routine for the Yuan MPC718 and future cards
Add a routine for dumping the EEPROM of the MPC718.  It is generic enough
to use for other cards in the future that may have an EEPROM.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:17:26 -03:00
Roel Kluin
de81c3c3f5 V4L/DVB (12199): remove redundant tests on unsigned
input, inp and i are unsigned. When negative they are wrapped and caught by the
other test.

Cc: Andy Walls <awalls@radix.net>
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:17:23 -03:00
Joe Perches
32a60955fb V4L/DVB (12196): cx18-fileops.c: Remove unnecessary semicolons
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Andy Walls <awalls@radix.net>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-09-12 12:17:22 -03:00
Andy Walls
225aeb1c58 V4L/DVB (12338): cx18: Read buffer overflow
This mistakenly tested against sizeof(freqs) instead of the array size. Due to
the mask the only illegal value possible was 3.

Reported-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-08-13 20:39:02 -03:00
Andy Walls
ff861fb21e V4L/DVB (12182): cx18: Add DVB-T support for Yuan MPC-718 cards with an MT352 or ZL10353
Add DVB-T support for Yuan MPC-718 cards with an MT352 or ZL10353 demodulator.

There are apparently some units with a DiBcom demodulator which could be
supported by one of the dib7000 modules - but this is not implemented in the
cx18 driver (yet).

Due to lack of porgramming details for the MT352 and the mt352 module requiring
a "demod_init" function, a "firmware" must be obtained and loaded to get
DVB-T working for Yuan MPC-718 cards with an MT352.

Tested-by: Steve Firth <firth650@btinternet.com>
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-05 14:29:59 -03:00
Andy Walls
637fb3d70b V4L/DVB (12180): cx18: Update Yuan MPC-718 card entry with better information and guesses
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-07-05 14:29:58 -03:00
Hans Verkuil
c6711c3e6d V4L/DVB (12104): ivtv/cx18: fix regression: class controls are no longer seen
A previous change (v4l2-common: remove v4l2_ctrl_query_fill_std) broke
the handling of class controls in VIDIOC_QUERYCTRL. The MPEG class control
was broken for all drivers that use the cx2341x module and the USER class
control was broken for ivtv and cx18.

This change adds back proper class control support.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-23 03:14:31 -03:00
Andy Walls
8bb09db375 V4L/DVB (11951): cx18: Add DVB-T support for the Leadtek WinFast DVR3100 H
This adds support for DVB-T on the Leadtek DVR3100 H and should also get analog
TV capture from the tuner working properly as well.

DVB-T 6 MHz and 8 MHz have been tested and verified to work by Terry Wu of
Leadtek.  DVB-T 7 MHz has also been verified working with a change developed by
Terry to the tuner-xc2028.c driver.

Special thanks go to Terry Wu <terrywu2009@gmail.com> of Leadtek who provided
the needed information and testing to get digital TV working for the Leadtek
DVR3100 H.

Reported-by: Terry Wu <terrywu2009@gmail.com>
Tested-by: Terry Wu <terrywu2009@gmail.com>
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 19:07:33 -03:00
Andy Walls
9d5af86292 V4L/DVB (11950): cx18: Split LeadTek PVR2100 and DVR3100 H into 2 separate card entries
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 19:07:33 -03:00
Andy Walls
9ad4c6551b V4L/DVB (11898): cx18: Perform 64 bit divide so it works for 32 bit systems
Thanks to David Ward and Mike Krufky for reporting the problem and
debugging this as an unresolved symbol due to a 64 bit divide on a 32 bit
system.  David Ward provided the content of this patch; Andy Walls only
performed some cosmetic edits.

Reported-by: David Ward <david.ward@gatech.edu>
Signed-off-by: David Ward <david.ward@gatech.edu>
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:16 -03:00
Andy Walls
86bc85b386 V4L/DVB (11865): cx18: Tweak color burst gate delay and initial color sub-carrier freq
Fix the burst gate delays to use a crystal value of 28636360 as assumed by
the rest of the driver.  Also have the initial color sub-carrier freq paramter
use the src decimation ratio per the documentation, instead of the actual
crystal/pixel clock ratio.  The tracking circuit will find the correct color
subcarrier in any case, as long as we're close.  Also fix up some debug print
statements.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:14 -03:00
Andy Walls
929a3ad152 V4L/DVB (11864): cx18: Complete support for Sliced and Raw VBI for 625 line systems
Finish changes for sliced and raw VBI for 625 line systems.  Tested with VPS
and WSS being emitted by a PVR-350 in field 1 lines 16 and 23.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:14 -03:00
Andy Walls
5ab740522f V4L/DVB (11863): cx18: Initial attempt to get sliced VBI working for 625 line systems
Initial changes to get sliced VBI for 625 line system working.  This is patch
is untested.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:14 -03:00
Andy Walls
4442ee8bdd V4L/DVB (11752): cx18: Add missing newline to tuner detection error message
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:21:00 -03:00
Andy Walls
f4672dffa1 V4L/DVB (11703): cx18: Have audio decoder drive SIF gain control, and rework AFE config
Ensure the variable gain amplifier gain for SIF is driven by the audio deocder
and not the video decoder.  This forced rework of the analog front end (AFE)
configuration to not rely on autoconfiguration, but instead set up the AFE mux,
AFE parameters, and ADC1 & ADC2 configurations explicitly.

Reported-by: Helen Buus <mythtv@hbuus.com>
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:20:54 -03:00
Andy Walls
33b55a0a7d V4L/DVB (11624): cx18: Toggle the AI1 mux when changing the CX18_AUDIO_ENABLE register
Toggle the AI1 mux when changing the CX18_AUDIO_ENABLE register.  It's hard to
reliably tell when we have written to this register successfully unless we
change some bits we know we can read back.  The AI mux bits always read back
what we wrote to them, so force them to toggle whenever we have to write to
the register, so we can tell we wrote to the register successfully.

This change was prompted by users experiencing broadcast audio decoding
problems after the cx18 module loads for the first time.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:20:45 -03:00
Andy Walls
1bd8e15ac3 V4L/DVB (11623): cx18: Verify cx18-av-core digitizer firmware loads correctly
Add code to verify the cx18-av-core digitizer firmware loads correctly.  The
verification function reads back and compares the firmware bytes loaded
into the A/V core.  The result of the verification is only used to log a
message in the system log.

This change was prompted by users with multiple card setups that have problems
with broadcast audio decoding the first time the cx18 module is loaded.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:20:45 -03:00
Andy Walls
0c62925229 V4L/DVB (11622): cx18: Allow IVTV format VBI insertion in MPEG-2 SVCD and DVD streams
Both the MPEG-2 SVCD stream format and the MPEG-2 DVD stream format should
use an MPEG-2 PS container.  This makes it safe to stuff IVTV Private Stream 1
VBI packets in these stream types using the existing cx18 driver routines.

Reported-by: Helen Buus <mythtv@hbuus.com>
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:20:45 -03:00
Andy Walls
9982be8a14 V4L/DVB (11620): cx18: Increment version due to significant buffer handling changes
Version bump from 1.1.0 to 1.2.0

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:20:45 -03:00
Andy Walls
21a278b85d V4L/DVB (11619): cx18: Simplify the work handler for outgoing mailbox commands
Simplify the way outgoing work handler gets scheduled to send empty buffers
back to the firmware for use.  Also reduced the memory required for scheduling
this outgoing work, by using a single, per stream work object.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:20:44 -03:00
Andy Walls
40c5520f55 V4L/DVB (11618): cx18: Convert per stream mutex locks to per queue spin locks
To avoid sleeps in providing buffers to user space and in handling incoming
buffers from the capture unit, converted the per stream mutex for locking
queues to 3 spin locks.  There is now a spin lock per queue
to increase concurrency when moving buffers around.

Also simplified queue manipulations and buffer handling of incoming buffers
of data from the capture unit.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:20:44 -03:00
Andy Walls
5f0a3cfcfd V4L/DVB (11617): cx18: Set up to wait for a one-shot response before sending a firmware cmd
When sending an outgoing firmware command, prepare to wait before we raise the
interrupt, so we don't miss the wake_up() on the acknowledgment.  When waiting
for the acknowledgement, there is no need to loop around schedule(), as there
will only be one interrupt, and hence one wake_up(), issued.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:20:44 -03:00
Andy Walls
8711615951 V4L/DVB (11616): cx18: Add a work queue for deferring empty buffer handoffs to the firmware
This change defers sending all CX18_CPU_DE_SET_MDL commands, for a stream with
an ongoing capture, by adding a work queue to handle sending such commands when
needed.  This prevents any sleeps, caused by notifying the firmware of new
usable buffers, when a V4L2 application read() is being satisfied or when
an incoming buffer is processed by the cx18-NN-in work queue thread.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16 18:20:44 -03:00