Commit Graph

21826 Commits

Author SHA1 Message Date
Michael Krufky 47e76c5c79 V4L/DVB (5252): Qt1010: use ARRAY_SIZE macro when appropriate
Use ARRAY_SIZE macro already defined in kernel.h

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:33 -02:00
Marco Schluessler b79ea694a9 V4L/DVB (5251): Qt1010: fix compiler warning
In function 'qt1010_init':

Signed-off-by: Marco Schluessler <marco@lordzodiac.de>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:33 -02:00
Marcel Siegert 4acf26703e V4L/DVB (5249): Fix compiler warning in vivi.c
The result of copy_to_user was not used, so the compiler complained
now a warning will be issued if copy_to_user fails.

Signed-off-by: Marcel Siegert <mws@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:32 -02:00
Hartmut Birr 90e3bd4ba5 V4L/DVB (5247): Stv0297: Enable BER/UNC counting
Enable BER/UNC counting for the stv0297 frontend.
The idea for this patch comes from stv0297_cs.c.

Signed-off-by: Hartmut Birr <e9hack@googlemail.com>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:32 -02:00
David Härdeman 59327a4897 V4L/DVB (5246): Budget-ci: IR handling fixups
Commit 00c4cc6751 Oliver Endriss changed 
the budget-ci driver to use interrupt mode for i2c transfers.

This also meant that a new bunch of IR bytes that were previously lost 
are now received, which allowed me to better understand how the MSP430 
chip works. Unfortunately it also means that the current driver gets 
some assumptions wrong and might generate double keypresses for one IR 
command. 

The attached patch fixes this by throwing away the repeat bytes and by 
associating the correct command and device bytes.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:32 -02:00
Marco Schluessler 89e4d59f2c V4L/DVB (5245): Dvb-ttpci: use i2c gate ctrl from stv0297 frontend driver
Use i2c gate ctrl from stv0297 frontend driver.

Signed-off-by: Marco Schluessler <marco@lordzodiac.de>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:31 -02:00
Marcel Siegert b619010247 V4L/DVB (5244): Dvbdev: fix illegal re-usage of fileoperations struct
Arjan van de Ven <arjan@infradead.org> reported an illegal re-usage of 
the fileoperations struct if more than one dvb device (e.g. frontend) is 
present. 

This patch fixes this issue.  

It allocates a new fileoperations struct each time a device is 
registered and copies the default template fileops.

Signed-off-by: Marcel Siegert <mws@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:31 -02:00
Chris Rankin e1af498063 V4L/DVB (5178): Avoid race when deregistering the IR control for dvb-usb
The work item function is dvb_usb_read_remote_control():
        INIT_WORK(&d->rc_query_work, dvb_usb_read_remote_control, d);
and the last piece of work it does is:
        schedule_delayed_work(&d->rc_query_work,msecs_to_jiffies(d->props.rc_interval));
Hence you need to call "cancel_rearming_delayed_work()" and not
"cancel_delayed_work()", correct?  I certainly haven't seen this oops
reoccur since I applied this patch.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:31 -02:00
Antti Palosaari 705d41e5da V4L/DVB (5240): Qt1010: use i2c_gate_ctrl where appropriate
This patch adds calls to i2c_gate_ctrl in the qt1010 dvb tuner module,
while removing the temporary hack in au6610 and gl861.
Tested successfully against fi-Oulu frequencies with
MSI Megasky 580 GL861 and Sigmatek DVB-110 AU6610.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:31 -02:00
Michael Krufky 38d0629fd8 V4L/DVB (5239): Whitespace / 80-column cleanups
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:30 -02:00
Michael Krufky d4130b18f7 V4L/DVB (5238): Kconfig: qt1010 should be selected by gl861 and au6610
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:30 -02:00
Antti Palosaari 4c7e3ea92d V4L/DVB (5237): Dvb: add new qt1010 tuner module
gl861: (MSI Megasky)
- hack for enable ZL10353 / QT1010 I2C gate
- use new QT1010 module instead of old code

au6610: (Sigmatek DVB-110)
- hack for enable ZL10353 / QT1010 I2C gate
- use new QT1010 module instead of old code

Tested successfully with au6610 and gl861 devices against fi-Yllas
frequencies. Now it locks perfectly with both devices.
There is a "hack" to enable probable i2c gate in zl10535
demodulator. QT1010 doesn't respond to any i2c messages before we
write 0x1a to demodulator register 0x62. In my understanding this
should be fixed to demodulator code.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:30 -02:00
Antti Palosaari 5decdd2729 V4L/DVB (5236): Initial support for Sigmatek DVB-110 DVB-T
This patch adds driver for Sigmatek DVB-110 USB DVB-T stick. Stick has based
on hardware of Qtuantek QT1010 tuner, Zarlink ZL10353 (Intel CE 6353)
demodulator and Alcor Micro AU6610 DVB-T USB controller. HW is rather similar
as used in MSI Megasky GL861.
Currently, the driver works only in USB 2.0. In my understanding USB 1.1 is
also supported by hw but I cannot test it due to lack of USB 1.1 port. Device
supports only isochronous mode transfers. There is also eeprom in usb
controller(at least in address range 0x80 - 0xbf) for storing data, eg.
firmware. Anyway, firmware loading is not used / required by the device.
There seems to be at least one unknown I2C device in address 0xa0, probably
remote control or GPIO. Windows drivers reads registers from 0x00 to 0x07
from this unknown address.
Driver is based on gl861 module. Tuner has a lot of problems to lock with
megasky qt1010 module with this hardware with some broadcasting standards.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:30 -02:00
Carl Lundqvist 4131fd4fd4 V4L/DVB (5235): Gl861: use parallel_ts
- use parallel_ts - Now this driver works.
- correct typo in MODULE_VERSION

Signed-off-by: Carl Lundqvist <comabug@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:29 -02:00
Michael Krufky 05eb2a8058 V4L/DVB (5234): Gl861: remove unneeded declaration
remove unneeded declaration of .generic_bulk_ctrl_endpoint

generic_bulk_ctrl_endpoint isn't being used in this device, so this
is not needed here.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:29 -02:00
Jan Nijs 8c0b24c2d2 V4L/DVB (5233): Gl861: correct address of the bulk endpoint
The megasky 580 based on gl861 has three endpoints:
- 0x81 BULK/ISOC	IN	MPEG2 TS
- 0x83 INT			IN	remote control receiver
- 0x02 BULK			OUT	bulk control endpoint
It doesn't look like the bulk endpoint is used, but better to
have the correct one in the config.

Signed-off-by: Jan Nijs <jan.nijs@scarlet.be>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:29 -02:00
Jan Nijs b3b2b8b574 V4L/DVB (5232): Gl861: correct oops when loading module
This patch moves the DVB_USB_IS_AN_I2C_ADAPTER flag from the adapter
properties to the device properties.
Without this patch I get an OOPS when the gl861 driver tries to
access any registers.

Signed-off-by: Jan Nijs <jan.nijs@scarlet.be>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:28 -02:00
Michael Krufky 1f78867bc8 V4L/DVB (5231): Gl861: whitespace cleanups
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:28 -02:00
Michael Krufky e465ea7ed1 V4L/DVB (5230): Gl861: remove NULL entry from gl861_properties
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:28 -02:00
Michael Krufky 6ae7232084 V4L/DVB (5229): Gl861: use qt1010_tuner_attach function from qt1010.h
The gl861_tuner_attach function is not specific to this device.
This patch removes gl861_tuner_attach, and replaces it with
qt1010_tuner_attach from the qt1010 header file.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:28 -02:00
Michael Krufky 8bb36dc7b5 V4L/DVB (5228): Gl861: remove unneeded "extern int" declaration
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:27 -02:00
Michael Krufky 73b96c09f6 V4L/DVB (5227): Gl861: hide disabled code from upstream patch system
enclose disabled code inside an #if 0 block, instead of /* comments */

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:27 -02:00
Michael Krufky 05ec6cc88c V4L/DVB (5226): Gl861: fix driver_name
Rename driver_name from "gl861" to "dvb_usb_gl861"

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:27 -02:00
Michael Krufky 947af8fdcd V4L/DVB (5225): Gl861: fix MODULE_AUTHOR
The author's email address is already in the MODULE_AUTHOR field.
This patch adds his name as well.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:26 -02:00
Michael Krufky a9bde1d88c V4L/DVB (5224): Gl861: select DVB_ZL10353 if !DVB_FE_CUSTOMISE
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:26 -02:00
Michael Krufky 6f7880f026 V4L/DVB (5223): Rename USB_PID_MSI_MEGASKY55801 to USB_PID_MSI_MEGASKY580_55801
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:25 -02:00
Carl Lundqvist f0c3a2ca56 V4L/DVB (5221): Dvb-usb: initial support for MSI Mega Sky 580 DVB-T based on GL861
This patch adds support for MSI Mega Sky 580 / GL861 DVB-T USB2.0
Except for the 2 lines added to zl10353.c, zl10353_reset_attach needs
to be changed. If I read the code correctly setting parallel_ts will
take care of the 3rd byte, but the 2nd byte needs to be 0x0b instead
of 0x03 too. I guess these changes needs to be done only for this
device, not sure how to do that.
The zl10353 changes have been split apart from this patch, into the next
patch, soon to follow.

Signed-off-by: Carl Lundqvist <comabug@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:25 -02:00
Chris Pascoe 6345f0f642 V4L/DVB (5218): Zl10353: register definitions update
Update the descriptions of "discovered" registers on the zl10353, using the
equivalaent mt352 register names.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:25 -02:00
Antti Palosaari f7f57770dc V4L/DVB (5217): Zl10353: Implement TRL nominal rate calculation
Implement trl nominal rate calculation to Zarlink ZL10353 demod,
based on calculation used in Zarlink MT352.
This adds support for 6 and 8MHz bandwidth transponders.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:24 -02:00
Antti Palosaari 0a11bb865a V4L/DVB (5216): Zl10353: add i2c_gate_ctrl support
Implement I2C gate control for Megasky GL861 and SigmaTek AU6610 support.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:21 -02:00
Chris Pascoe 67b60aad16 V4L/DVB (5215): Experimental support for signal strength/BER/uncorrectable count
After studying many hours worth of register dumps of MT352 and ZL10353 fed
with identically damaged RF signals I have made an educated guess at which
registers contain the AGC level, bit error rate and uncorrectable error
count values.
Implement the IOCTLs that return these values to userspace.

Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:21 -02:00
Mike Isely 90060d32ca V4L/DVB (5212): Pvrusb2: Be more forgiving about encoder firmware size
The pvrusb2 driver previously rejected encoder firmware whose size was
not a multiple of 8192.  But this is a false check because it's
possible to find cx23416 firmware whose size doesn't conform to this
limit.  So change the firmware loader implementation to be more
forgiving of the image size.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:20 -02:00
Mike Isely 201779f5c4 V4L/DVB (5210): Pvrusb2: Fix printk format typo
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:20 -02:00
akpm@linux-foundation.org 6591691b25 V4L/DVB (5209): Kthread api conversion for dvb_frontend and av7110 fix
avoid double-up(), pointed out by Oliver.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:20 -02:00
Herbert Poetzl 8eec14295e V4L/DVB (5208): Kthread API conversion for dvb_frontend and av7110
dvb kernel_thread to kthread API port.  
It is running fine here, including module load/unload and software suspend
(which doesn't work as expected with or without this patch :).
I didn't convert the dvb_ca_en50221 as I do not have such an interface, but
if the conversion process is fine with the v4l-dvb maintainers, it should not
be a problem to send a patch for that too ...
Acked-by: Oliver Endriss <o.endriss@gmx.de>

Signed-off-by: Herbert Poetzl <herbert@13thfloor.at>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:20 -02:00
Thierry MERLE 2a9f8b5d25 V4L/DVB (5206): Usbvision: set alternate interface modification
- usb alternate selection modified to get the biggest endpoint packet size.
- fix sysfs get values for brightness/contrast/hue/saturation

Signed-off-by: Thierry MERLE <thierry.merle@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:19 -02:00
Thierry MERLE 6f78e186fe V4L/DVB (5205): Usbvision: dynamic allocation for frames
- fix decoder route output
- dynamic frame buffer allocation

Signed-off-by: Thierry MERLE <thierry.merle@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:19 -02:00
Adrian Bunk c65eeaab1f V4L/DVB (5200): V4l_printk_ioctl_arg() is no longer used.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:18 -02:00
Ahmed S. Darwish 0496daa7d8 V4L/DVB (5202): DVB: Use ARRAY_SIZE macro when appropriate
Use ARRAY_SIZE macro already defined in kernel.h

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
Acked-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:18 -02:00
Richard Knutsson fd4bc44553 V4L/DVB (5201): Radio/: Convert to generic boolean-values
Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:17 -02:00
Adrian Bunk db406b5855 V4L/DVB (5199): Cx88-video.c: remove struct radionorms
This patch removes the unused struct radionorms.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:17 -02:00
Jonathan Corbet 3198cf676c V4L/DVB (5198): Cafe_ccic.c fix warning
Quiet a spurious gcc warning.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:17 -02:00
Richard Knutsson e8be02a34a V4L/DVB (5197): Convert to generic boolean-values
Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:16 -02:00
Andrew Morton 7a9ca4a3f9 V4L/DVB (5196): VIDEO_BUF depends on PCI
m68k allmodconfig:
drivers/media/video/video-buf.c: In function 'videobuf_queue_pci':
drivers/media/video/video-buf.c:396: error: 'pci_map_sg' undeclared (first use in this function)
drivers/media/video/video-buf.c:396: error: (Each undeclared identifier is reported only once
drivers/media/video/video-buf.c:396: error: for each function it appears in.)
drivers/media/video/video-buf.c:399: error: 'pci_dma_sync_sg_for_cpu' undeclared (first use in this function)
drivers/media/video/video-buf.c:401: error: 'pci_unmap_sg' undeclared (first use in this function)
drivers/media/video/video-buf.c: In function 'videobuf_pci_dma_map':
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:16 -02:00
Adrian Bunk 346304097b V4L/DVB (5195): Frontends: make 4 functions static
This patch makes four needlessly global functions static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:16 -02:00
Robert P. J. Day 48fc923b0e V4L/DVB (5193): Remove the unused kernel config option VIDEO_VIDEOBUF
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:16 -02:00
Marco Schluessler 716a4e334e V4L/DVB (5189): Budget-av: Call saa7146_vv_release on exit
Call saa7146_vv_release on exit.

Signed-off-by: Marco Schluessler <marco@lordzodiac.de>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:15 -02:00
Oliver Endriss 6c91449021 V4L/DVB (5188): Add separate configuration data for subsystem 0x13c2:0x1012
Fixed problem reported by Teemu Suikki:
After a device with subsystem 0x13c2:0x1012 has been installed,
devices with subsystem id 0x13c2:0x1011 did not work anymore.

Reason:
	The driver for 0x13c2:0x1012 modified shared configuration data.
Fix:
	Use separate configuration data for those devices.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:15 -02:00
Hans Verkuil faeb4ab38f V4L/DVB (5183): Fix CC handling in VIDIOC_INT_G_VBI_DATA
When capturing a 60 Hz input the internal field ID is inverted. The
VIDIOC_INT_G_VBI_DATA didn't take that into account and so returned
XDS instead of CC and vice versa.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:14 -02:00
Hans Verkuil b7a01e723c V4L/DVB (5180): Fix cx2584x revision reporting.
Revisions >= 23 were always reported as revision 23.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:13 -02:00
Mike Isely 201f5c9caf V4L/DVB (5175): Pvrusb2: VIDIOC_DBG_[S|G]_REGISTER fixups
Support 64 bit register IDs internally.  Only allow root access to
this API (for both set and get).  Note that actual 64 bit access only
becomes possible once the definition for v4l2_register is updated, but
this change clears the way for it from the viewpoint of the pvrusb2
driver.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:13 -02:00
Mike Isely 6fe7d2c466 V4L/DVB (5174): Pvrusb2: video corruption fixes
Tweak the encoder setup in order to stop it from corrupting the video
data when there is a disruption in the data flow (e.g. a channel change).

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:12 -02:00
Mike Isely c43000ef0c V4L/DVB (5173): Pvrusb2: encoder comm protocol cleanup
Update the implementation of the communication protocol for operating
the encoder, using updated knowledge about the encoder.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:12 -02:00
Mike Isely 567d7115b9 V4L/DVB (5172): Pvrusb2: Control protocol cleanup
Several special-case FX2 commands were being issued through
pvr2_write_u16() and pvr2_write_8(), but there's really nothing
special case about them.  These date from a very early time in the
driver development.  This patch removes these functions and replaces
their use with calls to pvr2_send_request.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:12 -02:00
Mike Isely edae96bd72 V4L/DVB (5170): Pvrusb2: Add boilerplate to new header file
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:11 -02:00
Michael Krufky 8d3643637e V4L/DVB (5169): Pvrusb2: Use macro names for FX2 commands
This is a maintainability cleanup; use nice names for all the FX2
commands instead of raw bytes.  This way we can easily find where we
issue FX commands.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:11 -02:00
Trent Piepho 05ad390724 V4L/DVB (5166): Remove obsolete alias defines of CONFIG_* settings
The out of tree v4l-dvb build system didn't always override the kernel's
configuration settings with v4l-dvb's settings correctly.  To work around
this, makefiles would define some new macro based on the setting of a
config variable.  e.g. the pwc Makefile would define CONFIG_PWC_DEBUG if
CONFIG_USB_PWC_DEBUG (which is defined via Kconfig) was set.
The v4l-dvb build system should now always override correctly, and this
is no longer necessary.  This patch gets ride of these extra defines and
just uses the CONFIG_* settings directly.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:11 -02:00
Trent Piepho 6827709a61 V4L/DVB (5164): Compat: Handle input_register_device() change and some others
input_register_device() was changed to return an error code instead of
being void in 2.6.15.  Handle it with a macro wrapper in config.h.  For
this to work, linux/input.h must be included before config.h.  This
required some trivial header re-ordering in budget-ci.c and ttusb_dec.c.
In kernel 2.6.15-rc1 a helper function called setup_timer() was added to
linux/timer.h.  Add to compat.h, but require that linux/timer.h be
included first to give the definition of struct timer_list.
A new 4GB DMA zone, __GFP_DMA32, was added in 2.6.15-rc2.  Alias it to
__GFP_DMA on older kernels.
Handle another 2.6.15 "input_dev->dev to input_dev->cdev.dev" change for
some recently added code in cinergyT2.c.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:10 -02:00
Trent Piepho 62d50addf0 V4L/DVB (5163): Add checks for CAP_SYS_ADMIN to VIDIOC_DBG_G_REGISTER
Before, root privileges were only needed to set hardware registers, not
to read them.  On some hardware, reading from the wrong place at the
wrong time can hang the machine.  So, to be consistent, root privileges
are required to read registers on all hardware.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:10 -02:00
Trent Piepho e7b58f5259 V4L/DVB (5162): Change VIDIOC_DBG_[SG]_REGISTER ioctls' reg address to 64 bits
Maybe someday there will be a device with a register address space >
32-bits, or maybe an i2c device which uses a protocol > 4 bytes long to
address its registers.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:10 -02:00
Marco Schluessler e19c55ffb9 V4L/DVB (5161): Dvb-ttpci: call saa7146_vv_release() on exit
Call saa7146_vv_release() on exit.

Signed-off-by: Marco Schluessler <marco@lordzodiac.de>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:09 -02:00
Marco Schluessler 58af00456a V4L/DVB (5160): Saa7146_vv: pass correct memory size to pci_free_consistent
Pass correct memory size to pci_free_consistent.

Signed-off-by: Marco Schluessler <marco@lordzodiac.de>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:09 -02:00
Oliver Endriss 7857735b3a V4L/DVB (5158): Dvb-ttpci: Fixed unregistering the vbi device
Fixed unregistering the vbi device for cards without analog tuner.
Thanks to Marco Schluessler <marco@lordzodiac.de> for pointing out this bug.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:09 -02:00
Matthias Schwarzott 357a268d59 V4L/DVB (5157): Set phys, bustype, version, vendor and product for input device
Add phys-string, bustype, version, vendor and product to help udev and
others using EVIOCPHYS ioctl to identify the input device node.
Code taken (with little changes) from budget-ci.c

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:08 -02:00
Michael Schimek feaba7a96d V4L/DVB (5156): Fix: dma free is being called with wrong arguments
Functions buffer_release() in bttv-driver.c and
vbi_buffer_release() in bttv-vbi.c are ending with:
      bttv_dma_free(&fh->cap,fh->btv,buf);
 
For vbi it seems to be wrong. Both functions should end with:
 
      bttv_dma_free(q,fh->btv,buf);
Thanks to Peter Schlaf <peter.schlaf@web.de> for pointing this.

Signed-off-by: Michael H. Schimek <mschimek@gmx.at>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:08 -02:00
Mauro Carvalho Chehab 712642b8e3 V4L/DVB (5155): Properly initialize mute and radio frequency
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:08 -02:00
Mauro Carvalho Chehab f1557cebc8 V4L/DVB (5154): Add some debug info, depending on debug level
With debug>0, it will show mute/unmute and set frequency events
with debug>=4, it will show get frequency events
Also, some kernel CodingStyle fixes were done.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:06 -02:00
Mauro Carvalho Chehab b61f8d695c V4L/DVB (5153): Make it coherent with vidioc_g_tuner
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:35:03 -02:00
Mauro Carvalho Chehab a0c05ab976 V4L/DVB (5152): Implements VIDIOC_[S|G]_INPUT on radio-aztech/radio-maxiradio
fmtools use VIDIOCSTUNER, with, in turn, calls VIDIOC_S_INPUT on v4l1-compat.
So, those ioctls are required for V4L1  to work properly.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:58 -02:00
Mauro Carvalho Chehab 676b0ac7aa V4L/DVB (5151): Implement VIDIOC_[GS]_AUDIO on aztech
v4l1-compat requires those two ioctls to translate VIDIOC[SG]RADIO
into V4L2 calls.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:56 -02:00
Mauro Carvalho Chehab 140dcc46ed V4L/DVB (5150): Implement VIDIOC_[GS]_AUDIO on maxiradio
v4l1-compat requires those two ioctls to translate VIDIOC[SG]RADIO
 into V4L2 calls.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:56 -02:00
Mauro Carvalho Chehab 06470ed612 V4L/DVB (5149): Convert radio-maxiradio to use video_ioctl2
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:56 -02:00
Mauro Carvalho Chehab 99218fe478 V4L/DVB (5148): Convert radio-aztech to use video_ioctl2
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:55 -02:00
Mauro Carvalho Chehab b50e7fe993 V4L/DVB (5147): Make vivi driver to use vmalloced pointers
Before this patch, vivi were simulating a scatter gather DMA transfer.
While this is academic, showing how stuff really works on a real PCI 
device, this means a non-optimized code. 
There are only two memory models that vivi implements:
	1) kernel alloced memory. This is also used by read() method.
	   On this case, a vmalloc32 buffer is allocated at kernel;
	2) userspace allocated memory. This is used by most userspace apps.
	   video-buf will store this pointer.
	   a simple copy_to_user is enough to transfer data.
