Commit b2e95563 authored by Linus Torvalds's avatar Linus Torvalds

Merge home.osdl.org:/home/torvalds/v2.5/linux

into home.osdl.org:/home/torvalds/v2.5/akpm
parents 9323e059 1d0990ac
......@@ -34,14 +34,13 @@ Linux 2.2:
maintainer then please contact Alan Cox <alan@lxorguk.ukuu.org.uk>
Linux 2.4:
The same rules apply as 2.2 but this kernel tree is under active
development. The final contact point for Linux 2.4 submissions is
Marcelo Tosatti <marcelo@conectiva.com.br>.
The same rules apply as 2.2. The final contact point for Linux 2.4
submissions is Marcelo Tosatti <marcelo.tosatti@cyclades.com>.
Linux 2.5:
Linux 2.6:
The same rules apply as 2.4 except that you should follow linux-kernel
to track changes in API's. The final contact point for Linux 2.5
submissions is Linus Torvalds <torvalds@osdl.org>.
to track changes in API's. The final contact point for Linux 2.6
submissions is Andrew Morton <akpm@osdl.org>.
What Criteria Determine Acceptance
----------------------------------
......
......@@ -323,7 +323,7 @@ involved. In the latter case, the driver would modify and manage the
request->buffer, request->sector and request->nr_sectors or
request->current_nr_sectors fields itself rather than using the block layer
end_request or end_that_request_first completion interfaces.
(See 2.3 or Documentation/bio/request.txt for a brief explanation of
(See 2.3 or Documentation/block/request.txt for a brief explanation of
the request structure fields)
[TBD: end_that_request_last should be usable even in this case;
......@@ -517,7 +517,7 @@ request structure.
Only some relevant fields (mainly those which changed or may be referred
to in some of the discussion here) are listed below, not necessarily in
the order in which they occur in the structure (see include/linux/blkdev.h)
Refer to Documentation/bio/request.txt for details about all the request
Refer to Documentation/block/request.txt for details about all the request
structure fields and a quick reference about the layers which are
supposed to use or modify those fields.
......
Hardware supported by the linuxtv.org DVB drivers
=================================================
Generally, the DVB hardware manufacturers frequently change the
frontends (i.e. tuner / demodulator units) used, usually without
changing the product name, revision number or specs. Some cards
are also available in versions with different frontends for
DVB-S/DVB-C/DVB-T. Thus the frontend drivers are listed seperately.
Note 1: There is no guarantee that every frontend driver works
out-of-the box with every card, because of different wiring.
Note 2: The demodulator chips can be used with a variety of
tuner/PLL chips, and not all combinations are supported. Often
the demodulator and tuner/PLL chip are inside a metal box for
shielding, and the whole metal box has its own part number.
o Frontends drivers:
- dvb_dummy_fe: for testing...
DVB-S:
- alps_bsrv2 : Alps BSRV2 (ves1893 demodulator)
- cx24110 : Conexant HM1221/HM1811 (cx24110 or cx24106 demod, cx24108 PLL)
- grundig_29504-491 : Grundig 29504-491 (Philips TDA8083 demodulator), tsa5522 PLL
- mt312 : Zarlink mt312 or Mitel vp310 demodulator, sl1935 or tsa5059 PLL
- stv0299 : Alps BSRU6 (tsa5059 PLL), LG TDQB-S00x (tsa5059 PLL),
LG TDQF-S001F (sl1935 PLL), Philips SU1278 (tua6100 PLL),
Philips SU1278SH (tsa5059 PLL)
DVB-C:
- ves1820 : various (ves1820 demodulator, sp5659c or spXXXX PLL)
- at76c651 : Atmel AT76c651(B) with DAT7021 PLL
DVB-T:
- alps_tdlb7 : Alps TDLB7 (sp8870 demodulator, sp5659 PLL)
- alps_tdmb7 : Alps TDMB7 (cx22700 demodulator)
- grundig_29504-401 : Grundig 29504-401 (LSI L64781 demodulator), tsa5060 PLL
- tda1004x : Philips tda10045h (td1344 or tdm1316l PLL)
- nxt6000 : Alps TDME7 (MITEL SP5659 PLL), Alps TDED4 (TI ALP510 PLL),
Comtech DVBT-6k07 (SP5730 PLL)
(NxtWave Communications NXT6000 demodulator)
o Cards based on the Phillips saa7146 multimedia PCI bridge chip:
- TI AV7110 based cards (i.e. with hardware MPEG decoder):
- Siemens/Technotrend/Hauppauge PCI DVB card revision 1.1, 1.3, 1.5, 1.6, 2.1
(aka Hauppauge Nexus)
- "budget" cards (i.e. without hardware MPEG decoder):
- Technotrend Budget / Hauppauge WinTV-Nova PCI Cards
- SATELCO Multimedia PCI
- KNC1 DVB-S
o Cards based on the B2C2 Inc. FlexCopII:
- Technisat SkyStar2 PCI DVB
o Cards based on the Conexant Bt8xx PCI bridge:
- Pinnacle PCTV Sat DVB
- Nebula Electronics DigiTV
o Technotrend / Hauppauge DVB USB devices:
- Nova USB
- DEC 2000-T
o Preliminary support for the analog module of the Siemens DVB-C PCI card
Thanks go to the following people for patches and contributions:
Michael Hunold <m.hunold@gmx.de>
for the initial saa7146 driver and it's recent overhaul
Christian Theiss
for his work on the initial Linux DVB driver
Marcus Metzler <mocm@metzlerbros.de>
Ralph Metzler <rjkm@metzlerbros.de>
for their contining work on the DVB driver
Michael Holzt <kju@debian.org>
for his contributions to the dvb-net driver
Diego Picciani <d.picciani@novacomp.it>
for CyberLogin for Linux which allows logging onto EON
(in case you are wondering where CyberLogin is, EON changed its login
procedure and CyberLogin is no longer used.)
Martin Schaller <martin@smurf.franken.de>
for patching the cable card decoder driver
Klaus Schmidinger <Klaus.Schmidinger@cadsoft.de>
for various fixes regarding tuning, OSD and CI stuff and his work on VDR
Steve Brown <sbrown@cortland.com>
for his AFC kernel thread
Christoph Martin <martin@uni-mainz.de>
for his LIRC infrared handler
Andreas Oberritter <andreas@oberritter.de>
Florian Schirmer <jolt@tuxbox.org>
...and all the other dBox2 people
for many bugfixes in the generic DVB Core and their work on the
dBox2 port of the DVB driver
Oliver Endriss <o.endriss@gmx.de>
for many bugfixes
Andrew de Quincey <adq_dvb@lidskialf.net>
for the tda1004x frontend driver, and various bugfixes
Peter Schildmann <peter.schildmann@web.de>
for the driver for the Technisat SkyStar2 PCI DVB card
Vadim Catana <skystar@moldova.cc>
Roberto Ragusa <r.ragusa@libero.it>
Augusto Cardoso <augusto@carhil.net>
for all the work for the FlexCopII chipset by B2C2,Inc.
(If you think you should be in this list, but you are not, drop a
line to the DVB mailing list)
Some very frequently asked questions about linuxtv-dvb
1. The signal seems to die a few seconds after tuning.
It's not a bug, it's a feature. Because the frontends have
significant power requirements (and hence get very hot), they
are powered down if they are unused (i.e. if the frontend device
is closed). The dvb-core.o module paramter "dvb_shutdown_timeout"
allow you to change the timeout (default 5 seconds). Setting the
timeout to 0 disables the timeout feature.
2. How can I watch TV?
The driver distribution includes some simple utilities which
are mainly intended for testing and to demonstrate how the
DVB API works.
Depending on whether you have a DVB-S, DVB-C or DVB-T card, use
apps/szap/szap, czap or tzap. You must supply a channel list
in ~/.[sct]zap/channels.conf. If you are lucky you can just copy
one of the supplied channel lists, or you can create a new one
by running apps/scan/scan. If you run scan on an unknown network
you might have to supply some start data in apps/scan/initial.h.
If you have a card with a built-in hardware MPEG-decoder the
drivers create a video4linux device (/dev/v4l/video0) which
you can use to watch TV with any v4l application. xawtv is known
to work. Note that you cannot change channels with xawtv, you
have to zap using [sct]zap. If you want a nice application for
TV watching and record/playback, have a look at VDR.
If your card does not have a hardware MPEG decoder you need
a software MPEG decoder. Mplayer or xine are known to work.
Newsflash: MythTV also has DVB support now.
Note: Only very recent versions of Mplayer and xine can decode.
MPEG2 transport streams (TS) directly. Then, run
'[sct]zap channelname -r' in one xterm, and keep it running,
and start 'mplayer - < /dev/dvb/adapter0/dvr0' or
'xine stdin://mpeg2 < /dev/dvb/adapter0/dvr0' in a second xterm.
That's all far from perfect, but it seems no one has written
a nice DVB application which includes a builtin software MPEG
decoder yet.
Newsflash: Newest xine directly supports DVB. Just copy your
channels.conf to ~/.xine and start 'xine dvb://', or select
the DVB button in the xine GUI. Channel switching works using the
numpad pgup/pgdown (NP9 / NP3) keys to scroll through the channel osd
menu and pressing numpad-enter to switch to the selected channel.
Note: Older versions of xine and mplayer understand MPEG program
streams (PS) only, and can be used in conjunction with the
ts2ps tool from the Metzler Brother's dvb-mpegtools package.
3. Which other DVB applications exist?
http://www.cadsoft.de/people/kls/vdr/
Klaus Schmidinger's Video Disk Recorder
http://www.metzlerbros.org/dvb/
Metzler Bros. DVB development; alternate drivers and
DVB utilities, include dvb-mpegtools and tuxzap.
http://www.linuxstb.org/
http://sourceforge.net/projects/dvbtools/
Dave Chapman's dvbtools package, including
dvbstream and dvbtune
http://www.linuxdvb.tv/
Henning Holtschneider's site with many interesting
links and docs
http://www.dbox2.info/
LinuxDVB on the dBox2
http://www.tuxbox.org/
http://cvs.tuxbox.org/
the TuxBox CVS many interesting DVB applications and the dBox2
DVB source
http://sourceforge.net/projects/dvbsak/
DVB Swiss Army Knife library and utilities
http://www.nenie.org/misc/mpsys/
MPSYS: a MPEG2 system library and tools
http://mplayerhq.hu/
mplayer
http://xine.sourceforge.net/
http://xinehq.de/
xine
http://www.mythtv.org/
MythTV - analog TV PVR, but now with DVB support, too
(with software MPEG decode)
4. Can't get a signal tuned correctly
If you are using a Technotrend/Hauppauge DVB-C card *without* analog
module, you might have to use module parameter adac=-1 (dvb-ttpci.o).
5. The dvb_net device doesn't give me any multicast packets
Check your routes if they include the multicast address range.
Additionally make sure that "source validation by reversed path
lookup" is disabled:
$ "echo 0 > /proc/sys/net/ipv4/conf/dvb0/rp_filter"
eof
Some DVB cards and many newer frontends require proprietary,
binary-only firmware.
The DVB drivers will be converted to use the request_firmware()
hotplug interface (see linux/Documentation/firmware_class/).
(CONFIG_FW_LOADER)
The firmware can be loaded automatically via the hotplug manager
or manually with the steps described below.
Currently the drivers still use various different methods
to load their firmwares, so here's just a short list of the
current state:
- dvb-ttpci: driver uses firmware hotplug interface
- ttusb-budget: firmware is compiled in (dvb-ttusb-dspbootcode.h)
- sp887x: firmware is compiled in (sp887x_firm.h)
- alps_tdlb7: firmware is loaded from path specified by
"mcfile" module parameter; the binary must be
extracted from the Windows driver (Sc_main.mc).
- tda1004x: firmware is loaded from path specified in
DVB_TDA1004X_FIRMWARE_FILE kernel config
variable (default /etc/dvb/tda1004x.bin); the
firmware binary must be extracted from the windows
driver
- ttusb-dec: see "ttusb-dec.txt" for details
1) Automatic firmware loading
You need to install recent hotplug scripts if your distribution did not do it
for you already, especially the /etc/hotplug/firmware.agent.
http://linux-hotplug.sourceforge.net/ (Call /sbin/hotplug without arguments
to find out if the firmware agent is installed.)
The firmware.agent script expects firmware binaries in
/usr/lib/hotplug/firmware/. To avoid naming and versioning
conflicts we propose the following naming scheme:
/usr/lib/hotplug/firmware/dvb-{driver}-{ver}.fw for MPEG decoders etc.
/usr/lib/hotplug/firmware/dvb-fe-{driver}-{ver}.fw for frontends
{driver} name is the basename of the driver kernel module (e.g. dvb-ttpci)
{ver} is a version number/name that should change only when the
driver/firmware internal API changes (so users are free to install the
latest firmware compatible with the driver).
2) Manually loading the firmware into a driver
(currently only the dvb-ttpci / av7110 driver supports this)
Step a) Mount sysfs-filesystem.
Sysfs provides a means to export kernel data structures, their attributes,
and the linkages between them to userspace.
For detailed informations have a look at Documentation/filesystems/sysfs.txt
All you need to know at the moment is that firmware loading only works through
sysfs.
> mkdir /sys
> mount -t sysfs sysfs /sys
Step b) Exploring the firmware loading facilities
Firmware_class support is located in
/sys/class/firmware
> dir /sys/class/firmware
The "timeout" values specifies the amount of time that is waited before the
firmware upload process is cancelled. The default values is 10 seconds. If
you use a hotplug script for the firmware upload, this is sufficient. If
you want to upload the firmware by hand, however, this might be too fast.
> echo "180" > /sys/class/firmware/timeout
Step c) Getting a usable firmware file for the dvb-ttpci driver/av7110 card.
You can download the firmware files from
http://www.linuxtv.org/download/dvb/
Please note that in case of the dvb-ttpci driver this is *not* the "Root"
file you probably know from the 2.4 DVB releases driver.
> wget http://www.linuxtv.org/download/dvb/dvb-ttpci-01.fw
gets you the version 01 of the firmware fot the ttpci driver.
Step d) Loading the dvb-ttpci driver and loading the firmware
"modprobe" will take care that every needed module will be loaded
automatically (except the frontend driver)
> modprobe dvb-ttpci
The "modprobe" process will hang until
a) you upload the firmware or
b) the timeout occurs.
Change to another terminal and have a look at
> dir /sys/class/firmware/
total 0
drwxr-xr-x 2 root root 0 Jul 29 11:00 0000:03:05.0
-rw-r--r-- 1 root root 0 Jul 29 10:41 timeout
"0000:03:05.0" is the id for my dvb-c card. It depends on the pci slot,
so it changes if you plug the card to different slots.
You can upload the firmware like that:
> export DEVDIR=/sys/class/firmware/0000\:03\:05.0
> echo 1 > $DEVDIR/loading
> cat dvb-ttpci-01.fw > $DEVDIR/data
> echo 0 > $DEVDIR/loading
That's it. The driver should be up and running now.
Linux Digital Video Broadcast (DVB) subsystem
=============================================
The main development site and CVS repository for these
drivers is http://linuxtv.org/.
The developer mailing list linux-dvb is also hosted there,
see http://linuxtv.org/mailinglists.xml. Please check
the archive http://linuxtv.org/mailinglists/linux-dvb/
before asking newbie questions on the list.
API documentation, utilities and test/example programs
are available as part of the old driver package for Linux 2.4
(linuxtv-dvb-1.0.x.tar.gz), or from CVS (module DVB).
We plan to split this into separate packages, but it's not
been done yet.
http://linuxtv.org/download/dvb/
What's inside this directory:
"cards.txt"
contains a list of supported hardware.
"contributors.txt"
is the who-is-who of DVB development
"faq.txt"
contains frequently asked questions and their answers.
"firmware.txt"
contains informations for required external firmware
files and where to get them.
"ttusb-dec.txt"
contains detailed informations about the
TT DEC2000/DEC3000 USB DVB hardware.
Good luck and have fun!
TechnoTrend/Hauppauge DEC USB Driver
====================================
Driver Status
-------------
Supported:
DEC2000-t
Linux Kernels 2.4 and 2.6
Video Streaming
Audio Streaming
Channel Zapping
Hotplug firmware loader under 2.6 kernels
In Progress:
DEC3000-s
To Do:
Section data
Teletext streams
Tuner status information
DVB network interface
Streaming video PC->DEC
Note: Since section data can not be retreived yet, scan apps will not work.
Getting the Firmware
--------------------
Currently, the driver only works with v2.15a of the firmware. The firmwares
can be obtained in this way:
wget http://hauppauge.lightpath.net/de/dec215a.exe
unzip -j dec215a.exe Software/Oem/STB/App/Boot/STB_PC_T.bin
unzip -j dec215a.exe Software/Oem/STB/App/Boot/STB_PC_S.bin
Compilation Notes for 2.4 kernels
---------------------------------
For 2.4 kernels the firmware for the DECs is compiled into the driver itself.
The firmwares are expected to be in /etc/dvb at compilation time.
mv STB_PC_T.bin /etc/dvb/dec2000t.bin
mv STB_PC_S.bin /etc/dvb/dec3000s.bin
Hotplug Firmware Loading for 2.6 kernels
----------------------------------------
For 2.6 kernels the firmware is loaded at the point that the driver module is
loaded. See linux/Documentation/dvb/FIRMWARE for more information.
mv STB_PC_T.bin /usr/lib/hotplug/firmware/dec2000t.bin
mv STB_PC_S.bin /usr/lib/hotplug/firmware/dec3000s.bin
......@@ -32,7 +32,7 @@ resolutions.
You should compile in both vgacon (to boot if you remove your Rage128 from
box) and aty128fb (for graphics mode). You should not compile-in vesafb
unless you have primary display on non-Rage128 VBE2.0 device (see
Documentation/vesafb.txt for details).
Documentation/fb/vesafb.txt for details).
X11
......
......@@ -31,7 +31,7 @@ pass to the kernel this command line: "video=matroxfb:vesa:0x1BB".
You should compile in both vgacon (to boot if you remove you Matrox from
box) and matroxfb (for graphics mode). You should not compile-in vesafb
unless you have primary display on non-Matrox VBE2.0 device (see
Documentation/vesafb.txt for details).
Documentation/fb/vesafb.txt for details).
Currently supported video modes are (through vesa:... interface, PowerMac
has [as addon] compatibility code):
......
......@@ -22,6 +22,7 @@ Offset Type Description
0x90000 + contents of CL_OFFSET
(only taken, when CL_MAGIC = 0xA33F)
0x40 20 bytes struct apm_bios_info, APM_BIOS_INFO
0x60 16 bytes Intel SpeedStep (IST) BIOS support information
0x80 16 bytes hd0-disk-parameter from intvector 0x41
0x90 16 bytes hd1-disk-parameter from intvector 0x46
......
......@@ -255,7 +255,7 @@ driver.
is also emulated, characters should appear if you move it.
You can test the joystick emulation with the 'jstest' utility,
available in the joystick package (see Documentation/joystick.txt).
available in the joystick package (see Documentation/input/joystick.txt).
You can test the event devices with the 'evtest' utility available
in the LinuxConsole project CVS archive (see the URL below).
......
......@@ -141,8 +141,8 @@ Expressions are listed in decreasing order of precedence.
otherwise 'y'.
(4) Returns the value of the expression. Used to override precedence.
(5) Returns the result of (2-/expr/).
(6) Returns the result of max(/expr/, /expr/).
(7) Returns the result of min(/expr/, /expr/).
(6) Returns the result of min(/expr/, /expr/).
(7) Returns the result of max(/expr/, /expr/).
An expression can have a value of 'n', 'm' or 'y' (or 0, 1, 2
respectively for calculations). A menu entry becomes visible when it's
......
For now this is a raw copy from the old Documentation/modules.txt,
For now this is a raw copy from the old Documentation/kbuild/modules.txt,
which was removed in 2.6.0-test5.
The information herein is correct but not complete.
......
......@@ -1150,7 +1150,7 @@ running once the system is up.
See header of drivers/scsi/wd7000.c.
wdt= [WDT] Watchdog
See Documentation/watchdog.txt.
See Documentation/watchdog/watchdog.txt.
xd= [HW,XT] Original XT pre-IDE (RLL encoded) disks.
xd_geo= See header of drivers/block/xd.c.
......
......@@ -3623,7 +3623,7 @@ struct _snd_pcm_runtime {
<para>
More precise information can be found in
<filename>alsa-kernel/Documentation/ControlNames.txt</filename>.
<filename>alsa-kernel/Documentation/sound/alsa/ControlNames.txt</filename>.
</para>
</section>
</section>
......
......@@ -2,7 +2,7 @@ Documentation for CMI 8330 (SoundPRO)
-------------------------------------
Alessandro Zummo <azummo@ita.flashnet.it>
( Be sure to read Documentation/sound/SoundPro too )
( Be sure to read Documentation/sound/oss/SoundPro too )
This adapter is now directly supported by the sb driver.
......
......@@ -114,7 +114,7 @@ See INSTALL.RH for more details.
# insmod awe_wave
(Be sure to load awe_wave after sb!)
See /usr/src/linux/Documentation/sound/AWE32 for
See /usr/src/linux/Documentation/sound/oss/AWE32 for
more details.
9. (only for obsolete systems) If you don't have /dev/sequencer
......
......@@ -24,7 +24,7 @@ History:
========
0.1.0 11/20/1998 First version, draft
1.0.0 11/1998 Alan Cox changes, incorporation in 2.2.0
as /usr/src/linux/Documentation/sound/Introduction
as /usr/src/linux/Documentation/sound/oss/Introduction
1.1.0 6/30/1999 Second version, added notes on making the drivers,
added info on multiple sound cards of similar types,]
added more diagnostics info, added info about esd.
......
......@@ -9,7 +9,7 @@ and others whose names I could not find.
This documentation is relevant for the PAS16 driver (pas2_card.c and
friends) under kernel version 2.3.99 and later. If you are
unfamiliar with configuring sound under Linux, please read the
Sound-HOWTO, linux/Documentation/sound/Introduction and other
Sound-HOWTO, linux/Documentation/sound/oss/Introduction and other
relevant docs first.
The following information is relevant information from README.OSS
......@@ -73,8 +73,8 @@ CONFIG_SOUND
You want to read the Sound-HOWTO, available from
http://www.tldp.org/docs.html#howto . General information
about the modular sound system is contained in the files
Documentation/sound/Introduction. The file
Documentation/sound/README.OSS contains some slightly outdated but
Documentation/sound/oss/Introduction. The file
Documentation/sound/oss/README.OSS contains some slightly outdated but
still useful information as well.
OSS sound modules
......@@ -119,7 +119,7 @@ CONFIG_SOUND_YM3812
cards may have software (TSR) FM emulation. Enabling FM support with
these cards may cause trouble (I don't currently know of any such
cards, however).
Please read the file Documentation/sound/OPL3 if your card has an
Please read the file Documentation/sound/oss/OPL3 if your card has an
OPL3 chip.
If you compile the driver into the kernel, you have to add
"opl3=<io>" to the kernel command line.
......
Documentation for the SoundPro CMI8330 extensions in the WSS driver (ad1848.o)
------------------------------------------------------------------------------
( Be sure to read Documentation/sound/CMI8330 too )
( Be sure to read Documentation/sound/oss/CMI8330 too )
Ion Badulescu, ionut@cs.columbia.edu
February 24, 1999
......
......@@ -105,7 +105,7 @@ design and implementation of the driver.
drivers/sound/wf_midi.c -- the "uart401" driver
to support virtual MIDI mode.
include/wavefront.h -- the header file
Documentation/sound/Tropez+ -- short docs on configuration
Documentation/sound/oss/Tropez+ -- short docs on configuration
**********************************************************************
4) How do I compile/install/use it ?
......
......@@ -878,7 +878,7 @@ rpm: clean spec
$(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version;\
mv -f $(objtree)/.tmp_version $(objtree)/.version;
$(RPM) -ta ../$(KERNELPATH).tar.gz
$(RPM) --target $(UTS_MACHINE) -ta ../$(KERNELPATH).tar.gz
rm ../$(KERNELPATH).tar.gz
# Brief documentation of the typical targets used
......
......@@ -119,7 +119,7 @@ BUILD directory for the kernel:
cd /usr/src/linux-2.6.N
make O=/home/name/build/kernel menuconfig
make O=/home/name/build/kernel
sudo make O=/home/name/build/kernel install_modules install
sudo make O=/home/name/build/kernel modules_install install
Please note: If the 'O=output/dir' option is used then it must be
used for all invocations of make.
......
......@@ -304,7 +304,7 @@ config SA1100_YOPY
depends on ARCH_SA1100
help
Say Y here to support the Yopy PDA. Product information at
<http://www.yopy.com/>. See Documentation/arm/SA110/Yopy
<http://www.yopy.com/>. See Documentation/arm/SA1100/Yopy
for more.
config SA1100_STORK
......
......@@ -115,6 +115,11 @@ config ACPI_SRAT
default y
depends on NUMA && (X86_SUMMIT || X86_GENERICARCH)
config X86_SUMMIT_NUMA
bool
default y
depends on NUMA && (X86_SUMMIT || X86_GENERICARCH)
config X86_CYCLONE_TIMER
bool
default y
......
......@@ -24,7 +24,7 @@ obj-$(CONFIG_X86_MPPARSE) += mpparse.o
obj-$(CONFIG_X86_LOCAL_APIC) += apic.o nmi.o
obj-$(CONFIG_X86_IO_APIC) += io_apic.o
obj-$(CONFIG_X86_NUMAQ) += numaq.o
obj-$(CONFIG_X86_SUMMIT) += summit.o
obj-$(CONFIG_X86_SUMMIT_NUMA) += summit.o
obj-$(CONFIG_EDD) += edd.o
obj-$(CONFIG_MODULES) += module.o
obj-y += sysenter.o vsyscall.o
......
......@@ -29,86 +29,85 @@
#include <linux/mm.h>
#include <linux/init.h>
#include <asm/io.h>
#include <mach_mpparse.h>
#include <asm/mach-summit/mach_mpparse.h>
#ifdef CONFIG_NUMA
static void __init setup_pci_node_map_for_wpeg(int wpeg_num, struct rio_table_hdr *rth,
struct scal_detail **scal_nodes, struct rio_detail **rio_nodes){
int twst_num = 0, node = 0, first_bus = 0;
int i, bus, num_busses;
static struct rio_table_hdr *rio_table_hdr __initdata;
static struct scal_detail *scal_devs[MAX_NUMNODES] __initdata;
static struct rio_detail *rio_devs[MAX_NUMNODES*4] __initdata;
for(i = 0; i < rth->num_rio_dev; i++){
if (rio_nodes[i]->node_id == rio_nodes[wpeg_num]->owner_id){
twst_num = rio_nodes[i]->owner_id;
static int __init setup_pci_node_map_for_wpeg(int wpeg_num, int last_bus)
{
int twister = 0, node = 0;
int i, bus, num_buses;
for(i = 0; i < rio_table_hdr->num_rio_dev; i++){
if (rio_devs[i]->node_id == rio_devs[wpeg_num]->owner_id){
twister = rio_devs[i]->owner_id;
break;
}
}
if (i == rth->num_rio_dev){
printk("%s: Couldn't find owner Cyclone for Winnipeg!\n", __FUNCTION__);
return;
if (i == rio_table_hdr->num_rio_dev){
printk(KERN_ERR "%s: Couldn't find owner Cyclone for Winnipeg!\n", __FUNCTION__);
return last_bus;
}
for(i = 0; i < rth->num_scal_dev; i++){
if (scal_nodes[i]->node_id == twst_num){
node = scal_nodes[i]->node_id;
for(i = 0; i < rio_table_hdr->num_scal_dev; i++){
if (scal_devs[i]->node_id == twister){
node = scal_devs[i]->node_id;
break;
}
}
if (i == rth->num_scal_dev){
printk("%s: Couldn't find owner Twister for Cyclone!\n", __FUNCTION__);
return;
if (i == rio_table_hdr->num_scal_dev){
printk(KERN_ERR "%s: Couldn't find owner Twister for Cyclone!\n", __FUNCTION__);
return last_bus;
}
switch (rio_nodes[wpeg_num]->type){
switch (rio_devs[wpeg_num]->type){
case CompatWPEG:
/* The Compatability Winnipeg controls the legacy busses
(busses 0 & 1), the 66MHz PCI bus [2 slots] (bus 2),
and the "extra" busses in case a PCI-PCI bridge card is
used in either slot (busses 3 & 4): total 5 busses. */
num_busses = 5;
/* The BIOS numbers the busses starting at 1, and in a
slightly wierd manner. You'll have to trust that
the math used below to determine the number of the
first bus works. */
first_bus = (rio_nodes[wpeg_num]->first_slot - 1) * 2;
/* The Compatability Winnipeg controls the 2 legacy buses,
* the 66MHz PCI bus [2 slots] and the 2 "extra" buses in case
* a PCI-PCI bridge card is used in either slot: total 5 buses.
*/
num_buses = 5;
break;
case AltWPEG:
/* The Alternate/Secondary Winnipeg controls the 1st 133MHz
bus [1 slot] & its "extra" bus (busses 0 & 1), the 2nd
133MHz bus [1 slot] & its "extra" bus (busses 2 & 3), the
100MHz bus [2 slots] (bus 4), and the "extra" busses for
the 2 100MHz slots (busses 5 & 6): total 7 busses. */
num_busses = 7;
first_bus = (rio_nodes[wpeg_num]->first_slot * 2) - 1;
/* The Alternate Winnipeg controls the 2 133MHz buses [1 slot
* each], their 2 "extra" buses, the 100MHz bus [2 slots] and
* the "extra" buses for each of those slots: total 7 buses.
*/
num_buses = 7;
break;
case LookOutAWPEG:
case LookOutBWPEG:
printk("%s: LookOut Winnipegs not supported yet!\n", __FUNCTION__);
return;
/* A Lookout Winnipeg controls 3 100MHz buses [2 slots each]
* & the "extra" buses for each of those slots: total 9 buses.
*/
num_buses = 9;
break;
default:
printk("%s: Unsupported Winnipeg type!\n", __FUNCTION__);
return;
printk(KERN_INFO "%s: Unsupported Winnipeg type!\n", __FUNCTION__);
return last_bus;
}
for(bus = first_bus; bus < first_bus + num_busses; bus++)
for(bus = last_bus; bus < last_bus + num_buses; bus++)
mp_bus_id_to_node[bus] = node;
return bus;
}
static int __init build_detail_arrays(struct rio_table_hdr *rth,
struct scal_detail **sd, struct rio_detail **rd){
static int __init build_detail_arrays(void)
{
unsigned long ptr;
int i, scal_detail_size, rio_detail_size;
if ((rth->num_scal_dev > MAX_NUMNODES) ||
(rth->num_rio_dev > MAX_NUMNODES * 2)){
printk("%s: MAX_NUMNODES too low! Defined as %d, but system has %d nodes.\n", __FUNCTION__, MAX_NUMNODES, rth->num_scal_dev);
return 1;
if (rio_table_hdr->num_scal_dev > MAX_NUMNODES){
printk(KERN_WARNING "%s: MAX_NUMNODES too low! Defined as %d, but system has %d nodes.\n", __FUNCTION__, MAX_NUMNODES, rio_table_hdr->num_scal_dev);
return 0;
}
switch (rth->version){
switch (rio_table_hdr->version){
default:
printk("%s: Bad Rio Grande Table Version: %d\n", __FUNCTION__, rth->version);
return 1;
printk(KERN_WARNING "%s: Invalid Rio Grande Table Version: %d\n", __FUNCTION__, rio_table_hdr->version);
return 0;
case 2:
scal_detail_size = 11;
rio_detail_size = 13;
......@@ -119,32 +118,27 @@ static int __init build_detail_arrays(struct rio_table_hdr *rth,
break;
}
ptr = (unsigned long)rth + 3;
for(i = 0; i < rth->num_scal_dev; i++)
sd[i] = (struct scal_detail *)(ptr + (scal_detail_size * i));
ptr = (unsigned long)rio_table_hdr + 3;
for(i = 0; i < rio_table_hdr->num_scal_dev; i++, ptr += scal_detail_size)
scal_devs[i] = (struct scal_detail *)ptr;
ptr += scal_detail_size * rth->num_scal_dev;
for(i = 0; i < rth->num_rio_dev; i++)
rd[i] = (struct rio_detail *)(ptr + (rio_detail_size * i));
for(i = 0; i < rio_table_hdr->num_rio_dev; i++, ptr += rio_detail_size)
rio_devs[i] = (struct rio_detail *)ptr;
return 0;
return 1;
}
void __init setup_summit(void)
{
struct rio_table_hdr *rio_table_hdr = NULL;
struct scal_detail *scal_devs[MAX_NUMNODES];
struct rio_detail *rio_devs[MAX_NUMNODES*2];
unsigned long ptr;
unsigned short offset;
int i;
memset(mp_bus_id_to_node, -1, sizeof(mp_bus_id_to_node));
int i, next_wpeg, next_bus = 0;
/* The pointer to the EBDA is stored in the word @ phys 0x40E(40:0E) */
ptr = *(unsigned short *)phys_to_virt(0x40Eul);
ptr = (unsigned long)phys_to_virt(ptr << 4);
rio_table_hdr = NULL;
offset = 0x180;
while (offset){
/* The block id is stored in the 2nd word */
......@@ -157,16 +151,30 @@ void __init setup_summit(void)
offset = *((unsigned short *)(ptr + offset));
}
if (!rio_table_hdr){
printk("%s: Unable to locate Rio Grande Table in EBDA - bailing!\n", __FUNCTION__);
printk(KERN_ERR "%s: Unable to locate Rio Grande Table in EBDA - bailing!\n", __FUNCTION__);
return;
}
if (build_detail_arrays(rio_table_hdr, scal_devs, rio_devs))
if (!build_detail_arrays())
return;
for(i = 0; i < rio_table_hdr->num_rio_dev; i++)
if (is_WPEG(rio_devs[i]->type))
/* It's a Winnipeg, it's got PCI Busses */
setup_pci_node_map_for_wpeg(i, rio_table_hdr, scal_devs, rio_devs);
/* The first Winnipeg we're looking for has an index of 0 */
next_wpeg = 0;
do {
for(i = 0; i < rio_table_hdr->num_rio_dev; i++){
if (is_WPEG(rio_devs[i]) && rio_devs[i]->WP_index == next_wpeg){
/* It's the Winnipeg we're looking for! */
next_bus = setup_pci_node_map_for_wpeg(i, next_bus);
next_wpeg++;
break;
}
}
/*
* If we go through all Rio devices and don't find one with
* the next index, it means we've found all the Winnipegs,
* and thus all the PCI buses.
*/
if (i == rio_table_hdr->num_rio_dev)
next_wpeg = 0;
} while (next_wpeg != 0);
}
#endif /* CONFIG_NUMA */
......@@ -71,7 +71,7 @@ static void mark_offset_cyclone(void)
lost = delta/(1000000/HZ);
delay = delta%(1000000/HZ);
if (lost >= 2)
jiffies += lost-1;
jiffies_64 += lost-1;
/* update the monotonic base value */
this_offset = ((unsigned long long)last_cyclone_high<<32)|last_cyclone_low;
......@@ -88,7 +88,7 @@ static void mark_offset_cyclone(void)
* usec delta is > 90% # of usecs/tick)
*/
if (lost && abs(delay - delay_at_last_interrupt) > (900000/HZ))
jiffies++;
jiffies_64++;
}
static unsigned long get_offset_cyclone(void)
......
......@@ -108,7 +108,7 @@ static void mark_offset_hpet(void)
offset = hpet_readl(HPET_T0_CMP) - hpet_tick;
if (unlikely(((offset - hpet_last) > hpet_tick) && (hpet_last != 0))) {
int lost_ticks = (offset - hpet_last) / hpet_tick;
jiffies += lost_ticks;
jiffies_64 += lost_ticks;
}
hpet_last = offset;
......
......@@ -30,7 +30,6 @@ struct timer_opts timer_tsc;
int tsc_disable __initdata = 0;
extern spinlock_t i8253_lock;
extern volatile unsigned long jiffies;
static int use_tsc;
/* Number of usecs that the last interrupt was delayed */
......@@ -141,7 +140,7 @@ unsigned long long sched_clock(void)
#ifndef CONFIG_NUMA
if (!use_tsc)
#endif
return (unsigned long long)jiffies * (1000000000 / HZ);
return (unsigned long long)get_jiffies_64() * (1000000000 / HZ);
/* Read the Time Stamp Counter */
rdtscll(this_offset);
......@@ -184,6 +183,18 @@ static void mark_offset_tsc(void)
count = inb_p(PIT_CH0); /* read the latched count */
count |= inb(PIT_CH0) << 8;
/*
* VIA686a test code... reset the latch if count > max + 1
* from timer_pit.c - cjb
*/
if (count > LATCH) {
outb_p(0x34, PIT_MODE);
outb_p(LATCH & 0xff, PIT_CH0);
outb(LATCH >> 8, PIT_CH0);
count = LATCH - 1;
}
spin_unlock(&i8253_lock);
if (pit_latch_buggy) {
......@@ -215,7 +226,7 @@ static void mark_offset_tsc(void)
lost = delta/(1000000/HZ);
delay = delta%(1000000/HZ);
if (lost >= 2) {
jiffies += lost-1;
jiffies_64 += lost-1;
/* sanity check to ensure we're not always losing ticks */
if (lost_count++ > 100) {
......@@ -241,7 +252,7 @@ static void mark_offset_tsc(void)
* usec delta is > 90% # of usecs/tick)
*/
if (lost && abs(delay - delay_at_last_interrupt) > (900000/HZ))
jiffies++;
jiffies_64++;
}
static void delay_tsc(unsigned long loops)
......@@ -283,7 +294,7 @@ static void mark_offset_tsc_hpet(void)
offset = hpet_readl(HPET_T0_CMP) - hpet_tick;
if (unlikely(((offset - hpet_last) > hpet_tick) && (hpet_last != 0))) {
int lost_ticks = (offset - hpet_last) / hpet_tick;
jiffies += lost_ticks;
jiffies_64 += lost_ticks;
}
hpet_last = hpet_current;
......
......@@ -30,6 +30,7 @@ void *kmap_atomic(struct page *page, enum km_type type)
enum fixed_addresses idx;
unsigned long vaddr;
/* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */
inc_preempt_count();
if (page < highmem_start_page)
return page_address(page);
......@@ -54,6 +55,7 @@ void kunmap_atomic(void *kvaddr, enum km_type type)
if (vaddr < FIXADDR_START) { // FIXME
dec_preempt_count();
preempt_check_resched();
return;
}
......@@ -69,6 +71,7 @@ void kunmap_atomic(void *kvaddr, enum km_type type)
#endif
dec_preempt_count();
preempt_check_resched();
}
struct page *kmap_atomic_to_page(void *ptr)
......
......@@ -1025,7 +1025,7 @@ config WATCHDOG
implementation entirely in software (which can sometimes fail to
reboot the machine) and a driver for hardware watchdog boards, which
are more robust and can also keep track of the temperature inside
your computer. For details, read <file:Documentation/watchdog.txt>
your computer. For details, read <file:Documentation/watchdog/watchdog.txt>
in the kernel source.
The watchdog is usually used together with the watchdog daemon
......
......@@ -1261,8 +1261,8 @@ config SOUND
You want to read the Sound-HOWTO, available from
<http://www.tldp.org/docs.html#howto>. General information about
the modular sound system is contained in the files
<file:Documentation/sound/Introduction>. The file
<file:Documentation/sound/README.OSS> contains some slightly
<file:Documentation/sound/oss/Introduction>. The file
<file:Documentation/sound/oss/README.OSS> contains some slightly
outdated but still useful information as well.
If you have a PnP sound card and you want to configure it at boot
......@@ -1270,7 +1270,7 @@ config SOUND
<http://www.roestock.demon.co.uk/isapnptools/>), then you need to
compile the sound card support as a module and load that module
after the PnP configuration is finished. To do this, choose M here
and read <file:Documentation/sound/README.modules>; the module
and read <file:Documentation/sound/oss/README.modules>; the module
will be called soundcore.
I'm told that even without a sound card, you can make your computer
......
......@@ -40,6 +40,7 @@ void *kmap_atomic(struct page *page, enum km_type type)
enum fixed_addresses idx;
unsigned long vaddr;
/* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */
inc_preempt_count();
if (page < highmem_start_page)
return page_address(page);
......@@ -64,6 +65,7 @@ void kunmap_atomic(void *kvaddr, enum km_type type)
if (vaddr < FIXADDR_START) { // FIXME
dec_preempt_count();
preempt_check_resched();
return;
}
......@@ -79,6 +81,7 @@ void kunmap_atomic(void *kvaddr, enum km_type type)
#endif
dec_preempt_count();
preempt_check_resched();
}
struct page *kmap_atomic_to_page(void *ptr)
......
......@@ -215,7 +215,7 @@ EXPORT_SYMBOL(enable_irq);
int show_interrupts(struct seq_file *p, void *v)
{
#ifdef CONFIG_PROC_FS
unsigned int regnr = *(loff_t *) v, i;
unsigned int regnr = *(loff_t *) v, i = 0;
if (regnr == 0) {
seq_puts(p, " ");
......
......@@ -1053,7 +1053,7 @@ config WATCHDOG
implementation entirely in software (which can sometimes fail to
reboot the machine) and a driver for hardware watchdog boards, which
are more robust and can also keep track of the temperature inside
your computer. For details, read <file:Documentation/watchdog.txt>
your computer. For details, read <file:Documentation/watchdog/watchdog.txt>
in the kernel source.
The watchdog is usually used together with the watchdog daemon
......
......@@ -33,6 +33,7 @@ void *kmap_atomic(struct page *page, enum km_type type)
unsigned long idx;
unsigned long vaddr;
/* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */
inc_preempt_count();
if (page < highmem_start_page)
return page_address(page);
......@@ -69,6 +70,7 @@ void kunmap_atomic(void *kvaddr, enum km_type type)
if (vaddr < fix_kmap_begin) { // FIXME
dec_preempt_count();
preempt_check_resched();
return;
}
......@@ -96,4 +98,5 @@ void kunmap_atomic(void *kvaddr, enum km_type type)
#endif
#endif
dec_preempt_count();
preempt_check_resched();
}
......@@ -314,7 +314,7 @@ config SOFTWARE_SUSPEND
This option is close to getting stable. However there is still some
absence of features.
For more information take a look at Documentation/swsusp.txt.
For more information take a look at Documentation/power/swsusp.txt.
source "drivers/acpi/Kconfig"
......
......@@ -415,18 +415,22 @@ struct firmware_work {
void (*cont)(const struct firmware *fw, void *context);
};
static void
static int
request_firmware_work_func(void *arg)
{
struct firmware_work *fw_work = arg;
const struct firmware *fw;
if (!arg)
return;
if (!arg) {
WARN_ON(1);
return 0;
}
daemonize("%s/%s", "firmware", fw_work->name);
request_firmware(&fw, fw_work->name, fw_work->device);
fw_work->cont(fw, fw_work->context);
release_firmware(fw);
module_put(fw_work->module);
kfree(fw_work);
return 0;
}
/**
......@@ -451,6 +455,8 @@ request_firmware_nowait(
{
struct firmware_work *fw_work = kmalloc(sizeof (struct firmware_work),
GFP_ATOMIC);
int ret;
if (!fw_work)
return -ENOMEM;
if (!try_module_get(module)) {
......@@ -465,9 +471,14 @@ request_firmware_nowait(
.context = context,
.cont = cont,
};
INIT_WORK(&fw_work->work, request_firmware_work_func, fw_work);
schedule_work(&fw_work->work);
ret = kernel_thread(request_firmware_work_func, fw_work,
CLONE_FS | CLONE_FILES);
if (ret < 0) {
fw_work->cont(NULL, fw_work->context);
return ret;
}
return 0;
}
......
......@@ -2563,7 +2563,7 @@ static void copy_buffer(int ssize, int max_sector, int max_sector_2)
current_count_sectors);
if (CT(COMMAND) == FD_READ)
printk("read\n");
if (CT(COMMAND) == FD_READ)
if (CT(COMMAND) == FD_WRITE)
printk("write\n");
break;
}
......@@ -2894,7 +2894,7 @@ static int make_raw_rw_request(void)
current_count_sectors);
if (CT(COMMAND) == FD_READ)
printk("read\n");
if (CT(COMMAND) == FD_READ)
if (CT(COMMAND) == FD_WRITE)
printk("write\n");
return 0;
}
......
......@@ -2594,7 +2594,7 @@ static void copy_buffer(int ssize, int max_sector, int max_sector_2)
current_count_sectors);
if (CT(COMMAND) == FD_READ)
printk("read\n");
if (CT(COMMAND) == FD_READ)
if (CT(COMMAND) == FD_WRITE)
printk("write\n");
break;
}
......@@ -2925,7 +2925,7 @@ static int make_raw_rw_request(void)
current_count_sectors);
if (CT(COMMAND) == FD_READ)
printk("read\n");
if (CT(COMMAND) == FD_READ)
if (CT(COMMAND) == FD_WRITE)
printk("write\n");
return 0;
}
......
......@@ -67,6 +67,7 @@
#include <asm/uaccess.h>
#include <linux/ppdev.h>
#include <linux/smp_lock.h>
#include <linux/device.h>
#define PP_VERSION "ppdev: user-space parallel port driver"
#define CHRDEV "ppdev"
......@@ -782,4 +783,4 @@ module_init(ppdev_init);
module_exit(ppdev_cleanup);
MODULE_LICENSE("GPL");
MODULE_ALIAS_CHARDEV_MAJOR(PP_MAJOR);
......@@ -509,13 +509,13 @@ static int sx_busy_wait_eq (struct sx_board *board,
func_enter ();
for (i=0; i < TIMEOUT_1 > 0;i++)
for (i=0; i < TIMEOUT_1 ;i++)
if ((read_sx_byte (board, offset) & mask) == correctval) {
func_exit ();
return 1;
}
for (i=0; i < TIMEOUT_2 > 0;i++) {
for (i=0; i < TIMEOUT_2 ;i++) {
if ((read_sx_byte (board, offset) & mask) == correctval) {
func_exit ();
return 1;
......@@ -535,13 +535,13 @@ static int sx_busy_wait_neq (struct sx_board *board,
func_enter ();
for (i=0; i < TIMEOUT_1 > 0;i++)
for (i=0; i < TIMEOUT_1 ;i++)
if ((read_sx_byte (board, offset) & mask) != badval) {
func_exit ();
return 1;
}
for (i=0; i < TIMEOUT_2 > 0;i++) {
for (i=0; i < TIMEOUT_2 ;i++) {
if ((read_sx_byte (board, offset) & mask) != badval) {
func_exit ();
return 1;
......
......@@ -19,6 +19,22 @@ config GAMEPORT
To compile this driver as a module, choose M here: the
module will be called gameport.
# Yes, SOUND_GAMEPORT looks a bit odd. Yes, it ends up being turned on
# in every .config. Please don't touch it. It is here to handle an
# unusual dependency between GAMEPORT and sound drivers.
#
# Some sound drivers call gameport functions. If GAMEPORT is
# not selected, empty stubs are provided for the functions and all is
# well.
# If GAMEPORT is built in, everything is fine.
# If GAMEPORT is a module, however, it would need to be loaded for the
# sound driver to be able to link properly. Therefore, the sound
# driver must be a module as well in that case. Since there's no way
# to express that directly in Kconfig, we use SOUND_GAMEPORT to
# express it. SOUND_GAMEPORT boils down to "if GAMEPORT is 'm',
# anything that depends on SOUND_GAMEPORT must be 'm' as well. if
# GAMEPORT is 'y' or 'n', it can be anything".
config SOUND_GAMEPORT
tristate
default y if GAMEPORT!=m
......
......@@ -31,7 +31,7 @@ module_param(psmouse_noext, int, 0);
MODULE_PARM_DESC(psmouse_noext, "[DEPRECATED] Disable any protocol extensions. Useful for KVM switches.");
static char *psmouse_proto;
static unsigned int psmouse_max_proto = -1UL;
static unsigned int psmouse_max_proto = -1U;
module_param(psmouse_proto, charp, 0);
MODULE_PARM_DESC(psmouse_proto, "Highest protocol extension to probe (bare, imps, exps). Useful for KVM switches.");
......
......@@ -29,6 +29,7 @@
#include <linux/init.h>
#ifdef CONFIG_MCA
#include <linux/mca.h>
#include <linux/mca-legacy.h>
#endif /* CONFIG_MCA */
#include "eicon.h"
......
......@@ -56,7 +56,8 @@ static void r1bio_pool_free(void *r1_bio, void *data)
kfree(r1_bio);
}
#define RESYNC_BLOCK_SIZE (64*1024)
//#define RESYNC_BLOCK_SIZE (64*1024)
#define RESYNC_BLOCK_SIZE PAGE_SIZE
#define RESYNC_SECTORS (RESYNC_BLOCK_SIZE >> 9)
#define RESYNC_PAGES ((RESYNC_BLOCK_SIZE + PAGE_SIZE-1) / PAGE_SIZE)
#define RESYNC_WINDOW (2048*1024)
......
......@@ -44,11 +44,66 @@ static void dump_registers(struct saa7146_dev* dev)
}
#endif
/****************************************************************************
* gpio and debi helper functions
****************************************************************************/
/* write "data" to the gpio-pin "pin" */
void saa7146_set_gpio(struct saa7146_dev *dev, u8 pin, u8 data)
{
u32 value = 0;
/* sanity check */
if(pin > 3)
return;
/* read old register contents */
value = saa7146_read(dev, GPIO_CTRL );
value &= ~(0xff << (8*pin));
value |= (data << (8*pin));
saa7146_write(dev, GPIO_CTRL, value);
}
/* This DEBI code is based on the saa7146 Stradis driver by Nathan Laredo */
int saa7146_wait_for_debi_done(struct saa7146_dev *dev)
{
int start;
/* wait for registers to be programmed */
start = jiffies;
while (1) {
if (saa7146_read(dev, MC2) & 2)
break;
if (jiffies-start > HZ/20) {
DEB_S(("timed out while waiting for registers getting programmed\n"));
return -ETIMEDOUT;
}
}
/* wait for transfer to complete */
start = jiffies;
while (1) {
if (!(saa7146_read(dev, PSR) & SPCI_DEBI_S))
break;
saa7146_read(dev, MC2);
if (jiffies-start > HZ/4) {
DEB_S(("timed out while waiting for transfer completion\n"));
return -ETIMEDOUT;
}
}
return 0;
}
/****************************************************************************
* general helper functions
****************************************************************************/
/* this is videobuf_vmalloc_to_sg() from video-buf.c */
/* this is videobuf_vmalloc_to_sg() from video-buf.c
make sure virt has been allocated with vmalloc_32(), otherwise the BUG()
may be triggered on highmem machines */
static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages)
{
struct scatterlist *sglist;
......@@ -84,7 +139,7 @@ char *saa7146_vmalloc_build_pgtable(struct pci_dev *pci, long length, struct saa
{
struct scatterlist *slist = NULL;
int pages = (length+PAGE_SIZE-1)/PAGE_SIZE;
char *mem = vmalloc(length);
char *mem = vmalloc_32(length);
int slen = 0;
if (NULL == mem) {
......@@ -103,7 +158,9 @@ char *saa7146_vmalloc_build_pgtable(struct pci_dev *pci, long length, struct saa
}
slen = pci_map_sg(pci,slist,pages,PCI_DMA_FROMDEVICE);
saa7146_pgtable_build_single(pci, pt, slist, slen);
if (0 != saa7146_pgtable_build_single(pci, pt, slist, slen)) {
return NULL;
}
/* fixme: here's a memory leak: slist never gets freed by any other
function ...*/
......@@ -139,7 +196,7 @@ int saa7146_pgtable_alloc(struct pci_dev *pci, struct saa7146_pgtable *pt)
return 0;
}
void saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *pt,
int saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *pt,
struct scatterlist *list, int sglen )
{
u32 *ptr, fill;
......@@ -148,6 +205,11 @@ void saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *p
BUG_ON( 0 == sglen);
if (list->offset > PAGE_SIZE) {
DEB_D(("offset > PAGE_SIZE. this should not happen."));
return -EINVAL;
}
/* if we have a user buffer, the first page may not be
aligned to a page boundary. */
pt->offset = list->offset;
......@@ -177,6 +239,7 @@ void saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *p
printk("ptr1 %d: 0x%08x\n",i,ptr[i]);
}
*/
return 0;
}
/********************************************************************************/
......@@ -322,7 +385,7 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent
saa7146_write(dev, MC1, MASK_31);
*/
/* disable alle irqs */
/* disable all irqs */
saa7146_write(dev, IER, 0);
/* shut down all dma transfers */
......@@ -381,8 +444,8 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent
dev->module = THIS_MODULE;
init_waitqueue_head(&dev->i2c_wq);
/* set some default values */
saa7146_write(dev, BCS_CTRL, 0x80400040);
/* set some sane pci arbitrition values */
saa7146_write(dev, PCI_BT_V1, 0x1c00101f);
if( 0 != ext->probe) {
if( 0 != ext->probe(dev) ) {
......@@ -508,6 +571,7 @@ EXPORT_SYMBOL_GPL(saa7146_pgtable_alloc);
EXPORT_SYMBOL_GPL(saa7146_pgtable_free);
EXPORT_SYMBOL_GPL(saa7146_pgtable_build_single);
EXPORT_SYMBOL_GPL(saa7146_vmalloc_build_pgtable);
EXPORT_SYMBOL_GPL(saa7146_wait_for_debi_done);
EXPORT_SYMBOL_GPL(saa7146_setgpio);
......
......@@ -86,7 +86,7 @@ void saa7146_buffer_next(struct saa7146_dev *dev,
return;
}
DEB_EE(("dev:%p, dmaq:%p, vbi:%d\n", dev, q, vbi));
DEB_INT(("dev:%p, dmaq:%p, vbi:%d\n", dev, q, vbi));
#if DEBUG_SPINLOCKS
BUG_ON(!spin_is_locked(&dev->slock));
......@@ -98,10 +98,10 @@ void saa7146_buffer_next(struct saa7146_dev *dev,
if (!list_empty(&q->queue))
next = list_entry(q->queue.next,struct saa7146_buf, vb.queue);
q->curr = buf;
DEB_D(("next buffer: buf:%p, prev:%p, next:%p\n", buf, q->queue.prev,q->queue.next));
DEB_INT(("next buffer: buf:%p, prev:%p, next:%p\n", buf, q->queue.prev,q->queue.next));
buf->activate(dev,buf,next);
} else {
DEB_D(("no next buffer. stopping.\n"));
DEB_INT(("no next buffer. stopping.\n"));
if( 0 != vbi ) {
/* turn off video-dma3 */
saa7146_write(dev,MC1, MASK_20);
......@@ -229,10 +229,10 @@ static int fops_open(struct inode *inode, struct file *file)
if( fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) {
DEB_S(("initializing vbi...\n"));
saa7146_vbi_uops.open(dev,fh);
saa7146_vbi_uops.open(dev,file);
} else {
DEB_S(("initializing video...\n"));
saa7146_video_uops.open(dev,fh);
saa7146_video_uops.open(dev,file);
}
result = 0;
......@@ -255,9 +255,9 @@ static int fops_release(struct inode *inode, struct file *file)
return -ERESTARTSYS;
if( fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) {
saa7146_vbi_uops.release(dev,fh,file);
saa7146_vbi_uops.release(dev,file);
} else {
saa7146_video_uops.release(dev,fh,file);
saa7146_video_uops.release(dev,file);
}
module_put(dev->ext->module);
......@@ -372,7 +372,7 @@ void vv_callback(struct saa7146_dev *dev, unsigned long status)
{
u32 isr = status;
DEB_EE(("dev:%p, isr:0x%08x\n",dev,(u32)status));
DEB_INT(("dev:%p, isr:0x%08x\n",dev,(u32)status));
if (0 != (isr & (MASK_27))) {
DEB_INT(("irq: RPS0 (0x%08x).\n",isr));
......@@ -410,6 +410,12 @@ int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv)
DEB_EE(("dev:%p\n",dev));
/* set default values for video parts of the saa7146 */
saa7146_write(dev, BCS_CTRL, 0x80400040);
/* enable video-port pins */
saa7146_write(dev, MC1, (MASK_10 | MASK_26));
/* save per-device extension data (one extension can
handle different devices that might need different
configuration data) */
......
......@@ -660,24 +660,6 @@ void saa7146_set_hps_source_and_sync(struct saa7146_dev *dev, int source, int sy
vv->current_hps_sync = sync;
}
/* write "data" to the gpio-pin "pin" */
void saa7146_set_gpio(struct saa7146_dev *dev, u8 pin, u8 data)
{
u32 value = 0;
/* sanity check */
if(pin > 3)
return;
/* read old register contents */
value = saa7146_read(dev, GPIO_CTRL );
value &= ~(0xff << (8*pin));
value |= (data << (8*pin));
saa7146_write(dev, GPIO_CTRL, value);
}
/* reprogram hps, enable(1) / disable(0) video */
void saa7146_set_overlay(struct saa7146_dev *dev, struct saa7146_fh *fh, int v)
{
......@@ -710,13 +692,15 @@ void saa7146_write_out_dma(struct saa7146_dev* dev, int which, struct saa7146_vi
/* calculate starting address */
where = (which-1)*0x18;
/*
if( 0 != (dev->ext_vv_data->flags & SAA7146_EXT_SWAP_ODD_EVEN)) {
saa7146_write(dev, where, vdma->base_even);
saa7146_write(dev, where+0x04, vdma->base_odd);
} else {
*/
saa7146_write(dev, where, vdma->base_odd);
saa7146_write(dev, where+0x04, vdma->base_even);
}
// }
saa7146_write(dev, where+0x08, vdma->prot_addr);
saa7146_write(dev, where+0x0c, vdma->pitch);
saa7146_write(dev, where+0x10, vdma->base_page);
......@@ -971,12 +955,13 @@ static void program_capture_engine(struct saa7146_dev *dev, int planar)
unsigned long e_wait = vv->current_hps_sync == SAA7146_HPS_SYNC_PORT_A ? CMD_E_FID_A : CMD_E_FID_B;
unsigned long o_wait = vv->current_hps_sync == SAA7146_HPS_SYNC_PORT_A ? CMD_O_FID_A : CMD_O_FID_B;
/*
if( 0 != (dev->ext_vv_data->flags & SAA7146_EXT_SWAP_ODD_EVEN)) {
unsigned long tmp = e_wait;
e_wait = o_wait;
o_wait = tmp;
}
*/
/* wait for o_fid_a/b / e_fid_a/b toggle only if rps register 0 is not set*/
WRITE_RPS0(CMD_PAUSE | CMD_OAN | CMD_SIG0 | o_wait);
WRITE_RPS0(CMD_PAUSE | CMD_OAN | CMD_SIG0 | e_wait);
......
......@@ -301,7 +301,8 @@ int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg msgs[], i
goto out;
}
if (count > 3) short_delay = 1;
if ( count > 3 || 0 != (SAA7146_I2C_SHORT_DELAY & dev->ext->flags) )
short_delay = 1;
do {
/* reset the i2c-device if necessary */
......@@ -403,19 +404,29 @@ int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c
{
DEB_EE(("bitrate: 0x%08x\n",bitrate));
/* enable i2c-port pins */
saa7146_write(dev, MC1, (MASK_08 | MASK_24));
dev->i2c_bitrate = bitrate;
saa7146_i2c_reset(dev);
if( NULL != i2c_adapter ) {
memset(i2c_adapter,0,sizeof(struct i2c_adapter));
strcpy(i2c_adapter->name, dev->name);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
i2c_adapter->data = dev;
#else
i2c_set_adapdata(i2c_adapter,dev);
i2c_adapter->class = I2C_ADAP_CLASS_TV_ANALOG;
#endif
i2c_adapter->algo = &saa7146_algo;
i2c_adapter->algo_data = NULL;
i2c_adapter->id = I2C_ALGO_SAA7146;
i2c_adapter->timeout = SAA7146_I2C_TIMEOUT;
i2c_adapter->retries = SAA7146_I2C_RETRIES;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
#else
i2c_adapter->class = I2C_ADAP_CLASS_TV_ANALOG;
#endif
}
return 0;
......
......@@ -41,7 +41,11 @@ static int vbi_workaround(struct saa7146_dev *dev)
/* wait for vbi_a or vbi_b*/
if ( 0 != (SAA7146_USE_PORT_B_FOR_VBI & dev->ext_vv_data->flags)) {
DEB_D(("...using port b\n"));
WRITE_RPS1(CMD_PAUSE | CMD_OAN | CMD_SIG1 | CMD_E_FID_B);
WRITE_RPS1(CMD_PAUSE | CMD_OAN | CMD_SIG1 | CMD_O_FID_B);
/*
WRITE_RPS1(CMD_PAUSE | MASK_09);
*/
} else {
DEB_D(("...using port a\n"));
WRITE_RPS1(CMD_PAUSE | MASK_10);
......@@ -137,10 +141,10 @@ void saa7146_set_vbi_capture(struct saa7146_dev *dev, struct saa7146_buf *buf, s
unsigned long o_wait = vv->current_hps_sync == SAA7146_HPS_SYNC_PORT_A ? CMD_O_FID_A : CMD_O_FID_B;
/*
vdma3.base_even = (u32)dev->ov_fb.base+2048*70;
vdma3.base_odd = (u32)dev->ov_fb.base;
vdma3.prot_addr = (u32)dev->ov_fb.base+2048*164;
vdma3.pitch = 2048;
vdma3.base_even = 0xc8000000+2560*70;
vdma3.base_odd = 0xc8000000;
vdma3.prot_addr = 0xc8000000+2560*164;
vdma3.pitch = 2560;
vdma3.base_page = 0;
vdma3.num_line_byte = (64<<16)|((vbi_pixel_to_capture)<<0); // set above!
*/
......@@ -244,7 +248,9 @@ static int buffer_prepare(struct file *file, struct videobuf_buffer *vb,enum v4l
err = videobuf_iolock(dev->pci,&buf->vb,NULL);
if (err)
goto oops;
saa7146_pgtable_build_single(dev->pci, &buf->pt[2], buf->vb.dma.sglist, buf->vb.dma.sglen);
err = saa7146_pgtable_build_single(dev->pci, &buf->pt[2], buf->vb.dma.sglist, buf->vb.dma.sglen);
if (0 != err)
return err;
}
buf->vb.state = STATE_PREPARED;
buf->activate = buffer_activate;
......@@ -303,7 +309,7 @@ static struct videobuf_queue_ops vbi_qops = {
/* ------------------------------------------------------------------ */
static void vbi_stop(struct saa7146_fh *fh)
static void vbi_stop(struct saa7146_fh *fh, struct file *file)
{
struct saa7146_dev *dev = fh->dev;
struct saa7146_vv *vv = dev->vv_data;
......@@ -321,23 +327,29 @@ static void vbi_stop(struct saa7146_fh *fh)
/* shut down dma 3 transfers */
saa7146_write(dev, MC1, MASK_20);
if (vv->vbi_q.curr) {
saa7146_buffer_finish(dev,&vv->vbi_q,STATE_DONE);
}
videobuf_queue_cancel(file,&fh->vbi_q);
vv->vbi_streaming = NULL;
del_timer(&vv->vbi_q.timeout);
del_timer(&fh->vbi_read_timeout);
DEB_VBI(("out\n"));
spin_unlock_irqrestore(&dev->slock, flags);
}
static void vbi_read_timeout(unsigned long data)
{
struct saa7146_fh *fh = (struct saa7146_fh *)data;
struct file *file = (struct file*)data;
struct saa7146_fh *fh = file->private_data;
struct saa7146_dev *dev = fh->dev;
DEB_VBI(("dev:%p, fh:%p\n",dev, fh));
vbi_stop(fh);
vbi_stop(fh, file);
}
static void vbi_init(struct saa7146_dev *dev, struct saa7146_vv *vv)
......@@ -354,10 +366,21 @@ static void vbi_init(struct saa7146_dev *dev, struct saa7146_vv *vv)
init_waitqueue_head(&vv->vbi_wq);
}
static void vbi_open(struct saa7146_dev *dev, struct saa7146_fh *fh)
static void vbi_open(struct saa7146_dev *dev, struct file *file)
{
struct saa7146_fh *fh = (struct saa7146_fh *)file->private_data;
u32 arbtr_ctrl = saa7146_read(dev, PCI_BT_V1);
int ret = 0;
DEB_VBI(("dev:%p, fh:%p\n",dev,fh));
/* adjust arbitrition control for video dma 3 */
arbtr_ctrl &= ~0x1f0000;
arbtr_ctrl |= 0x1d0000;
saa7146_write(dev, PCI_BT_V1, arbtr_ctrl);
saa7146_write(dev, MC2, (MASK_04|MASK_20));
memset(&fh->vbi_fmt,0,sizeof(fh->vbi_fmt));
fh->vbi_fmt.sampling_rate = 27000000;
......@@ -380,21 +403,32 @@ static void vbi_open(struct saa7146_dev *dev, struct saa7146_fh *fh)
init_timer(&fh->vbi_read_timeout);
fh->vbi_read_timeout.function = vbi_read_timeout;
fh->vbi_read_timeout.data = (unsigned long)fh;
fh->vbi_read_timeout.data = (unsigned long)file;
/* fixme: enable this again, if the dvb-c w/ analog module work properly */
/*
vbi_workaround(dev);
*/
/* initialize the brs */
if ( 0 != (SAA7146_USE_PORT_B_FOR_VBI & dev->ext_vv_data->flags)) {
saa7146_write(dev, BRS_CTRL, MASK_30|MASK_29 | (7 << 19));
} else {
saa7146_write(dev, BRS_CTRL, 0x00000001);
if (0 != (ret = vbi_workaround(dev))) {
DEB_VBI(("vbi workaround failed!\n"));
/* return ret;*/
}
}
/* upload brs register */
saa7146_write(dev, MC2, (MASK_08|MASK_24));
}
static void vbi_close(struct saa7146_dev *dev, struct saa7146_fh *fh, struct file *file)
static void vbi_close(struct saa7146_dev *dev, struct file *file)
{
struct saa7146_fh *fh = (struct saa7146_fh *)file->private_data;
struct saa7146_vv *vv = dev->vv_data;
DEB_VBI(("dev:%p, fh:%p\n",dev,fh));
if( fh == vv->vbi_streaming ) {
vbi_stop(fh);
vbi_stop(fh, file);
}
}
......
......@@ -116,7 +116,7 @@ static int try_win(struct saa7146_dev *dev, struct v4l2_window *win)
DEB_D(("no fb fmt set.\n"));
return -EINVAL;
}
if (win->w.width < 64 || win->w.height < 64) {
if (win->w.width < 48 || win->w.height < 32) {
DEB_D(("min width/height. (%d,%d)\n",win->w.width,win->w.height));
return -EINVAL;
}
......@@ -661,7 +661,7 @@ static int saa7146_pgtable_build(struct saa7146_dev *dev, struct saa7146_buf *bu
*/
} else {
struct saa7146_pgtable *pt = &buf->pt[0];
saa7146_pgtable_build_single(pci, pt, list, length);
return saa7146_pgtable_build_single(pci, pt, list, length);
}
return 0;
......@@ -704,7 +704,7 @@ static int video_begin(struct saa7146_fh *fh)
return 0;
}
static int video_end(struct saa7146_fh *fh)
static int video_end(struct saa7146_fh *fh, struct file *file)
{
struct saa7146_dev *dev = fh->dev;
struct saa7146_vv *vv = dev->vv_data;
......@@ -735,82 +735,9 @@ static int video_end(struct saa7146_fh *fh)
saa7146_write(dev, MC1, 0x00700000);
vv->streaming = NULL;
spin_unlock_irqrestore(&dev->slock, flags);
return 0;
}
/* capturing to framebuffer */
int overlay_reqbufs(struct saa7146_dev *dev, struct v4l2_requestbuffers *req)
{
/* struct saa7146_fh *fh = file->private_data;
if (req->count > VIDEO_MAX_FRAME)
req->count = VIDEO_MAX_FRAME;
*size = fh->video_fmt.sizeimage;
*/
return 0;
}
int overlay_querybuf(struct saa7146_dev *dev, struct v4l2_buffer *buf)
{
return 0;
}
int overlay_qbuf(struct saa7146_dev *dev, struct v4l2_buffer *b)
{
/* if (b->index < 0 || b->index >= VIDEO_MAX_FRAME) {
DEB_D(("index %d out of bounds.\n",b->index));
goto -EINVAL;
}
buf = q->bufs[b->index];
if (NULL == buf) {
printk("videobuf_qbuf: NULL == buf\n");
goto done;
}
if (0 == buf->baddr) {
printk("videobuf_qbuf: 0 == buf->baddr\n");
goto done;
}
if (buf->state == STATE_QUEUED ||
buf->state == STATE_ACTIVE) {
printk("videobuf_qbuf: already queued or activated.\n");
goto done;
}
field = videobuf_next_field(q);
retval = q->ops->buf_prepare(file,buf,field);
if (0 != retval) {
printk("videobuf_qbuf: buf_prepare() failed.\n");
goto done;
}
list_add_tail(&buf->stream,&q->stream);
if (q->streaming) {
spin_lock_irqsave(q->irqlock,flags);
q->ops->buf_queue(file,buf);
spin_unlock_irqrestore(q->irqlock,flags);
}
retval = 0;
spin_unlock_irqrestore(&dev->slock, flags);
done:
up(&q->lock);
return retval;
*/
return 0;
}
int overlay_dqbuf(struct saa7146_dev *dev, struct v4l2_buffer *buf)
{
return 0;
}
int overlay_streamon(struct saa7146_dev *dev)
{
return 0;
}
int overlay_streamoff(struct saa7146_dev *dev)
{
return 0;
}
......@@ -818,7 +745,7 @@ int overlay_streamoff(struct saa7146_dev *dev)
/*
* This function is _not_ called directly, but from
* video_generic_ioctl (and maybe others). userspace
* copying is done already, arg is a kernel fhinter.
* copying is done already, arg is a kernel pointer.
*/
int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int cmd, void *arg)
......@@ -1141,38 +1068,24 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
case VIDIOC_REQBUFS: {
struct v4l2_requestbuffers *req = arg;
DEB_D(("VIDIOC_REQBUFS, type:%d\n",req->type));
/*
if( req->type == V4L2_BUF_TYPE_VIDEO_OVERLAY ) {
return overlay_reqbufs(dev,req);
}
*/
return videobuf_reqbufs(file,q,req);
}
case VIDIOC_QUERYBUF: {
struct v4l2_buffer *buf = arg;
DEB_D(("VIDIOC_QUERYBUF, type:%d, offset:%d\n",buf->type,buf->m.offset));
/* if( buf->type == V4L2_BUF_TYPE_VIDEO_OVERLAY ) {
return overlay_querybuf(dev,buf);
}
*/ return videobuf_querybuf(q,buf);
return videobuf_querybuf(q,buf);
}
case VIDIOC_QBUF: {
struct v4l2_buffer *buf = arg;
int ret = 0;
/* if( buf->type == V4L2_BUF_TYPE_VIDEO_OVERLAY ) {
return overlay_qbuf(dev,buf);
}
*/ ret = videobuf_qbuf(file,q,buf);
ret = videobuf_qbuf(file,q,buf);
DEB_D(("VIDIOC_QBUF: ret:%d, index:%d\n",ret,buf->index));
return ret;
}
case VIDIOC_DQBUF: {
struct v4l2_buffer *buf = arg;
int ret = 0;
/* if( buf->type == V4L2_BUF_TYPE_VIDEO_OVERLAY ) {
return overlay_dqbuf(dev,buf);
}
*/ ret = videobuf_dqbuf(file,q,buf);
ret = videobuf_dqbuf(file,q,buf);
DEB_D(("VIDIOC_DQBUF: ret:%d, index:%d\n",ret,buf->index));
return ret;
}
......@@ -1180,29 +1093,18 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
int *type = arg;
DEB_D(("VIDIOC_STREAMON, type:%d\n",*type));
if( 0 != ops->capture_begin ) {
if( 0 != (err = ops->capture_begin(fh))) {
if( 0 != (err = video_begin(fh))) {
return err;
}
}
/* if( *type == V4L2_BUF_TYPE_VIDEO_OVERLAY ) {
err = overlay_streamon(dev);
} else { */
err = videobuf_streamon(file,q);
/* } */
return err;
}
case VIDIOC_STREAMOFF: {
int *type = arg;
DEB_D(("VIDIOC_STREAMOFF, type:%d\n",*type));
if( 0 != ops->capture_end ) {
ops->capture_end(fh);
}
/* if( *type == V4L2_BUF_TYPE_VIDEO_OVERLAY ) {
return overlay_streamoff(dev);
}
*/ err = videobuf_streamoff(file,q);
err = videobuf_streamoff(file,q);
video_end(fh, file);
return err;
}
case VIDIOCGMBUF:
......@@ -1267,8 +1169,8 @@ static int buffer_prepare(struct file *file, struct videobuf_buffer *vb, enum v4
DEB_CAP(("vbuf:%p\n",vb));
/* sanity checks */
if (fh->video_fmt.width < 64 ||
fh->video_fmt.height < 64 ||
if (fh->video_fmt.width < 48 ||
fh->video_fmt.height < 32 ||
fh->video_fmt.width > vv->standard->h_max_out ||
fh->video_fmt.height > vv->standard->v_max_out) {
DEB_D(("w (%d) / h (%d) out of bounds.\n",fh->video_fmt.width,fh->video_fmt.height));
......@@ -1407,8 +1309,9 @@ static void video_init(struct saa7146_dev *dev, struct saa7146_vv *vv)
}
static void video_open(struct saa7146_dev *dev, struct saa7146_fh *fh)
static void video_open(struct saa7146_dev *dev, struct file *file)
{
struct saa7146_fh *fh = (struct saa7146_fh *)file->private_data;
struct saa7146_format *sfmt;
fh->video_fmt.width = 384;
......@@ -1429,8 +1332,9 @@ static void video_open(struct saa7146_dev *dev, struct saa7146_fh *fh)
}
static void video_close(struct saa7146_dev *dev, struct saa7146_fh *fh, struct file *file)
static void video_close(struct saa7146_dev *dev, struct file *file)
{
struct saa7146_fh *fh = (struct saa7146_fh *)file->private_data;
struct saa7146_vv *vv = dev->vv_data;
unsigned long flags;
......@@ -1443,10 +1347,8 @@ static void video_close(struct saa7146_dev *dev, struct saa7146_fh *fh, struct f
}
if( fh == vv->streaming ) {
video_end(fh);
video_end(fh, file);
}
videobuf_queue_cancel(file,&fh->video_q);
}
......@@ -1489,7 +1391,7 @@ static ssize_t video_read(struct file *file, char *data, size_t count, loff_t *p
return -EAGAIN;
}
ret = videobuf_read_one(file,&fh->video_q , data, count, ppos);
video_end(fh);
video_end(fh, file);
/* restart overlay if it was active before */
if( 0 != restart_overlay ) {
......@@ -1505,6 +1407,4 @@ struct saa7146_use_ops saa7146_video_uops = {
.release = video_close,
.irq_done = video_irq_done,
.read = video_read,
.capture_begin = video_begin,
.capture_end = video_end,
};
......@@ -45,5 +45,9 @@ comment "Supported FlexCopII (B2C2) Adapters"
depends on DVB_CORE && PCI
source "drivers/media/dvb/b2c2/Kconfig"
comment "Supported BT878 Adapters"
depends on DVB_CORE && PCI
source "drivers/media/dvb/bt8xx/Kconfig"
endmenu
......@@ -2,5 +2,5 @@
# Makefile for the kernel multimedia device drivers.
#
obj-y := dvb-core/ frontends/ ttpci/ ttusb-dec/ ttusb-budget/ b2c2/
obj-y := dvb-core/ frontends/ ttpci/ ttusb-dec/ ttusb-budget/ b2c2/ bt8xx/
This diff is collapsed.
config DVB_BT8XX
tristate "Nebula/Pinnacle PCTV PCI cards"
depends on DVB_CORE && PCI && VIDEO_BT848
help
Support for PCI cards based on the Bt8xx PCI bridge. Examples are
the Nebula cards, the Pinnacle PCTV cards, and Twinhan DST cards.
Since these cards have no MPEG decoder onboard, they transmit
only compressed MPEG data over the PCI bus, so you need
an external software decoder to watch TV on your computer.
Say Y if you own such a device and want to use it.
obj-$(CONFIG_DVB_BT8XX) += bt878.o dvb-bt8xx.o
EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/video -Idrivers/media/dvb/frontends
This diff is collapsed.
/*
bt878.h - Bt878 audio module (register offsets)
Copyright (C) 2002 Peter Hettkamp <peter.hettkamp@t-online.de>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef _BT878_H_
#define _BT878_H_
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/sched.h>
#include <linux/spinlock.h>
#include "bt848.h"
#define BT878_VERSION_CODE 0x000000
#define BT878_AINT_STAT 0x100
#define BT878_ARISCS (0xf<<28)
#define BT878_ARISC_EN (1<<27)
#define BT878_ASCERR (1<<19)
#define BT878_AOCERR (1<<18)
#define BT878_APABORT (1<<17)
#define BT878_ARIPERR (1<<16)
#define BT878_APPERR (1<<15)
#define BT878_AFDSR (1<<14)
#define BT878_AFTRGT (1<<13)
#define BT878_AFBUS (1<<12)
#define BT878_ARISCI (1<<11)
#define BT878_AOFLOW (1<<3)
#define BT878_AINT_MASK 0x104
#define BT878_AGPIO_DMA_CTL 0x10c
#define BT878_A_GAIN (0xf<<28)
#define BT878_A_G2X (1<<27)
#define BT878_A_PWRDN (1<<26)
#define BT878_A_SEL (3<<24)
#define BT878_DA_SCE (1<<23)
#define BT878_DA_LRI (1<<22)
#define BT878_DA_MLB (1<<21)
#define BT878_DA_LRD (0x1f<<16)
#define BT878_DA_DPM (1<<15)
#define BT878_DA_SBR (1<<14)
#define BT878_DA_ES2 (1<<13)
#define BT878_DA_LMT (1<<12)
#define BT878_DA_SDR (0xf<<8)
#define BT878_DA_IOM (3<<6)
#define BT878_DA_APP (1<<5)
#define BT878_ACAP_EN (1<<4)
#define BT878_PKTP (3<<2)
#define BT878_RISC_EN (1<<1)
#define BT878_FIFO_EN 1
#define BT878_APACK_LEN 0x110
#define BT878_AFP_LEN (0xff<<16)
#define BT878_ALP_LEN 0xfff
#define BT878_ARISC_START 0x114
#define BT878_ARISC_PC 0x120
/* BT878 FUNCTION 0 REGISTERS */
#define BT878_GPIO_DMA_CTL 0x10c
/* Interrupt register */
#define BT878_INT_STAT 0x100
#define BT878_INT_MASK 0x104
#define BT878_I2CRACK (1<<25)
#define BT878_I2CDONE (1<<8)
#define BT878_MAX 4
#define BT878_RISC_SYNC_MASK (1 << 15)
extern int bt878_num;
extern struct bt878 bt878[BT878_MAX];
struct bt878 {
struct semaphore gpio_lock;
unsigned int nr;
unsigned int bttv_nr;
struct dvb_adapter *adap_ptr;
struct pci_dev *dev;
unsigned int id;
unsigned int TS_Size;
unsigned char revision;
unsigned int irq;
unsigned long bt878_adr;
unsigned char *bt878_mem; /* function 1 */
volatile u32 finished_block;
volatile u32 last_block;
u32 block_count;
u32 block_bytes;
u32 line_bytes;
u32 line_count;
u32 buf_size;
u8 *buf_cpu;
dma_addr_t buf_dma;
u32 risc_size;
u32 *risc_cpu;
dma_addr_t risc_dma;
u32 risc_pos;
struct tasklet_struct tasklet;
int shutdown;
};
void bt878_start(struct bt878 *bt, u32 controlreg, u32 op_sync_orin,
u32 irq_err_ignore);
void bt878_stop(struct bt878 *bt);
#if defined(__powerpc__) /* big-endian */
extern __inline__ void io_st_le32(volatile unsigned *addr, unsigned val)
{
__asm__ __volatile__("stwbrx %1,0,%2":"=m"(*addr):"r"(val),
"r"(addr));
__asm__ __volatile__("eieio":::"memory");
}
#define bmtwrite(dat,adr) io_st_le32((unsigned *)(adr),(dat))
#define bmtread(adr) ld_le32((unsigned *)(adr))
#else
#define bmtwrite(dat,adr) writel((dat), (char *) (adr))
#define bmtread(adr) readl(adr)
#endif
#endif
This diff is collapsed.
/*
* Bt8xx based DVB adapter driver
*
* Copyright (C) 2002,2003 Florian Schirmer <schirmer@taytron.net>
* Copyright (C) 2002 Peter Hettkamp <peter.hettkamp@t-online.de>
* Copyright (C) 1999-2001 Ralph Metzler & Marcus Metzler for convergence integrated media GmbH
* Copyright (C) 1998,1999 Christian Theiss <mistert@rz.fh-augsburg.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#include <linux/i2c.h>
#include "dvbdev.h"
#include "dvb_net.h"
struct dvb_bt8xx_card {
struct list_head list;
u8 active;
char card_name[32];
struct dvb_adapter *dvb_adapter;
struct bt878 *bt;
unsigned int bttv_nr;
struct dvb_demux demux;
struct dmxdev dmxdev;
struct dmx_frontend fe_hw;
struct dmx_frontend fe_mem;
u32 gpio_mode;
u32 op_sync_orin;
u32 irq_err_ignore;
struct i2c_adapter *i2c_adapter;
struct dvb_net dvbnet;
};
......@@ -43,6 +43,15 @@
#define DMX_MAX_FILTER_SIZE 18
#endif
/*
* DMX_MAX_SECFEED_SIZE: Maximum length (in bytes) of a private section feed filter.
*/
#ifndef DMX_MAX_SECFEED_SIZE
#define DMX_MAX_SECFEED_SIZE 4096
#endif
/*
* enum dmx_success: Success codes for the Demux Callback API.
*/
......@@ -143,9 +152,9 @@ struct dmx_section_feed {
int check_crc;
u32 crc_val;
u8 secbuf[4096];
int secbufp;
int seclen;
u8 *secbuf;
u8 secbuf_base[DMX_MAX_SECFEED_SIZE];
u16 secbufp, seclen, tsfeedp;
int (*set) (struct dmx_section_feed* feed,
u16 pid,
......
This diff is collapsed.
......@@ -127,7 +127,7 @@ struct dvb_demux {
#define DMX_MAX_PID 0x2000
struct list_head feed_list;
u8 tsbuf[188];
u8 tsbuf[204];
int tsbufp;
struct semaphore mutex;
......@@ -140,6 +140,7 @@ int dvb_dmx_release(struct dvb_demux *dvbdemux);
void dvb_dmx_swfilter_packet(struct dvb_demux *dvbdmx, const u8 *buf);
void dvb_dmx_swfilter_packets(struct dvb_demux *dvbdmx, const u8 *buf, size_t count);
void dvb_dmx_swfilter(struct dvb_demux *demux, const u8 *buf, size_t count);
void dvb_dmx_swfilter_204(struct dvb_demux *demux, const u8 *buf, size_t count);
int dvbdmx_connect_frontend(struct dmx_demux *demux, struct dmx_frontend *frontend);
int dvbdmx_disconnect_frontend(struct dmx_demux *demux);
......
......@@ -564,14 +564,18 @@ void dvb_filter_pes2ts_init(struct dvb_filter_pes2ts *p2ts, unsigned short pid,
p2ts->priv=priv;
}
int dvb_filter_pes2ts(struct dvb_filter_pes2ts *p2ts, unsigned char *pes, int len)
int dvb_filter_pes2ts(struct dvb_filter_pes2ts *p2ts, unsigned char *pes,
int len, int payload_start)
{
unsigned char *buf=p2ts->buf;
int ret=0, rest;
//len=6+((pes[4]<<8)|pes[5]);
if (payload_start)
buf[1]|=0x40;
else
buf[1]&=~0x40;
while (len>=184) {
buf[3]=0x10|((p2ts->cc++)&0x0f);
memcpy(buf+4, pes, 184);
......
......@@ -37,7 +37,8 @@ struct dvb_filter_pes2ts {
void dvb_filter_pes2ts_init(struct dvb_filter_pes2ts *p2ts, unsigned short pid,
dvb_filter_pes2ts_cb_t *cb, void *priv);
int dvb_filter_pes2ts(struct dvb_filter_pes2ts *p2ts, unsigned char *pes, int len);
int dvb_filter_pes2ts(struct dvb_filter_pes2ts *p2ts, unsigned char *pes,
int len, int payload_start);
#define PROG_STREAM_MAP 0xBC
......
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.
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