Commit f0481730 authored by Linus Torvalds's avatar Linus Torvalds

Merge kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git with fixups

This merges the DVB tree, but fixes up the history that had gotten
screwed up by a broken commit.

The history is fixed up by re-doing the commit properly (taking the
resolve from the final result of the original), and then cherry-picking
the commits that followed the broken merge.

* dvb: (190 commits)
  V4L/DVB (3545): Fixed no_overlay option and quirks on saa7134 driver
  V4L/DVB (3543): Fix Makefile to adapt to bt8xx/ conversion
  V4L/DVB (3538): Bt8xx documentation update
  V4L/DVB (3537a): Whitespace cleanup
  V4L/DVB (3533): Add WSS (wide screen signalling) module parameters
  V4L/DVB (3532): Moved duplicated code of ALPS BSRU6 tuner to a standalone file.
  V4L/DVB (3530): Kconfig: remove VIDEO_AUDIO_DECODER
  V4L/DVB (3529): Kconfig: add menu items for cs53l32a and wm8775 A/D converters
  V4L/DVB (3528): Kconfig: fix ATSC frontend menu item names by manufacturer
  V4L/DVB (3527): VIDEO_CPIA2 must depend on USB
  V4L/DVB (3525): Kconfig: remove VIDEO_DECODER
  V4L/DVB (3524): Kconfig: add menu items for saa7115 and saa7127
  V4L/DVB (3494): Kconfig: select VIDEO_MSP3400 to build msp3400.ko
  V4L/DVB (3522): Fixed a trouble with other PAL standards
  V4L/DVB (3521): Avoid warnings at video-buf.c
  V4L/DVB (3514): SAA7113 doesn't have auto std chroma detection mode
  V4L/DVB (3513): Remove saa711x driver
  V4L/DVB (3509): Make a needlessly global function static.
  V4L/DVB (3506): Cinergy T2 dmx cleanup on disconnect
  V4L/DVB (3504): Medion 7134: Autodetect second bridge chip
  ...
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parents c4a1745a ecb73774
......@@ -30,3 +30,5 @@ include/linux/autoconf.h
include/linux/compile.h
include/linux/version.h
# stgit generated dirs
patches-*
HOWTO: Get An Avermedia DVB-T working under Linux
______________________________________________
......@@ -137,11 +136,8 @@ Getting the card going
To power up the card, load the following modules in the
following order:
* insmod dvb-core.o
* modprobe bttv.o
* insmod bt878.o
* insmod dvb-bt8xx.o
* insmod sp887x.o
* modprobe bttv (normally loaded automatically)
* modprobe dvb-bt8xx (or place dvb-bt8xx in /etc/modules)
Insertion of these modules into the running kernel will
activate the appropriate DVB device nodes. It is then possible
......@@ -302,4 +298,4 @@ Further Update
Many thanks to Nigel Pearson for the updates to this document
since the recent revision of the driver.
January 29th 2004
February 14th 2006
How to get the Nebula, PCTV, FusionHDTV Lite and Twinhan DST cards working
==========================================================================
How to get the bt8xx cards working
==================================
This class of cards has a bt878a as the PCI interface, and
require the bttv driver.
1) General information
======================
Please pay close attention to the warning about the bttv module
options below for the DST card.
This class of cards has a bt878a as the PCI interface, and require the bttv driver
for accessing the i2c bus and the gpio pins of the bt8xx chipset.
Please see Documentation/dvb/cards.txt => o Cards based on the Conexant Bt8xx PCI bridge:
1) General informations
=======================
These drivers require the bttv driver to provide the means to access
the i2c bus and the gpio pins of the bt8xx chipset.
Because of this, you need to enable
"Device drivers" => "Multimedia devices"
=> "Video For Linux" => "BT848 Video For Linux"
Furthermore you need to enable
"Device drivers" => "Multimedia devices" => "Digital Video Broadcasting Devices"
=> "DVB for Linux" "DVB Core Support" "BT8xx based PCI cards"
Compiling kernel please enable:
a.)"Device drivers" => "Multimedia devices" => "Video For Linux" => "BT848 Video For Linux"
b.)"Device drivers" => "Multimedia devices" => "Digital Video Broadcasting Devices"
=> "DVB for Linux" "DVB Core Support" "Bt8xx based PCI Cards"
2) Loading Modules
==================
In general you need to load the bttv driver, which will handle the gpio and
i2c communication for us, plus the common dvb-bt8xx device driver.
The frontends for Nebula (nxt6000), Pinnacle PCTV (cx24110), TwinHan (dst),
FusionHDTV DVB-T Lite (mt352) and FusionHDTV5 Lite (lgdt330x) are loaded
automatically by the dvb-bt8xx device driver.
3a) Nebula / Pinnacle PCTV / FusionHDTV Lite
---------------------------------------------
$ modprobe bttv (normally bttv is being loaded automatically by kmod)
$ modprobe dvb-bt8xx
(or just place dvb-bt8xx in /etc/modules for automatic loading)
3b) TwinHan and Clones
--------------------------
In default cases bttv is loaded automatically.
To load the backend either place dvb-bt8xx in etc/modules, or apply manually:
$ modprobe bttv card=0x71
$ modprobe dvb-bt8xx
$ modprobe dst
$ modprobe dvb-bt8xx
The value 0x71 will override the PCI type detection for dvb-bt8xx,
which is necessary for TwinHan cards. Omission of this parameter might result
in a system lockup.
All frontends will be loaded automatically.
People running udev please see Documentation/dvb/udev.txt.
If you're having an older card (blue color PCB) and card=0x71 locks up
your machine, try using 0x68, too. If that does not work, ask on the
mailing list.
In the following cases overriding the PCI type detection for dvb-bt8xx might be necessary:
The DST module takes a couple of useful parameters.
2a) Running TwinHan and Clones
------------------------------
verbose takes values 0 to 4. These values control the verbosity level,
and can be used to debug also.
$ modprobe bttv card=113
$ modprobe dvb-bt8xx
$ modprobe dst
verbose=0 means complete disabling of messages
1 only error messages are displayed
2 notifications are also displayed
3 informational messages are also displayed
4 debug setting
Useful parameters for verbosity level and debugging the dst module:
dst_addons takes values 0 and 0x20. A value of 0 means it is a FTA card.
0x20 means it has a Conditional Access slot.
verbose=0: messages are disabled
1: only error messages are displayed
2: notifications are displayed
3: other useful messages are displayed
4: debug setting
dst_addons=0: card is a free to air (FTA) card only
0x20: card has a conditional access slot for scrambled channels
The autodetected values are determined by the cards 'response string'
which you can see in your logs e.g.
The autodetected values are determined by the cards' "response string".
In your logs see f. ex.: dst_get_device_id: Recognize [DSTMCI].
For bug reports please send in a complete log with verbose=4 activated.
Please also see Documentation/dvb/ci.txt.
dst_get_device_id: Recognise [DSTMCI]
If you need to sent in bug reports on the dst, please do send in a complete
log with the verbose=4 module parameter. For general usage, the default setting
of verbose=1 is ideal.
4) Multiple cards
2b) Running multiple cards
--------------------------
If you happen to be running multiple cards, it would be advisable to load
the bttv module with the card id. This would help to solve any module loading
problems that you might face.
For example, if you have a Twinhan and Clones card along with a FusionHDTV5 Lite
Examples of card ID's:
$ modprobe bttv card=0x71 card=0x87
Here the order of the card id is important and should be the same as that of the
physical order of the cards. Here card=0x71 represents the Twinhan and clones
and card=0x87 represents Fusion HDTV5 Lite. These arguments can also be
specified in decimal, rather than hex:
Pinnacle PCTV Sat: 94
Nebula Electronics Digi TV: 104
pcHDTV HD-2000 TV: 112
Twinhan DST and clones: 113
Avermedia AverTV DVB-T 771: 123
Avermedia AverTV DVB-T 761: 124
DViCO FusionHDTV DVB-T Lite: 128
DViCO FusionHDTV 5 Lite: 135
Notice: The order of the card ID should be uprising:
Example:
$ modprobe bttv card=113 card=135
$ modprobe dvb-bt8xx
Some examples of card-id's
Pinnacle Sat 0x5e (94)
Nebula Digi TV 0x68 (104)
PC HDTV 0x70 (112)
Twinhan 0x71 (113)
FusionHDTV DVB-T Lite 0x80 (128)
FusionHDTV5 Lite 0x87 (135)
For a full list of card-id's, see the V4L Documentation within the kernel
source: linux/Documentation/video4linux/CARDLIST.bttv
If you have problems with this please do ask on the mailing list.
For a full list of card ID's please see Documentation/video4linux/CARDLIST.bttv.
In case of further problems send questions to the mailing list: www.linuxdvb.org.
--
Authors: Richard Walker,
Jamie Honan,
Michael Hunold,
Manu Abraham,
Uwe Bugla,
Michael Krufky
......@@ -21,8 +21,9 @@
use File::Temp qw/ tempdir /;
use IO::Handle;
@components = ( "sp8870", "sp887x", "tda10045", "tda10046", "av7110", "dec2000t",
"dec2540t", "dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004",
@components = ( "sp8870", "sp887x", "tda10045", "tda10046",
"tda10046lifeview", "av7110", "dec2000t", "dec2540t",
"dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004",
"or51211", "or51132_qam", "or51132_vsb", "bluebird");
# Check args
......@@ -126,6 +127,24 @@ sub tda10046 {
$outfile;
}
sub tda10046lifeview {
my $sourcefile = "Drv_2.11.02.zip";
my $url = "http://www.lifeview.com.tw/drivers/pci_card/FlyDVB-T/$sourcefile";
my $hash = "1ea24dee4eea8fe971686981f34fd2e0";
my $outfile = "dvb-fe-tda10046.fw";
my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1);
checkstandard();
wgetfile($sourcefile, $url);
unzip($sourcefile, $tmpdir);
extract("$tmpdir/LVHybrid.sys", 0x8b088, 24602, "$tmpdir/fwtmp");
verify("$tmpdir/fwtmp", $hash);
copy("$tmpdir/fwtmp", $outfile);
$outfile;
}
sub av7110 {
my $sourcefile = "dvb-ttpci-01.fw-261d";
my $url = "http://www.linuxtv.org/downloads/firmware/$sourcefile";
......
......@@ -20,11 +20,23 @@ http://linuxtv.org/downloads/
What's inside this directory:
"avermedia.txt"
contains detailed information about the
Avermedia DVB-T cards. See also "bt8xx.txt".
"bt8xx.txt"
contains detailed information about the
various bt8xx based "budget" DVB cards.
"cards.txt"
contains a list of supported hardware.
"ci.txt"
contains detailed information about the
CI module as part from TwinHan cards and Clones.
"contributors.txt"
is the who-is-who of DVB development
is the who-is-who of DVB development.
"faq.txt"
contains frequently asked questions and their answers.
......@@ -34,19 +46,17 @@ script to download and extract firmware for those devices
that require it.
"ttusb-dec.txt"
contains detailed informations about the
contains detailed information about the
TT DEC2000/DEC3000 USB DVB hardware.
"bt8xx.txt"
contains detailed installation instructions for the
various bt8xx based "budget" DVB cards
(Nebula, Pinnacle PCTV, Twinhan DST)
"README.dibusb"
contains detailed information about adapters
based on DiBcom reference design.
"udev.txt"
how to get DVB and udev up and running.
"README.dvb-usb"
contains detailed information about the DVB USB cards.
"README.flexcop"
contains detailed information about the
Technisat- and Flexcop B2C2 drivers.
Good luck and have fun!
......@@ -43,3 +43,5 @@
42 -> digitalnow DNTV Live! DVB-T Pro [1822:0025]
43 -> KWorld/VStream XPert DVB-T with cx22702 [17de:08a1]
44 -> DViCO FusionHDTV DVB-T Dual Digital [18ac:db50,18ac:db54]
45 -> KWorld HardwareMpegTV XPert [17de:0840]
46 -> DViCO FusionHDTV DVB-T Hybrid [18ac:db40,18ac:db44]
......@@ -8,3 +8,4 @@
7 -> Leadtek Winfast USB II (em2800)
8 -> Kworld USB2800 (em2800)
9 -> Pinnacle Dazzle DVC 90 (em2820/em2840) [2304:0207]
12 -> Kworld PVR TV 2800 RF (em2820/em2840)
......@@ -83,3 +83,12 @@
82 -> MSI TV@Anywhere plus [1462:6231]
83 -> Terratec Cinergy 250 PCI TV [153b:1160]
84 -> LifeView FlyDVB Trio [5168:0319]
85 -> AverTV DVB-T 777 [1461:2c05]
86 -> LifeView FlyDVB-T [5168:0301]
87 -> ADS Instant TV Duo Cardbus PTV331 [0331:1421]
88 -> Tevion/KWorld DVB-T 220RF [17de:7201]
89 -> ELSA EX-VISION 700TV [1048:226c]
90 -> Kworld ATSC110 [17de:7350]
91 -> AVerMedia A169 B [1461:7360]
92 -> AVerMedia A169 B1 [1461:6360]
93 -> Medion 7134 Bridge #2 [16be:0005]
......@@ -64,8 +64,10 @@ tuner=62 - Philips TEA5767HN FM Radio
tuner=63 - Philips FMD1216ME MK3 Hybrid Tuner
tuner=64 - LG TDVS-H062F/TUA6034
tuner=65 - Ymec TVF66T5-B/DFF
tuner=66 - LG NTSC (TALN mini series)
tuner=66 - LG TALN series
tuner=67 - Philips TD1316 Hybrid Tuner
tuner=68 - Philips TUV1236D ATSC/NTSC dual in
tuner=69 - Tena TNF 5335 MF
tuner=69 - Tena TNF 5335 and similar models
tuner=70 - Samsung TCPN 2121P30A
tuner=71 - Xceive xc3028
tuner=72 - Thomson FE6600
$Id: README,v 1.7 2005/08/29 23:39:57 sbertin Exp $
1. Introduction
This is a driver for STMicroelectronics's CPiA2 (second generation
Colour Processor Interface ASIC) based cameras. This camera outputs an MJPEG
stream at up to vga size. It implements the Video4Linux interface as much as
possible. Since the V4L interface does not support compressed formats, only
an mjpeg enabled application can be used with the camera. We have modified the
gqcam application to view this stream.
The driver is implemented as two kernel modules. The cpia2 module
contains the camera functions and the V4L interface. The cpia2_usb module
contains usb specific functions. The main reason for this was the size of the
module was getting out of hand, so I separted them. It is not likely that
there will be a parallel port version.
FEATURES:
- Supports cameras with the Vision stv6410 (CIF) and stv6500 (VGA) cmos
sensors. I only have the vga sensor, so can't test the other.
- Image formats: VGA, QVGA, CIF, QCIF, and a number of sizes in between.
VGA and QVGA are the native image sizes for the VGA camera. CIF is done
in the coprocessor by scaling QVGA. All other sizes are done by clipping.
- Palette: YCrCb, compressed with MJPEG.
- Some compression parameters are settable.
- Sensor framerate is adjustable (up to 30 fps CIF, 15 fps VGA).
- Adjust brightness, color, contrast while streaming.
- Flicker control settable for 50 or 60 Hz mains frequency.
2. Making and installing the stv672 driver modules:
Requirements:
-------------
This should work with 2.4 (2.4.23 and later) and 2.6 kernels, but has
only been tested on 2.6. Video4Linux must be either compiled into the kernel or
available as a module. Video4Linux2 is automatically detected and made
available at compile time.
Compiling:
----------
As root, do a make install. This will compile and install the modules
into the media/video directory in the module tree. For 2.4 kernels, use
Makefile_2.4 (aka do make -f Makefile_2.4 install).
Setup:
------
Use 'modprobe cpia2' to load and 'modprobe -r cpia2' to unload. This
may be done automatically by your distribution.
3. Driver options
Option Description
------ -----------
video_nr video device to register (0=/dev/video0, etc)
range -1 to 64. default is -1 (first available)
If you have more than 1 camera, this MUST be -1.
buffer_size Size for each frame buffer in bytes (default 68k)
num_buffers Number of frame buffers (1-32, default 3)
alternate USB Alternate (2-7, default 7)
flicker_freq Frequency for flicker reduction(50 or 60, default 60)
flicker_mode 0 to disable, or 1 to enable flicker reduction.
(default 0). This is only effective if the camera
uses a stv0672 coprocessor.
Setting the options:
--------------------
If you are using modules, edit /etc/modules.conf and add an options
line like this:
options cpia2 num_buffers=3 buffer_size=65535
If the driver is compiled into the kernel, at boot time specify them
like this:
cpia2.num_buffers=3 cpia2.buffer_size=65535
What buffer size should I use?
------------------------------
The maximum image size depends on the alternate you choose, and the
frame rate achieved by the camera. If the compression engine is able to
keep up with the frame rate, the maximum image size is given by the table
below.
The compression engine starts out at maximum compression, and will
increase image quality until it is close to the size in the table. As long
as the compression engine can keep up with the frame rate, after a short time
the images will all be about the size in the table, regardless of resolution.
At low alternate settings, the compression engine may not be able to
compress the image enough and will reduce the frame rate by producing larger
images.
The default of 68k should be good for most users. This will handle
any alternate at frame rates down to 15fps. For lower frame rates, it may
be necessary to increase the buffer size to avoid having frames dropped due
to insufficient space.
Image size(bytes)
Alternate bytes/ms 15fps 30fps
2 128 8533 4267
3 384 25600 12800
4 640 42667 21333
5 768 51200 25600
6 896 59733 29867
7 1023 68200 34100
How many buffers should I use?
------------------------------
For normal streaming, 3 should give the best results. With only 2,
it is possible for the camera to finish sending one image just after a
program has started reading the other. If this happens, the driver must drop
a frame. The exception to this is if you have a heavily loaded machine. In
this case use 2 buffers. You are probably not reading at the full frame rate.
If the camera can send multiple images before a read finishes, it could
overwrite the third buffer before the read finishes, leading to a corrupt
image. Single and double buffering have extra checks to avoid overwriting.
4. Using the camera
We are providing a modified gqcam application to view the output. In
order to avoid confusion, here it is called mview. There is also the qx5view
program which can also control the lights on the qx5 microscope. MJPEG Tools
(http://mjpeg.sourceforge.net) can also be used to record from the camera.
5. Notes to developers:
- This is a driver version stripped of the 2.4 back compatibility
and old MJPEG ioctl API. See cpia2.sf.net for 2.4 support.
6. Thanks:
- Peter Pregler <Peter_Pregler@email.com>,
Scott J. Bertin <scottbertin@yahoo.com>, and
Jarl Totland <Jarl.Totland@bdc.no> for the original cpia driver, which
this one was modelled from.
Programmer's View of Cpia2
Cpia2 is the second generation video coprocessor from VLSI Vision Ltd (now a
division of ST Microelectronics). There are two versions. The first is the
STV0672, which is capable of up to 30 frames per second (fps) in frame sizes
up to CIF, and 15 fps for VGA frames. The STV0676 is an improved version,
which can handle up to 30 fps VGA. Both coprocessors can be attached to two
CMOS sensors - the vvl6410 CIF sensor and the vvl6500 VGA sensor. These will
be referred to as the 410 and the 500 sensors, or the CIF and VGA sensors.
The two chipsets operate almost identically. The core is an 8051 processor,
running two different versions of firmware. The 672 runs the VP4 video
processor code, the 676 runs VP5. There are a few differences in register
mappings for the two chips. In these cases, the symbols defined in the
header files are marked with VP4 or VP5 as part of the symbol name.
The cameras appear externally as three sets of registers. Setting register
values is the only way to control the camera. Some settings are
interdependant, such as the sequence required to power up the camera. I will
try to make note of all of these cases.
The register sets are called blocks. Block 0 is the system block. This
section is always powered on when the camera is plugged in. It contains
registers that control housekeeping functions such as powering up the video
processor. The video processor is the VP block. These registers control
how the video from the sensor is processed. Examples are timing registers,
user mode (vga, qvga), scaling, cropping, framerates, and so on. The last
block is the video compressor (VC). The video stream sent from the camera is
compressed as Motion JPEG (JPEGA). The VC controls all of the compression
parameters. Looking at the file cpia2_registers.h, you can get a full view
of these registers and the possible values for most of them.
One or more registers can be set or read by sending a usb control message to
the camera. There are three modes for this. Block mode requests a number
of contiguous registers. Random mode reads or writes random registers with
a tuple structure containing address/value pairs. The repeat mode is only
used by VP4 to load a firmware patch. It contains a starting address and
a sequence of bytes to be written into a gpio port.
\ No newline at end of file
saa7146-objs := saa7146_i2c.o saa7146_core.o
saa7146_vv-objs := saa7146_vv_ksyms.o saa7146_fops.o saa7146_video.o saa7146_hlp.o saa7146_vbi.o
ir-common-objs := ir-functions.o ir-keymaps.o
obj-$(CONFIG_VIDEO_SAA7146) += saa7146.o
obj-$(CONFIG_VIDEO_SAA7146_VV) += saa7146_vv.o
......
......@@ -42,253 +42,6 @@ module_param(debug, int, 0644);
/* -------------------------------------------------------------------------- */
/* generic RC5 keytable */
/* see http://users.pandora.be/nenya/electronics/rc5/codes00.htm */
/* used by old (black) Hauppauge remotes */
IR_KEYTAB_TYPE ir_codes_rc5_tv[IR_KEYTAB_SIZE] = {
/* Keys 0 to 9 */
[ 0x00 ] = KEY_KP0,
[ 0x01 ] = KEY_KP1,
[ 0x02 ] = KEY_KP2,
[ 0x03 ] = KEY_KP3,
[ 0x04 ] = KEY_KP4,
[ 0x05 ] = KEY_KP5,
[ 0x06 ] = KEY_KP6,
[ 0x07 ] = KEY_KP7,
[ 0x08 ] = KEY_KP8,
[ 0x09 ] = KEY_KP9,
[ 0x0b ] = KEY_CHANNEL, /* channel / program (japan: 11) */
[ 0x0c ] = KEY_POWER, /* standby */
[ 0x0d ] = KEY_MUTE, /* mute / demute */
[ 0x0f ] = KEY_TV, /* display */
[ 0x10 ] = KEY_VOLUMEUP,
[ 0x11 ] = KEY_VOLUMEDOWN,
[ 0x12 ] = KEY_BRIGHTNESSUP,
[ 0x13 ] = KEY_BRIGHTNESSDOWN,
[ 0x1e ] = KEY_SEARCH, /* search + */
[ 0x20 ] = KEY_CHANNELUP, /* channel / program + */
[ 0x21 ] = KEY_CHANNELDOWN, /* channel / program - */
[ 0x22 ] = KEY_CHANNEL, /* alt / channel */
[ 0x23 ] = KEY_LANGUAGE, /* 1st / 2nd language */
[ 0x26 ] = KEY_SLEEP, /* sleeptimer */
[ 0x2e ] = KEY_MENU, /* 2nd controls (USA: menu) */
[ 0x30 ] = KEY_PAUSE,
[ 0x32 ] = KEY_REWIND,
[ 0x33 ] = KEY_GOTO,
[ 0x35 ] = KEY_PLAY,
[ 0x36 ] = KEY_STOP,
[ 0x37 ] = KEY_RECORD, /* recording */
[ 0x3c ] = KEY_TEXT, /* teletext submode (Japan: 12) */
[ 0x3d ] = KEY_SUSPEND, /* system standby */
};
EXPORT_SYMBOL_GPL(ir_codes_rc5_tv);
/* Table for Leadtek Winfast Remote Controls - used by both bttv and cx88 */
IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE] = {
/* Keys 0 to 9 */
[ 18 ] = KEY_KP0,
[ 5 ] = KEY_KP1,
[ 6 ] = KEY_KP2,
[ 7 ] = KEY_KP3,
[ 9 ] = KEY_KP4,
[ 10 ] = KEY_KP5,
[ 11 ] = KEY_KP6,
[ 13 ] = KEY_KP7,
[ 14 ] = KEY_KP8,
[ 15 ] = KEY_KP9,
[ 0 ] = KEY_POWER,
[ 2 ] = KEY_TUNER, /* TV/FM */
[ 30 ] = KEY_VIDEO,
[ 4 ] = KEY_VOLUMEUP,
[ 8 ] = KEY_VOLUMEDOWN,
[ 12 ] = KEY_CHANNELUP,
[ 16 ] = KEY_CHANNELDOWN,
[ 3 ] = KEY_ZOOM, /* fullscreen */
[ 31 ] = KEY_SUBTITLE, /* closed caption/teletext */
[ 32 ] = KEY_SLEEP,
[ 20 ] = KEY_MUTE,
[ 43 ] = KEY_RED,
[ 44 ] = KEY_GREEN,
[ 45 ] = KEY_YELLOW,
[ 46 ] = KEY_BLUE,
[ 24 ] = KEY_KPPLUS, /* fine tune + */
[ 25 ] = KEY_KPMINUS, /* fine tune - */
[ 33 ] = KEY_KPDOT,
[ 19 ] = KEY_KPENTER,
[ 34 ] = KEY_BACK,
[ 35 ] = KEY_PLAYPAUSE,
[ 36 ] = KEY_NEXT,
[ 38 ] = KEY_STOP,
[ 39 ] = KEY_RECORD
};
EXPORT_SYMBOL_GPL(ir_codes_winfast);
IR_KEYTAB_TYPE ir_codes_pinnacle[IR_KEYTAB_SIZE] = {
[ 0x59 ] = KEY_MUTE,
[ 0x4a ] = KEY_POWER,
[ 0x18 ] = KEY_TEXT,
[ 0x26 ] = KEY_TV,
[ 0x3d ] = KEY_PRINT,
[ 0x48 ] = KEY_RED,
[ 0x04 ] = KEY_GREEN,
[ 0x11 ] = KEY_YELLOW,
[ 0x00 ] = KEY_BLUE,
[ 0x2d ] = KEY_VOLUMEUP,
[ 0x1e ] = KEY_VOLUMEDOWN,
[ 0x49 ] = KEY_MENU,
[ 0x16 ] = KEY_CHANNELUP,
[ 0x17 ] = KEY_CHANNELDOWN,
[ 0x20 ] = KEY_UP,
[ 0x21 ] = KEY_DOWN,
[ 0x22 ] = KEY_LEFT,
[ 0x23 ] = KEY_RIGHT,
[ 0x0d ] = KEY_SELECT,
[ 0x08 ] = KEY_BACK,
[ 0x07 ] = KEY_REFRESH,
[ 0x2f ] = KEY_ZOOM,
[ 0x29 ] = KEY_RECORD,
[ 0x4b ] = KEY_PAUSE,
[ 0x4d ] = KEY_REWIND,
[ 0x2e ] = KEY_PLAY,
[ 0x4e ] = KEY_FORWARD,
[ 0x53 ] = KEY_PREVIOUS,
[ 0x4c ] = KEY_STOP,
[ 0x54 ] = KEY_NEXT,
[ 0x69 ] = KEY_KP0,
[ 0x6a ] = KEY_KP1,
[ 0x6b ] = KEY_KP2,
[ 0x6c ] = KEY_KP3,
[ 0x6d ] = KEY_KP4,
[ 0x6e ] = KEY_KP5,
[ 0x6f ] = KEY_KP6,
[ 0x70 ] = KEY_KP7,
[ 0x71 ] = KEY_KP8,
[ 0x72 ] = KEY_KP9,
[ 0x74 ] = KEY_CHANNEL,
[ 0x0a ] = KEY_BACKSPACE,
};
EXPORT_SYMBOL_GPL(ir_codes_pinnacle);
/* empty keytable, can be used as placeholder for not-yet created keytables */
IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE] = {
[ 42 ] = KEY_COFFEE,
};
EXPORT_SYMBOL_GPL(ir_codes_empty);
/* Hauppauge: the newer, gray remotes (seems there are multiple
* slightly different versions), shipped with cx88+ivtv cards.
* almost rc5 coding, but some non-standard keys */
IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE] = {
/* Keys 0 to 9 */
[ 0x00 ] = KEY_KP0,
[ 0x01 ] = KEY_KP1,
[ 0x02 ] = KEY_KP2,
[ 0x03 ] = KEY_KP3,
[ 0x04 ] = KEY_KP4,
[ 0x05 ] = KEY_KP5,
[ 0x06 ] = KEY_KP6,
[ 0x07 ] = KEY_KP7,
[ 0x08 ] = KEY_KP8,
[ 0x09 ] = KEY_KP9,
[ 0x0a ] = KEY_TEXT, /* keypad asterisk as well */
[ 0x0b ] = KEY_RED, /* red button */
[ 0x0c ] = KEY_RADIO,
[ 0x0d ] = KEY_MENU,
[ 0x0e ] = KEY_SUBTITLE, /* also the # key */
[ 0x0f ] = KEY_MUTE,
[ 0x10 ] = KEY_VOLUMEUP,
[ 0x11 ] = KEY_VOLUMEDOWN,
[ 0x12 ] = KEY_PREVIOUS, /* previous channel */
[ 0x14 ] = KEY_UP,
[ 0x15 ] = KEY_DOWN,
[ 0x16 ] = KEY_LEFT,
[ 0x17 ] = KEY_RIGHT,
[ 0x18 ] = KEY_VIDEO, /* Videos */
[ 0x19 ] = KEY_AUDIO, /* Music */
/* 0x1a: Pictures - presume this means
"Multimedia Home Platform" -
no "PICTURES" key in input.h
*/
[ 0x1a ] = KEY_MHP,
[ 0x1b ] = KEY_EPG, /* Guide */
[ 0x1c ] = KEY_TV,
[ 0x1e ] = KEY_NEXTSONG, /* skip >| */
[ 0x1f ] = KEY_EXIT, /* back/exit */
[ 0x20 ] = KEY_CHANNELUP, /* channel / program + */
[ 0x21 ] = KEY_CHANNELDOWN, /* channel / program - */
[ 0x22 ] = KEY_CHANNEL, /* source (old black remote) */
[ 0x24 ] = KEY_PREVIOUSSONG, /* replay |< */
[ 0x25 ] = KEY_ENTER, /* OK */
[ 0x26 ] = KEY_SLEEP, /* minimize (old black remote) */
[ 0x29 ] = KEY_BLUE, /* blue key */
[ 0x2e ] = KEY_GREEN, /* green button */
[ 0x30 ] = KEY_PAUSE, /* pause */
[ 0x32 ] = KEY_REWIND, /* backward << */
[ 0x34 ] = KEY_FASTFORWARD, /* forward >> */
[ 0x35 ] = KEY_PLAY,
[ 0x36 ] = KEY_STOP,
[ 0x37 ] = KEY_RECORD, /* recording */
[ 0x38 ] = KEY_YELLOW, /* yellow key */
[ 0x3b ] = KEY_SELECT, /* top right button */
[ 0x3c ] = KEY_ZOOM, /* full */
[ 0x3d ] = KEY_POWER, /* system power (green button) */
};
EXPORT_SYMBOL(ir_codes_hauppauge_new);
IR_KEYTAB_TYPE ir_codes_pixelview[IR_KEYTAB_SIZE] = {
[ 2 ] = KEY_KP0,
[ 1 ] = KEY_KP1,
[ 11 ] = KEY_KP2,
[ 27 ] = KEY_KP3,
[ 5 ] = KEY_KP4,
[ 9 ] = KEY_KP5,
[ 21 ] = KEY_KP6,
[ 6 ] = KEY_KP7,
[ 10 ] = KEY_KP8,
[ 18 ] = KEY_KP9,
[ 3 ] = KEY_TUNER, /* TV/FM */
[ 7 ] = KEY_SEARCH, /* scan */
[ 28 ] = KEY_ZOOM, /* full screen */
[ 30 ] = KEY_POWER,
[ 23 ] = KEY_VOLUMEDOWN,
[ 31 ] = KEY_VOLUMEUP,
[ 20 ] = KEY_CHANNELDOWN,
[ 22 ] = KEY_CHANNELUP,
[ 24 ] = KEY_MUTE,
[ 0 ] = KEY_LIST, /* source */
[ 19 ] = KEY_INFO, /* loop */
[ 16 ] = KEY_LAST, /* +100 */
[ 13 ] = KEY_CLEAR, /* reset */
[ 12 ] = BTN_RIGHT, /* fun++ */
[ 4 ] = BTN_LEFT, /* fun-- */
[ 14 ] = KEY_GOTO, /* function */
[ 15 ] = KEY_STOP, /* freeze */
};
EXPORT_SYMBOL(ir_codes_pixelview);
/* -------------------------------------------------------------------------- */
static void ir_input_key_event(struct input_dev *dev, struct ir_input_state *ir)
{
if (KEY_RESERVED == ir->keycode) {
......
This diff is collapsed.
......@@ -21,7 +21,7 @@
#include <media/saa7146.h>
LIST_HEAD(saa7146_devices);
DECLARE_MUTEX(saa7146_devices_lock);
DEFINE_MUTEX(saa7146_devices_lock);
static int saa7146_num;
......@@ -116,8 +116,7 @@ static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages)
pg = vmalloc_to_page(virt);
if (NULL == pg)
goto err;
if (PageHighMem(pg))
BUG();
BUG_ON(PageHighMem(pg));
sglist[i].page = pg;
sglist[i].length = PAGE_SIZE;
}
......@@ -402,11 +401,11 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent
pci_set_drvdata(pci, dev);
init_MUTEX(&dev->lock);
mutex_init(&dev->lock);
spin_lock_init(&dev->int_slock);
spin_lock_init(&dev->slock);
init_MUTEX(&dev->i2c_lock);
mutex_init(&dev->i2c_lock);
dev->module = THIS_MODULE;
init_waitqueue_head(&dev->i2c_wq);
......
......@@ -17,18 +17,18 @@ int saa7146_res_get(struct saa7146_fh *fh, unsigned int bit)
}
/* is it free? */
down(&dev->lock);
mutex_lock(&dev->lock);
if (vv->resources & bit) {
DEB_D(("locked! vv->resources:0x%02x, we want:0x%02x\n",vv->resources,bit));
/* no, someone else uses it */
up(&dev->lock);
mutex_unlock(&dev->lock);
return 0;
}
/* it's free, grab it */
fh->resources |= bit;
vv->resources |= bit;
DEB_D(("res: get 0x%02x, cur:0x%02x\n",bit,vv->resources));
up(&dev->lock);
mutex_unlock(&dev->lock);
return 1;
}
......@@ -37,14 +37,13 @@ void saa7146_res_free(struct saa7146_fh *fh, unsigned int bits)
struct saa7146_dev *dev = fh->dev;
struct saa7146_vv *vv = dev->vv_data;
if ((fh->resources & bits) != bits)
BUG();
BUG_ON((fh->resources & bits) != bits);
down(&dev->lock);
mutex_lock(&dev->lock);
fh->resources &= ~bits;
vv->resources &= ~bits;
DEB_D(("res: put 0x%02x, cur:0x%02x\n",bits,vv->resources));
up(&dev->lock);
mutex_unlock(&dev->lock);
}
......@@ -55,8 +54,7 @@ void saa7146_dma_free(struct saa7146_dev *dev,struct saa7146_buf *buf)
{
DEB_EE(("dev:%p, buf:%p\n",dev,buf));
if (in_interrupt())
BUG();
BUG_ON(in_interrupt());
videobuf_waiton(&buf->vb,0,0);
videobuf_dma_pci_unmap(dev->pci, &buf->vb.dma);
......@@ -204,7 +202,7 @@ static int fops_open(struct inode *inode, struct file *file)
DEB_EE(("inode:%p, file:%p, minor:%d\n",inode,file,minor));
if (down_interruptible(&saa7146_devices_lock))
if (mutex_lock_interruptible(&saa7146_devices_lock))
return -ERESTARTSYS;
list_for_each(list,&saa7146_devices) {
......@@ -276,7 +274,7 @@ static int fops_open(struct inode *inode, struct file *file)
kfree(fh);
file->private_data = NULL;
}
up(&saa7146_devices_lock);
mutex_unlock(&saa7146_devices_lock);
return result;
}
......@@ -287,7 +285,7 @@ static int fops_release(struct inode *inode, struct file *file)
DEB_EE(("inode:%p, file:%p\n",inode,file));
if (down_interruptible(&saa7146_devices_lock))
if (mutex_lock_interruptible(&saa7146_devices_lock))
return -ERESTARTSYS;
if( fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) {
......@@ -303,7 +301,7 @@ static int fops_release(struct inode *inode, struct file *file)
file->private_data = NULL;
kfree(fh);
up(&saa7146_devices_lock);
mutex_unlock(&saa7146_devices_lock);
return 0;
}
......
......@@ -279,7 +279,7 @@ int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *msgs, in
int address_err = 0;
int short_delay = 0;
if (down_interruptible (&dev->i2c_lock))
if (mutex_lock_interruptible(&dev->i2c_lock))
return -ERESTARTSYS;
for(i=0;i<num;i++) {
......@@ -366,7 +366,7 @@ int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *msgs, in
}
}
up(&dev->i2c_lock);
mutex_unlock(&dev->i2c_lock);
return err;
}
......
......@@ -410,7 +410,7 @@ static int vbi_open(struct saa7146_dev *dev, struct file *file)
V4L2_FIELD_SEQ_TB, // FIXME: does this really work?
sizeof(struct saa7146_buf),
file);
init_MUTEX(&fh->vbi_q.lock);
mutex_init(&fh->vbi_q.lock);
init_timer(&fh->vbi_read_timeout);
fh->vbi_read_timeout.function = vbi_read_timeout;
......
......@@ -378,20 +378,20 @@ static int s_fmt(struct saa7146_fh *fh, struct v4l2_format *f)
err = try_win(dev,&f->fmt.win);
if (0 != err)
return err;
down(&dev->lock);
mutex_lock(&dev->lock);
fh->ov.win = f->fmt.win;
fh->ov.nclips = f->fmt.win.clipcount;
if (fh->ov.nclips > 16)
fh->ov.nclips = 16;
if (copy_from_user(fh->ov.clips,f->fmt.win.clips,sizeof(struct v4l2_clip)*fh->ov.nclips)) {
up(&dev->lock);
mutex_unlock(&dev->lock);
return -EFAULT;
}
/* fh->ov.fh is used to indicate that we have valid overlay informations, too */
fh->ov.fh = fh;
up(&dev->lock);
mutex_unlock(&dev->lock);
/* check if our current overlay is active */
if (IS_OVERLAY_ACTIVE(fh) != 0) {
......@@ -516,7 +516,7 @@ static int set_control(struct saa7146_fh *fh, struct v4l2_control *c)
return -EINVAL;
}
down(&dev->lock);
mutex_lock(&dev->lock);
switch (ctrl->type) {
case V4L2_CTRL_TYPE_BOOLEAN:
......@@ -560,7 +560,7 @@ static int set_control(struct saa7146_fh *fh, struct v4l2_control *c)
/* fixme: we can support changing VFLIP and HFLIP here... */
if (IS_CAPTURE_ACTIVE(fh) != 0) {
DEB_D(("V4L2_CID_HFLIP while active capture.\n"));
up(&dev->lock);
mutex_unlock(&dev->lock);
return -EINVAL;
}
vv->hflip = c->value;
......@@ -568,7 +568,7 @@ static int set_control(struct saa7146_fh *fh, struct v4l2_control *c)
case V4L2_CID_VFLIP:
if (IS_CAPTURE_ACTIVE(fh) != 0) {
DEB_D(("V4L2_CID_VFLIP while active capture.\n"));
up(&dev->lock);
mutex_unlock(&dev->lock);
return -EINVAL;
}
vv->vflip = c->value;
......@@ -577,7 +577,7 @@ static int set_control(struct saa7146_fh *fh, struct v4l2_control *c)
return -EINVAL;
}
}
up(&dev->lock);
mutex_unlock(&dev->lock);
if (IS_OVERLAY_ACTIVE(fh) != 0) {
saa7146_stop_preview(fh);
......@@ -939,7 +939,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
}
}
down(&dev->lock);
mutex_lock(&dev->lock);
/* ok, accept it */
vv->ov_fb = *fb;
......@@ -948,7 +948,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
vv->ov_fb.fmt.bytesperline =
vv->ov_fb.fmt.width*fmt->depth/8;
up(&dev->lock);
mutex_unlock(&dev->lock);
return 0;
}
......@@ -1086,7 +1086,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
}
}
down(&dev->lock);
mutex_lock(&dev->lock);
for(i = 0; i < dev->ext_vv_data->num_stds; i++)
if (*id & dev->ext_vv_data->stds[i].id)
......@@ -1098,7 +1098,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
found = 1;
}
up(&dev->lock);
mutex_unlock(&dev->lock);
if (vv->ov_suspend != NULL) {
saa7146_start_preview(vv->ov_suspend);
......@@ -1201,11 +1201,11 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
DEB_D(("VIDIOCGMBUF \n"));
q = &fh->video_q;
down(&q->lock);
mutex_lock(&q->lock);
err = videobuf_mmap_setup(q,gbuffers,gbufsize,
V4L2_MEMORY_MMAP);
if (err < 0) {
up(&q->lock);
mutex_unlock(&q->lock);
return err;
}
memset(mbuf,0,sizeof(*mbuf));
......@@ -1213,7 +1213,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
mbuf->size = gbuffers * gbufsize;
for (i = 0; i < gbuffers; i++)
mbuf->offsets[i] = i * gbufsize;
up(&q->lock);
mutex_unlock(&q->lock);
return 0;
}
default:
......@@ -1414,7 +1414,7 @@ static int video_open(struct saa7146_dev *dev, struct file *file)
sizeof(struct saa7146_buf),
file);
init_MUTEX(&fh->video_q.lock);
mutex_init(&fh->video_q.lock);
return 0;
}
......
......@@ -10,6 +10,7 @@
#include <linux/config.h>
#include <linux/pci.h>
#include <linux/mutex.h>
#include "flexcop-reg.h"
......@@ -73,8 +74,7 @@ struct flexcop_device {
int (*fe_sleep) (struct dvb_frontend *);
struct i2c_adapter i2c_adap;
struct semaphore i2c_sem;
struct mutex i2c_mutex;
struct module *owner;
/* options and status */
......
......@@ -135,7 +135,7 @@ static int flexcop_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs
struct flexcop_device *fc = i2c_get_adapdata(i2c_adap);
int i, ret = 0;
if (down_interruptible(&fc->i2c_sem))
if (mutex_lock_interruptible(&fc->i2c_mutex))
return -ERESTARTSYS;
/* reading */
......@@ -161,7 +161,7 @@ static int flexcop_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs
else
ret = num;
up(&fc->i2c_sem);
mutex_unlock(&fc->i2c_mutex);
return ret;
}
......@@ -180,7 +180,7 @@ int flexcop_i2c_init(struct flexcop_device *fc)
{
int ret;
sema_init(&fc->i2c_sem,1);
mutex_init(&fc->i2c_mutex);
memset(&fc->i2c_adap, 0, sizeof(struct i2c_adapter));
strncpy(fc->i2c_adap.name, "B2C2 FlexCop device",I2C_NAME_SIZE);
......
obj-$(CONFIG_DVB_BT8XX) += bt878.o dvb-bt8xx.o dst.o dst_ca.o
EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/video -Idrivers/media/dvb/frontends
EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/video/bt8xx -Idrivers/media/dvb/frontends
......@@ -344,7 +344,7 @@ bt878_device_control(struct bt878 *bt, unsigned int cmd, union dst_gpio_packet *
int retval;
retval = 0;
if (down_interruptible (&bt->gpio_lock))
if (mutex_lock_interruptible(&bt->gpio_lock))
return -ERESTARTSYS;
/* special gpio signal */
switch (cmd) {
......@@ -375,7 +375,7 @@ bt878_device_control(struct bt878 *bt, unsigned int cmd, union dst_gpio_packet *
retval = -EINVAL;
break;
}
up(&bt->gpio_lock);
mutex_unlock(&bt->gpio_lock);
return retval;
}
......
......@@ -25,6 +25,8 @@
#include <linux/pci.h>
#include <linux/sched.h>
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include "bt848.h"
#include "bttv.h"
......@@ -108,7 +110,7 @@ struct cards {
extern int bt878_num;
struct bt878 {
struct semaphore gpio_lock;
struct mutex gpio_lock;
unsigned int nr;
unsigned int bttv_nr;
struct i2c_adapter *adapter;
......
......@@ -910,7 +910,7 @@ static int dst_get_device_id(struct dst_state *state)
static int dst_probe(struct dst_state *state)
{
sema_init(&state->dst_mutex, 1);
mutex_init(&state->dst_mutex);
if ((rdc_8820_reset(state)) < 0) {
dprintk(verbose, DST_ERROR, 1, "RDC 8820 RESET Failed.");
return -1;
......@@ -962,7 +962,7 @@ int dst_command(struct dst_state *state, u8 *data, u8 len)
{
u8 reply;
down(&state->dst_mutex);
mutex_lock(&state->dst_mutex);
if ((dst_comm_init(state)) < 0) {
dprintk(verbose, DST_NOTICE, 1, "DST Communication Initialization Failed.");
goto error;
......@@ -1013,11 +1013,11 @@ int dst_command(struct dst_state *state, u8 *data, u8 len)
dprintk(verbose, DST_INFO, 1, "checksum failure");
goto error;
}
up(&state->dst_mutex);
mutex_unlock(&state->dst_mutex);
return 0;
error:
up(&state->dst_mutex);
mutex_unlock(&state->dst_mutex);
return -EIO;
}
......@@ -1128,7 +1128,7 @@ static int dst_write_tuna(struct dvb_frontend *fe)
dst_set_voltage(fe, SEC_VOLTAGE_13);
}
state->diseq_flags &= ~(HAS_LOCK | ATTEMPT_TUNE);
down(&state->dst_mutex);
mutex_lock(&state->dst_mutex);
if ((dst_comm_init(state)) < 0) {
dprintk(verbose, DST_DEBUG, 1, "DST Communication initialization failed.");
goto error;
......@@ -1160,11 +1160,11 @@ static int dst_write_tuna(struct dvb_frontend *fe)
state->diseq_flags |= ATTEMPT_TUNE;
retval = dst_get_tuna(state);
werr:
up(&state->dst_mutex);
mutex_unlock(&state->dst_mutex);
return retval;
error:
up(&state->dst_mutex);
mutex_unlock(&state->dst_mutex);
return -EIO;
}
......
......@@ -81,7 +81,7 @@ static int dst_ci_command(struct dst_state* state, u8 * data, u8 *ca_string, u8
{
u8 reply;
down(&state->dst_mutex);
mutex_lock(&state->dst_mutex);
dst_comm_init(state);
msleep(65);
......@@ -110,11 +110,11 @@ static int dst_ci_command(struct dst_state* state, u8 * data, u8 *ca_string, u8
goto error;
}
}
up(&state->dst_mutex);
mutex_unlock(&state->dst_mutex);
return 0;
error:
up(&state->dst_mutex);
mutex_unlock(&state->dst_mutex);
return -EIO;
}
......
......@@ -25,6 +25,7 @@
#include <linux/smp_lock.h>
#include <linux/dvb/frontend.h>
#include <linux/device.h>
#include <linux/mutex.h>
#include "bt878.h"
#include "dst_ca.h"
......@@ -121,7 +122,7 @@ struct dst_state {
u8 vendor[8];
u8 board_info[8];
struct semaphore dst_mutex;
struct mutex dst_mutex;
};
struct dst_types {
......
......@@ -76,13 +76,13 @@ static int dvb_bt8xx_start_feed(struct dvb_demux_feed *dvbdmxfeed)
if (!dvbdmx->dmx.frontend)
return -EINVAL;
down(&card->lock);
mutex_lock(&card->lock);
card->nfeeds++;
rc = card->nfeeds;
if (card->nfeeds == 1)
bt878_start(card->bt, card->gpio_mode,
card->op_sync_orin, card->irq_err_ignore);
up(&card->lock);
mutex_unlock(&card->lock);
return rc;
}
......@@ -96,11 +96,11 @@ static int dvb_bt8xx_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
if (!dvbdmx->dmx.frontend)
return -EINVAL;
down(&card->lock);
mutex_lock(&card->lock);
card->nfeeds--;
if (card->nfeeds == 0)
bt878_stop(card->bt);
up(&card->lock);
mutex_unlock(&card->lock);
return 0;
}
......@@ -239,6 +239,20 @@ static int cx24108_pll_set(struct dvb_frontend* fe, struct dvb_frontend_paramete
static int pinnsat_pll_init(struct dvb_frontend* fe)
{
struct dvb_bt8xx_card *card = fe->dvb->priv;
bttv_gpio_enable(card->bttv_nr, 1, 1); /* output */
bttv_write_gpio(card->bttv_nr, 1, 1); /* relay on */
return 0;
}
static int pinnsat_pll_sleep(struct dvb_frontend* fe)
{
struct dvb_bt8xx_card *card = fe->dvb->priv;
bttv_write_gpio(card->bttv_nr, 1, 0); /* relay off */
return 0;
}
......@@ -246,6 +260,7 @@ static struct cx24110_config pctvsat_config = {
.demod_address = 0x55,
.pll_init = pinnsat_pll_init,
.pll_set = cx24108_pll_set,
.pll_sleep = pinnsat_pll_sleep,
};
static int microtune_mt7202dtf_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
......@@ -788,7 +803,7 @@ static int dvb_bt8xx_probe(struct bttv_sub_device *sub)
if (!(card = kzalloc(sizeof(struct dvb_bt8xx_card), GFP_KERNEL)))
return -ENOMEM;
init_MUTEX(&card->lock);
mutex_init(&card->lock);
card->bttv_nr = sub->core->nr;
strncpy(card->card_name, sub->core->name, sizeof(sub->core->name));
card->i2c_adapter = &sub->core->i2c_adap;
......@@ -798,14 +813,14 @@ static int dvb_bt8xx_probe(struct bttv_sub_device *sub)
card->gpio_mode = 0x0400c060;
/* should be: BT878_A_GAIN=0,BT878_A_PWRDN,BT878_DA_DPM,BT878_DA_SBR,
BT878_DA_IOM=1,BT878_DA_APP to enable serial highspeed mode. */
card->op_sync_orin = 0;
card->irq_err_ignore = 0;
card->op_sync_orin = BT878_RISC_SYNC_MASK;
card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR;
break;
case BTTV_BOARD_DVICO_DVBT_LITE:
card->gpio_mode = 0x0400C060;
card->op_sync_orin = 0;
card->irq_err_ignore = 0;
card->op_sync_orin = BT878_RISC_SYNC_MASK;
card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR;
/* 26, 15, 14, 6, 5
* A_PWRDN DA_DPM DA_SBR DA_IOM_DA
* DA_APP(parallel) */
......@@ -820,15 +835,15 @@ static int dvb_bt8xx_probe(struct bttv_sub_device *sub)
case BTTV_BOARD_NEBULA_DIGITV:
case BTTV_BOARD_AVDVBT_761:
card->gpio_mode = (1 << 26) | (1 << 14) | (1 << 5);
card->op_sync_orin = 0;
card->irq_err_ignore = 0;
card->op_sync_orin = BT878_RISC_SYNC_MASK;
card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR;
/* A_PWRDN DA_SBR DA_APP (high speed serial) */
break;
case BTTV_BOARD_AVDVBT_771: //case 0x07711461:
card->gpio_mode = 0x0400402B;
card->op_sync_orin = BT878_RISC_SYNC_MASK;
card->irq_err_ignore = 0;
card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR;
/* A_PWRDN DA_SBR DA_APP[0] PKTP=10 RISC_ENABLE FIFO_ENABLE*/
break;
......@@ -852,8 +867,8 @@ static int dvb_bt8xx_probe(struct bttv_sub_device *sub)
case BTTV_BOARD_PC_HDTV:
card->gpio_mode = 0x0100EC7B;
card->op_sync_orin = 0;
card->irq_err_ignore = 0;
card->op_sync_orin = BT878_RISC_SYNC_MASK;
card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR;
break;
default:
......@@ -881,7 +896,7 @@ static int dvb_bt8xx_probe(struct bttv_sub_device *sub)
return -EFAULT;
}
init_MUTEX(&card->bt->gpio_lock);
mutex_init(&card->bt->gpio_lock);
card->bt->bttv_nr = sub->core->nr;
if ( (ret = dvb_bt8xx_load_card(card, sub->core->type)) ) {
......
......@@ -26,6 +26,7 @@
#define DVB_BT8XX_H
#include <linux/i2c.h>
#include <linux/mutex.h>
#include "dvbdev.h"
#include "dvb_net.h"
#include "bttv.h"
......@@ -38,7 +39,7 @@
#include "lgdt330x.h"
struct dvb_bt8xx_card {
struct semaphore lock;
struct mutex lock;
int nfeeds;
char card_name[32];
struct dvb_adapter dvb_adapter;
......
......@@ -30,6 +30,7 @@
#include <linux/pci.h>
#include <linux/input.h>
#include <linux/dvb/frontend.h>
#include <linux/mutex.h>
#include "dmxdev.h"
#include "dvb_demux.h"
......@@ -116,7 +117,7 @@ static struct dvb_frontend_info cinergyt2_fe_info = {
struct cinergyt2 {
struct dvb_demux demux;
struct usb_device *udev;
struct semaphore sem;
struct mutex sem;
struct dvb_adapter adapter;
struct dvb_device *fedev;
struct dmxdev dmxdev;
......@@ -345,14 +346,14 @@ static int cinergyt2_start_feed(struct dvb_demux_feed *dvbdmxfeed)
struct dvb_demux *demux = dvbdmxfeed->demux;
struct cinergyt2 *cinergyt2 = demux->priv;
if (cinergyt2->disconnect_pending || down_interruptible(&cinergyt2->sem))
if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->sem))
return -ERESTARTSYS;
if (cinergyt2->streaming == 0)
cinergyt2_start_stream_xfer(cinergyt2);
cinergyt2->streaming++;
up(&cinergyt2->sem);
mutex_unlock(&cinergyt2->sem);
return 0;
}
......@@ -361,13 +362,13 @@ static int cinergyt2_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
struct dvb_demux *demux = dvbdmxfeed->demux;
struct cinergyt2 *cinergyt2 = demux->priv;
if (cinergyt2->disconnect_pending || down_interruptible(&cinergyt2->sem))
if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->sem))
return -ERESTARTSYS;
if (--cinergyt2->streaming == 0)
cinergyt2_stop_stream_xfer(cinergyt2);
up(&cinergyt2->sem);
mutex_unlock(&cinergyt2->sem);
return 0;
}
......@@ -483,11 +484,11 @@ static int cinergyt2_open (struct inode *inode, struct file *file)
struct cinergyt2 *cinergyt2 = dvbdev->priv;
int err = -ERESTARTSYS;
if (cinergyt2->disconnect_pending || down_interruptible(&cinergyt2->sem))
if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->sem))
return -ERESTARTSYS;
if ((err = dvb_generic_open(inode, file))) {
up(&cinergyt2->sem);
mutex_unlock(&cinergyt2->sem);
return err;
}
......@@ -499,12 +500,15 @@ static int cinergyt2_open (struct inode *inode, struct file *file)
atomic_inc(&cinergyt2->inuse);
up(&cinergyt2->sem);
mutex_unlock(&cinergyt2->sem);
return 0;
}
static void cinergyt2_unregister(struct cinergyt2 *cinergyt2)
{
dvb_net_release(&cinergyt2->dvbnet);
dvb_dmxdev_release(&cinergyt2->dmxdev);
dvb_dmx_release(&cinergyt2->demux);
dvb_unregister_device(cinergyt2->fedev);
dvb_unregister_adapter(&cinergyt2->adapter);
......@@ -517,7 +521,7 @@ static int cinergyt2_release (struct inode *inode, struct file *file)
struct dvb_device *dvbdev = file->private_data;
struct cinergyt2 *cinergyt2 = dvbdev->priv;
if (down_interruptible(&cinergyt2->sem))
if (mutex_lock_interruptible(&cinergyt2->sem))
return -ERESTARTSYS;
if (!cinergyt2->disconnect_pending && (file->f_flags & O_ACCMODE) != O_RDONLY) {
......@@ -526,7 +530,7 @@ static int cinergyt2_release (struct inode *inode, struct file *file)
cinergyt2_sleep(cinergyt2, 1);
}
up(&cinergyt2->sem);
mutex_unlock(&cinergyt2->sem);
if (atomic_dec_and_test(&cinergyt2->inuse) && cinergyt2->disconnect_pending) {
warn("delayed unregister in release");
......@@ -541,12 +545,12 @@ static unsigned int cinergyt2_poll (struct file *file, struct poll_table_struct
struct dvb_device *dvbdev = file->private_data;
struct cinergyt2 *cinergyt2 = dvbdev->priv;
if (cinergyt2->disconnect_pending || down_interruptible(&cinergyt2->sem))
if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->sem))
return -ERESTARTSYS;
poll_wait(file, &cinergyt2->poll_wq, wait);
up(&cinergyt2->sem);
mutex_unlock(&cinergyt2->sem);
return (POLLIN | POLLRDNORM | POLLPRI);
}
......@@ -613,7 +617,7 @@ static int cinergyt2_ioctl (struct inode *inode, struct file *file,
if (copy_from_user(&p, (void __user*) arg, sizeof(p)))
return -EFAULT;
if (cinergyt2->disconnect_pending || down_interruptible(&cinergyt2->sem))
if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->sem))
return -ERESTARTSYS;
param->cmd = CINERGYT2_EP1_SET_TUNER_PARAMETERS;
......@@ -629,7 +633,7 @@ static int cinergyt2_ioctl (struct inode *inode, struct file *file,
(char *) param, sizeof(*param),
NULL, 0);
up(&cinergyt2->sem);
mutex_unlock(&cinergyt2->sem);
return (err < 0) ? err : 0;
}
......@@ -724,7 +728,7 @@ static void cinergyt2_query_rc (void *data)
struct cinergyt2_rc_event rc_events[12];
int n, len, i;
if (cinergyt2->disconnect_pending || down_interruptible(&cinergyt2->sem))
if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->sem))
return;
len = cinergyt2_command(cinergyt2, buf, sizeof(buf),
......@@ -784,7 +788,7 @@ static void cinergyt2_query_rc (void *data)
schedule_delayed_work(&cinergyt2->rc_query_work,
msecs_to_jiffies(RC_QUERY_INTERVAL));
up(&cinergyt2->sem);
mutex_unlock(&cinergyt2->sem);
}
static int cinergyt2_register_rc(struct cinergyt2 *cinergyt2)
......@@ -849,7 +853,7 @@ static void cinergyt2_query (void *data)
uint8_t lock_bits;
uint32_t unc;
if (cinergyt2->disconnect_pending || down_interruptible(&cinergyt2->sem))
if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->sem))
return;
unc = s->uncorrected_block_count;
......@@ -868,7 +872,7 @@ static void cinergyt2_query (void *data)
schedule_delayed_work(&cinergyt2->query_work,
msecs_to_jiffies(QUERY_INTERVAL));
up(&cinergyt2->sem);
mutex_unlock(&cinergyt2->sem);
}
static int cinergyt2_probe (struct usb_interface *intf,
......@@ -885,7 +889,7 @@ static int cinergyt2_probe (struct usb_interface *intf,
memset (cinergyt2, 0, sizeof (struct cinergyt2));
usb_set_intfdata (intf, (void *) cinergyt2);
init_MUTEX(&cinergyt2->sem);
mutex_init(&cinergyt2->sem);
init_waitqueue_head (&cinergyt2->poll_wq);
INIT_WORK(&cinergyt2->query_work, cinergyt2_query, cinergyt2);
......@@ -937,6 +941,7 @@ static int cinergyt2_probe (struct usb_interface *intf,
return 0;
bailout:
dvb_net_release(&cinergyt2->dvbnet);
dvb_dmxdev_release(&cinergyt2->dmxdev);
dvb_dmx_release(&cinergyt2->demux);
dvb_unregister_adapter(&cinergyt2->adapter);
......@@ -967,7 +972,7 @@ static int cinergyt2_suspend (struct usb_interface *intf, pm_message_t state)
{
struct cinergyt2 *cinergyt2 = usb_get_intfdata (intf);
if (cinergyt2->disconnect_pending || down_interruptible(&cinergyt2->sem))
if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->sem))
return -ERESTARTSYS;
if (state.event > PM_EVENT_ON) {
......@@ -981,7 +986,7 @@ static int cinergyt2_suspend (struct usb_interface *intf, pm_message_t state)
cinergyt2_sleep(cinergyt2, 1);
}
up(&cinergyt2->sem);
mutex_unlock(&cinergyt2->sem);
return 0;
}
......@@ -990,7 +995,7 @@ static int cinergyt2_resume (struct usb_interface *intf)
struct cinergyt2 *cinergyt2 = usb_get_intfdata (intf);
struct dvbt_set_parameters_msg *param = &cinergyt2->param;
if (cinergyt2->disconnect_pending || down_interruptible(&cinergyt2->sem))
if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->sem))
return -ERESTARTSYS;
if (!cinergyt2->sleeping) {
......@@ -1003,7 +1008,7 @@ static int cinergyt2_resume (struct usb_interface *intf)
cinergyt2_resume_rc(cinergyt2);
up(&cinergyt2->sem);
mutex_unlock(&cinergyt2->sem);
return 0;
}
......
This diff is collapsed.
......@@ -30,14 +30,15 @@
#include <linux/wait.h>
#include <linux/fs.h>
#include <linux/string.h>
#include <asm/semaphore.h>
#include <linux/mutex.h>
#include <linux/dvb/dmx.h>
#include "dvbdev.h"
#include "demux.h"
#include "dvb_ringbuffer.h"
enum dmxdevype {
enum dmxdev_type {
DMXDEV_TYPE_NONE,
DMXDEV_TYPE_SEC,
DMXDEV_TYPE_PES,
......@@ -52,18 +53,7 @@ enum dmxdev_state {
DMXDEV_STATE_TIMEDOUT
};
struct dmxdev_buffer {
u8 *data;
int size;
int pread;
int pwrite;
wait_queue_head_t queue;
int error;
};
struct dmxdev_filter {
struct dvb_device *dvbdev;
union {
struct dmx_section_filter *sec;
} filter;
......@@ -78,26 +68,17 @@ struct dmxdev_filter {
struct dmx_pes_filter_params pes;
} params;
int type;
enum dmxdev_type type;
enum dmxdev_state state;
struct dmxdev *dev;
struct dmxdev_buffer buffer;
struct dvb_ringbuffer buffer;
struct semaphore mutex;
struct mutex mutex;
/* only for sections */
struct timer_list timer;
int todo;
u8 secheader[3];
u16 pid;
};
struct dmxdev_dvr {
int state;
struct dmxdev *dev;
struct dmxdev_buffer buffer;
};
......@@ -106,7 +87,6 @@ struct dmxdev {
struct dvb_device *dvr_dvbdev;
struct dmxdev_filter *filter;
struct dmxdev_dvr *dvr;
struct dmx_demux *demux;
int filternum;
......@@ -114,10 +94,10 @@ struct dmxdev {
#define DMXDEV_CAP_DUPLEX 1
struct dmx_frontend *dvr_orig_fe;
struct dmxdev_buffer dvr_buffer;
struct dvb_ringbuffer dvr_buffer;
#define DVR_BUFFER_SIZE (10*188*1024)
struct semaphore mutex;
struct mutex mutex;
spinlock_t lock;
};
......
This diff is collapsed.
......@@ -26,7 +26,7 @@
#include <linux/time.h>
#include <linux/timer.h>
#include <linux/spinlock.h>
#include <asm/semaphore.h>
#include <linux/mutex.h>
#include "demux.h"
......@@ -125,7 +125,7 @@ struct dvb_demux {
u8 tsbuf[204];
int tsbufp;
struct semaphore mutex;
struct mutex mutex;
spinlock_t lock;
};
......
......@@ -37,7 +37,6 @@
#include <linux/suspend.h>
#include <linux/jiffies.h>
#include <asm/processor.h>
#include <asm/semaphore.h>
#include "dvb_frontend.h"
#include "dvbdev.h"
......@@ -50,13 +49,13 @@ static int dvb_powerdown_on_sleep = 1;
module_param_named(frontend_debug, dvb_frontend_debug, int, 0644);
MODULE_PARM_DESC(frontend_debug, "Turn on/off frontend core debugging (default:off).");
module_param(dvb_shutdown_timeout, int, 0444);
module_param(dvb_shutdown_timeout, int, 0644);
MODULE_PARM_DESC(dvb_shutdown_timeout, "wait <shutdown_timeout> seconds after close() before suspending hardware");
module_param(dvb_force_auto_inversion, int, 0444);
module_param(dvb_force_auto_inversion, int, 0644);
MODULE_PARM_DESC(dvb_force_auto_inversion, "0: normal (default), 1: INVERSION_AUTO forced always");
module_param(dvb_override_tune_delay, int, 0444);
module_param(dvb_override_tune_delay, int, 0644);
MODULE_PARM_DESC(dvb_override_tune_delay, "0: normal (default), >0 => delay in milliseconds to wait for lock after a tune attempt");
module_param(dvb_powerdown_on_sleep, int, 0444);
module_param(dvb_powerdown_on_sleep, int, 0644);
MODULE_PARM_DESC(dvb_powerdown_on_sleep, "0: do not power down, 1: turn LNB volatage off on sleep (default)");
#define dprintk if (dvb_frontend_debug) printk
......@@ -88,7 +87,7 @@ MODULE_PARM_DESC(dvb_powerdown_on_sleep, "0: do not power down, 1: turn LNB vola
* FESTATE_LOSTLOCK. When the lock has been lost, and we're searching it again.
*/
static DECLARE_MUTEX(frontend_mutex);
static DEFINE_MUTEX(frontend_mutex);
struct dvb_frontend_private {
......@@ -1021,12 +1020,12 @@ int dvb_register_frontend(struct dvb_adapter* dvb,
dprintk ("%s\n", __FUNCTION__);
if (down_interruptible (&frontend_mutex))
if (mutex_lock_interruptible(&frontend_mutex))
return -ERESTARTSYS;
fe->frontend_priv = kzalloc(sizeof(struct dvb_frontend_private), GFP_KERNEL);
if (fe->frontend_priv == NULL) {
up(&frontend_mutex);
mutex_unlock(&frontend_mutex);
return -ENOMEM;
}
fepriv = fe->frontend_priv;
......@@ -1045,7 +1044,7 @@ int dvb_register_frontend(struct dvb_adapter* dvb,
dvb_register_device (fe->dvb, &fepriv->dvbdev, &dvbdev_template,
fe, DVB_DEVICE_FRONTEND);
up (&frontend_mutex);
mutex_unlock(&frontend_mutex);
return 0;
}
EXPORT_SYMBOL(dvb_register_frontend);
......@@ -1055,7 +1054,7 @@ int dvb_unregister_frontend(struct dvb_frontend* fe)
struct dvb_frontend_private *fepriv = fe->frontend_priv;
dprintk ("%s\n", __FUNCTION__);
down (&frontend_mutex);
mutex_lock(&frontend_mutex);
dvb_unregister_device (fepriv->dvbdev);
dvb_frontend_stop (fe);
if (fe->ops->release)
......@@ -1064,7 +1063,7 @@ int dvb_unregister_frontend(struct dvb_frontend* fe)
printk("dvb_frontend: Demodulator (%s) does not have a release callback!\n", fe->ops->info.name);
/* fe is invalid now */
kfree(fepriv);
up (&frontend_mutex);
mutex_unlock(&frontend_mutex);
return 0;
}
EXPORT_SYMBOL(dvb_unregister_frontend);
......@@ -104,6 +104,7 @@ struct dvb_frontend {
struct dvb_adapter *dvb;
void* demodulator_priv;
void* frontend_priv;
void* misc_priv;
};
extern int dvb_register_frontend(struct dvb_adapter* dvb,
......
......@@ -62,6 +62,7 @@
#include <linux/uio.h>
#include <asm/uaccess.h>
#include <linux/crc32.h>
#include <linux/mutex.h>
#include "dvb_demux.h"
#include "dvb_net.h"
......@@ -151,8 +152,7 @@ struct dvb_net_priv {
unsigned char ule_bridged; /* Whether the ULE_BRIDGED extension header was found. */
int ule_sndu_remain; /* Nr. of bytes still required for current ULE SNDU. */
unsigned long ts_count; /* Current ts cell counter. */
struct semaphore mutex;
struct mutex mutex;
};
......@@ -889,7 +889,7 @@ static int dvb_net_feed_start(struct net_device *dev)
unsigned char *mac = (unsigned char *) dev->dev_addr;
dprintk("%s: rx_mode %i\n", __FUNCTION__, priv->rx_mode);
down(&priv->mutex);
mutex_lock(&priv->mutex);
if (priv->tsfeed || priv->secfeed || priv->secfilter || priv->multi_secfilter[0])
printk("%s: BUG %d\n", __FUNCTION__, __LINE__);
......@@ -974,7 +974,7 @@ static int dvb_net_feed_start(struct net_device *dev)
ret = -EINVAL;
error:
up(&priv->mutex);
mutex_unlock(&priv->mutex);
return ret;
}
......@@ -984,7 +984,7 @@ static int dvb_net_feed_stop(struct net_device *dev)
int i, ret = 0;
dprintk("%s\n", __FUNCTION__);
down(&priv->mutex);
mutex_lock(&priv->mutex);
if (priv->feedtype == DVB_NET_FEEDTYPE_MPE) {
if (priv->secfeed) {
if (priv->secfeed->is_filtering) {
......@@ -1026,7 +1026,7 @@ static int dvb_net_feed_stop(struct net_device *dev)
printk("%s: no ts feed to stop\n", dev->name);
} else
ret = -EINVAL;
up(&priv->mutex);
mutex_unlock(&priv->mutex);
return ret;
}
......@@ -1208,7 +1208,7 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid, u8 feedtype)
INIT_WORK(&priv->set_multicast_list_wq, wq_set_multicast_list, net);
INIT_WORK(&priv->restart_net_feed_wq, wq_restart_net_feed, net);
init_MUTEX(&priv->mutex);
mutex_init(&priv->mutex);
net->base_addr = pid;
......
......@@ -45,6 +45,7 @@ void dvb_ringbuffer_init(struct dvb_ringbuffer *rbuf, void *data, size_t len)
rbuf->pread=rbuf->pwrite=0;
rbuf->data=data;
rbuf->size=len;
rbuf->error=0;
init_waitqueue_head(&rbuf->queue);
......@@ -87,6 +88,7 @@ ssize_t dvb_ringbuffer_avail(struct dvb_ringbuffer *rbuf)
void dvb_ringbuffer_flush(struct dvb_ringbuffer *rbuf)
{
rbuf->pread = rbuf->pwrite;
rbuf->error = 0;
}
......
......@@ -35,6 +35,7 @@ struct dvb_ringbuffer {
ssize_t size;
ssize_t pread;
ssize_t pwrite;
int error;
wait_queue_head_t queue;
spinlock_t lock;
......
......@@ -77,7 +77,7 @@ static int cxusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num)
struct dvb_usb_device *d = i2c_get_adapdata(adap);
int i;
if (down_interruptible(&d->i2c_sem) < 0)
if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
return -EAGAIN;
if (num > 2)
......@@ -126,7 +126,7 @@ static int cxusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num)
}
}
up(&d->i2c_sem);
mutex_unlock(&d->i2c_mutex);
return i;
}
......
......@@ -128,7 +128,7 @@ static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num
struct dvb_usb_device *d = i2c_get_adapdata(adap);
int i;
if (down_interruptible(&d->i2c_sem) < 0)
if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
return -EAGAIN;
if (num > 2)
......@@ -146,7 +146,7 @@ static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num
break;
}
up(&d->i2c_sem);
mutex_unlock(&d->i2c_mutex);
return i;
}
......
......@@ -48,7 +48,7 @@ static int digitv_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num
struct dvb_usb_device *d = i2c_get_adapdata(adap);
int i;
if (down_interruptible(&d->i2c_sem) < 0)
if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
return -EAGAIN;
if (num > 2)
......@@ -67,7 +67,7 @@ static int digitv_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num
break;
}
up(&d->i2c_sem);
mutex_unlock(&d->i2c_mutex);
return i;
}
......
......@@ -42,8 +42,8 @@ static int dvb_usb_init(struct dvb_usb_device *d)
{
int ret = 0;
sema_init(&d->usb_sem, 1);
sema_init(&d->i2c_sem, 1);
mutex_init(&d->usb_mutex);
mutex_init(&d->i2c_mutex);
d->state = DVB_USB_STATE_INIT;
......
......@@ -21,7 +21,7 @@ int dvb_usb_generic_rw(struct dvb_usb_device *d, u8 *wbuf, u16 wlen, u8 *rbuf,
if (wbuf == NULL || wlen == 0)
return -EINVAL;
if ((ret = down_interruptible(&d->usb_sem)))
if ((ret = mutex_lock_interruptible(&d->usb_mutex)))
return ret;
deb_xfer(">>> ");
......@@ -53,7 +53,7 @@ int dvb_usb_generic_rw(struct dvb_usb_device *d, u8 *wbuf, u16 wlen, u8 *rbuf,
}
}
up(&d->usb_sem);
mutex_unlock(&d->usb_mutex);
return ret;
}
EXPORT_SYMBOL(dvb_usb_generic_rw);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -20,6 +20,7 @@ obj-$(CONFIG_DVB_TDA1004X) += tda1004x.o
obj-$(CONFIG_DVB_SP887X) += sp887x.o
obj-$(CONFIG_DVB_NXT6000) += nxt6000.o
obj-$(CONFIG_DVB_MT352) += mt352.o
obj-$(CONFIG_DVB_ZL10353) += zl10353.o
obj-$(CONFIG_DVB_CX22702) += cx22702.o
obj-$(CONFIG_DVB_TDA10021) += tda10021.o
obj-$(CONFIG_DVB_STV0297) += stv0297.o
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
cpia2-objs := cpia2_v4l.o cpia2_usb.o cpia2_core.o
obj-$(CONFIG_VIDEO_CPIA2) += cpia2.o
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment