Create private data struct for device specific private data.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Remove the long-dead references to the obsolete MODULE_PARM macro.
Given that the first one of those is actually misspelled as
"MODULE_PARAM", it's clear that they can't have been doing any good.
Acked-by: Thierry Merle <thierry.merle@free.fr>
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
In preparation for struct class_device -> struct device input
core conversion switch to using input_dev->dev.parent when
specifying device position in sysfs tree.
Signed-off-by: Dmitry Torokhov <dtor at mail.ru>
Acked-by: Thierry Merle <thierry.merle@free.fr>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Make sure devices manufactured by Dposh are not affected by previous hw
pid filtering changes
Doing so might crash it.
Signed-off-by: Aapo Tahkola <aet@rasterburn.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This patch fixes several return value related problems in zr364xx.
- return -ENOMEM instead of -ENODEV on out of memory
- zr364xx checks video_register_device() error only when
its return value is -1. But video_register_device() doesn't
always return -1 on error.
- If usb_register() returns error, module_init() wrongly returns 1:
retval = usb_register(&zr364xx_driver) < 0;
...
return retval;
And it allows the module to be loaded. Because sys_init_module() doesn't
see positive return value as error.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Antoine Jacquet <royale@zerezo.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Now that dvb-pll is being used properly in all cx88-dvb instances,
the cx88 driver no longer needs to store pll_desc nor pll_addr.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Enhance the dvb-pll definition of the fmd1216 tuner by adding an init sequence
and a sleep sequence.
The init sequence sets the AGC control register to 0xa0, selecting the fast
time constant and 112 dBuV take-over point. This the recommended value for
DVB-T operation.
The sleep sequence sets bit P4 (which is believed to turn the analog
demodulator on), turns off the tuning voltage, and sets the AGC control
register to 0x60 (external AGC voltage, the recommended value for analog
operation).
The existing dvb-pll users in the cx88 driver, listed below, will gain these
init and sleep sequences.
CX88_BOARD_HAUPPAUGE_HVR1100 Hauppauge WinTV-HVR1100 DVB-T/Hybrid
CX88_BOARD_HAUPPAUGE_HVR1100LP Hauppauge WinTV-HVR1100 DVB-T/Hybrid (Low Profi
CX88_BOARD_WINFAST_DTV2000H WinFast DTV2000 H
CX88_BOARD_HAUPPAUGE_HVR3000 Hauppauge WinTV-HVR3000 TriMode Analog/DVB-S/DV
CX88_BOARD_HAUPPAUGE_HVR1300 Hauppauge WinTV-HVR1300 DVB-T/Hybrid MPEG Encod
This non-dvb-pll user in the cx88 driver should only gain the sleep sequence,
as it already had an equivalent init sequence. The non-dvb-pll code for this
user is removed.
X88_BOARD_DNTV_LIVE_DVB_T_PRO digitalnow DNTV Live! DVB-T Pro
In these saa7134 driver, these non-dvb-pll users are converted to use dvb-pll:
SAA7134_BOARD_MD7134 Medion 7134
SAA7134_BOARD_ASUS_EUROPA2_HYBRID Asus Europa2 OEM
The saa7134 functions philips_fmd1216_tuner_init(),
philips_fmd1216_tuner_sleep(), and philips_fmd1216_tuner_set_params() are
deleted and the dvb-pll versions are used.
This should result in equivalent sleep, init, and tuning sequences being sent
to the tuner.
For the cxusb driver, only one board is effected:
USB_PID_MEDION_MD95700 Medion MD95700
This board used dvb_usb_tuner_init_i2c() and dvb_usb_tuner_set_params_i2c()
for init and tuning, respectively. These functions are effectively the same
as the dvb-pll versions. They call a tuner pass control function defined at
the dvb-usb level, but this does not matter, as this card does not have a
tuner pass control function (only the dib3000mb does). This board will gain
the sleep sequence, while init and tuning should be unchanged.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Support for A-LINK DTU(m) is not included in this patch.
Signed-off-by: Aapo Tahkola <aet@rasterburn.org>
Acked-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Marked af9005 driver as experimental and add dependency for qt1010;
Added a dependency on qt1010 in Kconfig;
Corrected the experimental gain reduction of the mt2060 in case of
strong signal (though it is code included in #ifdef 0).
Signed-off-by: Luca Olivetti <luca@ventoso.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
convert calls to dib3000mb_attach to use dvb_attach
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
moved tda665x pll_init into dvb_pll_desc dvb_pll_tda665x.initdata
convert handling of tda665x and tua6010xs to properly use dvb-pll
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
These sources do not need to #include "dvb-pll.h"
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Using Encore's key codes, we needn't add any additional key table.
Signed-off-by: Tony Wan <wankai@sjtu.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Support the 10moons TM300 TV card (so called TV Master 3), which is a
10moons saa7130 based board. Here not include features for the
IR-remote.
It has been tested using TVTIME. The card was auto-detected and all the
input sources worked correct with sound.
Signed-off-by: Tony Wan <wankai@sjtu.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
The ioctl entry point, a big switch/case, is splitted in little
functions.
These functions are set as callbacks for the video_ioctl2 video4linux
facility.
This improves the driver memory consumption and enables the v4l1
compatibility as a side effect.
Signed-off-by: Thierry MERLE <thierry.merle@free.fr>
Acked-by: Dwaine P. Garden <dwainegarden@rogers.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Radio and video ioctls are the same,
delete the usbvision_do_radio_ioctl function
add the special cases for radio in usbvision_v4l2_do_ioctl
Signed-off-by: Thierry MERLE <thierry.merle@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
usbvision_set_video_format: add comment that VO_MODE is also being set.
Signed-off-by: David Warman <dwarman@davidwarman.net>
Signed-off-by: Thierry MERLE <thierry.merle@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This patch removes duplicate code from cx88-dvb and saa7134-dvb that handles
rf input switching for the TUV1236d tuner.
The functionality is added to dvb-pll, where all the other code that
handles the TUV1236d is kept.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Rename dvb_pll_desc.setbw() to set(), and accept struct dvb_frontend_parameters
instead of passing both freq and bandwidth, so that this may be used as a
generic function.
In order to do this, dvb_pll_configure must also be altered in the same manner,
to take struct dvb_frontend_parameters instead of freq and bandwidth.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
All the printks had missing level prefixes so I've fixed these too.
Also fixed some grammer errors.
Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
If cx88 support is compiled into the kernel while vp3054 is left as a module,
the kernel will fail to link. Adjust the existing "#if" code in cx88 so
that it won't consider vp3054 to be supported in this case.
It might make sense to move vp3054 selection into the "customisation" menu
instead of a cx88 sub-option (though this is a cx88 feature, there is no extra
chip involved).
It might also make sense to use dvb_attach() to load vp3054 support.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Currently, the freezer treats all tasks as freezable, except for the kernel
threads that explicitly set the PF_NOFREEZE flag for themselves. This
approach is problematic, since it requires every kernel thread to either
set PF_NOFREEZE explicitly, or call try_to_freeze(), even if it doesn't
care for the freezing of tasks at all.
It seems better to only require the kernel threads that want to or need to
be frozen to use some freezer-related code and to remove any
freezer-related code from the other (nonfreezable) kernel threads, which is
done in this patch.
The patch causes all kernel threads to be nonfreezable by default (ie. to
have PF_NOFREEZE set by default) and introduces the set_freezable()
function that should be called by the freezable kernel threads in order to
unset PF_NOFREEZE. It also makes all of the currently freezable kernel
threads call set_freezable(), so it shouldn't cause any (intentional)
change of behaviour to appear. Additionally, it updates documentation to
describe the freezing of tasks more accurately.
[akpm@linux-foundation.org: build fixes]
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Nigel Cunningham <nigel@nigel.suspend2.net>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Gautham R Shenoy <ego@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Instead of all drivers reading pci config space to get the revision
ID, they can now use the pci_device->revision member.
This exposes some issues where drivers where reading a word or a dword
for the revision number, and adding useless error-handling around the
read. Some drivers even just read it for no purpose of all.
In devices where the revision ID is being copied over and used in what
appears to be the equivalent of hotpath, I have left the copy code
and the cached copy as not to influence the driver's performance.
Compile tested with make all{yes,mod}config on x86_64 and i386.
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Acked-by: Dave Jones <davej@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
if the call to budget_register() fails in ttpci_budget_int(),
ttpci_budget_init() returns success. The attached patch will
fix this problem.
Signed-off-by: Hartmut Birr <e9hack@googlemail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Spotted and tested by Thomas Sattler <tsattler@gmx.de>.
cinergyT2.c does cancel_delayed_work() + flush_scheduled_work() while
holding cinergyt2->sem. This leads to deadlock because work->func()
needs the same mutex to complete. Another bug is that this code in fact
can't reliably stop the re-arming delayed_work.
Convert this code to use cancel_rearming_delayed_work() and move it
out of ->sem. Another mutex, ->wq_sem, was added to protect against the
concurrent open/resume.
This patch is a horrible hack to fix the lockup which happens in practice.
As Dmitry Torokhov pointed out this driver has other problems and needs
further changes.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
v4l-info and other programs would loop indefinitely while querying the
tuners for cx88-blackbird cards.
The cause was that vidioc_g_tuner didn't return an error value for
qctrl->id != 0, making the application think there is a never ending
list of tuners...
This patch adds the same index check as done in vidioc_g_tuner() in
cx88-video.
Signed-off-by: Jelle Foks <jelle@foks.8m.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
If one uses a V4L *one* application, such as vlc or mplayer's v4l driver, as
the first user after the driver is loaded, the driver wedges itself and will
never capture properly. Even if one uses a V4L2 application later, it still
won't work.
If one uses a V4L *two* application first, such as tvtime or mplayer's v4l2
driver, then the driver will be ok. One can then run a V4L1 application, and
it will work.
It turns out the problem is with norm changing and the crop support that was
added in 2.6.21. The driver defaults to PAL, and keeps the last norm it was
set too across opens. If one changes the norm via V4L1, the cropping
parameters are not reset like they should be, and they'll remain broken across
device opens.
This patch removes the direct setting of btv->tvnorm in the V4L1 ioctl
VIDIOCSCHAN handler. The norm is set via the existing call to set_input(),
which calls set_tvnorm(), which will reset the cropping values now that it is
able to detect the norm change.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This patch changes the test for the thread pid from >= 0 to > 0.
When the saa8134 driver initialization fails after a certain point, it goes
through the complete shutdown process for the driver. Part of shutting it
down includes tearing down the thread for tv audio.
The test for tearing down the thread tests for >= 0. Since the dev
structure is kzalloc'd, the test will always be true if we haven't tried to
start the thread yet. We end up waiting on pid 0 to complete, which will
never happen, so we lock up.
This bug was observed in Novell Bugzilla 284718, when request_irq() failed.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>