The third memory model scenario supported by video-buf is overlay mode. 
This model is not implemented on vivi and unlikely to be implemented on 
newer drivers, since now, most userspace apps do some post-processing 
(like de-interlacing).
After this patch, some cleanups may be done at video-buf.c to avoid 
allocating pages, when the driver doesn't need a PCI buffer. This is the 
case of vivi and usb drivers.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:55 -02:00
Trent Piepho 52ebc763d8 V4L/DVB (5146): Make VIDIOC_INT_[SG]_REGISTER ioctls no longer internal only
The direct register access ioctls were defined as kernel internal only,
but they are very useful for debugging hardware from userspace and are
used as such.  Officially export them.

VIDIOC_INT_[SG]_REGISTER is renamed to VIDIOC_DBG_[SG]_REGISTER 
Definition of ioctl and struct v4l2_register is moved from v4l2-common.h 
to videodev2.h.

Types used in struct v4l2_register are changed to the userspace 
exportable versions (u32 -> __u32, etc). 

Use of VIDIOC_DBG_S_REGISTER requires CAP_SYS_ADMIN permission, so move 
the check into the video_ioctl2() dispatcher so it doesn't need to be 
duplicated in each driver's call-back function. CAP_SYS_ADMIN check is 
added to pvrusb2 (which doesn't use video_ioctl2).

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:55 -02:00
Trent Piepho dbbff48f39 V4L/DVB (5144): Restore VIDIOC_INT_[SG]_REGISTER calls
Add support for these ioctls to the video_ioctl2 system and the cx88
driver.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:54 -02:00
Michael Krufky 758117c25b V4L/DVB (5142): M920x: move filter caps from device caps to adapter caps
Move filter caps from device caps to adapter caps for the megasky driver.
This fixes usb1.1 operation.

Signed-off-by: Aapo Tahkola <aet@rasterburn.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:54 -02:00
Michael Krufky e16c1f5564 V4L/DVB (5141): M920x: group tuner / demod callback functions together
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:54 -02:00
Michael Krufky fa94805d03 V4L/DVB (5140): Whitespace / 80-column cleanups
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:53 -02:00
Aapo Tahkola 84ad7574f6 V4L/DVB (5139): M920x: Fix tuner identification bug with qt1010 module
Fixes qt1010 identification bug with megasky caused by
the Quantek QT1010 tuner module patch.

Signed-off-by: Aapo Tahkola <aet@rasterburn.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:53 -02:00
Michael Krufky 816172f8b9 V4L/DVB (5138): Kconfig: qt1010 should be selected by m920x
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:53 -02:00
Antti Palosaari cbdc80ed8f V4L/DVB (5137): Dvb: add new qt1010 tuner module
QT1010:
- old qt1010-code totally rewritten and put in own kernel module
- same enhancements as my earlier QT1010 125kHz patch
- tuner initialization
- register 1f calculation
- register 20 calculation
- register 25 calculation

m920x: (MSI Megasky)
- use new QT1010 module instead of old code

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:53 -02:00
Michael Krufky 1f61f3bab3 V4L/DVB (5136): M920x: correct oops when loading module
move .caps from the adapter properties to the device properties.
Thanks to Martin Schwier for confirming this fix.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:52 -02:00
Jan Nijs 565ef12713 V4L/DVB (5135): Qt1010: correct hardlockup when an app access the DVB dongle
This patch changes qt1010.h to use dvb_usb_device struct instead of a
dvb_usb_adapter for accessing the private area of the driver.
Without this patch my PC hard locks when an application tries to access
the DVB tuner.

Signed-off-by: Jan Nijs <jan.nijs@scarlet.be>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:52 -02:00
Michael Krufky e2d79439c2 V4L/DVB (5134): M920x: fix build in hg tree / other trivial fixes
- removed extra newline
- removed NULL entry
- fixed versions.txt

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:52 -02:00
Michael Krufky 6cf2a10180 V4L/DVB (5133): M920x: move qt1010_tuner_attach function into qt1010.h
The megasky_tuner_attach function is not specific to this device.
This patch renames it to qt1010_tuner_attach and moves it into the qt1010
header file.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:51 -02:00
Patrick Boettcher 94a47dc433 V4L/DVB (5132): M920x: more trivial cleanups
- Removed some needless brances
- Removed an unneeded check for adapter[0]
- Removed unneeded declaration of .generic_bulk_ctrl_endpoint = 0x01

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:51 -02:00
Michael Krufky 26f48eaa9e V4L/DVB (5131): M920x: more cleanups
Some cleanups and suggestions from Patrick Boettcher.
Dropped the mutex in m9206_rc_query using #if 0, because
M9206_CORE, M9206_I2C, M9206_FILTER and M9206_FW can be accessed
concurrently.
Thanks to both Aapo Tahkola and Patrick Boettcher.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:51 -02:00
Aapo Tahkola e2adbecf72 V4L/DVB (5130): M920x: misc updates and fixes
- hardware pid filtering no longer enabled unless in usb 1.x mode
- more responsive rc handling
- some minor bug fixes and code refolding
- m9206_write delay dropped (doesn't seem to be needed)

Signed-off-by: Aapo Tahkola <aet@rasterburn.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:50 -02:00
Michael Krufky 017cf01257 V4L/DVB (5129): M920x: break out qt1010 tuner code into a separate file
qt1010 is a tuner used in some other devices, so this code should be put
into a separate file so that it could be reused by other drivers.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:50 -02:00
Michael Krufky 2a2bfa7d61 V4L/DVB (5128): M920x: trivial cleanups
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:50 -02:00
Michael Krufky 01cb34dba9 V4L/DVB (5127): M920x: update megasky driver for recent changes in the dvb tree
update code to use dvb_attach()
update code to reflect recent changes to the dvb_usb framework

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:50 -02:00
Michael Krufky baa2ed0900 V4L/DVB (5126): M920x: cleanups after rename from megasky.[ch]
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:49 -02:00
Michael Krufky 2aef7d0fa0 V4L/DVB (5125): Dvb-usb: rename megasky.[ch] to m920x.[ch]
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:49 -02:00
Aapo Tahkola 5fecd9fd42 V4L/DVB (5124): Dvb-usb: Initial support for MSI Mega Sky 580 based on Uli m9206
Currently, the driver works in bulk mode supporting both USB 2.0 and
1.0 with and without hardware pid filters.
The ULi m9205 also supports isochronous transfer mode, but I have
dropped support for it because it depends on firmware and does not work
on all USB host chips. Further, I have no firmware with remote
controller support for this mode.

Signed-off-by: Aapo Tahkola <aet@rasterburn.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:49 -02:00
Tino Keitel ef7b8b725b V4L/DVB (5121): Proper vendor/device ID for the CinergyT2 input device
I noticed that udev does not create a symlink for the CinergyT2 remote input
device in /dev/input/by-id, which is required if I want to have a
unique device name for lircd.
The attached patch tries to achive this. However, udev still omits the
input device for /dev/input/by-id symlinks. I think something is still
not reported correctly.

Signed-off-by: Tino Keitel <tino.keitel@tikei.de>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:48 -02:00
Mauro Carvalho Chehab 5cc1dd8c3d V4L/DVB (5117): Fix: VIDIOC_G_TUNER were returning an endless number of tuners
pvrusb2 have only one tuner inside. However, as it were not handling
index, a call to v4l-info were returning as if it were an infinite
number of tuners:
$ v4l-info|grep VIDIOC_G_TUNER |head -5
    VIDIOC_G_TUNER(0)
    VIDIOC_G_TUNER(1)
    VIDIOC_G_TUNER(2)
    VIDIOC_G_TUNER(3)
    VIDIOC_G_TUNER(4)

Acked-by: Mike Isely <isely@isely.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:48 -02:00
Mauro Carvalho Chehab 69b04f0dc1 V4L/DVB (5116): Remove some warnings when compiling on x86_64
pvrusb2-encoder.c: In function 'pvr2_encoder_cmd':
pvrusb2-encoder.c:195: warning: format '%u' expects
	type 'unsigned int', but argument 3 has type 'long unsigned int'
pvrusb2-encoder.c:205: warning: format '%u' expects
	type 'unsigned int', but argument 3 has type 'long unsigned int'
pvrusb2-encoder.c: In function 'pvr2_encoder_vcmd':
pvrusb2-encoder.c:303: warning: format '%u' expects
	type 'unsigned int', but argument 3 has type 'long unsigned int'

Acked-by: Mike Isely <isely@isely.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:47 -02:00
Heiko Baums 05eda24968 V4L/DVB (5114): Cx88: Add support for svideo/composite input of the Terratec Cinergy 1400 DVB-T
Adds support for the combined S-Video/Composite input of the
Terratec Cinergy 1400 DVB-T.

Signed-off-by: Heiko Baums <heiko@baums-on-web.de>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:47 -02:00
Marco Schluessler 4cbca185e9 V4L/DVB (5113): Adds video output routing
Nexus CA needs to use a different routing on saa7115 module.

Signed-off-by: Marco Schluessler <marco@lordzodiac.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:47 -02:00
Michael Krufky 9de271e66d V4L/DVB (5111): Saa7134: add support for Terratec Cinergy HT PCI
Add support for Terratec Cinergy HT PCI

Signed-off-by: Giorgio Moscardi <software@sukkology.net>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:47 -02:00
Mauro Carvalho Chehab a4b662f736 V4L/DVB (5110): Keep the previous tvnorm default for cx88 and cx88-blackbird
The video_ioctl2 conversion replaced the default from NTSC to PAL_BG.
This broke cx88-blackbird. Probably, there are some badness at this
driver, not doing all required stuff to change video standard.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:46 -02:00
Mauro Carvalho Chehab b3c4ee7016 V4L/DVB (5109): Convert cx88-blackbird to use video_ioctl2
This patch finishes cx88-blackbird conversion to use video_ioctl2. Video
standards are generated automatically inside videodev.c. the big ioctl
parser is removed, using, instead, video_ioctl2.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:46 -02:00
Mauro Carvalho Chehab 7730bef9c5 V4L/DVB (5108): Remove_cx88_ioctl
cx88_ioctl were merged at the master ioctl handler on cx88-blackbird

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:46 -02:00
Mauro Carvalho Chehab 84f1b6783a V4L/DVB (5107): Use cx88_set_freq() on cx88-blackbird.c
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:45 -02:00
Mauro Carvalho Chehab 1571720c5e V4L/DVB (5106): Do some cleanups at cx88-blackbird
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:45 -02:00
Mauro Carvalho Chehab 23154f2f3b V4L/DVB (5105): Reorder some ioctl handlers
Reorder some ioctl handlers to make easy to convert to video_ioctl2

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:45 -02:00
Mauro Carvalho Chehab ed10b06d8d V4L/DVB (5104): Moved several stuff that were at cx88-video to cx88-blackbird.c
cx88-blackbird were using some ioctl handling that were previously on
cx88-video.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:44 -02:00
Mauro Carvalho Chehab 243d8c0fd0 V4L/DVB (5103): Fix vidioc_g_tuner handling
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:44 -02:00
Mauro Carvalho Chehab 63ab1bdc3b V4L/DVB (5102): make videodev to auto-generate standards
v4l2_tvnorm were meant to describe video standards and its names to V4L2 API.
However, this were doing by some static structures at the driver.

This patch changes the internals in a way that, at the driver, only a
v4l2_tvnorm (a 64 bit integer) should be filled, with all supported 
tvnorms. videodev will dynamically generate the proper API array
based on supported standards.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:44 -02:00
Mauro Carvalho Chehab e90311a198 V4L/DVB (5101): Renamed video_mux to cx88_video_mux
video_mux is renamed to cx88_video_mux to be exported to cx88-blackbird

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:44 -02:00
Mauro Carvalho Chehab 54da49f5a4 V4L/DVB (5100): Make cx88-blackbird to work again
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:43 -02:00
Mauro Carvalho Chehab c526ab91a2 V4L/DVB (5099): Uncommented NTSC/443 video standard
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:43 -02:00
Mauro Carvalho Chehab 1427f6b6b9 V4L/DVB (5098): Added support for V4L2_STD_NTSC_443
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:43 -02:00
Mauro Carvalho Chehab 8d87cb9f31 V4L/DVB (5097): Convert cx8800 driver to video_ioctl2 handler
video_ioctl2 handler provides V4L2 API parsing.
Using it makes the driver simpler, and isolates API parsing.
This allows future reusage of driver controls using other ways, like sysfs
and/or procfs and increases isolation of driver-specific handling from the
generic common ioctl processing.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:42 -02:00
Pantelis Koukousoulas fd69496461 V4L/DVB (5095): Pvrusb2: Allow VIDIOC_S_FMT with -1 for resolution values
With the previous patch, mplayer started but was polling the video
device forever without any video actually coming out. Further analysis
showed that it does a VIDIOC_S_FMT with width and height set to -1 (!!!).
The code handling this only cares that both are lower than the minimum
range allowed so it ends up setting the size to 19x17 (!!) This pretty
much breaks the encoder here. Even if this breakage is yet another (TM)
result of my setup, setting the size to 19x17 by default would surprise
most users IMHO.
So, special case for -1 and interpret this to be a request for the
default size, please. Users can then set their favorite size both
through mplayer and through sysfs.
With this patch, mplayer finally works in pvr:// mode (not that we
really gain anything over operating it through sysfs with lirc,
sometime I might actually get off my lazy a** and contribute this
setup too)

Signed-off-by: Pantelis Koukousoulas <pakt223@freemail.gr>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:42 -02:00
Pantelis Koukousoulas 848ed3ca2a V4L/DVB (5094): Pvrusb2: Introduce fake audio input selection
This should allow mplayer pvr:// to start. The trick is that no matter
what actual input we use under this "fake" one, it will be able to do
stereo :-)

Signed-off-by: Pantelis Koukousoulas <pakt223@freemail.gr>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:42 -02:00
Mike Isely 606cf9caeb V4L/DVB (5093): Pvrusb2: Emit VIDIOC_S_TUNER correctly
Audio mode changes are not private to the audio chip - other I2C
modules need to see this as well.  And since the command in question
is VIDIOC_S_TUNER which is a standard v4l2 command, we really should
be broadcasting it out.  This change sets up a broadcast pathway for
VIDIOC_S_TUNER and also eliminates the now redundant code from the
audio chip handler.
This fix enables stereo reception for the FM radio

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:41 -02:00
Mike Isely 27c7b710a4 V4L/DVB (5092): Pvrusb2: Use ARRAY_SIZE wherever possible
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:41 -02:00
Mike Isely ca545f7c39 V4L/DVB (5091): Pvrusb2: Use kzalloc in place of kmalloc/memset pairs
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:41 -02:00
Ahmed S. Darwish eca8ebfc11 V4L/DVB (5090): Pvrusb2: A patch to use ARRAY_SIZE macro when appropriate
Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:40 -02:00
Mike Isely c1c2680d92 V4L/DVB (5089): Pvrusb2: V4L EXT_CTRLS fixup
Attempts to enumerate or operate on a group of EXT_CTRLS where the
group size is zero is OK; don't fail on such operations.  At least one
application uses this to probe for the existence of this API so let it
succeed.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:40 -02:00
Mike Isely af75453860 V4L/DVB (5088): Pvrusb2: Minor dead code / comment cleanups
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:40 -02:00
Mike Isely 293b5d94eb V4L/DVB (5087): Pvrusb2: Fix sizeof() calculation foul-up
This bug caused uninitalized data to be returned during a G_TUNER status poll.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:40 -02:00
Mike Isely 11fc76c9a8 V4L/DVB (5086): Pvrusb2: Fix missing break statement on VIDIOC_S_TUNER
The lack of a break statement in the handling of VIDIOC_S_TUNER caused
errors to result.  Fixed.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:39 -02:00
Mike Isely 8433544ea9 V4L/DVB (5085): Pvrusb2: trace print added
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:39 -02:00
Mike Isely 644afdb9cc V4L/DVB (5084): Pvrusb2: Stop hardcoding frequency ranges
Rather than hardcoding frequency ranges everywhere, rely on
VIDIOC_G_TUNER results wherever we can.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:39 -02:00
Mike Isely 7c74e57e6f V4L/DVB (5083): Pvrusb2: Remove automodeswitch control
The automodeswitch control was a feature that enable automatic radio /
tv switching based on the selected frequency.  However since frequency
ranges can overlap and also since apparently in some cases it's
possible for the same frequency range to be both tv and radio in a
specific region, then this feature can't safely work.  So it's removed.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:38 -02:00
Mike Isely fe23a2809d V4L/DVB (5082): Pvrusb2: Slight debug printing efficiency fixup
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:38 -02:00
Mike Isely 18103c57b0 V4L/DVB (5081): Pvrusb2: VIDIOC_G_TUNER cleanup
Clean up use of VIDIOC_G_TUNER; we now correctly gather info from all
the I2C client modules.  Also abide by V4L2_TUNER_CAP_LOW
appropriately.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:38 -02:00
Mike Isely af78a48b69 V4L/DVB (5080): Pvrusb2: Allow streaming from /dev/radioX
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:37 -02:00
Mike Isely 4b85dee6a0 V4L/DVB (5079): Pvrusb2: Use kzalloc instead of kmalloc+memset pairs
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:37 -02:00
Mike Isely 6710fb868b V4L/DVB (5078): Pvrusb2: It's safe to kfree() a null pointer
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:37 -02:00
Michael Schimek e5bd0260e7 V4L/DVB (5077): Bttv cropping support
Adds the missing VIDIOC_CROPCAP, G_CROP and S_CROP ioctls, permitting 
applications to capture or overlay a subsection of the picture or to 
extend the capture window beyond active video, into the VBI area and the 
horizontal blanking. VBI capturing can start and end on any line, 
including the picture area, and apps can capture different lines of each 
field and single fields.
For compatibility with existing applications, the open() function
resets the cropping and VBI capturing parameters and a VIDIOC_S_CROP
call is necessary to actually enable cropping. 
Regrettably in PAL-M, PAL-N, PAL-Nc and NTSC-JP mode the maximum image 
width will increase from 640 and 768 to 747 and 923 pixels respectively.
Like the VBI changes however, this should only affect applications which 
depend on former driver limitations, such as never getting more than 640 
pixels regardless of the requested width. 
Also, new freedoms require additional checks for conflicts and some 
applications may not expect an EBUSY error from the VIDIOC_QBUF and 
VIDIOCMCAPTURE ioctls. These errors should be rare though.
So far, the patch has been tested on a UP machine with a bt878 in PAL-
BGHI and NTSC-M mode using xawtv, tvtime, mplayer/mencoder, zapping/
libzvbi and these tools: http://zapping.sf.net/bttv-crop-test.tar.bz2
I'd be grateful about comments or bug reports.

