Commit Graph

3935 Commits (abe4c4710386a4859dae9193bfc9a1f0e3c60db4)

Author SHA1 Message Date
Guennadi Liakhovetski abe4c47103 V4L/DVB (9786): soc-camera: formatting fixes
Minor formatting fixes

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:22 -02:00
Guennadi Liakhovetski a2c8c68cca V4L/DVB (9785): soc-camera: merge .try_bus_param() into .try_fmt_cap()
.try_bus_param() method from struct soc_camera_host_ops is only called at one
location immediately before .try_fmt_cap(), there is no value in keeping these
two methods separate, merge them.

Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:21 -02:00
Kuninori Morimoto b3d7b2ad9c V4L/DVB (9784): Register name fix for ov772x driver
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:21 -02:00
Kuninori Morimoto b90c032b0d V4L/DVB (9783): Change power on/off sequence on ov772x
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:20 -02:00
Andy Walls daa1c164db V4L/DVB (9778): cx18: cx18_writel_expect() should not declare success on a PCI read error
cx18: cx18_writel_expect() should not declare success on a PCI read error.
This removes the potential for cx18_write*_expect() calls to not
accomplish a PCI write successfully as expected.  The CX18-AV core uses the
*expect() calls often and this may be the source of intermittent audio
problems and standands switching problems.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:20 -02:00
Andy Walls 572bfea71b V4L/DVB (9776): cx18: Change to per CX23418 device work queues for deferrable work handling
cx18: Change to per CX23418 device work queues for deferrable work handling.
Needed to support 2.6.22 and earlier kernels that can't selectively cancel
work orders.  Also will provide slightly better performance on SMP systems.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:19 -02:00
Mauro Carvalho Chehab 26d5f3a3fe V4L/DVB (9772): saa7134: Add support for Kworld Plus TV Analog Lite PCI
Thanks to Sistema Fenix (http://www.sistemafenix.com.br/) for sponsoring
this
development.

Signed-off-by: Gilberto <gilberto@sistemafenix.com.br>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:17 -02:00
Mauro Carvalho Chehab eb6c96345d V4L/DVB (9770): em28xx: turn off tuner when not used
em28xx devices generally get hot when xc3028 tuner is powered on. This
patch solves this by turning power off when the device is not used, at the
expense of having a higher load time, when calling a TV application.

Since firmware load happens on 1 or 2 seconds on most devices, this is not a pain.

Also, it helps to save the planet by saving some power :)

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:15 -02:00
Mauro Carvalho Chehab 9e5d6760c2 V4L/DVB (9756): em28xx: Improve register log format
Change log format to look more like URB transactions. In fact, setup and
IN/OUT transactions are merged. This helps to debug the driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:14 -02:00
Andy Walls ec984f4378 V4L/DVB (9730): cx18: Quiet a sometimes common warning that often has benign consequences
cx18: Quiet a sometimes common warning that often has benign consequences.
No one probably cares that the firmware took forever to ack our command, as
they always seem to succeed whether or not the firmware acks it in a reasonable
amount of time.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:13 -02:00
Andy Walls 20543ec414 V4L/DVB (9729): cx18: Update version due to significant irq handling changes
Update the version number due to significant changes in the way the
mailboxes and interrupts are handled.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:12 -02:00
Andy Walls 1ed9dcc8ef V4L/DVB (9728): cx18: Copyright attribution update for files modified by awalls
Add copyright attribution for files modified by awalls in 2008

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:11 -02:00
Andy Walls 2bb49f1b9f V4L/DVB (9727): cx18: Adjust outgoing mailbox timeouts and remove statistics logging
cx18: Adjust outgoing mailbox timeouts and remove statistics logging.
This saves some wasted storage in struct cx18 for each card.  Cutting
the outgoing mailbox timeouts in half from the previous value appears to
be safe with MythTV.  Got rid of interrupted case code path after
a wait uninterruptable returns.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:11 -02:00
Andy Walls bca11a5721 V4L/DVB (9726): cx18: Restore buffers that have fallen out of the transfer rotation
Restore buffers that have fallen out of the transfer rotation, and check
for coherent mailbox data when processing a stale mailbox.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:10 -02:00
Andy Walls d6c7e5f8fa V4L/DVB (9725): cx18: Remove unnecessary MMIO accesses in time critical irq handling path
Remove unnecessary MMIO accesses in time critical irq handling path.  Also
ensured that the mailbox ack field is read in last, so we know for sure if we
have a stale mailbox or not on receipt.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:10 -02:00
Andy Walls 3f75c6161f V4L/DVB (9724): cx18: Streamline cx18-io[ch] wrappers and enforce MMIO retry strategy
cx18: Streamline cx18-io[ch] wrappers and enforce MMIO retry strategy so that
write retries always occur and read retries never occur (as they never help).
Remove MMIO statistics logging to speed up MMIO accesses.  Deprecate & ignore
retry_mmio and mmio_ndelay module parameters, to essentially force
retry_mmio=1 and mmio_ndelay=0.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:09 -02:00
Andy Walls 72a4f8081a V4L/DVB (9723): cx18: Propagate staleness of mailbox and mdl ack data to work handler
cx18: Propagate staleness of mailbox and mdl ack data to work handler to let
the work handler know that the data from the encoder may not be coherent.
Allows for smarter handling of buffers in future, to deal with MDLs that fall
out of rotation due to irq handler being late in collecting mailbox and mdl ack
info.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:09 -02:00
Andy Walls f576ceefb4 V4L/DVB (9722): cx18: Convert per stream queue spinlocks into mutexes
Convert the per stream queue spinlocks into mutexes.  All queue
manipulation happens via the work queue or system calls into the driver, and
not in an interrupt context.  This reduces the amout of time the cx18 driver
keeps interrupts disabled.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:08 -02:00
Andy Walls 18b5dc2ed7 V4L/DVB (9721): cx18: Change to singlethreaded global work queue thread for deferable work
Change to singlethreaded global work queue thread for deferable work,
instead of the kernel default multithreaded work queue.  This ensures
execution of deferable work is always in the proper order, so caputred buffers
don't get reordered.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:08 -02:00
Andy Walls ee2d64f5cc V4L/DVB (9720): cx18: Major rewrite of interrupt handling for incoming mailbox processing
A major rewrite of interrupt handling for incoming mailbox processing, to split
the timing critical steps from the the deferrable steps as the sending XPU on
the CX23418 will time out and overwrite our incoming mailboxes rather quickly.
Setup a pool of work "order forms" for the irq handler to send jobs to the new
work handler routine which uses the kernel default work queue to do the
deferrable work.  Started optimizing some of the cx18-io calls as they are now
the low hanging fruit for recoving microseconds back from the timeline.
Future optimizations will get rid of mmio read retries, mmio stats logging, and
combine smaller functions in the irq path into the larger ones to save ~2 us
each.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:07 -02:00
Jean-Francois Moine ba38ee8ebe V4L/DVB (9710): gspca: Remove some unuseful core in main.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:06 -02:00
Hans de Goede 181b704fd3 V4L/DVB (9707): gspca: Remove the event counter and simplify the frame wait.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:06 -02:00
Andy Walls c7abfb47c9 V4L/DVB (9599): cx18: Fix unitialized variable problem upon APU firmware file read failure
If APU firmware file read failed, the jump vector to the APU was undefined and
the APU would be started executing garbage.  Fix uninitialized variable to be
an infinite loop for the APU, but also bail out before even starting the APU.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:05 -02:00
Andy Walls d20ceecd0c V4L/DVB (9598): cx18: Prevent CX23418 from clearing it's outgoing ack interrupts to driver
When the CX23418 CPU unit sent out an ack interrupt to the linux driver, it
also received that interrupt and cleared the flag before the linux driver could
see what the interrupt was for.  This fix prevents the CPU from receiving an
IRQ for it's own outgoing ack's to the linux driver.  This fix is critical now
that the linux driver doesn't poll but relies on these ack interrupts.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:04 -02:00
Andy Walls 2d1a1b055b V4L/DVB (9597): cx18: Minor fixes to APU firmware load process
Use the APU fw start address from rom file instead of a hardcoded entry vector.
Fixed cx18_setup_page() calls to use the correct APU image load addresses.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:04 -02:00
Andy Walls 330c6ec894 V4L/DVB (9596): cx18: Further changes to improve mailbox protocol integrity & performnce
All waits for cx18 mailbox API commands are now uninterruptable.  Added
code to collect mailbox ack statistics.  Tweaked timeouts based on collected
stats and video vertical frame and field rates.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:03 -02:00
Andy Walls ac50441720 V4L/DVB (9595): cx18: Improve handling of outgoing mailboxes detected to be busy
cx18: Improve handling of outgoing mailboxes detected to be busy.  When
encountering a busy mailbox, sleep instead of polling, and wait for interrupt or
timeout.  If the mailbox is still busy, force it free.  When sending commands,
make sure we never create a situation where we mark the mailbox busy upon
sending, and ensure we always have a method to cleanly recover from a busy
mailbox.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:03 -02:00
Andy Walls d670b6ff4e V4L/DVB (9594): cx18: Roll driver version number due to significant changes
Driver interrupt and mailbox handling has change significantly.
Time for a roll to v1.0.2.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:02 -02:00
Andy Walls 72c2d6d3ac V4L/DVB (9593): cx18: Add outgoing mailbox mutexes and check for ack via waitq vs poll
Add mutexes to ensure exclusive access for outgoing driver to CX23418 mailboxes.
Also wait on a waitq for mailbox acknowledgement from the CX23418 instead of
polling.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:02 -02:00
Andy Walls f68d0cf567 V4L/DVB (9592): cx18: Use default kernel work queue; fix streaming flag for work handler
cx18: Use default kernel work queue; fix streaming flag for work handler.
Eliminate cx18 specific work queue and use the kernel default work queue.
Fixed the F_STREAMING_FLAG for the TS stream so cx18_dvb_work_handler()
can know when it is not safe to send MDLs to the firmware.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:01 -02:00
Jean-Francois Moine 13563f44a2 V4L/DVB (9558): gspca: Add the light frequency control for the sensor HV7131B in zc3xx
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:01 -02:00
Andy Walls f7823f8f43 V4L/DVB (9513): cx18: Reduce number of mmio read retries
cx18: Reduce number of mmio read retries to improve performance.  Experiments
have shown 2 things: read retries never improve the result of a suspect mmio
read from the CX23418 (the result stays all 0xff's), and that most of the
suspected read failures are actually proper reads of values that should be
all 0xff's.  This change reduces the number of read retries and keeps the
count separate from write retries.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30 09:38:00 -02:00
Mauro Carvalho Chehab 8c2399895d V4L/DVB (9767): em28xx: improve board description messages
Print manufacturer/product info from USB device and also card entry.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:43 -02:00
Mauro Carvalho Chehab 6a18eaf61a V4L/DVB (9766): em28xx: improve probe messages
Prints usb speed used by em28xx interface. While there, fixes USB ID's
endiannes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:43 -02:00
Mauro Carvalho Chehab 017ab4b1e2 V4L/DVB (9765): em28xx: move tuner gpio's to the cards struct
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:43 -02:00
Mauro Carvalho Chehab 2fe3e2ee72 V4L/DVB (9764): em28xx: Add support for suspend the device when not used
Several chips may be turned off when the device is not used, like audio,
video and dvb demods. This patch adds a gpio callback at the core
structs to allow turning off such devices.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:43 -02:00
Mauro Carvalho Chehab f502e86184 V4L/DVB (9763): em28xx: fix gpio settings
A previous changeset moved gpio from em28xx struct into em28xx_board.
However, the driver were not updated to properly honor those gpio's.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:42 -02:00
Mauro Carvalho Chehab 1c67e76f71 V4L/DVB (9762): em28xx: fix tuner absent entries
Before this patch, several devices without tuner were kept the value 0
for tuner_type. However, this means TUNER_TEMIC_PAL. Replace those
entries for the proper TUNER_ABSENT value.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:42 -02:00
Mauro Carvalho Chehab a5942b5c26 V4L/DVB (9761): em28xx: replace magic numbers for mux aliases
Instead of using magic vmux/amux, let's use an alias where possible.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:42 -02:00
Mauro Carvalho Chehab 122b77e59e V4L/DVB (9760): em28xx: move gpio lines into board table description
Instead of a large, ugly switch specifying the gpio tables for each
device, let's move it into the boards struct. This also helps to see
what boards have already the gpio's for DVB.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:42 -02:00
Mauro Carvalho Chehab 0ec202d183 V4L/DVB (9759): em28xx: move gpio tables to the top of em28xx-cards
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:42 -02:00
Mauro Carvalho Chehab 2a29a0d770 V4L/DVB (9758): em28xx: replace some magic by register descriptions where known
Replaces all occurrences of em28xx_write_regs_req() and em28xx_write_reg()
used to setup register names by em28xx_write_reg().

Also, documents the register names that are known.

This patch were generated by this small perl script:

my %reg_map = (
	# Register table - the same as defined on parse_em28xx.pl script
);

while (<>) {
	if (m/(.*)em28xx_write_regs_req\(dev\,\s*0x00\,\s*(.*)\,\s*\"\\x(..)\",\s*1\)\;(.*)/) {
		my $reg = $2;
		my $val = $3;
		$val =~ tr/A-f/a-f/;
		$reg = $reg_map{$reg} if defined($reg_map{$reg});
		printf "$1em28xx_write_reg(dev, %s, 0x%s);$4\n", $reg, $val;
	} elsif (m/(.*)em28xx_write_regs\(dev\,\s*(.*)\,\s*\"\\x(..)\",\s*1\)\;(.*)/) {
		my $reg = $2;
		my $val = $3;
		$val =~ tr/A-f/a-f/;
		$reg = $reg_map{$reg} if defined($reg_map{$reg});
		printf "$1em28xx_write_reg(dev, %s, 0x%s);$4\n", $reg, $val;
	} else {
		print $_;
	}
}

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:42 -02:00
Mauro Carvalho Chehab c864405747 V4L/DVB (9755): em28xx: cleanup: We need just one tuner callback
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:42 -02:00
Mauro Carvalho Chehab 1bee0184f6 V4L/DVB (9754): em28xx: improve debug messages
Now, the first message states board names. Also, removed printing the alternate
settings by default. I2C messages are now clearer.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:42 -02:00
Mauro Carvalho Chehab ec5de990d9 V4L/DVB (9753): em28xx: cleanup: saa7115 module auto-detects saa711x type
Since saa7115 has saa711x chip auto-detection, there's no need on differenciating
it at cards table. Just use the generic name for all boards that use a philips
saa711x decoder.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:41 -02:00
Mauro Carvalho Chehab 505b6d0b77 V4L/DVB (9752): Remove duplicated fields on em28xx_board and em28xx structs
Several fields are duplicated on both structs. Let's just copy em28xx_board instead.

A later cleanup could just copy the fields that are changed, in order to keep em28xx_board
const.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:41 -02:00
Mauro Carvalho Chehab d4d889e329 V4L/DVB (9751): em28xx: card description cleanups
Remove unused em28xx_board.vchannels and em28xx.video_channels.
Also, .is_em2800 = 0 is not needed, as all data is zeroed by kernel loader.

The table also included a notice that svideo weren't test on Hauppauge
USB2. Remove this notice, since this input also works properly.

Also, it does some whitespace cleanups.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:41 -02:00
Mauro Carvalho Chehab a2070c6654 V4L/DVB (9747): em28xx: Properly handles XCLK and I2C speed
The previous patches removed XCLK and I2C magic. Now, we finally know
what those registers do. Also, only a very few cards need different
setups for those.

Instead of keeping the setups for those values inside the per-device
hack magic switch, move the uncommon values to the board-specific
struct, and have a common setup for all other boards.

So, almost 100 lines of hacking magic were removed.

A co-lateral effect of this patch is that it also fixes a bug at em28xx-core, where xclk
were set, without taking any care about not overriding a previous xclk setup.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:41 -02:00
Devin Heitmueller 6d676d8af8 V4L/DVB (9745): em28xx: Cleanup GPIO/GPO setup code
Cleanup the calls to set the GPIOs and GPOs for various devices,
replacing the register number with the #define from em28xx-reg.h and
converting over to using em28xx_write_reg()

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:41 -02:00
Devin Heitmueller 55927684e7 V4L/DVB (9744): em28xx: cleanup XCLK register usage
Convert over to setting the XCLK register usage with the new em28xx_write_reg()
function.

Thanks to Ray Lu from Empia for providing the em2860/2880 datasheet.

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29 17:53:41 -02:00