* [patch] 30_bttv-doc
From: Gerd Knorr @ 2003-01-08 12:04 UTC (permalink / raw)
To: Linus Torvalds, Kernel List
Hi,
$subject says all: This patch updates the bttv documentation.
Gerd
--- linux-2.5.54/Documentation/video4linux/bttv/CARDLIST 2003-01-08 10:33:57.000000000 +0100
+++ linux/Documentation/video4linux/bttv/CARDLIST 2003-01-08 10:59:58.000000000 +0100
@@ -69,7 +69,7 @@
card=67 - IODATA GV-BCTV4/PCI
card=68 - 3Dfx VoodooTV FM (Euro), VoodooTV 200 (USA)
card=69 - Active Imaging AIMMS
- card=70 - Prolink Pixelview PV-BT878P+ (Rev.4C)
+ card=70 - Prolink Pixelview PV-BT878P+ (Rev.4C,8E)
card=71 - Lifeview FlyVideo 98EZ (capture only) LR51
card=72 - Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)
card=73 - Sensoray 311
--- linux-2.5.54/Documentation/video4linux/bttv/Cards 2003-01-08 10:34:02.000000000 +0100
+++ linux/Documentation/video4linux/bttv/Cards 2003-01-08 10:59:58.000000000 +0100
@@ -4,25 +4,27 @@
Suppported cards:
-
-
Bt848/Bt848a/Bt849/Bt878/Bt879 cards
------------------------------------
-All cards with Bt848/Bt848a/Bt849/Bt878/Bt879 and normal Composite/S-VHS inputs
-are supported.
-Teletext and Intercast support (PAL only) for ALL cards via VBI sample decoding
-in software.
+All cards with Bt848/Bt848a/Bt849/Bt878/Bt879 and normal
+Composite/S-VHS inputs are supported. Teletext and Intercast support
+(PAL only) for ALL cards via VBI sample decoding in software.
+
+Some cards with additional multiplexing of inputs or other additional
+fancy chips are only partially supported (unless specifications by the
+card manufacturer are given). When a card is listed here it isn't
+necessarily fully supported.
-Some cards with additional multiplexing of inputs are only partially
-supported (unless specifications by the card manufacturer are given).
+All other cards only differ by additional components as tuners, sound
+decoders, EEPROMs, teletext decoders ...
-All other cards only differ by additional components as tuners, sound decoders,
-EEPROMs, teletext decoders ...
Unsupported Cards:
------------------
-Cards with Zoran (ZR) or Philips (SAA) or ISA are not supported by this driver.
+
+Cards with Zoran (ZR) or Philips (SAA) or ISA are not supported by
+this driver.
MATRIX Vision
@@ -197,7 +199,7 @@
50686 "TV Tuner" = KNC1 TV Station
50687 "TV Tuner stereo" = KNC1 TV Station pro
50688 "TV Tuner RDS" (black package) = KNC1 TV Station RDS
- 50689 TV SAT DVB-S CARD CI PCI (SAA7146AH)
+ 50689 TV SAT DVB-S CARD CI PCI (SAA7146AH, SU1278?) = "KNC1 TV Station DVB-S"
50692 "TV/FM Tuner" (small PCB)
50694 TV TUNER CARD RDS (PHILIPS CHIPSET SAA7134HL)
50696 TV TUNER STEREO (PHILIPS CHIPSET SAA7134HL, MK3ME Tuner)
@@ -234,10 +236,20 @@
PixelView PowerStudio PAK - (Model: PV-M3600 REV 4E)
PixelView DigitalVCR PAK - (Model: PV-M2400 REV 4C / 8D / 10A )
+ PixelView PlayTV PAK II (TV/FM card + usb camera) PV-M3800
+ PixelView PlayTV XP PV-M4700,PV-M4700(w/FM)
+ PixelView PlayTV DVR PV-M4600 package contents:PixelView PlayTV pro, windvr & videoMail s/w
+
Further Cards:
PV-BT878P+rev.9B (Play TV Pro, opt. w/FM w/NICAM)
PV-BT878P+rev.2F
PV-BT878P Rev.1D (bt878, capture only)
+
+ XCapture PV-CX881P (cx23881)
+ PlayTV HD PV-CX881PL+, PV-CX881PL+(w/FM) (cx23881)
+
+ DTV3000 PV-DTV3000P+ DVB-S CI = Twinhan VP-1030
+ DTV2000 DVB-S = Twinhan VP-1020
Video Conferencing:
PixelView Meeting PAK - (Model: PV-BT878P)
@@ -245,6 +257,9 @@
PixelView Meeting PAK plus - (Model: PV-BT878P+rev 4C/8D/10A)
PixelView Capture - (Model: PV-BT848P)
+ PixelView PlayTV USB pro
+ Model No. PV-NT1004+, PV-NT1004+ (w/FM) = NT1004 USB decoder chip + SAA7113 video decoder chip
+
Dynalink
--------
These are CPH series.
@@ -284,6 +299,8 @@
TV-Station pro (+TV stereo)
TV-Station FM (+Radio)
TV-Station RDS (+RDS)
+ TV Station SAT (analog satellite)
+ TV-Station DVB-S
newer Cards have saa7134, but model name stayed the same?
@@ -296,8 +313,23 @@
3DeMon PV951
MediaForte TV-Vision PV951
Yoko PV951
- )
+ Vivanco Tuner Card PCI Art.-Nr.: 68404
+ ) now named PV-951T
+
+ Surveillance Series
+ PV-141
+ PV-143
+ PV-147
PV-148 (capture only)
+ PV-150
+ PV-151
+
+ TV-FM Tuner Series
+ PV-951TDV (tv tuner + 1394)
+ PV-951T/TF
+ PV-951PT/TF
+ PV-956T/TF Low Profile
+ PV-911
Highscreen
----------
@@ -372,9 +404,9 @@
IXMicro (former: IMS=Integrated Micro Solutions)
-------
- IXTV BT848
+ IXTV BT848 (=TurboTV)
IXTV BT878
- TurboTV (Bt848)
+ IMS TurboTV (Bt848)
Lifetec/Medion/Tevion/Aldi
--------------------------
@@ -386,8 +418,10 @@
Modular Technologies (www.modulartech.com) UK
---------------------------------------------
MM100 PCTV (Bt848)
+ MM201 PCTV (Bt878, Bt832) w/ Quartzsight camera
+ MM202 PCTV (Bt878, Bt832, tda9874)
MM205 PCTV (Bt878)
- MM210 PCTV (Bt878) (Galaxy TV)
+ MM210 PCTV (Bt878) (Galaxy TV, Galaxymedia ?)
Terratec
--------
@@ -399,6 +433,7 @@
Terra TValue Version BT878, "80-CP2830110-0 TTTV4" printed on the PCB,
"CPH011-D83" on back
Terra TValue Version 1.0 "ceb105.PCB" (really identical to Terra TV+ Version 1.0)
+ Terra TValue New Revision "LR102 Rec.C"
Terra Active Radio Upgrade (tea5757h, saa6588t)
LR74 is a newer PCB revision of ceb105 (both incl. connector for Active Radio Upgrade)
@@ -446,7 +481,7 @@
Studio PCTV Pro (Bt878 stereo w/ FM)
Pinnacle PCTV (Bt878, MT2032)
Pinnacle PCTV Pro (Bt878, MT2032)
- Pinncale PCTV Sat
+ Pinncale PCTV Sat (bt878a, HM1821/1221)
M(J)PEG capture and playback:
DC1+ (ISA)
@@ -519,7 +554,7 @@
------
iProTV (Card for iMac Mezzanine slot, Bt848+SCSI)
ProTV (Bt848)
- ProTV II = ProTV Stereo (Bt878)
+ ProTV II = ProTV Stereo (Bt878) ["stereo" means FM stereo, tv is still mono]
ATI
---
@@ -544,7 +579,7 @@
STB
---
- STB bt878 == Gateway 6000704
+ STB Gateway 6000704 (bt878)
STB Gateway 6000699 (bt848)
STB Gateway 6000402 (bt848)
STB TV130 PCI
@@ -558,13 +593,14 @@
------------
TT-SAT PCI (PCB "Sat-PCI Rev.:1.3.1"; zr36125, vpx3225d, stc0056a, Tuner:BSKE6-155A
TT-DVB-Sat
+ revisions 1.1, 1.3, 1.5, 1.6 and 2.1
This card is sold as OEM from:
Siemens DVB-s Card
Hauppauge WinTV DVB-S
Technisat SkyStar 1 DVB
Galaxis DVB Sat
Now this card is called TT-PCline Premium Family
- TT-Budget
+ TT-Budget (saa7146, bsru6-701a)
This card is sold as OEM from:
Hauppauge WinTV Nova
Satelco Standard PCI (DVB-S)
@@ -603,18 +639,71 @@
Galaxis DVB Card C CI
Galaxis DVB Card S
Galaxis DVB Card C
+ Galaxis plug.in S [neuer Name: Galaxis DVB Card S CI
Hauppauge
---------
many many WinTV models ...
- WinTV DVBs = Tehcnotrend Premium
- WinTV NOVA = Technotrend Budget
- WinTV NOVA-CI
- WinTV-Nexus-s
+ WinTV DVBs = Technotrend Premium 1.3
+ WinTV NOVA = Technotrend Budget 1.1 "S-DVB DATA"
+ WinTV NOVA-CI "SDVBACI"
+ WinTV Nova USB (=Technotrend USB 1.0)
+ WinTV-Nexus-s (=Technotrend Premium 2.1 or 2.2)
WinTV PVR
WinTV PVR 250
WinTV PVR 450
+ US models
+ 990 WinTV-PVR-350 (249USD)
+ 980 WinTV-PVR-250 (149USD)
+ 880 WinTV-PVR-PCI (199USD)
+ 881 WinTV-PVR-USB
+ 190 WinTV-GO
+ 191 WinTV-GO-FM
+ 404 WinTV
+ 401 WinTV-radio
+ 495 WinTV-Theater
+ 602 WinTV-USB
+ 621 WinTV-USB-FM
+ 600 USB-Live
+ 698 WinTV-HD
+ 697 WinTV-D
+ 564 WinTV-Nexus-S
+
+ Deutsche Modelle
+ 603 WinTV GO
+ 719 WinTV Primio-FM
+ 718 WinTV PCI-FM
+ 497 WinTV Theater
+ 569 WinTV USB
+ 568 WinTV USB-FM
+ 882 WinTV PVR
+ 981 WinTV PVR 250
+ 891 WinTV-PVR-USB
+ 541 WinTV Nova
+ 488 WinTV Nova-Ci
+ 564 WinTV-Nexus-s
+ 727 WinTV-DVB-c
+ 545 Common Interface
+ 898 WinTV-Nova-USB
+
+ UK models
+ 607 WinTV Go
+ 693,793 WinTV Primio FM
+ 647,747 WinTV PCI FM
+ 498 WinTV Theater
+ 883 WinTV PVR
+ 893 WinTV PVR USB (Duplicate entry)
+ 566 WinTV USB (UK)
+ 573 WinTV USB FM
+ 429 Impact VCB (bt848)
+ 600 USB Libe (Video-In 1x Comp, 1xSVHS)
+ 542 WinTV Nova
+ 717 WinTV DVB-S
+ 909 Nova-t PCI
+ 893 Nova-t USB (Duplicate entry)
+
+
Matrix-Vision
-------------
MATRIX-Vision MV-Delta
@@ -699,7 +788,7 @@
HS-878 Mini PCI Capture Add-on Card
HS-879 Mini PCI 3D Audio and Capture Add-on Card (w/ ES1938 Solo-1)
-Satelco
+Satelco www.citycom-gmbh.de, www.satelco.de
-------
TV-FM =KNC1 saa7134
Standard PCI (DVB-S) = Technotrend Budget
@@ -724,7 +813,8 @@
AITech
------
- AITech WaveWatcher TV-PCI = LR26
+ Wavewatcher TV (ISA)
+ AITech WaveWatcher TV-PCI = can be LR26 (Bt848) or LR50 (BT878)
WaveWatcher TVR-202 TV/FM Radio Card (ISA)
MAXRON
@@ -750,3 +840,42 @@
CyberMail AV Video Email Kit w/ PCI Capture Card (capture only)
CyberMail Xtreme
These are Flyvideo
+
+VCR (http://www.vcrinc.com/)
+---
+ Video Catcher 16
+
+Twinhan
+-------
+ DST Card/DST-IP (bt878, twinhan asic) VP-1020
+ Sold as:
+ KWorld DVBS Satellite TV-Card
+ Powercolor DSTV Satellite Tuner Card
+ Prolink Pixelview DTV2000
+ Provideo PV-911 Digital Satellite TV Tuner Card With Common Interface ?
+ DST-CI Card (DVB Satellite) VP-1030
+ DCT Card (DVB cable)
+
+MSI
+---
+ MSI TV@nywhere Tuner Card (MS-8876) (CX23881/883) Not Bt878 compatible.
+ MS-8401 DVB-S
+
+Focus www.focusinfo.com
+-----
+ InVideo PCI (bt878)
+
+Sdisilk www.sdisilk.com/
+-------
+ SDI Silk 100
+ SDI Silk 200 SDI Input Card
+
+www.euresys.com
+ PICOLO series
+
+PMC/Pace
+www.pacecom.co.uk website closed
+
+Mercury www.kobian.com (UK and FR)
+ LR50
+ LR138RBG-Rx == LR138
--
Weil die späten Diskussionen nicht mal mehr den Rotwein lohnen.
-- Wacholder in "Melanie"
^ permalink raw reply
* [patch] add bt832 module
From: Gerd Knorr @ 2003-01-08 12:03 UTC (permalink / raw)
To: Linus Torvalds, Kernel List
Hi,
This patch adds a driver module for the bt832 chip. It is needed
by the bttv driver to support the Pixelview Digital Camera. The
bt832 is connected using the GPIO pins of the bt878 chip.
Please apply,
Gerd
--- linux-2.5.54/drivers/media/video/bt832.c 2003-01-08 10:59:58.000000000 +0100
+++ linux/drivers/media/video/bt832.c 2003-01-08 10:59:58.000000000 +0100
@@ -0,0 +1,289 @@
+/* Driver for Bt832 CMOS Camera Video Processor
+ i2c-adresses: 0x88 or 0x8a
+
+ The BT832 interfaces to a Quartzsight Digital Camera (352x288, 25 or 30 fps)
+ via a 9 pin connector ( 4-wire SDATA, 2-wire i2c, SCLK, VCC, GND).
+ It outputs an 8-bit 4:2:2 YUV or YCrCb video signal which can be directly
+ connected to bt848/bt878 GPIO pins on this purpose.
+ (see: VLSI Vision Ltd. www.vvl.co.uk for camera datasheets)
+
+ Supported Cards:
+ - Pixelview Rev.4E: 0x8a
+ GPIO 0x400000 toggles Bt832 RESET, and the chip changes to i2c 0x88 !
+
+ (c) Gunther Mayer, 2002
+
+ STATUS:
+ - detect chip and hexdump
+ - reset chip and leave low power mode
+ - detect camera present
+
+ TODO:
+ - make it work (find correct setup for Bt832 and Bt878)
+*/
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/i2c.h>
+#include <linux/types.h>
+#include <linux/videodev.h>
+#include <linux/init.h>
+#include <linux/errno.h>
+#include <linux/slab.h>
+
+#include "id.h"
+#include "audiochip.h"
+#include "bttv.h"
+#include "bt832.h"
+
+MODULE_LICENSE("GPL");
+
+/* Addresses to scan */
+static unsigned short normal_i2c[] = {I2C_CLIENT_END};
+static unsigned short normal_i2c_range[] = {I2C_BT832_ALT1>>1,I2C_BT832_ALT2>>1,I2C_CLIENT_END};
+I2C_CLIENT_INSMOD;
+
+/* ---------------------------------------------------------------------- */
+
+#define dprintk if (debug) printk
+
+static int bt832_detach(struct i2c_client *client);
+
+
+static struct i2c_driver driver;
+static struct i2c_client client_template;
+
+struct bt832 {
+ struct i2c_client client;
+};
+
+int bt832_hexdump(struct i2c_client *i2c_client_s, unsigned char *buf)
+{
+ int i,rc;
+ buf[0]=0x80; // start at register 0 with auto-increment
+ if (1 != (rc = i2c_master_send(i2c_client_s,buf,1)))
+ printk("bt832: i2c i/o error: rc == %d (should be 1)\n",rc);
+
+ for(i=0;i<65;i++)
+ buf[i]=0;
+ if (65 != (rc=i2c_master_recv(i2c_client_s,buf,65)))
+ printk("bt832: i2c i/o error: rc == %d (should be 65)\n",rc);
+
+ // Note: On READ the first byte is the current index
+ // (e.g. 0x80, what we just wrote)
+
+ if(1) {
+ int i;
+ printk("BT832 hexdump:\n");
+ for(i=1;i<65;i++) {
+ if(i!=1) {
+ if(((i-1)%8)==0) printk(" ");
+ if(((i-1)%16)==0) printk("\n");
+ }
+ printk(" %02x",buf[i]);
+ }
+ printk("\n");
+ }
+ return 0;
+}
+
+// Return: 1 (is a bt832), 0 (No bt832 here)
+int bt832_init(struct i2c_client *i2c_client_s)
+{
+ unsigned char *buf;
+ int rc;
+
+ buf=kmalloc(65,GFP_KERNEL);
+ bt832_hexdump(i2c_client_s,buf);
+
+ if(buf[0x40] != 0x31) {
+ printk("bt832: this i2c chip is no bt832 (id=%02x). Detaching.\n",buf[0x40]);
+ kfree(buf);
+ return 0;
+ }
+
+ printk("Write 0 tp VPSTATUS\n");
+ buf[0]=BT832_VP_STATUS; // Reg.52
+ buf[1]= 0x00;
+ if (2 != (rc = i2c_master_send(i2c_client_s,buf,2)))
+ printk("bt832: i2c i/o error VPS: rc == %d (should be 2)\n",rc);
+
+ bt832_hexdump(i2c_client_s,buf);
+
+
+ // Leave low power mode:
+ printk("Bt832: leave low power mode.\n");
+ buf[0]=BT832_CAM_SETUP0; //0x39 57
+ buf[1]=0x08;
+ if (2 != (rc = i2c_master_send(i2c_client_s,buf,2)))
+ printk("bt832: i2c i/o error LLPM: rc == %d (should be 2)\n",rc);
+
+ bt832_hexdump(i2c_client_s,buf);
+
+ printk("Write 0 tp VPSTATUS\n");
+ buf[0]=BT832_VP_STATUS; // Reg.52
+ buf[1]= 0x00;
+ if (2 != (rc = i2c_master_send(i2c_client_s,buf,2)))
+ printk("bt832: i2c i/o error VPS: rc == %d (should be 2)\n",rc);
+
+ bt832_hexdump(i2c_client_s,buf);
+
+
+ // Enable Output
+ printk("Enable Output\n");
+ buf[0]=BT832_VP_CONTROL1; // Reg.40
+ buf[1]= 0x27 & (~0x01); // Default | !skip
+ if (2 != (rc = i2c_master_send(i2c_client_s,buf,2)))
+ printk("bt832: i2c i/o error EO: rc == %d (should be 2)\n",rc);
+
+ bt832_hexdump(i2c_client_s,buf);
+
+#if 0
+ // Full 30/25 Frame rate
+ printk("Full 30/25 Frame rate\n");
+ buf[0]=BT832_VP_CONTROL0; // Reg.39
+ buf[1]= 0x00;
+ if (2 != (rc = i2c_master_send(i2c_client_s,buf,2)))
+ printk("bt832: i2c i/o error FFR: rc == %d (should be 2)\n",rc);
+
+ bt832_hexdump(i2c_client_s,buf);
+#endif
+
+#if 1
+ // for testing (even works when no camera attached)
+ printk("bt832: *** Generate NTSC M Bars *****\n");
+ buf[0]=BT832_VP_TESTCONTROL0; // Reg. 42
+ buf[1]=3; // Generate NTSC System M bars, Generate Frame timing internally
+ if (2 != (rc = i2c_master_send(i2c_client_s,buf,2)))
+ printk("bt832: i2c i/o error MBAR: rc == %d (should be 2)\n",rc);
+#endif
+
+ printk("Bt832: Camera Present: %s\n",
+ (buf[1+BT832_CAM_STATUS] & BT832_56_CAMERA_PRESENT) ? "yes":"no");
+
+ bt832_hexdump(i2c_client_s,buf);
+ kfree(buf);
+ return 1;
+}
+
+
+
+static int bt832_attach(struct i2c_adapter *adap, int addr,
+ unsigned short flags, int kind)
+{
+ struct bt832 *t;
+
+ printk("bt832_attach\n");
+
+ client_template.adapter = adap;
+ client_template.addr = addr;
+
+ printk("bt832: chip found @ 0x%x\n", addr<<1);
+
+ if (NULL == (t = kmalloc(sizeof(*t), GFP_KERNEL)))
+ return -ENOMEM;
+ memset(t,0,sizeof(*t));
+ t->client = client_template;
+ t->client.data = t;
+ i2c_attach_client(&t->client);
+
+ MOD_INC_USE_COUNT;
+ if(! bt832_init(&t->client)) {
+ bt832_detach(&t->client);
+ return -1;
+ }
+
+ return 0;
+}
+
+static int bt832_probe(struct i2c_adapter *adap)
+{
+ int rc;
+
+ printk("bt832_probe\n");
+
+ switch (adap->id) {
+ case I2C_ALGO_BIT | I2C_HW_B_BT848:
+ case I2C_ALGO_BIT | I2C_HW_B_RIVA:
+ case I2C_ALGO_SAA7134:
+ printk("bt832: probing %s i2c adapter [id=0x%x]\n",
+ adap->name,adap->id);
+ rc = i2c_probe(adap, &addr_data, bt832_attach);
+ break;
+ default:
+ printk("bt832: ignoring %s i2c adapter [id=0x%x]\n",
+ adap->name,adap->id);
+ rc = 0;
+ /* nothing */
+ }
+ return rc;
+}
+
+static int bt832_detach(struct i2c_client *client)
+{
+ struct bt832 *t = (struct bt832*)client->data;
+
+ printk("bt832: detach.\n");
+ i2c_detach_client(client);
+ kfree(t);
+ MOD_DEC_USE_COUNT;
+ return 0;
+}
+
+static int
+bt832_command(struct i2c_client *client, unsigned int cmd, void *arg)
+{
+ struct bt832 *t = (struct bt832*)client->data;
+
+ printk("bt832: command %x\n",cmd);
+
+ switch (cmd) {
+ case BT832_HEXDUMP: {
+ unsigned char *buf;
+ buf=kmalloc(65,GFP_KERNEL);
+ bt832_hexdump(&t->client,buf);
+ kfree(buf);
+ }
+ break;
+ case BT832_REATTACH:
+ printk("bt832: re-attach\n");
+ i2c_del_driver(&driver);
+ i2c_add_driver(&driver);
+ break;
+ }
+ return 0;
+}
+
+/* ----------------------------------------------------------------------- */
+
+static struct i2c_driver driver = {
+ .owner = THIS_MODULE,
+ .name = "i2c bt832 driver",
+ .id = -1, /* FIXME */
+ .flags = I2C_DF_NOTIFY,
+ .attach_adapter = bt832_probe,
+ .detach_client = bt832_detach,
+ .command = bt832_command,
+};
+static struct i2c_client client_template =
+{
+ .name = "bt832",
+ .flags = I2C_CLIENT_ALLOW_USE,
+ .driver = &driver,
+};
+
+
+int bt832_init_module(void)
+{
+ i2c_add_driver(&driver);
+ return 0;
+}
+
+static void bt832_cleanup_module(void)
+{
+ i2c_del_driver(&driver);
+}
+
+module_init(bt832_init_module);
+module_exit(bt832_cleanup_module);
+
--- linux-2.5.54/drivers/media/video/bt832.h 2003-01-08 10:59:58.000000000 +0100
+++ linux/drivers/media/video/bt832.h 2003-01-08 10:59:58.000000000 +0100
@@ -0,0 +1,305 @@
+/* Bt832 CMOS Camera Video Processor (VP)
+
+ The Bt832 CMOS Camera Video Processor chip connects a Quartsight CMOS
+ color digital camera directly to video capture devices via an 8-bit,
+ 4:2:2 YUV or YCrCb video interface.
+
+ i2c adresses: 0x88 or 0x8a
+ */
+
+/* The 64 registers: */
+
+// Input Processor
+#define BT832_OFFSET 0
+#define BT832_RCOMP 1
+#define BT832_G1COMP 2
+#define BT832_G2COMP 3
+#define BT832_BCOMP 4
+// Exposures:
+#define BT832_FINEH 5
+#define BT832_FINEL 6
+#define BT832_COARSEH 7
+#define BT832_COARSEL 8
+#define BT832_CAMGAIN 9
+// Main Processor:
+#define BT832_M00 10
+#define BT832_M01 11
+#define BT832_M02 12
+#define BT832_M10 13
+#define BT832_M11 14
+#define BT832_M12 15
+#define BT832_M20 16
+#define BT832_M21 17
+#define BT832_M22 18
+#define BT832_APCOR 19
+#define BT832_GAMCOR 20
+// Level Accumulator Inputs
+#define BT832_VPCONTROL2 21
+#define BT832_ZONECODE0 22
+#define BT832_ZONECODE1 23
+#define BT832_ZONECODE2 24
+#define BT832_ZONECODE3 25
+// Level Accumulator Outputs:
+#define BT832_RACC 26
+#define BT832_GACC 27
+#define BT832_BACC 28
+#define BT832_BLACKACC 29
+#define BT832_EXP_AGC 30
+#define BT832_LACC0 31
+#define BT832_LACC1 32
+#define BT832_LACC2 33
+#define BT832_LACC3 34
+#define BT832_LACC4 35
+#define BT832_LACC5 36
+#define BT832_LACC6 37
+#define BT832_LACC7 38
+// System:
+#define BT832_VP_CONTROL0 39
+#define BT832_VP_CONTROL1 40
+#define BT832_THRESH 41
+#define BT832_VP_TESTCONTROL0 42
+#define BT832_VP_DMCODE 43
+#define BT832_ACB_CONFIG 44
+#define BT832_ACB_GNBASE 45
+#define BT832_ACB_MU 46
+#define BT832_CAM_TEST0 47
+#define BT832_AEC_CONFIG 48
+#define BT832_AEC_TL 49
+#define BT832_AEC_TC 50
+#define BT832_AEC_TH 51
+// Status:
+#define BT832_VP_STATUS 52
+#define BT832_VP_LINECOUNT 53
+#define BT832_CAM_DEVICEL 54 // e.g. 0x19
+#define BT832_CAM_DEVICEH 55 // e.g. 0x40 == 0x194 Mask0, 0x194 = 404 decimal (VVL-404 camera)
+#define BT832_CAM_STATUS 56
+ #define BT832_56_CAMERA_PRESENT 0x20
+//Camera Setups:
+#define BT832_CAM_SETUP0 57
+#define BT832_CAM_SETUP1 58
+#define BT832_CAM_SETUP2 59
+#define BT832_CAM_SETUP3 60
+// System:
+#define BT832_DEFCOR 61
+#define BT832_VP_TESTCONTROL1 62
+#define BT832_DEVICE_ID 63
+# define BT832_DEVICE_ID__31 0x31 // Bt832 has ID 0x31
+
+/* STMicroelectronivcs VV5404 camera module
+ i2c: 0x20: sensor address
+ i2c: 0xa0: eeprom for ccd defect map
+ */
+#define VV5404_device_h 0x00 // 0x19
+#define VV5404_device_l 0x01 // 0x40
+#define VV5404_status0 0x02
+#define VV5404_linecountc 0x03 // current line counter
+#define VV5404_linecountl 0x04
+#define VV5404_setup0 0x10
+#define VV5404_setup1 0x11
+#define VV5404_setup2 0x12
+#define VV5404_setup4 0x14
+#define VV5404_setup5 0x15
+#define VV5404_fine_h 0x20 // fine exposure
+#define VV5404_fine_l 0x21
+#define VV5404_coarse_h 0x22 //coarse exposure
+#define VV5404_coarse_l 0x23
+#define VV5404_gain 0x24 // ADC pre-amp gain setting
+#define VV5404_clk_div 0x25
+#define VV5404_cr 0x76 // control register
+#define VV5404_as0 0x77 // ADC setup register
+
+
+// IOCTL
+#define BT832_HEXDUMP _IOR('b',1,int)
+#define BT832_REATTACH _IOR('b',2,int)
+
+/* from BT8x8VXD/capdrv/dialogs.cpp */
+
+/*
+typedef enum { SVI, Logitech, Rockwell } CAMERA;
+
+static COMBOBOX_ENTRY gwCameraOptions[] =
+{
+ { SVI, "Silicon Vision 512N" },
+ { Logitech, "Logitech VideoMan 1.3" },
+ { Rockwell, "Rockwell QuartzSight PCI 1.0" }
+};
+
+// SRAM table values
+//===========================================================================
+typedef enum { TGB_NTSC624, TGB_NTSC780, TGB_NTSC858, TGB_NTSC392 } TimeGenByte;
+
+BYTE SRAMTable[][ 60 ] =
+{
+ // TGB_NTSC624
+ {
+ 0x33, // size of table = 51
+ 0x0E, 0xC0, 0x00, 0x00, 0x90, 0x02, 0x03, 0x10, 0x03, 0x06,
+ 0x10, 0x04, 0x12, 0x12, 0x05, 0x02, 0x13, 0x04, 0x19, 0x00,
+ 0x04, 0x39, 0x00, 0x06, 0x59, 0x08, 0x03, 0x85, 0x08, 0x07,
+ 0x03, 0x50, 0x00, 0x91, 0x40, 0x00, 0x11, 0x01, 0x01, 0x4D,
+ 0x0D, 0x02, 0x03, 0x11, 0x01, 0x05, 0x37, 0x00, 0x37, 0x21, 0x00
+ },
+ // TGB_NTSC780
+ {
+ 0x33, // size of table = 51
+ 0x0e, 0xc0, 0x00, 0x00, 0x90, 0xe2, 0x03, 0x10, 0x03, 0x06,
+ 0x10, 0x34, 0x12, 0x12, 0x65, 0x02, 0x13, 0x24, 0x19, 0x00,
+ 0x24, 0x39, 0x00, 0x96, 0x59, 0x08, 0x93, 0x85, 0x08, 0x97,
+ 0x03, 0x50, 0x50, 0xaf, 0x40, 0x30, 0x5f, 0x01, 0xf1, 0x7f,
+ 0x0d, 0xf2, 0x03, 0x11, 0xf1, 0x05, 0x37, 0x30, 0x85, 0x21, 0x50
+ },
+ // TGB_NTSC858
+ {
+ 0x33, // size of table = 51
+ 0x0c, 0xc0, 0x00, 0x00, 0x90, 0xc2, 0x03, 0x10, 0x03, 0x06,
+ 0x10, 0x34, 0x12, 0x12, 0x65, 0x02, 0x13, 0x24, 0x19, 0x00,
+ 0x24, 0x39, 0x00, 0x96, 0x59, 0x08, 0x93, 0x83, 0x08, 0x97,
+ 0x03, 0x50, 0x30, 0xc0, 0x40, 0x30, 0x86, 0x01, 0x01, 0xa6,
+ 0x0d, 0x62, 0x03, 0x11, 0x61, 0x05, 0x37, 0x30, 0xac, 0x21, 0x50
+ },
+ // TGB_NTSC392
+ // This table has been modified to be used for Fusion Rev D
+ {
+ 0x2A, // size of table = 42
+ 0x06, 0x08, 0x04, 0x0a, 0xc0, 0x00, 0x18, 0x08, 0x03, 0x24,
+ 0x08, 0x07, 0x02, 0x90, 0x02, 0x08, 0x10, 0x04, 0x0c, 0x10,
+ 0x05, 0x2c, 0x11, 0x04, 0x55, 0x48, 0x00, 0x05, 0x50, 0x00,
+ 0xbf, 0x0c, 0x02, 0x2f, 0x3d, 0x00, 0x2f, 0x3f, 0x00, 0xc3,
+ 0x20, 0x00
+ }
+};
+
+//===========================================================================
+// This is the structure of the camera specifications
+//===========================================================================
+typedef struct tag_cameraSpec
+{
+ SignalFormat signal; // which digital signal format the camera has
+ VideoFormat vidFormat; // video standard
+ SyncVideoRef syncRef; // which sync video reference is used
+ State syncOutput; // enable sync output for sync video input?
+ DecInputClk iClk; // which input clock is used
+ TimeGenByte tgb; // which timing generator byte does the camera use
+ int HReset; // select 64, 48, 32, or 16 CLKx1 for HReset
+ PLLFreq pllFreq; // what synthesized frequency to set PLL to
+ VSIZEPARMS vSize; // video size the camera produces
+ int lineCount; // expected total number of half-line per frame - 1
+ BOOL interlace; // interlace signal?
+} CameraSpec;
+
+//===========================================================================
+// <UPDATE REQUIRED>
+// Camera specifications database. Update this table whenever camera spec
+// has been changed or added/deleted supported camera models
+//===========================================================================
+static CameraSpec dbCameraSpec[ N_CAMERAOPTIONS ] =
+{ // Silicon Vision 512N
+ { Signal_CCIR656, VFormat_NTSC, VRef_alignedCb, Off, DecClk_GPCLK, TGB_NTSC624, 64, KHz19636,
+ // Clkx1_HACTIVE, Clkx1_HDELAY, VActive, VDelay, linesPerField; lineCount, Interlace
+ { 512, 0x64, 480, 0x13, 240 }, 0, TRUE
+ },
+ // Logitech VideoMan 1.3
+ { Signal_CCIR656, VFormat_NTSC, VRef_alignedCb, Off, DecClk_GPCLK, TGB_NTSC780, 64, KHz24545,
+ // Clkx1_HACTIVE, Clkx1_HDELAY, VActive, VDelay, linesPerField; lineCount, Interlace
+ { 640, 0x80, 480, 0x1A, 240 }, 0, TRUE
+ },
+ // Rockwell QuartzSight
+ // Note: Fusion Rev D (rev ID 0x02) and later supports 16 pixels for HReset which is preferable.
+ // Use 32 for earlier version of hardware. Clkx1_HDELAY also changed from 0x27 to 0x20.
+ { Signal_CCIR656, VFormat_NTSC, VRef_alignedCb, Off, DecClk_GPCLK, TGB_NTSC392, 16, KHz28636,
+ // Clkx1_HACTIVE, Clkx1_HDELAY, VActive, VDelay, linesPerField; lineCount, Interlace
+ { 352, 0x20, 576, 0x08, 288 }, 607, FALSE
+ }
+};
+*/
+
+/*
+The corresponding APIs required to be invoked are:
+SetConnector( ConCamera, TRUE/FALSE );
+SetSignalFormat( spec.signal );
+SetVideoFormat( spec.vidFormat );
+SetSyncVideoRef( spec.syncRef );
+SetEnableSyncOutput( spec.syncOutput );
+SetTimGenByte( SRAMTable[ spec.tgb ], SRAMTableSize[ spec.tgb ] );
+SetHReset( spec.HReset );
+SetPLL( spec.pllFreq );
+SetDecInputClock( spec.iClk );
+SetVideoInfo( spec.vSize );
+SetTotalLineCount( spec.lineCount );
+SetInterlaceMode( spec.interlace );
+*/
+
+/* from web:
+ Video Sampling
+Digital video is a sampled form of analog video. The most common sampling schemes in use today are:
+ Pixel Clock Horiz Horiz Vert
+ Rate Total Active
+NTSC square pixel 12.27 MHz 780 640 525
+NTSC CCIR-601 13.5 MHz 858 720 525
+NTSC 4FSc 14.32 MHz 910 768 525
+PAL square pixel 14.75 MHz 944 768 625
+PAL CCIR-601 13.5 MHz 864 720 625
+PAL 4FSc 17.72 MHz 1135 948 625
+
+For the CCIR-601 standards, the sampling is based on a static orthogonal sampling grid. The luminance component (Y) is sampled at 13.5 MHz, while the two color difference signals, Cr and Cb are sampled at half that, or 6.75 MHz. The Cr and Cb samples are colocated with alternate Y samples, and they are taken at the same position on each line, such that one sample is coincident with the 50% point of the falling edge of analog sync. The samples are coded to either 8 or 10 bits per component.
+*/
+
+/* from DScaler:*/
+/*
+//===========================================================================
+// CCIR656 Digital Input Support: The tables were taken from DScaler proyect
+//
+// 13 Dec 2000 - Michael Eskin, Conexant Systems - Initial version
+//
+
+//===========================================================================
+// Timing generator SRAM table values for CCIR601 720x480 NTSC
+//===========================================================================
+// For NTSC CCIR656
+BYTE BtCard::SRAMTable_NTSC[] =
+{
+ // SRAM Timing Table for NTSC
+ 0x0c, 0xc0, 0x00,
+ 0x00, 0x90, 0xc2,
+ 0x03, 0x10, 0x03,
+ 0x06, 0x10, 0x34,
+ 0x12, 0x12, 0x65,
+ 0x02, 0x13, 0x24,
+ 0x19, 0x00, 0x24,
+ 0x39, 0x00, 0x96,
+ 0x59, 0x08, 0x93,
+ 0x83, 0x08, 0x97,
+ 0x03, 0x50, 0x30,
+ 0xc0, 0x40, 0x30,
+ 0x86, 0x01, 0x01,
+ 0xa6, 0x0d, 0x62,
+ 0x03, 0x11, 0x61,
+ 0x05, 0x37, 0x30,
+ 0xac, 0x21, 0x50
+};
+
+//===========================================================================
+// Timing generator SRAM table values for CCIR601 720x576 NTSC
+//===========================================================================
+// For PAL CCIR656
+BYTE BtCard::SRAMTable_PAL[] =
+{
+ // SRAM Timing Table for PAL
+ 0x36, 0x11, 0x01,
+ 0x00, 0x90, 0x02,
+ 0x05, 0x10, 0x04,
+ 0x16, 0x14, 0x05,
+ 0x11, 0x00, 0x04,
+ 0x12, 0xc0, 0x00,
+ 0x31, 0x00, 0x06,
+ 0x51, 0x08, 0x03,
+ 0x89, 0x08, 0x07,
+ 0xc0, 0x44, 0x00,
+ 0x81, 0x01, 0x01,
+ 0xa9, 0x0d, 0x02,
+ 0x02, 0x50, 0x03,
+ 0x37, 0x3d, 0x00,
+ 0xaf, 0x21, 0x00,
+};
+*/
--
Weil die späten Diskussionen nicht mal mehr den Rotwein lohnen.
-- Wacholder in "Melanie"
^ permalink raw reply
* Re: BDI-2000
From: Jerry Van Baren @ 2003-01-08 11:47 UTC (permalink / raw)
To: linuxppc-embedded
In-Reply-To: <0065D0B7.C21188@alloptic.com>
You are setting your breakpoint at 0x0c000000. Linux in virtual memory
starts at 0xc0000000. Am I missing something?
gvb
At 04:40 PM 1/7/2003 -0500, cecilia.muaddi@alloptic.com wrote:
>Hello,
>
>I finally got my BDI-2000 for PPC 860 this week, and tried to set it up to
>debug my MMU problem.
>This is my first time using the BDI-2000, and really hope someone here can
>give me a hand.
[snip]
>I am able to check and modify the SRAM (at physical address location 0x0).
>and view the bootROM memory
>(at physical address of 0x28000000). I enable the MMU XLAT and set the
>PTBASE to 0xf0 as suggested in the
>user manual.
>Here is the output of the BDI
>
>BDI>reset
>- TARGET: processing user reset request
>- TARGET: resetting target passed
>- TARGET: processing target init list ....
>- TARGET: processing target init list passed
>BDI>bi 0x0c000000 0x0c00ffff
>Breakpoint identification is 0
>BDI>go 0x28000100
>- TARGET: target has entered debug mode
>BDI>ci
>BDI>info
> Target state : debug mode
> Debug entry cause : entering check stop state
> Current PC : 0x00000220
>BDI>
>
>I never seem to get the break at the location of 0x0c000000.
>The same problem if I set the break at location of start_here grep from
>System.map
>
>However I do get the break if I set at address location of 0 (start of the
>head_8xx.S)
>Can someone help me out here??
>
>Thanks
>
>Cecilia
>
>P.S. here is a brief information of my .cfg file which I loaded to BDI
[snip]
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply
* [patch] bttv driver update.
From: Gerd Knorr @ 2003-01-08 11:59 UTC (permalink / raw)
To: Linus Torvalds, Kernel List
Hi,
This patch updates the bttv driver. Changes:
* adaptions to the video-buf changes send in a previous mail.
* adaptions to recent i2c changes in the kernel.
* first code bits the pixelview digital camera support (not
working yet).
* lots of small fixes/changes for specific TV cards.
Please apply,
Gerd
--- linux-2.5.54/drivers/media/video/bttv-cards.c 2003-01-08 10:34:28.000000000 +0100
+++ linux/drivers/media/video/bttv-cards.c 2003-01-08 10:59:58.000000000 +0100
@@ -37,15 +37,15 @@
#include "bttvp.h"
#include "tuner.h"
-#if 0
-# include "bt832.h"
-#endif
+#include "bt832.h"
/* fwd decl */
static void boot_msp34xx(struct bttv *btv, int pin);
+static void boot_bt832(struct bttv *btv);
static void hauppauge_eeprom(struct bttv *btv);
static void avermedia_eeprom(struct bttv *btv);
static void osprey_eeprom(struct bttv *btv);
+static void modtec_eeprom(struct bttv *btv);
static void init_PXC200(struct bttv *btv);
static void winview_audio(struct bttv *btv, struct video_audio *v, int set);
@@ -64,12 +64,15 @@
static int terratec_active_radio_upgrade(struct bttv *btv);
static int tea5757_read(struct bttv *btv);
static int tea5757_write(struct bttv *btv, int value);
+int is_MM20xPCTV(unsigned char eeprom_data[256]);
/* config variables */
static int triton1=0;
static int vsfx=0;
-int no_overlay=-1;
+static int no_overlay=-1;
+static int latency = -1;
+
static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = -1};
static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = -1};
static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = -1};
@@ -90,6 +93,8 @@
MODULE_PARM_DESC(vsfx,"set VSFX pci config bit "
"[yet another chipset flaw workaround]");
MODULE_PARM(no_overlay,"i");
+MODULE_PARM(latency,"i");
+MODULE_PARM_DESC(latency,"pci latency timer");
MODULE_PARM(card,"1-" __stringify(BTTV_MAX) "i");
MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");
MODULE_PARM(pll,"1-" __stringify(BTTV_MAX) "i");
@@ -153,7 +158,7 @@
{ 0x1200bd11, BTTV_PINNACLE, "Pinnacle PCTV" },
{ 0x001211bd, BTTV_PINNACLE, "Pinnacle PCTV" },
- { 0x001c11bd, BTTV_PINNACLE, "Pinnacle PCTV Sat" },
+ { 0x001c11bd, BTTV_PINNACLESAT, "Pinnacle PCTV Sat" },
{ 0x3000121a, BTTV_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
{ 0x3060121a, BTTV_STB2, "3Dfx VoodooTV 100/ STB OEM" },
@@ -166,21 +171,23 @@
{ 0x00021461, BTTV_AVERMEDIA98, "AVermedia TVCapture 98" },
{ 0x00031461, BTTV_AVPHONE98, "AVerMedia TVPhone98" },
{ 0x00041461, BTTV_AVERMEDIA98, "AVerMedia TVCapture 98" },
+ { 0x03001461, BTTV_AVERMEDIA98, "VDOMATE TV TUNER CARD" },
{ 0x300014ff, BTTV_MAGICTVIEW061, "TView 99 (CPH061)" },
{ 0x300214ff, BTTV_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" },
- { 0x1117153b, BTTV_TERRATVALUE, "Terratec TValue" },
- { 0x1118153b, BTTV_TERRATVALUE, "Terratec TValue" },
- { 0x1119153b, BTTV_TERRATVALUE, "Terratec TValue" },
- { 0x111a153b, BTTV_TERRATVALUE, "Terratec TValue" },
+ { 0x1117153b, BTTV_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" },
+ { 0x1118153b, BTTV_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" },
+ { 0x1119153b, BTTV_TERRATVALUE, "Terratec TValue (Philips PAL I)" },
+ { 0x111a153b, BTTV_TERRATVALUE, "Terratec TValue (Temic PAL I)" },
+
{ 0x1123153b, BTTV_TERRATVRADIO, "Terratec TV Radio+" },
- { 0x1127153b, BTTV_TERRATV, "Terratec TV+" },
+ { 0x1127153b, BTTV_TERRATV, "Terratec TV+ (V1.05)" },
// clashes with FlyVideo
- //{ 0x18521852, BTTV_TERRATV, "Terratec TV+" },
- { 0x1134153b, BTTV_TERRATVALUE, "Terratec TValue" },
- { 0x1135153b, BTTV_TERRATVALUER, "Terratec TValue Radio" },
- { 0x5018153b, BTTV_TERRATVALUE, "Terratec TValue" },
+ //{ 0x18521852, BTTV_TERRATV, "Terratec TV+ (V1.10)" },
+ { 0x1134153b, BTTV_TERRATVALUE, "Terratec TValue (LR102)" },
+ { 0x1135153b, BTTV_TERRATVALUER, "Terratec TValue Radio" }, // LR102
+ { 0x5018153b, BTTV_TERRATVALUE, "Terratec TValue" }, // ??
{ 0x400015b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
{ 0x400a15b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
@@ -189,7 +196,7 @@
{ 0x401615b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
{ 0x010115cb, BTTV_GMV1, "AG GMV1" },
- { 0x010114c7, BTTV_MODTEC_205, "Modular Technology MM205 PCTV" },
+ { 0x010114c7, BTTV_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
{ 0x18501851, BTTV_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
{ 0x18511851, BTTV_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" },
{ 0x18521852, BTTV_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
@@ -198,6 +205,7 @@
{ 0x03116000, BTTV_SENSORAY311, "Sensoray 311" },
{ 0x00790e11, BTTV_WINDVR, "Canopus WinDVR PCI" },
{ 0xa0fca1a0, BTTV_ZOLTRIX, "Face to Face Tvmax" },
+ { 0xa0fca04f, BTTV_MAGICTVIEW063, "Guillemot Maxi TV Video 3" },
{ 0, -1, NULL }
};
@@ -479,13 +487,14 @@
.pll = PLL_28,
.tuner_type = -1,
},{
- .name = "Modular Technology MM205 PCTV, bt878",
- .video_inputs = 2,
+ .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
+ .video_inputs = 3,
.audio_inputs = 1,
.tuner = 0,
.svhs = -1,
.gpiomask = 7,
- .muxsel = { 2, 3 },
+ .muxsel = { 2, 3, -1 },
+ .digital_mode = DIGITAL_MODE_CAMERA,
.audiomux = { 0, 0, 0, 0, 0 },
.no_msp34xx = 1,
.pll = PLL_28,
@@ -608,14 +617,15 @@
.tuner_type = -1,
},{
.name = "Formac iProTV",
- .video_inputs = 3,
+ .video_inputs = 4,
.audio_inputs = 1,
.tuner = 0,
- .svhs = 2,
+ .svhs = 3,
.gpiomask = 1,
.muxsel = { 2, 3, 1, 1},
.audiomux = { 1, 0, 0, 0, 0 },
- .tuner_type = -1,
+ .pll = PLL_28,
+ .tuner_type = TUNER_PHILIPS_PAL,
},{
/* ---- card 0x20 ---------------------------------- */
@@ -861,12 +871,13 @@
.audio_hook = gvbctv3pci_audio,
},{
.name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
- .video_inputs = 4,
+ .video_inputs = 5,
.audio_inputs = 1,
.tuner = 0,
.svhs = 3,
.gpiomask = 0xAA0000,
- .muxsel = { 2,3,1,1 },
+ .muxsel = { 2,3,1,1,-1 },
+ .digital_mode = DIGITAL_MODE_CAMERA,
.audiomux = { 0x20000, 0, 0x80000, 0x80000, 0xa8000, 0x46000 },
.no_msp34xx = 1,
.pll = PLL_28,
@@ -902,7 +913,7 @@
.svhs = 2,
.gpiomask = 0x03000F,
.muxsel = { 2, 3, 1, 1},
- .audiomux = { 1, 0x10001, 0, 0, 10},
+ .audiomux = { 1, 0xd0001, 0, 0, 10},
/* sound path (5 sources):
MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
0= ext. Audio IN
@@ -1165,10 +1176,10 @@
.tuner_type = -1,
.pll = PLL_28,
.muxsel = { 2 },
- .gpiomask = 0
+ gpiomask: 0
},{
/* Tomasz Pyra <hellfire@sedez.iq.pl> */
- .name = "Prolink Pixelview PV-BT878P+ (Rev.4C)",
+ .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
.video_inputs = 3,
.audio_inputs = 4,
.tuner = 0,
@@ -1252,7 +1263,7 @@
},{
.name = "Powercolor MTV878/ MTV878R/ MTV878F",
.video_inputs = 3,
- .audio_inputs = 2,
+ audio_inputs: 2,
.tuner = 0,
.svhs = 2,
.gpiomask = 0x1C800F, // Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset
@@ -1292,7 +1303,7 @@
},{
.name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
.video_inputs = 4,
- .audio_inputs = 3,
+ audio_inputs: 3,
.tuner = 0,
.svhs = 2,
.gpiomask = 7,
@@ -1313,7 +1324,7 @@
GPIO0,1: HEF4052 A0,A1
GPIO2: HEF4052 nENABLE
GPIO3-7: n.c.
- GPIO8-13: IRDC357 data0,5 (data6 n.c. ?) [chip not present on my card]
+ GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
GPIO14,15: ??
GPIO16-21: n.c.
GPIO22,23: ??
@@ -1513,6 +1524,65 @@
.no_msp34xx = 1,
.no_tda9875 = 1,
.pll = PLL_28,
+},{
+ .name = "Pinnacle PCTV Sat",
+ .video_inputs = 2,
+ .audio_inputs = 0,
+ .svhs = 1,
+ .tuner = -1,
+ .tuner_type = -1,
+ .no_msp34xx = 1,
+ .no_tda9875 = 1,
+ .no_tda7432 = 1,
+ .muxsel = { 3, 0, 1, 2},
+ .needs_tvaudio = 0,
+ .pll = PLL_28,
+},{
+ .name = "Formac ProTV II",
+ .video_inputs = 4,
+ .audio_inputs = 1,
+ .tuner = 0,
+ .svhs = 3,
+ .gpiomask = 2,
+ // TV, Comp1, Composite over SVID con, SVID
+ .muxsel = { 2, 3, 1, 1},
+ .audiomux = { 2, 2, 0, 0, 0 },
+ .pll = PLL_28,
+ .has_radio = 1,
+ .tuner_type = TUNER_PHILIPS_PAL,
+ /* sound routing:
+ GPIO=0x00,0x01,0x03: mute (?)
+ 0x02: both TV and radio (tuner: FM1216/I)
+ The card has onboard audio connectors labeled "cdrom" and "board",
+ not soldered here, though unknown wiring.
+ Card lacks: external audio in, pci subsystem id.
+ */
+
+},{
+ /* ---- card 0x60 ---------------------------------- */
+ .name = "MachTV",
+ .video_inputs = 3,
+ .audio_inputs = 1,
+ .tuner = 0,
+ .svhs = -1,
+ .gpiomask = 7,
+ .muxsel = { 2, 3, 1, 1},
+ .audiomux = { 0, 1, 2, 3, 4},
+ .needs_tvaudio = 1,
+ .tuner_type = 5,
+ .pll = 1,
+},{
+ .name = "Euresys Picolo",
+ .video_inputs = 3,
+ .audio_inputs = 0,
+ .tuner = -1,
+ .svhs = 2,
+ .gpiomask = 0,
+ .no_msp34xx = 1,
+ .no_tda9875 = 1,
+ .no_tda7432 = 1,
+ .muxsel = { 2, 0, 1},
+ .pll = PLL_28,
}};
const int bttv_num_tvcards = (sizeof(bttv_tvcards)/sizeof(struct tvcard));
@@ -1556,7 +1626,7 @@
printk(KERN_DEBUG "please mail id, board name and "
"the correct card= insmod option to kraxel@bytesex.org\n");
}
- }
+ }
/* let the user override the autodetected type */
if (card[btv->nr] >= 0 && card[btv->nr] < bttv_num_tvcards)
@@ -1601,6 +1671,16 @@
* (most) board specific initialisations goes here
*/
+/* Some Modular Technology cards have an eeprom, but no subsystem ID */
+int is_MM20xPCTV(unsigned char eeprom_data[256])
+{
+ if (0 == strncmp(eeprom_data,"GET.MM20xPCTV",13)) {
+ printk("bttv: GET.MM20xPCTV found\n");
+ return 1; // found
+ }
+ return 0;
+}
+
static void flyvideo_gpio(struct bttv *btv)
{
int gpio,outbits,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821;
@@ -1624,7 +1704,7 @@
ttype=(gpio&0x0f0000)>>16;
switch(ttype) {
- case 0x0: tuner=4; // None
+ case 0x0: tuner=2; // NTSC, e.g. TPI8NSR11P
break;
case 0x2: tuner=39;// LG NTSC (newer TAPC series) TAPC-H701P
break;
@@ -1647,6 +1727,9 @@
is_lr90 = !(gpio & 0x002000); // else LR26/LR50 (LR38/LR51 f. capture only)
// gpio & 0x001000 // output bit for audio routing
+ if(is_capture_only)
+ tuner=4; // No tuner present
+
printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
btv->nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio);
printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
@@ -1659,7 +1742,7 @@
// LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
// LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
- // Audio options: from tuner, from tda9821/tda9821(mono,stereo.sap), from tda9874, ext., mute
+ // Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute
if(has_tda9820_tda9821) btv->audio_hook = lt9415_audio;
//todo: if(has_tda9874) btv->audio_hook = fv2000s_audio;
}
@@ -1816,6 +1899,16 @@
{
btv->tuner_type = -1;
+ if (BTTV_UNKNOWN == btv->type) {
+ printk("bttv%d: Looking for eeprom\n",btv->nr);
+ bttv_readee(btv,eeprom_data,0xa0);
+ if(is_MM20xPCTV(eeprom_data)) {
+ btv->type = BTTV_MODTEC_205;
+ printk("bttv%d: Autodetect by eeprom:(%s) [card=%d]\n",
+ btv->nr, bttv_tvcards[btv->type].name, btv->type);
+ }
+ }
+
switch (btv->type) {
case BTTV_MIRO:
case BTTV_MIROPRO:
@@ -1896,6 +1989,10 @@
case BTTV_IDS_EAGLE:
init_ids_eagle(btv);
break;
+ case BTTV_MODTEC_205:
+ bttv_readee(btv,eeprom_data,0xa0);
+ modtec_eeprom(btv);
+ break;
}
/* pll configuration */
@@ -1930,6 +2027,7 @@
break;
}
}
+ btv->pll.pll_current = -1;
/* tuner configuration (from card list / autodetect / insmod option) */
if (-1 != bttv_tvcards[btv->type].tuner_type)
@@ -1947,33 +2045,12 @@
if (bttv_tvcards[btv->type].audio_hook)
btv->audio_hook=bttv_tvcards[btv->type].audio_hook;
-#if 0
- /* detect Bt832 chip for quartzsight digital camera */
- if((bttv_I2CRead(btv, I2C_BT832_ALT1, "Bt832") >=0) ||
- (bttv_I2CRead(btv, I2C_BT832_ALT2, "Bt832") >=0)) {
- int outbits,databits;
- request_module("bt832");
-
- bttv_call_i2c_clients(btv, BT832_HEXDUMP, NULL);
-
- printk("Reset Bt832 (0x400000 for Pixelview 4E)\n");
- btwrite(0, BT848_GPIO_DATA);
- outbits = btread(BT848_GPIO_OUT_EN);
- databits= btread(BT848_GPIO_DATA);
- btwrite(0x400000, BT848_GPIO_OUT_EN);
- udelay(5);
- btwrite(0x400000, BT848_GPIO_DATA);
- udelay(5);
- btwrite(0, BT848_GPIO_DATA);
- udelay(5);
- btwrite(outbits, BT848_GPIO_OUT_EN);
- btwrite(databits, BT848_GPIO_DATA);
-
- // bt832 on pixelview changes from i2c 0x8a to 0x88 after
- // being reset as above. So we must follow by this:
- bttv_call_i2c_clients(btv, BT832_REATTACH, NULL);
+ if (bttv_tvcards[btv->type].digital_mode == DIGITAL_MODE_CAMERA) {
+ /* detect Bt832 chip for quartzsight digital camera */
+ if ((bttv_I2CRead(btv, I2C_BT832_ALT1, "Bt832") >=0) ||
+ (bttv_I2CRead(btv, I2C_BT832_ALT2, "Bt832") >=0))
+ boot_bt832(btv);
}
-#endif
/* try to detect audio/fader chips */
if (!bttv_tvcards[btv->type].no_msp34xx &&
@@ -2069,6 +2146,16 @@
{ TUNER_LG_PAL_I, "LG TAPC-I701D"}
};
+static void modtec_eeprom(struct bttv *btv)
+{
+ if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
+ btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
+ printk("bttv Modtec: Tuner autodetected %s\n",&eeprom_data[0x1e]);
+ }
+ else
+ printk("bttv Modtec: Unknown TunerString:%s\n",&eeprom_data[0x1e]);
+}
+
static void __devinit hauppauge_eeprom(struct bttv *btv)
{
int blk2,tuner,radio,model;
@@ -2316,8 +2403,8 @@
/* AVermedia specific stuff, from bktr_card.c */
int tuner_0_table[] = {
- TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL,
- TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
+ TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
+ TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL};
@@ -2408,6 +2495,41 @@
"init [%d]\n", btv->nr, pin);
}
+static void __devinit boot_bt832(struct bttv *btv)
+{
+ int outbits,databits,resetbit=0;
+
+ switch (btv->type) {
+ case BTTV_PXELVWPLTVPAK:
+ resetbit = 0x400000;
+ break;
+ case BTTV_MODTEC_205:
+ resetbit = 1<<9;
+ break;
+ default:
+ BUG();
+ }
+
+ request_module("bt832");
+ bttv_call_i2c_clients(btv, BT832_HEXDUMP, NULL);
+
+ printk("bttv%d: Reset Bt832 [line=0x%x]\n",btv->nr,resetbit);
+ btwrite(0, BT848_GPIO_DATA);
+ outbits = btread(BT848_GPIO_OUT_EN);
+ databits= btread(BT848_GPIO_DATA);
+ btwrite(resetbit, BT848_GPIO_OUT_EN);
+ udelay(5);
+ btwrite(resetbit, BT848_GPIO_DATA);
+ udelay(5);
+ btwrite(0, BT848_GPIO_DATA);
+ udelay(5);
+ btwrite(outbits, BT848_GPIO_OUT_EN);
+ btwrite(databits, BT848_GPIO_DATA);
+
+ // bt832 on pixelview changes from i2c 0x8a to 0x88 after
+ // being reset as above. So we must follow by this:
+ bttv_call_i2c_clients(btv, BT832_REATTACH, NULL);
+}
/* ----------------------------------------------------------------------- */
/* Imagenation L-Model PXC200 Framegrabber */
@@ -2980,13 +3102,16 @@
int pcipci_fail = 0;
struct pci_dev *dev = NULL;
- /* for 2.4.x we'll use the pci quirks (drivers/pci/quirks.c) */
if (pci_pci_problems & PCIPCI_FAIL)
pcipci_fail = 1;
if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
triton1 = 1;
if (pci_pci_problems & PCIPCI_VSFX)
vsfx = 1;
+#ifdef PCIPCI_ALIMAGIK
+ if (pci_pci_problems & PCIPCI_ALIMAGIK)
+ latency = 0x0A;
+#endif
/* print which chipset we have */
while ((dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8,dev)))
@@ -2997,7 +3122,6 @@
printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");
if (vsfx)
printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");
-
if (pcipci_fail) {
printk(KERN_WARNING "bttv: BT848 and your chipset may not work together.\n");
if (-1 == no_overlay) {
@@ -3005,30 +3129,34 @@
no_overlay = 1;
}
}
+ if (-1 != latency)
+ printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);
while ((dev = pci_find_device(PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_82441, dev))) {
unsigned char b;
- pci_read_config_byte(dev, 0x53, &b);
+ pci_read_config_byte(dev, 0x53, &b);
if (bttv_debug)
printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "
"bufcon=0x%02x\n",b);
}
-
}
int __devinit bttv_handle_chipset(struct bttv *btv)
{
unsigned char command;
- if (!triton1 && !vsfx)
+ if (!triton1 && !vsfx && -1 == latency)
return 0;
if (bttv_verbose) {
if (triton1)
- printk("bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->nr);
+ printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->nr);
if (vsfx && btv->id >= 878)
- printk("bttv%d: enabling VSFX\n",btv->nr);
+ printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->nr);
+ if (-1 != latency)
+ printk(KERN_INFO "bttv%d: setting pci timer to %d\n",
+ btv->nr,latency);
}
if (btv->id < 878) {
@@ -3044,6 +3172,8 @@
command |= BT878_EN_VSFX;
pci_write_config_byte(btv->dev, BT878_DEVCTRL, command);
}
+ if (-1 != latency)
+ pci_write_config_byte(btv->dev, PCI_LATENCY_TIMER, latency);
return 0;
}
--- linux-2.5.54/drivers/media/video/bttv-driver.c 2003-01-08 10:34:54.000000000 +0100
+++ linux/drivers/media/video/bttv-driver.c 2003-01-08 10:59:58.000000000 +0100
@@ -39,8 +39,6 @@
#include "bttvp.h"
#include "tuner.h"
-/* 2.4 / 2.5 driver compatibility stuff */
-
int bttv_num; /* number of Bt848s in use */
struct bttv bttvs[BTTV_MAX];
@@ -58,13 +56,14 @@
static unsigned int irq_debug = 0;
static unsigned int gbuffers = 8;
static unsigned int gbufsize = 0x208000;
-static unsigned int fdsr = 0;
-static unsigned int latency = -1;
static int video_nr = -1;
static int radio_nr = -1;
static int vbi_nr = -1;
+static unsigned int fdsr = 0;
+static unsigned int gpint = 1;
+
/* options */
static unsigned int combfilter = 0;
static unsigned int lumafilter = 0;
@@ -94,14 +93,14 @@
MODULE_PARM_DESC(gbuffers,"number of capture buffers. range 2-32, default 8");
MODULE_PARM(gbufsize,"i");
MODULE_PARM_DESC(gbufsize,"size of the capture buffers, default is 0x208000");
-MODULE_PARM(fdsr,"i");
-MODULE_PARM(latency,"i");
-MODULE_PARM_DESC(latency,"pci latency timer");
MODULE_PARM(video_nr,"i");
MODULE_PARM(radio_nr,"i");
MODULE_PARM(vbi_nr,"i");
+MODULE_PARM(fdsr,"i");
+MODULE_PARM(gpint,"i");
+
MODULE_PARM(combfilter,"i");
MODULE_PARM(lumafilter,"i");
MODULE_PARM(automute,"i");
@@ -132,6 +131,7 @@
{
/* PAL digital input over GPIO[7:0] */
{
+ 45, // 45 bytes following
0x36,0x11,0x01,0x00,0x90,0x02,0x05,0x10,0x04,0x16,
0x12,0x05,0x11,0x00,0x04,0x12,0xC0,0x00,0x31,0x00,
0x06,0x51,0x08,0x03,0x89,0x08,0x07,0xC0,0x44,0x00,
@@ -140,6 +140,7 @@
},
/* NTSC digital input over GPIO[7:0] */
{
+ 51, // 51 bytes following
0x0C,0xC0,0x00,0x00,0x90,0x02,0x03,0x10,0x03,0x06,
0x10,0x04,0x12,0x12,0x05,0x02,0x13,0x04,0x19,0x00,
0x04,0x39,0x00,0x06,0x59,0x08,0x03,0x83,0x08,0x07,
@@ -147,6 +148,16 @@
0x0D,0x02,0x03,0x11,0x01,0x05,0x37,0x00,0xAC,0x21,
0x00,
},
+ // TGB_NTSC392 // quartzsight
+ // This table has been modified to be used for Fusion Rev D
+ {
+ 0x2A, // size of table = 42
+ 0x06, 0x08, 0x04, 0x0a, 0xc0, 0x00, 0x18, 0x08, 0x03, 0x24,
+ 0x08, 0x07, 0x02, 0x90, 0x02, 0x08, 0x10, 0x04, 0x0c, 0x10,
+ 0x05, 0x2c, 0x11, 0x04, 0x55, 0x48, 0x00, 0x05, 0x50, 0x00,
+ 0xbf, 0x0c, 0x02, 0x2f, 0x3d, 0x00, 0x2f, 0x3f, 0x00, 0xc3,
+ 0x20, 0x00
+ }
};
const struct bttv_tvnorm bttv_tvnorms[] = {
@@ -170,7 +181,7 @@
.vbipack = 255,
.sram = 0,
},{
- .v4l2_id = V4L2_STD_NTSC,
+ .v4l2_id = V4L2_STD_NTSC_M,
.name = "NTSC",
.Fsc = 28636363,
.swidth = 768,
@@ -635,28 +646,31 @@
btwrite(fi|BT848_PLL_X, BT848_PLL_XCI);
}
-static int set_pll(struct bttv *btv)
+static void set_pll(struct bttv *btv)
{
int i;
if (!btv->pll.pll_crystal)
- return 0;
+ return;
+
+ if (btv->pll.pll_ofreq == btv->pll.pll_current) {
+ dprintk("bttv%d: PLL: no change required\n",btv->nr);
+ return;
+ }
if (btv->pll.pll_ifreq == btv->pll.pll_ofreq) {
/* no PLL needed */
if (btv->pll.pll_current == 0)
- return 0;
- vprintk("bttv%d: PLL: switching off\n",btv->nr);
+ return;
+ vprintk(KERN_INFO "bttv%d: PLL can sleep, using XTAL (%d).\n",
+ btv->nr,btv->pll.pll_ifreq);
btwrite(0x00,BT848_TGCTRL);
btwrite(0x00,BT848_PLL_XCI);
btv->pll.pll_current = 0;
- return 0;
+ return;
}
- if (btv->pll.pll_ofreq == btv->pll.pll_current)
- return 0;
-
- vprintk("bttv%d: PLL: %d => %d ",btv->nr,
+ vprintk(KERN_INFO "bttv%d: PLL: %d => %d ",btv->nr,
btv->pll.pll_ifreq, btv->pll.pll_ofreq);
set_pll_freq(btv, btv->pll.pll_ifreq, btv->pll.pll_ofreq);
@@ -672,40 +686,43 @@
btwrite(0x08,BT848_TGCTRL);
btv->pll.pll_current = btv->pll.pll_ofreq;
vprintk(" ok\n");
- return 0;
+ return;
}
}
btv->pll.pll_current = -1;
vprintk("failed\n");
- return -1;
+ return;
}
/* used to switch between the bt848's analog/digital video capture modes */
void bt848A_set_timing(struct bttv *btv)
{
- u8 dvsif_val = 0;
- int table_idx = bttv_tvnorms[btv->tvnorm].sram;
- int i;
-
- /* timing change...reset timing generator address */
- btwrite(0x00, BT848_TGCTRL);
- btwrite(0x02, BT848_TGCTRL);
- btwrite(0x00, BT848_TGCTRL);
-
- if (btv->digital_video && -1 != table_idx) {
- dprintk("bttv%d: load digital timing table (table_idx=%d)\n",
- btv->nr,table_idx);
- dvsif_val = 0x41;
- for(i = 0; i < 51; i++)
- btwrite(SRAM_Table[table_idx][i],BT848_TGLB);
-
- btwrite(0x75,BT848_PLL_F_LO);
- btwrite(0x50,BT848_PLL_F_HI);
- btwrite(0x8B,BT848_PLL_XCI);
- btwrite(0x11,BT848_TGCTRL);
- btv->pll.pll_current = 0;
- }
- btwrite(dvsif_val,BT848_DVSIF);
+ int i, len;
+ int table_idx = bttv_tvnorms[btv->tvnorm].sram;
+ int fsc = bttv_tvnorms[btv->tvnorm].Fsc;
+
+ if (bttv_tvcards[btv->type].muxsel[btv->input] < 0) {
+ dprintk("bttv%d: load digital timing table (table_idx=%d)\n",
+ btv->nr,table_idx);
+
+ /* timing change...reset timing generator address */
+ btwrite(0x00, BT848_TGCTRL);
+ btwrite(0x02, BT848_TGCTRL);
+ btwrite(0x00, BT848_TGCTRL);
+
+ len=SRAM_Table[table_idx][0];
+ for(i = 1; i <= len; i++)
+ btwrite(SRAM_Table[table_idx][i],BT848_TGLB);
+ btv->pll.pll_ofreq = 27000000;
+
+ set_pll(btv);
+ btwrite(0x11, BT848_TGCTRL);
+ btwrite(0x41, BT848_DVSIF);
+ } else {
+ btv->pll.pll_ofreq = fsc;
+ set_pll(btv);
+ btwrite(0x0, BT848_DVSIF);
+ }
}
/* ----------------------------------------------------------------------- */
@@ -878,13 +895,7 @@
BT848_IFORM);
btwrite(tvnorm->vbipack, BT848_VBI_PACK_SIZE);
btwrite(1, BT848_VBI_PACK_DEL);
-
- if (btv->digital_video) {
- bt848A_set_timing(btv);
- } else {
- btv->pll.pll_ofreq = tvnorm->Fsc;
- set_pll(btv);
- }
+ bt848A_set_timing(btv);
switch (btv->type) {
case BTTV_VOODOOTV_FM:
@@ -1133,9 +1144,7 @@
{
int need_count = 0;
- if (locked_btres(btv,RESOURCE_VIDEO))
- need_count++;
- if (locked_btres(btv,RESOURCE_VBI))
+ if (btv->users)
need_count++;
if (need_count) {
@@ -1245,7 +1254,7 @@
}
#if 0
- if (STATE_NEEDS_INIT == buf->vb.state)
+ if (STATE_NEEDS_INIT == buf->vb.state) {
if (redo_dma_risc)
bttv_dma_free(btv,buf);
}
@@ -1275,7 +1284,7 @@
{
struct bttv_fh *fh = file->private_data;
- *size = fh->buf.fmt->depth*fh->buf.vb.width*fh->buf.vb.height >> 3;
+ *size = fh->fmt->depth*fh->width*fh->height >> 3;
if (0 == *count)
*count = gbuffers;
while (*size * *count > gbuffers * gbufsize)
@@ -1284,14 +1293,14 @@
}
static int
-buffer_prepare(struct file *file, struct videobuf_buffer *vb)
+buffer_prepare(struct file *file, struct videobuf_buffer *vb,
+ enum v4l2_field field)
{
struct bttv_buffer *buf = (struct bttv_buffer*)vb;
struct bttv_fh *fh = file->private_data;
- return bttv_prepare_buffer(fh->btv,buf,fh->buf.fmt,
- fh->buf.vb.width,fh->buf.vb.height,
- fh->buf.vb.field);
+ return bttv_prepare_buffer(fh->btv, buf, fh->fmt,
+ fh->width, fh->height, field);
}
static void
@@ -1357,6 +1366,8 @@
{
struct video_tuner *v = arg;
+ if (-1 == bttv_tvcards[btv->type].tuner)
+ return -EINVAL;
if (v->tuner) /* Only tuner 0 */
return -EINVAL;
strcpy(v->name, "Television");
@@ -1517,10 +1528,15 @@
case VIDIOC_ENUMINPUT:
{
struct v4l2_input *i = arg;
-
- if (i->index >= bttv_tvcards[btv->type].video_inputs)
+ int n;
+
+ n = i->index;
+ if (n >= bttv_tvcards[btv->type].video_inputs)
return -EINVAL;
- i->type = V4L2_INPUT_TYPE_CAMERA;
+ memset(i,0,sizeof(*i));
+ i->index = n;
+ i->type = V4L2_INPUT_TYPE_CAMERA;
+ i->audioset = 1;
if (i->index == bttv_tvcards[btv->type].tuner) {
sprintf(i->name, "Television");
i->type = V4L2_INPUT_TYPE_TUNER;
@@ -1530,6 +1546,15 @@
} else {
sprintf(i->name,"Composite%d",i->index);
}
+ if (i->index == btv->input) {
+ __u32 dstatus = btread(BT848_DSTATUS);
+ if (0 == (dstatus & BT848_DSTATUS_PRES))
+ i->status |= V4L2_IN_ST_NO_SIGNAL;
+ if (0 == (dstatus & BT848_DSTATUS_HLOC))
+ i->status |= V4L2_IN_ST_NO_H_LOCK;
+ }
+ for (n = 0; n < BTTV_TVNORMS; n++)
+ i->std |= bttv_tvnorms[n].v4l2_id;
return 0;
}
case VIDIOC_G_INPUT:
@@ -1562,8 +1587,9 @@
down(&btv->lock);
memset(t,0,sizeof(*t));
strcpy(t->name, "Television");
+ t->type = V4L2_TUNER_ANALOG_TV;
t->capability = V4L2_TUNER_CAP_NORM;
- t->rangehigh = 0xffffffffUL;
+ t->rangehigh = 0xffffffffUL;
t->rxsubchans = V4L2_TUNER_SUB_MONO;
if (btread(BT848_DSTATUS)&BT848_DSTATUS_HLOC)
t->signal = 0xffff;
@@ -1680,6 +1706,15 @@
if (!fixup && (win->w.width > maxw || win->w.height > maxh))
return -EINVAL;
+ if (1 /* depth < 4bpp */) {
+ /* adjust and align writes */
+ int left = (win->w.left + 3) & ~3;
+ int width = win->w.width & ~3;
+ while (left + width > win->w.left + win->w.width)
+ width -= 4;
+ win->w.left = left;
+ win->w.width = width;
+ }
if (win->w.width > maxw)
win->w.width = maxw;
if (win->w.height > maxh)
@@ -1796,15 +1831,17 @@
switch (f->type) {
case V4L2_BUF_TYPE_VIDEO_CAPTURE:
memset(&f->fmt.pix,0,sizeof(struct v4l2_pix_format));
- f->fmt.pix.width = fh->buf.vb.width;
- f->fmt.pix.height = fh->buf.vb.height;
- f->fmt.pix.pixelformat = fh->buf.fmt->fourcc;
+ f->fmt.pix.width = fh->width;
+ f->fmt.pix.height = fh->height;
+ f->fmt.pix.field = fh->cap.field;
+ f->fmt.pix.pixelformat = fh->fmt->fourcc;
f->fmt.pix.sizeimage =
- (fh->buf.vb.width*fh->buf.vb.height*fh->buf.fmt->depth)/8;
+ (fh->width * fh->height * fh->fmt->depth)/8;
return 0;
case V4L2_BUF_TYPE_VIDEO_OVERLAY:
memset(&f->fmt.win,0,sizeof(struct v4l2_window));
- f->fmt.win.w = fh->ov.w;
+ f->fmt.win.w = fh->ov.w;
+ f->fmt.win.field = fh->ov.field;
return 0;
case V4L2_BUF_TYPE_VBI_CAPTURE:
bttv_vbi_fmt(fh,f);
@@ -1866,7 +1903,7 @@
if (f->fmt.pix.height > maxh)
f->fmt.pix.height = maxh;
f->fmt.pix.sizeimage =
- (fh->buf.vb.width * fh->buf.vb.height * fmt->depth)/8;
+ (fh->width * fh->height * fmt->depth)/8;
return 0;
}
@@ -1909,14 +1946,13 @@
/* update our state informations */
down(&fh->cap.lock);
- fh->buf.fmt = fmt;
- fh->buf.vb.field = f->fmt.pix.field;
- fh->buf.vb.width = f->fmt.pix.width;
- fh->buf.vb.height = f->fmt.pix.height;
- btv->init.buf.fmt = fmt;
- btv->init.buf.vb.field = f->fmt.pix.field;
- btv->init.buf.vb.width = f->fmt.pix.width;
- btv->init.buf.vb.height = f->fmt.pix.height;
+ fh->fmt = fmt;
+ fh->cap.field = f->fmt.pix.field;
+ fh->width = f->fmt.pix.width;
+ fh->height = f->fmt.pix.height;
+ btv->init.fmt = fmt;
+ btv->init.width = f->fmt.pix.width;
+ btv->init.height = f->fmt.pix.height;
up(&fh->cap.lock);
return 0;
@@ -1953,7 +1989,7 @@
v4l1_ioctls[_IOC_NR(cmd)] : "???");
break;
case 'V':
- printk("bttv%d: ioctl 0x%x (v4l2, VIDIOC_%s)\n",
+ printk("bttv%d: ioctl 0x%x (v4l2, %s)\n",
btv->nr, cmd, v4l2_ioctl_names[_IOC_NR(cmd)]);
break;
default:
@@ -2002,9 +2038,9 @@
pic->contrast = btv->contrast;
pic->hue = btv->hue;
pic->colour = btv->saturation;
- if (fh->buf.fmt) {
- pic->depth = fh->buf.fmt->depth;
- pic->palette = fh->buf.fmt->palette;
+ if (fh->fmt) {
+ pic->depth = fh->fmt->depth;
+ pic->palette = fh->fmt->palette;
}
return 0;
}
@@ -2021,9 +2057,9 @@
if (fmt->depth != pic->depth && !sloppy)
goto fh_unlock_and_return;
fh->ovfmt = fmt;
- fh->buf.fmt = fmt;
+ fh->fmt = fmt;
btv->init.ovfmt = fmt;
- btv->init.buf.fmt = fmt;
+ btv->init.fmt = fmt;
if (bigendian) {
/* dirty hack time: swap bytes for overlay if the
display adaptor is big endian (insmod option) */
@@ -2067,10 +2103,10 @@
retval = setup_window(fh, btv, &w2, 0);
if (0 == retval) {
/* on v4l1 this ioctl affects the read() size too */
- fh->buf.vb.width = fh->ov.w.width;
- fh->buf.vb.height = fh->ov.w.height;
- btv->init.buf.vb.width = fh->ov.w.width;
- btv->init.buf.vb.height = fh->ov.w.height;
+ fh->width = fh->ov.w.width;
+ fh->height = fh->ov.w.height;
+ btv->init.width = fh->ov.w.width;
+ btv->init.height = fh->ov.w.height;
}
return retval;
}
@@ -2120,10 +2156,10 @@
}
if (NULL == fmt)
goto fh_unlock_and_return;
- fh->ovfmt = fmt;
- fh->buf.fmt = fmt;
- btv->init.ovfmt = fmt;
- btv->init.buf.fmt = fmt;
+ fh->ovfmt = fmt;
+ fh->fmt = fmt;
+ btv->init.ovfmt = fmt;
+ btv->init.fmt = fmt;
} else {
if (15 == fbuf->depth)
fbuf->depth = 16;
@@ -2266,11 +2302,6 @@
case VIDIOCSAUDIO:
return bttv_common_ioctls(btv,cmd,arg);
- /* vbi/teletext ioctls */
- case BTTV_VBISIZE:
- bttv_switch_type(fh,V4L2_BUF_TYPE_VBI_CAPTURE);
- return fh->lines * 2 * 2048;
-
/* *** v4l2 *** ************************************************ */
case VIDIOC_QUERYCAP:
{
@@ -2295,8 +2326,24 @@
case VIDIOC_ENUM_FMT:
{
struct v4l2_fmtdesc *f = arg;
+ enum v4l2_buf_type type;
int i, index;
+ type = f->type;
+ if (V4L2_BUF_TYPE_VBI_CAPTURE == type) {
+ /* vbi */
+ index = f->index;
+ if (0 != index)
+ return -EINVAL;
+ memset(f,0,sizeof(*f));
+ f->index = index;
+ f->type = type;
+ f->pixelformat = V4L2_PIX_FMT_GREY;
+ strcpy(f->description,"vbi data");
+ return 0;
+ }
+
+ /* video capture + overlay */
index = -1;
for (i = 0; i < BTTV_FORMATS; i++) {
if (bttv_formats[i].fourcc != -1)
@@ -2318,9 +2365,10 @@
return -EINVAL;
}
memset(f,0,sizeof(*f));
- f->index = index;
- strncpy(f->description,bttv_formats[i].name,31);
+ f->index = index;
+ f->type = type;
f->pixelformat = bttv_formats[i].fourcc;
+ strncpy(f->description,bttv_formats[i].name,31);
return 0;
}
@@ -2438,7 +2486,6 @@
if (!check_alloc_btres(btv,fh,res))
return -EBUSY;
- bttv_field_count(btv);
return videobuf_streamon(file,bttv_queue(fh));
}
case VIDIOC_STREAMOFF:
@@ -2449,7 +2496,6 @@
if (retval < 0)
return retval;
free_btres(btv,fh,res);
- bttv_field_count(btv);
return 0;
}
@@ -2540,7 +2586,15 @@
static int bttv_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
- return video_usercopy(inode, file, cmd, arg, bttv_do_ioctl);
+ struct bttv_fh *fh = file->private_data;
+
+ switch (cmd) {
+ case BTTV_VBISIZE:
+ bttv_switch_type(fh,V4L2_BUF_TYPE_VBI_CAPTURE);
+ return fh->lines * 2 * 2048;
+ default:
+ return video_usercopy(inode, file, cmd, arg, bttv_do_ioctl);
+ }
}
static ssize_t bttv_read(struct file *file, char *data,
@@ -2561,6 +2615,8 @@
retval = videobuf_read_one(file, &fh->cap, data, count, ppos);
break;
case V4L2_BUF_TYPE_VBI_CAPTURE:
+ if (!check_alloc_btres(fh->btv,fh,RESOURCE_VBI))
+ return -EBUSY;
retval = videobuf_read_stream(file, &fh->vbi, data, count, ppos, 1);
break;
default:
@@ -2574,8 +2630,11 @@
struct bttv_fh *fh = file->private_data;
struct bttv_buffer *buf;
- if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type)
+ if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) {
+ if (!check_alloc_btres(fh->btv,fh,RESOURCE_VBI))
+ return -EBUSY;
return videobuf_poll_stream(file, &fh->vbi, wait);
+ }
if (check_btres(fh,RESOURCE_VIDEO)) {
/* streaming capture */
@@ -2596,7 +2655,7 @@
up(&fh->cap.lock);
return POLLERR;
}
- if (0 != fh->cap.ops->buf_prepare(file,fh->cap.read_buf)) {
+ if (0 != fh->cap.ops->buf_prepare(file,fh->cap.read_buf,fh->cap.field)) {
up(&fh->cap.lock);
return POLLERR;
}
@@ -2652,14 +2711,18 @@
videobuf_queue_init(&fh->cap, &bttv_video_qops,
btv->dev, &btv->s_lock,
V4L2_BUF_TYPE_VIDEO_CAPTURE,
+ V4L2_FIELD_INTERLACED,
sizeof(struct bttv_buffer));
videobuf_queue_init(&fh->vbi, &bttv_vbi_qops,
btv->dev, &btv->s_lock,
V4L2_BUF_TYPE_VBI_CAPTURE,
+ V4L2_FIELD_SEQ_TB,
sizeof(struct bttv_buffer));
-
i2c_vidiocschan(btv);
- return 0;
+
+ btv->users++;
+ bttv_field_count(btv);
+ return 0;
}
static int bttv_release(struct inode *inode, struct file *file)
@@ -2667,7 +2730,7 @@
struct bttv_fh *fh = file->private_data;
struct bttv *btv = fh->btv;
- /* turn off overlay, stop outstanding captures */
+ /* turn off overlay */
if (check_btres(fh, RESOURCE_OVERLAY))
bttv_switch_overlay(btv,fh,NULL);
@@ -2675,7 +2738,6 @@
if (check_btres(fh, RESOURCE_VIDEO)) {
videobuf_streamoff(file,&fh->cap);
free_btres(btv,fh,RESOURCE_VIDEO);
- bttv_field_count(btv);
}
if (fh->cap.read_buf) {
buffer_release(file,fh->cap.read_buf);
@@ -2683,13 +2745,19 @@
}
/* stop vbi capture */
- if (fh->vbi.streaming)
- videobuf_streamoff(file,&fh->vbi);
- if (fh->vbi.reading)
- videobuf_read_stop(file,&fh->vbi);
+ if (check_btres(fh, RESOURCE_VBI)) {
+ if (fh->vbi.streaming)
+ videobuf_streamoff(file,&fh->vbi);
+ if (fh->vbi.reading)
+ videobuf_read_stop(file,&fh->vbi);
+ free_btres(btv,fh,RESOURCE_VBI);
+ }
file->private_data = NULL;
kfree(fh);
+
+ btv->users--;
+ bttv_field_count(btv);
return 0;
}
@@ -2719,7 +2787,7 @@
static struct video_device bttv_video_template =
{
.name = "UNSET",
- .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_OVERLAY|
+ type: VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_OVERLAY|
VID_TYPE_CLIPPING|VID_TYPE_SCALES,
.hardware = VID_HARDWARE_BT848,
.fops = &bttv_fops,
@@ -2965,6 +3033,7 @@
{
struct bttv_buffer *o_bottom,*o_top,*o_vcurr;
struct bttv_buffer *capture;
+ dma_addr_t rc;
int irqflags = 0;
struct timeval ts;
@@ -3032,9 +3101,17 @@
}
if (irq_debug)
- printk(KERN_DEBUG
- "bttv: irq top=%p bottom=%p screen=%p vbi=%p\n",
- btv->top,btv->bottom,btv->screen,btv->vcurr);
+ printk(KERN_DEBUG "bttv%d: irq top=0x%08x bottom=0x%08x"
+ " vbi=0x%08x/0x%08x\n", btv->nr,
+ btv->top ? btv->top->top.dma : 0,
+ btv->bottom ? btv->bottom->bottom.dma : 0,
+ btv->vcurr ? btv->vcurr->top.dma : 0,
+ btv->vcurr ? btv->vcurr->bottom.dma : 0);
+
+ rc = btread(BT848_RISC_COUNT);
+ if (rc < btv->main.dma || rc > btv->main.dma + 0x100)
+ printk("bttv%d: Huh? IRQ latency? main=0x%x rc=0x%x\n",
+ btv->nr,btv->main.dma,rc);
/* activate new fields */
bttv_buffer_activate(btv,btv->top,btv->bottom);
@@ -3270,11 +3347,6 @@
goto fail1;
}
- if (-1 != latency) {
- printk(KERN_INFO "bttv%d: setting pci latency timer to %d\n",
- bttv_num,latency);
- pci_write_config_byte(dev, PCI_LATENCY_TIMER, latency);
- }
pci_read_config_byte(dev, PCI_CLASS_REVISION, &btv->revision);
pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat);
printk(KERN_INFO "bttv%d: Bt%d (rev %d) at %s, ",
@@ -3315,14 +3387,13 @@
btv->opt_adc_crush = adc_crush;
/* fill struct bttv with some useful defaults */
- btv->init.btv = btv;
- btv->init.ov.w.width = 320;
- btv->init.ov.w.height = 240;
- btv->init.buf.fmt = format_by_palette(VIDEO_PALETTE_RGB24);
- btv->init.buf.vb.width = 320;
- btv->init.buf.vb.height = 240;
- btv->init.buf.vb.field = V4L2_FIELD_BOTTOM;
- btv->init.lines = 16;
+ btv->init.btv = btv;
+ btv->init.ov.w.width = 320;
+ btv->init.ov.w.height = 240;
+ btv->init.fmt = format_by_palette(VIDEO_PALETTE_RGB24);
+ btv->init.width = 320;
+ btv->init.height = 240;
+ btv->init.lines = 16;
btv->input = 0;
/* initialize hardware */
@@ -3341,7 +3412,7 @@
/* interrupt */
btwrite(0xfffffUL, BT848_INT_STAT);
btwrite((btv->triton1) |
- BT848_INT_GPINT|
+ (gpint ? BT848_INT_GPINT : 0) |
BT848_INT_SCERR|
(fdsr ? BT848_INT_FDSR : 0) |
BT848_INT_RISCI|BT848_INT_OCERR|BT848_INT_VPRES|
--- linux-2.5.54/drivers/media/video/bttv-if.c 2003-01-08 10:33:57.000000000 +0100
+++ linux/drivers/media/video/bttv-if.c 2003-01-08 10:59:58.000000000 +0100
@@ -54,7 +54,7 @@
/* gpio ports (IR for example) */
/* see bttv.h for comments */
-int bttv_get_cardinfo(unsigned int card, int *type, int *cardid)
+int bttv_get_cardinfo(unsigned int card, int *type, unsigned *cardid)
{
if (card >= bttv_num) {
return -1;
@@ -194,6 +194,7 @@
return state;
}
+
static int attach_inform(struct i2c_client *client)
{
struct bttv *btv = (struct bttv*)client->adapter->data;
@@ -262,7 +263,7 @@
};
static struct i2c_adapter bttv_i2c_adap_template = {
- .owner = THIS_MODULE,
+ .owner = THIS_MODULE,
.name = "bt848",
.id = I2C_HW_B_BT848,
.client_register = attach_inform,
--- linux-2.5.54/drivers/media/video/bttv-risc.c 2003-01-08 10:34:29.000000000 +0100
+++ linux/drivers/media/video/bttv-risc.c 2003-01-08 10:59:58.000000000 +0100
@@ -453,7 +453,7 @@
int totalwidth = tvnorm->totalwidth;
int scaledtwidth = tvnorm->scaledtwidth;
- if (btv->digital_video) {
+ if (bttv_tvcards[btv->type].muxsel[btv->input] < 0) {
swidth = 720;
totalwidth = 858;
scaledtwidth = 858;
@@ -764,15 +764,15 @@
case V4L2_FIELD_INTERLACED:
bttv_calc_geo(btv,&buf->geo,buf->vb.width,
buf->vb.height,1,buf->tvnorm);
- lines = buf->vb.height >> 1;
- ypadding = buf->vb.width;
+ lines = buf->vb.height >> 1;
+ ypadding = buf->vb.width;
cpadding = buf->vb.width >> buf->fmt->hshift;
bttv_risc_planar(btv,&buf->top,
buf->vb.dma.sglist,
0,buf->vb.width,ypadding,lines,
uoffset,voffset,
buf->fmt->hshift,
- buf->fmt->vshift >> 1,
+ buf->fmt->vshift,
cpadding);
bttv_risc_planar(btv,&buf->bottom,
buf->vb.dma.sglist,
@@ -780,7 +780,7 @@
uoffset+cpadding,
voffset+cpadding,
buf->fmt->hshift,
- buf->fmt->vshift >> 1,
+ buf->fmt->vshift,
cpadding);
break;
default:
--- linux-2.5.54/drivers/media/video/bttv-vbi.c 2003-01-08 10:34:39.000000000 +0100
+++ linux/drivers/media/video/bttv-vbi.c 2003-01-08 10:59:58.000000000 +0100
@@ -65,14 +65,17 @@
static int vbi_buffer_setup(struct file *file, int *count, int *size)
{
struct bttv_fh *fh = file->private_data;
+ struct bttv *btv = fh->btv;
if (0 == *count)
*count = vbibufs;
*size = fh->lines * 2 * 2048;
+ dprintk("setup: lines=%d\n",fh->lines);
return 0;
}
-static int vbi_buffer_prepare(struct file *file, struct videobuf_buffer *vb)
+static int vbi_buffer_prepare(struct file *file, struct videobuf_buffer *vb,
+ enum v4l2_field field)
{
struct bttv_fh *fh = file->private_data;
struct bttv *btv = fh->btv;
@@ -90,8 +93,10 @@
goto fail;
}
buf->vb.state = STATE_PREPARED;
- dprintk("buf prepare %p: top=%p bottom=%p\n",
- vb,&buf->top,&buf->bottom);
+ buf->vb.field = field;
+ dprintk("buf prepare %p: top=%p bottom=%p field=%s\n",
+ vb, &buf->top, &buf->bottom,
+ v4l2_field_names[buf->vb.field]);
return 0;
fail:
--- linux-2.5.54/drivers/media/video/bttv.h 2003-01-08 10:33:58.000000000 +0100
+++ linux/drivers/media/video/bttv.h 2003-01-08 10:59:58.000000000 +0100
@@ -90,6 +90,7 @@
#define BTTV_SENSORAY311 0x49
#define BTTV_RV605 0x4a
#define BTTV_WINDVR 0x4c
+#define BTTV_KWORLD 0x4e
#define BTTV_HAUPPAUGEPVR 0x50
#define BTTV_GVBCTV5PCI 0x51
#define BTTV_OSPREY1x0 0x52
@@ -104,6 +105,9 @@
#define BTTV_OSPREY540 0x5b
#define BTTV_OSPREY2000 0x5c
#define BTTV_IDS_EAGLE 0x5d
+#define BTTV_PINNACLESAT 0x5e
+#define BTTV_FORMAC_PROTV 0x5f
+#define BTTV_EURESYS_PICOLO 0x61
/* i2c address list */
#define I2C_TSA5522 0xc2
@@ -132,6 +136,10 @@
#define WINVIEW_PT2254_DATA 0x20
#define WINVIEW_PT2254_STROBE 0x80
+/* digital_mode */
+#define DIGITAL_MODE_VIDEO 1
+#define DIGITAL_MODE_CAMERA 2
+
struct bttv;
struct tvcard
@@ -141,6 +149,7 @@
int audio_inputs;
int tuner;
int svhs;
+ int digital_mode; // DIGITAL_MODE_CAMERA or DIGITAL_MODE_VIDEO
u32 gpiomask;
u32 muxsel[16];
u32 audiomux[6]; /* Tuner, Radio, external, internal, mute, stereo */
@@ -191,7 +200,8 @@
for possible values see lines below beginning with #define BTTV_UNKNOWN
returns negative value if error occurred
*/
-extern int bttv_get_cardinfo(unsigned int card, int *type, int *cardid);
+extern int bttv_get_cardinfo(unsigned int card, int *type,
+ unsigned int *cardid);
extern struct pci_dev* bttv_get_pcidev(unsigned int card);
/* obsolete, use bttv_get_cardinfo instead */
--- linux-2.5.54/drivers/media/video/bttvp.h 2003-01-08 10:34:21.000000000 +0100
+++ linux/drivers/media/video/bttvp.h 2003-01-08 10:59:58.000000000 +0100
@@ -24,7 +24,7 @@
#ifndef _BTTVP_H_
#define _BTTVP_H_
-#define BTTV_VERSION_CODE KERNEL_VERSION(0,9,1)
+#define BTTV_VERSION_CODE KERNEL_VERSION(0,9,4)
#include <linux/types.h>
#include <linux/wait.h>
@@ -55,7 +55,7 @@
#define RESOURCE_OVERLAY 1
#define RESOURCE_VIDEO 2
-#define RESOURCE_VBI 3
+#define RESOURCE_VBI 4
#define RAW_LINES 640
#define RAW_BPL 1024
@@ -136,7 +136,10 @@
/* video capture */
struct videobuf_queue cap;
- struct bttv_buffer buf;
+ /* struct bttv_buffer buf; */
+ const struct bttv_format *fmt;
+ int width;
+ int height;
/* current settings */
const struct bttv_format *ovfmt;
@@ -255,7 +258,7 @@
/* card configuration info */
unsigned int nr; /* dev nr (for printk("bttv%d: ..."); */
char name[8]; /* dev name */
- int cardid; /* pci subsystem id (bt878 based ones) */
+ unsigned int cardid; /* pci subsystem id (bt878 based ones) */
int type; /* card type (pointer into tvcards[]) */
int tuner_type; /* tuner chip type */
struct bttv_pll_info pll;
@@ -291,7 +294,6 @@
int tvnorm,hue,contrast,bright,saturation;
struct video_buffer fbuf;
int field_count;
- int digital_video;
/* various options */
int opt_combfilter;
@@ -334,7 +336,7 @@
struct timer_list timeout;
int errors;
- int user;
+ int users;
struct bttv_fh init;
};
--
Weil die späten Diskussionen nicht mal mehr den Rotwein lohnen.
-- Wacholder in "Melanie"
^ permalink raw reply
* [PATCH][COMPAT] {get,put}_compat_timspec 4/8 x86_64
From: Stephen Rothwell @ 2003-01-08 11:53 UTC (permalink / raw)
To: ak; +Cc: torvalds, linux-kernel
In-Reply-To: <20030108223744.0c4856b7.sfr@canb.auug.org.au>
Hi Andi,
You asked for it ... x86_64 part.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN 2.5.54-200301081106-32bit.2/arch/x86_64/ia32/ipc32.c 2.5.54-200301081106-32bit.3/arch/x86_64/ia32/ipc32.c
--- 2.5.54-200301081106-32bit.2/arch/x86_64/ia32/ipc32.c 2003-01-08 11:40:39.000000000 +1100
+++ 2.5.54-200301081106-32bit.3/arch/x86_64/ia32/ipc32.c 2003-01-08 16:43:42.000000000 +1100
@@ -626,9 +626,7 @@
return -E2BIG;
if (!access_ok(VERIFY_READ, sb, nsops * sizeof(struct sembuf)))
return -EFAULT;
- if (ts32 &&
- (get_user(ts.tv_sec, &ts32->tv_sec) ||
- __get_user(ts.tv_nsec, &ts32->tv_nsec)))
+ if (ts32 && get_compat_timespec(&ts, ts32))
return -EFAULT;
set_fs(KERNEL_DS);
diff -ruN 2.5.54-200301081106-32bit.2/arch/x86_64/ia32/sys_ia32.c 2.5.54-200301081106-32bit.3/arch/x86_64/ia32/sys_ia32.c
--- 2.5.54-200301081106-32bit.2/arch/x86_64/ia32/sys_ia32.c 2003-01-08 11:40:39.000000000 +1100
+++ 2.5.54-200301081106-32bit.3/arch/x86_64/ia32/sys_ia32.c 2003-01-08 17:19:37.000000000 +1100
@@ -1271,9 +1271,7 @@
set_fs (KERNEL_DS);
ret = sys_sched_rr_get_interval(pid, &t);
set_fs (old_fs);
- if (verify_area(VERIFY_WRITE, interval, sizeof(struct compat_timespec)) ||
- __put_user (t.tv_sec, &interval->tv_sec) ||
- __put_user (t.tv_nsec, &interval->tv_nsec))
+ if (put_compat_timespec(&t, interval))
return -EFAULT;
return ret;
}
@@ -1440,14 +1438,11 @@
case 2: s.sig[1] = s32.sig[2] | (((long)s32.sig[3]) << 32);
case 1: s.sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32);
}
- if (uts) {
- if (verify_area(VERIFY_READ, uts, sizeof(struct compat_timespec)) ||
- __get_user (t.tv_sec, &uts->tv_sec) ||
- __get_user (t.tv_nsec, &uts->tv_nsec))
- return -EFAULT;
- }
+ if (uts && get_compat_timespec(&t, uts))
+ return -EFAULT;
set_fs (KERNEL_DS);
- ret = sys_rt_sigtimedwait(&s, &info, &t, sigsetsize);
+ ret = sys_rt_sigtimedwait(&s, uinfo ? &info : NULL, uts ? &t : NULL,
+ sigsetsize);
set_fs (old_fs);
if (ret >= 0 && uinfo) {
if (copy_to_user (uinfo, siginfo64to32(&info32, &info),
@@ -2300,20 +2295,13 @@
mm_segment_t oldfs = get_fs();
int err;
- if (utime32) {
- if (verify_area(VERIFY_READ, utime32, sizeof(*utime32)))
- return -EFAULT;
-
- if (__get_user(t.tv_sec, &utime32->tv_sec) ||
- __get_user(t.tv_nsec, &utime32->tv_nsec))
- return -EFAULT;
-
- }
+ if (utime32 && get_compat_timespec(&t, utime32))
+ return -EFAULT;
/* the set_fs is safe because futex doesn't use the seg limit
for valid page checking of uaddr. */
set_fs(KERNEL_DS);
- err = sys_futex(uaddr, op, val, &t);
+ err = sys_futex(uaddr, op, val, utime32 ? &t : NULL);
set_fs(oldfs);
return err;
}
@@ -2392,22 +2380,18 @@
{
long ret;
mm_segment_t oldfs;
- struct timespec t32;
+ struct timespec t;
/* Harden against bogus ptrace */
if (nr >= 0xffffffff ||
!access_ok(VERIFY_WRITE, events, nr * sizeof(struct io_event)))
return -EFAULT;
- if (timeout &&
- (get_user(t32.tv_sec, &timeout->tv_sec) ||
- __get_user(t32.tv_nsec, &timeout->tv_nsec)))
+ if (timeout && get_compat_timespec(&t, timeout))
return -EFAULT;
oldfs = get_fs();
set_fs(KERNEL_DS);
- ret = sys_io_getevents(ctx_id,min_nr,nr,events,timeout ? &t32 : NULL);
+ ret = sys_io_getevents(ctx_id,min_nr,nr,events,timeout ? &t : NULL);
set_fs(oldfs);
- if (timeout &&
- (__put_user(t32.tv_sec, &timeout->tv_sec) ||
- __put_user(t32.tv_nsec, &timeout->tv_nsec)))
+ if (timeout && put_compat_timespec(&t, timeout))
return -EFAULT;
return ret;
}
^ permalink raw reply
* Re: Why is Nvidia given GPL'd code to use in closed source drivers?
From: Bill Huey @ 2003-01-08 11:53 UTC (permalink / raw)
To: Richard Stallman; +Cc: mark, lm, linux-kernel, paul, riel, Bill Huey (Hui)
In-Reply-To: <E18WB8Q-0004k6-00@fencepost.gnu.org>
On Wed, Jan 08, 2003 at 03:00:22AM -0500, Richard Stallman wrote:
> activistic political structure to bind a project like this, but
> the successful execution of Linux as a large scale political,
> social and economic product (credit to folks like Linus, Alan Cox,
> Stephen Tweedie, etc...)
>
> When you say "Linux" here, do you mean the kernel, or the whole
> GNU/Linux system? With all due respect, I think you may not have
Linux itself, yes, it's definitely a special project in the context of
GNU and deserve to have it's identity preserved even outside of the
main core of GNU/GPL. It's special case all around.
> answered this question for yourself, because the people that you name
> are people who worked on the kernel, but the success that you talk
> about is the success of the whole system. (No kernel alone could have
> had this effect.)
Those folks were on the forefront of this and have special historical
status as a result of this.
> Like any community, it contains people with different views. Nowadays
> many of the people in our community support the open source movement.
> The open source advocates are legitimate members of the community, and
> some have contributed to it. They have a right to form a movement to
> promote their views, but that movement was started only in 1998, long
> after the community existed. Their movement did not build the
> community, and it should not be named after them.
Yes, but they were on the forefront of this and have special status and
should be held seperate from GNU/GPL itself.
> Speaking of which, your ideas seem to have a lot in common with the
> free software movement. I wonder if you thought that the open source
> movement was the only one and that we all support it. (Many
> inaccurate articles give that impression.) If you read about the free
> software movement, you might decide we are closer to your views.
The difference that respect about this project is that, although it's
has GPL roots, it has been a refactoring foundation for the entire
open source community. The rules were rewritten after the success of
this project. It's not ment to be a disrespect to you and what you've
done certainly, but it's definitely smashed the scale and scope
of free software projects.
Like when Metallica hit the Metal scene in 1984, it was a bit sterile
prior to that. :)
> See http://www.gnu.org/philosophy/, and in particular
> http://www.gnu.org/philosophy/free-software-for-freedom.html for an
> explanation of the difference between the two movements. We and they
> have similar practices, which is why we and they can work together
> some of the time, but what we say about it is very different from
> what they say.
I'll read it again. :)
bill
^ permalink raw reply
* How to route "spdif" to an FXBUS of emu10k1
From: Gerard Janssen @ 2003-01-08 11:47 UTC (permalink / raw)
To: alsa-devel
Hi,
By making slight changes in emufx.c, I could use all four spdif stereo
channels of the sblive! that are present on the audio-ext connector. These
spdif0..3 outputs can be accessed via: EXTOUT_TOSLINK_L,R ;
EXTOUT_HEADPHONE_L,R ; EXTOUT_REAR_L,R and EXTOUT_CENTER,LFE. By re-routing
"spdif", "front", "rear" and "center_lfe" to the respective outputs, four
stereo signals (8 channels) can be simultaneously send to these outputs.
The "front", "rear" and "center_lfe" signals are alsmost perfectly
synchronized (within a few samples) and the small delays are constant.
However, the signal via "spdif" is not: its delay w.r.t. the other signals
is about 60 samples and changes randomly every time the application is
started.
The "spdif" signal is taken from GPR(8) and GPR(9) in emufx.c. As far as I
could backtrace these signals come from etram, which probably is the cause
of the random delay.
A solution might be to put the "spdif" also directly in two FXBUS registers
(there are still 6 free FXBUS registers), as is done with the other
signals. However, I don't know how to do this.
I would appreciate any help or suggestions in routing "spdif" to an FXBUS.
Thanks,
Gerard Janssen
**********************************************************************
Dr.ir. Gerard J.M. Janssen
Delft University of Technology
Faculty of Information Technology and Systems (ITS)
Wireless Mobile Communications Group
P.O. Box 5031, 2600 GA Delft, The Netherlands
Phone +31-15-2786736, Fax +31-15-2781774
E-mail G.Janssen@ITS.TUDelft.NL
**********************************************************************
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
^ permalink raw reply
* lsscsi-0.03
From: Douglas Gilbert @ 2003-01-08 11:46 UTC (permalink / raw)
To: linux-scsi
lsscsi is a utility the uses sysfs in kernels >= lk 2.5.50
to list information about all SCSI devices (including devices
that use the SCSI stack such as USB mass storage devices).
Both a compact format (default), one line per device, and
a "classic" format (like the output of 'cat /proc/scsi/scsi')
are supported.
A '-g' switch has been added in version 0.03 to show the
corresponding scsi generic device name:
$ lsscsi
[0:0:1:0] disk FUJITSU MAM3184MP 0105 /dev/sda
[2:0:0:0] CDROM CREATIVE CD5233E 1.00 /dev/sr0
$ lsscsi -g
[0:0:1:0] disk FUJITSU MAM3184MP 0105 /dev/sda /dev/sg0
[2:0:0:0] CDROM CREATIVE CD5233E 1.00 /dev/sr0 /dev/sg1
Patrick Mansfield's patch to output the scsi_level in
"classic" mode is also included. The scsi_level is also
output with the '-l' switch. [Until Patrick's kernel
patch for sysfs to output scsi_level gets into the kernel,
the ANSI SCSI revision will appear as "?".]
See http://www.torque.net/scsi/lsscsi.html for more information
and downloads.
Doug Gilbert
^ permalink raw reply
* Re: /var/lib/nfs/sm/ files
From: Christian Reis @ 2003-01-08 11:50 UTC (permalink / raw)
To: Trond Myklebust; +Cc: NFS, linux-kernel
In-Reply-To: <shsn0mcj3x8.fsf@charged.uio.no>
On Tue, Jan 07, 2003 at 05:54:59PM +0100, Trond Myklebust wrote:
> >>>>> " " == Christian Reis <kiko@async.com.br> writes:
>
> > Hi there,
>
> > Can `anybody' (Neil, Trond?) explain what the entries in
> > /var/lib/nfs/sm/ are for? If they refer to file locks, can we
>
> 'man rpc.statd'. Those files store the IP-addresses of the machines
> being monitored by statd. In case of a crash or a reboot, those files
> tell statd which machines that need to be notified.
Thanks. So my questions are related to what `monitored by statd' means:
- Why don't all the diskless workstations get an entry in that
directory while they are running? Right now I have 5 running, and
only one has an entry there.
- Why do most entries' mtime get updated periodically, but a few of
the entries go stale with time?
- Why do some of the stale entries get left over even after the
workstations have halted (these ones present the nfs hang issue)?
Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
^ permalink raw reply
* ASSISTANCE NEEDED
From: ademola1950 @ 2003-01-08 11:21 UTC (permalink / raw)
To: ademola1950
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2810 bytes --]
BENSON ADEMOLA
ademola.benson@caramail.com
Dear Sir,
With profound interest and in utmost confidence, I am
soliciting your immediate assistance or co-operation
as to enable us round up an opportunity within my
capability as a result of the death of one of our
contractor (Beneficiary).
I am Ademola Benson, Chief Auditor, Special Project
and Foreign Contract Regularization and Disbursement,
in the Office of the Auditor General of the Federation
of Federal Republic of Nigeria. We work in hand with
the Senate Committee on Foreign Contract Payment. Our
duty is to ensure that all contractors are paid
their contract sum in due time.
This last payment quarter, a total of 30 contractors
were short listed for payment and about 25 of them
have been paid remaining about 5 (Five), information
reaching this office indicates that one among the
remaining has been reported dead. His name is Mr.
Gerrand Schwartz from Sweden, he died in the last Air
France Concorde plane crash. Meanwhile he finished the
execution of his contract December 19th 1999. But
since his death, nobody has come forward to put a
claim to his contract fund which is about
US$7,500,000.00 Million (seven Million five hundred
thousand U.S Dollars) that is why I need your
immediate assistance to expedite the transfer of the
contract amount.
With my position as a Director in the Department of
Contract Regularisation and Disbursement, I will
regularize all the necessary documents and present
your company as the bona-fide beneficiary of this fund
in as much as you respond within 48 hours for
respect of this important message. Your unreserved
cooperation in this business is just what we require
for a successful and hitch free transaction.
Necessary measures to ensure a risk free and fool
proof transaction and confidentiality has been taken.
Kindly signify your interest by replying via my
personal e mail address above. Upon receipt of your
positive reply we shall discuss on (1) Basic Program
for Operation (2) Financial Status as to ascertain
your capability. Upon completion of this transaction
I have decided to give you 30% of the total sum, 60%
of the fund which is our share will be used for
investment in any foreign country of our choice.
While 10% has been mapped out to take care
of any minor expenses incurred.
Take note that this project will last for only 10
working days.
I expect your response in time (within 48 hours) as
time is of great essence in this transaction.
God Bless and Kind Regards,
Ademola Benson.
Please you may also reach me with this email address benson.ademola@caramail.com
--------------------------------------------------
This email is a free service of Phantom Email
available at http://phantomemail.com/.
Looking for a date? Check out http://personalinteractions.com/go/p185.
^ permalink raw reply
* Re: OT: curious about eth0/eth1
From: Maciej Soltysiak @ 2003-01-08 11:40 UTC (permalink / raw)
To: Tommy McNeely; +Cc: netfilter
In-Reply-To: <6620000.1041983993@leverage>
> Again.. I am just curious as to why some do it one way.. and some the
> other... the above is only MY opinion, and could be dreadfully wrong :)
Well, i never care for which is internal or external, sometimes i set up
eth1 as external, sometimes it's eth0 or ppp0. What is funny,
on my experimentalbox i have the network with default route on eth1, and
eth0 is connected to a roaming port in a 3com corebuilder (== i get a copy
of the whole Internet<->LAN traffic), it's unusual, and i very often have
to reconfigure programs that make this assumption that eth0 is the
Internet interface.
I take it as totally free to choose, and propably random.
Anyway i alwyas refer to interfaces as EXT, INT, not their names.
Regards,
Maciej Soltysiak
^ permalink raw reply
* [PATCH][COMPAT] {get,put}_compat_timspec 3/8 sparc64
From: Stephen Rothwell @ 2003-01-08 11:44 UTC (permalink / raw)
To: davem; +Cc: torvalds, linux-kernel
In-Reply-To: <20030108223744.0c4856b7.sfr@canb.auug.org.au>
Hi Dave,
sparc 64 part. This is relative to the previous patches I have sent you.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN 2.5.54-200301081106-32bit.2/arch/sparc64/kernel/sys_sparc32.c 2.5.54-200301081106-32bit.3/arch/sparc64/kernel/sys_sparc32.c
--- 2.5.54-200301081106-32bit.2/arch/sparc64/kernel/sys_sparc32.c 2003-01-08 11:40:38.000000000 +1100
+++ 2.5.54-200301081106-32bit.3/arch/sparc64/kernel/sys_sparc32.c 2003-01-08 17:15:17.000000000 +1100
@@ -1729,8 +1729,7 @@
set_fs (KERNEL_DS);
ret = sys_sched_rr_get_interval(pid, &t);
set_fs (old_fs);
- if (put_user (t.tv_sec, &interval->tv_sec) ||
- __put_user (t.tv_nsec, &interval->tv_nsec))
+ if (put_compat_timespec(&t, interval))
return -EFAULT;
return ret;
}
@@ -1861,8 +1860,7 @@
signotset(&these);
if (uts) {
- if (get_user (ts.tv_sec, &uts->tv_sec) ||
- get_user (ts.tv_nsec, &uts->tv_nsec))
+ if (get_compat_timespec(&ts, uts))
return -EINVAL;
if (ts.tv_nsec >= 1000000000L || ts.tv_nsec < 0
|| ts.tv_sec < 0)
^ permalink raw reply
* [PATCH][COMPAT] {get,put}_compat_timspec 2/8 ppc64
From: Stephen Rothwell @ 2003-01-08 11:41 UTC (permalink / raw)
To: anton; +Cc: torvalds, linux-kernel
In-Reply-To: <20030108223744.0c4856b7.sfr@canb.auug.org.au>
Hi Anton,
The ppc64 part. This is relative to my previous patches.
This patch also fixes a strange bit of code in sys32_rt_sigtimedwait.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN 2.5.54-200301081106-32bit.2/arch/ppc64/kernel/signal32.c 2.5.54-200301081106-32bit.3/arch/ppc64/kernel/signal32.c
--- 2.5.54-200301081106-32bit.2/arch/ppc64/kernel/signal32.c 2003-01-08 11:40:34.000000000 +1100
+++ 2.5.54-200301081106-32bit.3/arch/ppc64/kernel/signal32.c 2003-01-08 17:17:13.000000000 +1100
@@ -720,18 +720,11 @@
case 2: s.sig[1] = s32.sig[2] | (((long)s32.sig[3]) << 32);
case 1: s.sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32);
}
- if (uts) {
- ret = get_user(t.tv_sec, &uts->tv_sec);
- ret |= __get_user(t.tv_nsec, &uts->tv_nsec);
- if (ret)
- return -EFAULT;
- }
+ if (uts && get_compat_timespec(&t, uts))
+ return -EFAULT;
set_fs(KERNEL_DS);
- if (uts)
- ret = sys_rt_sigtimedwait(&s, &info, &t, sigsetsize);
- else
- ret = sys_rt_sigtimedwait(&s, &info, (struct timespec *)uts,
- sigsetsize);
+ ret = sys_rt_sigtimedwait(&s, uinfo ? &info : NULL, uts ? &t : NULL,
+ sigsetsize);
set_fs(old_fs);
if (ret >= 0 && uinfo) {
if (copy_siginfo_to_user32(uinfo, &info))
diff -ruN 2.5.54-200301081106-32bit.2/arch/ppc64/kernel/sys_ppc32.c 2.5.54-200301081106-32bit.3/arch/ppc64/kernel/sys_ppc32.c
--- 2.5.54-200301081106-32bit.2/arch/ppc64/kernel/sys_ppc32.c 2003-01-08 11:40:35.000000000 +1100
+++ 2.5.54-200301081106-32bit.3/arch/ppc64/kernel/sys_ppc32.c 2003-01-08 17:17:55.000000000 +1100
@@ -3603,10 +3603,8 @@
set_fs (KERNEL_DS);
ret = sys_sched_rr_get_interval((int)pid, &t);
set_fs (old_fs);
- if (put_user (t.tv_sec, &interval->tv_sec) ||
- __put_user (t.tv_nsec, &interval->tv_nsec))
+ if (put_compat_timespec(&t, interval))
return -EFAULT;
-
return ret;
}
^ permalink raw reply
* [PATCH][COMPAT] {get,put}_compat_timspec 1/8 generic
From: Stephen Rothwell @ 2003-01-08 11:37 UTC (permalink / raw)
To: Linus; +Cc: LKML, anton, David S. Miller, ak, davidm, schwidefsky, ralf,
matthew
Hi Linus,
Andi Kleen asked for these two, so here they are. This is the generic
part of the patch. It is relative to 2.5.54 BK.
The diffstat for the total patch is:
arch/ia64/ia32/ia32_signal.c | 11 +++-------
arch/ia64/ia32/sys_ia32.c | 2 -
arch/mips64/kernel/linux32.c | 3 --
arch/parisc/kernel/sys_parisc32.c | 11 ----------
arch/ppc64/kernel/signal32.c | 15 +++-----------
arch/ppc64/kernel/sys_ppc32.c | 4 ---
arch/s390x/kernel/linux32.c | 11 +++-------
arch/sparc64/kernel/sys_sparc32.c | 6 +----
arch/x86_64/ia32/ipc32.c | 4 ---
arch/x86_64/ia32/sys_ia32.c | 40 +++++++++++---------------------------
include/linux/compat.h | 2 +
kernel/compat.c | 23 +++++++++++++++------
12 files changed, 49 insertions(+), 83 deletions(-)
One thing - would these be better as inline functions in linux/compat.h?
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN 2.5.54-200301081106-32bit.2/include/linux/compat.h 2.5.54-200301081106-32bit.3/include/linux/compat.h
--- 2.5.54-200301081106-32bit.2/include/linux/compat.h 2003-01-08 11:41:18.000000000 +1100
+++ 2.5.54-200301081106-32bit.3/include/linux/compat.h 2003-01-08 16:41:48.000000000 +1100
@@ -36,6 +36,8 @@
extern int cp_compat_stat(struct kstat *, struct compat_stat *);
extern int get_compat_flock(struct flock *, struct compat_flock *);
extern int put_compat_flock(struct flock *, struct compat_flock *);
+extern int get_compat_timespec(struct timespec *, struct compat_timespec *);
+extern int put_compat_timespec(struct timespec *, struct compat_timespec *);
#endif /* CONFIG_COMPAT */
#endif /* _LINUX_COMPAT_H */
diff -ruN 2.5.54-200301081106-32bit.2/kernel/compat.c 2.5.54-200301081106-32bit.3/kernel/compat.c
--- 2.5.54-200301081106-32bit.2/kernel/compat.c 2002-12-16 14:49:55.000000000 +1100
+++ 2.5.54-200301081106-32bit.3/kernel/compat.c 2003-01-08 16:39:44.000000000 +1100
@@ -18,6 +18,20 @@
#include <asm/uaccess.h>
+int get_compat_timespec(struct timespec *ts, struct compat_timespec *cts)
+{
+ return (verify_area(VERIFY_READ, cts, sizeof(*cts)) ||
+ __get_user(ts->tv_sec, &cts->tv_sec) ||
+ __get_user(ts->tv_nsec, &cts->tv_nsec)) ? -EFAULT : 0;
+}
+
+int put_compat_timespec(struct timespec *ts, struct compat_timespec *cts)
+{
+ return (verify_area(VERIFY_WRITE, cts, sizeof(*cts)) ||
+ __put_user(ts->tv_sec, &cts->tv_sec) ||
+ __put_user(ts->tv_nsec, &cts->tv_nsec)) ? -EFAULT : 0;
+}
+
static long compat_nanosleep_restart(struct restart_block *restart)
{
unsigned long expire = restart->arg0, now = jiffies;
@@ -50,15 +64,12 @@
asmlinkage long compat_sys_nanosleep(struct compat_timespec *rqtp,
struct compat_timespec *rmtp)
{
- struct compat_timespec ct;
struct timespec t;
struct restart_block *restart;
unsigned long expire;
- if (copy_from_user(&ct, rqtp, sizeof(ct)))
+ if (get_compat_timespec(&t, rqtp))
return -EFAULT;
- t.tv_sec = ct.tv_sec;
- t.tv_nsec = ct.tv_nsec;
if ((t.tv_nsec >= 1000000000L) || (t.tv_nsec < 0) || (t.tv_sec < 0))
return -EINVAL;
@@ -71,9 +82,7 @@
if (rmtp) {
jiffies_to_timespec(expire, &t);
- ct.tv_sec = t.tv_sec;
- ct.tv_nsec = t.tv_nsec;
- if (copy_to_user(rmtp, &ct, sizeof(ct)))
+ if (put_compat_timespec(&t, rmtp))
return -EFAULT;
}
restart = ¤t_thread_info()->restart_block;
^ permalink raw reply
* Re: ymfpci, big-endian, and spdif out
From: Jaroslav Kysela @ 2003-01-08 11:30 UTC (permalink / raw)
To: Troy Benjegerdes; +Cc: Takashi Iwai, alsa-devel@lists.sourceforge.net
In-Reply-To: <20030108053721.GC10119@kalmia.hozed.org>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 2177 bytes --]
On Tue, 7 Jan 2003, Troy Benjegerdes wrote:
> On Tue, Jan 07, 2003 at 05:02:53PM +0100, Takashi Iwai wrote:
> > At Thu, 2 Jan 2003 22:22:34 -0600,
> > Troy Benjegerdes wrote:
> > >
> > > I have a mac G4 (running debian testing), a ymfpci card (MaxiSound
> > > Fortissimo) with optical TOSlink out, and a yamaha HTR-5540 receiver with
> > > digital optical TOSlink input.
> > >
> > > I'm trying to get xine or some other DVD player to output AC/3 sound to
> > > the receiver for watching dvd's, and I have a couple of problems.
> > >
> > > 1) xmms (and xine 2-channel sound) works with OSS emulation, but is static
> > > with native ALSA drivers. This seems like some endian problem
> >
> > then most likely it's a bug of alsa output plugin.
>
> It seems the latest xmms source uses 'S16_NE' (which is S16_BE on
> big-endian platforms) as the pcm format, which works correctly.
>
> alsa-tools/acdec/output.c also has a problem.. it uses S16_LE on
> big-endian platforms.
>
> I am able to successfully open the SPDIF output and output *something*
> with a commandline like:
>
> ac3dec -D hw:0,0 -C THX.ac3
>
> However, the hardware decoder (yamaha receiver) is getting garbled data
> and plays what sounds like stacatto static.
>
> ac3dec -C THX.ac3 gives the following:
>
> Using PCM device 'iec958:AES0=0x2,AES1=0x82,AES2=0x0,AES3=0x2'
> ALSA lib pcm_hw.c:292:(snd_pcm_hw_hw_params) SNDRV_PCM_IOCTL_HW_PARAMS
> failed: No such device or address
> PCM hw_params failed: No such device or address
> Output open failed
>
> Another interesting bit...
> If I change S16_LE to S16_BE in output.c, now it works with regular 2
> channel audio, but anything with the '-C' option gives:
>
> Using PCM device 'hw:0,0'
> Sample format non availableOutput open failed
>
> Using PCM device 'iec958:AES0=0x2,AES1=0x82,AES2=0x0,AES3=0x2'
> Sample format non availableOutput open failed
>
>
> Should the alsa drive be able to byteswap SPDIF data??
There were a few bad assumtions in the spdif code. Could you try the
latest CVS code of ac3dec (or attached patch)?
Jaroslav
-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs
[-- Attachment #2: Type: TEXT/plain, Size: 3027 bytes --]
? out.txt
Index: ac3spdif.c
===================================================================
RCS file: /cvsroot/alsa/alsa-tools/ac3dec/ac3spdif.c,v
retrieving revision 1.3
diff -u -r1.3 ac3spdif.c
--- ac3spdif.c 6 Aug 2001 16:08:01 -0000 1.3
+++ ac3spdif.c 8 Jan 2003 11:28:48 -0000
@@ -154,7 +154,7 @@
done_banner = 1;
}
-#ifndef WORDS_BIGENDIAN
+#ifndef _a_b_c_d_e_f /* WORDS_BIGENDIAN */
// extract_ac3 seems to write swabbed data
swab(&buf[10], &buf[10], syncinfo.frame_size * 2 - 2);
#endif
Index: output.c
===================================================================
RCS file: /cvsroot/alsa/alsa-tools/ac3dec/output.c,v
retrieving revision 1.17
diff -u -r1.17 output.c
--- output.c 22 Oct 2002 18:01:16 -0000 1.17
+++ output.c 8 Jan 2003 11:28:48 -0000
@@ -41,6 +41,7 @@
char devstr[128];
snd_pcm_hw_params_t *params;
unsigned int rate, buffer_time, period_time, tmp;
+ snd_pcm_format_t format = output->bits == 16 ? SND_PCM_FORMAT_S16 : SND_PCM_FORMAT_U8;
int err, step;
snd_pcm_hw_params_alloca(¶ms);
@@ -76,6 +77,7 @@
sprintf(devstr, "iec958:AES0=0x%x,AES1=0x%x,AES2=0x%x,AES3=0x%x", s[0], s[1], s[2], s[3]);
if (out_config.card)
sprintf(devstr + strlen(devstr), ",CARD=%s", out_config.card);
+ format = SND_PCM_FORMAT_S16_LE;
} else {
if (out_config.card)
sprintf(devstr, "plughw:%s", out_config.card);
@@ -114,29 +116,29 @@
err = snd_pcm_hw_params_set_access(pcm, params,
SND_PCM_ACCESS_RW_INTERLEAVED);
if (err < 0) {
- fprintf(stderr, "Access type not available");
+ fprintf(stderr, "Access type not available\n");
goto __close;
}
- err = snd_pcm_hw_params_set_format(pcm, params, output->bits == 16 ? SND_PCM_FORMAT_S16_LE : SND_PCM_FORMAT_U8);
+ err = snd_pcm_hw_params_set_format(pcm, params, format);
if (err < 0) {
- fprintf(stderr, "Sample format non available");
+ fprintf(stderr, "Sample format non available\n");
goto __close;
}
err = snd_pcm_hw_params_set_channels(pcm, params, output->channels);
if (err < 0) {
- fprintf(stderr, "Channels count non available");
+ fprintf(stderr, "Channels count non available\n");
goto __close;
}
rate = output->rate;
err = snd_pcm_hw_params_set_rate_near(pcm, params, &rate, 0);
if (err < 0) {
- fprintf(stderr, "Rate not available");
+ fprintf(stderr, "Rate not available\n");
goto __close;
}
buffer_time = 500000;
err = snd_pcm_hw_params_set_buffer_time_near(pcm, params, &buffer_time, 0);
if (err < 0) {
- fprintf(stderr, "Buffer time not available");
+ fprintf(stderr, "Buffer time not available\n");
goto __close;
}
step = 2;
@@ -146,7 +148,7 @@
tmp = period_time;
err = snd_pcm_hw_params_set_period_time_near(pcm, params, &tmp, 0);
if (err < 0) {
- fprintf(stderr, "Period time not available");
+ fprintf(stderr, "Period time not available\n");
goto __close;
}
if (tmp == period_time) {
^ permalink raw reply
* Re: [PATCH][TRIVIAL] menuconfig color sanity
From: Dave Jones @ 2003-01-08 11:35 UTC (permalink / raw)
To: Marc-Christian Petersen; +Cc: linux-kernel, jeff gerard
In-Reply-To: <200301081205.04849.m.c.p@wolk-project.de>
On Wed, Jan 08, 2003 at 12:05:04PM +0100, Marc-Christian Petersen wrote:
> > using yellow and green text with a "white" background in menuconfig works
> > all right on console, but it looks like crap under xterm, rxvt, etc. no
> > matter whose fault that is, the trivial patch below makes things more
> > readable without any major change in appearance. applies to 2.4 and 2.5.
> > now you can stop wondering about support for "lug and play", "mateur
> > radio", and "elephony" in the linux kernel.
> huh? I can see Plug and Play, Amateur Radio and Telephony very well also in a
> XTERM etc. I don't know where you have any problems with those colors.
> Prolly your xterm etc. are faulty ;)
Different monitors, different graphic cards, different eyes.
All these things offer variation in colour, and yellow text
on a light grey background wasn't exactly a wise choice from
a readability point of view.
Dave
--
| Dave Jones. http://www.codemonkey.org.uk
^ permalink raw reply
* Re: [Linux-fbdev-devel] Re: rotation.
From: Måns Rullgård @ 2003-01-08 11:25 UTC (permalink / raw)
To: Sven Luther
Cc: Geert Uytterhoeven, James Simmons, Linux Fbdev development list,
Linux Kernel Mailing List
In-Reply-To: <20030108104817.GA10165@iliana>
Sven Luther <luther@dpt-info.u-strasbg.fr> writes:
> > > I'm about to implement rotation which is needed for devices like the ipaq.
> > > The question is do we flip the xres and yres values depending on the
> > > rotation or do we just alter the data that will be drawn to make the
> > > screen appear to rotate. How does hardware rotate view the x and y axis?
> > > Are they rotated or does just the data get rotated?
> >
> > Where are you going to implement the rotation? At the fbcon or fbdev level?
> >
> > Fbcon has the advantage that it'll work for all frame buffer devices.
>
> But you could also provide driver hooks for the chips which have such a
> rotation feature included (don't know if such exist, but i suppose they
> do, or may in the future).
I heard of someone have problems with the display getting rotated in
Windows. I don't know what chip it was.
--
Måns Rullgård
mru@users.sf.net
^ permalink raw reply
* Re: Fwd: File system corruption
From: Paul @ 2003-01-08 11:35 UTC (permalink / raw)
To: linux-kernel; +Cc: Rogier Wolff
In-Reply-To: <20030107130832.A4953@bitwizard.nl>
Roger,
Thanks for the programme Roger!
I'm not sure if I did this right but.....
I ran the programme as follows: (I called it sandisktest :)
# ./sandisktest -b | dd of=/dev/hdc
then I dd'd the image of the flash disk to my local disk and viewed the file
through midnight commander.
What I have found is that just after the start of a sector, usually 43 to 45
bytes, 6 bytes are skipped and the sequence starts again. This continues
until the next sector starts, where the sequence corrects. This appears to
happen every 65536 bytes or some multiple of 65536. It may skip three blocks
of 65536 and then corrupt on the next block of 65536 bytes.
I would greatly appreciate some other ideas to try, I'm not game to start
hacking the kernel code quite yet :)
Paul.
BTW: I also tried a EXT2 FS and it corrupted files just as the FAT16
filesystem had.
On Tue, 7 Jan 2003 10:08 pm, Rogier Wolff wrote:
> On Mon, Jan 06, 2003 at 03:06:20PM +0000, Alan Cox wrote:
> > Might be interesting to see what it does given a totally not FAT
> > environment (eg fill the disk start to end with each sector filled
> > with its sector number repeatedly) and see what comes out the other
> > end.
>
> How about the following program to do this.
>
> Roger.
>
>
> /* Written By R.E.Wolff@BitWizard.nl
> *
> * This program is distributed under GPL. */
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <unistd.h>
> #include <string.h>
>
> int main (int argc, char **argv)
> {
> int i;
> int ascii = 0;
> int size = 512;
> long long secno;
> char *buf;
> int s;
>
> for (i=1;i<argc;i++) {
> if (strcmp (argv[i], "-a") == 0) {
> ascii = 1;
> }
> if (strcmp (argv[i], "-b") == 0) {
> ascii = 0;
> }
>
> if (strncmp (argv[i], "-s", 2) == 0) {
> if (strlen (argv[i]) > 2)
> size = atoi (argv[i]+2);
> else
> /* Sorry. Will crash if you specify -s as the last argument */
> size = atoi (argv[++i]);
> }
> }
>
> buf = malloc (size + 16);
>
> if (!buf) {
> fprintf (stderr, "Can't allocate buffer.\n");
> exit (1);
> }
>
> secno = 0;
> while (1) {
> if (ascii) {
> sprintf (buf, "%lld\n", secno);
> s = strlen (buf);
> for (i=s;i<size;i+=s)
> sprintf (buf+i, "%lld\n", secno);
> } else {
> for (i=0;i<size;i+=sizeof (long long))
> *(long long *)(buf+i) = secno;
> }
> if (write (1, buf, size) < 0)
> break;
> secno++;
> }
> exit (0);
> }
^ permalink raw reply
* [LARTC] BW trottle follow up.
From: Jesper Kold-Hansen @ 2003-01-08 11:15 UTC (permalink / raw)
To: lartc
I have seen and resived a few messages where ppl want to know what my
script looks like and routing tables look like.
Well it should be said that the connection refused problems, accures
BEFORE i run the script also. Therefore it must be either a kernel problem
when it get's patched, or something the kernel does og set in eg. the
routing tables.
But I garantee that it is not the script.
Btw. I have also tryed with a 2.4.20 (no patched) kernel. Same problem.
Candyman
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply
* Re: OT Naming. was: Re: Why is Nvidia given GPL'd code to use in closed source drivers?
From: Hacksaw @ 2003-01-08 11:23 UTC (permalink / raw)
To: Nils Petter Vaskinn; +Cc: rms, linux-kernel@vger.kernel.org
In-Reply-To: <1042016680.1714.16.camel@station3>
>The "GNU/Linux" vs "Linux" argument is a political one, not a practical
>one, don't try to disguise it.
I used to agree with this, and as far as politics, I do. However, a practical
reason to call it GNU/Linux just occurred to me: the ABI.
Linux is a kernel. It runs on a variety of platforms. You certainly must
differentiate between a program for Linux on StrongARM and one for Linux on
x86. To use a kernel one makes calls into it via a system call mechanism. In
the case of the vast majority of Linux installations, that is done via glibc.
Not for kicks is that 'g' there.
A system with a linux kernel using a different API will likely have a
different ABI for it's programs.
This will need to be accounted for at some point. Forget all the tools for the
moment, and just think about what makes the program ABI.
Is there any vendor out there now who's shipping something other than glibc
with their Linux distribution? I bet there is someone, probably in the
embedded market.
Of course, I bow to human nature. People will continue to make references to
Linux meaning the OS, and never mention the qualifiers, until it becomes an
issue.
Here's to looking forward to the day when it does. :-)
--
We begin again, constantly.
http://www.hacksaw.org -- http://www.privatecircus.com -- KB1FVD
^ permalink raw reply
* [patch] add v4l1-compat module.
From: Gerd Knorr @ 2003-01-08 11:22 UTC (permalink / raw)
To: Linus Torvalds, Kernel List
Hi,
This patch adds the v4l1-compat module. This is a module which can
translate most (old) v4l1 ioctls into the new v4l2 API. This makes it
easier for v4l2 drivers to present both old v4l and new v4l2 APIs to
video4linux applications. The saa7134 driver uses this for example.
Gerd
--- linux-2.5.54/drivers/media/video/Makefile 2003-01-08 10:59:58.000000000 +0100
+++ linux/drivers/media/video/Makefile 2003-01-08 10:59:58.000000000 +0100
@@ -5,14 +5,14 @@
# All of the (potential) objects that export symbols.
# This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'.
-export-objs := videodev.o v4l2-common.o \
+export-objs := videodev.o v4l2-common.o v4l1-compat.o \
bttv-if.o cpia.o video-buf.o
bttv-objs := bttv-driver.o bttv-cards.o bttv-if.o \
bttv-risc.o bttv-vbi.o
zoran-objs := zr36120.o zr36120_i2c.o zr36120_mem.o
-obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-common.o
+obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-common.o v4l1-compat.o
obj-$(CONFIG_VIDEO_BT848) += bttv.o msp3400.o tvaudio.o \
tda7432.o tda9875.o tuner.o video-buf.o tda9887.o
--- linux-2.5.54/drivers/media/video/v4l1-compat.c 2003-01-08 10:59:58.000000000 +0100
+++ linux/drivers/media/video/v4l1-compat.c 2003-01-08 10:59:58.000000000 +0100
@@ -0,0 +1,1010 @@
+/*
+ * Video for Linux Two
+ * Backward Compatibility Layer
+ *
+ * Support subroutines for providing V4L2 drivers with backward
+ * compatibility with applications using the old API.
+ *
+ * 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.
+ *
+ * Author: Bill Dirks <bdirks@pacbell.net>
+ * et al.
+ *
+ */
+
+#ifndef __KERNEL__
+#define __KERNEL__
+#endif
+
+#include <linux/config.h>
+
+#include <linux/version.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/smp_lock.h>
+#include <linux/mm.h>
+#include <linux/fs.h>
+#include <linux/file.h>
+#include <linux/string.h>
+#include <linux/errno.h>
+#include <linux/slab.h>
+#include <linux/videodev.h>
+
+#include <asm/uaccess.h>
+#include <asm/system.h>
+#include <asm/pgtable.h>
+
+#ifdef CONFIG_KMOD
+#include <linux/kmod.h>
+#endif
+
+static unsigned int debug = 0;
+MODULE_PARM(debug,"i");
+MODULE_PARM_DESC(debug,"enable debug messages");
+MODULE_AUTHOR("Bill Dirks");
+MODULE_DESCRIPTION("v4l(1) compatibility layer for v4l2 drivers.");
+MODULE_LICENSE("GPL");
+
+#define dprintk(fmt, arg...) if (debug) \
+ printk(KERN_DEBUG "v4l1-compat: " fmt, ## arg)
+
+/*
+ * I O C T L T R A N S L A T I O N
+ *
+ * From here on down is the code for translating the numerous
+ * ioctl commands from the old API to the new API.
+ */
+
+static int
+get_v4l_control(struct inode *inode,
+ struct file *file,
+ int cid,
+ v4l2_kioctl drv)
+{
+ struct v4l2_queryctrl qctrl2;
+ struct v4l2_control ctrl2;
+ int err;
+
+ qctrl2.id = cid;
+ err = drv(inode, file, VIDIOC_QUERYCTRL, &qctrl2);
+ if (err < 0)
+ dprintk("VIDIOC_QUERYCTRL: %d\n",err);
+ if (err == 0 &&
+ !(qctrl2.flags & V4L2_CTRL_FLAG_DISABLED))
+ {
+ ctrl2.id = qctrl2.id;
+ err = drv(inode, file, VIDIOC_G_CTRL, &ctrl2);
+ if (err < 0)
+ dprintk("VIDIOC_G_CTRL: %d\n",err);
+ return ((ctrl2.value - qctrl2.minimum) * 65535
+ + (qctrl2.maximum - qctrl2.minimum) / 2)
+ / (qctrl2.maximum - qctrl2.minimum);
+ }
+ return 0;
+}
+
+static int
+set_v4l_control(struct inode *inode,
+ struct file *file,
+ int cid,
+ int value,
+ v4l2_kioctl drv)
+{
+ struct v4l2_queryctrl qctrl2;
+ struct v4l2_control ctrl2;
+ int err;
+
+ qctrl2.id = cid;
+ err = drv(inode, file, VIDIOC_QUERYCTRL, &qctrl2);
+ if (err < 0)
+ dprintk("VIDIOC_QUERYCTRL: %d\n",err);
+ if (err == 0 &&
+ !(qctrl2.flags & V4L2_CTRL_FLAG_DISABLED) &&
+ !(qctrl2.flags & V4L2_CTRL_FLAG_GRABBED))
+ {
+ if (value < 0)
+ value = 0;
+ if (value > 65535)
+ value = 65535;
+ if (value && qctrl2.type == V4L2_CTRL_TYPE_BOOLEAN)
+ value = 65535;
+ ctrl2.id = qctrl2.id;
+ ctrl2.value =
+ (value * (qctrl2.maximum - qctrl2.minimum)
+ + 32767)
+ / 65535;
+ ctrl2.value += qctrl2.minimum;
+ err = drv(inode, file, VIDIOC_S_CTRL, &ctrl2);
+ if (err < 0)
+ dprintk("VIDIOC_S_CTRL: %d\n",err);
+ }
+ return 0;
+}
+
+static int palette2pixelformat[] = {
+ [VIDEO_PALETTE_GREY] = V4L2_PIX_FMT_GREY,
+ [VIDEO_PALETTE_RGB555] = V4L2_PIX_FMT_RGB555,
+ [VIDEO_PALETTE_RGB565] = V4L2_PIX_FMT_RGB565,
+ [VIDEO_PALETTE_RGB24] = V4L2_PIX_FMT_BGR24,
+ [VIDEO_PALETTE_RGB32] = V4L2_PIX_FMT_BGR32,
+ /* yuv packed pixel */
+ [VIDEO_PALETTE_YUYV] = V4L2_PIX_FMT_YUYV,
+ [VIDEO_PALETTE_YUV422] = V4L2_PIX_FMT_YUYV,
+ [VIDEO_PALETTE_UYVY] = V4L2_PIX_FMT_UYVY,
+ /* yuv planar */
+ [VIDEO_PALETTE_YUV410P] = V4L2_PIX_FMT_YUV410,
+ [VIDEO_PALETTE_YUV420] = V4L2_PIX_FMT_YUV420,
+ [VIDEO_PALETTE_YUV420P] = V4L2_PIX_FMT_YUV420,
+ [VIDEO_PALETTE_YUV411P] = V4L2_PIX_FMT_YUV411P,
+ [VIDEO_PALETTE_YUV422P] = V4L2_PIX_FMT_YUV422P,
+};
+
+static int
+palette_to_pixelformat(int palette)
+{
+ if (palette < sizeof(palette2pixelformat)/sizeof(int))
+ return palette2pixelformat[palette];
+ else
+ return 0;
+}
+
+static int
+pixelformat_to_palette(int pixelformat)
+{
+ int palette = 0;
+ switch (pixelformat)
+ {
+ case V4L2_PIX_FMT_GREY:
+ palette = VIDEO_PALETTE_GREY;
+ break;
+ case V4L2_PIX_FMT_RGB555:
+ palette = VIDEO_PALETTE_RGB555;
+ break;
+ case V4L2_PIX_FMT_RGB565:
+ palette = VIDEO_PALETTE_RGB565;
+ break;
+ case V4L2_PIX_FMT_BGR24:
+ palette = VIDEO_PALETTE_RGB24;
+ break;
+ case V4L2_PIX_FMT_BGR32:
+ palette = VIDEO_PALETTE_RGB32;
+ break;
+ /* yuv packed pixel */
+ case V4L2_PIX_FMT_YUYV:
+ palette = VIDEO_PALETTE_YUYV;
+ break;
+ case V4L2_PIX_FMT_UYVY:
+ palette = VIDEO_PALETTE_UYVY;
+ break;
+ /* yuv planar */
+ case V4L2_PIX_FMT_YUV410:
+ palette = VIDEO_PALETTE_YUV420;
+ break;
+ case V4L2_PIX_FMT_YUV420:
+ palette = VIDEO_PALETTE_YUV420;
+ break;
+ case V4L2_PIX_FMT_YUV411P:
+ palette = VIDEO_PALETTE_YUV411P;
+ break;
+ case V4L2_PIX_FMT_YUV422P:
+ palette = VIDEO_PALETTE_YUV422P;
+ break;
+ }
+ return palette;
+}
+
+/* Do an 'in' (wait for input) select on a single file descriptor */
+/* This stuff plaigarized from linux/fs/select.c */
+#define __FD_IN(fds, n) (fds->in + n)
+#define BIT(i) (1UL << ((i)&(__NFDBITS-1)))
+#define SET(i,m) (*(m) |= (i))
+extern int do_select(int n, fd_set_bits *fds, long *timeout);
+
+
+static int
+simple_select(struct file *file)
+{
+ fd_set_bits fds;
+ char *bits;
+ long timeout;
+ int i, fd, n, ret, size;
+
+ for (i = 0; i < current->files->max_fds; ++i)
+ if (file == current->files->fd[i])
+ break;
+ if (i == current->files->max_fds)
+ return -EINVAL;
+ fd = i;
+ n = fd + 1;
+
+ timeout = MAX_SCHEDULE_TIMEOUT;
+ /*
+ * We need 6 bitmaps (in/out/ex for both incoming and outgoing),
+ * since we used fdset we need to allocate memory in units of
+ * long-words.
+ */
+ ret = -ENOMEM;
+ size = FDS_BYTES(n);
+ bits = kmalloc(6 * size, GFP_KERNEL);
+ if (!bits)
+ goto out_nofds;
+ fds.in = (unsigned long *) bits;
+ fds.out = (unsigned long *) (bits + size);
+ fds.ex = (unsigned long *) (bits + 2*size);
+ fds.res_in = (unsigned long *) (bits + 3*size);
+ fds.res_out = (unsigned long *) (bits + 4*size);
+ fds.res_ex = (unsigned long *) (bits + 5*size);
+
+ /* All zero except our one file descriptor bit, for input */
+ memset(bits, 0, 6 * size);
+ SET(BIT(fd), __FD_IN((&fds), fd / __NFDBITS));
+
+ ret = do_select(n, &fds, &timeout);
+
+ if (ret < 0)
+ goto out;
+ if (!ret) {
+ ret = -ERESTARTNOHAND;
+ if (signal_pending(current))
+ goto out;
+ ret = 0;
+ }
+out:
+ kfree(bits);
+out_nofds:
+ return ret;
+}
+
+static int count_inputs(struct inode *inode,
+ struct file *file,
+ v4l2_kioctl drv)
+{
+ struct v4l2_input input2;
+ int i;
+
+ for (i = 0;; i++) {
+ memset(&input2,0,sizeof(input2));
+ input2.index = i;
+ if (0 != drv(inode,file,VIDIOC_ENUMINPUT, &input2))
+ break;
+ }
+ return i;
+}
+
+static int check_size(struct inode *inode,
+ struct file *file,
+ v4l2_kioctl drv,
+ int *maxw, int *maxh)
+{
+ struct v4l2_fmtdesc desc2;
+ struct v4l2_format fmt2;
+
+ memset(&desc2,0,sizeof(desc2));
+ memset(&fmt2,0,sizeof(fmt2));
+
+ desc2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ if (0 != drv(inode,file,VIDIOC_ENUM_FMT, &desc2))
+ goto done;
+
+ fmt2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ fmt2.fmt.pix.width = 10000;
+ fmt2.fmt.pix.height = 10000;
+ fmt2.fmt.pix.pixelformat = desc2.pixelformat;
+ if (0 != drv(inode,file,VIDIOC_TRY_FMT, &fmt2))
+ goto done;
+
+ *maxw = fmt2.fmt.pix.width;
+ *maxh = fmt2.fmt.pix.height;
+
+ done:
+ return 0;
+}
+
+
+/*
+ * This function is exported.
+ */
+int
+v4l_compat_translate_ioctl(struct inode *inode,
+ struct file *file,
+ int cmd,
+ void *arg,
+ v4l2_kioctl drv)
+{
+ int err = -ENOIOCTLCMD;
+
+ switch (cmd)
+ {
+ case VIDIOCGCAP: /* capability */
+ {
+ struct video_capability *cap = arg;
+ struct v4l2_capability cap2;
+ struct v4l2_framebuffer fbuf2;
+
+ memset(cap, 0, sizeof(*cap));
+ memset(&cap2, 0, sizeof(cap2));
+ memset(&fbuf2, 0, sizeof(fbuf2));
+
+ err = drv(inode, file, VIDIOC_QUERYCAP, &cap2);
+ if (err < 0) {
+ dprintk("VIDIOCGCAP / VIDIOC_QUERYCAP: %d\n",err);
+ break;
+ }
+ if (cap2.capabilities & V4L2_CAP_VIDEO_OVERLAY) {
+ err = drv(inode, file, VIDIOC_G_FBUF, &fbuf2);
+ if (err < 0) {
+ dprintk("VIDIOCGCAP / VIDIOC_G_FBUF: %d\n",err);
+ memset(&fbuf2, 0, sizeof(fbuf2));
+ }
+ err = 0;
+ }
+
+ memcpy(cap->name, cap2.card,
+ min(sizeof(cap->name), sizeof(cap2.card)));
+ cap->name[sizeof(cap->name) - 1] = 0;
+ if (cap2.capabilities & V4L2_CAP_VIDEO_CAPTURE)
+ cap->type |= VID_TYPE_CAPTURE;
+ if (cap2.capabilities & V4L2_CAP_TUNER)
+ cap->type |= VID_TYPE_TUNER;
+ if (cap2.capabilities & V4L2_CAP_VBI_CAPTURE)
+ cap->type |= VID_TYPE_TELETEXT;
+ if (cap2.capabilities & V4L2_CAP_VIDEO_OVERLAY)
+ cap->type |= VID_TYPE_OVERLAY;
+ if (fbuf2.capability & V4L2_FBUF_CAP_LIST_CLIPPING)
+ cap->type |= VID_TYPE_CLIPPING;
+
+ cap->channels = count_inputs(inode,file,drv);
+ check_size(inode,file,drv,
+ &cap->maxwidth,&cap->maxheight);
+ cap->audios = 0; /* FIXME */
+ cap->minwidth = 48; /* FIXME */
+ cap->minheight = 32; /* FIXME */
+ break;
+ }
+ case VIDIOCGFBUF: /* get frame buffer */
+ {
+ struct video_buffer *buffer = arg;
+ struct v4l2_framebuffer fbuf2;
+
+ err = drv(inode, file, VIDIOC_G_FBUF, &fbuf2);
+ if (err < 0) {
+ dprintk("VIDIOCGFBUF / VIDIOC_G_FBUF: %d\n",err);
+ break;
+ }
+ buffer->base = fbuf2.base;
+ buffer->height = fbuf2.fmt.height;
+ buffer->width = fbuf2.fmt.width;
+
+ switch (fbuf2.fmt.pixelformat) {
+ case V4L2_PIX_FMT_RGB332:
+ buffer->depth = 8;
+ break;
+ case V4L2_PIX_FMT_RGB555:
+ buffer->depth = 15;
+ break;
+ case V4L2_PIX_FMT_RGB565:
+ buffer->depth = 16;
+ break;
+ case V4L2_PIX_FMT_BGR24:
+ buffer->depth = 24;
+ break;
+ case V4L2_PIX_FMT_BGR32:
+ buffer->depth = 32;
+ break;
+ default:
+ buffer->depth = 0;
+ }
+ if (0 != fbuf2.fmt.bytesperline)
+ buffer->bytesperline = fbuf2.fmt.bytesperline;
+ else {
+ buffer->bytesperline =
+ (buffer->width * buffer->depth + 7) & 7;
+ buffer->bytesperline >>= 3;
+ }
+ break;
+ }
+ case VIDIOCSFBUF: /* set frame buffer */
+ {
+ struct video_buffer *buffer = arg;
+ struct v4l2_framebuffer fbuf2;
+
+ memset(&fbuf2, 0, sizeof(fbuf2));
+ fbuf2.base = buffer->base;
+ fbuf2.fmt.height = buffer->height;
+ fbuf2.fmt.width = buffer->width;
+ switch (buffer->depth) {
+ case 8:
+ fbuf2.fmt.pixelformat = V4L2_PIX_FMT_RGB332;
+ break;
+ case 15:
+ fbuf2.fmt.pixelformat = V4L2_PIX_FMT_RGB555;
+ break;
+ case 16:
+ fbuf2.fmt.pixelformat = V4L2_PIX_FMT_RGB565;
+ break;
+ case 24:
+ fbuf2.fmt.pixelformat = V4L2_PIX_FMT_BGR24;
+ break;
+ case 32:
+ fbuf2.fmt.pixelformat = V4L2_PIX_FMT_BGR32;
+ break;
+ }
+ fbuf2.fmt.bytesperline = buffer->bytesperline;
+ err = drv(inode, file, VIDIOC_S_FBUF, &fbuf2);
+ if (err < 0)
+ dprintk("VIDIOCSFBUF / VIDIOC_S_FBUF: %d\n",err);
+ break;
+ }
+ case VIDIOCGWIN: /* get window or capture dimensions */
+ {
+ struct video_window *win = arg;
+ struct v4l2_format fmt2;
+
+ memset(win,0,sizeof(*win));
+ memset(&fmt2,0,sizeof(fmt2));
+
+ fmt2.type = V4L2_BUF_TYPE_VIDEO_OVERLAY;
+ err = drv(inode, file, VIDIOC_G_FMT, &fmt2);
+ if (err < 0)
+ dprintk("VIDIOCGWIN / VIDIOC_G_WIN: %d\n",err);
+ if (err == 0) {
+ win->x = fmt2.fmt.win.w.left;
+ win->y = fmt2.fmt.win.w.top;
+ win->width = fmt2.fmt.win.w.width;
+ win->height = fmt2.fmt.win.w.height;
+ win->chromakey = fmt2.fmt.win.chromakey;
+ win->clips = NULL;
+ win->clipcount = 0;
+ break;
+ }
+
+ fmt2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ err = drv(inode, file, VIDIOC_G_FMT, &fmt2);
+ if (err < 0) {
+ dprintk("VIDIOCGWIN / VIDIOC_G_FMT: %d\n",err);
+ break;
+ }
+ win->x = 0;
+ win->y = 0;
+ win->width = fmt2.fmt.pix.width;
+ win->height = fmt2.fmt.pix.height;
+ win->chromakey = 0;
+ win->clips = NULL;
+ win->clipcount = 0;
+ break;
+ }
+ case VIDIOCSWIN: /* set window and/or capture dimensions */
+ {
+ struct video_window *win = arg;
+ struct v4l2_format fmt2;
+
+ memset(&fmt2,0,sizeof(fmt2));
+ fmt2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ err = drv(inode, file, VIDIOC_G_FMT, &fmt2);
+ if (err < 0)
+ dprintk("VIDIOCSWIN / VIDIOC_G_FMT: %d\n",err);
+ if (err == 0) {
+ fmt2.fmt.pix.width = win->width;
+ fmt2.fmt.pix.height = win->height;
+ fmt2.fmt.pix.field = V4L2_FIELD_ANY;
+ err = drv(inode, file, VIDIOC_S_FMT, &fmt2);
+ if (err < 0)
+ dprintk("VIDIOCSWIN / VIDIOC_S_FMT #1: %d\n",
+ err);
+ win->width = fmt2.fmt.pix.width;
+ win->height = fmt2.fmt.pix.height;
+ }
+
+ memset(&fmt2,0,sizeof(fmt2));
+ fmt2.type = V4L2_BUF_TYPE_VIDEO_OVERLAY;
+ fmt2.fmt.win.w.left = win->x;
+ fmt2.fmt.win.w.top = win->y;
+ fmt2.fmt.win.w.width = win->width;
+ fmt2.fmt.win.w.height = win->height;
+ fmt2.fmt.win.chromakey = win->chromakey;
+ fmt2.fmt.win.clips = (void *)win->clips;
+ fmt2.fmt.win.clipcount = win->clipcount;
+ err = drv(inode, file, VIDIOC_S_FMT, &fmt2);
+ if (err < 0)
+ dprintk("VIDIOCSWIN / VIDIOC_S_FMT #2: %d\n",err);
+ break;
+ }
+ case VIDIOCCAPTURE: /* turn on/off preview */
+ {
+ err = drv(inode, file, VIDIOC_OVERLAY, arg);
+ if (err < 0)
+ dprintk("VIDIOCCAPTURE / VIDIOC_PREVIEW: %d\n",err);
+ break;
+ }
+ case VIDIOCGCHAN: /* get input information */
+ {
+ struct video_channel *chan = arg;
+ struct v4l2_input input2;
+ v4l2_std_id sid;
+
+ memset(&input2,0,sizeof(input2));
+ input2.index = chan->channel;
+ err = drv(inode, file, VIDIOC_ENUMINPUT, &input2);
+ if (err < 0) {
+ dprintk("VIDIOCGCHAN / VIDIOC_ENUMINPUT: "
+ "channel=%d err=%d\n",chan->channel,err);
+ break;
+ }
+ chan->channel = input2.index;
+ memcpy(chan->name, input2.name,
+ min(sizeof(chan->name), sizeof(input2.name)));
+ chan->name[sizeof(chan->name) - 1] = 0;
+ chan->tuners = (input2.type == V4L2_INPUT_TYPE_TUNER) ? 1 : 0;
+ chan->flags = (chan->tuners) ? VIDEO_VC_TUNER : 0;
+ switch (input2.type) {
+ case V4L2_INPUT_TYPE_TUNER:
+ chan->type = VIDEO_TYPE_TV;
+ break;
+ default:
+ case V4L2_INPUT_TYPE_CAMERA:
+ chan->type = VIDEO_TYPE_CAMERA;
+ break;
+ }
+ chan->norm = 0;
+ err = drv(inode, file, VIDIOC_G_STD, &sid);
+ if (err < 0)
+ dprintk("VIDIOCGCHAN / VIDIOC_G_STD: %d\n",err);
+ if (err == 0) {
+ if (sid & V4L2_STD_PAL)
+ chan->norm = VIDEO_MODE_PAL;
+ if (sid & V4L2_STD_NTSC)
+ chan->norm = VIDEO_MODE_NTSC;
+ if (sid & V4L2_STD_SECAM)
+ chan->norm = VIDEO_MODE_SECAM;
+ }
+ break;
+ }
+ case VIDIOCSCHAN: /* set input */
+ {
+ struct video_channel *chan = arg;
+
+ err = drv(inode, file, VIDIOC_S_INPUT, &chan->channel);
+ if (err < 0)
+ dprintk("VIDIOCSCHAN / VIDIOC_S_INPUT: %d\n",err);
+ break;
+ }
+ case VIDIOCGPICT: /* get tone controls & partial capture format */
+ {
+ struct video_picture *pict = arg;
+ struct v4l2_format fmt2;
+
+ pict->brightness = get_v4l_control(inode, file,
+ V4L2_CID_BRIGHTNESS,drv);
+ pict->hue = get_v4l_control(inode, file,
+ V4L2_CID_HUE, drv);
+ pict->contrast = get_v4l_control(inode, file,
+ V4L2_CID_CONTRAST, drv);
+ pict->colour = get_v4l_control(inode, file,
+ V4L2_CID_SATURATION, drv);
+ pict->whiteness = get_v4l_control(inode, file,
+ V4L2_CID_WHITENESS, drv);
+
+ memset(&fmt2,0,sizeof(fmt2));
+ fmt2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ err = drv(inode, file, VIDIOC_G_FMT, &fmt2);
+ if (err < 0) {
+ dprintk("VIDIOCGPICT / VIDIOC_G_FMT: %d\n",err);
+ break;
+ }
+#if 0 /* FIXME */
+ pict->depth = fmt2.fmt.pix.depth;
+#endif
+ pict->palette = pixelformat_to_palette(
+ fmt2.fmt.pix.pixelformat);
+ break;
+ }
+ case VIDIOCSPICT: /* set tone controls & partial capture format */
+ {
+ struct video_picture *pict = arg;
+ struct v4l2_format fmt2;
+ struct v4l2_framebuffer fbuf2;
+
+ set_v4l_control(inode, file,
+ V4L2_CID_BRIGHTNESS, pict->brightness, drv);
+ set_v4l_control(inode, file,
+ V4L2_CID_HUE, pict->hue, drv);
+ set_v4l_control(inode, file,
+ V4L2_CID_CONTRAST, pict->contrast, drv);
+ set_v4l_control(inode, file,
+ V4L2_CID_SATURATION, pict->colour, drv);
+ set_v4l_control(inode, file,
+ V4L2_CID_WHITENESS, pict->whiteness, drv);
+
+ memset(&fmt2,0,sizeof(fmt2));
+ fmt2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ err = drv(inode, file, VIDIOC_G_FMT, &fmt2);
+ if (err < 0)
+ dprintk("VIDIOCSPICT / VIDIOC_G_FMT: %d\n",err);
+ if (fmt2.fmt.pix.pixelformat !=
+ palette_to_pixelformat(pict->palette)) {
+ fmt2.fmt.pix.pixelformat = palette_to_pixelformat(
+ pict->palette);
+ err = drv(inode, file, VIDIOC_S_FMT, &fmt2);
+ if (err < 0)
+ dprintk("VIDIOCSPICT / VIDIOC_S_FMT: %d\n",err);
+ }
+
+ err = drv(inode, file, VIDIOC_G_FBUF, &fbuf2);
+ if (err < 0)
+ dprintk("VIDIOCSPICT / VIDIOC_G_FBUF: %d\n",err);
+ if (fbuf2.fmt.pixelformat !=
+ palette_to_pixelformat(pict->palette)) {
+ fbuf2.fmt.pixelformat = palette_to_pixelformat(
+ pict->palette);
+ err = drv(inode, file, VIDIOC_S_FBUF, &fbuf2);
+ if (err < 0)
+ dprintk("VIDIOCSPICT / VIDIOC_S_FBUF: %d\n",err);
+ err = 0; /* likely fails for non-root */
+ }
+ break;
+ }
+ case VIDIOCGTUNER: /* get tuner information */
+ {
+ struct video_tuner *tun = arg;
+ struct v4l2_tuner tun2;
+ v4l2_std_id sid;
+
+ memset(&tun2,0,sizeof(tun2));
+ err = drv(inode, file, VIDIOC_G_TUNER, &tun2);
+ if (err < 0) {
+ dprintk("VIDIOCGTUNER / VIDIOC_G_TUNER: %d\n",err);
+ break;
+ }
+ memcpy(tun->name, tun2.name,
+ min(sizeof(tun->name), sizeof(tun2.name)));
+ tun->name[sizeof(tun->name) - 1] = 0;
+ tun->rangelow = tun2.rangelow;
+ tun->rangehigh = tun2.rangehigh;
+ tun->flags = 0;
+ tun->mode = VIDEO_MODE_AUTO;
+
+ err = drv(inode, file, VIDIOC_G_STD, &sid);
+ if (err < 0)
+ dprintk("VIDIOCGTUNER / VIDIOC_G_STD: %d\n",err);
+ if (err == 0) {
+ if (sid & V4L2_STD_PAL)
+ tun->mode = VIDEO_MODE_PAL;
+ if (sid & V4L2_STD_NTSC)
+ tun->mode = VIDEO_MODE_NTSC;
+ if (sid & V4L2_STD_SECAM)
+ tun->mode = VIDEO_MODE_SECAM;
+ }
+
+ if (tun2.capability & V4L2_TUNER_CAP_LOW)
+ tun->flags |= VIDEO_TUNER_LOW;
+ if (tun2.rxsubchans & V4L2_TUNER_SUB_STEREO)
+ tun->flags |= VIDEO_TUNER_STEREO_ON;
+ tun->signal = tun2.signal;
+ break;
+ }
+#if 0 /* FIXME */
+ case VIDIOCSTUNER: /* select a tuner input */
+ {
+ int i;
+
+ err = drv(inode, file, VIDIOC_S_INPUT, &i);
+ if (err < 0)
+ dprintk("VIDIOCSTUNER / VIDIOC_S_INPUT: %d\n",err);
+ break;
+ }
+#endif
+ case VIDIOCGFREQ: /* get frequency */
+ {
+ int *freq = arg;
+ struct v4l2_frequency freq2;
+
+ err = drv(inode, file, VIDIOC_G_FREQUENCY, &freq2);
+ if (err < 0)
+ dprintk("VIDIOCGFREQ / VIDIOC_G_FREQUENCY: %d\n",err);
+ if (0 == err)
+ *freq = freq2.frequency;
+ break;
+ }
+ case VIDIOCSFREQ: /* set frequency */
+ {
+ int *freq = arg;
+ struct v4l2_frequency freq2;
+
+ drv(inode, file, VIDIOC_G_FREQUENCY, &freq2);
+ freq2.frequency = *freq;
+ err = drv(inode, file, VIDIOC_S_FREQUENCY, &freq2);
+ if (err < 0)
+ dprintk("VIDIOCSFREQ / VIDIOC_S_FREQUENCY: %d\n",err);
+ break;
+ }
+ case VIDIOCGAUDIO: /* get audio properties/controls */
+ {
+ struct video_audio *aud = arg;
+ struct v4l2_audio aud2;
+ struct v4l2_queryctrl qctrl2;
+ struct v4l2_tuner tun2;
+ int v;
+
+ err = drv(inode, file, VIDIOC_G_AUDIO, &aud2);
+ if (err < 0) {
+ dprintk("VIDIOCGAUDIO / VIDIOC_G_AUDIO: %d\n",err);
+ break;
+ }
+ memcpy(aud->name, aud2.name,
+ min(sizeof(aud->name), sizeof(aud2.name)));
+ aud->name[sizeof(aud->name) - 1] = 0;
+ aud->audio = aud2.index;
+ aud->flags = 0;
+ v = get_v4l_control(inode, file, V4L2_CID_AUDIO_VOLUME, drv);
+ if (v >= 0)
+ {
+ aud->volume = v;
+ aud->flags |= VIDEO_AUDIO_VOLUME;
+ }
+ v = get_v4l_control(inode, file, V4L2_CID_AUDIO_BASS, drv);
+ if (v >= 0)
+ {
+ aud->bass = v;
+ aud->flags |= VIDEO_AUDIO_BASS;
+ }
+ v = get_v4l_control(inode, file, V4L2_CID_AUDIO_TREBLE, drv);
+ if (v >= 0)
+ {
+ aud->treble = v;
+ aud->flags |= VIDEO_AUDIO_TREBLE;
+ }
+ v = get_v4l_control(inode, file, V4L2_CID_AUDIO_BALANCE, drv);
+ if (v >= 0)
+ {
+ aud->balance = v;
+ aud->flags |= VIDEO_AUDIO_BALANCE;
+ }
+ v = get_v4l_control(inode, file, V4L2_CID_AUDIO_MUTE, drv);
+ if (v >= 0)
+ {
+ if (v)
+ aud->flags |= VIDEO_AUDIO_MUTE;
+ aud->flags |= VIDEO_AUDIO_MUTABLE;
+ }
+ aud->step = 1;
+ qctrl2.id = V4L2_CID_AUDIO_VOLUME;
+ if (drv(inode, file, VIDIOC_QUERYCTRL, &qctrl2) == 0 &&
+ !(qctrl2.flags & V4L2_CTRL_FLAG_DISABLED))
+ aud->step = qctrl2.step;
+ aud->mode = 0;
+ err = drv(inode, file, VIDIOC_G_TUNER, &tun2);
+ if (err < 0) {
+ dprintk("VIDIOCGAUDIO / VIDIOC_G_TUNER: %d\n",err);
+ err = 0;
+ break;
+ }
+ if (tun2.rxsubchans & V4L2_TUNER_SUB_LANG2)
+ aud->mode = VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
+ else if (tun2.rxsubchans & V4L2_TUNER_SUB_STEREO)
+ aud->mode = VIDEO_SOUND_STEREO;
+ else if (tun2.rxsubchans & V4L2_TUNER_SUB_MONO)
+ aud->mode = VIDEO_SOUND_MONO;
+ break;
+ }
+ case VIDIOCSAUDIO: /* set audio controls */
+ {
+ struct video_audio *aud = arg;
+ struct v4l2_audio aud2;
+ struct v4l2_tuner tun2;
+
+ memset(&aud2,0,sizeof(aud2));
+ memset(&tun2,0,sizeof(tun2));
+
+ aud2.index = aud->audio;
+ err = drv(inode, file, VIDIOC_S_AUDIO, &aud2);
+ if (err < 0) {
+ dprintk("VIDIOCSAUDIO / VIDIOC_S_AUDIO: %d\n",err);
+ break;
+ }
+
+ set_v4l_control(inode, file, V4L2_CID_AUDIO_VOLUME,
+ aud->volume, drv);
+ set_v4l_control(inode, file, V4L2_CID_AUDIO_BASS,
+ aud->bass, drv);
+ set_v4l_control(inode, file, V4L2_CID_AUDIO_TREBLE,
+ aud->treble, drv);
+ set_v4l_control(inode, file, V4L2_CID_AUDIO_BALANCE,
+ aud->balance, drv);
+ set_v4l_control(inode, file, V4L2_CID_AUDIO_MUTE,
+ !!(aud->flags & VIDEO_AUDIO_MUTE), drv);
+
+ err = drv(inode, file, VIDIOC_G_TUNER, &tun2);
+ if (err < 0)
+ dprintk("VIDIOCSAUDIO / VIDIOC_G_TUNER: %d\n",err);
+ if (err == 0) {
+ switch (aud->mode) {
+ default:
+ case VIDEO_SOUND_MONO:
+ case VIDEO_SOUND_LANG1:
+ tun2.audmode = V4L2_TUNER_MODE_MONO;
+ break;
+ case VIDEO_SOUND_STEREO:
+ tun2.audmode = V4L2_TUNER_MODE_STEREO;
+ break;
+ case VIDEO_SOUND_LANG2:
+ tun2.audmode = V4L2_TUNER_MODE_LANG2;
+ break;
+ }
+ err = drv(inode, file, VIDIOC_S_TUNER, &tun2);
+ if (err < 0)
+ dprintk("VIDIOCSAUDIO / VIDIOC_S_TUNER: %d\n",err);
+ }
+ err = 0;
+ break;
+ }
+#if 0
+ case VIDIOCGMBUF: /* get mmap parameters */
+ {
+ struct video_mbuf *mbuf = arg;
+ struct v4l2_requestbuffers reqbuf2;
+ struct v4l2_buffer buf2;
+ struct v4l2_format fmt2, fmt2o;
+ struct v4l2_capability cap2;
+ int i;
+
+ /* Set the format to maximum dimensions */
+ if ((err = drv(inode, file, VIDIOC_QUERYCAP, &cap2)) < 0)
+ break;
+ fmt2o.type = V4L2_BUF_TYPE_CAPTURE;
+ if ((err = drv(inode, file, VIDIOC_G_FMT, &fmt2o)) < 0)
+ break;
+ fmt2 = fmt2o;
+ fmt2.fmt.pix.width = cap2.maxwidth;
+ fmt2.fmt.pix.height = cap2.maxheight;
+ fmt2.fmt.pix.flags |= V4L2_FMT_FLAG_INTERLACED;
+ if ((err = drv(inode, file, VIDIOC_S_FMT, &fmt2)) < 0)
+ break;
+ reqbuf2.count = 2; /* v4l always used two buffers */
+ reqbuf2.type = V4L2_BUF_TYPE_CAPTURE | V4L2_BUF_REQ_CONTIG;
+ err = drv(inode, file, VIDIOC_REQBUFS, &reqbuf2);
+ if (err < 0 || reqbuf2.count < 2 || reqbuf2.type
+ != (V4L2_BUF_TYPE_CAPTURE | V4L2_BUF_REQ_CONTIG))
+ {/* Driver doesn't support v4l back-compatibility */
+ fmt2o.fmt.pix.flags |= V4L2_FMT_FLAG_INTERLACED;
+ drv(inode, file, VIDIOC_S_FMT, &fmt2o);
+ reqbuf2.count = 1;
+ reqbuf2.type = V4L2_BUF_TYPE_CAPTURE;
+ err = drv(inode, file, VIDIOC_REQBUFS, &reqbuf2);
+ if (err < 0)
+ {
+ err = -EINVAL;
+ break;
+ }
+ printk(KERN_INFO"V4L2: Device \"%s\" doesn't support"
+ " v4l memory mapping\n", vfl->name);
+ }
+ buf2.index = 0;
+ buf2.type = V4L2_BUF_TYPE_CAPTURE;
+ err = drv(inode, file, VIDIOC_QUERYBUF, &buf2);
+ mbuf->size = buf2.length * reqbuf2.count;
+ mbuf->frames = reqbuf2.count;
+ memset(mbuf->offsets, 0, sizeof(mbuf->offsets));
+ for (i = 0; i < mbuf->frames; ++i)
+ mbuf->offsets[i] = i * buf2.length;
+ break;
+ }
+#endif
+ case VIDIOCMCAPTURE: /* capture a frame */
+ {
+ struct video_mmap *mm = arg;
+ struct v4l2_buffer buf2;
+ struct v4l2_format fmt2;
+
+ memset(&buf2,0,sizeof(buf2));
+ memset(&fmt2,0,sizeof(fmt2));
+
+ fmt2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ err = drv(inode, file, VIDIOC_G_FMT, &fmt2);
+ if (err < 0) {
+ dprintk("VIDIOCMCAPTURE / VIDIOC_G_FMT: %d\n",err);
+ break;
+ }
+ if (mm->width != fmt2.fmt.pix.width ||
+ mm->height != fmt2.fmt.pix.height ||
+ palette_to_pixelformat(mm->format) !=
+ fmt2.fmt.pix.pixelformat)
+ {/* New capture format... */
+ fmt2.fmt.pix.width = mm->width;
+ fmt2.fmt.pix.height = mm->height;
+ fmt2.fmt.pix.pixelformat =
+ palette_to_pixelformat(mm->format);
+ fmt2.fmt.pix.field = V4L2_FIELD_ANY;
+ err = drv(inode, file, VIDIOC_S_FMT, &fmt2);
+ if (err < 0) {
+ dprintk("VIDIOCMCAPTURE / VIDIOC_S_FMT: %d\n",err);
+ break;
+ }
+ }
+ buf2.index = mm->frame;
+ buf2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ err = drv(inode, file, VIDIOC_QUERYBUF, &buf2);
+ if (err < 0) {
+ dprintk("VIDIOCMCAPTURE / VIDIOC_QUERYBUF: %d\n",err);
+ break;
+ }
+ err = drv(inode, file, VIDIOC_QBUF, &buf2);
+ if (err < 0) {
+ dprintk("VIDIOCMCAPTURE / VIDIOC_QBUF: %d\n",err);
+ break;
+ }
+ err = drv(inode, file, VIDIOC_STREAMON, &buf2.type);
+ if (err < 0)
+ dprintk("VIDIOCMCAPTURE / VIDIOC_STREAMON: %d\n",err);
+ break;
+ }
+ case VIDIOCSYNC: /* wait for a frame */
+ {
+ int *i = arg;
+ struct v4l2_buffer buf2;
+
+ buf2.index = *i;
+ buf2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ err = drv(inode, file, VIDIOC_QUERYBUF, &buf2);
+ if (err < 0) {
+ /* No such buffer */
+ dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n",err);
+ break;
+ }
+ if (!(buf2.flags & V4L2_BUF_FLAG_MAPPED)) {
+ /* Buffer is not mapped */
+ err = -EINVAL;
+ break;
+ }
+
+ /* Loop as long as the buffer is queued, but not done */
+ while ((buf2.flags &
+ (V4L2_BUF_FLAG_QUEUED | V4L2_BUF_FLAG_DONE))
+ == V4L2_BUF_FLAG_QUEUED)
+ {
+ err = simple_select(file);
+ if (err < 0 || /* error or sleep was interrupted */
+ err == 0) /* timeout? Shouldn't occur. */
+ break;
+ err = drv(inode, file, VIDIOC_QUERYBUF, &buf2);
+ if (err < 0)
+ dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n",err);
+ }
+ if (!(buf2.flags & V4L2_BUF_FLAG_DONE)) /* not done */
+ break;
+ do {
+ err = drv(inode, file, VIDIOC_DQBUF, &buf2);
+ if (err < 0)
+ dprintk("VIDIOCSYNC / VIDIOC_DQBUF: %d\n",err);
+ } while (err == 0 && buf2.index != *i);
+ break;
+ }
+ case VIDIOCGUNIT: /* get related device minors */
+ /* No translation */
+ break;
+ case VIDIOCGCAPTURE: /* */
+ /* No translation, yet... */
+ printk(KERN_INFO"v4l1-compat: VIDIOCGCAPTURE not implemented."
+ " Send patches to bdirks@pacbell.net :-)\n");
+ break;
+ case VIDIOCSCAPTURE: /* */
+ /* No translation, yet... */
+ printk(KERN_INFO"v4l1-compat: VIDIOCSCAPTURE not implemented."
+ " Send patches to bdirks@pacbell.net :-)\n");
+ break;
+ }
+ return err;
+}
+
+EXPORT_SYMBOL(v4l_compat_translate_ioctl);
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
--- linux-2.5.54/kernel/ksyms.c 2003-01-08 10:33:53.000000000 +0100
+++ linux/kernel/ksyms.c 2003-01-08 10:59:58.000000000 +0100
@@ -329,6 +329,7 @@
EXPORT_SYMBOL(deactivate_super);
EXPORT_SYMBOL(sget);
EXPORT_SYMBOL(set_anon_super);
+EXPORT_SYMBOL(do_select);
/* for stackable file systems (lofs, wrapfs, cryptfs, etc.) */
EXPORT_SYMBOL(default_llseek);
--
Weil die späten Diskussionen nicht mal mehr den Rotwein lohnen.
-- Wacholder in "Melanie"
^ permalink raw reply
* 2.4.21-pre2 peculiarity
From: Margit Schubert-While @ 2003-01-08 11:13 UTC (permalink / raw)
To: linux-kernel
My bad, RTFM. However another question :
13 __generic_copy_to_user 0.1566
10 __constant_c_and_count_memset 0.0781
16 __constant_memcpy 0.0620
I thought these guys are supposed to be inlined or ?
Margit
^ permalink raw reply
* Re: Honest does not pay here ...
From: Andre Hedrick @ 2003-01-08 11:05 UTC (permalink / raw)
To: venom; +Cc: Larry McVoy, Matthias Andree, linux-kernel
In-Reply-To: <Pine.LNX.4.43.0301081058320.28725-100000@cibs9.sns.it>
Luigi,
I have finally determined that nobody really gives a flying flip what you
do or what ship. Nobody cares.
I have made more noise than a jackass in tin barn.
Trying to grab the attention of peer developers.
There are binary modules out there left and right.
Many are dirty, many are okay, many do not give a rip.
I have seen and know of lots of them.
The really bad ones I laugh in the face of the vendor.
Then there are the really slick ones, which I suspect can spoof anything.
I have asked for people to object, and only one person really has.
I have pissed off everyone.
While searching for the exact line of where things are black and white.
Nobody cares enough to help clear the air.
Nobody cares to pursue any of the existing binary modules.
I just do not get it anymore.
I guess I will shutup and do whatever.
Maybe I will get sued maybe I will not.
Regards,
Andre Hedrick
LAD Storage Consulting Group
Sorry for buggy everyone.
Sorry for asking first, instead of just doing it with thumb on nose.
Sorry most that I never found an answer.
Guess I need to listen to a lawyer.
On Wed, 8 Jan 2003 venom@sns.it wrote:
>
> if I understand your point, a vendor could ask to the end user to apply a patch
> to the new kernels, so that modules infrastructure will be changed, and also non
> GPLed modules can create their own run queue.
>
>
> Yes, it is possible, because we are talking about open source (I mean a more
> generic definition instead of free-software, i.e. all the software that comes
> with source code). I would add, it's in the rules of the game.
> But developers for this patch have to be paid, and
> patch could create conflicts, and has to be maintained togheter with the
> binary only module (depends on costs).
>
> To say the truth, I do not even expect end users to care if the modules is
> running with its own kernel threads in his own run queue, or it is using the
> defaul queue.
>
> Anyway I found the runqueue concept, as it has been implemented, an
> equilibrate and factual solution to incentivate companies to GPL their code,
> and I was surprised that none (except a short allusion from you),
> in two threads took the opportunity to talk about a fact and a good point.
>
> Luigi Genoni
>
>
> On Tue, 7 Jan 2003, Andre Hedrick wrote:
>
> > Date: Tue, 7 Jan 2003 17:10:41 -0800 (PST)
> > From: Andre Hedrick <andre@linux-ide.org>
> > To: venom@sns.it
> > Cc: Larry McVoy <lm@bitmover.com>, Matthias Andree <matthias.andree@gmx.de>,
> > linux-kernel@vger.kernel.org
> > Subject: Re: Honest does not pay here ...
> >
> >
> > Luigi,
> >
> > You forgot one thing. None of us can control what the end user does.
> > If a vendor tells the enduser to alter the 2.5/2.6 kernel and recompile.
> > What are you going to do?
> >
> > Add a clause where the enduser can not change the source code or apply a
> > patch to do it for them?
> >
> > Funny, you lost your rights to do that w/ GPL, as did I.
> >
> > *sigh*
> >
> > Andre Hedrick
> > LAD Storage Consulting Group
> >
> > On Wed, 8 Jan 2003 venom@sns.it wrote:
> >
> > >
> > > well, I was forgetting to specify,
> > > queues are kernel threads, and that is quite
> > > optimum expecially on SMP systems.
> > > One big advantage is that conflicts possibilities are
> > > (should be) less than minimal.
> > >
> > > Luigi
> > >
> > > On Tue, 7 Jan 2003, Larry McVoy wrote:
> > >
> > > > Date: Tue, 7 Jan 2003 16:30:50 -0800
> > > > From: Larry McVoy <lm@bitmover.com>
> > > > To: venom@sns.it
> > > > Cc: Matthias Andree <matthias.andree@gmx.de>, linux-kernel@vger.kernel.org,
> > > > andre@linux-ide.org
> > > > Subject: Re: Honest does not pay here ...
> > > >
> > > >
> > > > > In very semplicistic words:
> > > > > In 2.5/2.6 kernels, non GPL modules have a big
> > > > > penalty, because they cannot create their own queue, but have to use a default
> > > > > one.
> > > >
> > > > I may be showing my ignorance here (won't be the first time) but this makes
> > > > me wonder if Linux could provide a way to do "user level drivers". I.e.,
> > > > drivers which ran in kernel mode but in the context of a process and had
> > > > to talk to the real kernel via pipes or whatever. It's a fair amount of
> > > > plumbing but could have the advantage of being a more stable interface
> > > > for the drivers.
> > > >
> > > > If you think about it, drivers are more or less open/close/read/write/ioctl.
> > > > They need kernel privileges to do their thing but don't need (and shouldn't
> > > > have) access to all the guts of the kernel.
> > > >
> > > > Can any well traveled driver people see this working or is it nuts?
> > > > --
> > > > ---
> > > > Larry McVoy lm at bitmover.com http://www.bitmover.com/lm
> > > >
> > >
> > > -
> > > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > > the body of a message to majordomo@vger.kernel.org
> > > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > > Please read the FAQ at http://www.tux.org/lkml/
> > >
> >
>
^ permalink raw reply
* Re: [PATCH][TRIVIAL] menuconfig color sanity
From: Marc-Christian Petersen @ 2003-01-08 11:05 UTC (permalink / raw)
To: linux-kernel; +Cc: jeff gerard
In-Reply-To: <20030108104714.GM268@gage.org>
On Wednesday 08 January 2003 11:47, jeff gerard wrote:
Hi Jeff,
> using yellow and green text with a "white" background in menuconfig works
> all right on console, but it looks like crap under xterm, rxvt, etc. no
> matter whose fault that is, the trivial patch below makes things more
> readable without any major change in appearance. applies to 2.4 and 2.5.
> now you can stop wondering about support for "lug and play", "mateur
> radio", and "elephony" in the linux kernel.
huh? I can see Plug and Play, Amateur Radio and Telephony very well also in a
XTERM etc. I don't know where you have any problems with those colors.
Prolly your xterm etc. are faulty ;)
ciao, Marc
^ permalink raw reply
* Re: iptables u32 match code for review/testing/...
From: Harald Welte @ 2003-01-08 10:56 UTC (permalink / raw)
To: Don Cohen; +Cc: netfilter-devel
In-Reply-To: <15899.51201.381520.438520@isis.cs3-inc.com>
[-- Attachment #1: Type: text/plain, Size: 3679 bytes --]
On Tue, Jan 07, 2003 at 10:41:05PM -0800, Don Cohen wrote:
> Harald Welte writes (two separate msgs):
> > /* *** What's this about?
> > Must fit inside union ipt_matchinfo: 16 bytes */
> What do you mean by this?
>
> That was a comment I found in one of the other match modules
> (which I used as a template for this one).
> I didn't understand it so I thought I better keep it and flag it.
> If you don't know what it's about I guess it's safe to discard it.
Hm. A recursive grep through the kernel doesn't find any occurrance of
'ipt_matchinfo' at all.
However, most userspace iptables plugins still contain a comment
referring to union ipt_matchinfo. I think this is a remnant of the very
early days of iptables [which I have missed]. I think it's safe to
forget about it.
> > /* *** any way to allow for an arbitrary number of elements?
> > for now I settle for a limit of 10 of each */
> no way. At least not with the current kernel/userspace interface :(
> Ok, then I'll leave it at 10x10x10 (perhaps a lot of overhead for
> a single match?)
It also means that every single rule containing the u32 match will
occupy smp_num_cpus*1000*sizeof(your structure) bytes of non-swappable
kernel memory.
> > I like the content (code/implementation/idea of having u32).
> > The only issue is that it doesn't really fit into the current iptables
> > architecture. Why?
> > - because it is a whole classification engine on it's own
> Why is this bad? I wrote it to do things I wanted to do but didn't
> see how. I think that's good. If it subsumes a few others that are
> out there, even better. (But it's almost certainly a lot slower than
> any more specialized match, so they're still useful.)
Sorry, I didn't make myself clear. if u32 is used the right way, it is
way better than lots of the static matches within iptables. However, it
is more like a replacement of the whole iptables packet matching engine,
than a plugin/extension to it. Making it a plugin/extension will
unfortunately become a sort-of clumsy approach. I don't blame or
critisize you... this is not an issue of implementation, but a
fundamental architectural problem.
> > - because it has an arbitrary [variable] amount of match data
> At the moment, a large fixed amount. I regard that as a fault of
> current iptables, though.
I totally agree. I said "it doesn't really fit into the current
iptables architecture".
> > > Was the indentation a problem? The tabs were all 8 spaces, but
> > > perhaps you want wider indentation?
> > no, but look at the structure definitions in your header file.
> Oops. The "no" above suggests that you don't mind the narrow
> indentation, in which case not only the .h file but the earlier
> versions of the .c files were ok except for the few misplaced }'s.
I really should work on the precision of my language, it seems.
the indentation was a problem, yes. no, I don't want wider indentation
than 8.
> But if you do want wide indentation (and don't mind >80 cols)
> then here you go:
yes. If you now would be as friendly to post it as a unified diff
against current patch-o-matic CVS, attached in MIME format? (And for
posting habits and/or coding style hints there are plenty of examples in
the list archives respectively CVS).
Thanks again.
--
- Harald Welte / laforge@gnumonks.org http://www.gnumonks.org/
============================================================================
"If this were a dictatorship, it'd be a heck of a lot easier, just so long
as I'm the dictator." -- George W. Bush Dec 18, 2000
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.