Signed-off-by: Michael H. Schimek <mschimek@gmx.at>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:36 -02:00
Alexey Dobriyan 13071f0a58 V4L/DVB (5076): Cpia.c: buffer overflow
If assigned minor is 10 or greater, terminator will be put beyound the end.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:35 -02:00
Mike Isely c74e006268 V4L/DVB (5059): Pvrusb2: Be smarter about mode restoration
Switch back to the previous input selection when the radio device is
closed - but only do that if the current input selection is still the
radio (i.e. it appears that it hasn't been messed with).

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:35 -02:00
Mike Isely cdef8bd8c6 V4L/DVB (5058): Pvrusb2: bug fix involving switch into radio mode
When the input is switched by opening /dev/radioX, we must also commit
that change into the driver core.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:35 -02:00
Mike Isely 16eb40d37d V4L/DVB (5057): Pvrusb2: Stream configuration cleanups
Clean up and tighten logic involving stream configuration.  This
mainly involves changes to pvrusb2-v4l2.c, where we better clarify how
we use the stream configuration enum and implement a cleaner means to
control streaming for a given device node.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:34 -02:00
Mike Isely f13ed249ed V4L/DVB (5056): Pvrusb2: Fix cut/paste bug in auto_mode_switch control
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:34 -02:00
Mike Isely 7a4a3770dd V4L/DVB (5054): Pvrusb2: cosmetic comment tweak
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:34 -02:00
Mike Isely 139eecf94c V4L/DVB (5053): Pvrusb2: Change default volume to something sane
The default volume of 65535 is too high.  Make is something smaller.
Note that this _only_ changes the default value.  Specifically, there
are no scaling or other more intrusive changes here.  I'm just sick of
constantly having to reduce the volume every time I plug in and test
the device!  (And unfortunately we can't do a better fix like scaling
the volume so that 65535 makes sense because doing so will screw up
any app - like MythTV - which expects the old scaling.)  Too bad V4L
controls don't have better defined ranges.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:34 -02:00
Mike Isely 62f5fdace7 V4L/DVB (5052): Pvrusb2: Remove stream claiming hack from /dev/radio
Trying to temporarily check that the stream is not claimed during open
of the radio device is at best a race condition.  What's to stop
another app from claiming the stream anyway the instant after the
check is done?  The implementation for this was dicey anyway.  So it's
removed.  The only "price" for this is that if /dev/radioX is opened
while streaming video, then the video stream is just going to switch
to radio mode anyway.  If a user does this, he gets what he expects...

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:33 -02:00
Mike Isely 1bde02891b V4L/DVB (5051): Pvrusb2: Better radio versus tv frequency handling
Separate track radio versus tv frequency so that when we switch modes
we can also switch to a sane frequency appropriate for the mode.  Also
implement logic to automate mode switching in certain cases.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:33 -02:00
Mike Isely 5549f54f46 V4L/DVB (5050): Pvrusb2: Newer frequency range checking
Implement new method for doing integer range checking, so that we can
more intelligently range-check radio and tv ranges at once.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:33 -02:00
Mike Isely 2083230084 V4L/DVB (5049): Pvrusb2: Enable radio mode for 24xxx devices
These changes implement correct audio routing for radio mode on a
24xxx device.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:32 -02:00
Mike Isely c0e69315ed V4L/DVB (5048): Pvrusb2: v4l2 API implementation frequency tweaks
Report and set correctly converted frequency to/from a V4L2 app.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:32 -02:00
Mike Isely f1382122ab V4L/DVB (5047): Pvrusb2: Fix tuning calculation when in radio mode
Frequency units in V4L2 are apparently different when in radio mode
compared to tv mode.  Why?  Who knows.  This change adapts the driver
appropriately - so that internally we always only deal in Hz and don't
have to muck with craziness like this.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:32 -02:00
Mike Isely 5a8a0a1642 V4L/DVB (5046): Pvrusb2: Fix tuner frequency calculation
A conversion from Hz to V4L frequency units was accidentally removed
by an earlier change.  Restore it.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:31 -02:00
Mike Isely 0f0f257b7b V4L/DVB (5045): Pvrusb2: Fix heap corruption introduced by radio mods
We can't allocate v4l device structures in a block, since the v4l core
governs when each device actually gets freed.  This bug was introduced
as part of the core radio implementation.  Fix it.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:31 -02:00
Mike Isely 5e6862cefe V4L/DVB (5044): Pvrusb2: Allow overriding vbi and radio device minor numbers
Support specification of vbi and radio device minor numbers in a
manner similar to the video device minor number.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:29 -02:00
Mike Isely f5156b06ac V4L/DVB (5043): Pvrusb2: video standard broadcast fix for radio mode
Ensure we don't accidentally broadcast the standard while in radio mode.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:24 -02:00
Mike Isely 98752102dc V4L/DVB (5042): Pvrusb2: Make units uniform when tracking tuning frequency
The initial radio implementation used different units for tuning when
in radio mode.  This changes everything to Hz.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:24 -02:00
Mike Isely 8079384eeb V4L/DVB (5041): Pvrusb2: Use separate enumeration for get/store of minor number
Use separate enum for get/store of minor number; we want pvr2_config
to go away eventually and since it really means something different,
don't use it here

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:24 -02:00
Mike Isely fd5a75fe00 V4L/DVB (5040): Pvrusb2: Use enumeration for minor number get / store code
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:23 -02:00
Pantelis Koukousoulas ae2b9e25fd V4L/DVB (5039): Pvrusb2: Implement /dev/radioX
The "main" V4L2 interface patch. This is yet very incomplete, incorrect and
probably inappropriate for inclusion as-is, but at least with this I 'm able
to tune and play radio through a V4L2 program (pvr-radio.c, a "thumb" version
of ivtv-radio.c with just the essentials).

Therefore, it kinda gives an idea of what is needed to support this, hm,
interface (partly used also by e.g., kradio). Please point out any mistakes
on this code. I 'm sure I 'm messing up some struct initialization somewhere
but currently I 'm too lazy to actually think this through until I complete
the functionality (e.g., handle the VIDIOC_S_STD, ENUMINPUT, etc ioctls
appropriately).

Signed-off-by: Pantelis Koukousoulas <pakt223@freemail.gr>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:23 -02:00
Pantelis Koukousoulas 99cfdf5cc6 V4L/DVB (5038): Pvrusb2: Implement stream claim checking function
Add (and expose) a new function, pvr2_channel_check_stream_no_lock(), in
pvrusb2-context.c. This is hopefully the last V4L2 interface related patch
to change anything outside pvrusb2-v4l2.c.

We need this to implement the open() for the radio device. The reason is
that within the *enter_context() section of open() we need to ensure nobody
is streaming and if we cannot, we should cleanup after ourselves and return
 -EBUSY. We cannot just use claim_stream() because:

   1) That would cause a deadlock trying to re-acquire the context lock
   2) We only need to ensure that nobody is streaming. We don't need to
      actually acquire the stream.

Again, this is a kinda ugly patch. Feel free to improve.

Signed-off-by: Pantelis Koukousoulas <pakt223@freemail.gr>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:23 -02:00
Pantelis Koukousoulas 2fdf3d9c94 V4L/DVB (5037): Pvrusb2: Implement multiple minor device number handling
This is the first patch in preparation of the V4L2/IVTV radio interface.
It does away with the assumption of only one minor per device. It also
adds a file to show the radio minor as well. This can be useful for a
program like pvr-radio.c (when it grows up), since this way it can search
for the minor of the /dev/radioX device it opened and use the video minor
of the same driver instance to get to the actual stream.

The implementation looks kinda ugly. Feel free to improve (that is the
reason behind separate patches anyway).

Signed-off-by: Pantelis Koukousoulas <pakt223@freemail.gr>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:22 -02:00
Pantelis Koukousoulas 6fcb5b3ef7 V4L/DVB (5036): Pvrusb2: Fix for min/max control value checking
In the previous patch we exploited the get_{min,max}_value facility to adjust
min/max allowable frequencies on the fly, depending on tuner mode.

Unfortunately, this facility was not used inside the *sym_to_val() function
that translates what we echo to sysfs, which means we got an -ERANGE despite
asking for a frequency between what we read to be min/max.
This patch corrects this small omission.

Signed-off-by: Pantelis Koukousoulas <pakt223@freemail.gr>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:22 -02:00
Pantelis Koukousoulas 25d8527a44 V4L/DVB (5035): Pvrusb2: Enable radio mode round #2
This is the logic that:
  a) Ensures /sys/class/pvrusb2/sn-*/ctl_frequency/{max,min}_val are
     "automagically" reset to sane values on each mode change.

  b) Allows tuning to a radio frequency by something like:
     echo `perl -e "print int(94.9*16000 + 0.5)"` \
       > /sys/class/pvrusb2/sn-*/ctl_input/cur_val


The trick was to take advantage of the already existing .get_{min,max}_value
function pointers in pvr2_ctrl, to "dynamically override" the hardcoded values
for min/max frequency at runtime.

For a moment I thought to dispose of the hardcoded MIN/MAX_FREQ and use the
hirange/lowrange fields of the v4l2_tuner struct instead, but then I see that
tuner-core.c kinda hardcodes these as well, so I decided to not bother.

Signed-off-by: Pantelis Koukousoulas <pakt223@freemail.gr>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:22 -02:00
Pantelis Koukousoulas 275b2e283b V4L/DVB (5034): Pvrusb2: Enable radio mode round #1
This is the logic that supports switching modes via e.g.,
  echo radio > /sys/class/pvrusb2/sn-*/ctl_input/cur_val.

To do the mode switching we need to:
a) broadcast AUDC_SET_RADIO and
b) issue the CX2341X_ENC_MUTE_VIDEO command to the encoder. 

The first is done by adding a new pvr2_i2c_op and having it trigger on 
input change, the second by adding this command in pvr2_encoder_start() 
and requesting an encoder restart on input change by setting 
stale_subsys_mask appropriately. 

The clues about AUDC_SET_RADIO and CX2341X_ENC_MUTE_VIDEO were kindly 
provided by Hans Verkuil on the pvrusb2 mailing list. The idea to 
implement mode switching this way (on input change) is due to Mike Isely.

Why AUDC_SET_RADIO/VIDIOC_S_STD are used for switching? I can 't be sure, 
but I think this can be traced to a cornell student being the first to 
implement radio support in ivtv "as a different standard". I think the 
rest just evolved from there (it 's in the ivtv ML archives).

Signed-off-by: Pantelis Koukousoulas <pakt223@freemail.gr>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:21 -02:00
Mauro Carvalho Chehab 0b60051286 V4L/DVB (5074): Some fixes at stream waitqueue on vivi
There are several potential troubles on vivi waitqueue code:
- Watchdog timer should be reset at every received frame;
- Watchdog timer should be reset at the beginning of vivi_thread();
- Checks for errors when creating a newer thread with kernel_thread();
- Wake up vivi_thread() after creating it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:21 -02:00
Mauro Carvalho Chehab df3a710458 V4L/DVB (5073): Fix OOPS on some waitqueue conditions
If for some reason vivi_thread() fails, vivi will suffer an OOPS at
thread stop code, since waitqueue wouldn't be properly initializated.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:21 -02:00
Ville-Pekka Vainio ae1942c571 V4L/DVB (5070): Budget-ci: add support for the Technotrend 1500 bundled remote
The keymap is based on a previous patch by Jussi Kukkonen.
This remote is identified by subsystem_device id 0x1010.

Signed-off-by: Ville-Pekka Vainio <vpivaini@cs.helsinki.fi>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:20 -02:00
Mauro Carvalho Chehab 43db48d3d2 V4L/DVB (5068): Fix authorship references
Bill Dirks asked me to update his entries at kernel files, since
he change his e-mail.
I've also updated a few web broken links or obsolete info to the curent
sites where V4L drivers and API are being discussed currently.

CC: Bill Dirks <bill@thedirks.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:20 -02:00
Luca Risolia 2656312724 V4L/DVB (5064): ET61X251 driver updates.
- Implement audio ioctl's and VIDIOC_ENUM_FRAMESIZES
- Documentation updates
- Generic improvements

Signed-off-by: Luca Risolia <luca.risolia@studio.unibo.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:20 -02:00
Luca Risolia 7e3a066070 V4L/DVB (5063): ZC0301 driver updates.
- Implement audio ioctl's and VIDIOC_ENUM_FRAMESIZES
- Documentation updates
- Generic improvements

Signed-off-by: Luca Risolia <luca.risolia@studio.unibo.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:19 -02:00
Luca Risolia f327ebbd00 V4L/DVB (5062): SN9C102 driver updates
- Add support for SN9C105 and SN9C120
- Add some more USB device identifiers
- Add support for OV7660
- Implement audio ioctl's and VIDIOC_ENUM_FRAMESIZES
- Add preliminary support for 0x0c45/0x6007
- Documentation updates
- Generic improvements
Signed-off-by: Luca Risolia <luca.risolia@studio.unibo.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:19 -02:00
Michael Krufky 19790db00b V4L/DVB (5061): Bt8xx: add support for Ultraview DVB-T Lite
Ultraview DVB-T Lite is a clone of DViCO FusionHDTV DVB-T Lite

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:19 -02:00
Dwaine Garden de6a1b8edc V4L/DVB (5032): Improves some USBVision info messages
Replaces the info statements with printk(KERN_INFO statements.
This will cut down on the useless information which is showing up
 in the kernel messages log file.

Signed-off-by: Dwaine P. Garden <DwaineGarden@rogers.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:18 -02:00
Dmitry Torokhov c190495681 V4L/DVB (5025): Cleanup: switch to using msecs_to_jiffies() on bttv
PS.: Part of the changes at the original patch were removed due to the changes
done at commit 52c14e794f6ce345343a6b8fc98ea4e0ba2dfce4

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:18 -02:00
Mariusz Kozlowski cededbfcbc V4L/DVB (5028): Tvmixer module_put cleanup
Removes redundant argument check for module_put()

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:18 -02:00
Mariusz Kozlowski ac32898930 V4L/DVB (5027): Cpia module_put cleanup
No need for redundant argument check for module_put()

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:17 -02:00
Mariusz Kozlowski 22071a42a1 V4L/DVB (5026): Pvrusb2-hdw kfree cleanup
Removes redundant argument check for kfree().

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:17 -02:00
Adrian Bunk 4a06b538d6 V4L/DVB (5018): Make usbvision_rvfree() static
usbvision_rvfree() can now become static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:16 -02:00
Adrian Bunk c408a6f673 V4L/DVB (5017): DVB: fix compile error
This patch fixes the following compile error:
<--  snip  -->
...
  LD      drivers/media/video/built-in.o
drivers/media/video/saa7134/built-in.o:(.data+0x85ec): multiple definition of `ir_rc5_remote_gap'
drivers/media/video/bt8xx/built-in.o:(.data+0x734c): first defined here
drivers/media/video/saa7134/built-in.o:(.data+0x85f0): multiple definition of `ir_rc5_key_timeout'
drivers/media/video/bt8xx/built-in.o:(.data+0x7350): first defined here
make[4]: *** [drivers/media/video/built-in.o] Error 1
<--  snip  -->
Since this variables were needlessly global, this patch implements the
trivial fix of making them static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:16 -02:00
Juan Pablo Sormani c36c459a55 V4L/DVB (5015): Add support for more Encore TV cards
Signed-off-by: Juan Pablo Sormani <sorman@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:16 -02:00
Mauro Carvalho Chehab 95efa03bd6 V4L/DVB (5012a): Remove some unused code from kernel mainstream
There are some long time unused code under some media driver source files. 
There's no need of keeping it at mainstream.
Those unused code will remain available at V4L/DVB master tree and also at
kernel history.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:15 -02:00
Tobias Klauser d9bdf77296 V4L/DVB (5011): DVB: Remove unneeded void * casts in ttpci/av7110
The patch removes unneeded void * casts for the following (void *) pointers:
- struct file: private_data
- struct dvb_device: priv
- struct dvb_demux: priv
- struct dvb_adapter: priv
The patch also contains some whitespace and coding style cleanups in the
relevant areas.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:15 -02:00
Antti Seppälä 9d85d776cb V4L/DVB (4999): [PATCH] Cablestar2 support
This patch changes the initialization of alps tdee4 tuner in
flexcop-fe-tuner.c to match what is used in the old driver that was
written specifically for Cablestar cards by Patrick Boettcher. This
patch should make Cablestar2 work again with recent dvb drivers without
breaking other stv0297 based cards.

Signed-off-by: Antti Seppala <ajhseppa@niksula.hut.fi>
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:15 -02:00
Mario Rossi e3ab2fdd3f V4L/DVB (4998): [PATCH] DIB3000MC and NOVA T USB2 #2
Second part of the patch to make the autosearch work again with DiB3000P/MC.

Signed-off-by: Mario Rossi <mariofutire@googlemail.com>
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:14 -02:00
Steven Walter d1158f469c V4L/DVB (4989): Saa7134: add support for the Encore ENL-TV
Add a board definition for the Encore ENL-TV card, and
adds its PCI subdevice to the ID table.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:14 -02:00
Hans Verkuil 75558ab92d V4L/DVB (4986): Removed unimplemented cx2341x API commands
The commands CX2341X_DEC_SET_AUDIO_OUTPUT, CX2341X_DEC_SET_AV_DELAY and
CX2341X_ENC_SET_3_2_PULLDOWN are not implemented in the Conexant firmware.
So these commands are removed. This also means that the V4L2_CID_MPEG_VIDEO_PULLDOWN
control in cx2341x.c and pvrusb2-hdw.c is removed.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:13 -02:00
Hermann Pitton 8387c66c7f V4L/DVB (4962): Add the Composite over S-Video input on the Asus P7131 Dual
This makes a second CVBS input available.

Signed-off-by: Hermann Pitton <hermann-pitton@arcor.de>
Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:12 -02:00
Hermann Pitton 9160723ed6 V4L/DVB (4961): Add support for the ASUS P7131 remote control
Besides adding the board specific code, this patch moves
the RC5 decoding code from bt8xx to ir-functions.c to make it available 
for all drivers.

Signed-off-by: Marc Fargas <telenieko.telenieko.com>
Signed-off-by: Hermann Pitton <hermann-pitton@arcor.de>
Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21 13:34:12 -02:00
Alan 16728da998 pata_sl82c105: remove un-needed code paths
Remove the DMA setup function. As pointed out by Sergey we set the actual
DMA clock timing in set_dmamode so we don't actually need to do anything
with it at set up time, but just leave the PIO timings loaded.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21 04:58:20 -05:00
Alan cb0e34ba59 pata_sil680: Assorted fixes
Correct iordy handling and DMA bit flag handling.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21 04:58:20 -05:00
Alan b7939b14d8 pata_oldpiix: Call both PIO and DMA setup functions on switch as they are called on set up
Keeps the behaviour consistent and easier to understand.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21 04:58:20 -05:00
Alan 3ddcc591e3 pata_ixp4xx: Fix up set_mode() function and display Configured for PIO info
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21 04:58:20 -05:00
Alan aa6de4942c pata_cs5520: suspend/resume
The CS5520 isn't just an ATA controller and we must not
pci_disable_device it as it turns into pci_disable_computer.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21 04:58:20 -05:00
Alan e852f7054d pata: Display Configuring .. lines for devices with private set_mode methods
We can't specify which mode in the cases below but we can at least say
PIO and look consistent with the default.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21 04:58:20 -05:00
Tejun Heo 44877b4e22 libata: s/ap->id/ap->print_id/g
ata_port has two different id fields - id and port_no.  id is
system-wide 1-based unique id for the port while port_no is 0-based
host-wide port number.  The former is primarily used to identify the
ATA port to the user in printk messages while the latter is used in
various places in libata core and LLDs to index the port inside the
host.

The two fields feel quite similar and sometimes ap->id is used in
place of ap->port_no, which is very difficult to spot.  This patch
renames ap->id to ap->print_id to reduce the possibility of such bugs.

Some printk messages are adjusted such that id string (ata%u[.%u])
isn't printed twice and/or to use ata_*_printk() instead of hardcoded
id format.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21 04:58:20 -05:00
Robert Hancock 5ce0cf6faf sata_nv: enable hotplug interrupt and fix some readl/readw mismatches
We already have code that handles hotplug interrupt indications in ADMA
mode, this turns on the control flag that actually enables these interrupts.
Also fixes some cases in the same functions where a 16-bit register was read
using a readl instead of a readw.

Signed-off-by: Robert Hancock <hancockr@shaw.ca>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21 04:58:19 -05:00
Robert Hancock 721449bf0d sata_nv: Use notifier for completion checks
The hardware provides us a notifier register that indicates what command
tags have completed. Use this to determine which CPBs to check, rather
than blindly checking all active CPBs. This should provide a minor
performance win, since if the controller has touched some of these
incomplete CPBs, accessing them will likely result in a cache miss.

Signed-off-by: Robert Hancock <hancockr@shaw.ca>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21 04:58:19 -05:00
Robert Hancock ac3d6b869f sata_nv: Cleanup taskfile setup
This edits the taskfile setup to more closely match the way that libata
sends the taskfile for other controllers. This avoids putting taskfile writes
into the CPB buffer that are not needed according to the taskfile flags.

Signed-off-by: Robert Hancock <hancockr@shaw.ca>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21 04:58:19 -05:00
Robert Hancock 41949ed5c1 sata_nv: cleanup CPB and APRD initialization
Clean up the initialization of the CPB and APRD structures so that we
strictly follow the rules for ordering of writes to the CPB flags and
response flags, and prevent duplicate initialization.

Signed-off-by: Robert Hancock <hancockr@shaw.ca>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21 04:58:19 -05:00
Robert Hancock 08af741478 sata_nv: Add CPB register info to error_handler output
When error handling occurs with pending commands, output the contents
of the next CPB count and next CPB index registers as well as the others,
since these may be useful for debugging.

Signed-off-by: Robert Hancock <hancockr@shaw.ca>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21 04:58:19 -05:00
Magnus Damm 9dd6fa3231 libata: Remove duplicate dma blacklist entry
libata: Remove duplicate dma blacklist entry

The exact same entry is already present.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21 04:58:19 -05:00
Magnus Damm ed2a6e4aca pata_pcmcia: Update device table
pata_pcmcia: Update device table

Add CFA devices from I-O Data, Mitsubishi and Viking. Add SanDisk comment.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21 04:58:19 -05:00
Tejun Heo e1be5d73e0 sata_via: fix resource-managed iomap conversion
Conversion to resource-managed iomap was buggy causing init failures
on both vt6420 and 6421 - BAR5 wasn't mapped for both controllers
while on vt6420 sata_via tried to map BAR0-4 twice.  Fix it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21 04:58:19 -05:00
Tejun Heo c3c70c443c libata: fix ata_scsi_change_queue_depth()
Fix ata_scsi_change_queue_depth() such that...

* NCQ on/off is exactly determined using the same logic as the issue path.

* queue depth is adjusted to 1 if NCQ is not enabled.

* -EINVAL is returned if requested action is ignored due to limitations.

This fixes the bug which allows queue depth to be increased on
blacklisted NCQ hosts/devices.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21 04:58:19 -05:00